es-toolkit 1.9.0-dev.190 → 1.9.0-dev.192
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/array/chunk.mjs +1 -1
- package/dist/array/compact.mjs +1 -1
- package/dist/array/countBy.mjs +1 -1
- package/dist/array/difference.mjs +1 -1
- package/dist/array/differenceBy.mjs +1 -1
- package/dist/array/differenceWith.mjs +1 -1
- package/dist/array/drop.mjs +1 -1
- package/dist/array/dropRight.mjs +1 -1
- package/dist/array/dropRightWhile.mjs +1 -1
- package/dist/array/dropWhile.mjs +1 -1
- package/dist/array/fill.mjs +1 -1
- package/dist/array/flatten.mjs +1 -1
- package/dist/array/flattenDeep.mjs +1 -1
- package/dist/array/forEachRight.mjs +1 -1
- package/dist/array/groupBy.mjs +1 -1
- package/dist/array/head.mjs +1 -1
- package/dist/array/index.mjs +1 -1
- package/dist/array/initial.mjs +1 -1
- package/dist/array/intersection.mjs +1 -1
- package/dist/array/intersectionBy.mjs +1 -1
- package/dist/array/intersectionWith.mjs +1 -1
- package/dist/array/keyBy.mjs +1 -1
- package/dist/array/last.mjs +1 -1
- package/dist/array/maxBy.mjs +1 -1
- package/dist/array/minBy.mjs +1 -1
- package/dist/array/orderBy.mjs +1 -1
- package/dist/array/partition.mjs +1 -1
- package/dist/array/sample.mjs +1 -1
- package/dist/array/sampleSize.mjs +1 -1
- package/dist/array/shuffle.mjs +1 -1
- package/dist/array/tail.mjs +1 -1
- package/dist/array/take.mjs +1 -1
- package/dist/array/takeRight.mjs +1 -1
- package/dist/array/takeRightWhile.mjs +1 -1
- package/dist/array/takeWhile.mjs +1 -1
- package/dist/array/toFilled.mjs +1 -1
- package/dist/array/union.mjs +1 -1
- package/dist/array/unionBy.mjs +1 -1
- package/dist/array/unionWith.mjs +1 -1
- package/dist/array/uniq.mjs +1 -1
- package/dist/array/uniqBy.mjs +1 -1
- package/dist/array/uniqWith.mjs +1 -1
- package/dist/array/unzip.mjs +1 -1
- package/dist/array/unzipWith.mjs +1 -1
- package/dist/array/without.mjs +1 -1
- package/dist/array/xor.mjs +1 -1
- package/dist/array/xorBy.mjs +1 -1
- package/dist/array/xorWith.mjs +1 -1
- package/dist/array/zip.mjs +1 -1
- package/dist/array/zipObject.mjs +1 -1
- package/dist/array/zipWith.mjs +1 -1
- package/dist/chunk-2HIMLZE3.mjs +46 -0
- package/dist/{chunk-QZITBKWX.mjs → chunk-4E4D3BMI.mjs} +2 -2
- package/dist/chunk-QKYYOLJ6.mjs +1 -0
- package/dist/chunk-WMM7TZLG.mjs +9 -0
- package/dist/{chunk-OHQAR5AU.mjs.map → chunk-WMM7TZLG.mjs.map} +1 -1
- package/dist/chunk-XGCYC4YA.mjs +5516 -0
- package/dist/chunk-XGCYC4YA.mjs.map +1 -0
- package/dist/error/AbortError.mjs +1 -1
- package/dist/error/index.mjs +1 -1
- package/dist/function/debounce.mjs +1 -1
- package/dist/function/index.mjs +1 -1
- package/dist/function/noop.mjs +1 -1
- package/dist/function/once.mjs +1 -1
- package/dist/function/throttle.mjs +1 -1
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +5524 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -8
- package/dist/math/clamp.mjs +1 -1
- package/dist/math/inRange.mjs +1 -1
- package/dist/math/index.mjs +1 -1
- package/dist/math/mean.mjs +1 -1
- package/dist/math/meanBy.mjs +1 -1
- package/dist/math/random.mjs +1 -1
- package/dist/math/randomInt.mjs +1 -1
- package/dist/math/range.mjs +1 -1
- package/dist/math/round.mjs +1 -1
- package/dist/math/sum.mjs +1 -1
- package/dist/object/index.mjs +2 -2
- package/dist/object/invert.mjs +1 -1
- package/dist/object/omit.mjs +2 -2
- package/dist/object/omitBy.mjs +1 -1
- package/dist/object/pick.mjs +1 -1
- package/dist/object/pickBy.mjs +1 -1
- package/dist/predicate/index.js +1 -1
- package/dist/predicate/index.js.map +1 -1
- package/dist/predicate/index.mjs +2 -2
- package/dist/predicate/isNil.js +1 -1
- package/dist/predicate/isNil.js.map +1 -1
- package/dist/predicate/isNil.mjs +2 -2
- package/dist/predicate/isNotNil.mjs +1 -1
- package/dist/predicate/isNull.mjs +1 -1
- package/dist/predicate/isUndefined.mjs +1 -1
- package/dist/promise/delay.mjs +1 -1
- package/dist/promise/index.mjs +1 -1
- package/dist/string/camelCase.d.mts +17 -0
- package/dist/string/camelCase.d.ts +17 -0
- package/dist/string/camelCase.js +5554 -0
- package/dist/string/camelCase.js.map +1 -0
- package/dist/string/camelCase.mjs +9 -0
- package/dist/string/camelCase.mjs.map +1 -0
- package/dist/string/capitalize.mjs +1 -1
- package/dist/string/index.d.mts +1 -0
- package/dist/string/index.d.ts +1 -0
- package/dist/string/index.js +5523 -2
- package/dist/string/index.js.map +1 -1
- package/dist/string/index.mjs +6 -2
- package/dist/string/kebabCase.mjs +1 -1
- package/dist/string/lowerCase.mjs +1 -1
- package/dist/string/snakeCase.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-2MM5EJJX.mjs +0 -21
- package/dist/chunk-HXGADE4C.mjs +0 -1
- package/dist/chunk-OHQAR5AU.mjs +0 -9
- /package/dist/{chunk-2MM5EJJX.mjs.map → chunk-2HIMLZE3.mjs.map} +0 -0
- /package/dist/{chunk-QZITBKWX.mjs.map → chunk-4E4D3BMI.mjs.map} +0 -0
- /package/dist/{chunk-HXGADE4C.mjs.map → chunk-QKYYOLJ6.mjs.map} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,10 @@ import "./chunk-ARZ5BDR6.mjs";
|
|
|
2
2
|
import {
|
|
3
3
|
delay
|
|
4
4
|
} from "./chunk-O64NE2P4.mjs";
|
|
5
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-QKYYOLJ6.mjs";
|
|
6
|
+
import {
|
|
7
|
+
camelCase
|
|
8
|
+
} from "./chunk-XGCYC4YA.mjs";
|
|
6
9
|
import {
|
|
7
10
|
capitalize
|
|
8
11
|
} from "./chunk-U56ZOM7L.mjs";
|
|
@@ -19,7 +22,7 @@ import "./chunk-WVQ7YVRK.mjs";
|
|
|
19
22
|
import "./chunk-MAJSPFA6.mjs";
|
|
20
23
|
import {
|
|
21
24
|
isNil
|
|
22
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-WMM7TZLG.mjs";
|
|
23
26
|
import {
|
|
24
27
|
isNotNil
|
|
25
28
|
} from "./chunk-BMRTZMRE.mjs";
|
|
@@ -44,7 +47,7 @@ import {
|
|
|
44
47
|
} from "./chunk-74WWMNZS.mjs";
|
|
45
48
|
import {
|
|
46
49
|
omit
|
|
47
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-4E4D3BMI.mjs";
|
|
48
51
|
import "./chunk-2MRZANXZ.mjs";
|
|
49
52
|
import {
|
|
50
53
|
xorBy
|
|
@@ -224,10 +227,6 @@ import {
|
|
|
224
227
|
import {
|
|
225
228
|
range
|
|
226
229
|
} from "./chunk-DPH2KE6O.mjs";
|
|
227
|
-
import "./chunk-FZEZH22H.mjs";
|
|
228
|
-
import {
|
|
229
|
-
AbortError
|
|
230
|
-
} from "./chunk-DXB7EZUQ.mjs";
|
|
231
230
|
import "./chunk-N6EM6ETS.mjs";
|
|
232
231
|
import {
|
|
233
232
|
debounce
|
|
@@ -241,9 +240,14 @@ import {
|
|
|
241
240
|
import {
|
|
242
241
|
throttle
|
|
243
242
|
} from "./chunk-QOJGMVVR.mjs";
|
|
244
|
-
import "./chunk-
|
|
243
|
+
import "./chunk-FZEZH22H.mjs";
|
|
244
|
+
import {
|
|
245
|
+
AbortError
|
|
246
|
+
} from "./chunk-DXB7EZUQ.mjs";
|
|
247
|
+
import "./chunk-2HIMLZE3.mjs";
|
|
245
248
|
export {
|
|
246
249
|
AbortError,
|
|
250
|
+
camelCase,
|
|
247
251
|
capitalize,
|
|
248
252
|
chunk,
|
|
249
253
|
clamp,
|
package/dist/math/clamp.mjs
CHANGED
package/dist/math/inRange.mjs
CHANGED
package/dist/math/index.mjs
CHANGED
package/dist/math/mean.mjs
CHANGED
package/dist/math/meanBy.mjs
CHANGED
package/dist/math/random.mjs
CHANGED
package/dist/math/randomInt.mjs
CHANGED
package/dist/math/range.mjs
CHANGED
package/dist/math/round.mjs
CHANGED
package/dist/math/sum.mjs
CHANGED
package/dist/object/index.mjs
CHANGED
package/dist/object/invert.mjs
CHANGED
package/dist/object/omit.mjs
CHANGED
package/dist/object/omitBy.mjs
CHANGED
package/dist/object/pick.mjs
CHANGED
package/dist/object/pickBy.mjs
CHANGED
package/dist/predicate/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/predicate/index.ts","../../src/predicate/isNil.ts","../../src/predicate/isNotNil.ts","../../src/predicate/isNull.ts","../../src/predicate/isUndefined.ts"],"sourcesContent":["export { isNil } from './isNil.ts';\nexport { isNotNil } from './isNotNil.ts';\nexport { isNull } from './isNull.ts';\nexport { isUndefined } from './isUndefined.ts';\n","/**\n * Checks if a given value is null or undefined.\n *\n * This function tests whether the provided value is either `null` or `undefined`.\n * It returns `true` if the value is `null` or `undefined`, and `false` otherwise.\n *\n * This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `null` or `undefined`.\n *\n * @param {unknown} x - The value to test for null or undefined.\n * @returns {boolean} `true` if the value is null or undefined, `false` otherwise.\n *\n * @example\n * const value1 = null;\n * const value2 = undefined;\n * const value3 = 42;\n * const result1 = isNil(value1); // true\n * const result2 = isNil(value2); // true\n * const result3 = isNil(value3); // false\n */\nexport function isNil(x: unknown): x is null | undefined {\n return x
|
|
1
|
+
{"version":3,"sources":["../../src/predicate/index.ts","../../src/predicate/isNil.ts","../../src/predicate/isNotNil.ts","../../src/predicate/isNull.ts","../../src/predicate/isUndefined.ts"],"sourcesContent":["export { isNil } from './isNil.ts';\nexport { isNotNil } from './isNotNil.ts';\nexport { isNull } from './isNull.ts';\nexport { isUndefined } from './isUndefined.ts';\n","/**\n * Checks if a given value is null or undefined.\n *\n * This function tests whether the provided value is either `null` or `undefined`.\n * It returns `true` if the value is `null` or `undefined`, and `false` otherwise.\n *\n * This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `null` or `undefined`.\n *\n * @param {unknown} x - The value to test for null or undefined.\n * @returns {boolean} `true` if the value is null or undefined, `false` otherwise.\n *\n * @example\n * const value1 = null;\n * const value2 = undefined;\n * const value3 = 42;\n * const result1 = isNil(value1); // true\n * const result2 = isNil(value2); // true\n * const result3 = isNil(value3); // false\n */\nexport function isNil(x: unknown): x is null | undefined {\n return x == null;\n}\n","/**\n * Checks if the given value is not null nor undefined.\n *\n * The main use of this function is to be used with TypeScript as a type predicate.\n *\n * @template T - The type of value.\n * @param {T | null | undefined} x - The value to test if it is not null nor undefined.\n * @returns {x is T} True if the value is not null nor undefined, false otherwise.\n *\n * @example\n * // Here the type of `arr` is (number | undefined)[]\n * const arr = [1, undefined, 3];\n * // Here the type of `result` is number[]\n * const result = arr.filter(isNotNil);\n * // result will be [1, 3]\n */\nexport function isNotNil<T>(x: T | null | undefined): x is T {\n return x !== null && x !== undefined;\n}\n","/**\n * Checks if the given value is null.\n *\n * This function tests whether the provided value is strictly equal to `null`.\n * It returns `true` if the value is `null`, and `false` otherwise.\n *\n * This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `null`.\n *\n * @param {unknown} x - The value to test if it is null.\n * @returns {x is null} True if the value is null, false otherwise.\n *\n * @example\n * const value1 = null;\n * const value2 = undefined;\n * const value3 = 42;\n *\n * console.log(isNull(value1)); // true\n * console.log(isNull(value2)); // false\n * console.log(isNull(value3)); // false\n */\nexport function isNull(x: unknown): x is null {\n return x === null;\n}\n","/**\n * Checks if the given value is undefined.\n *\n * This function tests whether the provided value is strictly equal to `undefined`.\n * It returns `true` if the value is `undefined`, and `false` otherwise.\n *\n * This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `undefined`.\n *\n * @param {unknown} x - The value to test if it is undefined.\n * @returns {x is undefined} true if the value is undefined, false otherwise.\n *\n * @example\n * const value1 = undefined;\n * const value2 = null;\n * const value3 = 42;\n *\n * console.log(isUndefined(value1)); // true\n * console.log(isUndefined(value2)); // false\n * console.log(isUndefined(value3)); // false\n */\nexport function isUndefined(x: unknown): x is undefined {\n return x === undefined;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACmBO,SAAS,MAAM,GAAmC;AACvD,SAAO,KAAK;AACd;;;ACLO,SAAS,SAAY,GAAiC;AAC3D,SAAO,MAAM,QAAQ,MAAM;AAC7B;;;ACEO,SAAS,OAAO,GAAuB;AAC5C,SAAO,MAAM;AACf;;;ACFO,SAAS,YAAY,GAA4B;AACtD,SAAO,MAAM;AACf;","names":[]}
|
package/dist/predicate/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../chunk-MAJSPFA6.mjs";
|
|
2
2
|
import {
|
|
3
3
|
isNil
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-WMM7TZLG.mjs";
|
|
5
5
|
import {
|
|
6
6
|
isNotNil
|
|
7
7
|
} from "../chunk-BMRTZMRE.mjs";
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
import {
|
|
12
12
|
isUndefined
|
|
13
13
|
} from "../chunk-VH2PV426.mjs";
|
|
14
|
-
import "../chunk-
|
|
14
|
+
import "../chunk-2HIMLZE3.mjs";
|
|
15
15
|
export {
|
|
16
16
|
isNil,
|
|
17
17
|
isNotNil,
|
package/dist/predicate/isNil.js
CHANGED
|
@@ -24,7 +24,7 @@ __export(isNil_exports, {
|
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(isNil_exports);
|
|
26
26
|
function isNil(x) {
|
|
27
|
-
return x
|
|
27
|
+
return x == null;
|
|
28
28
|
}
|
|
29
29
|
// Annotate the CommonJS export names for ESM import in node:
|
|
30
30
|
0 && (module.exports = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/predicate/isNil.ts"],"sourcesContent":["/**\n * Checks if a given value is null or undefined.\n *\n * This function tests whether the provided value is either `null` or `undefined`.\n * It returns `true` if the value is `null` or `undefined`, and `false` otherwise.\n *\n * This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `null` or `undefined`.\n *\n * @param {unknown} x - The value to test for null or undefined.\n * @returns {boolean} `true` if the value is null or undefined, `false` otherwise.\n *\n * @example\n * const value1 = null;\n * const value2 = undefined;\n * const value3 = 42;\n * const result1 = isNil(value1); // true\n * const result2 = isNil(value2); // true\n * const result3 = isNil(value3); // false\n */\nexport function isNil(x: unknown): x is null | undefined {\n return x
|
|
1
|
+
{"version":3,"sources":["../../src/predicate/isNil.ts"],"sourcesContent":["/**\n * Checks if a given value is null or undefined.\n *\n * This function tests whether the provided value is either `null` or `undefined`.\n * It returns `true` if the value is `null` or `undefined`, and `false` otherwise.\n *\n * This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `null` or `undefined`.\n *\n * @param {unknown} x - The value to test for null or undefined.\n * @returns {boolean} `true` if the value is null or undefined, `false` otherwise.\n *\n * @example\n * const value1 = null;\n * const value2 = undefined;\n * const value3 = 42;\n * const result1 = isNil(value1); // true\n * const result2 = isNil(value2); // true\n * const result3 = isNil(value3); // false\n */\nexport function isNil(x: unknown): x is null | undefined {\n return x == null;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAmBO,SAAS,MAAM,GAAmC;AACvD,SAAO,KAAK;AACd;","names":[]}
|
package/dist/predicate/isNil.mjs
CHANGED
package/dist/promise/delay.mjs
CHANGED
package/dist/promise/index.mjs
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts a string to camel case.
|
|
3
|
+
*
|
|
4
|
+
* camel case is the naming convention in which each word is written in lowercase and separated by an underscore (_) character.
|
|
5
|
+
*
|
|
6
|
+
* @param {string} str - The string that is to be changed to camel case.
|
|
7
|
+
* @returns {string} - The converted string to camel case.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* const convertedStr1 = camelCase('camelCase') // returns 'camelCase'
|
|
11
|
+
* const convertedStr2 = camelCase('some whitespace') // returns 'someWhitespace'
|
|
12
|
+
* const convertedStr3 = camelCase('hyphen-text') // returns 'hyphenText'
|
|
13
|
+
* const convertedStr4 = camelCase('HTTPRequest') // returns 'httpRequest'
|
|
14
|
+
*/
|
|
15
|
+
declare function camelCase(str: string): string;
|
|
16
|
+
|
|
17
|
+
export { camelCase };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts a string to camel case.
|
|
3
|
+
*
|
|
4
|
+
* camel case is the naming convention in which each word is written in lowercase and separated by an underscore (_) character.
|
|
5
|
+
*
|
|
6
|
+
* @param {string} str - The string that is to be changed to camel case.
|
|
7
|
+
* @returns {string} - The converted string to camel case.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* const convertedStr1 = camelCase('camelCase') // returns 'camelCase'
|
|
11
|
+
* const convertedStr2 = camelCase('some whitespace') // returns 'someWhitespace'
|
|
12
|
+
* const convertedStr3 = camelCase('hyphen-text') // returns 'hyphenText'
|
|
13
|
+
* const convertedStr4 = camelCase('HTTPRequest') // returns 'httpRequest'
|
|
14
|
+
*/
|
|
15
|
+
declare function camelCase(str: string): string;
|
|
16
|
+
|
|
17
|
+
export { camelCase };
|