init
This commit is contained in:
31
node_modules/ramda/es/prop.js
generated
vendored
Normal file
31
node_modules/ramda/es/prop.js
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
import _curry2 from "./internal/_curry2.js";
|
||||
import path from "./path.js";
|
||||
/**
|
||||
* Returns a function that when supplied an object returns the indicated
|
||||
* property of that object, if it exists.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.1.0
|
||||
* @category Object
|
||||
* @typedefn Idx = String | Int
|
||||
* @sig Idx -> {s: a} -> a | Undefined
|
||||
* @param {String|Number} p The property name or array index
|
||||
* @param {Object} obj The object to query
|
||||
* @return {*} The value at `obj.p`.
|
||||
* @see R.path, R.nth
|
||||
* @example
|
||||
*
|
||||
* R.prop('x', {x: 100}); //=> 100
|
||||
* R.prop('x', {}); //=> undefined
|
||||
* R.prop(0, [100]); //=> 100
|
||||
* R.compose(R.inc, R.prop('x'))({ x: 3 }) //=> 4
|
||||
*/
|
||||
|
||||
var prop =
|
||||
/*#__PURE__*/
|
||||
_curry2(function prop(p, obj) {
|
||||
return path([p], obj);
|
||||
});
|
||||
|
||||
export default prop;
|
Reference in New Issue
Block a user