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

utils/has
v1.1.0
1.1.0
1.0.0
MIT
PUBLIC
3
Build: fail
BuildFail
Build Status: fail
Returns whether or not an object has an own property with the specified name

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/has in your project
npm i @bit/bit.ramda.utils.has
Copied

has (prop:String, obj:Object) : Boolean

Returns whether or not an object has an own property with the specified name

Example

var hasName = R.has('name');
     hasName({name: 'alice'});   //=> true
     hasName({name: 'bob'});     //=> true
     hasName({});                //=> false

     var point = {x: 0, y: 0};
     var pointHas = R.has(R.__, point);
     pointHas('x');  //=> true
     pointHas('y');  //=> true
     pointHas('z');  //=> false

Arguments

prop: String

The name of the property to check for.

obj: Object

The object to query.

Returns

Boolean

Whether the property exists.