UNPKG

typedash

Version:

modern, type-safe collection of utility functions

16 lines (14 loc) 734 B
import { n as createObjectPredicate, t as filterObject } from "./filterObject-CMlrMYad.js"; //#region src/functions/pick/pick.ts /** * Implementation for all overloads. * @param object The input object to pick properties from. * @param propertiesOrPredicate Either an array of property names to pick from the input object or 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 specified properties from the input object. */ function pick(object, propertiesOrPredicate) { return filterObject(object, createObjectPredicate(propertiesOrPredicate)); } //#endregion export { pick as t }; //# sourceMappingURL=pick-Cc6RPGAG.js.map