where-eq

v0.9.6arrow_drop_down
v0.9.6
STATUS
Passing
DOWNLOADS
2
VISIBILITY
Public
PUBLISHED
5 years ago
SIZE
3 KB
Takes a spec object and a test object; returns true if the test satisfies the spec, false otherwise.
1 contributor
Install where-eq as a package?
Copied
npm i @bit/justin-capalbo.ramda.where-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
whereEq (
spec:Object,
testObj:Object
) : Boolean

Takes a spec object and a test object; returns true if the test satisfies the spec, false otherwise. An object satisfies the spec if, for each of the spec’s own properties, accessing that property of the object gives the same value (in R.equals terms) as accessing that property of the spec.

whereEq is a specialization of where.

Example
// pred :: Object -> Boolean
     const pred = R.whereEq({a: 1, b: 2});

     pred({a: 1});              //=> false
     pred({a: 1, b: 2});        //=> true
     pred({a: 1, b: 2, c: 3});  //=> true
     pred({a: 1, b: 1});        //=> false
Arguments
spec: Object
testObj: Object
Returns
Boolean

Help and resources