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