JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 9
  • Score
    100M100P100Q78272F
  • License MIT

Creates an object composed of the picked object properties.

Package Exports

  • @queso/pick

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@queso/pick) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@queso/pick

npm license Travis Build Status codecov Try @queso/pick on RunKit

Part of a library of zero-dependency npm modules that do just one thing.

npm

min + gzip | 99 bytes

source

Creates an object composed of the picked object properties.

Usage

import pick from '@queso/pick'

const obj = { a: 1, b: 2, c: 3 }
pick(obj, 'a', 'c')
// => { a: 1, c: 3 }

Parameters

Name Type Description
object T The source object.
paths K[] The property paths to pick.

Type parameters

Name Constraint
T object
K keyof T

Returns

A new object composed of the picked object properties.

Return type

Partial<Pick<T, K>>