es-toolkit 1.44.0-dev.1731 → 1.44.0-dev.1737

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.
@@ -25,7 +25,7 @@ async function retry(func, _options) {
25
25
  shouldRetry = _options?.shouldRetry ?? DEFAULT_SHOULD_RETRY;
26
26
  }
27
27
  let error;
28
- for (let attempts = 0; attempts < retries; attempts++) {
28
+ for (let attempts = 0; attempts <= retries; attempts++) {
29
29
  if (signal?.aborted) {
30
30
  throw error ?? new Error(`The retry operation was aborted due to an abort signal.`);
31
31
  }
@@ -21,7 +21,7 @@ async function retry(func, _options) {
21
21
  shouldRetry = _options?.shouldRetry ?? DEFAULT_SHOULD_RETRY;
22
22
  }
23
23
  let error;
24
- for (let attempts = 0; attempts < retries; attempts++) {
24
+ for (let attempts = 0; attempts <= retries; attempts++) {
25
25
  if (signal?.aborted) {
26
26
  throw error ?? new Error(`The retry operation was aborted due to an abort signal.`);
27
27
  }
@@ -15,24 +15,6 @@
15
15
  * const result = omit(obj, ['b', 'c']);
16
16
  * // result will be { a: 1 }
17
17
  */
18
- declare function omit<T extends Record<PropertyKey, any>, K extends keyof T>(obj: T, keys: readonly K[]): Omit<T, K>;
19
- /**
20
- * Creates a new object with specified keys omitted.
21
- *
22
- * This overload supports dynamic key arrays determined at runtime,
23
- * useful when working with keys from Object.keys() or similar operations.
24
- *
25
- * @template T - The type of object.
26
- * @param {T} obj - The object to omit keys from.
27
- * @param {PropertyKey[]} keys - An array of keys to be omitted from the object. Supports dynamic arrays.
28
- * @returns {Partial<T>} A new object with the specified keys omitted.
29
- *
30
- * @example
31
- * const obj = { a: 1, b: 2, c: 3 };
32
- * const keysToOmit = Object.keys({ b: true, c: true }); // string[]
33
- * const result = omit(obj, keysToOmit);
34
- * // result will be { a: 1 }
35
- */
36
- declare function omit<T extends Record<PropertyKey, any>>(obj: T, keys: readonly PropertyKey[]): Partial<T>;
18
+ declare function omit<T extends Record<string, any>, K extends keyof T>(obj: T, keys: readonly K[]): Omit<T, K>;
37
19
 
38
20
  export { omit };
@@ -15,24 +15,6 @@
15
15
  * const result = omit(obj, ['b', 'c']);
16
16
  * // result will be { a: 1 }
17
17
  */
18
- declare function omit<T extends Record<PropertyKey, any>, K extends keyof T>(obj: T, keys: readonly K[]): Omit<T, K>;
19
- /**
20
- * Creates a new object with specified keys omitted.
21
- *
22
- * This overload supports dynamic key arrays determined at runtime,
23
- * useful when working with keys from Object.keys() or similar operations.
24
- *
25
- * @template T - The type of object.
26
- * @param {T} obj - The object to omit keys from.
27
- * @param {PropertyKey[]} keys - An array of keys to be omitted from the object. Supports dynamic arrays.
28
- * @returns {Partial<T>} A new object with the specified keys omitted.
29
- *
30
- * @example
31
- * const obj = { a: 1, b: 2, c: 3 };
32
- * const keysToOmit = Object.keys({ b: true, c: true }); // string[]
33
- * const result = omit(obj, keysToOmit);
34
- * // result will be { a: 1 }
35
- */
36
- declare function omit<T extends Record<PropertyKey, any>>(obj: T, keys: readonly PropertyKey[]): Partial<T>;
18
+ declare function omit<T extends Record<string, any>, K extends keyof T>(obj: T, keys: readonly K[]): Omit<T, K>;
37
19
 
38
20
  export { omit };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "es-toolkit",
3
- "version": "1.44.0-dev.1731+40d9e722",
3
+ "version": "1.44.0-dev.1737+95858e96",
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",