Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on May 14, 2020. It is now read-only.

Commit eaab1d3

Browse files
Tweaks for previous PRs
1 parent 906cb65 commit eaab1d3

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

‎examples/src/App.js‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ const getValueLabelStyle = ({ style }, nodeType, keyPath) => ({
3838
const longString =
3939
'Loremipsumdolorsitamet,consecteturadipiscingelit.Namtempusipsumutfelisdignissimauctor.Maecenasodiolectus,finibusegetultricesvel,aliquamutelit.Loremipsumdolorsitamet,consecteturadipiscingelit.Namtempusipsumutfelisdignissimauctor.Maecenasodiolectus,finibusegetultricesvel,aliquamutelit.Loremipsumdolorsitamet,consecteturadipiscingelit.Namtempusipsumutfelisdignissimauctor.Maecenasodiolectus,finibusegetultricesvel,aliquamutelit.';
4040

41-
var Custom = function(value) { this.value = value; };
41+
const Custom = function(value) {
42+
this.value = value;
43+
};
4244
Custom.prototype[Symbol.toStringTag] = 'Custom';
4345

4446
const data = {
@@ -88,7 +90,7 @@ const data = {
8890
hugeArray: Array.from({ length: 10000 }).map((_, i) => `item #${i}`),
8991
customProfile: {
9092
avatar: new Custom('placehold.it/50x50'),
91-
name: new Custom('Name'),
93+
name: new Custom('Name')
9294
},
9395
longString
9496
};

‎src/getCollectionEntries.js‎

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,8 @@ function getEntries(type, collection, sortObjectKeys, from = 0, to = Infinity) {
1818
if (type === 'Object') {
1919
let keys = Object.getOwnPropertyNames(collection);
2020

21-
switch (typeof sortObjectKeys) {
22-
case 'boolean':
23-
keys.sort();
24-
break;
25-
case 'function':
26-
keys.sort(sortObjectKeys);
27-
break;
28-
default:
29-
// Do nothing
21+
if (sortObjectKeys) {
22+
keys.sort(sortObjectKeys === true ? undefined : sortObjectKeys);
3023
}
3124

3225
keys = keys.slice(from, to + 1);

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /