typedash
Version:
modern, type-safe collection of utility functions
23 lines (22 loc) • 1.33 kB
text/typescript
import { t as KeysOfUnion } from "./KeysOfUnion-D3-apcAx.cjs";
import { t as Many } from "./Many-bCNxekD7.cjs";
import { t as Maybe } from "./Maybe-BVpZiDsE.cjs";
import { t as ObjectPredicate } from "./createObjectPredicate-Cdp8ClLZ.cjs";
//#region src/functions/pick/pick.d.ts
/**
* Returns a new object with only the specified properties from the input object.
* @param object The input object to pick properties from.
* @param properties An array of property names to pick from the input object.
* @returns A new object with only the specified properties from the input object.
*/
declare function pick<T extends object, const K extends keyof T | KeysOfUnion<T>>(object: Maybe<T>, properties: Many<K>): Pick<T, K>;
/**
* Returns a new object with only the properties that satisfy the predicate function from the input object.
* @param object The input object to pick properties from.
* @param predicate A function that takes a property value and its key and returns a boolean indicating whether to pick the property or not.
* @returns A new object with only the properties that satisfy the predicate function from the input object.
*/
declare function pick<T extends object>(object: Maybe<T>, predicate: ObjectPredicate<T>): Partial<T>;
//#endregion
export { pick as t };
//# sourceMappingURL=pick-Cn_a-2yu.d.cts.map