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:
795 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | import { identical, curryN } from 'ramda';
|
---|
| 2 |
|
---|
| 3 | /**
|
---|
| 4 | * Checks if input value is the Boolean primitive `true`. Will return false for Boolean objects
|
---|
| 5 | * created using the `Boolean` function as a constructor.
|
---|
| 6 | *
|
---|
| 7 | * @func isTrue
|
---|
| 8 | * @memberOf RA
|
---|
| 9 | * @since {@link https://char0n.github.io/ramda-adjunct/2.6.0|v2.6.0}
|
---|
| 10 | * @category Type
|
---|
| 11 | * @sig * -> Boolean
|
---|
| 12 | * @param {*} val The value to test
|
---|
| 13 | * @return {boolean}
|
---|
| 14 | * @see {@link RA.isFalse|isFalse}, {@link RA.isTruthy|isTruthy}, {@link RA.isFalsy|isFalsy}
|
---|
| 15 | * @example
|
---|
| 16 | *
|
---|
| 17 | * RA.isTrue(true); // => true
|
---|
| 18 | * RA.isTrue(Boolean(true)); // => true
|
---|
| 19 | * RA.isTrue(false); // => false
|
---|
| 20 | * RA.isTrue(1); // => false
|
---|
| 21 | * RA.isTrue('true'); // => false
|
---|
| 22 | * RA.isTrue(new Boolean(true)); // => false
|
---|
| 23 | */
|
---|
| 24 |
|
---|
| 25 | const isTrue = curryN(1, identical(true));
|
---|
| 26 |
|
---|
| 27 | export default isTrue;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.