main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
830 bytes
|
Line | |
---|
1 | var _curry3 =
|
---|
2 | /*#__PURE__*/
|
---|
3 | require("./internal/_curry3.js");
|
---|
4 |
|
---|
5 | var path =
|
---|
6 | /*#__PURE__*/
|
---|
7 | require("./path.js");
|
---|
8 | /**
|
---|
9 | * Returns `true` if the specified object property at given path satisfies the
|
---|
10 | * given predicate; `false` otherwise.
|
---|
11 | *
|
---|
12 | * @func
|
---|
13 | * @memberOf R
|
---|
14 | * @since v0.19.0
|
---|
15 | * @category Logic
|
---|
16 | * @typedefn Idx = String | Int | Symbol
|
---|
17 | * @sig (a -> Boolean) -> [Idx] -> {a} -> Boolean
|
---|
18 | * @param {Function} pred
|
---|
19 | * @param {Array} propPath
|
---|
20 | * @param {*} obj
|
---|
21 | * @return {Boolean}
|
---|
22 | * @see R.propSatisfies, R.path
|
---|
23 | * @example
|
---|
24 | *
|
---|
25 | * R.pathSatisfies(y => y > 0, ['x', 'y'], {x: {y: 2}}); //=> true
|
---|
26 | * R.pathSatisfies(R.is(Object), [], {x: {y: 2}}); //=> true
|
---|
27 | */
|
---|
28 |
|
---|
29 |
|
---|
30 | var pathSatisfies =
|
---|
31 | /*#__PURE__*/
|
---|
32 | _curry3(function pathSatisfies(pred, propPath, obj) {
|
---|
33 | return pred(path(propPath, obj));
|
---|
34 | });
|
---|
35 |
|
---|
36 | module.exports = pathSatisfies; |
---|
Note:
See
TracBrowser
for help on using the repository browser.