es-toolkit 1.52.0-dev.2096 → 1.52.0-dev.2097

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.
@@ -1,3 +1,5 @@
1
+ import { ObjectKeys } from "../types/ObjectKeys.mjs";
2
+
1
3
  //#region src/object/findKey.d.ts
2
4
  /**
3
5
  * Finds the key of the first element in the object that satisfies the provided testing function.
@@ -17,6 +19,6 @@
17
19
  * };
18
20
  * findKey(users, function(o) { return o.age < 40; }); => 'barney'
19
21
  */
20
- declare function findKey<T extends Record<any, any>>(obj: T, predicate: (value: T[keyof T], key: keyof T, obj: T) => boolean): keyof T | undefined;
22
+ declare function findKey<T extends Record<any, any>>(obj: T, predicate: (value: T[keyof T], key: ObjectKeys<T>, obj: T) => boolean): ObjectKeys<T> | undefined;
21
23
  //#endregion
22
24
  export { findKey };
@@ -1,3 +1,5 @@
1
+ import { ObjectKeys } from "../types/ObjectKeys.js";
2
+
1
3
  //#region src/object/findKey.d.ts
2
4
  /**
3
5
  * Finds the key of the first element in the object that satisfies the provided testing function.
@@ -17,6 +19,6 @@
17
19
  * };
18
20
  * findKey(users, function(o) { return o.age < 40; }); => 'barney'
19
21
  */
20
- declare function findKey<T extends Record<any, any>>(obj: T, predicate: (value: T[keyof T], key: keyof T, obj: T) => boolean): keyof T | undefined;
22
+ declare function findKey<T extends Record<any, any>>(obj: T, predicate: (value: T[keyof T], key: ObjectKeys<T>, obj: T) => boolean): ObjectKeys<T> | undefined;
21
23
  //#endregion
22
24
  export { findKey };
@@ -1,3 +1,5 @@
1
+ import { ObjectKeys } from "../types/ObjectKeys.mjs";
2
+
1
3
  //#region src/object/mapKeys.d.ts
2
4
  /**
3
5
  * Creates a new object with the same values as the given object, but with keys generated
@@ -16,6 +18,6 @@
16
18
  * const result = mapKeys(obj, (value, key) => key + value);
17
19
  * console.log(result); // { a1: 1, b2: 2 }
18
20
  */
19
- declare function mapKeys<T extends Record<PropertyKey, any>, K extends PropertyKey>(object: T, getNewKey: (value: T[keyof T], key: keyof T, object: T) => K): Record<K, T[keyof T]>;
21
+ declare function mapKeys<T extends Record<PropertyKey, any>, K extends PropertyKey>(object: T, getNewKey: (value: T[keyof T], key: ObjectKeys<T>, object: T) => K): Record<K, T[keyof T]>;
20
22
  //#endregion
21
23
  export { mapKeys };
@@ -1,3 +1,5 @@
1
+ import { ObjectKeys } from "../types/ObjectKeys.js";
2
+
1
3
  //#region src/object/mapKeys.d.ts
2
4
  /**
3
5
  * Creates a new object with the same values as the given object, but with keys generated
@@ -16,6 +18,6 @@
16
18
  * const result = mapKeys(obj, (value, key) => key + value);
17
19
  * console.log(result); // { a1: 1, b2: 2 }
18
20
  */
19
- declare function mapKeys<T extends Record<PropertyKey, any>, K extends PropertyKey>(object: T, getNewKey: (value: T[keyof T], key: keyof T, object: T) => K): Record<K, T[keyof T]>;
21
+ declare function mapKeys<T extends Record<PropertyKey, any>, K extends PropertyKey>(object: T, getNewKey: (value: T[keyof T], key: ObjectKeys<T>, object: T) => K): Record<K, T[keyof T]>;
20
22
  //#endregion
21
23
  export { mapKeys };
@@ -1,6 +1,6 @@
1
+ import { ObjectKeys } from "./ObjectKeys.mjs";
1
2
  import { Simplify } from "./Simplify.mjs";
2
3
  import { Merge } from "./Merge.mjs";
3
- import { ObjectKeys } from "./ObjectKeys.mjs";
4
4
  import { ToCamelCaseKeys } from "./ToCamelCaseKeys.mjs";
5
5
  import { ToConstantCaseKeys } from "./ToConstantCaseKeys.mjs";
6
6
  import { ToKebabCaseKeys } from "./ToKebabCaseKeys.mjs";
@@ -1,6 +1,6 @@
1
+ import { ObjectKeys } from "./ObjectKeys.js";
1
2
  import { Simplify } from "./Simplify.js";
2
3
  import { Merge } from "./Merge.js";
3
- import { ObjectKeys } from "./ObjectKeys.js";
4
4
  import { ToCamelCaseKeys } from "./ToCamelCaseKeys.js";
5
5
  import { ToConstantCaseKeys } from "./ToConstantCaseKeys.js";
6
6
  import { ToKebabCaseKeys } from "./ToKebabCaseKeys.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "es-toolkit",
3
- "version": "1.52.0-dev.2096+6380c75e",
3
+ "version": "1.52.0-dev.2097+0c731e9b",
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",