es-toolkit 1.45.1-dev.1779 → 1.45.1-dev.1782
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/error/AbortError.d.mts +2 -2
- package/dist/error/AbortError.d.ts +2 -2
- package/dist/error/AbortError.js +1 -2
- package/dist/error/AbortError.mjs +1 -2
- package/dist/error/TimeoutError.d.mts +3 -3
- package/dist/error/TimeoutError.d.ts +3 -3
- package/dist/error/TimeoutError.js +1 -2
- package/dist/error/TimeoutError.mjs +1 -2
- package/dist/function/partial.d.mts +69 -0
- package/dist/function/partial.d.ts +69 -0
- package/package.json +1 -1
package/dist/error/AbortError.js
CHANGED
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
class AbortError extends
|
|
5
|
+
class AbortError extends DOMException {
|
|
6
6
|
constructor(message = 'The operation was aborted') {
|
|
7
7
|
super(message);
|
|
8
|
-
this.name = 'AbortError';
|
|
9
8
|
}
|
|
10
9
|
}
|
|
11
10
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* An error class representing
|
|
3
|
-
* @augments
|
|
2
|
+
* An error class representing a timeout operation.
|
|
3
|
+
* @augments DOMException
|
|
4
4
|
*/
|
|
5
|
-
declare class TimeoutError extends
|
|
5
|
+
declare class TimeoutError extends DOMException {
|
|
6
6
|
constructor(message?: string);
|
|
7
7
|
}
|
|
8
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* An error class representing
|
|
3
|
-
* @augments
|
|
2
|
+
* An error class representing a timeout operation.
|
|
3
|
+
* @augments DOMException
|
|
4
4
|
*/
|
|
5
|
-
declare class TimeoutError extends
|
|
5
|
+
declare class TimeoutError extends DOMException {
|
|
6
6
|
constructor(message?: string);
|
|
7
7
|
}
|
|
8
8
|
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
class TimeoutError extends
|
|
5
|
+
class TimeoutError extends DOMException {
|
|
6
6
|
constructor(message = 'The operation was timed out') {
|
|
7
7
|
super(message);
|
|
8
|
-
this.name = 'TimeoutError';
|
|
9
8
|
}
|
|
10
9
|
}
|
|
11
10
|
|
|
@@ -58,6 +58,27 @@ declare function partial<T1, T2, R>(func: (arg1: T1, arg2: T2) => R, arg1: T1):
|
|
|
58
58
|
* console.log(greetWithHello('Hello')); // => 'Hello, John!'
|
|
59
59
|
*/
|
|
60
60
|
declare function partial<T1, T2, R>(func: (arg1: T1, arg2: T2) => R, placeholder: Placeholder, arg2: T2): (arg1: T1) => R;
|
|
61
|
+
/**
|
|
62
|
+
* 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.
|
|
63
|
+
*
|
|
64
|
+
* The partial.placeholder value, which defaults to a `symbol`, may be used as a placeholder for partially applied arguments.
|
|
65
|
+
*
|
|
66
|
+
* Note: This method doesn't set the `length` property of partially applied functions.
|
|
67
|
+
*
|
|
68
|
+
* @template T1 The type of the first argument.
|
|
69
|
+
* @template T2 The type of the second argument.
|
|
70
|
+
* @template R The return type of the function.
|
|
71
|
+
* @param {function(arg1: T1, arg2: T2): R} func The function to partially apply.
|
|
72
|
+
* @param {T1} arg1 The first argument to apply.
|
|
73
|
+
* @param {T2} arg2 The second argument to apply.
|
|
74
|
+
* @returns {function(): R} A new function that takes no arguments and returns the result of the original function.
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* const add = (x: number, y: number) => x + y;
|
|
78
|
+
* const addThree = partial(add, 1, 2);
|
|
79
|
+
* console.log(addThree()); // => 3
|
|
80
|
+
*/
|
|
81
|
+
declare function partial<T1, T2, R>(func: (arg1: T1, arg2: T2) => R, arg1: T1, arg2: T2): () => R;
|
|
61
82
|
/**
|
|
62
83
|
* 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.
|
|
63
84
|
*
|
|
@@ -170,6 +191,29 @@ declare function partial<T1, T2, T3, R>(func: (arg1: T1, arg2: T2, arg3: T3) =>
|
|
|
170
191
|
* console.log(greetWithPlaceholder('John')); // => 'Hello, John!'
|
|
171
192
|
*/
|
|
172
193
|
declare function partial<T1, T2, T3, R>(func: (arg1: T1, arg2: T2, arg3: T3) => R, plc1: Placeholder, arg2: T2, arg3: T3): (arg1: T1) => R;
|
|
194
|
+
/**
|
|
195
|
+
* 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.
|
|
196
|
+
*
|
|
197
|
+
* The partial.placeholder value, which defaults to a `symbol`, may be used as a placeholder for partially applied arguments.
|
|
198
|
+
*
|
|
199
|
+
* Note: This method doesn't set the `length` property of partially applied functions.
|
|
200
|
+
*
|
|
201
|
+
* @template T1 The type of the first argument.
|
|
202
|
+
* @template T2 The type of the second argument.
|
|
203
|
+
* @template T3 The type of the third argument.
|
|
204
|
+
* @template R The return type of the function.
|
|
205
|
+
* @param {function(arg1: T1, arg2: T2, arg3: T3): R} func The function to partially apply.
|
|
206
|
+
* @param {T1} arg1 The first argument to apply.
|
|
207
|
+
* @param {T2} arg2 The second argument to apply.
|
|
208
|
+
* @param {T3} arg3 The third argument to apply.
|
|
209
|
+
* @returns {function(): R} A new function that takes no arguments and returns the result of the original function.
|
|
210
|
+
*
|
|
211
|
+
* @example
|
|
212
|
+
* const sum = (a: number, b: number, c: number) => a + b + c;
|
|
213
|
+
* const sumAll = partial(sum, 1, 2, 3);
|
|
214
|
+
* console.log(sumAll()); // => 6
|
|
215
|
+
*/
|
|
216
|
+
declare function partial<T1, T2, T3, R>(func: (arg1: T1, arg2: T2, arg3: T3) => R, arg1: T1, arg2: T2, arg3: T3): () => R;
|
|
173
217
|
/**
|
|
174
218
|
* 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.
|
|
175
219
|
*
|
|
@@ -414,6 +458,31 @@ declare function partial<T1, T2, T3, T4, R>(func: (arg1: T1, arg2: T2, arg3: T3,
|
|
|
414
458
|
* @returns {function(arg1: T1): R} A new function that takes the first argument and returns the result of the original function.
|
|
415
459
|
*/
|
|
416
460
|
declare function partial<T1, T2, T3, T4, R>(func: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => R, arg1: Placeholder, arg2: T2, arg3: T3, arg4: T4): (arg1: T1) => R;
|
|
461
|
+
/**
|
|
462
|
+
* 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.
|
|
463
|
+
*
|
|
464
|
+
* The partial.placeholder value, which defaults to a `symbol`, may be used as a placeholder for partially applied arguments.
|
|
465
|
+
*
|
|
466
|
+
* Note: This method doesn't set the `length` property of partially applied functions.
|
|
467
|
+
*
|
|
468
|
+
* @template T1 The type of the first argument.
|
|
469
|
+
* @template T2 The type of the second argument.
|
|
470
|
+
* @template T3 The type of the third argument.
|
|
471
|
+
* @template T4 The type of the fourth argument.
|
|
472
|
+
* @template R The return type of the function.
|
|
473
|
+
* @param {function(arg1: T1, arg2: T2, arg3: T3, arg4: T4): R} func The function to partially apply.
|
|
474
|
+
* @param {T1} arg1 The first argument to apply.
|
|
475
|
+
* @param {T2} arg2 The second argument to apply.
|
|
476
|
+
* @param {T3} arg3 The third argument to apply.
|
|
477
|
+
* @param {T4} arg4 The fourth argument to apply.
|
|
478
|
+
* @returns {function(): R} A new function that takes no arguments and returns the result of the original function.
|
|
479
|
+
*
|
|
480
|
+
* @example
|
|
481
|
+
* const sumFour = (a: number, b: number, c: number, d: number) => a + b + c + d;
|
|
482
|
+
* const sumAll = partial(sumFour, 1, 2, 3, 4);
|
|
483
|
+
* console.log(sumAll()); // => 10
|
|
484
|
+
*/
|
|
485
|
+
declare function partial<T1, T2, T3, T4, R>(func: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => R, arg1: T1, arg2: T2, arg3: T3, arg4: T4): () => R;
|
|
417
486
|
/**
|
|
418
487
|
* 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.
|
|
419
488
|
*
|
|
@@ -58,6 +58,27 @@ declare function partial<T1, T2, R>(func: (arg1: T1, arg2: T2) => R, arg1: T1):
|
|
|
58
58
|
* console.log(greetWithHello('Hello')); // => 'Hello, John!'
|
|
59
59
|
*/
|
|
60
60
|
declare function partial<T1, T2, R>(func: (arg1: T1, arg2: T2) => R, placeholder: Placeholder, arg2: T2): (arg1: T1) => R;
|
|
61
|
+
/**
|
|
62
|
+
* 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.
|
|
63
|
+
*
|
|
64
|
+
* The partial.placeholder value, which defaults to a `symbol`, may be used as a placeholder for partially applied arguments.
|
|
65
|
+
*
|
|
66
|
+
* Note: This method doesn't set the `length` property of partially applied functions.
|
|
67
|
+
*
|
|
68
|
+
* @template T1 The type of the first argument.
|
|
69
|
+
* @template T2 The type of the second argument.
|
|
70
|
+
* @template R The return type of the function.
|
|
71
|
+
* @param {function(arg1: T1, arg2: T2): R} func The function to partially apply.
|
|
72
|
+
* @param {T1} arg1 The first argument to apply.
|
|
73
|
+
* @param {T2} arg2 The second argument to apply.
|
|
74
|
+
* @returns {function(): R} A new function that takes no arguments and returns the result of the original function.
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* const add = (x: number, y: number) => x + y;
|
|
78
|
+
* const addThree = partial(add, 1, 2);
|
|
79
|
+
* console.log(addThree()); // => 3
|
|
80
|
+
*/
|
|
81
|
+
declare function partial<T1, T2, R>(func: (arg1: T1, arg2: T2) => R, arg1: T1, arg2: T2): () => R;
|
|
61
82
|
/**
|
|
62
83
|
* 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.
|
|
63
84
|
*
|
|
@@ -170,6 +191,29 @@ declare function partial<T1, T2, T3, R>(func: (arg1: T1, arg2: T2, arg3: T3) =>
|
|
|
170
191
|
* console.log(greetWithPlaceholder('John')); // => 'Hello, John!'
|
|
171
192
|
*/
|
|
172
193
|
declare function partial<T1, T2, T3, R>(func: (arg1: T1, arg2: T2, arg3: T3) => R, plc1: Placeholder, arg2: T2, arg3: T3): (arg1: T1) => R;
|
|
194
|
+
/**
|
|
195
|
+
* 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.
|
|
196
|
+
*
|
|
197
|
+
* The partial.placeholder value, which defaults to a `symbol`, may be used as a placeholder for partially applied arguments.
|
|
198
|
+
*
|
|
199
|
+
* Note: This method doesn't set the `length` property of partially applied functions.
|
|
200
|
+
*
|
|
201
|
+
* @template T1 The type of the first argument.
|
|
202
|
+
* @template T2 The type of the second argument.
|
|
203
|
+
* @template T3 The type of the third argument.
|
|
204
|
+
* @template R The return type of the function.
|
|
205
|
+
* @param {function(arg1: T1, arg2: T2, arg3: T3): R} func The function to partially apply.
|
|
206
|
+
* @param {T1} arg1 The first argument to apply.
|
|
207
|
+
* @param {T2} arg2 The second argument to apply.
|
|
208
|
+
* @param {T3} arg3 The third argument to apply.
|
|
209
|
+
* @returns {function(): R} A new function that takes no arguments and returns the result of the original function.
|
|
210
|
+
*
|
|
211
|
+
* @example
|
|
212
|
+
* const sum = (a: number, b: number, c: number) => a + b + c;
|
|
213
|
+
* const sumAll = partial(sum, 1, 2, 3);
|
|
214
|
+
* console.log(sumAll()); // => 6
|
|
215
|
+
*/
|
|
216
|
+
declare function partial<T1, T2, T3, R>(func: (arg1: T1, arg2: T2, arg3: T3) => R, arg1: T1, arg2: T2, arg3: T3): () => R;
|
|
173
217
|
/**
|
|
174
218
|
* 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.
|
|
175
219
|
*
|
|
@@ -414,6 +458,31 @@ declare function partial<T1, T2, T3, T4, R>(func: (arg1: T1, arg2: T2, arg3: T3,
|
|
|
414
458
|
* @returns {function(arg1: T1): R} A new function that takes the first argument and returns the result of the original function.
|
|
415
459
|
*/
|
|
416
460
|
declare function partial<T1, T2, T3, T4, R>(func: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => R, arg1: Placeholder, arg2: T2, arg3: T3, arg4: T4): (arg1: T1) => R;
|
|
461
|
+
/**
|
|
462
|
+
* 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.
|
|
463
|
+
*
|
|
464
|
+
* The partial.placeholder value, which defaults to a `symbol`, may be used as a placeholder for partially applied arguments.
|
|
465
|
+
*
|
|
466
|
+
* Note: This method doesn't set the `length` property of partially applied functions.
|
|
467
|
+
*
|
|
468
|
+
* @template T1 The type of the first argument.
|
|
469
|
+
* @template T2 The type of the second argument.
|
|
470
|
+
* @template T3 The type of the third argument.
|
|
471
|
+
* @template T4 The type of the fourth argument.
|
|
472
|
+
* @template R The return type of the function.
|
|
473
|
+
* @param {function(arg1: T1, arg2: T2, arg3: T3, arg4: T4): R} func The function to partially apply.
|
|
474
|
+
* @param {T1} arg1 The first argument to apply.
|
|
475
|
+
* @param {T2} arg2 The second argument to apply.
|
|
476
|
+
* @param {T3} arg3 The third argument to apply.
|
|
477
|
+
* @param {T4} arg4 The fourth argument to apply.
|
|
478
|
+
* @returns {function(): R} A new function that takes no arguments and returns the result of the original function.
|
|
479
|
+
*
|
|
480
|
+
* @example
|
|
481
|
+
* const sumFour = (a: number, b: number, c: number, d: number) => a + b + c + d;
|
|
482
|
+
* const sumAll = partial(sumFour, 1, 2, 3, 4);
|
|
483
|
+
* console.log(sumAll()); // => 10
|
|
484
|
+
*/
|
|
485
|
+
declare function partial<T1, T2, T3, T4, R>(func: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => R, arg1: T1, arg2: T2, arg3: T3, arg4: T4): () => R;
|
|
417
486
|
/**
|
|
418
487
|
* 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.
|
|
419
488
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "es-toolkit",
|
|
3
|
-
"version": "1.45.1-dev.
|
|
3
|
+
"version": "1.45.1-dev.1782+923b636b",
|
|
4
4
|
"description": "A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.",
|
|
5
5
|
"homepage": "https://es-toolkit.dev",
|
|
6
6
|
"bugs": "https://github.com/toss/es-toolkit/issues",
|