- pick<T, P>(object, ...paths): IfCouldBe<T, Nil, {}> | {
[K in P[number]]: NonNullable<T>[K]
} Type Parameters
- T
- P extends readonly (keyof NonNullable<T>)[]
Parameters
- object: T
Rest
...paths: P
Returns IfCouldBe<T, Nil, {}> | {
[K in P[number]]: NonNullable<T>[K]
}
Creates an object composed of the picked
object
properties.Differences from lodash:
paths
must be direct properties ofobject
(they cannot references deep properties)Contribution to minified bundle size, when it is the only function imported: