1 | import sortBy from './index'
|
2 |
|
3 |
|
4 | sortBy(['a', 'b', 'c']);
|
5 | sortBy([1, 2, 3]);
|
6 | sortBy([{name: 'claudio'}, {name: 'klaus'}]);
|
7 | sortBy([{name: 'claudio'}, {name: 'klaus'}], 'name');
|
8 | sortBy([
|
9 | {user: 'fabio', details: {city: "Milan", age: 34}},
|
10 | {user: 'max', details: {city: "Munich", age: 29}},
|
11 | {user: 'zacarias', details: {city: "Sao Paulo", age: 44}},
|
12 | ], function(o) {
|
13 | return o.details.age;
|
14 | });
|
15 |
|
16 |
|
17 |
|
18 | sortBy();
|
19 |
|
20 | sortBy({});
|
21 |
|
22 | sortBy({}, 'name');
|
23 |
|
24 | sortBy({}, function(){});
|
25 |
|
26 | sortBy([1, 2, 3], 1);
|
27 |
|
28 | sortBy([1, 2, 3], []);
|
29 |
|
30 | sortBy([1, 2, 3], {});
|