prop-eq

v0.9.6arrow_drop_down
v0.9.6
STATUS
Passing
DOWNLOADS
2
VISIBILITY
Public
PUBLISHED
5 years ago
SIZE
2 KB
Returns `true` if the specified object property is equal, in [`R.equals`](#equals) terms, to the given value; `false` otherwise.
1 contributor
Install prop-eq as a package?
Copied
npm i @bit/justin-capalbo.ramda.prop-eq
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
propEq (
name:String,
val:*,
obj:*
) : Boolean

Returns true if the specified object property is equal, in R.equals terms, to the given value; false otherwise. You can test multiple properties with R.whereEq.

Example
const abby = {name: 'Abby', age: 7, hair: 'blond'};
     const fred = {name: 'Fred', age: 12, hair: 'brown'};
     const rusty = {name: 'Rusty', age: 10, hair: 'brown'};
     const alois = {name: 'Alois', age: 15, disposition: 'surly'};
     const kids = [abby, fred, rusty, alois];
     const hasBrownHair = R.propEq('hair', 'brown');
     R.filter(hasBrownHair, kids); //=> [fred, rusty]
Arguments
name: String
val: *
obj: *
Returns
Boolean

Help and resources