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:
840 bytes
|
Line | |
---|
1 | import _curry1 from "./internal/_curry1.js";
|
---|
2 | import empty from "./empty.js";
|
---|
3 | import equals from "./equals.js";
|
---|
4 | /**
|
---|
5 | * Returns `true` if the given value is its type's empty value; `false`
|
---|
6 | * otherwise.
|
---|
7 | *
|
---|
8 | * @func
|
---|
9 | * @memberOf R
|
---|
10 | * @since v0.1.0
|
---|
11 | * @category Logic
|
---|
12 | * @sig a -> Boolean
|
---|
13 | * @param {*} x
|
---|
14 | * @return {Boolean}
|
---|
15 | * @see R.empty
|
---|
16 | * @example
|
---|
17 | *
|
---|
18 | * R.isEmpty([1, 2, 3]); //=> false
|
---|
19 | * R.isEmpty([]); //=> true
|
---|
20 | * R.isEmpty(''); //=> true
|
---|
21 | * R.isEmpty(null); //=> false
|
---|
22 | * R.isEmpty({}); //=> true
|
---|
23 | * R.isEmpty({length: 0}); //=> false
|
---|
24 | * R.isEmpty(Uint8Array.from('')); //=> true
|
---|
25 | */
|
---|
26 |
|
---|
27 | var isEmpty =
|
---|
28 | /*#__PURE__*/
|
---|
29 | _curry1(function isEmpty(x) {
|
---|
30 | return x != null && equals(x, empty(x));
|
---|
31 | });
|
---|
32 |
|
---|
33 | export default isEmpty; |
---|
Note:
See
TracBrowser
for help on using the repository browser.