UNPKG

710 BJavaScriptView Raw
1var _curry3 =
2/*#__PURE__*/
3require("./internal/_curry3");
4/**
5 * Returns `true` if the specified object property satisfies the given
6 * predicate; `false` otherwise. You can test multiple properties with
7 * [`R.where`](#where).
8 *
9 * @func
10 * @memberOf R
11 * @since v0.16.0
12 * @category Logic
13 * @sig (a -> Boolean) -> String -> {String: a} -> Boolean
14 * @param {Function} pred
15 * @param {String} name
16 * @param {*} obj
17 * @return {Boolean}
18 * @see R.where, R.propEq, R.propIs
19 * @example
20 *
21 * R.propSatisfies(x => x > 0, 'x', {x: 1, y: 2}); //=> true
22 */
23
24
25var propSatisfies =
26/*#__PURE__*/
27_curry3(function propSatisfies(pred, name, obj) {
28 return pred(obj[name]);
29});
30
31module.exports = propSatisfies;
\No newline at end of file