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:
729 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | import _curry3 from "./internal/_curry3.js";
|
---|
| 2 | import prop from "./prop.js";
|
---|
| 3 | /**
|
---|
| 4 | * Returns `true` if the specified object property satisfies the given
|
---|
| 5 | * predicate; `false` otherwise. You can test multiple properties with
|
---|
| 6 | * [`R.where`](#where).
|
---|
| 7 | *
|
---|
| 8 | * @func
|
---|
| 9 | * @memberOf R
|
---|
| 10 | * @since v0.16.0
|
---|
| 11 | * @category Logic
|
---|
| 12 | * @sig (a -> Boolean) -> String -> {String: a} -> Boolean
|
---|
| 13 | * @param {Function} pred
|
---|
| 14 | * @param {String} name
|
---|
| 15 | * @param {*} obj
|
---|
| 16 | * @return {Boolean}
|
---|
| 17 | * @see R.where, R.propEq, R.propIs
|
---|
| 18 | * @example
|
---|
| 19 | *
|
---|
| 20 | * R.propSatisfies(x => x > 0, 'x', {x: 1, y: 2}); //=> true
|
---|
| 21 | */
|
---|
| 22 |
|
---|
| 23 | var propSatisfies =
|
---|
| 24 | /*#__PURE__*/
|
---|
| 25 | _curry3(function propSatisfies(pred, name, obj) {
|
---|
| 26 | return pred(prop(name, obj));
|
---|
| 27 | });
|
---|
| 28 |
|
---|
| 29 | export default propSatisfies; |
---|
Note:
See
TracBrowser
for help on using the repository browser.