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