Start sharing components as a team!Share components as a team!Join Bit to build your applications faster.Get Started Free

pick-by

v0.26.1arrow_drop_down
v0.26.1
STATUS
Passing
DOWNLOADS
0
LICENSE
MIT
VISIBILITY
Public
PUBLISHED
7 months ago
SIZE
827 B
subject
Returns a partial copy of an object containing only the keys that satisfy the supplied predicate.
1 contributor
Use pick-by in your project ?
Copied
npm i @bit/ramda.ramda.pick-by
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.dev
Component Example
React
React
Vue
Angular
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';
revert changes
reload
toggle layout
maximize
key.toUpperCase();
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.