JSPM

@queso/pick-by

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q27126F
  • License MIT

Creates an object composed of the object properties for which predicate returns truthy.

Package Exports

  • @queso/pick-by

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-by) 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-by

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

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

npm

min + gzip | 124 bytes

source

Creates an object composed of the object properties for which predicate returns truthy.

Usage

import pickBy from '@queso/pick-by'

const obj = { a: 0, b: '', c: true, d: 'hello' }
pickBy(obj)
// => { c: true, d: 'hello' }

Parameters

Name Type Description
object T The source object.
predicate <K extends keyof T>(value: T[K], key: K) => any The function invoked per property.

Type parameters

Name Constraint
T object
K keyof T

Returns

The new object.

Return type

Partial<T>