ramda-adjunct 5.0.0 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/README.md +1 -1
- package/dist/RA.node.js +10444 -452
- package/dist/RA.node.min.js +1 -1
- package/dist/RA.web.js +10444 -452
- package/dist/RA.web.min.js +1 -1
- package/dist/RA.web.standalone.js +18665 -447
- package/dist/RA.web.standalone.min.js +1 -1
- package/dist/package.json +1 -0
- package/es/copyKeys.js +1 -1
- package/es/dispatch.js +5 -5
- package/es/fantasy-land/Identity.js +3 -3
- package/es/fantasy-land/traits.js +1 -1
- package/es/flattenDepth.js +5 -5
- package/es/internal/ponyfills/Array.from.js +5 -5
- package/es/internal/ponyfills/Promise.allSettled.js +5 -5
- package/es/internal/ponyfills/Promise.any.js +15 -15
- package/es/lastP.js +5 -5
- package/es/reduceP.js +4 -4
- package/es/reduceRightP.js +4 -4
- package/es/renameKey.js +1 -1
- package/es/sortByProps.js +5 -5
- package/lib/allEqual.js +1 -1
- package/lib/allIdentical.js +1 -1
- package/lib/allSettledP.js +1 -1
- package/lib/allUnique.js +1 -1
- package/lib/anyP.js +1 -1
- package/lib/argsPass.js +1 -1
- package/lib/async.js +1 -1
- package/lib/cata.js +1 -1
- package/lib/compact.js +1 -1
- package/lib/concatAll.js +1 -1
- package/lib/copyKeys.js +2 -2
- package/lib/curryRight.js +1 -1
- package/lib/delayP.js +1 -1
- package/lib/dispatch.js +6 -6
- package/lib/ensureArray.js +1 -1
- package/lib/escapeRegExp.js +1 -1
- package/lib/fantasy-land/Identity.js +3 -3
- package/lib/fantasy-land/traits.js +2 -2
- package/lib/flattenDepth.js +6 -6
- package/lib/flattenProp.js +1 -1
- package/lib/fnull.js +1 -1
- package/lib/index.js +1 -1
- package/lib/internal/ap.js +1 -1
- package/lib/internal/isCoercible.js +1 -1
- package/lib/internal/makeFlat.js +1 -1
- package/lib/internal/ponyfills/Array.from.js +6 -6
- package/lib/internal/ponyfills/Math.trunc.js +1 -1
- package/lib/internal/ponyfills/Number.isFinite.js +1 -1
- package/lib/internal/ponyfills/Number.isInteger.js +1 -1
- package/lib/internal/ponyfills/Number.isNaN.js +1 -1
- package/lib/internal/ponyfills/Number.isSafeInteger.js +1 -1
- package/lib/internal/ponyfills/Promise.allSettled.js +6 -6
- package/lib/internal/ponyfills/Promise.any.js +16 -16
- package/lib/internal/ponyfills/String.padEnd.js +1 -1
- package/lib/internal/ponyfills/String.padStart.js +1 -1
- package/lib/internal/ponyfills/String.repeat.js +1 -1
- package/lib/internal/ponyfills/String.replaceAll.js +1 -1
- package/lib/invoke.js +1 -1
- package/lib/invokeArgs.js +1 -1
- package/lib/isArray.js +1 -1
- package/lib/isArrayLike.js +1 -1
- package/lib/isBlank.js +1 -1
- package/lib/isEmptyArray.js +1 -1
- package/lib/isEven.js +1 -1
- package/lib/isFalsy.js +1 -1
- package/lib/isFinite.js +1 -1
- package/lib/isFloat.js +1 -1
- package/lib/isFunction.js +1 -1
- package/lib/isIndexed.js +1 -1
- package/lib/isInteger.js +1 -1
- package/lib/isInteger32.js +1 -1
- package/lib/isIterable.js +1 -1
- package/lib/isNaN.js +1 -1
- package/lib/isNaturalNumber.js +1 -1
- package/lib/isNegative.js +1 -1
- package/lib/isNonEmptyArray.js +1 -1
- package/lib/isNonEmptyString.js +1 -1
- package/lib/isNonNegative.js +1 -1
- package/lib/isNonPositive.js +1 -1
- package/lib/isNotArray.js +1 -1
- package/lib/isNotArrayLike.js +1 -1
- package/lib/isNotAsyncFunction.js +1 -1
- package/lib/isNotBoolean.js +1 -1
- package/lib/isNotDate.js +1 -1
- package/lib/isNotFinite.js +1 -1
- package/lib/isNotFloat.js +1 -1
- package/lib/isNotFunction.js +1 -1
- package/lib/isNotGeneratorFunction.js +1 -1
- package/lib/isNotInteger.js +1 -1
- package/lib/isNotMap.js +1 -1
- package/lib/isNotNaN.js +1 -1
- package/lib/isNotNilOrEmpty.js +1 -1
- package/lib/isNotNull.js +1 -1
- package/lib/isNotNumber.js +1 -1
- package/lib/isNotObj.js +1 -1
- package/lib/isNotObjLike.js +1 -1
- package/lib/isNotPair.js +1 -1
- package/lib/isNotPlainObj.js +1 -1
- package/lib/isNotPrimitive.js +1 -1
- package/lib/isNotRegExp.js +1 -1
- package/lib/isNotSet.js +1 -1
- package/lib/isNotString.js +1 -1
- package/lib/isNotUndefined.js +1 -1
- package/lib/isNotValidDate.js +1 -1
- package/lib/isNotValidNumber.js +1 -1
- package/lib/isObj.js +1 -1
- package/lib/isObjLike.js +1 -1
- package/lib/isOdd.js +1 -1
- package/lib/isPair.js +1 -1
- package/lib/isPlainObj.js +1 -1
- package/lib/isPositive.js +1 -1
- package/lib/isPrimitive.js +1 -1
- package/lib/isPromise.js +1 -1
- package/lib/isPrototypeOf.js +1 -1
- package/lib/isSafeInteger.js +1 -1
- package/lib/isSentinelValue.js +1 -1
- package/lib/isSparseArray.js +1 -1
- package/lib/isThenable.js +1 -1
- package/lib/isUinteger32.js +1 -1
- package/lib/isUndefined.js +1 -1
- package/lib/isValidDate.js +1 -1
- package/lib/isValidNumber.js +1 -1
- package/lib/lastP.js +6 -6
- package/lib/lengthEq.js +1 -1
- package/lib/lengthGt.js +1 -1
- package/lib/lengthGte.js +1 -1
- package/lib/lengthLt.js +1 -1
- package/lib/lengthLte.js +1 -1
- package/lib/lengthNotEq.js +1 -1
- package/lib/lensNotEq.js +1 -1
- package/lib/lensNotSatisfy.js +1 -1
- package/lib/lensSatisfies.js +1 -1
- package/lib/lensTraverse.js +1 -1
- package/lib/liftF.js +1 -1
- package/lib/liftFN.js +1 -1
- package/lib/mergePaths.js +1 -1
- package/lib/mergeProp.js +1 -1
- package/lib/noneP.js +1 -1
- package/lib/noop.js +1 -1
- package/lib/notAllUnique.js +1 -1
- package/lib/padCharsEnd.js +1 -1
- package/lib/padCharsStart.js +1 -1
- package/lib/padEnd.js +1 -1
- package/lib/padStart.js +1 -1
- package/lib/rangeStep.js +1 -1
- package/lib/reduceP.js +5 -5
- package/lib/reduceRightP.js +5 -5
- package/lib/renameKey.js +2 -2
- package/lib/renameKeyWith.js +1 -1
- package/lib/renameKeys.js +1 -1
- package/lib/repeatStr.js +1 -1
- package/lib/replaceAll.js +1 -1
- package/lib/sign.js +1 -1
- package/lib/sortByProp.js +1 -1
- package/lib/sortByProps.js +5 -5
- package/lib/spreadProp.js +1 -1
- package/lib/toArray.js +1 -1
- package/lib/toNumber.js +1 -1
- package/lib/trimCharsEnd.js +1 -1
- package/lib/trimCharsStart.js +1 -1
- package/lib/trimEnd.js +1 -1
- package/lib/trimStart.js +1 -1
- package/lib/trunc.js +1 -1
- package/lib/unzipObjWith.js +1 -1
- package/package.json +22 -19
- package/babel.config.cjs +0 -56
- package/src/Y.js +0 -32
- package/src/allEqual.js +0 -28
- package/src/allEqualTo.js +0 -25
- package/src/allIdentical.js +0 -26
- package/src/allIdenticalTo.js +0 -25
- package/src/allP.js +0 -27
- package/src/allSettledP.js +0 -34
- package/src/allUnique.js +0 -25
- package/src/anyP.js +0 -33
- package/src/appendFlipped.js +0 -24
- package/src/argsPass.js +0 -40
- package/src/async.js +0 -60
- package/src/cata.js +0 -86
- package/src/catchP.js +0 -25
- package/src/ceil.js +0 -28
- package/src/compact.js +0 -23
- package/src/concatAll.js +0 -35
- package/src/concatRight.js +0 -30
- package/src/copyKeys.js +0 -31
- package/src/curryRight.js +0 -26
- package/src/curryRightN.js +0 -29
- package/src/defaultWhen.js +0 -26
- package/src/delayP.js +0 -45
- package/src/dispatch.js +0 -74
- package/src/divideNum.js +0 -20
- package/src/dropArgs.js +0 -23
- package/src/ensureArray.js +0 -24
- package/src/escapeRegExp.js +0 -22
- package/src/fantasy-land/Identity.js +0 -270
- package/src/fantasy-land/mapping.js +0 -20
- package/src/fantasy-land/traits.js +0 -57
- package/src/fantasy-land/util.js +0 -23
- package/src/filterIndexed.js +0 -28
- package/src/findOr.js +0 -30
- package/src/flattenDepth.js +0 -39
- package/src/flattenPath.js +0 -28
- package/src/flattenProp.js +0 -28
- package/src/floor.js +0 -27
- package/src/fnull.js +0 -38
- package/src/inRange.js +0 -34
- package/src/included.js +0 -28
- package/src/index.js +0 -241
- package/src/internal/ap.js +0 -30
- package/src/internal/compareLength.js +0 -7
- package/src/internal/isCoercible.js +0 -12
- package/src/internal/isOfTypeObject.js +0 -3
- package/src/internal/makeFlat.js +0 -42
- package/src/internal/ponyfills/Array.from.js +0 -34
- package/src/internal/ponyfills/Math.sign.js +0 -3
- package/src/internal/ponyfills/Math.trunc.js +0 -14
- package/src/internal/ponyfills/Number.MAX_SAFE_INTEGER.js +0 -3
- package/src/internal/ponyfills/Number.MIN_SAFE_INTEGER.js +0 -3
- package/src/internal/ponyfills/Number.isFinite.js +0 -8
- package/src/internal/ponyfills/Number.isInteger.js +0 -10
- package/src/internal/ponyfills/Number.isNaN.js +0 -8
- package/src/internal/ponyfills/Number.isSafeInteger.js +0 -11
- package/src/internal/ponyfills/Promise.allSettled.js +0 -18
- package/src/internal/ponyfills/Promise.any.js +0 -29
- package/src/internal/ponyfills/String.padEnd.js +0 -25
- package/src/internal/ponyfills/String.padStart.js +0 -27
- package/src/internal/ponyfills/String.repeat.js +0 -49
- package/src/internal/ponyfills/String.replaceAll.js +0 -44
- package/src/internal/ponyfills/String.trimEnd.js +0 -5
- package/src/internal/ponyfills/String.trimStart.js +0 -5
- package/src/invoke.js +0 -22
- package/src/invokeArgs.js +0 -36
- package/src/isArray.js +0 -27
- package/src/isArrayLike.js +0 -79
- package/src/isAsyncFunction.js +0 -23
- package/src/isBigInt.js +0 -24
- package/src/isBlank.js +0 -33
- package/src/isBoolean.js +0 -22
- package/src/isDate.js +0 -21
- package/src/isEmptyArray.js +0 -28
- package/src/isEmptyString.js +0 -28
- package/src/isError.js +0 -21
- package/src/isEven.js +0 -31
- package/src/isFalse.js +0 -31
- package/src/isFalsy.js +0 -28
- package/src/isFinite.js +0 -37
- package/src/isFloat.js +0 -36
- package/src/isFunction.js +0 -32
- package/src/isGeneratorFunction.js +0 -26
- package/src/isIndexed.js +0 -24
- package/src/isInteger.js +0 -40
- package/src/isInteger32.js +0 -28
- package/src/isIterable.js +0 -37
- package/src/isMap.js +0 -25
- package/src/isNaN.js +0 -45
- package/src/isNaturalNumber.js +0 -28
- package/src/isNegative.js +0 -27
- package/src/isNegativeZero.js +0 -23
- package/src/isNilOrEmpty.js +0 -26
- package/src/isNonEmptyArray.js +0 -28
- package/src/isNonEmptyString.js +0 -31
- package/src/isNonNegative.js +0 -30
- package/src/isNonPositive.js +0 -30
- package/src/isNotArray.js +0 -24
- package/src/isNotArrayLike.js +0 -26
- package/src/isNotAsyncFunction.js +0 -27
- package/src/isNotBoolean.js +0 -24
- package/src/isNotDate.js +0 -23
- package/src/isNotFinite.js +0 -31
- package/src/isNotFloat.js +0 -35
- package/src/isNotFunction.js +0 -29
- package/src/isNotGeneratorFunction.js +0 -27
- package/src/isNotInteger.js +0 -36
- package/src/isNotMap.js +0 -27
- package/src/isNotNaN.js +0 -37
- package/src/isNotNil.js +0 -23
- package/src/isNotNilOrEmpty.js +0 -28
- package/src/isNotNull.js +0 -24
- package/src/isNotNumber.js +0 -25
- package/src/isNotObj.js +0 -29
- package/src/isNotObjLike.js +0 -29
- package/src/isNotPair.js +0 -27
- package/src/isNotPlainObj.js +0 -35
- package/src/isNotPrimitive.js +0 -26
- package/src/isNotRegExp.js +0 -24
- package/src/isNotSet.js +0 -26
- package/src/isNotString.js +0 -23
- package/src/isNotUndefined.js +0 -24
- package/src/isNotValidDate.js +0 -24
- package/src/isNotValidNumber.js +0 -27
- package/src/isNull.js +0 -22
- package/src/isNumber.js +0 -24
- package/src/isObj.js +0 -31
- package/src/isObjLike.js +0 -30
- package/src/isOdd.js +0 -29
- package/src/isPair.js +0 -27
- package/src/isPlainObj.js +0 -65
- package/src/isPositive.js +0 -26
- package/src/isPositiveZero.js +0 -23
- package/src/isPrimitive.js +0 -46
- package/src/isPromise.js +0 -32
- package/src/isPrototypeOf.js +0 -36
- package/src/isRegExp.js +0 -22
- package/src/isSafeInteger.js +0 -40
- package/src/isSentinelValue.js +0 -26
- package/src/isSet.js +0 -24
- package/src/isSparseArray.js +0 -43
- package/src/isString.js +0 -21
- package/src/isSymbol.js +0 -29
- package/src/isThenable.js +0 -28
- package/src/isTrue.js +0 -27
- package/src/isTruthy.js +0 -28
- package/src/isUinteger32.js +0 -29
- package/src/isUndefined.js +0 -24
- package/src/isValidDate.js +0 -29
- package/src/isValidNumber.js +0 -28
- package/src/lastP.js +0 -54
- package/src/lengthEq.js +0 -24
- package/src/lengthGt.js +0 -24
- package/src/lengthGte.js +0 -26
- package/src/lengthLt.js +0 -24
- package/src/lengthLte.js +0 -25
- package/src/lengthNotEq.js +0 -24
- package/src/lensEq.js +0 -28
- package/src/lensIso.js +0 -51
- package/src/lensNotEq.js +0 -28
- package/src/lensNotSatisfy.js +0 -30
- package/src/lensSatisfies.js +0 -33
- package/src/lensTraverse.js +0 -56
- package/src/liftF.js +0 -37
- package/src/liftFN.js +0 -45
- package/src/list.js +0 -20
- package/src/mapIndexed.js +0 -27
- package/src/mergePath.js +0 -30
- package/src/mergePaths.js +0 -29
- package/src/mergeProp.js +0 -30
- package/src/mergeProps.js +0 -27
- package/src/move.js +0 -26
- package/src/nand.js +0 -27
- package/src/neither.js +0 -38
- package/src/noneP.js +0 -35
- package/src/nonePass.js +0 -32
- package/src/noop.js +0 -21
- package/src/nor.js +0 -28
- package/src/notAllPass.js +0 -32
- package/src/notAllUnique.js +0 -25
- package/src/notBoth.js +0 -38
- package/src/notEqual.js +0 -31
- package/src/omitBy.js +0 -25
- package/src/omitIndexes.js +0 -27
- package/src/overlaps.js +0 -30
- package/src/padCharsEnd.js +0 -37
- package/src/padCharsStart.js +0 -35
- package/src/padEnd.js +0 -25
- package/src/padStart.js +0 -23
- package/src/pathNotEq.js +0 -31
- package/src/pathOrLazy.js +0 -30
- package/src/paths.js +0 -26
- package/src/pickIndexes.js +0 -30
- package/src/propNotEq.js +0 -30
- package/src/rangeStep.js +0 -37
- package/src/reduceIndexed.js +0 -31
- package/src/reduceP.js +0 -96
- package/src/reduceRightP.js +0 -101
- package/src/rejectP.js +0 -24
- package/src/renameKey.js +0 -33
- package/src/renameKeyWith.js +0 -30
- package/src/renameKeys.js +0 -40
- package/src/renameKeysWith.js +0 -27
- package/src/repeatStr.js +0 -30
- package/src/replaceAll.js +0 -35
- package/src/resolveP.js +0 -28
- package/src/round.js +0 -26
- package/src/seq.js +0 -38
- package/src/sign.js +0 -33
- package/src/skipTake.js +0 -33
- package/src/sliceFrom.js +0 -23
- package/src/sliceTo.js +0 -23
- package/src/sortByPaths.js +0 -55
- package/src/sortByProp.js +0 -45
- package/src/sortByProps.js +0 -31
- package/src/spreadPath.js +0 -26
- package/src/spreadProp.js +0 -25
- package/src/stubArray.js +0 -18
- package/src/stubNull.js +0 -19
- package/src/stubObj.js +0 -19
- package/src/stubString.js +0 -19
- package/src/stubUndefined.js +0 -19
- package/src/subtractNum.js +0 -20
- package/src/thenCatchP.js +0 -27
- package/src/toArray.js +0 -32
- package/src/toInteger32.js +0 -22
- package/src/toNumber.js +0 -24
- package/src/toUinteger32.js +0 -26
- package/src/trimCharsEnd.js +0 -25
- package/src/trimCharsStart.js +0 -25
- package/src/trimEnd.js +0 -30
- package/src/trimStart.js +0 -29
- package/src/trunc.js +0 -33
- package/src/unzipObjWith.js +0 -40
- package/src/viewOr.js +0 -32
- package/src/weave.js +0 -35
- package/src/weaveLazy.js +0 -37
- package/src/zipObjWith.js +0 -27
package/src/isEmptyArray.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { both, isEmpty } from 'ramda';
|
|
2
|
-
|
|
3
|
-
import isArray from './isArray.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Checks if input value is an empty `Array`.
|
|
7
|
-
*
|
|
8
|
-
* @func isEmptyArray
|
|
9
|
-
* @memberOf RA
|
|
10
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/2.4.0|v2.4.0}
|
|
11
|
-
* @category Type
|
|
12
|
-
* @sig * -> Boolean
|
|
13
|
-
* @param {*} val The value to test
|
|
14
|
-
* @return {boolean}
|
|
15
|
-
* @see {@link RA.isNotEmptyArray|isNotEmptyArray}
|
|
16
|
-
* @example
|
|
17
|
-
*
|
|
18
|
-
* RA.isEmptyArray([]); // => true
|
|
19
|
-
* RA.isEmptyArray([42]); // => false
|
|
20
|
-
* RA.isEmptyArray({}); // => false
|
|
21
|
-
* RA.isEmptyArray(null); // => false
|
|
22
|
-
* RA.isEmptyArray(undefined); // => false
|
|
23
|
-
* RA.isEmptyArray(42); // => false
|
|
24
|
-
* RA.isEmptyArray('42'); // => false
|
|
25
|
-
*/
|
|
26
|
-
const isEmptyArray = both(isArray, isEmpty);
|
|
27
|
-
|
|
28
|
-
export default isEmptyArray;
|
package/src/isEmptyString.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { equals } from 'ramda';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Checks if input value is an empty `String`.
|
|
5
|
-
*
|
|
6
|
-
* @func isEmptyString
|
|
7
|
-
* @memberOf RA
|
|
8
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/2.4.0|v2.4.0}
|
|
9
|
-
* @category Type
|
|
10
|
-
* @sig * -> Boolean
|
|
11
|
-
* @param {*} val The value to test
|
|
12
|
-
* @return {boolean}
|
|
13
|
-
* @see {@link RA.isNotEmptyString|isNotEmptyString}
|
|
14
|
-
* @example
|
|
15
|
-
*
|
|
16
|
-
* RA.isEmptyString(''); // => true
|
|
17
|
-
* RA.isEmptyString('42'); // => false
|
|
18
|
-
* RA.isEmptyString(new String('42')); // => false
|
|
19
|
-
* RA.isEmptyString(new String('')); // => false
|
|
20
|
-
* RA.isEmptyString([42]); // => false
|
|
21
|
-
* RA.isEmptyString({}); // => false
|
|
22
|
-
* RA.isEmptyString(null); // => false
|
|
23
|
-
* RA.isEmptyString(undefined); // => false
|
|
24
|
-
* RA.isEmptyString(42); // => false
|
|
25
|
-
*/
|
|
26
|
-
const isEmptyString = equals('');
|
|
27
|
-
|
|
28
|
-
export default isEmptyString;
|
package/src/isError.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { type, identical, pipe, curryN } from 'ramda';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, `SyntaxError`, `TypeError` or `URIError` object.
|
|
5
|
-
*
|
|
6
|
-
* @func isError
|
|
7
|
-
* @category Type
|
|
8
|
-
* @memberOf RA
|
|
9
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/2.30.0|v2.30.0}
|
|
10
|
-
* @sig * -> Boolean
|
|
11
|
-
* @param {*} val The value to test
|
|
12
|
-
* @return {boolean} Returns `true` if value is an error object, `false` otherwise
|
|
13
|
-
* @example
|
|
14
|
-
*
|
|
15
|
-
* RA.isError(new Error()); //=> true
|
|
16
|
-
* RA.isError(Error); //=> false
|
|
17
|
-
* RA.isError(1); // => false
|
|
18
|
-
*/
|
|
19
|
-
const isError = curryN(1, pipe(type, identical('Error')));
|
|
20
|
-
|
|
21
|
-
export default isError;
|
package/src/isEven.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { both, complement, curryN } from 'ramda';
|
|
2
|
-
|
|
3
|
-
import isInteger from './isInteger.js';
|
|
4
|
-
import isOdd from './isOdd.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Checks if value is even integer number.
|
|
8
|
-
* An even number is an integer which is "evenly divisible" by two.
|
|
9
|
-
* Zero is an even number because zero divided by two equals zero,
|
|
10
|
-
* which despite not being a natural number, is an integer.
|
|
11
|
-
* Even numbers are either positive or negative.
|
|
12
|
-
*
|
|
13
|
-
* @func isEven
|
|
14
|
-
* @memberOf RA
|
|
15
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/1.18.0|v1.18.0}
|
|
16
|
-
* @category Type
|
|
17
|
-
* @sig * -> Boolean
|
|
18
|
-
* @param {*} val The value to test
|
|
19
|
-
* @return {boolean}
|
|
20
|
-
* @see {@link RA.isOdd|isOdd}
|
|
21
|
-
* @example
|
|
22
|
-
*
|
|
23
|
-
* RA.isEven(0); // => true
|
|
24
|
-
* RA.isEven(1); // => false
|
|
25
|
-
* RA.isEven(-Infinity); // => false
|
|
26
|
-
* RA.isEven(4); // => true
|
|
27
|
-
* RA.isEven(3); // => false
|
|
28
|
-
*/
|
|
29
|
-
const isEven = curryN(1, both(isInteger, complement(isOdd)));
|
|
30
|
-
|
|
31
|
-
export default isEven;
|
package/src/isFalse.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { identical, curryN } from 'ramda';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Checks if input value is the Boolean primitive `false`. Will return false for all values created
|
|
5
|
-
* using the `Boolean` function as a constructor.
|
|
6
|
-
*
|
|
7
|
-
* @func isFalse
|
|
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.isTrue|isTrue}, {@link RA.isTruthy|isTruthy}, {@link RA.isFalsy|isFalsy}
|
|
15
|
-
* @example
|
|
16
|
-
*
|
|
17
|
-
* RA.isFalse(false); // => true
|
|
18
|
-
* RA.isFalse(Boolean(false)); // => true
|
|
19
|
-
* RA.isFalse(true); // => false
|
|
20
|
-
* RA.isFalse(0); // => false
|
|
21
|
-
* RA.isFalse(''); // => false
|
|
22
|
-
* RA.isFalse(null); // => false
|
|
23
|
-
* RA.isFalse(undefined); // => false
|
|
24
|
-
* RA.isFalse(NaN); // => false
|
|
25
|
-
* RA.isFalse([]); // => false
|
|
26
|
-
* RA.isFalse(new Boolean(false)); // => false
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
const isFalse = curryN(1, identical(false));
|
|
30
|
-
|
|
31
|
-
export default isFalse;
|
package/src/isFalsy.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { complement } from 'ramda';
|
|
2
|
-
|
|
3
|
-
import isTruthy from './isTruthy.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* A falsy value is a value that translates to false when evaluated in a Boolean context.
|
|
7
|
-
* Falsy values are `false`, `0`, `""`, `null`, `undefined`, and `NaN`.
|
|
8
|
-
*
|
|
9
|
-
* @func isFalsy
|
|
10
|
-
* @memberOf RA
|
|
11
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/2.2.0|v2.2..0}
|
|
12
|
-
* @category Type
|
|
13
|
-
* @sig * -> Boolean
|
|
14
|
-
* @param {*} val The value to test
|
|
15
|
-
* @return {boolean}
|
|
16
|
-
* @see {@link https://developer.mozilla.org/en-US/docs/Glossary/Falsy|falsy}, {@link RA.isTruthy|isTruthy}
|
|
17
|
-
* @example
|
|
18
|
-
*
|
|
19
|
-
* RA.isFalsy(false); // => true
|
|
20
|
-
* RA.isFalsy(0); // => true
|
|
21
|
-
* RA.isFalsy(''); // => true
|
|
22
|
-
* RA.isFalsy(null); // => true
|
|
23
|
-
* RA.isFalsy(undefined); // => true
|
|
24
|
-
* RA.isFalsy(NaN); // => true
|
|
25
|
-
*/
|
|
26
|
-
const isFalsy = complement(isTruthy);
|
|
27
|
-
|
|
28
|
-
export default isFalsy;
|
package/src/isFinite.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { bind, curryN } from 'ramda';
|
|
2
|
-
|
|
3
|
-
import isFunction from './isFunction.js';
|
|
4
|
-
import ponyfill from './internal/ponyfills/Number.isFinite.js';
|
|
5
|
-
|
|
6
|
-
export const isFinitePonyfill = curryN(1, ponyfill);
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Checks whether the passed value is a finite `Number`.
|
|
10
|
-
*
|
|
11
|
-
* @func isFinite
|
|
12
|
-
* @memberOf RA
|
|
13
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/0.7.0|v0.7.0}
|
|
14
|
-
* @category Type
|
|
15
|
-
* @sig * -> Boolean
|
|
16
|
-
* @param {*} val The value to test
|
|
17
|
-
* @return {boolean}
|
|
18
|
-
* @see {@link RA.isNotFinite|isNotFinite}
|
|
19
|
-
* @example
|
|
20
|
-
*
|
|
21
|
-
* RA.isFinite(Infinity); //=> false
|
|
22
|
-
* RA.isFinite(NaN); //=> false
|
|
23
|
-
* RA.isFinite(-Infinity); //=> false
|
|
24
|
-
*
|
|
25
|
-
* RA.isFinite(0); // true
|
|
26
|
-
* RA.isFinite(2e64); // true
|
|
27
|
-
*
|
|
28
|
-
* RA.isFinite('0'); // => false
|
|
29
|
-
* // would've been true with global isFinite('0')
|
|
30
|
-
* RA.isFinite(null); // => false
|
|
31
|
-
* // would've been true with global isFinite(null)
|
|
32
|
-
*/
|
|
33
|
-
const _isFinite = isFunction(Number.isFinite)
|
|
34
|
-
? curryN(1, bind(Number.isFinite, Number))
|
|
35
|
-
: isFinitePonyfill;
|
|
36
|
-
|
|
37
|
-
export default _isFinite;
|
package/src/isFloat.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { complement, both } from 'ramda';
|
|
2
|
-
|
|
3
|
-
import isInteger from './isInteger.js';
|
|
4
|
-
import isFinite from './isFinite.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Checks whether the passed value is a `float`.
|
|
8
|
-
*
|
|
9
|
-
* @func isFloat
|
|
10
|
-
* @memberOf RA
|
|
11
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/1.14.0|v1.14.0}
|
|
12
|
-
* @category Type
|
|
13
|
-
* @sig * -> Boolean
|
|
14
|
-
* @param {*} val The value to test
|
|
15
|
-
* @return {boolean}
|
|
16
|
-
* @see {@link RA.isNotFloat|isNotFloat}
|
|
17
|
-
* @example
|
|
18
|
-
*
|
|
19
|
-
* RA.isFloat(0); //=> false
|
|
20
|
-
* RA.isFloat(1); //=> false
|
|
21
|
-
* RA.isFloat(-100000); //=> false
|
|
22
|
-
*
|
|
23
|
-
* RA.isFloat(0.1); //=> true
|
|
24
|
-
* RA.isFloat(Math.PI); //=> true
|
|
25
|
-
*
|
|
26
|
-
* RA.isFloat(NaN); //=> false
|
|
27
|
-
* RA.isFloat(Infinity); //=> false
|
|
28
|
-
* RA.isFloat(-Infinity); //=> false
|
|
29
|
-
* RA.isFloat('10'); //=> false
|
|
30
|
-
* RA.isFloat(true); //=> false
|
|
31
|
-
* RA.isFloat(false); //=> false
|
|
32
|
-
* RA.isFloat([1]); //=> false
|
|
33
|
-
*/
|
|
34
|
-
const isFloat = both(isFinite, complement(isInteger));
|
|
35
|
-
|
|
36
|
-
export default isFloat;
|
package/src/isFunction.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { anyPass, type, pipe, identical } from 'ramda';
|
|
2
|
-
|
|
3
|
-
import isGeneratorFunction from './isGeneratorFunction.js';
|
|
4
|
-
import isAsyncFunction from './isAsyncFunction.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Checks if input value is `Function`.
|
|
8
|
-
*
|
|
9
|
-
* @func isFunction
|
|
10
|
-
* @memberOf RA
|
|
11
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/0.5.0|v0.5.0}
|
|
12
|
-
* @category Type
|
|
13
|
-
* @sig * -> Boolean
|
|
14
|
-
* @param {*} val The value to test
|
|
15
|
-
* @return {boolean}
|
|
16
|
-
* @see {@link RA.isNotFunction|isNotFunction}, {@link RA.isAsyncFunction|isNotAsyncFunction}, {@link RA.isGeneratorFunction|isGeneratorFunction}
|
|
17
|
-
* @example
|
|
18
|
-
*
|
|
19
|
-
* RA.isFunction(function test() { }); //=> true
|
|
20
|
-
* RA.isFunction(function* test() { }); //=> true
|
|
21
|
-
* RA.isFunction(async function test() { }); //=> true
|
|
22
|
-
* RA.isFunction(() => {}); //=> true
|
|
23
|
-
* RA.isFunction(null); //=> false
|
|
24
|
-
* RA.isFunction('abc'); //=> false
|
|
25
|
-
*/
|
|
26
|
-
const isFunction = anyPass([
|
|
27
|
-
pipe(type, identical('Function')),
|
|
28
|
-
isGeneratorFunction,
|
|
29
|
-
isAsyncFunction,
|
|
30
|
-
]);
|
|
31
|
-
|
|
32
|
-
export default isFunction;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { type, identical, pipe, curryN } from 'ramda';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Checks if input value is `Generator Function`.
|
|
5
|
-
*
|
|
6
|
-
* @func isGeneratorFunction
|
|
7
|
-
* @memberOf RA
|
|
8
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/0.5.0|v0.5.0}
|
|
9
|
-
* @category Type
|
|
10
|
-
* @sig * -> Boolean
|
|
11
|
-
* @param {*} val The value to test
|
|
12
|
-
* @return {boolean}
|
|
13
|
-
* @see {@link RA.isFunction|isFunction}, {@link RA.isAsyncFunction|isAsyncFunction}, {@link RA.isNotGeneratorFunction|isNotGeneratorFunction}
|
|
14
|
-
* @example
|
|
15
|
-
*
|
|
16
|
-
* RA.isGeneratorFunction(function* test() { }); //=> true
|
|
17
|
-
* RA.isGeneratorFunction(null); //=> false
|
|
18
|
-
* RA.isGeneratorFunction(function test() { }); //=> false
|
|
19
|
-
* RA.isGeneratorFunction(() => {}); //=> false
|
|
20
|
-
*/
|
|
21
|
-
const isGeneratorFunction = curryN(
|
|
22
|
-
1,
|
|
23
|
-
pipe(type, identical('GeneratorFunction'))
|
|
24
|
-
);
|
|
25
|
-
|
|
26
|
-
export default isGeneratorFunction;
|
package/src/isIndexed.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { either, curryN } from 'ramda';
|
|
2
|
-
|
|
3
|
-
import isArray from './isArray.js';
|
|
4
|
-
import isString from './isString.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Determine if input value is an indexed data type.
|
|
8
|
-
*
|
|
9
|
-
* @func isIndexed
|
|
10
|
-
* @memberOf RA
|
|
11
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/2.26.0|v2.26.0}
|
|
12
|
-
* @category Type
|
|
13
|
-
* @sig * -> Boolean
|
|
14
|
-
* @param {*} val The value to test
|
|
15
|
-
* @return {boolean}
|
|
16
|
-
* @example
|
|
17
|
-
*
|
|
18
|
-
* RA.isIndexed([1]) //=> true
|
|
19
|
-
* RA.isIndexed('test') //=> true
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
const isIndexed = curryN(1, either(isString, isArray));
|
|
23
|
-
|
|
24
|
-
export default isIndexed;
|
package/src/isInteger.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { bind, curryN } from 'ramda';
|
|
2
|
-
|
|
3
|
-
import isFunction from './isFunction.js';
|
|
4
|
-
import ponyfill from './internal/ponyfills/Number.isInteger.js';
|
|
5
|
-
|
|
6
|
-
export const isIntegerPonyfill = curryN(1, ponyfill);
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Checks whether the passed value is an `integer`.
|
|
10
|
-
*
|
|
11
|
-
* @func isInteger
|
|
12
|
-
* @memberOf RA
|
|
13
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/0.7.0|v0.7.0}
|
|
14
|
-
* @category Type
|
|
15
|
-
* @sig * -> Boolean
|
|
16
|
-
* @param {*} val The value to test
|
|
17
|
-
* @return {boolean}
|
|
18
|
-
* @see {@link RA.isNotInteger|isNotInteger}
|
|
19
|
-
* @example
|
|
20
|
-
*
|
|
21
|
-
* RA.isInteger(0); //=> true
|
|
22
|
-
* RA.isInteger(1); //=> true
|
|
23
|
-
* RA.isInteger(-100000); //=> true
|
|
24
|
-
*
|
|
25
|
-
* RA.isInteger(0.1); //=> false
|
|
26
|
-
* RA.isInteger(Math.PI); //=> false
|
|
27
|
-
*
|
|
28
|
-
* RA.isInteger(NaN); //=> false
|
|
29
|
-
* RA.isInteger(Infinity); //=> false
|
|
30
|
-
* RA.isInteger(-Infinity); //=> false
|
|
31
|
-
* RA.isInteger('10'); //=> false
|
|
32
|
-
* RA.isInteger(true); //=> false
|
|
33
|
-
* RA.isInteger(false); //=> false
|
|
34
|
-
* RA.isInteger([1]); //=> false
|
|
35
|
-
*/
|
|
36
|
-
const isInteger = isFunction(Number.isInteger)
|
|
37
|
-
? curryN(1, bind(Number.isInteger, Number))
|
|
38
|
-
: isIntegerPonyfill;
|
|
39
|
-
|
|
40
|
-
export default isInteger;
|
package/src/isInteger32.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { curryN } from 'ramda';
|
|
2
|
-
|
|
3
|
-
import toInteger32 from './toInteger32.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Checks whether the passed value is a signed 32 bit integer.
|
|
7
|
-
*
|
|
8
|
-
* @func isInteger32
|
|
9
|
-
* @aliases isInt32
|
|
10
|
-
* @memberOf RA
|
|
11
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/2.32.0|v2.32.0}
|
|
12
|
-
* @category Type
|
|
13
|
-
* @sig * -> Boolean
|
|
14
|
-
* @param {*} val The value to test
|
|
15
|
-
* @return {boolean}
|
|
16
|
-
* @see {@link RA.toInteger32|toInteger32}
|
|
17
|
-
* @example
|
|
18
|
-
*
|
|
19
|
-
* RA.isInteger32(0); //=> true
|
|
20
|
-
* RA.isInteger32((-2) ** 31); //=> true
|
|
21
|
-
*
|
|
22
|
-
* RA.isInteger32(Infinity); //=> false
|
|
23
|
-
* RA.isInteger32(NaN); //=> false
|
|
24
|
-
* RA.isInteger32(2 ** 31); //=> false
|
|
25
|
-
*/
|
|
26
|
-
const isInteger32 = curryN(1, (val) => toInteger32(val) === val);
|
|
27
|
-
|
|
28
|
-
export default isInteger32;
|
package/src/isIterable.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { hasIn, curryN } from 'ramda';
|
|
2
|
-
|
|
3
|
-
import isFunction from './isFunction.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Checks whether the passed value is iterable.
|
|
7
|
-
*
|
|
8
|
-
* @func isIterable
|
|
9
|
-
* @memberOf RA
|
|
10
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/2.18.0|v2.18.0}
|
|
11
|
-
* @category Type
|
|
12
|
-
* @sig * -> Boolean
|
|
13
|
-
* @param {*} val The value to test
|
|
14
|
-
* @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol}
|
|
15
|
-
* @return {boolean}
|
|
16
|
-
* @example
|
|
17
|
-
*
|
|
18
|
-
* RA.isIterable(['arrays', 'are', 'iterable']); //=> true
|
|
19
|
-
* RA.isIterable('strings are iterable, too'); //=> true
|
|
20
|
-
* RA.isIterable((function* () {})()); //=> true (generator objects are both iterable and iterators)
|
|
21
|
-
*
|
|
22
|
-
* RA.isIterable({}); //=> false
|
|
23
|
-
* RA.isIterable(-0); //=> false
|
|
24
|
-
* RA.isIterable(null); //=> false
|
|
25
|
-
* RA.isIterable(undefined); //=> false
|
|
26
|
-
*/
|
|
27
|
-
const isIterable = curryN(1, (val) => {
|
|
28
|
-
if (typeof Symbol === 'undefined') {
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
hasIn(Symbol.iterator, Object(val)) && isFunction(val[Symbol.iterator])
|
|
34
|
-
);
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
export default isIterable;
|
package/src/isMap.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { type, identical, pipe, curryN } from 'ramda';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Predicate for determining if a provided value is an instance of a Map.
|
|
5
|
-
*
|
|
6
|
-
* @func isMap
|
|
7
|
-
* @memberOf RA
|
|
8
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/2.22.0|v2.22.0}
|
|
9
|
-
* @category Type
|
|
10
|
-
* @sig * -> Boolean
|
|
11
|
-
* @param {*} val The value to test
|
|
12
|
-
* @return {boolean}
|
|
13
|
-
* @see {@link RA.isSet|isSet}}
|
|
14
|
-
* @example
|
|
15
|
-
*
|
|
16
|
-
* RA.isMap(new Map()); //=> true
|
|
17
|
-
* RA.isMap(new Map([[1, 2], [2, 1]])); //=> true
|
|
18
|
-
* RA.isSet(new Set()); //=> false
|
|
19
|
-
* RA.isSet(new Set([1,2]); //=> false
|
|
20
|
-
* RA.isSet(new Object()); //=> false
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
const isMap = curryN(1, pipe(type, identical('Map')));
|
|
24
|
-
|
|
25
|
-
export default isMap;
|
package/src/isNaN.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { curryN } from 'ramda';
|
|
2
|
-
|
|
3
|
-
import isFunction from './isFunction.js';
|
|
4
|
-
import ponyfill from './internal/ponyfills/Number.isNaN.js';
|
|
5
|
-
|
|
6
|
-
export const isNaNPonyfill = curryN(1, ponyfill);
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Checks whether the passed value is `NaN` and its type is `Number`.
|
|
10
|
-
* It is a more robust version of the original, global isNaN().
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* @func isNaN
|
|
14
|
-
* @memberOf RA
|
|
15
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/0.6.0|v0.6.0}
|
|
16
|
-
* @category Type
|
|
17
|
-
* @sig * -> Boolean
|
|
18
|
-
* @param {*} val The value to test
|
|
19
|
-
* @return {boolean}
|
|
20
|
-
* @see {@link RA.isNotNaN|isNotNaN}
|
|
21
|
-
* @example
|
|
22
|
-
*
|
|
23
|
-
* RA.isNaN(NaN); // => true
|
|
24
|
-
* RA.isNaN(Number.NaN); // => true
|
|
25
|
-
* RA.isNaN(0 / 0); // => true
|
|
26
|
-
*
|
|
27
|
-
* // e.g. these would have been true with global isNaN().
|
|
28
|
-
* RA.isNaN('NaN'); // => false
|
|
29
|
-
* RA.isNaN(undefined); // => false
|
|
30
|
-
* RA.isNaN({}); // => false
|
|
31
|
-
* RA.isNaN('blabla'); // => false
|
|
32
|
-
*
|
|
33
|
-
* RA.isNaN(true); // => false
|
|
34
|
-
* RA.isNaN(null); // => false
|
|
35
|
-
* RA.isNaN(37); // => false
|
|
36
|
-
* RA.isNaN('37'); // => false
|
|
37
|
-
* RA.isNaN('37.37'); // => false
|
|
38
|
-
* RA.isNaN(''); // => false
|
|
39
|
-
* RA.isNaN(' '); // => false
|
|
40
|
-
*/
|
|
41
|
-
const _isNaN = isFunction(Number.isNaN)
|
|
42
|
-
? curryN(1, Number.isNaN)
|
|
43
|
-
: isNaNPonyfill;
|
|
44
|
-
|
|
45
|
-
export default _isNaN;
|
package/src/isNaturalNumber.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { both, complement, curryN } from 'ramda';
|
|
2
|
-
|
|
3
|
-
import isInteger from './isInteger.js';
|
|
4
|
-
import isNegative from './isNegative.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Checks if value is a natural number.
|
|
8
|
-
* Natural numbers correspond to all non-negative integers and 0.
|
|
9
|
-
*
|
|
10
|
-
* @func isNaturalNumber
|
|
11
|
-
* @memberOf RA
|
|
12
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/2.29.0|v2.29.0}
|
|
13
|
-
* @category Type
|
|
14
|
-
* @sig * -> Boolean
|
|
15
|
-
* @param {*} val The value to test
|
|
16
|
-
* @return {boolean}
|
|
17
|
-
* @example
|
|
18
|
-
*
|
|
19
|
-
* RA.isNaturalNumber(5); // => true
|
|
20
|
-
* RA.isNaturalNumber(Number.MAX_VALUE); // => true
|
|
21
|
-
* RA.isNaturalNumber(0); // => true
|
|
22
|
-
* RA.isNaturalNumber(-1); // => false
|
|
23
|
-
* RA.isNaturalNumber(0.9); // => false
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
const isNaturalNumber = curryN(1, both(isInteger, complement(isNegative)));
|
|
27
|
-
|
|
28
|
-
export default isNaturalNumber;
|
package/src/isNegative.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { both, gt, curryN } from 'ramda';
|
|
2
|
-
|
|
3
|
-
import isNumber from './isNumber.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Checks if value is a negative `Number` primitive or object. Zero is not considered neither
|
|
7
|
-
* positive or negative.
|
|
8
|
-
*
|
|
9
|
-
* @func isNegative
|
|
10
|
-
* @memberOf RA
|
|
11
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/1.15.0|v1.15.0}
|
|
12
|
-
* @category Type
|
|
13
|
-
* @sig * -> Boolean
|
|
14
|
-
* @param {*} val The value to test
|
|
15
|
-
* @return {boolean}
|
|
16
|
-
* @see {@link RA.isPositive|isPositive}
|
|
17
|
-
* @example
|
|
18
|
-
*
|
|
19
|
-
* RA.isNegative(-1); // => true
|
|
20
|
-
* RA.isNegative(Number.MIN_VALUE); // => false
|
|
21
|
-
* RA.isNegative(+Infinity); // => false
|
|
22
|
-
* RA.isNegative(NaN); // => false
|
|
23
|
-
* RA.isNegative('5'); // => false
|
|
24
|
-
*/
|
|
25
|
-
const isNegative = curryN(1, both(isNumber, gt(0)));
|
|
26
|
-
|
|
27
|
-
export default isNegative;
|
package/src/isNegativeZero.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { identical, curryN } from 'ramda';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Checks if value is a negative zero (-0).
|
|
5
|
-
*
|
|
6
|
-
* @func isNegativeZero
|
|
7
|
-
* @memberof RA
|
|
8
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/2.22.0|v2.22.0}
|
|
9
|
-
* @category Type
|
|
10
|
-
* @sig * -> Boolean
|
|
11
|
-
* @param {*} val The value to test
|
|
12
|
-
* @return {boolean}
|
|
13
|
-
* @see @see {@link RA.isPositiveZero|isPositiveZero}
|
|
14
|
-
* @example
|
|
15
|
-
*
|
|
16
|
-
* RA.isNegativeZero(-0); //=> true
|
|
17
|
-
* RA.isNegativeZero(+0); //=> false
|
|
18
|
-
* RA.isNegativeZero(0); //=> false
|
|
19
|
-
* RA.isNegativeZero(null); //=> false
|
|
20
|
-
*/
|
|
21
|
-
const isNegativeZero = curryN(1, identical(-0));
|
|
22
|
-
|
|
23
|
-
export default isNegativeZero;
|
package/src/isNilOrEmpty.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { either, isEmpty, isNil, curryN } from 'ramda';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Returns `true` if the given value is its type's empty value, `null` or `undefined`.
|
|
5
|
-
*
|
|
6
|
-
* @func isNilOrEmpty
|
|
7
|
-
* @memberOf RA
|
|
8
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/0.4.0|v0.4.0}
|
|
9
|
-
* @category Type
|
|
10
|
-
* @sig * -> Boolean
|
|
11
|
-
* @param {*} val The value to test
|
|
12
|
-
* @return {boolean}
|
|
13
|
-
* @see {@link http://ramdajs.com/docs/#isEmpty|R.isEmpty}, {@link http://ramdajs.com/docs/#isNil|R.isNil}
|
|
14
|
-
* @example
|
|
15
|
-
*
|
|
16
|
-
* RA.isNilOrEmpty([1, 2, 3]); //=> false
|
|
17
|
-
* RA.isNilOrEmpty([]); //=> true
|
|
18
|
-
* RA.isNilOrEmpty(''); //=> true
|
|
19
|
-
* RA.isNilOrEmpty(null); //=> true
|
|
20
|
-
* RA.isNilOrEmpty(undefined): //=> true
|
|
21
|
-
* RA.isNilOrEmpty({}); //=> true
|
|
22
|
-
* RA.isNilOrEmpty({length: 0}); //=> false
|
|
23
|
-
*/
|
|
24
|
-
const isNilOrEmpty = curryN(1, either(isNil, isEmpty));
|
|
25
|
-
|
|
26
|
-
export default isNilOrEmpty;
|
package/src/isNonEmptyArray.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { both, isNotEmpty } from 'ramda';
|
|
2
|
-
|
|
3
|
-
import isArray from './isArray.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Checks if input value is not an empty `Array`.
|
|
7
|
-
*
|
|
8
|
-
* @func isNonEmptyArray
|
|
9
|
-
* @memberOf RA
|
|
10
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/2.4.0|v2.4.0}
|
|
11
|
-
* @category Type
|
|
12
|
-
* @sig * -> Boolean
|
|
13
|
-
* @param {*} val The value to test
|
|
14
|
-
* @return {boolean}
|
|
15
|
-
* @see {@link RA.isEmptyArray|isEmptyArray}
|
|
16
|
-
* @example
|
|
17
|
-
*
|
|
18
|
-
* RA.isNonEmptyArray([42]); // => true
|
|
19
|
-
* RA.isNonEmptyArray([]); // => false
|
|
20
|
-
* RA.isNonEmptyArray({}); // => false
|
|
21
|
-
* RA.isNonEmptyArray(null); // => false
|
|
22
|
-
* RA.isNonEmptyArray(undefined); // => false
|
|
23
|
-
* RA.isNonEmptyArray(42); // => false
|
|
24
|
-
* RA.isNonEmptyArray('42'); // => false
|
|
25
|
-
*/
|
|
26
|
-
const isNonEmptyArray = both(isArray, isNotEmpty);
|
|
27
|
-
|
|
28
|
-
export default isNonEmptyArray;
|