pick-by

v0.9.6arrow_drop_down
v0.9.6
STATUS
Passing
DOWNLOADS
2
VISIBILITY
Public
PUBLISHED
5 years ago
SIZE
820 B
Returns a partial copy of an object containing only the keys that satisfy the supplied predicate.
1 contributor
Install pick-by as a package?
Copied
npm i @bit/justin-capalbo.ramda.pick-by
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
toggle layout
No preview available
modifieddraft
chevron_left
chevron_right
pickBy (
pred:Function,
obj:Object
) : Object

Returns a partial copy of an object containing only the keys that satisfy the supplied predicate.

Example
const isUpperCase = (val, key) => key.toUpperCase() === key;
     R.pickBy(isUpperCase, {a: 1, b: 2, A: 3, B: 4}); //=> {A: 3, B: 4}
Arguments
pred: Function

A predicate to determine whether or not a key should be included on the output object.

obj: Object

The object to copy from

Returns
Object

A new object with only properties that satisfy `pred` on it.

Help and resources