UNPKG

842 BJavaScriptView Raw
1var _curry3 =
2/*#__PURE__*/
3require("./internal/_curry3");
4
5var equals =
6/*#__PURE__*/
7require("./equals");
8/**
9 * Reports whether two objects have the same value, in [`R.equals`](#equals)
10 * terms, for the specified property. Useful as a curried predicate.
11 *
12 * @func
13 * @memberOf R
14 * @since v0.1.0
15 * @category Object
16 * @sig k -> {k: v} -> {k: v} -> Boolean
17 * @param {String} prop The name of the property to compare
18 * @param {Object} obj1
19 * @param {Object} obj2
20 * @return {Boolean}
21 *
22 * @example
23 *
24 * const o1 = { a: 1, b: 2, c: 3, d: 4 };
25 * const o2 = { a: 10, b: 20, c: 3, d: 40 };
26 * R.eqProps('a', o1, o2); //=> false
27 * R.eqProps('c', o1, o2); //=> true
28 */
29
30
31var eqProps =
32/*#__PURE__*/
33_curry3(function eqProps(prop, obj1, obj2) {
34 return equals(obj1[prop], obj2[prop]);
35});
36
37module.exports = eqProps;
\No newline at end of file