Share your code. Components are building blocks, you are the architect.

utils/path-eq
v1.1.0
1.1.0
1.0.0
MIT
PUBLIC
3
Build: fail
BuildFail
Build Status: fail
Determines whether a nested path on an object has a specific value, in

Please configure Bit as a scoped registry to install components with NPM.Learn more

npm config set '@bit:registry' https://node.bitsrc.io
Use utils/path-eq in your project
npm i @bit/bit.ramda.utils.path-eq
Copied

pathEq (path:Array, val:*, obj:Object) : Boolean

Determines whether a nested path on an object has a specific value, in R.equals terms. Most likely used to filter a list.

Example

var user1 = { address: { zipCode: 90210 } };
     var user2 = { address: { zipCode: 55555 } };
     var user3 = { name: 'Bob' };
     var users = [ user1, user2, user3 ];
     var isFamous = R.pathEq(['address', 'zipCode'], 90210);
     R.filter(isFamous, users); //=> [ user1 ]

Arguments

path: Array

The path of the nested property to use

val: *

The value to compare the nested property with

obj: Object

The object to check the nested property in

Returns

Boolean

`true` if the value equals the nested object property, `false` otherwise.