es-toolkit 1.45.1-dev.1769 → 1.45.1-dev.1771

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.
@@ -11,17 +11,16 @@
11
11
  * @returns {T[]} The array with the filled values.
12
12
  *
13
13
  * @example
14
- * const array = [1, 2, 3];
15
- * const result = fill(array, 'a');
14
+ * fill([1, 2, 3], 'a');
16
15
  * // => ['a', 'a', 'a']
17
16
  *
18
- * const result = fill(Array(3), 2);
17
+ * fill(Array(3), 2);
19
18
  * // => [2, 2, 2]
20
19
  *
21
- * const result = fill([4, 6, 8, 10], '*', 1, 3);
20
+ * fill([4, 6, 8, 10], '*', 1, 3);
22
21
  * // => [4, '*', '*', 10]
23
22
  *
24
- * const result = fill(array, '*', -2, -1);
23
+ * fill([1, 2, 3], '*', -2, -1);
25
24
  * // => [1, '*', 3]
26
25
  */
27
26
  declare function fill<T>(array: unknown[], value: T): T[];
@@ -40,17 +39,16 @@ declare function fill<T>(array: unknown[], value: T): T[];
40
39
  * @returns {Array<T | U>} The array with the filled values.
41
40
  *
42
41
  * @example
43
- * const array = [1, 2, 3];
44
- * const result = fill(array, 'a');
42
+ * fill([1, 2, 3], 'a');
45
43
  * // => ['a', 'a', 'a']
46
44
  *
47
- * const result = fill(Array(3), 2);
45
+ * fill(Array(3), 2);
48
46
  * // => [2, 2, 2]
49
47
  *
50
- * const result = fill([4, 6, 8, 10], '*', 1, 3);
48
+ * fill([4, 6, 8, 10], '*', 1, 3);
51
49
  * // => [4, '*', '*', 10]
52
50
  *
53
- * const result = fill(array, '*', -2, -1);
51
+ * fill([1, 2, 3], '*', -2, -1);
54
52
  * // => [1, '*', 3]
55
53
  */
56
54
  declare function fill<T, U>(array: Array<T | U>, value: U, start: number): Array<T | U>;
@@ -70,17 +68,16 @@ declare function fill<T, U>(array: Array<T | U>, value: U, start: number): Array
70
68
  * @returns {Array<T | U>} The array with the filled values.
71
69
  *
72
70
  * @example
73
- * const array = [1, 2, 3];
74
- * const result = fill(array, 'a');
71
+ * fill([1, 2, 3], 'a');
75
72
  * // => ['a', 'a', 'a']
76
73
  *
77
- * const result = fill(Array(3), 2);
74
+ * fill(Array(3), 2);
78
75
  * // => [2, 2, 2]
79
76
  *
80
- * const result = fill([4, 6, 8, 10], '*', 1, 3);
77
+ * fill([4, 6, 8, 10], '*', 1, 3);
81
78
  * // => [4, '*', '*', 10]
82
79
  *
83
- * const result = fill(array, '*', -2, -1);
80
+ * fill([1, 2, 3], '*', -2, -1);
84
81
  * // => [1, '*', 3]
85
82
  */
86
83
  declare function fill<T, U>(array: Array<T | U>, value: U, start: number, end: number): Array<T | U>;
@@ -11,17 +11,16 @@
11
11
  * @returns {T[]} The array with the filled values.
12
12
  *
13
13
  * @example
14
- * const array = [1, 2, 3];
15
- * const result = fill(array, 'a');
14
+ * fill([1, 2, 3], 'a');
16
15
  * // => ['a', 'a', 'a']
17
16
  *
18
- * const result = fill(Array(3), 2);
17
+ * fill(Array(3), 2);
19
18
  * // => [2, 2, 2]
20
19
  *
21
- * const result = fill([4, 6, 8, 10], '*', 1, 3);
20
+ * fill([4, 6, 8, 10], '*', 1, 3);
22
21
  * // => [4, '*', '*', 10]
23
22
  *
24
- * const result = fill(array, '*', -2, -1);
23
+ * fill([1, 2, 3], '*', -2, -1);
25
24
  * // => [1, '*', 3]
26
25
  */
27
26
  declare function fill<T>(array: unknown[], value: T): T[];
@@ -40,17 +39,16 @@ declare function fill<T>(array: unknown[], value: T): T[];
40
39
  * @returns {Array<T | U>} The array with the filled values.
