@queso/pick-by
Creates an object composed of the object properties for which predicate returns truthy.
Last updated 3 years ago by jedmao .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @queso/pick-by 
SYNC missed versions from official npm registry.

@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>

Current Tags

  • 0.1.0                                ...           latest (3 years ago)

1 Versions

  • 0.1.0                                ...           3 years ago
Maintainers (1)
Downloads
Total 51
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 2
Last Month 2
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (1)

Copyright 2014 - 2021 © npmmirror.com |