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/internal/makeFlat.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import isArrayLike from '../isArrayLike.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* `makeFlat` is a helper function that returns a one-level or fully recursive
|
|
5
|
-
* function based on the flag passed in.
|
|
6
|
-
*
|
|
7
|
-
* @func makeFlat
|
|
8
|
-
* @memberOf RA
|
|
9
|
-
*
|
|
10
|
-
* @category List
|
|
11
|
-
* @param {!bool} = should recursively flatten
|
|
12
|
-
* @param {!Array} = the nested list to be flattened
|
|
13
|
-
* @return {!Array} = the flattened list
|
|
14
|
-
* @sig Bool -> List -> List
|
|
15
|
-
*
|
|
16
|
-
*/
|
|
17
|
-
const makeFlat = (recursive) =>
|
|
18
|
-
function flatt(list) {
|
|
19
|
-
let value;
|
|
20
|
-
let jlen;
|
|
21
|
-
let j;
|
|
22
|
-
const result = [];
|
|
23
|
-
let idx = 0;
|
|
24
|
-
|
|
25
|
-
while (idx < list.length) {
|
|
26
|
-
if (isArrayLike(list[idx])) {
|
|
27
|
-
value = recursive ? flatt(list[idx]) : list[idx];
|
|
28
|
-
j = 0;
|
|
29
|
-
jlen = value.length;
|
|
30
|
-
while (j < jlen) {
|
|
31
|
-
result[result.length] = value[j];
|
|
32
|
-
j += 1;
|
|
33
|
-
}
|
|
34
|
-
} else {
|
|
35
|
-
result[result.length] = list[idx];
|
|
36
|
-
}
|
|
37
|
-
idx += 1;
|
|
38
|
-
}
|
|
39
|
-
return result;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export default makeFlat;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { bind } from 'ramda';
|
|
2
|
-
|
|
3
|
-
import isIterable from '../../isIterable.js';
|
|
4
|
-
import isNotUndefined from '../../isNotUndefined.js';
|
|
5
|
-
import isNotNil from '../../isNotNil.js';
|
|
6
|
-
import isNotFunction from '../../isNotFunction.js';
|
|
7
|
-
|
|
8
|
-
const copyArray = (items, mapFn, thisArg) => {
|
|
9
|
-
const boundMapFn = isNotUndefined(thisArg) ? bind(mapFn, thisArg) : mapFn;
|
|
10
|
-
|
|
11
|
-
return isNotUndefined(mapFn) ? [...items].map(boundMapFn) : [...items];
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const fromArray = (items, mapFn, thisArg) => {
|
|
15
|
-
if (items == null) {
|
|
16
|
-
throw new TypeError(
|
|
17
|
-
'Array.from requires an array-like object - not null or undefined'
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
if (isNotNil(mapFn) && isNotFunction(mapFn)) {
|
|
22
|
-
throw new TypeError(
|
|
23
|
-
'Array.from: when provided, the second argument must be a function'
|
|
24
|
-
);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
if (isIterable(items)) {
|
|
28
|
-
return copyArray(items, mapFn, thisArg);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return [];
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export default fromArray;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import isFinite from '../../isFinite.js';
|
|
2
|
-
|
|
3
|
-
const truncPonyfill = (v) => {
|
|
4
|
-
const numV = Number(v);
|
|
5
|
-
|
|
6
|
-
if (!isFinite(numV)) {
|
|
7
|
-
return numV;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
// eslint-disable-next-line no-nested-ternary
|
|
11
|
-
return numV - (numV % 1) || (numV < 0 ? -0 : numV === 0 ? numV : 0);
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export default truncPonyfill;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { both } from 'ramda';
|
|
2
|
-
|
|
3
|
-
import isInteger from '../../isInteger.js';
|
|
4
|
-
import MAX_SAFE_INTEGER from './Number.MAX_SAFE_INTEGER.js';
|
|
5
|
-
|
|
6
|
-
const isSafeIntegerPonyfill = both(
|
|
7
|
-
isInteger,
|
|
8
|
-
(value) => Math.abs(value) <= MAX_SAFE_INTEGER
|
|
9
|
-
);
|
|
10
|
-
|
|
11
|
-
export default isSafeIntegerPonyfill;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { map } from 'ramda';
|
|
2
|
-
|
|
3
|
-
import allP from '../../allP.js';
|
|
4
|
-
import resolveP from '../../resolveP.js';
|
|
5
|
-
|
|
6
|
-
const onFulfill = (value) => ({ status: 'fulfilled', value });
|
|
7
|
-
const onReject = (reason) => ({ status: 'rejected', reason });
|
|
8
|
-
|
|
9
|
-
const allSettledPonyfill = (iterable) => {
|
|
10
|
-
const array = map(
|
|
11
|
-
(p) => resolveP(p).then(onFulfill).catch(onReject),
|
|
12
|
-
[...iterable]
|
|
13
|
-
);
|
|
14
|
-
|
|
15
|
-
return allP(array);
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export default allSettledPonyfill;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { map } from 'ramda';
|
|
2
|
-
|
|
3
|
-
import resolveP from '../../resolveP.js';
|
|
4
|
-
|
|
5
|
-
export class AggregatedError extends Error {
|
|
6
|
-
constructor(errors = [], message = '') {
|
|
7
|
-
super(message);
|
|
8
|
-
|
|
9
|
-
this.errors = errors;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const anyPonyfill = (iterable) => {
|
|
14
|
-
const exceptions = [];
|
|
15
|
-
|
|
16
|
-
return new Promise((resolve, reject) => {
|
|
17
|
-
const onReject = (e) => {
|
|
18
|
-
exceptions.push(e);
|
|
19
|
-
|
|
20
|
-
if (exceptions.length === iterable.length) {
|
|
21
|
-
reject(new AggregatedError(exceptions));
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
map((p) => resolveP(p).then(resolve).catch(onReject), [...iterable]);
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export default anyPonyfill;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import isFunction from '../../isFunction.js';
|
|
2
|
-
import isNotUndefined from '../../isNotUndefined.js';
|
|
3
|
-
import repeat from './String.repeat.js';
|
|
4
|
-
|
|
5
|
-
const padEndPonyfill = (padString, targetLength, value) => {
|
|
6
|
-
// eslint-disable-next-line no-bitwise
|
|
7
|
-
let finalLength = targetLength >> 0;
|
|
8
|
-
let finalPadString = String(isNotUndefined(padString) ? padString : ' ');
|
|
9
|
-
|
|
10
|
-
if (value.length > finalLength) {
|
|
11
|
-
return String(value);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
finalLength -= value.length;
|
|
15
|
-
if (finalLength > finalPadString.length) {
|
|
16
|
-
const remainingLength = finalLength / finalPadString.length;
|
|
17
|
-
finalPadString += isFunction(String.prototype.repeat)
|
|
18
|
-
? finalPadString.repeat(remainingLength)
|
|
19
|
-
: repeat(finalPadString, remainingLength);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
return String(value) + finalPadString.slice(0, finalLength);
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export default padEndPonyfill;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import isFunction from '../../isFunction.js';
|
|
2
|
-
import isNotUndefined from '../../isNotUndefined.js';
|
|
3
|
-
import repeat from './String.repeat.js';
|
|
4
|
-
|
|
5
|
-
const padStartPonyfill = (padString, targetLength, value) => {
|
|
6
|
-
// eslint-disable-next-line no-bitwise
|
|
7
|
-
let finalLength = targetLength >> 0; // truncate if number, or convert non-number to 0;
|
|
8
|
-
let finalPadString = String(isNotUndefined(padString) ? padString : ' ');
|
|
9
|
-
|
|
10
|
-
// return the original string, if targeted length is less than original strings length
|
|
11
|
-
if (value.length >= finalLength) {
|
|
12
|
-
return String(value);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
finalLength -= value.length;
|
|
16
|
-
if (finalLength > finalPadString.length) {
|
|
17
|
-
const lenghtToPad = finalLength / finalPadString.length;
|
|
18
|
-
// append to original to ensure we are longer than needed
|
|
19
|
-
finalPadString += isFunction(String.prototype.repeat)
|
|
20
|
-
? finalPadString.repeat(lenghtToPad)
|
|
21
|
-
: repeat(finalPadString, lenghtToPad);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
return finalPadString.slice(0, finalLength) + String(value);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export default padStartPonyfill;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import isNotFinite from '../../isNotFinite.js';
|
|
2
|
-
import isNegative from '../../isNegative.js';
|
|
3
|
-
|
|
4
|
-
const repeat = (value, count) => {
|
|
5
|
-
let validCount = Number(count);
|
|
6
|
-
|
|
7
|
-
if (validCount !== count) {
|
|
8
|
-
validCount = 0;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
if (isNegative(validCount)) {
|
|
12
|
-
throw new RangeError('repeat count must be non-negative');
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
if (isNotFinite(validCount)) {
|
|
16
|
-
throw new RangeError('repeat count must be less than infinity');
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
validCount = Math.floor(validCount);
|
|
20
|
-
|
|
21
|
-
if (value.length === 0 || validCount === 0) {
|
|
22
|
-
return '';
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// Ensuring validCount is a 31-bit integer allows us to heavily optimize the
|
|
26
|
-
// main part. But anyway, most current (August 2014) browsers can't handle
|
|
27
|
-
// strings 1 << 28 chars or longer, so:
|
|
28
|
-
// eslint-disable-next-line no-bitwise
|
|
29
|
-
if (value.length * validCount >= 1 << 28) {
|
|
30
|
-
throw new RangeError('repeat count must not overflow maximum string size');
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const maxCount = value.length * validCount;
|
|
34
|
-
|
|
35
|
-
validCount = Math.floor(Math.log(validCount) / Math.log(2));
|
|
36
|
-
|
|
37
|
-
let result = value;
|
|
38
|
-
|
|
39
|
-
while (validCount) {
|
|
40
|
-
result += value;
|
|
41
|
-
validCount -= 1;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
result += result.substring(0, maxCount - result.length);
|
|
45
|
-
|
|
46
|
-
return result;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export default repeat;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { replace } from 'ramda';
|
|
2
|
-
|
|
3
|
-
import isRegExp from '../../isRegExp.js';
|
|
4
|
-
import escapeRegExp from '../../escapeRegExp.js';
|
|
5
|
-
|
|
6
|
-
const checkArguments = (searchValue, replaceValue, str) => {
|
|
7
|
-
if (str == null || searchValue == null || replaceValue == null) {
|
|
8
|
-
throw TypeError('Input values must not be `null` or `undefined`');
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
const checkValue = (value, valueName) => {
|
|
13
|
-
if (typeof value !== 'string') {
|
|
14
|
-
if (!(value instanceof String)) {
|
|
15
|
-
throw TypeError(`\`${valueName}\` must be a string`);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const checkSearchValue = (searchValue) => {
|
|
21
|
-
if (
|
|
22
|
-
typeof searchValue !== 'string' &&
|
|
23
|
-
!(searchValue instanceof String) &&
|
|
24
|
-
!(searchValue instanceof RegExp)
|
|
25
|
-
) {
|
|
26
|
-
throw TypeError('`searchValue` must be a string or an regexp');
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
const replaceAll = (searchValue, replaceValue, str) => {
|
|
31
|
-
checkArguments(searchValue, replaceValue, str);
|
|
32
|
-
checkValue(str, 'str');
|
|
33
|
-
checkValue(replaceValue, 'replaceValue');
|
|
34
|
-
checkSearchValue(searchValue);
|
|
35
|
-
|
|
36
|
-
const regexp = new RegExp(
|
|
37
|
-
isRegExp(searchValue) ? searchValue : escapeRegExp(searchValue),
|
|
38
|
-
'g'
|
|
39
|
-
);
|
|
40
|
-
|
|
41
|
-
return replace(regexp, replaceValue, str);
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export default replaceAll;
|
package/src/invoke.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { __ } from 'ramda';
|
|
2
|
-
|
|
3
|
-
import invokeArgs from './invokeArgs.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Invokes the method at path of object.
|
|
7
|
-
*
|
|
8
|
-
* @func invoke
|
|
9
|
-
* @memberOf RA
|
|
10
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/2.31.0|v2.31.0}
|
|
11
|
-
* @category Object
|
|
12
|
-
* @sig Array -> Object -> *
|
|
13
|
-
* @param {Array.<string|number>} path The path of the method to invoke
|
|
14
|
-
* @param {Object} obj The object to query
|
|
15
|
-
* @return {*}
|
|
16
|
-
* @example
|
|
17
|
-
*
|
|
18
|
-
* RA.invoke(['random'], Math); //=> 0.5113253820009047
|
|
19
|
-
*/
|
|
20
|
-
const invoke = invokeArgs(__, [], __);
|
|
21
|
-
|
|
22
|
-
export default invoke;
|
package/src/invokeArgs.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { curryN, path, apply, init, bind } from 'ramda';
|
|
2
|
-
|
|
3
|
-
import isNotFunction from './isNotFunction.js';
|
|
4
|
-
import isEmptyArray from './isEmptyArray.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Invokes the method at path of object with given arguments.
|
|
8
|
-
*
|
|
9
|
-
* @func invokeArgs
|
|
10
|
-
* @memberOf RA
|
|
11
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/2.27.0|v2.27.0}
|
|
12
|
-
* @category Object
|
|
13
|
-
* @sig Array -> Array -> Object -> *
|
|
14
|
-
* @param {Array.<string|number>} path The path of the method to invoke
|
|
15
|
-
* @param {Array} args The arguments to invoke the method with
|
|
16
|
-
* @param {Object} obj The object to query
|
|
17
|
-
* @return {*}
|
|
18
|
-
* @example
|
|
19
|
-
*
|
|
20
|
-
* RA.invokeArgs(['abs'], [-1], Math); //=> 1
|
|
21
|
-
* RA.invokeArgs(['path', 'to', 'non-existent', 'method'], [-1], Math); //=> undefined
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
const invokeArgs = curryN(3, (mpath, args, obj) => {
|
|
25
|
-
const method = path(mpath, obj);
|
|
26
|
-
const context = path(init(mpath), obj);
|
|
27
|
-
|
|
28
|
-
if (isNotFunction(method)) return undefined;
|
|
29
|
-
if (isEmptyArray(mpath)) return undefined;
|
|
30
|
-
|
|
31
|
-
const boundMethod = bind(method, context);
|
|
32
|
-
|
|
33
|
-
return apply(boundMethod, args);
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
export default invokeArgs;
|
package/src/isArray.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { curryN, pipe, type, identical } from 'ramda';
|
|
2
|
-
|
|
3
|
-
import isFunction from './isFunction.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Checks if input value is `Array`.
|
|
7
|
-
*
|
|
8
|
-
* @func isArray
|
|
9
|
-
* @memberOf RA
|
|
10
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/0.3.0|v0.3.0}
|
|
11
|
-
* @category Type
|
|
12
|
-
* @sig * -> Boolean
|
|
13
|
-
* @param {*} val The value to test
|
|
14
|
-
* @return {boolean}
|
|
15
|
-
* @see {@link RA.isNotArray|isNotArray}
|
|
16
|
-
* @example
|
|
17
|
-
*
|
|
18
|
-
* RA.isArray([]); //=> true
|
|
19
|
-
* RA.isArray(null); //=> false
|
|
20
|
-
* RA.isArray({}); //=> false
|
|
21
|
-
*/
|
|
22
|
-
const isArray = curryN(
|
|
23
|
-
1,
|
|
24
|
-
isFunction(Array.isArray) ? Array.isArray : pipe(type, identical('Array'))
|
|
25
|
-
);
|
|
26
|
-
|
|
27
|
-
export default isArray;
|
package/src/isArrayLike.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { has, curryN } from 'ramda';
|
|
2
|
-
|
|
3
|
-
import isArray from './isArray.js';
|
|
4
|
-
import isString from './isString.js';
|
|
5
|
-
|
|
6
|
-
/* eslint-disable max-len */
|
|
7
|
-
/**
|
|
8
|
-
* Tests whether or not an object is similar to an array.
|
|
9
|
-
*
|
|
10
|
-
* @func isArrayLike
|
|
11
|
-
* @memberOf RA
|
|
12
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/1.9.0|v1.9.0}
|
|
13
|
-
* @licence https://github.com/ramda/ramda/blob/master/LICENSE.txt
|
|
14
|
-
* @category List
|
|
15
|
-
* @category Type
|
|
16
|
-
* @sig * -> Boolean
|
|
17
|
-
* @param {*} val The value to test
|
|
18
|
-
* @returns {boolean} `true` if `val` has a numeric length property and extreme indices defined; `false` otherwise.
|
|
19
|
-
* @see {@link RA.isNotArrayLike|isNotArrayLike}
|
|
20
|
-
|
|
21
|
-
* @example
|
|
22
|
-
*
|
|
23
|
-
* RA.isArrayLike([]); //=> true
|
|
24
|
-
* RA.isArrayLike(true); //=> false
|
|
25
|
-
* RA.isArrayLike({}); //=> false
|
|
26
|
-
* RA.isArrayLike({length: 10}); //=> false
|
|
27
|
-
* RA.isArrayLike({0: 'zero', 9: 'nine', length: 10}); //=> true
|
|
28
|
-
*/
|
|
29
|
-
/* eslint-enable max-len */
|
|
30
|
-
const isArrayLike = curryN(1, (val) => {
|
|
31
|
-
if (isArray(val)) {
|
|
32
|
-
return true;
|
|
33
|
-
}
|
|
34
|
-
if (!val) {
|
|
35
|
-
return false;
|
|
36
|
-
}
|
|
37
|
-
if (isString(val)) {
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
if (typeof val !== 'object') {
|
|
41
|
-
return false;
|
|
42
|
-
}
|
|
43
|
-
if (val.nodeType === 1) {
|
|
44
|
-
return !!val.length;
|
|
45
|
-
}
|
|
46
|
-
if (val.length === 0) {
|
|
47
|
-
return true;
|
|
48
|
-
}
|
|
49
|
-
if (val.length > 0) {
|
|
50
|
-
return has(0, val) && has(val.length - 1, val);
|
|
51
|
-
}
|
|
52
|
-
return false;
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
export default isArrayLike;
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
The MIT License (MIT)
|
|
59
|
-
|
|
60
|
-
Copyright (c) 2013-2016 Scott Sauyet and Michael Hurley
|
|
61
|
-
|
|
62
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
63
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
64
|
-
in the Software without restriction, including without limitation the rights
|
|
65
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
66
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
67
|
-
furnished to do so, subject to the following conditions:
|
|
68
|
-
|
|
69
|
-
The above copyright notice and this permission notice shall be included in
|
|
70
|
-
all copies or substantial portions of the Software.
|
|
71
|
-
|
|
72
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
73
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
74
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
75
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
76
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
77
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
78
|
-
THE SOFTWARE.
|
|
79
|
-
*/
|
package/src/isAsyncFunction.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { pipe, type, identical, curryN } from 'ramda';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Checks if input value is `Async Function`.
|
|
5
|
-
*
|
|
6
|
-
* @func isAsyncFunction
|
|
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.isNotAsyncFunction|isNotAsyncFunction}, {@link RA.isGeneratorFunction|isGeneratorFunction}
|
|
14
|
-
* @example
|
|
15
|
-
*
|
|
16
|
-
* RA.isAsyncFunction(async function test() { }); //=> true
|
|
17
|
-
* RA.isAsyncFunction(null); //=> false
|
|
18
|
-
* RA.isAsyncFunction(function test() { }); //=> false
|
|
19
|
-
* RA.isAsyncFunction(() => {}); //=> false
|
|
20
|
-
*/
|
|
21
|
-
const isAsyncFunction = curryN(1, pipe(type, identical('AsyncFunction')));
|
|
22
|
-
|
|
23
|
-
export default isAsyncFunction;
|
package/src/isBigInt.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { type, pipe, identical, curryN } from 'ramda';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Checks if value is a BigInt.
|
|
5
|
-
*
|
|
6
|
-
* @func isBigInt
|
|
7
|
-
* @memberOf RA
|
|
8
|
-
* @category Type
|
|
9
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/2.27.0|v2.27.0}
|
|
10
|
-
* @sig * -> Boolean
|
|
11
|
-
* @param {*} val The value to test
|
|
12
|
-
* @return {boolean}
|
|
13
|
-
* @example
|
|
14
|
-
*
|
|
15
|
-
* RA.isBigInt(5); // => false
|
|
16
|
-
* RA.isBigInt(Number.MAX_VALUE); // => false
|
|
17
|
-
* RA.isBigInt(-Infinity); // => false
|
|
18
|
-
* RA.isBigInt(10); // => false
|
|
19
|
-
* RA.isBigInt(10n); // => true
|
|
20
|
-
* RA.isBigInt(BitInt(9007199254740991)); // => true
|
|
21
|
-
*/
|
|
22
|
-
const isBigInt = curryN(1, pipe(type, identical('BigInt')));
|
|
23
|
-
|
|
24
|
-
export default isBigInt;
|
package/src/isBlank.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { isEmpty, isNil, anyPass, test } from 'ramda';
|
|
2
|
-
|
|
3
|
-
import isFalse from './isFalse.js';
|
|
4
|
-
/**
|
|
5
|
-
* Returns `true` if the given value is its type's empty value, `false`, `undefined`
|
|
6
|
-
* as well as strings containing only whitespace characters; `false` otherwise.
|
|
7
|
-
*
|
|
8
|
-
* @func isBlank
|
|
9
|
-
* @memberOf RA
|
|
10
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/3.1.0|v3.1.0}
|
|
11
|
-
* @category Type
|
|
12
|
-
* @sig * -> Boolean
|
|
13
|
-
* @param {*} val The value to test
|
|
14
|
-
* @return {boolean}
|
|
15
|
-
* @see {@link https://blog.appsignal.com/2018/09/11/differences-between-nil-empty-blank-and-present.html|Differences Between #nil?, #empty?, #blank?, and #present?}
|
|
16
|
-
* @example
|
|
17
|
-
*
|
|
18
|
-
* RA.isBlank(''); //=> true
|
|
19
|
-
* RA.isBlank(' '); //=> true
|
|
20
|
-
* RA.isBlank('\t\n'); //=> true
|
|
21
|
-
* RA.isBlank({}); //=> true
|
|
22
|
-
* RA.isBlank(null); //=> true
|
|
23
|
-
* RA.isBlank(undefined); //=> true
|
|
24
|
-
* RA.isBlank([]); //=> true
|
|
25
|
-
* RA.isBlank(false); //=> true
|
|
26
|
-
* RA.isBlank('value'); //=> false
|
|
27
|
-
* RA.isBlank({ foo: 'foo' }); //=> false
|
|
28
|
-
* RA.isBlank([1, 2, 3]); //=> false
|
|
29
|
-
* RA.isBlank(true); //=> false
|
|
30
|
-
*/
|
|
31
|
-
const isBlank = anyPass([isFalse, isNil, isEmpty, test(/^\s+$/gm)]);
|
|
32
|
-
|
|
33
|
-
export default isBlank;
|
package/src/isBoolean.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { type, identical, pipe, curryN } from 'ramda';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Checks if input value is `Boolean`.
|
|
5
|
-
*
|
|
6
|
-
* @func isBoolean
|
|
7
|
-
* @memberOf RA
|
|
8
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/0.3.0|v0.3.0}
|
|
9
|
-
* @category Type
|
|
10
|
-
* @sig * -> Boolean
|
|
11
|
-
* @param {*} val The value to test
|
|
12
|
-
* @return {boolean}
|
|
13
|
-
* @see {@link RA.isNotBoolean|isNotBoolean}
|
|
14
|
-
* @example
|
|
15
|
-
*
|
|
16
|
-
* RA.isBoolean(false); //=> true
|
|
17
|
-
* RA.isBoolean(true); //=> true
|
|
18
|
-
* RA.isBoolean(null); //=> false
|
|
19
|
-
*/
|
|
20
|
-
const isBoolean = curryN(1, pipe(type, identical('Boolean')));
|
|
21
|
-
|
|
22
|
-
export default isBoolean;
|
package/src/isDate.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { type, identical, pipe, curryN } from 'ramda';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Checks if value is `Date` object.
|
|
5
|
-
*
|
|
6
|
-
* @func isDate
|
|
7
|
-
* @memberOf RA
|
|
8
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/0.6.0|v0.6.0}
|
|
9
|
-
* @category Type
|
|
10
|
-
* @sig * -> Boolean
|
|
11
|
-
* @param {*} val The value to test
|
|
12
|
-
* @return {boolean}
|
|
13
|
-
* @see {@link RA.isNotDate|isNotDate}, {@link RA.isValidDate|isValidDate}, {@link RA.isNotValidDate|isNotValidDate}
|
|
14
|
-
* @example
|
|
15
|
-
*
|
|
16
|
-
* RA.isDate(new Date()); //=> true
|
|
17
|
-
* RA.isDate('1997-07-16T19:20+01:00'); //=> false
|
|
18
|
-
*/
|
|
19
|
-
const isDate = curryN(1, pipe(type, identical('Date')));
|
|
20
|
-
|
|
21
|
-
export default isDate;
|