diginext-utils
Version:
README.md
17 lines • 579 B
TypeScript
/**
* Creates a new object with only the specified keys from the source object.
*
* @template T - The type of the source object
* @template K - The keys to pick
* @param obj - The source object
* @param keys - The keys to include in the new object
* @returns A new object with only the specified keys
*
* @example
* ```ts
* const obj = { a: 1, b: 2, c: 3, d: 4 };
* pick(obj, ['a', 'c']); // { a: 1, c: 3 }
* ```
*/
export declare function pick<T extends Record<string, unknown>, K extends keyof T>(obj: T, keys: K[]): Pick<T, K>;
//# sourceMappingURL=pick.d.ts.map