es-toolkit 1.35.0-dev.1202 → 1.35.0-dev.1206
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/dist/_chunk/{isPromise-ByAybB.js → isPromise-BqEEYJ.js} +126 -40
- package/dist/_chunk/{reverseString-D-wK2p.js → reverseString-BixeGz.js} +84 -13
- package/dist/_chunk/toSnakeCaseKeys-DCXJ3Q.js +4599 -0
- package/dist/_chunk/{unary-BsNWRM.js → unary-EIEhcF.js} +46 -0
- package/dist/_chunk/{zip-DxZJSH.js → zipWith-ChDTPy.js} +76 -0
- package/dist/array/index.js +57 -126
- package/dist/browser.global.js +1 -1
- package/dist/browser.global.js.map +1 -1
- package/dist/compat/compat.d.mts +301 -0
- package/dist/compat/compat.d.ts +301 -0
- package/dist/compat/compat.mjs +303 -0
- package/dist/compat/function/partial.d.mts +575 -0
- package/dist/compat/function/partial.d.ts +575 -0
- package/dist/compat/function/partial.mjs +8 -0
- package/dist/compat/function/partialRight.d.mts +651 -0
- package/dist/compat/function/partialRight.d.ts +651 -0
- package/dist/compat/function/partialRight.mjs +8 -0
- package/dist/compat/index.d.mts +10 -18
- package/dist/compat/index.d.ts +10 -18
- package/dist/compat/index.js +280 -4043
- package/dist/compat/index.mjs +12 -18
- package/dist/compat/toolkit.d.mts +9 -0
- package/dist/compat/toolkit.d.ts +9 -0
- package/dist/compat/toolkit.mjs +10 -0
- package/dist/function/index.js +3 -4
- package/dist/function/partial.d.mts +3 -3
- package/dist/function/partial.d.ts +3 -3
- package/dist/function/partial.mjs +17 -19
- package/dist/function/partialRight.d.mts +3 -3
- package/dist/function/partialRight.d.ts +3 -3
- package/dist/function/partialRight.mjs +18 -20
- package/dist/index.js +84 -87
- package/dist/object/index.js +15 -15
- package/dist/object/toCamelCaseKeys.mjs +3 -0
- package/dist/object/toSnakeCaseKeys.mjs +3 -0
- package/dist/predicate/index.js +4 -5
- package/dist/string/index.js +7 -8
- package/package.json +1 -1
- package/dist/_chunk/isPlainObject-Xaozpc.js +0 -93
- package/dist/_chunk/partialRight-B0_CSB.js +0 -50
- package/dist/_chunk/snakeCase-BtVEeB.js +0 -75
- package/dist/_chunk/toSnakeCaseKeys-BNpS71.js +0 -569
- package/dist/compat/_internal/copyArray.mjs +0 -12
- package/dist/compat/array/flatMap.d.mts +0 -20
- package/dist/compat/array/flatMap.d.ts +0 -20
- package/dist/compat/array/flatMap.mjs +0 -13
- package/dist/compat/array/forEachRight.d.mts +0 -106
- package/dist/compat/array/forEachRight.d.ts +0 -106
- package/dist/compat/array/forEachRight.mjs +0 -21
- package/dist/compat/array/partition.d.mts +0 -65
- package/dist/compat/array/partition.d.ts +0 -65
- package/dist/compat/array/partition.mjs +0 -24
- package/dist/compat/array/pullAllWith.d.mts +0 -59
- package/dist/compat/array/pullAllWith.d.ts +0 -59
- package/dist/compat/array/pullAllWith.mjs +0 -33
- package/dist/compat/array/pullAt.d.mts +0 -32
- package/dist/compat/array/pullAt.d.ts +0 -32
- package/dist/compat/array/pullAt.mjs +0 -34
- package/dist/compat/array/zipObject.d.mts +0 -49
- package/dist/compat/array/zipObject.d.ts +0 -49
- package/dist/compat/array/zipObject.mjs +0 -11
- package/dist/compat/array/zipWith.d.mts +0 -92
- package/dist/compat/array/zipWith.d.ts +0 -92
- package/dist/compat/array/zipWith.mjs +0 -20
- package/dist/compat/object/at.d.mts +0 -19
- package/dist/compat/object/at.d.ts +0 -19
- package/dist/compat/object/at.mjs +0 -27
- package/dist/compat/object/forIn.d.mts +0 -58
- package/dist/compat/object/forIn.d.ts +0 -58
- package/dist/compat/object/forIn.mjs +0 -16
- package/dist/compat/object/forInRight.d.mts +0 -58
- package/dist/compat/object/forInRight.d.ts +0 -58
- package/dist/compat/object/forInRight.mjs +0 -21
- package/dist/compat/object/forOwn.d.mts +0 -54
- package/dist/compat/object/forOwn.d.ts +0 -54
- package/dist/compat/object/forOwn.mjs +0 -19
- package/dist/compat/object/forOwnRight.d.mts +0 -54
- package/dist/compat/object/forOwnRight.d.ts +0 -54
- package/dist/compat/object/forOwnRight.mjs +0 -19
- package/dist/compat/object/hasIn.d.mts +0 -40
- package/dist/compat/object/hasIn.d.ts +0 -40
- package/dist/compat/object/hasIn.mjs +0 -34
- package/dist/compat/string/split.d.mts +0 -19
- package/dist/compat/string/split.d.ts +0 -19
- package/dist/compat/string/split.mjs +0 -7
- package/dist/compat/util/overEvery.d.mts +0 -67
- package/dist/compat/util/overEvery.d.ts +0 -67
- package/dist/compat/util/overEvery.mjs +0 -23
- package/dist/compat/util/overSome.d.mts +0 -69
- package/dist/compat/util/overSome.d.ts +0 -69
- package/dist/compat/util/overSome.mjs +0 -23
package/dist/compat/index.mjs
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
+
export { at } from '../array/at.mjs';
|
|
1
2
|
export { countBy } from '../array/countBy.mjs';
|
|
3
|
+
export { flatMap } from '../array/flatMap.mjs';
|
|
2
4
|
export { flatMapDeep } from '../array/flatMapDeep.mjs';
|
|
5
|
+
export { forEachRight } from '../array/forEachRight.mjs';
|
|
3
6
|
export { groupBy } from '../array/groupBy.mjs';
|
|
4
7
|
export { initial } from '../array/initial.mjs';
|
|
5
8
|
export { isSubset } from '../array/isSubset.mjs';
|
|
6
9
|
export { isSubsetWith } from '../array/isSubsetWith.mjs';
|
|
7
10
|
export { keyBy } from '../array/keyBy.mjs';
|
|
11
|
+
export { partition } from '../array/partition.mjs';
|
|
12
|
+
export { pullAt } from '../array/pullAt.mjs';
|
|
8
13
|
export { sampleSize } from '../array/sampleSize.mjs';
|
|
9
14
|
export { shuffle } from '../array/shuffle.mjs';
|
|
10
15
|
export { toFilled } from '../array/toFilled.mjs';
|
|
@@ -13,6 +18,8 @@ export { windowed } from '../array/windowed.mjs';
|
|
|
13
18
|
export { xor } from '../array/xor.mjs';
|
|
14
19
|
export { xorBy } from '../array/xorBy.mjs';
|
|
15
20
|
export { xorWith } from '../array/xorWith.mjs';
|
|
21
|
+
export { zipObject } from '../array/zipObject.mjs';
|
|
22
|
+
export { zipWith } from '../array/zipWith.mjs';
|
|
16
23
|
export { AbortError } from '../error/AbortError.mjs';
|
|
17
24
|
export { TimeoutError } from '../error/TimeoutError.mjs';
|
|
18
25
|
export { asyncNoop } from '../function/asyncNoop.mjs';
|
|
@@ -20,8 +27,8 @@ export { identity } from '../function/identity.mjs';
|
|
|
20
27
|
export { memoize } from '../function/memoize.mjs';
|
|
21
28
|
export { noop } from '../function/noop.mjs';
|
|
22
29
|
export { once } from '../function/once.mjs';
|
|
23
|
-
|
|
24
|
-
|
|
30
|
+
import '../function/partial.mjs';
|
|
31
|
+
import '../function/partialRight.mjs';
|
|
25
32
|
export { retry } from '../function/retry.mjs';
|
|
26
33
|
export { unary } from '../function/unary.mjs';
|
|
27
34
|
export { median } from '../math/median.mjs';
|
|
@@ -79,12 +86,10 @@ export { find } from './array/find.mjs';
|
|
|
79
86
|
export { findIndex } from './array/findIndex.mjs';
|
|
80
87
|
export { findLast } from './array/findLast.mjs';
|
|
81
88
|
export { findLastIndex } from './array/findLastIndex.mjs';
|
|
82
|
-
export { flatMap } from './array/flatMap.mjs';
|
|
83
89
|
export { flatten } from './array/flatten.mjs';
|
|
84
90
|
export { flattenDeep } from './array/flattenDeep.mjs';
|
|
85
91
|
export { flattenDepth } from './array/flattenDepth.mjs';
|
|
86
92
|
export { forEach as each, forEach } from './array/forEach.mjs';
|
|
87
|
-
export { forEachRight as eachRight, forEachRight } from './array/forEachRight.mjs';
|
|
88
93
|
export { head as first, head } from './array/head.mjs';
|
|
89
94
|
export { includes } from './array/includes.mjs';
|
|
90
95
|
export { indexOf } from './array/indexOf.mjs';
|
|
@@ -97,12 +102,9 @@ export { lastIndexOf } from './array/lastIndexOf.mjs';
|
|
|
97
102
|
export { map } from './array/map.mjs';
|
|
98
103
|
export { nth } from './array/nth.mjs';
|
|
99
104
|
export { orderBy } from './array/orderBy.mjs';
|
|
100
|
-
export { partition } from './array/partition.mjs';
|
|
101
105
|
export { pull } from './array/pull.mjs';
|
|
102
106
|
export { pullAll } from './array/pullAll.mjs';
|
|
103
107
|
export { pullAllBy } from './array/pullAllBy.mjs';
|
|
104
|
-
export { pullAllWith } from './array/pullAllWith.mjs';
|
|
105
|
-
export { pullAt } from './array/pullAt.mjs';
|
|
106
108
|
export { reduce } from './array/reduce.mjs';
|
|
107
109
|
export { reduceRight } from './array/reduceRight.mjs';
|
|
108
110
|
export { reject } from './array/reject.mjs';
|
|
@@ -132,9 +134,7 @@ export { uniqWith } from './array/uniqWith.mjs';
|
|
|
132
134
|
export { unzip } from './array/unzip.mjs';
|
|
133
135
|
export { without } from './array/without.mjs';
|
|
134
136
|
export { zip } from './array/zip.mjs';
|
|
135
|
-
export { zipObject } from './array/zipObject.mjs';
|
|
136
137
|
export { zipObjectDeep } from './array/zipObjectDeep.mjs';
|
|
137
|
-
export { zipWith } from './array/zipWith.mjs';
|
|
138
138
|
export { after } from './function/after.mjs';
|
|
139
139
|
export { ary } from './function/ary.mjs';
|
|
140
140
|
export { attempt } from './function/attempt.mjs';
|
|
@@ -151,6 +151,8 @@ export { flow } from './function/flow.mjs';
|
|
|
151
151
|
export { flowRight } from './function/flowRight.mjs';
|
|
152
152
|
export { negate } from './function/negate.mjs';
|
|
153
153
|
export { nthArg } from './function/nthArg.mjs';
|
|
154
|
+
export { partial } from './function/partial.mjs';
|
|
155
|
+
export { partialRight } from './function/partialRight.mjs';
|
|
154
156
|
export { rearg } from './function/rearg.mjs';
|
|
155
157
|
export { rest } from './function/rest.mjs';
|
|
156
158
|
export { spread } from './function/spread.mjs';
|
|
@@ -180,22 +182,16 @@ export { assign } from './object/assign.mjs';
|
|
|
180
182
|
export { assignIn, assignIn as extend } from './object/assignIn.mjs';
|
|
181
183
|
export { assignInWith, assignInWith as extendWith } from './object/assignInWith.mjs';
|
|
182
184
|
export { assignWith } from './object/assignWith.mjs';
|
|
183
|
-
export { at } from './object/at.mjs';
|
|
184
185
|
export { cloneDeep } from './object/cloneDeep.mjs';
|
|
185
186
|
export { cloneDeepWith } from './object/cloneDeepWith.mjs';
|
|
186
187
|
export { create } from './object/create.mjs';
|
|
187
188
|
export { defaults } from './object/defaults.mjs';
|
|
188
189
|
export { findKey } from './object/findKey.mjs';
|
|
189
|
-
export { forIn } from './object/forIn.mjs';
|
|
190
|
-
export { forInRight } from './object/forInRight.mjs';
|
|
191
|
-
export { forOwn } from './object/forOwn.mjs';
|
|
192
|
-
export { forOwnRight } from './object/forOwnRight.mjs';
|
|
193
190
|
export { fromPairs } from './object/fromPairs.mjs';
|
|
194
191
|
export { functions } from './object/functions.mjs';
|
|
195
192
|
export { functionsIn } from './object/functionsIn.mjs';
|
|
196
193
|
export { get } from './object/get.mjs';
|
|
197
194
|
export { has } from './object/has.mjs';
|
|
198
|
-
export { hasIn } from './object/hasIn.mjs';
|
|
199
195
|
export { invertBy } from './object/invertBy.mjs';
|
|
200
196
|
export { keys } from './object/keys.mjs';
|
|
201
197
|
export { keysIn } from './object/keysIn.mjs';
|
|
@@ -264,7 +260,6 @@ export { padStart } from './string/padStart.mjs';
|
|
|
264
260
|
export { repeat } from './string/repeat.mjs';
|
|
265
261
|
export { replace } from './string/replace.mjs';
|
|
266
262
|
export { snakeCase } from './string/snakeCase.mjs';
|
|
267
|
-
export { split } from './string/split.mjs';
|
|
268
263
|
export { startCase } from './string/startCase.mjs';
|
|
269
264
|
export { startsWith } from './string/startsWith.mjs';
|
|
270
265
|
export { template, templateSettings } from './string/template.mjs';
|
|
@@ -290,8 +285,6 @@ export { method } from './util/method.mjs';
|
|
|
290
285
|
export { methodOf } from './util/methodOf.mjs';
|
|
291
286
|
export { now } from './util/now.mjs';
|
|
292
287
|
export { over } from './util/over.mjs';
|
|
293
|
-
export { overEvery } from './util/overEvery.mjs';
|
|
294
|
-
export { overSome } from './util/overSome.mjs';
|
|
295
288
|
export { stubArray } from './util/stubArray.mjs';
|
|
296
289
|
export { stubFalse } from './util/stubFalse.mjs';
|
|
297
290
|
export { stubObject } from './util/stubObject.mjs';
|
|
@@ -308,3 +301,4 @@ export { toPlainObject } from './util/toPlainObject.mjs';
|
|
|
308
301
|
export { toSafeInteger } from './util/toSafeInteger.mjs';
|
|
309
302
|
export { toString } from './util/toString.mjs';
|
|
310
303
|
export { uniqueId } from './util/uniqueId.mjs';
|
|
304
|
+
export { toolkit as default } from './toolkit.mjs';
|
package/dist/function/index.js
CHANGED
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const unary = require('../_chunk/unary-
|
|
5
|
+
const unary = require('../_chunk/unary-EIEhcF.js');
|
|
6
6
|
const noop = require('../_chunk/noop-2IwLUk.js');
|
|
7
|
-
const partialRight = require('../_chunk/partialRight-B0_CSB.js');
|
|
8
7
|
|
|
9
8
|
function before(n, func) {
|
|
10
9
|
if (!Number.isInteger(n) || n < 0) {
|
|
@@ -95,12 +94,12 @@ exports.identity = unary.identity;
|
|
|
95
94
|
exports.memoize = unary.memoize;
|
|
96
95
|
exports.negate = unary.negate;
|
|
97
96
|
exports.once = unary.once;
|
|
97
|
+
exports.partial = unary.partial;
|
|
98
|
+
exports.partialRight = unary.partialRight;
|
|
98
99
|
exports.rest = unary.rest;
|
|
99
100
|
exports.retry = unary.retry;
|
|
100
101
|
exports.unary = unary.unary;
|
|
101
102
|
exports.noop = noop.noop;
|
|
102
|
-
exports.partial = partialRight.partial;
|
|
103
|
-
exports.partialRight = partialRight.partialRight;
|
|
104
103
|
exports.before = before;
|
|
105
104
|
exports.curry = curry;
|
|
106
105
|
exports.curryRight = curryRight;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
type Placeholder = typeof partialPlaceholder;
|
|
2
1
|
/**
|
|
3
2
|
* Creates a function that invokes `func` with `partialArgs` prepended to the arguments it receives. This method is like `bind` except it does not alter the `this` binding.
|
|
4
3
|
*
|
|
@@ -544,8 +543,9 @@ declare function partial<TS extends any[], T1, T2, T3, T4, R>(func: (t1: T1, arg
|
|
|
544
543
|
*/
|
|
545
544
|
declare function partial<F extends (...args: any[]) => any>(func: F, ...partialArgs: any[]): (...args: any[]) => ReturnType<F>;
|
|
546
545
|
declare namespace partial {
|
|
547
|
-
var placeholder: typeof
|
|
546
|
+
var placeholder: typeof placeholderSymbol;
|
|
548
547
|
}
|
|
549
|
-
declare const
|
|
548
|
+
declare const placeholderSymbol: unique symbol;
|
|
549
|
+
type Placeholder = typeof placeholderSymbol;
|
|
550
550
|
|
|
551
551
|
export { partial };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
type Placeholder = typeof partialPlaceholder;
|
|
2
1
|
/**
|
|
3
2
|
* Creates a function that invokes `func` with `partialArgs` prepended to the arguments it receives. This method is like `bind` except it does not alter the `this` binding.
|
|
4
3
|
*
|
|
@@ -544,8 +543,9 @@ declare function partial<TS extends any[], T1, T2, T3, T4, R>(func: (t1: T1, arg
|
|
|
544
543
|
*/
|
|
545
544
|
declare function partial<F extends (...args: any[]) => any>(func: F, ...partialArgs: any[]): (...args: any[]) => ReturnType<F>;
|
|
546
545
|
declare namespace partial {
|
|
547
|
-
var placeholder: typeof
|
|
546
|
+
var placeholder: typeof placeholderSymbol;
|
|
548
547
|
}
|
|
549
|
-
declare const
|
|
548
|
+
declare const placeholderSymbol: unique symbol;
|
|
549
|
+
type Placeholder = typeof placeholderSymbol;
|
|
550
550
|
|
|
551
551
|
export { partial };
|
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
function partial(func, ...partialArgs) {
|
|
2
|
-
return
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
for (let i = startIndex; i < providedArgs.length; i++) {
|
|
15
|
-
args.push(providedArgs[i]);
|
|
16
|
-
}
|
|
17
|
-
return func.apply(this, args);
|
|
2
|
+
return partialImpl(func, placeholderSymbol, ...partialArgs);
|
|
3
|
+
}
|
|
4
|
+
function partialImpl(func, placeholder, ...partialArgs) {
|
|
5
|
+
const partialed = function (...providedArgs) {
|
|
6
|
+
let providedArgsIndex = 0;
|
|
7
|
+
const substitutedArgs = partialArgs
|
|
8
|
+
.slice()
|
|
9
|
+
.map(arg => (arg === placeholder ? providedArgs[providedArgsIndex++] : arg));
|
|
10
|
+
const remainingArgs = providedArgs.slice(providedArgsIndex);
|
|
11
|
+
return func.apply(this, substitutedArgs.concat(remainingArgs));
|
|
18
12
|
};
|
|
13
|
+
if (func.prototype) {
|
|
14
|
+
partialed.prototype = Object.create(func.prototype);
|
|
15
|
+
}
|
|
16
|
+
return partialed;
|
|
19
17
|
}
|
|
20
|
-
const
|
|
21
|
-
partial.placeholder =
|
|
18
|
+
const placeholderSymbol = Symbol('partial.placeholder');
|
|
19
|
+
partial.placeholder = placeholderSymbol;
|
|
22
20
|
|
|
23
|
-
export { partial };
|
|
21
|
+
export { partial, partialImpl };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
type Placeholder = typeof partialRightPlaceholder;
|
|
2
1
|
/**
|
|
3
2
|
* This method is like `partial` except that partially applied arguments are appended to the arguments it receives.
|
|
4
3
|
*
|
|
@@ -621,8 +620,9 @@ declare function partialRight<T1, T2, T3, T4, R>(func: (arg1: T1, arg2: T2, arg3
|
|
|
621
620
|
*/
|
|
622
621
|
declare function partialRight(func: (...args: any[]) => any, ...args: any[]): (...args: any[]) => any;
|
|
623
622
|
declare namespace partialRight {
|
|
624
|
-
var placeholder: typeof
|
|
623
|
+
var placeholder: typeof placeholderSymbol;
|
|
625
624
|
}
|
|
626
|
-
declare const
|
|
625
|
+
declare const placeholderSymbol: unique symbol;
|
|
626
|
+
type Placeholder = typeof placeholderSymbol;
|
|
627
627
|
|
|
628
628
|
export { partialRight };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
type Placeholder = typeof partialRightPlaceholder;
|
|
2
1
|
/**
|
|
3
2
|
* This method is like `partial` except that partially applied arguments are appended to the arguments it receives.
|
|
4
3
|
*
|
|
@@ -621,8 +620,9 @@ declare function partialRight<T1, T2, T3, T4, R>(func: (arg1: T1, arg2: T2, arg3
|
|
|
621
620
|
*/
|
|
622
621
|
declare function partialRight(func: (...args: any[]) => any, ...args: any[]): (...args: any[]) => any;
|
|
623
622
|
declare namespace partialRight {
|
|
624
|
-
var placeholder: typeof
|
|
623
|
+
var placeholder: typeof placeholderSymbol;
|
|
625
624
|
}
|
|
626
|
-
declare const
|
|
625
|
+
declare const placeholderSymbol: unique symbol;
|
|
626
|
+
type Placeholder = typeof placeholderSymbol;
|
|
627
627
|
|
|
628
628
|
export { partialRight };
|
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
function partialRight(func, ...partialArgs) {
|
|
2
|
-
return
|
|
3
|
-
|
|
2
|
+
return partialRightImpl(func, placeholderSymbol, ...partialArgs);
|
|
3
|
+
}
|
|
4
|
+
function partialRightImpl(func, placeholder, ...partialArgs) {
|
|
5
|
+
const partialedRight = function (...providedArgs) {
|
|
6
|
+
const placeholderLength = partialArgs.filter(arg => arg === placeholder).length;
|
|
4
7
|
const rangeLength = Math.max(providedArgs.length - placeholderLength, 0);
|
|
5
|
-
const
|
|
6
|
-
let
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const arg = partialArgs[i];
|
|
12
|
-
if (arg === partialRight.placeholder) {
|
|
13
|
-
args.push(providedArgs[providedIndex++]);
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
args.push(arg);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return func.apply(this, args);
|
|
8
|
+
const remainingArgs = providedArgs.slice(0, rangeLength);
|
|
9
|
+
let providedArgsIndex = rangeLength;
|
|
10
|
+
const substitutedArgs = partialArgs
|
|
11
|
+
.slice()
|
|
12
|
+
.map(arg => (arg === placeholder ? providedArgs[providedArgsIndex++] : arg));
|
|
13
|
+
return func.apply(this, remainingArgs.concat(substitutedArgs));
|
|
20
14
|
};
|
|
15
|
+
if (func.prototype) {
|
|
16
|
+
partialedRight.prototype = Object.create(func.prototype);
|
|
17
|
+
}
|
|
18
|
+
return partialedRight;
|
|
21
19
|
}
|
|
22
|
-
const
|
|
23
|
-
partialRight.placeholder =
|
|
20
|
+
const placeholderSymbol = Symbol('partialRight.placeholder');
|
|
21
|
+
partialRight.placeholder = placeholderSymbol;
|
|
24
22
|
|
|
25
|
-
export { partialRight };
|
|
23
|
+
export { partialRight, partialRightImpl };
|
package/dist/index.js
CHANGED
|
@@ -2,92 +2,89 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
+
const zipWith = require('./_chunk/zipWith-ChDTPy.js');
|
|
5
6
|
const array_index = require('./array/index.js');
|
|
6
|
-
const zip = require('./_chunk/zip-DxZJSH.js');
|
|
7
7
|
const AbortError = require('./_chunk/AbortError-Cg4ZQ1.js');
|
|
8
8
|
const error_index = require('./error/index.js');
|
|
9
|
-
const unary = require('./_chunk/unary-
|
|
9
|
+
const unary = require('./_chunk/unary-EIEhcF.js');
|
|
10
10
|
const function_index = require('./function/index.js');
|
|
11
11
|
const noop = require('./_chunk/noop-2IwLUk.js');
|
|
12
|
-
const partialRight = require('./_chunk/partialRight-B0_CSB.js');
|
|
13
12
|
const range = require('./_chunk/range-HnEIT7.js');
|
|
14
13
|
const randomInt = require('./_chunk/randomInt-CF7bZK.js');
|
|
15
14
|
const math_index = require('./math/index.js');
|
|
16
|
-
const
|
|
15
|
+
const compat_index = require('./_chunk/toSnakeCaseKeys-DCXJ3Q.js');
|
|
17
16
|
const object_index = require('./object/index.js');
|
|
18
|
-
const isPromise = require('./_chunk/isPromise-
|
|
17
|
+
const isPromise = require('./_chunk/isPromise-BqEEYJ.js');
|
|
19
18
|
const predicate_index = require('./predicate/index.js');
|
|
20
|
-
const isPlainObject = require('./_chunk/isPlainObject-Xaozpc.js');
|
|
21
19
|
const delay = require('./_chunk/delay-_VMfFa.js');
|
|
22
20
|
const promise_index = require('./promise/index.js');
|
|
23
|
-
const
|
|
24
|
-
const reverseString = require('./_chunk/reverseString-D-wK2p.js');
|
|
21
|
+
const reverseString = require('./_chunk/reverseString-BixeGz.js');
|
|
25
22
|
const string_index = require('./string/index.js');
|
|
26
23
|
const util_index = require('./util/index.js');
|
|
27
24
|
const invariant = require('./_chunk/invariant-BfGFfr.js');
|
|
28
25
|
|
|
29
26
|
|
|
30
27
|
|
|
31
|
-
exports.at =
|
|
32
|
-
exports.
|
|
33
|
-
exports.
|
|
28
|
+
exports.at = zipWith.at;
|
|
29
|
+
exports.chunk = zipWith.chunk;
|
|
30
|
+
exports.compact = zipWith.compact;
|
|
31
|
+
exports.countBy = zipWith.countBy;
|
|
32
|
+
exports.difference = zipWith.difference;
|
|
33
|
+
exports.differenceBy = zipWith.differenceBy;
|
|
34
|
+
exports.differenceWith = zipWith.differenceWith;
|
|
35
|
+
exports.drop = zipWith.drop;
|
|
36
|
+
exports.dropRight = zipWith.dropRight;
|
|
37
|
+
exports.dropRightWhile = zipWith.dropRightWhile;
|
|
38
|
+
exports.dropWhile = zipWith.dropWhile;
|
|
39
|
+
exports.fill = zipWith.fill;
|
|
40
|
+
exports.flatMap = zipWith.flatMap;
|
|
41
|
+
exports.flatMapDeep = zipWith.flatMapDeep;
|
|
42
|
+
exports.flatten = zipWith.flatten;
|
|
43
|
+
exports.flattenDeep = zipWith.flattenDeep;
|
|
44
|
+
exports.forEachRight = zipWith.forEachRight;
|
|
45
|
+
exports.groupBy = zipWith.groupBy;
|
|
46
|
+
exports.head = zipWith.head;
|
|
47
|
+
exports.initial = zipWith.initial;
|
|
48
|
+
exports.intersection = zipWith.intersection;
|
|
49
|
+
exports.intersectionBy = zipWith.intersectionBy;
|
|
50
|
+
exports.intersectionWith = zipWith.intersectionWith;
|
|
51
|
+
exports.isSubset = zipWith.isSubset;
|
|
52
|
+
exports.isSubsetWith = zipWith.isSubsetWith;
|
|
53
|
+
exports.keyBy = zipWith.keyBy;
|
|
54
|
+
exports.last = zipWith.last;
|
|
55
|
+
exports.maxBy = zipWith.maxBy;
|
|
56
|
+
exports.minBy = zipWith.minBy;
|
|
57
|
+
exports.partition = zipWith.partition;
|
|
58
|
+
exports.pull = zipWith.pull;
|
|
59
|
+
exports.pullAt = zipWith.pullAt;
|
|
60
|
+
exports.remove = zipWith.remove;
|
|
61
|
+
exports.sample = zipWith.sample;
|
|
62
|
+
exports.sampleSize = zipWith.sampleSize;
|
|
63
|
+
exports.shuffle = zipWith.shuffle;
|
|
64
|
+
exports.tail = zipWith.tail;
|
|
65
|
+
exports.take = zipWith.take;
|
|
66
|
+
exports.takeRight = zipWith.takeRight;
|
|
67
|
+
exports.toFilled = zipWith.toFilled;
|
|
68
|
+
exports.union = zipWith.union;
|
|
69
|
+
exports.unionBy = zipWith.unionBy;
|
|
70
|
+
exports.unionWith = zipWith.unionWith;
|
|
71
|
+
exports.uniq = zipWith.uniq;
|
|
72
|
+
exports.uniqBy = zipWith.uniqBy;
|
|
73
|
+
exports.uniqWith = zipWith.uniqWith;
|
|
74
|
+
exports.unzip = zipWith.unzip;
|
|
75
|
+
exports.unzipWith = zipWith.unzipWith;
|
|
76
|
+
exports.windowed = zipWith.windowed;
|
|
77
|
+
exports.without = zipWith.without;
|
|
78
|
+
exports.xor = zipWith.xor;
|
|
79
|
+
exports.xorBy = zipWith.xorBy;
|
|
80
|
+
exports.xorWith = zipWith.xorWith;
|
|
81
|
+
exports.zip = zipWith.zip;
|
|
82
|
+
exports.zipObject = zipWith.zipObject;
|
|
83
|
+
exports.zipWith = zipWith.zipWith;
|
|
34
84
|
exports.orderBy = array_index.orderBy;
|
|
35
|
-
exports.partition = array_index.partition;
|
|
36
|
-
exports.pullAt = array_index.pullAt;
|
|
37
85
|
exports.sortBy = array_index.sortBy;
|
|
38
86
|
exports.takeRightWhile = array_index.takeRightWhile;
|
|
39
87
|
exports.takeWhile = array_index.takeWhile;
|
|
40
|
-
exports.zipObject = array_index.zipObject;
|
|
41
|
-
exports.zipWith = array_index.zipWith;
|
|
42
|
-
exports.chunk = zip.chunk;
|
|
43
|
-
exports.compact = zip.compact;
|
|
44
|
-
exports.countBy = zip.countBy;
|
|
45
|
-
exports.difference = zip.difference;
|
|
46
|
-
exports.differenceBy = zip.differenceBy;
|
|
47
|
-
exports.differenceWith = zip.differenceWith;
|
|
48
|
-
exports.drop = zip.drop;
|
|
49
|
-
exports.dropRight = zip.dropRight;
|
|
50
|
-
exports.dropRightWhile = zip.dropRightWhile;
|
|
51
|
-
exports.dropWhile = zip.dropWhile;
|
|
52
|
-
exports.fill = zip.fill;
|
|
53
|
-
exports.flatMapDeep = zip.flatMapDeep;
|
|
54
|
-
exports.flatten = zip.flatten;
|
|
55
|
-
exports.flattenDeep = zip.flattenDeep;
|
|
56
|
-
exports.groupBy = zip.groupBy;
|
|
57
|
-
exports.head = zip.head;
|
|
58
|
-
exports.initial = zip.initial;
|
|
59
|
-
exports.intersection = zip.intersection;
|
|
60
|
-
exports.intersectionBy = zip.intersectionBy;
|
|
61
|
-
exports.intersectionWith = zip.intersectionWith;
|
|
62
|
-
exports.isSubset = zip.isSubset;
|
|
63
|
-
exports.isSubsetWith = zip.isSubsetWith;
|
|
64
|
-
exports.keyBy = zip.keyBy;
|
|
65
|
-
exports.last = zip.last;
|
|
66
|
-
exports.maxBy = zip.maxBy;
|
|
67
|
-
exports.minBy = zip.minBy;
|
|
68
|
-
exports.pull = zip.pull;
|
|
69
|
-
exports.remove = zip.remove;
|
|
70
|
-
exports.sample = zip.sample;
|
|
71
|
-
exports.sampleSize = zip.sampleSize;
|
|
72
|
-
exports.shuffle = zip.shuffle;
|
|
73
|
-
exports.tail = zip.tail;
|
|
74
|
-
exports.take = zip.take;
|
|
75
|
-
exports.takeRight = zip.takeRight;
|
|
76
|
-
exports.toFilled = zip.toFilled;
|
|
77
|
-
exports.union = zip.union;
|
|
78
|
-
exports.unionBy = zip.unionBy;
|
|
79
|
-
exports.unionWith = zip.unionWith;
|
|
80
|
-
exports.uniq = zip.uniq;
|
|
81
|
-
exports.uniqBy = zip.uniqBy;
|
|
82
|
-
exports.uniqWith = zip.uniqWith;
|
|
83
|
-
exports.unzip = zip.unzip;
|
|
84
|
-
exports.unzipWith = zip.unzipWith;
|
|
85
|
-
exports.windowed = zip.windowed;
|
|
86
|
-
exports.without = zip.without;
|
|
87
|
-
exports.xor = zip.xor;
|
|
88
|
-
exports.xorBy = zip.xorBy;
|
|
89
|
-
exports.xorWith = zip.xorWith;
|
|
90
|
-
exports.zip = zip.zip;
|
|
91
88
|
exports.AbortError = AbortError.AbortError;
|
|
92
89
|
exports.TimeoutError = error_index.TimeoutError;
|
|
93
90
|
exports.after = unary.after;
|
|
@@ -100,6 +97,8 @@ exports.identity = unary.identity;
|
|
|
100
97
|
exports.memoize = unary.memoize;
|
|
101
98
|
exports.negate = unary.negate;
|
|
102
99
|
exports.once = unary.once;
|
|
100
|
+
exports.partial = unary.partial;
|
|
101
|
+
exports.partialRight = unary.partialRight;
|
|
103
102
|
exports.rest = unary.rest;
|
|
104
103
|
exports.retry = unary.retry;
|
|
105
104
|
exports.unary = unary.unary;
|
|
@@ -109,8 +108,6 @@ exports.curryRight = function_index.curryRight;
|
|
|
109
108
|
exports.spread = function_index.spread;
|
|
110
109
|
exports.throttle = function_index.throttle;
|
|
111
110
|
exports.noop = noop.noop;
|
|
112
|
-
exports.partial = partialRight.partial;
|
|
113
|
-
exports.partialRight = partialRight.partialRight;
|
|
114
111
|
exports.clamp = range.clamp;
|
|
115
112
|
exports.inRange = range.inRange;
|
|
116
113
|
exports.mean = range.mean;
|
|
@@ -124,19 +121,19 @@ exports.randomInt = randomInt.randomInt;
|
|
|
124
121
|
exports.rangeRight = math_index.rangeRight;
|
|
125
122
|
exports.round = math_index.round;
|
|
126
123
|
exports.sumBy = math_index.sumBy;
|
|
127
|
-
exports.clone =
|
|
128
|
-
exports.cloneDeep =
|
|
129
|
-
exports.cloneDeepWith =
|
|
130
|
-
exports.findKey =
|
|
131
|
-
exports.flattenObject =
|
|
132
|
-
exports.invert =
|
|
133
|
-
exports.mapKeys =
|
|
134
|
-
exports.mapValues =
|
|
135
|
-
exports.merge =
|
|
136
|
-
exports.omitBy =
|
|
137
|
-
exports.toCamelCaseKeys =
|
|
138
|
-
exports.toMerged =
|
|
139
|
-
exports.toSnakeCaseKeys =
|
|
124
|
+
exports.clone = compat_index.clone;
|
|
125
|
+
exports.cloneDeep = compat_index.cloneDeep;
|
|
126
|
+
exports.cloneDeepWith = compat_index.cloneDeepWith;
|
|
127
|
+
exports.findKey = compat_index.findKey;
|
|
128
|
+
exports.flattenObject = compat_index.flattenObject;
|
|
129
|
+
exports.invert = compat_index.invert;
|
|
130
|
+
exports.mapKeys = compat_index.mapKeys;
|
|
131
|
+
exports.mapValues = compat_index.mapValues;
|
|
132
|
+
exports.merge = compat_index.merge;
|
|
133
|
+
exports.omitBy = compat_index.omitBy;
|
|
134
|
+
exports.toCamelCaseKeys = compat_index.toCamelCaseKeys;
|
|
135
|
+
exports.toMerged = compat_index.toMerged;
|
|
136
|
+
exports.toSnakeCaseKeys = compat_index.toSnakeCaseKeys;
|
|
140
137
|
exports.mergeWith = object_index.mergeWith;
|
|
141
138
|
exports.omit = object_index.omit;
|
|
142
139
|
exports.pick = object_index.pick;
|
|
@@ -160,30 +157,28 @@ exports.isNil = isPromise.isNil;
|
|
|
160
157
|
exports.isNode = isPromise.isNode;
|
|
161
158
|
exports.isNotNil = isPromise.isNotNil;
|
|
162
159
|
exports.isNull = isPromise.isNull;
|
|
160
|
+
exports.isPlainObject = isPromise.isPlainObject;
|
|
161
|
+
exports.isPrimitive = isPromise.isPrimitive;
|
|
163
162
|
exports.isPromise = isPromise.isPromise;
|
|
164
163
|
exports.isRegExp = isPromise.isRegExp;
|
|
165
164
|
exports.isSet = isPromise.isSet;
|
|
166
165
|
exports.isSymbol = isPromise.isSymbol;
|
|
166
|
+
exports.isTypedArray = isPromise.isTypedArray;
|
|
167
167
|
exports.isUndefined = isPromise.isUndefined;
|
|
168
168
|
exports.isWeakMap = isPromise.isWeakMap;
|
|
169
169
|
exports.isWeakSet = isPromise.isWeakSet;
|
|
170
170
|
exports.isBoolean = predicate_index.isBoolean;
|
|
171
171
|
exports.isError = predicate_index.isError;
|
|
172
172
|
exports.isString = predicate_index.isString;
|
|
173
|
-
exports.isPlainObject = isPlainObject.isPlainObject;
|
|
174
|
-
exports.isPrimitive = isPlainObject.isPrimitive;
|
|
175
|
-
exports.isTypedArray = isPlainObject.isTypedArray;
|
|
176
173
|
exports.delay = delay.delay;
|
|
177
174
|
exports.Mutex = promise_index.Mutex;
|
|
178
175
|
exports.Semaphore = promise_index.Semaphore;
|
|
179
176
|
exports.timeout = promise_index.timeout;
|
|
180
177
|
exports.withTimeout = promise_index.withTimeout;
|
|
181
|
-
exports.camelCase =
|
|
182
|
-
exports.capitalize =
|
|
183
|
-
exports.deburr = snakeCase.deburr;
|
|
184
|
-
exports.snakeCase = snakeCase.snakeCase;
|
|
185
|
-
exports.words = snakeCase.words;
|
|
178
|
+
exports.camelCase = reverseString.camelCase;
|
|
179
|
+
exports.capitalize = reverseString.capitalize;
|
|
186
180
|
exports.constantCase = reverseString.constantCase;
|
|
181
|
+
exports.deburr = reverseString.deburr;
|
|
187
182
|
exports.escape = reverseString.escape;
|
|
188
183
|
exports.escapeRegExp = reverseString.escapeRegExp;
|
|
189
184
|
exports.kebabCase = reverseString.kebabCase;
|
|
@@ -192,12 +187,14 @@ exports.lowerFirst = reverseString.lowerFirst;
|
|
|
192
187
|
exports.pad = reverseString.pad;
|
|
193
188
|
exports.pascalCase = reverseString.pascalCase;
|
|
194
189
|
exports.reverseString = reverseString.reverseString;
|
|
190
|
+
exports.snakeCase = reverseString.snakeCase;
|
|
195
191
|
exports.trim = reverseString.trim;
|
|
196
192
|
exports.trimEnd = reverseString.trimEnd;
|
|
197
193
|
exports.trimStart = reverseString.trimStart;
|
|
198
194
|
exports.unescape = reverseString.unescape;
|
|
199
195
|
exports.upperCase = reverseString.upperCase;
|
|
200
196
|
exports.upperFirst = reverseString.upperFirst;
|
|
197
|
+
exports.words = reverseString.words;
|
|
201
198
|
exports.startCase = string_index.startCase;
|
|
202
199
|
exports.attempt = util_index.attempt;
|
|
203
200
|
exports.attemptAsync = invariant.attemptAsync;
|
package/dist/object/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const compat_index = require('../_chunk/toSnakeCaseKeys-DCXJ3Q.js');
|
|
6
6
|
|
|
7
7
|
function mergeWith(target, source, merge) {
|
|
8
8
|
const sourceKeys = Object.keys(source);
|
|
@@ -17,7 +17,7 @@ function mergeWith(target, source, merge) {
|
|
|
17
17
|
else if (Array.isArray(sourceValue)) {
|
|
18
18
|
target[key] = mergeWith(targetValue ?? [], sourceValue, merge);
|
|
19
19
|
}
|
|
20
|
-
else if (
|
|
20
|
+
else if (compat_index.isObjectLike(targetValue) && compat_index.isObjectLike(sourceValue)) {
|
|
21
21
|
target[key] = mergeWith(targetValue ?? {}, sourceValue, merge);
|
|
22
22
|
}
|
|
23
23
|
else if (targetValue === undefined || sourceValue !== undefined) {
|
|
@@ -60,19 +60,19 @@ function pickBy(obj, shouldPick) {
|
|
|
60
60
|
return result;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
exports.clone =
|
|
64
|
-
exports.cloneDeep =
|
|
65
|
-
exports.cloneDeepWith =
|
|
66
|
-
exports.findKey =
|
|
67
|
-
exports.flattenObject =
|
|
68
|
-
exports.invert =
|
|
69
|
-
exports.mapKeys =
|
|
70
|
-
exports.mapValues =
|
|
71
|
-
exports.merge =
|
|
72
|
-
exports.omitBy =
|
|
73
|
-
exports.toCamelCaseKeys =
|
|
74
|
-
exports.toMerged =
|
|
75
|
-
exports.toSnakeCaseKeys =
|
|
63
|
+
exports.clone = compat_index.clone;
|
|
64
|
+
exports.cloneDeep = compat_index.cloneDeep;
|
|
65
|
+
exports.cloneDeepWith = compat_index.cloneDeepWith;
|
|
66
|
+
exports.findKey = compat_index.findKey;
|
|
67
|
+
exports.flattenObject = compat_index.flattenObject;
|
|
68
|
+
exports.invert = compat_index.invert;
|
|
69
|
+
exports.mapKeys = compat_index.mapKeys;
|
|
70
|
+
exports.mapValues = compat_index.mapValues;
|
|
71
|
+
exports.merge = compat_index.merge;
|
|
72
|
+
exports.omitBy = compat_index.omitBy;
|
|
73
|
+
exports.toCamelCaseKeys = compat_index.toCamelCaseKeys;
|
|
74
|
+
exports.toMerged = compat_index.toMerged;
|
|
75
|
+
exports.toSnakeCaseKeys = compat_index.toSnakeCaseKeys;
|
|
76
76
|
exports.mergeWith = mergeWith;
|
|
77
77
|
exports.omit = omit;
|
|
78
78
|
exports.pick = pick;
|
|
@@ -7,7 +7,10 @@ import '../compat/function/bind.mjs';
|
|
|
7
7
|
import '../compat/function/bindKey.mjs';
|
|
8
8
|
import '../compat/function/curry.mjs';
|
|
9
9
|
import '../compat/function/curryRight.mjs';
|
|
10
|
+
import '../compat/function/partial.mjs';
|
|
11
|
+
import '../compat/function/partialRight.mjs';
|
|
10
12
|
import { isPlainObject } from '../compat/predicate/isPlainObject.mjs';
|
|
13
|
+
import '../compat/toolkit.mjs';
|
|
11
14
|
|
|
12
15
|
function toCamelCaseKeys(obj) {
|
|
13
16
|
if (isArray(obj)) {
|