pick
Commons
stable
Extract a subset of an object's own enumerable keys into a new object. Only keys that actually exist on `obj` are included — missing keys are silently skipped (contrast with `only`, which copies all listed keys unconditionally).
API
Signature
Signature TypeScript complète, extraite du fichier util.
API
Paramètres
Paramètres d'entrée acceptés par cet util.
- objrequisT
- The source object to extract properties from.
- pathsrequisArray<U>
- Array of key names to include. Only keys that exist in the source object (checked via `Object.keys`) are copied; absent keys are skipped.
API
Valeur de retour
La valeur retournée par cet util.
- A new object with only the requested keys that were present on the source. Does not mutate the original.
Usage
Exemples
Extraits de code prêts à coller.
Extract known keys from an object