source: node_modules/ramda/es/eqProps.js@ d24f17c

main
Last change on this file since d24f17c was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 810 bytes
Line 
1import _curry3 from "./internal/_curry3.js";
2import equals from "./equals.js";
3/**
4 * Reports whether two objects have the same value, in [`R.equals`](#equals)
5 * terms, for the specified property. Useful as a curried predicate.
6 *
7 * @func
8 * @memberOf R
9 * @since v0.1.0
10 * @category Object
11 * @sig k -> {k: v} -> {k: v} -> Boolean
12 * @param {String} prop The name of the property to compare
13 * @param {Object} obj1
14 * @param {Object} obj2
15 * @return {Boolean}
16 *
17 * @example
18 *
19 * const o1 = { a: 1, b: 2, c: 3, d: 4 };
20 * const o2 = { a: 10, b: 20, c: 3, d: 40 };
21 * R.eqProps('a', o1, o2); //=> false
22 * R.eqProps('c', o1, o2); //=> true
23 */
24
25var eqProps =
26/*#__PURE__*/
27_curry3(function eqProps(prop, obj1, obj2) {
28 return equals(obj1[prop], obj2[prop]);
29});
30
31export default eqProps;
Note: See TracBrowser for help on using the repository browser.