es-toolkit 1.15.1 → 1.16.0-dev.455
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.
- package/CHANGELOG.md +6 -0
- package/dist/_chunk/{initial-CBsbzo.js → initial-y0QrPY.js} +28 -0
- package/dist/_chunk/{isFunction-D0hq6d.js → isFunction-aCEz9d.js} +5 -7
- package/dist/_chunk/{isObjectLike-BeLCsr.js → toMerged-BGwYW5.js} +25 -0
- package/dist/_internal/compareValues.mjs +11 -0
- package/dist/array/index.d.mts +1 -0
- package/dist/array/index.d.ts +1 -0
- package/dist/array/index.js +3 -11
- package/dist/array/index.mjs +1 -0
- package/dist/array/orderBy.mjs +2 -9
- package/dist/array/sortBy.d.mts +35 -0
- package/dist/array/sortBy.d.ts +35 -0
- package/dist/array/sortBy.mjs +19 -0
- package/dist/browser.global.js +1 -1
- package/dist/browser.global.js.map +1 -1
- package/dist/compat/_internal/getSymbols.mjs +1 -2
- package/dist/compat/_internal/toKey.mjs +13 -0
- package/dist/compat/array/find.d.mts +122 -0
- package/dist/compat/array/find.d.ts +122 -0
- package/dist/compat/array/find.mjs +42 -0
- package/dist/compat/array/findIndex.d.mts +62 -0
- package/dist/compat/array/findIndex.d.ts +62 -0
- package/dist/compat/array/findIndex.mjs +26 -0
- package/dist/compat/array/indexOf.d.mts +21 -0
- package/dist/compat/array/indexOf.d.ts +21 -0
- package/dist/compat/array/indexOf.mjs +20 -0
- package/dist/compat/function/ary.d.mts +2 -1
- package/dist/compat/function/ary.d.ts +2 -1
- package/dist/compat/function/bind.d.mts +3 -1
- package/dist/compat/function/bind.d.ts +3 -1
- package/dist/compat/function/rest.d.mts +33 -0
- package/dist/compat/function/rest.d.ts +33 -0
- package/dist/compat/function/rest.mjs +11 -0
- package/dist/compat/index.d.mts +13 -0
- package/dist/compat/index.d.ts +13 -0
- package/dist/compat/index.js +413 -259
- package/dist/compat/index.mjs +13 -0
- package/dist/compat/object/get.mjs +2 -4
- package/dist/compat/object/has.d.mts +32 -0
- package/dist/compat/object/has.d.ts +32 -0
- package/dist/compat/object/has.mjs +34 -0
- package/dist/compat/object/merge.d.mts +1 -0
- package/dist/compat/object/merge.d.ts +1 -0
- package/dist/compat/object/mergeWith.d.mts +6 -0
- package/dist/compat/object/mergeWith.d.ts +6 -0
- package/dist/compat/object/mergeWith.mjs +0 -3
- package/dist/compat/object/set.mjs +1 -5
- package/dist/compat/predicate/isArrayLike.mjs +1 -2
- package/dist/compat/predicate/isString.d.mts +20 -0
- package/dist/compat/predicate/isString.d.ts +20 -0
- package/dist/compat/predicate/isString.mjs +13 -0
- package/dist/compat/predicate/matchesProperty.d.mts +28 -0
- package/dist/compat/predicate/matchesProperty.d.ts +28 -0
- package/dist/compat/predicate/matchesProperty.mjs +22 -0
- package/dist/compat/string/padEnd.d.mts +20 -0
- package/dist/compat/string/padEnd.d.ts +20 -0
- package/dist/compat/string/padEnd.mjs +5 -0
- package/dist/function/ary.d.mts +1 -1
- package/dist/function/ary.d.ts +1 -1
- package/dist/function/index.d.mts +4 -0
- package/dist/function/index.d.ts +4 -0
- package/dist/function/index.js +76 -0
- package/dist/function/index.mjs +4 -0
- package/dist/function/memoize.d.mts +87 -0
- package/dist/function/memoize.d.ts +87 -0
- package/dist/function/memoize.mjs +16 -0
- package/dist/function/partial.d.mts +33 -0
- package/dist/function/partial.d.ts +33 -0
- package/dist/function/partial.mjs +23 -0
- package/dist/function/partialRight.d.mts +33 -0
- package/dist/function/partialRight.d.ts +33 -0
- package/dist/function/partialRight.mjs +25 -0
- package/dist/function/rest.d.mts +33 -0
- package/dist/function/rest.d.ts +33 -0
- package/dist/function/rest.mjs +12 -0
- package/dist/function/unary.d.mts +1 -1
- package/dist/function/unary.d.ts +1 -1
- package/dist/index.d.mts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +21 -14
- package/dist/index.mjs +7 -0
- package/dist/object/index.d.mts +1 -0
- package/dist/object/index.d.ts +1 -0
- package/dist/object/index.js +14 -32
- package/dist/object/index.mjs +1 -0
- package/dist/object/toMerged.d.mts +45 -0
- package/dist/object/toMerged.d.ts +45 -0
- package/dist/object/toMerged.mjs +8 -0
- package/dist/predicate/index.d.mts +1 -0
- package/dist/predicate/index.d.ts +1 -0
- package/dist/predicate/index.js +6 -1
- package/dist/predicate/index.mjs +1 -0
- package/dist/predicate/isEqual.mjs +4 -5
- package/dist/predicate/isString.d.mts +20 -0
- package/dist/predicate/isString.d.ts +20 -0
- package/dist/predicate/isString.mjs +5 -0
- package/dist/string/camelCase.mjs +2 -2
- package/dist/string/index.js +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { rest as rest$1 } from '../../function/rest.mjs';
|
|
2
|
+
|
|
3
|
+
function rest(func, start = func.length - 1) {
|
|
4
|
+
start = Number.parseInt(start, 10);
|
|
5
|
+
if (Number.isNaN(start) || start < 0) {
|
|
6
|
+
start = func.length - 1;
|
|
7
|
+
}
|
|
8
|
+
return rest$1(func, start);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { rest };
|
package/dist/compat/index.d.mts
CHANGED
|
@@ -16,6 +16,7 @@ export { keyBy } from '../array/keyBy.mjs';
|
|
|
16
16
|
export { maxBy } from '../array/maxBy.mjs';
|
|
17
17
|
export { minBy } from '../array/minBy.mjs';
|
|
18
18
|
export { partition } from '../array/partition.mjs';
|
|
19
|
+
export { sortBy } from '../array/sortBy.mjs';
|
|
19
20
|
export { sample } from '../array/sample.mjs';
|
|
20
21
|
export { sampleSize } from '../array/sampleSize.mjs';
|
|
21
22
|
export { shuffle } from '../array/shuffle.mjs';
|
|
@@ -53,7 +54,10 @@ export { noop } from '../function/noop.mjs';
|
|
|
53
54
|
export { once } from '../function/once.mjs';
|
|
54
55
|
export { throttle } from '../function/throttle.mjs';
|
|
55
56
|
export { negate } from '../function/negate.mjs';
|
|
57
|
+
export { MemoizeCache, memoize } from '../function/memoize.mjs';
|
|
56
58
|
export { unary } from '../function/unary.mjs';
|
|
59
|
+
export { partial } from '../function/partial.mjs';
|
|
60
|
+
export { partialRight } from '../function/partialRight.mjs';
|
|
57
61
|
export { clamp } from '../math/clamp.mjs';
|
|
58
62
|
export { inRange } from '../math/inRange.mjs';
|
|
59
63
|
export { mean } from '../math/mean.mjs';
|
|
@@ -72,6 +76,7 @@ export { invert } from '../object/invert.mjs';
|
|
|
72
76
|
export { clone } from '../object/clone.mjs';
|
|
73
77
|
export { flattenObject } from '../object/flattenObject.mjs';
|
|
74
78
|
export { cloneDeep } from '../object/cloneDeep.mjs';
|
|
79
|
+
export { toMerged } from '../object/toMerged.mjs';
|
|
75
80
|
export { isEqual } from '../predicate/isEqual.mjs';
|
|
76
81
|
export { isNil } from '../predicate/isNil.mjs';
|
|
77
82
|
export { isNotNil } from '../predicate/isNotNil.mjs';
|
|
@@ -93,16 +98,21 @@ export { chunk } from './array/chunk.mjs';
|
|
|
93
98
|
export { concat } from './array/concat.mjs';
|
|
94
99
|
export { difference } from './array/difference.mjs';
|
|
95
100
|
export { fill } from './array/fill.mjs';
|
|
101
|
+
export { find } from './array/find.mjs';
|
|
102
|
+
export { findIndex } from './array/findIndex.mjs';
|
|
96
103
|
export { flatten } from './array/flatten.mjs';
|
|
97
104
|
export { flattenDeep } from './array/flattenDeep.mjs';
|
|
98
105
|
export { flattenDepth } from './array/flattenDepth.mjs';
|
|
99
106
|
export { orderBy } from './array/orderBy.mjs';
|
|
100
107
|
export { size } from './array/size.mjs';
|
|
101
108
|
export { zipObjectDeep } from './array/zipObjectDeep.mjs';
|
|
109
|
+
export { indexOf } from './array/indexOf.mjs';
|
|
102
110
|
export { ary } from './function/ary.mjs';
|
|
103
111
|
export { bind } from './function/bind.mjs';
|
|
112
|
+
export { rest } from './function/rest.mjs';
|
|
104
113
|
export { get } from './object/get.mjs';
|
|
105
114
|
export { set } from './object/set.mjs';
|
|
115
|
+
export { has } from './object/has.mjs';
|
|
106
116
|
export { property } from './object/property.mjs';
|
|
107
117
|
export { mapKeys } from './object/mapKeys.mjs';
|
|
108
118
|
export { mapValues } from './object/mapValues.mjs';
|
|
@@ -117,9 +127,12 @@ export { isObjectLike } from './predicate/isObjectLike.mjs';
|
|
|
117
127
|
export { isBoolean } from './predicate/isBoolean.mjs';
|
|
118
128
|
export { isTypedArray } from './predicate/isTypedArray.mjs';
|
|
119
129
|
export { isMatch } from './predicate/isMatch.mjs';
|
|
130
|
+
export { isString } from './predicate/isString.mjs';
|
|
120
131
|
export { matches } from './predicate/matches.mjs';
|
|
132
|
+
export { matchesProperty } from './predicate/matchesProperty.mjs';
|
|
121
133
|
export { startsWith } from './string/startsWith.mjs';
|
|
122
134
|
export { endsWith } from './string/endsWith.mjs';
|
|
123
135
|
export { padStart } from './string/padStart.mjs';
|
|
136
|
+
export { padEnd } from './string/padEnd.mjs';
|
|
124
137
|
export { max } from './math/max.mjs';
|
|
125
138
|
export { min } from './math/min.mjs';
|
package/dist/compat/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export { keyBy } from '../array/keyBy.js';
|
|
|
16
16
|
export { maxBy } from '../array/maxBy.js';
|
|
17
17
|
export { minBy } from '../array/minBy.js';
|
|
18
18
|
export { partition } from '../array/partition.js';
|
|
19
|
+
export { sortBy } from '../array/sortBy.js';
|
|
19
20
|
export { sample } from '../array/sample.js';
|
|
20
21
|
export { sampleSize } from '../array/sampleSize.js';
|
|
21
22
|
export { shuffle } from '../array/shuffle.js';
|
|
@@ -53,7 +54,10 @@ export { noop } from '../function/noop.js';
|
|
|
53
54
|
export { once } from '../function/once.js';
|
|
54
55
|
export { throttle } from '../function/throttle.js';
|
|
55
56
|
export { negate } from '../function/negate.js';
|
|
57
|
+
export { MemoizeCache, memoize } from '../function/memoize.js';
|
|
56
58
|
export { unary } from '../function/unary.js';
|
|
59
|
+
export { partial } from '../function/partial.js';
|
|
60
|
+
export { partialRight } from '../function/partialRight.js';
|
|
57
61
|
export { clamp } from '../math/clamp.js';
|
|
58
62
|
export { inRange } from '../math/inRange.js';
|
|
59
63
|
export { mean } from '../math/mean.js';
|
|
@@ -72,6 +76,7 @@ export { invert } from '../object/invert.js';
|
|
|
72
76
|
export { clone } from '../object/clone.js';
|
|
73
77
|
export { flattenObject } from '../object/flattenObject.js';
|
|
74
78
|
export { cloneDeep } from '../object/cloneDeep.js';
|
|
79
|
+
export { toMerged } from '../object/toMerged.js';
|
|
75
80
|
export { isEqual } from '../predicate/isEqual.js';
|
|
76
81
|
export { isNil } from '../predicate/isNil.js';
|
|
77
82
|
export { isNotNil } from '../predicate/isNotNil.js';
|
|
@@ -93,16 +98,21 @@ export { chunk } from './array/chunk.js';
|
|
|
93
98
|
export { concat } from './array/concat.js';
|
|
94
99
|
export { difference } from './array/difference.js';
|
|
95
100
|
export { fill } from './array/fill.js';
|
|
101
|
+
export { find } from './array/find.js';
|
|
102
|
+
export { findIndex } from './array/findIndex.js';
|
|
96
103
|
export { flatten } from './array/flatten.js';
|
|
97
104
|
export { flattenDeep } from './array/flattenDeep.js';
|
|
98
105
|
export { flattenDepth } from './array/flattenDepth.js';
|
|
99
106
|
export { orderBy } from './array/orderBy.js';
|
|
100
107
|
export { size } from './array/size.js';
|
|
101
108
|
export { zipObjectDeep } from './array/zipObjectDeep.js';
|
|
109
|
+
export { indexOf } from './array/indexOf.js';
|
|
102
110
|
export { ary } from './function/ary.js';
|
|
103
111
|
export { bind } from './function/bind.js';
|
|
112
|
+
export { rest } from './function/rest.js';
|
|
104
113
|
export { get } from './object/get.js';
|
|
105
114
|
export { set } from './object/set.js';
|
|
115
|
+
export { has } from './object/has.js';
|
|
106
116
|
export { property } from './object/property.js';
|
|
107
117
|
export { mapKeys } from './object/mapKeys.js';
|
|
108
118
|
export { mapValues } from './object/mapValues.js';
|
|
@@ -117,9 +127,12 @@ export { isObjectLike } from './predicate/isObjectLike.js';
|
|
|
117
127
|
export { isBoolean } from './predicate/isBoolean.js';
|
|
118
128
|
export { isTypedArray } from './predicate/isTypedArray.js';
|
|
119
129
|
export { isMatch } from './predicate/isMatch.js';
|
|
130
|
+
export { isString } from './predicate/isString.js';
|
|
120
131
|
export { matches } from './predicate/matches.js';
|
|
132
|
+
export { matchesProperty } from './predicate/matchesProperty.js';
|
|
121
133
|
export { startsWith } from './string/startsWith.js';
|
|
122
134
|
export { endsWith } from './string/endsWith.js';
|
|
123
135
|
export { padStart } from './string/padStart.js';
|
|
136
|
+
export { padEnd } from './string/padEnd.js';
|
|
124
137
|
export { max } from './math/max.js';
|
|
125
138
|
export { min } from './math/min.js';
|