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 | function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
---|
2 | import { type, curryN } from 'ramda';
|
---|
3 |
|
---|
4 | /**
|
---|
5 | * Checks if input value is a Symbol.
|
---|
6 | *
|
---|
7 | * @func isSymbol
|
---|
8 | * @memberOf RA
|
---|
9 | * @since {@link https://char0n.github.io/ramda-adjunct/2.22.0|v2.22.0}
|
---|
10 | * @category Type
|
---|
11 | * @sig * -> Boolean
|
---|
12 | * @param {*} val The value to test
|
---|
13 | * @return {boolean}
|
---|
14 | * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol|MDN Symbol}
|
---|
15 | * @example
|
---|
16 | *
|
---|
17 | * RA.isSymbol(Symbol('1')); //=> true
|
---|
18 | * RA.isSymbol(Symbol(1)); //=> true
|
---|
19 | * RA.isSymbol('string'); //=> false
|
---|
20 | * RA.isSymbol(undefined); //=> false
|
---|
21 | * RA.isSymbol(null); //=> false
|
---|
22 | */
|
---|
23 | var isSymbol = curryN(1, function (val) {
|
---|
24 | return _typeof(val) === 'symbol' || _typeof(val) === 'object' && type(val) === 'Symbol';
|
---|
25 | });
|
---|
26 | export default isSymbol; |
---|
Note:
See
TracBrowser
for help on using the repository browser.