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:
1.1 KB
|
Line | |
---|
1 | "use strict";
|
---|
2 |
|
---|
3 | exports.__esModule = true;
|
---|
4 | exports["default"] = void 0;
|
---|
5 | var _ramda = require("ramda");
|
---|
6 | var _isInteger = _interopRequireDefault(require("./isInteger32"));
|
---|
7 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
---|
8 | /**
|
---|
9 | * Checks whether the passed value is {@link https://github.com/getify/You-Dont-Know-JS/blob/9959fc904d584bbf0b02cf41c192f74ff4238581/types-grammar/ch4.md#the-curious-case-of-the-|a sentinel value}.
|
---|
10 | *
|
---|
11 | * @func isSentinelValue
|
---|
12 | * @memberOf RA
|
---|
13 | * @since {@link https://char0n.github.io/ramda-adjunct/2.33.0|v2.33.0}
|
---|
14 | * @category Type
|
---|
15 | * @sig * -> Boolean
|
---|
16 | * @param {*} val The value to test
|
---|
17 | * @return {boolean}
|
---|
18 | * @example
|
---|
19 | *
|
---|
20 | * RA.isSentinelValue(-1); //=> true
|
---|
21 | *
|
---|
22 | * RA.isSentinelValue('-1'); //=> false
|
---|
23 | * RA.isSentinelValue(1); //=> false
|
---|
24 | * RA.isSentinelValue([-1]); //=> false
|
---|
25 | */ // eslint-disable-next-line no-bitwise
|
---|
26 | var isSentinelValue = (0, _ramda.curryN)(1, function (val) {
|
---|
27 | return (0, _isInteger["default"])(val) && ~val === 0;
|
---|
28 | });
|
---|
29 | var _default = isSentinelValue;
|
---|
30 | exports["default"] = _default; |
---|
Note:
See
TracBrowser
for help on using the repository browser.