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
package/dist/index.mjs
CHANGED
|
@@ -22,6 +22,7 @@ export { maxBy } from './array/maxBy.mjs';
|
|
|
22
22
|
export { minBy } from './array/minBy.mjs';
|
|
23
23
|
export { orderBy } from './array/orderBy.mjs';
|
|
24
24
|
export { partition } from './array/partition.mjs';
|
|
25
|
+
export { sortBy } from './array/sortBy.mjs';
|
|
25
26
|
export { sample } from './array/sample.mjs';
|
|
26
27
|
export { sampleSize } from './array/sampleSize.mjs';
|
|
27
28
|
export { shuffle } from './array/shuffle.mjs';
|
|
@@ -59,8 +60,12 @@ export { noop } from './function/noop.mjs';
|
|
|
59
60
|
export { once } from './function/once.mjs';
|
|
60
61
|
export { throttle } from './function/throttle.mjs';
|
|
61
62
|
export { negate } from './function/negate.mjs';
|
|
63
|
+
export { memoize } from './function/memoize.mjs';
|
|
62
64
|
export { ary } from './function/ary.mjs';
|
|
63
65
|
export { unary } from './function/unary.mjs';
|
|
66
|
+
export { partial } from './function/partial.mjs';
|
|
67
|
+
export { partialRight } from './function/partialRight.mjs';
|
|
68
|
+
export { rest } from './function/rest.mjs';
|
|
64
69
|
export { clamp } from './math/clamp.mjs';
|
|
65
70
|
export { inRange } from './math/inRange.mjs';
|
|
66
71
|
export { mean } from './math/mean.mjs';
|
|
@@ -82,6 +87,7 @@ export { mapKeys } from './object/mapKeys.mjs';
|
|
|
82
87
|
export { mapValues } from './object/mapValues.mjs';
|
|
83
88
|
export { cloneDeep } from './object/cloneDeep.mjs';
|
|
84
89
|
export { merge } from './object/merge.mjs';
|
|
90
|
+
export { toMerged } from './object/toMerged.mjs';
|
|
85
91
|
export { mergeWith } from './object/mergeWith.mjs';
|
|
86
92
|
export { isEqual } from './predicate/isEqual.mjs';
|
|
87
93
|
export { isNil } from './predicate/isNil.mjs';
|
|
@@ -95,6 +101,7 @@ export { isTypedArray } from './predicate/isTypedArray.mjs';
|
|
|
95
101
|
export { isPrimitive } from './predicate/isPrimitive.mjs';
|
|
96
102
|
export { isBoolean } from './predicate/isBoolean.mjs';
|
|
97
103
|
export { isSymbol } from './predicate/isSymbol.mjs';
|
|
104
|
+
export { isString } from './predicate/isString.mjs';
|
|
98
105
|
export { delay } from './promise/delay.mjs';
|
|
99
106
|
export { withTimeout } from './promise/withTimeout.mjs';
|
|
100
107
|
export { camelCase } from './string/camelCase.mjs';
|
package/dist/object/index.d.mts
CHANGED
package/dist/object/index.d.ts
CHANGED
package/dist/object/index.js
CHANGED
|
@@ -2,26 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
function merge(target, source) {
|
|
8
|
-
const sourceKeys = Object.keys(source);
|
|
9
|
-
for (let i = 0; i < sourceKeys.length; i++) {
|
|
10
|
-
const key = sourceKeys[i];
|
|
11
|
-
const sourceValue = source[key];
|
|
12
|
-
const targetValue = target[key];
|
|
13
|
-
if (Array.isArray(sourceValue)) {
|
|
14
|
-
target[key] = merge(targetValue ?? [], sourceValue);
|
|
15
|
-
}
|
|
16
|
-
else if (isObjectLike.isObjectLike(targetValue) && isObjectLike.isObjectLike(sourceValue)) {
|
|
17
|
-
target[key] = merge(targetValue ?? {}, sourceValue);
|
|
18
|
-
}
|
|
19
|
-
else if (targetValue === undefined || sourceValue !== undefined) {
|
|
20
|
-
target[key] = sourceValue;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return target;
|
|
24
|
-
}
|
|
5
|
+
const toMerged = require('../_chunk/toMerged-BGwYW5.js');
|
|
25
6
|
|
|
26
7
|
function mergeWith(target, source, merge) {
|
|
27
8
|
const sourceKeys = Object.keys(source);
|
|
@@ -36,7 +17,7 @@ function mergeWith(target, source, merge) {
|
|
|
36
17
|
else if (Array.isArray(sourceValue)) {
|
|
37
18
|
target[key] = mergeWith(targetValue ?? [], sourceValue, merge);
|
|
38
19
|
}
|
|
39
|
-
else if (
|
|
20
|
+
else if (toMerged.isObjectLike(targetValue) && toMerged.isObjectLike(sourceValue)) {
|
|
40
21
|
target[key] = mergeWith(targetValue ?? {}, sourceValue, merge);
|
|
41
22
|
}
|
|
42
23
|
else if (targetValue === undefined || sourceValue !== undefined) {
|
|
@@ -46,15 +27,16 @@ function mergeWith(target, source, merge) {
|
|
|
46
27
|
return target;
|
|
47
28
|
}
|
|
48
29
|
|
|
49
|
-
exports.clone =
|
|
50
|
-
exports.cloneDeep =
|
|
51
|
-
exports.flattenObject =
|
|
52
|
-
exports.invert =
|
|
53
|
-
exports.mapKeys =
|
|
54
|
-
exports.mapValues =
|
|
55
|
-
exports.
|
|
56
|
-
exports.
|
|
57
|
-
exports.
|
|
58
|
-
exports.
|
|
59
|
-
exports.
|
|
30
|
+
exports.clone = toMerged.clone;
|
|
31
|
+
exports.cloneDeep = toMerged.cloneDeep;
|
|
32
|
+
exports.flattenObject = toMerged.flattenObject;
|
|
33
|
+
exports.invert = toMerged.invert;
|
|
34
|
+
exports.mapKeys = toMerged.mapKeys;
|
|
35
|
+
exports.mapValues = toMerged.mapValues;
|
|
36
|
+
exports.merge = toMerged.merge;
|
|
37
|
+
exports.omit = toMerged.omit;
|
|
38
|
+
exports.omitBy = toMerged.omitBy;
|
|
39
|
+
exports.pick = toMerged.pick;
|
|
40
|
+
exports.pickBy = toMerged.pickBy;
|
|
41
|
+
exports.toMerged = toMerged.toMerged;
|
|
60
42
|
exports.mergeWith = mergeWith;
|
package/dist/object/index.mjs
CHANGED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Merges the properties of the source object into a deep clone of the target object.
|
|
3
|
+
* Unlike `merge`, This function does not modify the original target object.
|
|
4
|
+
*
|
|
5
|
+
* This function performs a deep merge, meaning nested objects and arrays are merged recursively.
|
|
6
|
+
*
|
|
7
|
+
* - If a property in the source object is an array or object and the corresponding property in the target object is also an array or object, they will be merged.
|
|
8
|
+
* - If a property in the source object is undefined, it will not overwrite a defined property in the target object.
|
|
9
|
+
*
|
|
10
|
+
* Note that this function does not mutate the target object.
|
|
11
|
+
*
|
|
12
|
+
* @param {T} target - The target object to be cloned and merged into. This object is not modified directly.
|
|
13
|
+
* @param {S} source - The source object whose properties will be merged into the cloned target object.
|
|
14
|
+
* @returns {T & S} A new object with properties from the source object merged into a deep clone of the target object.
|
|
15
|
+
*
|
|
16
|
+
* @template T - Type of the target object.
|
|
17
|
+
* @template S - Type of the source object.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* const target = { a: 1, b: { x: 1, y: 2 } };
|
|
21
|
+
* const source = { b: { y: 3, z: 4 }, c: 5 };
|
|
22
|
+
*
|
|
23
|
+
* const result = toMerged(target, source);
|
|
24
|
+
* console.log(result);
|
|
25
|
+
* // Output: { a: 1, b: { x: 1, y: 3, z: 4 }, c: 5 }
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* const target = { a: [1, 2], b: { x: 1 } };
|
|
29
|
+
* const source = { a: [3], b: { y: 2 } };
|
|
30
|
+
*
|
|
31
|
+
* const result = toMerged(target, source);
|
|
32
|
+
* console.log(result);
|
|
33
|
+
* // Output: { a: [3, 2], b: { x: 1, y: 2 } }
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* const target = { a: null };
|
|
37
|
+
* const source = { a: [1, 2, 3] };
|
|
38
|
+
*
|
|
39
|
+
* const result = toMerged(target, source);
|
|
40
|
+
* console.log(result);
|
|
41
|
+
* // Output: { a: [1, 2, 3] }
|
|
42
|
+
*/
|
|
43
|
+
declare function toMerged<T, S>(target: T, source: S): T & S;
|
|
44
|
+
|
|
45
|
+
export { toMerged };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Merges the properties of the source object into a deep clone of the target object.
|
|
3
|
+
* Unlike `merge`, This function does not modify the original target object.
|
|
4
|
+
*
|
|
5
|
+
* This function performs a deep merge, meaning nested objects and arrays are merged recursively.
|
|
6
|
+
*
|
|
7
|
+
* - If a property in the source object is an array or object and the corresponding property in the target object is also an array or object, they will be merged.
|
|
8
|
+
* - If a property in the source object is undefined, it will not overwrite a defined property in the target object.
|
|
9
|
+
*
|
|
10
|
+
* Note that this function does not mutate the target object.
|
|
11
|
+
*
|
|
12
|
+
* @param {T} target - The target object to be cloned and merged into. This object is not modified directly.
|
|
13
|
+
* @param {S} source - The source object whose properties will be merged into the cloned target object.
|
|
14
|
+
* @returns {T & S} A new object with properties from the source object merged into a deep clone of the target object.
|
|
15
|
+
*
|
|
16
|
+
* @template T - Type of the target object.
|
|
17
|
+
* @template S - Type of the source object.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* const target = { a: 1, b: { x: 1, y: 2 } };
|
|
21
|
+
* const source = { b: { y: 3, z: 4 }, c: 5 };
|
|
22
|
+
*
|
|
23
|
+
* const result = toMerged(target, source);
|
|
24
|
+
* console.log(result);
|
|
25
|
+
* // Output: { a: 1, b: { x: 1, y: 3, z: 4 }, c: 5 }
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* const target = { a: [1, 2], b: { x: 1 } };
|
|
29
|
+
* const source = { a: [3], b: { y: 2 } };
|
|
30
|
+
*
|
|
31
|
+
* const result = toMerged(target, source);
|
|
32
|
+
* console.log(result);
|
|
33
|
+
* // Output: { a: [3, 2], b: { x: 1, y: 2 } }
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* const target = { a: null };
|
|
37
|
+
* const source = { a: [1, 2, 3] };
|
|
38
|
+
*
|
|
39
|
+
* const result = toMerged(target, source);
|
|
40
|
+
* console.log(result);
|
|
41
|
+
* // Output: { a: [1, 2, 3] }
|
|
42
|
+
*/
|
|
43
|
+
declare function toMerged<T, S>(target: T, source: S): T & S;
|
|
44
|
+
|
|
45
|
+
export { toMerged };
|
package/dist/predicate/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const isFunction = require('../_chunk/isFunction-
|
|
5
|
+
const isFunction = require('../_chunk/isFunction-aCEz9d.js');
|
|
6
6
|
const isTypedArray = require('../_chunk/isTypedArray-BBEkFl.js');
|
|
7
7
|
|
|
8
8
|
function isBoolean(x) {
|
|
@@ -13,6 +13,10 @@ function isSymbol(value) {
|
|
|
13
13
|
return typeof value === 'symbol';
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
function isString(value) {
|
|
17
|
+
return typeof value === 'string';
|
|
18
|
+
}
|
|
19
|
+
|
|
16
20
|
exports.isEqual = isFunction.isEqual;
|
|
17
21
|
exports.isFunction = isFunction.isFunction;
|
|
18
22
|
exports.isLength = isFunction.isLength;
|
|
@@ -24,4 +28,5 @@ exports.isPlainObject = isTypedArray.isPlainObject;
|
|
|
24
28
|
exports.isPrimitive = isTypedArray.isPrimitive;
|
|
25
29
|
exports.isTypedArray = isTypedArray.isTypedArray;
|
|
26
30
|
exports.isBoolean = isBoolean;
|
|
31
|
+
exports.isString = isString;
|
|
27
32
|
exports.isSymbol = isSymbol;
|
package/dist/predicate/index.mjs
CHANGED
|
@@ -47,7 +47,7 @@ function areObjectsEqual(a, b, stack) {
|
|
|
47
47
|
case numberTag: {
|
|
48
48
|
const x = a.valueOf();
|
|
49
49
|
const y = b.valueOf();
|
|
50
|
-
return x === y || Number.isNaN(x) && Number.isNaN(y);
|
|
50
|
+
return x === y || (Number.isNaN(x) && Number.isNaN(y));
|
|
51
51
|
}
|
|
52
52
|
case booleanTag:
|
|
53
53
|
case dateTag:
|
|
@@ -57,7 +57,7 @@ function areObjectsEqual(a, b, stack) {
|
|
|
57
57
|
return a.source === b.source && a.flags === b.flags;
|
|
58
58
|
}
|
|
59
59
|
case functionTag: {
|
|
60
|
-
return a
|
|
60
|
+
return a === b;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
stack = stack ?? new Map();
|
|
@@ -140,8 +140,7 @@ function areObjectsEqual(a, b, stack) {
|
|
|
140
140
|
return a.name === b.name && a.message === b.message;
|
|
141
141
|
}
|
|
142
142
|
case objectTag: {
|
|
143
|
-
const areEqualInstances = areObjectsEqual(a.constructor, b.constructor, stack) ||
|
|
144
|
-
(isPlainObject(a) && isPlainObject(b));
|
|
143
|
+
const areEqualInstances = areObjectsEqual(a.constructor, b.constructor, stack) || (isPlainObject(a) && isPlainObject(b));
|
|
145
144
|
if (!areEqualInstances) {
|
|
146
145
|
return false;
|
|
147
146
|
}
|
|
@@ -153,7 +152,7 @@ function areObjectsEqual(a, b, stack) {
|
|
|
153
152
|
for (let i = 0; i < aKeys.length; i++) {
|
|
154
153
|
const propKey = aKeys[i];
|
|
155
154
|
const aProp = a[propKey];
|
|
156
|
-
if (!
|
|
155
|
+
if (!Object.prototype.hasOwnProperty.call(b, propKey)) {
|
|
157
156
|
return false;
|
|
158
157
|
}
|
|
159
158
|
const bProp = b[propKey];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if a given value is stirng.
|
|
3
|
+
*
|
|
4
|
+
* This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `string`.
|
|
5
|
+
*
|
|
6
|
+
* @param {unknown} value The value to check if it is string.
|
|
7
|
+
* @returns {value is string} Returns `true` if `value` is a stirng, else `false`.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* const value1 = 'abc';
|
|
11
|
+
* const value2 = 123;
|
|
12
|
+
* const value3 = true;
|
|
13
|
+
*
|
|
14
|
+
* console.log(isString(value1)); // true
|
|
15
|
+
* console.log(isString(value2)); // false
|
|
16
|
+
* console.log(isString(value3)); // false
|
|
17
|
+
*/
|
|
18
|
+
declare function isString(value: unknown): value is string;
|
|
19
|
+
|
|
20
|
+
export { isString };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if a given value is stirng.
|
|
3
|
+
*
|
|
4
|
+
* This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `string`.
|
|
5
|
+
*
|
|
6
|
+
* @param {unknown} value The value to check if it is string.
|
|
7
|
+
* @returns {value is string} Returns `true` if `value` is a stirng, else `false`.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* const value1 = 'abc';
|
|
11
|
+
* const value2 = 123;
|
|
12
|
+
* const value3 = true;
|
|
13
|
+
*
|
|
14
|
+
* console.log(isString(value1)); // true
|
|
15
|
+
* console.log(isString(value2)); // false
|
|
16
|
+
* console.log(isString(value3)); // false
|
|
17
|
+
*/
|
|
18
|
+
declare function isString(value: unknown): value is string;
|
|
19
|
+
|
|
20
|
+
export { isString };
|
|
@@ -4,10 +4,10 @@ import { getWords } from './_internal/getWords.mjs';
|
|
|
4
4
|
function camelCase(str) {
|
|
5
5
|
const words = getWords(str);
|
|
6
6
|
if (words.length === 0) {
|
|
7
|
-
return
|
|
7
|
+
return '';
|
|
8
8
|
}
|
|
9
9
|
const [first, ...rest] = words;
|
|
10
|
-
return `${first.toLowerCase()}${rest.map(
|
|
10
|
+
return `${first.toLowerCase()}${rest.map(word => capitalize(word)).join('')}`;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export { camelCase };
|
package/dist/string/index.js
CHANGED
|
@@ -14,10 +14,10 @@ function getWords(str) {
|
|
|
14
14
|
function camelCase(str) {
|
|
15
15
|
const words = getWords(str);
|
|
16
16
|
if (words.length === 0) {
|
|
17
|
-
return
|
|
17
|
+
return '';
|
|
18
18
|
}
|
|
19
19
|
const [first, ...rest] = words;
|
|
20
|
-
return `${first.toLowerCase()}${rest.map(
|
|
20
|
+
return `${first.toLowerCase()}${rest.map(word => capitalize(word)).join('')}`;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const snakeCase = (str) => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "es-toolkit",
|
|
3
3
|
"description": "A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.16.0-dev.455+f08fbd1b",
|
|
5
5
|
"homepage": "https://es-toolkit.slash.page",
|
|
6
6
|
"bugs": "https://github.com/toss/es-toolkit/issues",
|
|
7
7
|
"repository": {
|