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:
953 bytes
|
Line | |
---|
1 | var _curry2 =
|
---|
2 | /*#__PURE__*/
|
---|
3 | require("./internal/_curry2.js");
|
---|
4 |
|
---|
5 | var hasPath =
|
---|
6 | /*#__PURE__*/
|
---|
7 | require("./hasPath.js");
|
---|
8 | /**
|
---|
9 | * Returns whether or not an object has an own property with the specified name
|
---|
10 | *
|
---|
11 | * @func
|
---|
12 | * @memberOf R
|
---|
13 | * @since v0.7.0
|
---|
14 | * @category Object
|
---|
15 | * @sig s -> {s: x} -> Boolean
|
---|
16 | * @param {String} prop The name of the property to check for.
|
---|
17 | * @param {Object} obj The object to query.
|
---|
18 | * @return {Boolean} Whether the property exists.
|
---|
19 | * @example
|
---|
20 | *
|
---|
21 | * const hasName = R.has('name');
|
---|
22 | * hasName({name: 'alice'}); //=> true
|
---|
23 | * hasName({name: 'bob'}); //=> true
|
---|
24 | * hasName({}); //=> false
|
---|
25 | *
|
---|
26 | * const point = {x: 0, y: 0};
|
---|
27 | * const pointHas = R.has(R.__, point);
|
---|
28 | * pointHas('x'); //=> true
|
---|
29 | * pointHas('y'); //=> true
|
---|
30 | * pointHas('z'); //=> false
|
---|
31 | */
|
---|
32 |
|
---|
33 |
|
---|
34 | var has =
|
---|
35 | /*#__PURE__*/
|
---|
36 | _curry2(function has(prop, obj) {
|
---|
37 | return hasPath([prop], obj);
|
---|
38 | });
|
---|
39 |
|
---|
40 | module.exports = has; |
---|
Note:
See
TracBrowser
for help on using the repository browser.