41
40
  *
42
41
  * @example
43
- * const array = [1, 2, 3];
44
- * const result = fill(array, 'a');
42
+ * fill([1, 2, 3], 'a');
45
43
  * // => ['a', 'a', 'a']
46
44
  *
47
- * const result = fill(Array(3), 2);
45
+ * fill(Array(3), 2);
48
46
  * // => [2, 2, 2]
49
47
  *
50
- * const result = fill([4, 6, 8, 10], '*', 1, 3);
48
+ * fill([4, 6, 8, 10], '*', 1, 3);
51
49
  * // => [4, '*', '*', 10]
52
50
  *
53
- * const result = fill(array, '*', -2, -1);
51
+ * fill([1, 2, 3], '*', -2, -1);
54
52
  * // => [1, '*', 3]
55
53
  */
56
54
  declare function fill<T, U>(array: Array<T | U>, value: U, start: number): Array<T | U>;
@@ -70,17 +68,16 @@ declare function fill<T, U>(array: Array<T | U>, value: U, start: number): Array
70
68
  * @returns {Array<T | U>} The array with the filled values.
71
69
  *
72
70
  * @example
73
- * const array = [1, 2, 3];
74
- * const result = fill(array, 'a');
71
+ * fill([1, 2, 3], 'a');
75
72
  * // => ['a', 'a', 'a']
76
73
  *
77
- * const result = fill(Array(3), 2);
74
+ * fill(Array(3), 2);
78
75
  * // => [2, 2, 2]
79
76
  *
80
- * const result = fill([4, 6, 8, 10], '*', 1, 3);
77
+ * fill([4, 6, 8, 10], '*', 1, 3);
81
78
  * // => [4, '*', '*', 10]
82
79
  *
83
- * const result = fill(array, '*', -2, -1);
80
+ * fill([1, 2, 3], '*', -2, -1);
84
81
  * // => [1, '*', 3]
85
82
  */
86
83
  declare function fill<T, U>(array: Array<T | U>, value: U, start: number, end: number): Array<T | U>;
@@ -15,10 +15,10 @@ import { ListIteratee } from '../_internal/ListIteratee.mjs';
15
15
  * // => [3]
16
16
  *
17
17
  * dropWhile([{ a: 1, b: 2 }, { a: 1, b: 3 }], { a: 1 })
18
- * // => [{ a: 1, b: 3 }]
18
+ * // => []
19
19
  *
20
20
  * dropWhile([{ a: 1, b: 2 }, { a: 1, b: 3 }], ['a', 1])
21
- * // => [{ a: 1, b: 3 }]
21
+ * // => []
22
22
  *
23
23
  * dropWhile([{ a: 1, b: 2 }, { a: 1, b: 3 }], 'a')
24
24
  * // => []
@@ -15,10 +15,10 @@ import { ListIteratee } from '../_internal/ListIteratee.js';
15
15
  * // => [3]
16
16
  *
17
17
  * dropWhile([{ a: 1, b: 2 }, { a: 1, b: 3 }], { a: 1 })
18
- * // => [{ a: 1, b: 3 }]
18
+ * // => []
19
19
  *
20
20
  * dropWhile([{ a: 1, b: 2 }, { a: 1, b: 3 }], ['a', 1])
21
- * // => [{ a: 1, b: 3 }]
21
+ * // => []
22
22
  *
23
23
  * dropWhile([{ a: 1, b: 2 }, { a: 1, b: 3 }], 'a')
24
24
  * // => []
@@ -15,7 +15,7 @@
15
15
  * // => 1
16
16
  *
17
17
  * lastIndexOf([1, 2, 1, 2], 2, true);
18
- * // => 3
18
+ * // => 1
19
19
  */
20
20
  declare function lastIndexOf<T>(array: ArrayLike<T> | null | undefined, searchElement: T, fromIndex?: true | number): number;
21
21
 
@@ -15,7 +15,7 @@
15
15
  * // => 1
16
16
  *
17
17
  * lastIndexOf([1, 2, 1, 2], 2, true);
18
- * // => 3
18
+ * // => 1
19
19
  */
20
20
  declare function lastIndexOf<T>(array: ArrayLike<T> | null | undefined, searchElement: T, fromIndex?: true | number): number;
21
21
 
