es-toolkit 1.17.0-dev.526 → 1.17.0-dev.528

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,34 @@
1
- const compareValues = (a, b, order) => {
2
- if ((a != null && b == null) || a < b) {
3
- return order === 'desc' ? 1 : -1;
1
+ function getPriority(a) {
2
+ if (typeof a === 'symbol') {
3
+ return 1;
4
+ }
5
+ if (a === null) {
6
+ return 2;
7
+ }
8
+ if (a === undefined) {
9
+ return 3;
4
10
  }
5
- if ((a == null && b != null) || a > b) {
6
- return order === 'desc' ? -1 : 1;
11
+ if (a !== a) {
12
+ return 4;
13
+ }
14
+ return 0;
15
+ }
16
+ const compareValues = (a, b, order) => {
17
+ if (a !== b) {
18
+ if (typeof a === 'string' && typeof b === 'string') {
19
+ return order === 'desc' ? b.localeCompare(a) : a.localeCompare(b);
20
+ }
21
+ const aPriority = getPriority(a);
22
+ const bPriority = getPriority(b);
23
+ if (aPriority === bPriority && aPriority === 0) {
24
+ if (a < b) {
25
+ return order === 'desc' ? 1 : -1;
26
+ }
27
+ if (a > b) {
28
+ return order === 'desc' ? -1 : 1;
29
+ }
30
+ }
31
+ return order === 'desc' ? bPriority - aPriority : aPriority - bPriority;
7
32
  }
8
33
  return 0;
9
34
  };
@@ -1,14 +1,14 @@
1
+ type Criterion<T> = ((item: T) => unknown) | PropertyKey | PropertyKey[] | null | undefined;
1
2
  /**
2
3
  * Sorts an array of objects based on multiple properties and their corresponding order directions.
3
4
  *
4
5
  * This function takes an array of objects, an array of criteria to sort by, and an array of order directions.
5
- * It returns the sorted array, ordering by each key according to its corresponding direction
6
- * ('asc' for ascending or 'desc' for descending). If values for a key are equal,string
7
- * it moves to the next key to determine the order.
6
+ * It returns the sorted array, ordering by each key according to its corresponding direction ('asc' for ascending or 'desc' for descending).
7
+ * If values for a key are equal, it moves to the next key to determine the order.
8
8
  *
9
9
  * @template T - The type of elements in the array.
10
10
  * @param { T[] | object | null | undefined} collection - The array of objects to be sorted.
11
- * @param {((item: T) => unknown) | PropertyKey | Array<((item: T) => unknown) | PropertyKey | PropertyKey[]>} criteria - An array of criteria (property names or property paths or custom key functions) to sort by.
11
+ * @param {Criterion<T> | Array<Criterion<T>>} criteria - An array of criteria (property names or property paths or custom key functions) to sort by.
12
12
  * @param {unknown | unknown[]} orders - An array of order directions ('asc' for ascending or 'desc' for descending).
13
13
  * @returns {T[]} - The sorted array.
14
14
  *
@@ -29,6 +29,6 @@
29
29
  * // { user: 'fred', age: 40 },
30
30
  * // ]
31
31
  */
32
- declare function orderBy<T>(collection: T[] | object | null | undefined, criteria?: ((item: T) => unknown) | PropertyKey | Array<((item: T) => unknown) | PropertyKey | PropertyKey[]>, orders?: unknown | unknown[]): T[];
32
+ declare function orderBy<T>(collection: T[] | object | number | null | undefined, criteria?: Criterion<T> | Array<Criterion<T>>, orders?: unknown | unknown[]): T[];
33
33
 
34
- export { orderBy };
34
+ export { type Criterion, orderBy };
@@ -1,14 +1,14 @@
1
+ type Criterion<T> = ((item: T) => unknown) | PropertyKey | PropertyKey[] | null | undefined;
1
2
  /**
2
3
  * Sorts an array of objects based on multiple properties and their corresponding order directions.
3
4
  *
4
5
  * This function takes an array of objects, an array of criteria to sort by, and an array of order directions.
5
- * It returns the sorted array, ordering by each key according to its corresponding direction
6
- * ('asc' for ascending or 'desc' for descending). If values for a key are equal,string
7
- * it moves to the next key to determine the order.
6
+ * It returns the sorted array, ordering by each key according to its corresponding direction ('asc' for ascending or 'desc' for descending).
7
+ * If values for a key are equal, it moves to the next key to determine the order.
8
8
  *
9
9
  * @template T - The type of elements in the array.
10
10
  * @param { T[] | object | null | undefined} collection - The array of objects to be sorted.
11
- * @param {((item: T) => unknown) | PropertyKey | Array<((item: T) => unknown) | PropertyKey | PropertyKey[]>} criteria - An array of criteria (property names or property paths or custom key functions) to sort by.
11
+ * @param {Criterion<T> | Array<Criterion<T>>} criteria - An array of criteria (property names or property paths or custom key functions) to sort by.
12
12
  * @param {unknown | unknown[]} orders - An array of order directions ('asc' for ascending or 'desc' for descending).
13
13
  * @returns {T[]} - The sorted array.
14
14
  *
@@ -29,6 +29,6 @@
29
29
  * // { user: 'fred', age: 40 },
30
30
  * // ]
31
31
  */
32
- declare function orderBy<T>(collection: T[] | object | null | undefined, criteria?: ((item: T) => unknown) | PropertyKey | Array<((item: T) => unknown) | PropertyKey | PropertyKey[]>, orders?: unknown | unknown[]): T[];
32
+ declare function orderBy<T>(collection: T[] | object | number | null | undefined, criteria?: Criterion<T> | Array<Criterion<T>>, orders?: unknown | unknown[]): T[];
33
33
 
34
- export { orderBy };
34
+ export { type Criterion, orderBy };
@@ -3,64 +3,72 @@ import { isKey } from '../_internal/isKey.mjs';
3
3
  import { toPath } from '../_internal/toPath.mjs';
4
4
 
5
5
  function orderBy(collection, criteria, orders) {
6
- if (collection == null) {
6
+ if (collection == null || typeof collection === 'number') {
7
7
  return [];
8
8
  }
9
- if (!Array.isArray(collection) && typeof collection === 'object') {
9
+ if (typeof collection === 'object' && !Array.isArray(collection)) {
10
10
  collection = Object.values(collection);
11
11
  }
12
12
  if (!Array.isArray(criteria)) {
13
- criteria = criteria == null ? [] : [criteria];
13
+ criteria = criteria == null ? [null] : [criteria];
14
14
  }
15
15
  if (!Array.isArray(orders)) {
16
16
  orders = orders == null ? [] : [orders];
17
17
  }
18
+ orders = orders.map(order => String(order));
18
19
  const getValueByNestedPath = (object, path) => {
19
20
  let target = object;
20
- for (let i = 0; i < path.length && target != null; i++) {
21
+ for (let i = 0; i < path.length && target != null; ++i) {
21
22
  target = target[path[i]];
22
23
  }
23
24
  return target;
24
25
  };
25
26
  const getValueByCriterion = (criterion, object) => {
26
- if (object == null) {
27
+ if (object == null || criterion == null) {
27
28
  return object;
28
29
  }
30
+ if (typeof criterion === 'object' && 'key' in criterion) {
31
+ if (Object.hasOwn(object, criterion.key)) {
32
+ return object[criterion.key];
33
+ }
34
+ return getValueByNestedPath(object, criterion.path);
35
+ }
29
36
  if (typeof criterion === 'function') {
30
37
  return criterion(object);
31
38
  }
32
39
  if (Array.isArray(criterion)) {
33
40
  return getValueByNestedPath(object, criterion);
34
41
  }
35
- if (typeof criterion !== 'object') {
42
+ if (typeof object === 'object') {
36
43
  return object[criterion];
37
44
  }
38
- if (Object.hasOwn(object, criterion.key)) {
39
- return object[criterion.key];
40
- }
41
- return getValueByNestedPath(object, criterion.path);
45
+ return object;
42
46
  };
43
47
  const preparedCriteria = criteria.map(criterion => {
44
48
  if (Array.isArray(criterion) && criterion.length === 1) {
45
49
  criterion = criterion[0];
46
50
  }
47
- if (typeof criterion === 'function' || Array.isArray(criterion) || isKey(criterion)) {
51
+ if (criterion == null || typeof criterion === 'function' || Array.isArray(criterion) || isKey(criterion)) {
48
52
  return criterion;
49
53
  }
50
54
  return { key: criterion, path: toPath(criterion) };
51
55
  });
52
- return collection.slice().sort((a, b) => {
53
- for (let i = 0; i < criteria.length; i++) {
54
- const order = String(orders[i]);
55
- const valueA = getValueByCriterion(preparedCriteria[i], a);
56
- const valueB = getValueByCriterion(preparedCriteria[i], b);
57
- const comparedResult = compareValues(valueA, valueB, order);
56
+ const preparedCollection = collection.map(item => ({
57
+ original: item,
58
+ criteria: preparedCriteria.map(criterion => getValueByCriterion(criterion, item)),
59
+ }));
60
+ return preparedCollection
61
+ .slice()
62
+ .sort((a, b) => {
63
+ for (let i = 0; i < preparedCriteria.length; i++) {
64
+ const comparedResult = compareValues(a.criteria[i], b.criteria[i], orders[i]);
58
65
  if (comparedResult !== 0) {
59
66
  return comparedResult;
60
67
  }
61
68
  }
62
69
  return 0;
63
- });
70
+ })
71
+ .map(item => item.original);
64
72
  }
65
73
 
66
74
  export { orderBy };
@@ -0,0 +1,34 @@
1
+ import { Criterion } from './orderBy.mjs';
2
+
3
+ /**
4
+ * Sorts an array of objects based on multiple properties and their corresponding order directions.
5
+ *
6
+ * This function takes an array of objects, an array of criteria to sort by.
7
+ * It returns the ascending sorted array, ordering by each key.
8
+ * If values for a key are equal, it moves to the next key to determine the order.
9
+ *
10
+ * @template T - The type of elements in the array.
11
+ * @param { T[] | object | null | undefined} collection - The array of objects to be sorted.
12
+ * @param {Criterion<T> | Array<Criterion<T>>} criteria - An array of criteria (property names or property paths or custom key functions) to sort by.
13
+ * @returns {T[]} - The ascending sorted array.
14
+ *
15
+ * @example
16
+ * // Sort an array of objects by 'user' in ascending order and 'age' in descending order.
17
+ * const users = [
18
+ * { user: 'fred', age: 48 },
19
+ * { user: 'barney', age: 34 },
20
+ * { user: 'fred', age: 40 },
21
+ * { user: 'barney', age: 36 },
22
+ * ];
23
+ * const result = sortBy(users, ['user', (item) => item.age])
24
+ * // result will be:
25
+ * // [
26
+ * // { user: 'barney', age: 34 },
27
+ * // { user: 'barney', age: 36 },
28
+ * // { user: 'fred', age: 40 },
29
+ * // { user: 'fred', age: 48 },
30
+ * // ]
31
+ */
32
+ declare function sortBy<T>(collection: T[] | object | number | null | undefined, criteria?: Criterion<T> | Array<Criterion<T>>): T[];
33
+
34
+ export { sortBy };
@@ -0,0 +1,34 @@
1
+ import { Criterion } from './orderBy.js';
2
+
3
+ /**
4
+ * Sorts an array of objects based on multiple properties and their corresponding order directions.
5
+ *
6
+ * This function takes an array of objects, an array of criteria to sort by.
7
+ * It returns the ascending sorted array, ordering by each key.
8
+ * If values for a key are equal, it moves to the next key to determine the order.
9
+ *
10
+ * @template T - The type of elements in the array.
11
+ * @param { T[] | object | null | undefined} collection - The array of objects to be sorted.
12
+ * @param {Criterion<T> | Array<Criterion<T>>} criteria - An array of criteria (property names or property paths or custom key functions) to sort by.
13
+ * @returns {T[]} - The ascending sorted array.
14
+ *
15
+ * @example
16
+ * // Sort an array of objects by 'user' in ascending order and 'age' in descending order.
17
+ * const users = [
18
+ * { user: 'fred', age: 48 },
19
+ * { user: 'barney', age: 34 },
20
+ * { user: 'fred', age: 40 },
21
+ * { user: 'barney', age: 36 },
22
+ * ];
23
+ * const result = sortBy(users, ['user', (item) => item.age])
24
+ * // result will be:
25
+ * // [
26
+ * // { user: 'barney', age: 34 },
27
+ * // { user: 'barney', age: 36 },
28
+ * // { user: 'fred', age: 40 },
29
+ * // { user: 'fred', age: 48 },
30
+ * // ]
31
+ */
32
+ declare function sortBy<T>(collection: T[] | object | number | null | undefined, criteria?: Criterion<T> | Array<Criterion<T>>): T[];
33
+
34
+ export { sortBy };
@@ -0,0 +1,7 @@
1
+ import { orderBy } from './orderBy.mjs';
2
+
3
+ function sortBy(collection, criteria) {
4
+ return orderBy(collection, criteria, ['asc']);
5
+ }
6
+
7
+ export { sortBy };
@@ -20,7 +20,6 @@ export { maxBy } from '../array/maxBy.mjs';
20
20
  export { minBy } from '../array/minBy.mjs';
21
21
  export { partition } from '../array/partition.mjs';
22
22
  export { pullAt } from '../array/pullAt.mjs';
23
- export { sortBy } from '../array/sortBy.mjs';
24
23
  export { sample } from '../array/sample.mjs';
25
24
  export { sampleSize } from '../array/sampleSize.mjs';
26
25
  export { shuffle } from '../array/shuffle.mjs';
@@ -115,6 +114,7 @@ export { flatten } from './array/flatten.mjs';
115
114
  export { flattenDeep } from './array/flattenDeep.mjs';
116
115
  export { flattenDepth } from './array/flattenDepth.mjs';
117
116
  export { orderBy } from './array/orderBy.mjs';
117
+ export { sortBy } from './array/sortBy.mjs';
118
118
  export { size } from './array/size.mjs';
119
119
  export { zipObjectDeep } from './array/zipObjectDeep.mjs';
120
120
  export { indexOf } from './array/indexOf.mjs';
@@ -20,7 +20,6 @@ export { maxBy } from '../array/maxBy.js';
20
20
  export { minBy } from '../array/minBy.js';
21
21
  export { partition } from '../array/partition.js';
22
22
  export { pullAt } from '../array/pullAt.js';
23
- export { sortBy } from '../array/sortBy.js';
24
23
  export { sample } from '../array/sample.js';
25
24
  export { sampleSize } from '../array/sampleSize.js';
26
25
  export { shuffle } from '../array/shuffle.js';
@@ -115,6 +114,7 @@ export { flatten } from './array/flatten.js';
115
114
  export { flattenDeep } from './array/flattenDeep.js';
116
115
  export { flattenDepth } from './array/flattenDepth.js';
117
116
  export { orderBy } from './array/orderBy.js';
117
+ export { sortBy } from './array/sortBy.js';
118
118
  export { size } from './array/size.js';
119
119
  export { zipObjectDeep } from './array/zipObjectDeep.js';
120
120
  export { indexOf } from './array/indexOf.js';
@@ -2,14 +2,14 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const array_index = require('../array/index.js');
5
+ const initial = require('../_chunk/initial-crEecP.js');
6
6
  const promise_index = require('../_chunk/index-BGZDR9.js');
7
7
  const rest$1 = require('../_chunk/rest-Bzm2XK.js');
8
8
  const math_index = require('../math/index.js');
9
9
  const randomInt = require('../_chunk/randomInt-CF7bZK.js');
10
- const toMerged = require('../_chunk/toMerged-BGwYW5.js');
11
- const isWeakSet$1 = require('../_chunk/isWeakSet-BRIIbG.js');
12
- const isTypedArray$1 = require('../_chunk/isTypedArray-BBEkFl.js');
10
+ const toMerged = require('../_chunk/toMerged-DN1PPP.js');
11
+ const isWeakSet$1 = require('../_chunk/isWeakSet-CogETi.js');
12
+ const isTypedArray$1 = require('../_chunk/isTypedArray-Dsrnb1.js');
13
13
  const string_index = require('../string/index.js');
14
14
 
15
15
  function chunk(arr, size = 1) {
@@ -17,17 +17,17 @@ function chunk(arr, size = 1) {
17
17
  if (size === 0) {
18
18
  return [];
19
19
  }
20
- return array_index.chunk(arr, size);
20
+ return initial.chunk(arr, size);
21
21
  }
22
22
 
23
23
  function concat(...values) {
24
- return array_index.flatten(values);
24
+ return initial.flatten(values);
25
25
  }
26
26
 
27
27
  function difference(arr, ...values) {
28
28
  const arr1 = arr;
29
- const arr2 = array_index.flatten(values);
30
- return array_index.difference(arr1, arr2);
29
+ const arr2 = initial.flatten(values);
30
+ return initial.difference(arr1, arr2);
31
31
  }
32
32
 
33
33
  function fill(array, value, start = 0, end = array.length) {
@@ -39,7 +39,7 @@ function fill(array, value, start = 0, end = array.length) {
39
39
  if (!end) {
40
40
  end = 0;
41
41
  }
42
- return array_index.fill(array, value, start, end);
42
+ return initial.fill(array, value, start, end);
43
43
  }
44
44
 
45
45
  const IS_PLAIN = /^\w*$/;
@@ -426,12 +426,37 @@ function flattenDepth(value, depth = 1) {
426
426
  return flatten(value, depth);
427
427
  }
428
428
 
429
- const compareValues = (a, b, order) => {
430
- if ((a != null && b == null) || a < b) {
431
- return order === 'desc' ? 1 : -1;
429
+ function getPriority(a) {
430
+ if (typeof a === 'symbol') {
431
+ return 1;
432
+ }
433
+ if (a === null) {
434
+ return 2;
435
+ }
436
+ if (a === undefined) {
437
+ return 3;
432
438
  }
433
- if ((a == null && b != null) || a > b) {
434
- return order === 'desc' ? -1 : 1;
439
+ if (a !== a) {
440
+ return 4;
441
+ }
442
+ return 0;
443
+ }
444
+ const compareValues = (a, b, order) => {
445
+ if (a !== b) {
446
+ if (typeof a === 'string' && typeof b === 'string') {
447
+ return order === 'desc' ? b.localeCompare(a) : a.localeCompare(b);
448
+ }
449
+ const aPriority = getPriority(a);
450
+ const bPriority = getPriority(b);
451
+ if (aPriority === bPriority && aPriority === 0) {
452
+ if (a < b) {
453
+ return order === 'desc' ? 1 : -1;
454
+ }
455
+ if (a > b) {
456
+ return order === 'desc' ? -1 : 1;
457
+ }
458
+ }
459
+ return order === 'desc' ? bPriority - aPriority : aPriority - bPriority;
435
460
  }
436
461
  return 0;
437
462
  };
@@ -450,64 +475,76 @@ function isKey(value, object) {
450
475
  }
451
476
 
452
477
  function orderBy(collection, criteria, orders) {
453
- if (collection == null) {
478
+ if (collection == null || typeof collection === 'number') {
454
479
  return [];
455
480
  }
456
- if (!Array.isArray(collection) && typeof collection === 'object') {
481
+ if (typeof collection === 'object' && !Array.isArray(collection)) {
457
482
  collection = Object.values(collection);
458
483
  }
459
484
  if (!Array.isArray(criteria)) {
460
- criteria = criteria == null ? [] : [criteria];
485
+ criteria = criteria == null ? [null] : [criteria];
461
486
  }
462
487
  if (!Array.isArray(orders)) {
463
488
  orders = orders == null ? [] : [orders];
464
489
  }
490
+ orders = orders.map(order => String(order));
465
491
  const getValueByNestedPath = (object, path) => {
466
492
  let target = object;
467
- for (let i = 0; i < path.length && target != null; i++) {
493
+ for (let i = 0; i < path.length && target != null; ++i) {
468
494
  target = target[path[i]];
469
495
  }
470
496
  return target;
471
497
  };
472
498
  const getValueByCriterion = (criterion, object) => {
473
- if (object == null) {
499
+ if (object == null || criterion == null) {
474
500
  return object;
475
501
  }
502
+ if (typeof criterion === 'object' && 'key' in criterion) {
503
+ if (Object.hasOwn(object, criterion.key)) {
504
+ return object[criterion.key];
505
+ }
506
+ return getValueByNestedPath(object, criterion.path);
507
+ }
476
508
  if (typeof criterion === 'function') {
477
509
  return criterion(object);
478
510
  }
479
511
  if (Array.isArray(criterion)) {
480
512
  return getValueByNestedPath(object, criterion);
481
513
  }
482
- if (typeof criterion !== 'object') {
514
+ if (typeof object === 'object') {
483
515
  return object[criterion];
484
516
  }
485
- if (Object.hasOwn(object, criterion.key)) {
486
- return object[criterion.key];
487
- }
488
- return getValueByNestedPath(object, criterion.path);
517
+ return object;
489
518
  };
490
519
  const preparedCriteria = criteria.map(criterion => {
491
520
  if (Array.isArray(criterion) && criterion.length === 1) {
492
521
  criterion = criterion[0];
493
522
  }
494
- if (typeof criterion === 'function' || Array.isArray(criterion) || isKey(criterion)) {
523
+ if (criterion == null || typeof criterion === 'function' || Array.isArray(criterion) || isKey(criterion)) {
495
524
  return criterion;
496
525
  }
497
526
  return { key: criterion, path: toPath(criterion) };
498
527
  });
499
- return collection.slice().sort((a, b) => {
500
- for (let i = 0; i < criteria.length; i++) {
501
- const order = String(orders[i]);
502
- const valueA = getValueByCriterion(preparedCriteria[i], a);
503
- const valueB = getValueByCriterion(preparedCriteria[i], b);
504
- const comparedResult = compareValues(valueA, valueB, order);
528
+ const preparedCollection = collection.map(item => ({
529
+ original: item,
530
+ criteria: preparedCriteria.map(criterion => getValueByCriterion(criterion, item)),
531
+ }));
532
+ return preparedCollection
533
+ .slice()
534
+ .sort((a, b) => {
535
+ for (let i = 0; i < preparedCriteria.length; i++) {
536
+ const comparedResult = compareValues(a.criteria[i], b.criteria[i], orders[i]);
505
537
  if (comparedResult !== 0) {
506
538
  return comparedResult;
507
539
  }
508
540
  }
509
541
  return 0;
510
- });
542
+ })
543
+ .map(item => item.original);
544
+ }
545
+
546
+ function sortBy(collection, criteria) {
547
+ return orderBy(collection, criteria, ['asc']);
511
548
  }
512
549
 
513
550
  function size(target) {
@@ -538,7 +575,7 @@ function set(obj, path, value) {
538
575
 
539
576
  function zipObjectDeep(keys, values) {
540
577
  const result = {};
541
- const zipped = array_index.zip(keys, values);
578
+ const zipped = initial.zip(keys, values);
542
579
  for (let i = 0; i < zipped.length; i++) {
543
580
  const [key, value] = zipped[i];
544
581
  if (key != null) {
@@ -844,58 +881,57 @@ function min(items = []) {
844
881
  return minElement;
845
882
  }
846
883
 
847
- exports.at = array_index.at;
848
- exports.compact = array_index.compact;
849
- exports.countBy = array_index.countBy;
850
- exports.differenceBy = array_index.differenceBy;
851
- exports.differenceWith = array_index.differenceWith;
852
- exports.drop = array_index.drop;
853
- exports.dropRight = array_index.dropRight;
854
- exports.dropRightWhile = array_index.dropRightWhile;
855
- exports.dropWhile = array_index.dropWhile;
856
- exports.first = array_index.head;
857
- exports.flatMap = array_index.flatMap;
858
- exports.flatMapDeep = array_index.flatMapDeep;
859
- exports.forEachRight = array_index.forEachRight;
860
- exports.groupBy = array_index.groupBy;
861
- exports.head = array_index.head;
862
- exports.initial = array_index.initial;
863
- exports.intersection = array_index.intersection;
864
- exports.intersectionBy = array_index.intersectionBy;
865
- exports.intersectionWith = array_index.intersectionWith;
866
- exports.isSubset = array_index.isSubset;
867
- exports.join = array_index.join;
868
- exports.keyBy = array_index.keyBy;
869
- exports.last = array_index.last;
870
- exports.maxBy = array_index.maxBy;
871
- exports.minBy = array_index.minBy;
872
- exports.partition = array_index.partition;
873
- exports.pullAt = array_index.pullAt;
874
- exports.sample = array_index.sample;
875
- exports.sampleSize = array_index.sampleSize;
876
- exports.shuffle = array_index.shuffle;
877
- exports.sortBy = array_index.sortBy;
878
- exports.tail = array_index.tail;
879
- exports.take = array_index.take;
880
- exports.takeRight = array_index.takeRight;
881
- exports.takeRightWhile = array_index.takeRightWhile;
882
- exports.takeWhile = array_index.takeWhile;
883
- exports.toFilled = array_index.toFilled;
884
- exports.union = array_index.union;
885
- exports.unionBy = array_index.unionBy;
886
- exports.unionWith = array_index.unionWith;
887
- exports.uniq = array_index.uniq;
888
- exports.uniqBy = array_index.uniqBy;
889
- exports.uniqWith = array_index.uniqWith;
890
- exports.unzip = array_index.unzip;
891
- exports.unzipWith = array_index.unzipWith;
892
- exports.without = array_index.without;
893
- exports.xor = array_index.xor;
894
- exports.xorBy = array_index.xorBy;
895
- exports.xorWith = array_index.xorWith;
896
- exports.zip = array_index.zip;
897
- exports.zipObject = array_index.zipObject;
898
- exports.zipWith = array_index.zipWith;
884
+ exports.at = initial.at;
885
+ exports.compact = initial.compact;
886
+ exports.countBy = initial.countBy;
887
+ exports.differenceBy = initial.differenceBy;
888
+ exports.differenceWith = initial.differenceWith;
889
+ exports.drop = initial.drop;
890
+ exports.dropRight = initial.dropRight;
891
+ exports.dropRightWhile = initial.dropRightWhile;
892
+ exports.dropWhile = initial.dropWhile;
893
+ exports.first = initial.head;
894
+ exports.flatMap = initial.flatMap;
895
+ exports.flatMapDeep = initial.flatMapDeep;
896
+ exports.forEachRight = initial.forEachRight;
897
+ exports.groupBy = initial.groupBy;
898
+ exports.head = initial.head;
899
+ exports.initial = initial.initial;
900
+ exports.intersection = initial.intersection;
901
+ exports.intersectionBy = initial.intersectionBy;
902
+ exports.intersectionWith = initial.intersectionWith;
903
+ exports.isSubset = initial.isSubset;
904
+ exports.join = initial.join;
905
+ exports.keyBy = initial.keyBy;
906
+ exports.last = initial.last;
907
+ exports.maxBy = initial.maxBy;
908
+ exports.minBy = initial.minBy;
909
+ exports.partition = initial.partition;
910
+ exports.pullAt = initial.pullAt;
911
+ exports.sample = initial.sample;
912
+ exports.sampleSize = initial.sampleSize;
913
+ exports.shuffle = initial.shuffle;
914
+ exports.tail = initial.tail;
915
+ exports.take = initial.take;
916
+ exports.takeRight = initial.takeRight;
917
+ exports.takeRightWhile = initial.takeRightWhile;
918
+ exports.takeWhile = initial.takeWhile;
919
+ exports.toFilled = initial.toFilled;
920
+ exports.union = initial.union;
921
+ exports.unionBy = initial.unionBy;
922
+ exports.unionWith = initial.unionWith;
923
+ exports.uniq = initial.uniq;
924
+ exports.uniqBy = initial.uniqBy;
925
+ exports.uniqWith = initial.uniqWith;
926
+ exports.unzip = initial.unzip;
927
+ exports.unzipWith = initial.unzipWith;
928
+ exports.without = initial.without;
929
+ exports.xor = initial.xor;
930
+ exports.xorBy = initial.xorBy;
931
+ exports.xorWith = initial.xorWith;
932
+ exports.zip = initial.zip;
933
+ exports.zipObject = initial.zipObject;
934
+ exports.zipWith = initial.zipWith;
899
935
  exports.AbortError = promise_index.AbortError;
900
936
  exports.TimeoutError = promise_index.TimeoutError;
901
937
  exports.delay = promise_index.delay;
@@ -996,6 +1032,7 @@ exports.repeat = repeat;
996
1032
  exports.rest = rest;
997
1033
  exports.set = set;
998
1034
  exports.size = size;
1035
+ exports.sortBy = sortBy;
999
1036
  exports.spread = spread;
1000
1037
  exports.startsWith = startsWith;
1001
1038
  exports.zipObjectDeep = zipObjectDeep;
@@ -20,7 +20,6 @@ export { maxBy } from '../array/maxBy.mjs';
20
20
  export { minBy } from '../array/minBy.mjs';
21
21
  export { partition } from '../array/partition.mjs';
22
22
  export { pullAt } from '../array/pullAt.mjs';
23
- export { sortBy } from '../array/sortBy.mjs';
24
23
  export { sample } from '../array/sample.mjs';
25
24
  export { sampleSize } from '../array/sampleSize.mjs';
26
25
  export { shuffle } from '../array/shuffle.mjs';
@@ -116,6 +115,7 @@ export { flatten } from './array/flatten.mjs';
116
115
  export { flattenDeep } from './array/flattenDeep.mjs';
117
116
  export { flattenDepth } from './array/flattenDepth.mjs';
118
117
  export { orderBy } from './array/orderBy.mjs';
118
+ export { sortBy } from './array/sortBy.mjs';
119
119
  export { size } from './array/size.mjs';
120
120
  export { zipObjectDeep } from './array/zipObjectDeep.mjs';
121
121
  export { indexOf } from './array/indexOf.mjs';