@@ -8,7 +8,7 @@
8
8
  * @returns {number} Returns the index at which `value` should be inserted
9
9
  * into `array`.
10
10
  * @example
11
- * sortedIndex([4, 5, 5, 5, 6], 5)
11
+ * sortedLastIndex([4, 5, 5, 5, 6], 5)
12
12
  * // => 4
13
13
  */
14
14
  declare function sortedLastIndex<T>(array: ArrayLike<T> | null | undefined, value: T): number;
@@ -8,7 +8,7 @@
8
8
  * @returns {number} Returns the index at which `value` should be inserted
9
9
  * into `array`.
10
10
  * @example
11
- * sortedIndex([4, 5, 5, 5, 6], 5)
11
+ * sortedLastIndex([4, 5, 5, 5, 6], 5)
12
12
  * // => 4
13
13
  */
14
14
  declare function sortedLastIndex<T>(array: ArrayLike<T> | null | undefined, value: T): number;
@@ -20,7 +20,7 @@ import { PropertyPath } from '../_internal/PropertyPath.mjs';
20
20
  * // Set a value with a customizer that creates arrays for numeric path segments
21
21
  * const object = {};
22
22
  * setWith(object, '[0][1]', 'a', (value) => Array.isArray(value) ? value : []);
23
- * // => { '0': ['a'] }
23
+ * // => { '0': [, 'a'] }
24
24
  */
25
25
  declare function setWith<T extends object>(object: T, path: PropertyPath, value: any, customizer?: (nsValue: any, key: string, nsObject: T) => any): T;
26
26
  /**
@@ -44,7 +44,7 @@ declare function setWith<T extends object>(object: T, path: PropertyPath, value:
44
44
  * // Set a value with a customizer that creates arrays for numeric path segments
45
45
  * const object = {};
46
46
  * setWith(object, '[0][1]', 'a', (value) => Array.isArray(value) ? value : []);
47
- * // => { '0': ['a'] }
47
+ * // => { '0': [, 'a'] }
48
48
  */
49
49
  declare function setWith<T extends object, R>(object: T, path: PropertyPath, value: any, customizer?: (nsValue: any, key: string, nsObject: T) => any): R;
50
50
 
@@ -20,7 +20,7 @@ import { PropertyPath } from '../_internal/PropertyPath.js';
20
20
  * // Set a value with a customizer that creates arrays for numeric path segments
21
21
  * const object = {};
22
22
  * setWith(object, '[0][1]', 'a', (value) => Array.isArray(value) ? value : []);
23
- * // => { '0': ['a'] }
23
+ * // => { '0': [, 'a'] }
24
24
  */
25
25
  declare function setWith<T extends object>(object: T, path: PropertyPath, value: any, customizer?: (nsValue: any, key: string, nsObject: T) => any): T;
26
26
  /**
@@ -44,7 +44,7 @@ declare function setWith<T extends object>(object: T, path: PropertyPath, value:
44
44
  * // Set a value with a customizer that creates arrays for numeric path segments
45
45
  * const object = {};
46
46
  * setWith(object, '[0][1]', 'a', (value) => Array.isArray(value) ? value : []);
47
- * // => { '0': ['a'] }
47
+ * // => { '0': [, 'a'] }
48
48
  */
49
49
  declare function setWith<T extends object, R>(object: T, path: PropertyPath, value: any, customizer?: (nsValue: any, key: string, nsObject: T) => any): R;
50
50
 
@@ -18,7 +18,7 @@
18
18
  *
19
19
  * const func = over([{ a: 1 }, { b: 2 }]);
20
20
  * func({ a: 1, b: 2 });
21
- * // => [true, false]
21
+ * // => [true, true]
22
22
  *
23
23
  * const func = over([['a', 1], ['b', 2]]);
24
24
  * func({ a: 1, b: 2 });
@@ -18,7 +18,7 @@
18
18
  *
19
19
  * const func = over([{ a: 1 }, { b: 2 }]);
20
20
  * func({ a: 1, b: 2 });
21
- * // => [true, false]
21
+ * // => [true, true]
22
22
  *
23
23
  * const func = over([['a', 1], ['b', 2]]);
24
24
  * func({ a: 1, b: 2 });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "es-toolkit",
3
- "version": "1.45.1-dev.1769+9cc3d5db",
3
+ "version": "1.45.1-dev.1771+f6fa376f",
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",