ramda-adjunct 2.34.0
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/.nvmrc +1 -0
- package/CHANGELOG.md +973 -0
- package/LICENSE.md +25 -0
- package/README.md +297 -0
- package/SECURITY.md +43 -0
- package/dist/RA.node.js +11172 -0
- package/dist/RA.node.min.js +2 -0
- package/dist/RA.node.min.js.LICENSE.txt +22 -0
- package/dist/RA.web.js +11172 -0
- package/dist/RA.web.min.js +2 -0
- package/dist/RA.web.min.js.LICENSE.txt +22 -0
- package/dist/RA.web.standalone.js +27797 -0
- package/dist/RA.web.standalone.min.js +2 -0
- package/dist/RA.web.standalone.min.js.LICENSE.txt +22 -0
- package/es/Y.js +38 -0
- package/es/allEqual.js +25 -0
- package/es/allEqualTo.js +26 -0
- package/es/allIdentical.js +24 -0
- package/es/allIdenticalTo.js +26 -0
- package/es/allP.js +26 -0
- package/es/allSettledP.js +29 -0
- package/es/allUnique.js +23 -0
- package/es/anyP.js +28 -0
- package/es/appendFlipped.js +23 -0
- package/es/argsPass.js +38 -0
- package/es/async.js +57 -0
- package/es/cata.js +101 -0
- package/es/catchP.js +24 -0
- package/es/ceil.js +26 -0
- package/es/compact.js +21 -0
- package/es/concatAll.js +30 -0
- package/es/concatRight.js +29 -0
- package/es/contained.js +29 -0
- package/es/curryRight.js +24 -0
- package/es/curryRightN.js +32 -0
- package/es/defaultWhen.js +25 -0
- package/es/delayP.js +44 -0
- package/es/dispatch.js +75 -0
- package/es/divideNum.js +19 -0
- package/es/dropArgs.js +22 -0
- package/es/ensureArray.js +22 -0
- package/es/escapeRegExp.js +20 -0
- package/es/fantasy-land/Identity.js +309 -0
- package/es/fantasy-land/mapping.js +20 -0
- package/es/fantasy-land/traits.js +41 -0
- package/es/fantasy-land/util.js +11 -0
- package/es/filterIndexed.js +27 -0
- package/es/findOr.js +28 -0
- package/es/flattenDepth.js +50 -0
- package/es/flattenPath.js +27 -0
- package/es/flattenProp.js +28 -0
- package/es/floor.js +25 -0
- package/es/fnull.js +37 -0
- package/es/hasPath.js +38 -0
- package/es/inRange.js +29 -0
- package/es/index.js +252 -0
- package/es/internal/ap.js +20 -0
- package/es/internal/compareLength.js +5 -0
- package/es/internal/isOfTypeObject.js +7 -0
- package/es/internal/makeFlat.js +46 -0
- package/es/internal/ponyfills/Array.from.js +40 -0
- package/es/internal/ponyfills/Math.sign.js +5 -0
- package/es/internal/ponyfills/Math.trunc.js +14 -0
- package/es/internal/ponyfills/Number.MAX_SAFE_INTEGER.js +2 -0
- package/es/internal/ponyfills/Number.MIN_SAFE_INTEGER.js +2 -0
- package/es/internal/ponyfills/Number.isFinite.js +5 -0
- package/es/internal/ponyfills/Number.isInteger.js +4 -0
- package/es/internal/ponyfills/Number.isNaN.js +5 -0
- package/es/internal/ponyfills/Number.isSafeInteger.js +7 -0
- package/es/internal/ponyfills/Promise.allSettled.js +38 -0
- package/es/internal/ponyfills/Promise.any.js +77 -0
- package/es/internal/ponyfills/String.padEnd.js +24 -0
- package/es/internal/ponyfills/String.padStart.js +26 -0
- package/es/internal/ponyfills/String.repeat.js +46 -0
- package/es/internal/ponyfills/String.replaceAll.js +34 -0
- package/es/internal/ponyfills/String.trimEnd.js +3 -0
- package/es/internal/ponyfills/String.trimStart.js +3 -0
- package/es/invoke.js +20 -0
- package/es/invokeArgs.js +30 -0
- package/es/isArray.js +22 -0
- package/es/isArrayLike.js +87 -0
- package/es/isAsyncFunction.js +22 -0
- package/es/isBigInt.js +23 -0
- package/es/isBoolean.js +21 -0
- package/es/isDate.js +20 -0
- package/es/isEmptyArray.js +26 -0
- package/es/isEmptyString.js +27 -0
- package/es/isError.js +20 -0
- package/es/isEven.js +29 -0
- package/es/isFalse.js +29 -0
- package/es/isFalsy.js +26 -0
- package/es/isFinite.js +33 -0
- package/es/isFloat.js +34 -0
- package/es/isFunction.js +26 -0
- package/es/isGeneratorFunction.js +33 -0
- package/es/isIndexed.js +21 -0
- package/es/isInteger.js +35 -0
- package/es/isInteger32.js +28 -0
- package/es/isIterable.js +33 -0
- package/es/isMap.js +23 -0
- package/es/isNaN.js +41 -0
- package/es/isNaturalNumber.js +25 -0
- package/es/isNegative.js +25 -0
- package/es/isNegativeZero.js +22 -0
- package/es/isNilOrEmpty.js +25 -0
- package/es/isNonEmptyArray.js +27 -0
- package/es/isNonEmptyString.js +30 -0
- package/es/isNonNegative.js +28 -0
- package/es/isNonPositive.js +28 -0
- package/es/isNotArray.js +22 -0
- package/es/isNotArrayLike.js +24 -0
- package/es/isNotAsyncFunction.js +27 -0
- package/es/isNotBoolean.js +22 -0
- package/es/isNotDate.js +21 -0
- package/es/isNotEmpty.js +25 -0
- package/es/isNotFinite.js +29 -0
- package/es/isNotFloat.js +33 -0
- package/es/isNotFunction.js +29 -0
- package/es/isNotGeneratorFunction.js +27 -0
- package/es/isNotInteger.js +34 -0
- package/es/isNotMap.js +24 -0
- package/es/isNotNaN.js +35 -0
- package/es/isNotNil.js +22 -0
- package/es/isNotNilOrEmpty.js +26 -0
- package/es/isNotNull.js +22 -0
- package/es/isNotNumber.js +23 -0
- package/es/isNotObj.js +29 -0
- package/es/isNotObjLike.js +29 -0
- package/es/isNotPair.js +25 -0
- package/es/isNotPlainObj.js +35 -0
- package/es/isNotPrimitive.js +22 -0
- package/es/isNotRegExp.js +22 -0
- package/es/isNotSet.js +23 -0
- package/es/isNotString.js +21 -0
- package/es/isNotUndefined.js +22 -0
- package/es/isNotValidDate.js +22 -0
- package/es/isNotValidNumber.js +25 -0
- package/es/isNull.js +21 -0
- package/es/isNumber.js +23 -0
- package/es/isObj.js +31 -0
- package/es/isObjLike.js +30 -0
- package/es/isOdd.js +24 -0
- package/es/isPair.js +25 -0
- package/es/isPlainObj.js +52 -0
- package/es/isPositive.js +24 -0
- package/es/isPositiveZero.js +22 -0
- package/es/isPrimitive.js +31 -0
- package/es/isPromise.js +27 -0
- package/es/isPrototypeOf.js +34 -0
- package/es/isRegExp.js +21 -0
- package/es/isSafeInteger.js +34 -0
- package/es/isSentinelValue.js +26 -0
- package/es/isSet.js +22 -0
- package/es/isSparseArray.js +30 -0
- package/es/isString.js +20 -0
- package/es/isSymbol.js +27 -0
- package/es/isThenable.js +26 -0
- package/es/isTrue.js +25 -0
- package/es/isTruthy.js +27 -0
- package/es/isUndefined.js +22 -0
- package/es/isValidDate.js +26 -0
- package/es/isValidNumber.js +26 -0
- package/es/lastP.js +63 -0
- package/es/lengthEq.js +22 -0
- package/es/lengthGt.js +22 -0
- package/es/lengthGte.js +24 -0
- package/es/lengthLt.js +22 -0
- package/es/lengthLte.js +23 -0
- package/es/lengthNotEq.js +22 -0
- package/es/lensEq.js +27 -0
- package/es/lensIso.js +55 -0
- package/es/lensNotEq.js +26 -0
- package/es/lensNotSatisfy.js +28 -0
- package/es/lensSatisfies.js +31 -0
- package/es/lensTraverse.js +42 -0
- package/es/liftF.js +37 -0
- package/es/liftFN.js +47 -0
- package/es/list.js +19 -0
- package/es/mapIndexed.js +26 -0
- package/es/mergePath.js +30 -0
- package/es/mergePaths.js +27 -0
- package/es/mergeProp.js +30 -0
- package/es/mergeProps.js +26 -0
- package/es/mergeRight.js +26 -0
- package/es/move.js +25 -0
- package/es/nand.js +27 -0
- package/es/neither.js +39 -0
- package/es/noneP.js +28 -0
- package/es/nonePass.js +31 -0
- package/es/noop.js +19 -0
- package/es/nor.js +28 -0
- package/es/notAllPass.js +31 -0
- package/es/notAllUnique.js +23 -0
- package/es/notBoth.js +39 -0
- package/es/notEqual.js +30 -0
- package/es/omitBy.js +26 -0
- package/es/omitIndexes.js +27 -0
- package/es/overlaps.js +29 -0
- package/es/padCharsEnd.js +31 -0
- package/es/padCharsStart.js +29 -0
- package/es/padEnd.js +24 -0
- package/es/padStart.js +22 -0
- package/es/pathNotEq.js +32 -0
- package/es/pathOrLazy.js +25 -0
- package/es/paths.js +27 -0
- package/es/pickIndexes.js +30 -0
- package/es/propNotEq.js +29 -0
- package/es/rangeStep.js +36 -0
- package/es/reduceIndexed.js +30 -0
- package/es/reduceP.js +111 -0
- package/es/reduceRightP.js +117 -0
- package/es/rejectP.js +23 -0
- package/es/renameKeyWith.js +28 -0
- package/es/renameKeys.js +42 -0
- package/es/renameKeysWith.js +26 -0
- package/es/repeatStr.js +24 -0
- package/es/replaceAll.js +29 -0
- package/es/resolveP.js +29 -0
- package/es/round.js +24 -0
- package/es/seq.js +44 -0
- package/es/sign.js +27 -0
- package/es/skipTake.js +22 -0
- package/es/sliceFrom.js +22 -0
- package/es/sliceTo.js +22 -0
- package/es/sortByProps.js +52 -0
- package/es/spreadPath.js +25 -0
- package/es/spreadProp.js +25 -0
- package/es/stubArray.js +19 -0
- package/es/stubNull.js +18 -0
- package/es/stubObj.js +20 -0
- package/es/stubString.js +18 -0
- package/es/stubUndefined.js +19 -0
- package/es/subtractNum.js +19 -0
- package/es/thenCatchP.js +26 -0
- package/es/thenP.js +28 -0
- package/es/toArray.js +27 -0
- package/es/toInteger32.js +24 -0
- package/es/toUinteger32.js +26 -0
- package/es/trimCharsEnd.js +22 -0
- package/es/trimCharsStart.js +22 -0
- package/es/trimEnd.js +23 -0
- package/es/trimStart.js +22 -0
- package/es/trunc.js +27 -0
- package/es/unzipObjWith.js +26 -0
- package/es/viewOr.js +30 -0
- package/es/weave.js +36 -0
- package/es/weaveLazy.js +38 -0
- package/es/zipObjWith.js +26 -0
- package/lib/Y.js +44 -0
- package/lib/allEqual.js +35 -0
- package/lib/allEqualTo.js +32 -0
- package/lib/allIdentical.js +33 -0
- package/lib/allIdenticalTo.js +32 -0
- package/lib/allP.js +32 -0
- package/lib/allSettledP.js +41 -0
- package/lib/allUnique.js +32 -0
- package/lib/anyP.js +47 -0
- package/lib/appendFlipped.js +29 -0
- package/lib/argsPass.js +48 -0
- package/lib/async.js +67 -0
- package/lib/cata.js +110 -0
- package/lib/catchP.js +30 -0
- package/lib/ceil.js +32 -0
- package/lib/compact.js +30 -0
- package/lib/concatAll.js +40 -0
- package/lib/concatRight.js +35 -0
- package/lib/contained.js +35 -0
- package/lib/curryRight.js +33 -0
- package/lib/curryRightN.js +38 -0
- package/lib/defaultWhen.js +31 -0
- package/lib/delayP.js +54 -0
- package/lib/dispatch.js +50 -0
- package/lib/divideNum.js +25 -0
- package/lib/dropArgs.js +28 -0
- package/lib/ensureArray.js +31 -0
- package/lib/escapeRegExp.js +29 -0
- package/lib/fantasy-land/Identity.js +323 -0
- package/lib/fantasy-land/mapping.js +44 -0
- package/lib/fantasy-land/traits.js +77 -0
- package/lib/fantasy-land/util.js +21 -0
- package/lib/filterIndexed.js +33 -0
- package/lib/findOr.js +34 -0
- package/lib/flattenDepth.js +58 -0
- package/lib/flattenPath.js +33 -0
- package/lib/flattenProp.js +37 -0
- package/lib/floor.js +31 -0
- package/lib/fnull.js +47 -0
- package/lib/hasPath.js +47 -0
- package/lib/inRange.js +37 -0
- package/lib/index.js +863 -0
- package/lib/internal/ap.js +37 -0
- package/lib/internal/compareLength.js +12 -0
- package/lib/internal/isOfTypeObject.js +13 -0
- package/lib/internal/makeFlat.js +54 -0
- package/lib/internal/ponyfills/Array.from.js +52 -0
- package/lib/internal/ponyfills/Math.sign.js +11 -0
- package/lib/internal/ponyfills/Math.trunc.js +22 -0
- package/lib/internal/ponyfills/Number.MAX_SAFE_INTEGER.js +7 -0
- package/lib/internal/ponyfills/Number.MIN_SAFE_INTEGER.js +7 -0
- package/lib/internal/ponyfills/Number.isFinite.js +15 -0
- package/lib/internal/ponyfills/Number.isInteger.js +14 -0
- package/lib/internal/ponyfills/Number.isNaN.js +15 -0
- package/lib/internal/ponyfills/Number.isSafeInteger.js +18 -0
- package/lib/internal/ponyfills/Promise.allSettled.js +48 -0
- package/lib/internal/ponyfills/Promise.any.js +89 -0
- package/lib/internal/ponyfills/String.padEnd.js +34 -0
- package/lib/internal/ponyfills/String.padStart.js +36 -0
- package/lib/internal/ponyfills/String.repeat.js +55 -0
- package/lib/internal/ponyfills/String.replaceAll.js +44 -0
- package/lib/internal/ponyfills/String.trimEnd.js +10 -0
- package/lib/internal/ponyfills/String.trimStart.js +10 -0
- package/lib/invoke.js +29 -0
- package/lib/invokeArgs.js +40 -0
- package/lib/isArray.js +31 -0
- package/lib/isArrayLike.js +98 -0
- package/lib/isAsyncFunction.js +28 -0
- package/lib/isBigInt.js +29 -0
- package/lib/isBoolean.js +27 -0
- package/lib/isDate.js +26 -0
- package/lib/isEmptyArray.js +35 -0
- package/lib/isEmptyString.js +33 -0
- package/lib/isError.js +26 -0
- package/lib/isEven.js +39 -0
- package/lib/isFalse.js +35 -0
- package/lib/isFalsy.js +35 -0
- package/lib/isFinite.js +46 -0
- package/lib/isFloat.js +44 -0
- package/lib/isFunction.js +36 -0
- package/lib/isGeneratorFunction.js +40 -0
- package/lib/isIndexed.js +31 -0
- package/lib/isInteger.js +47 -0
- package/lib/isInteger32.js +37 -0
- package/lib/isIterable.js +42 -0
- package/lib/isMap.js +29 -0
- package/lib/isNaN.js +54 -0
- package/lib/isNaturalNumber.js +35 -0
- package/lib/isNegative.js +34 -0
- package/lib/isNegativeZero.js +28 -0
- package/lib/isNilOrEmpty.js +31 -0
- package/lib/isNonEmptyArray.js +37 -0
- package/lib/isNonEmptyString.js +41 -0
- package/lib/isNonNegative.js +37 -0
- package/lib/isNonPositive.js +37 -0
- package/lib/isNotArray.js +31 -0
- package/lib/isNotArrayLike.js +33 -0
- package/lib/isNotAsyncFunction.js +36 -0
- package/lib/isNotBoolean.js +31 -0
- package/lib/isNotDate.js +30 -0
- package/lib/isNotEmpty.js +31 -0
- package/lib/isNotFinite.js +38 -0
- package/lib/isNotFloat.js +42 -0
- package/lib/isNotFunction.js +38 -0
- package/lib/isNotGeneratorFunction.js +36 -0
- package/lib/isNotInteger.js +43 -0
- package/lib/isNotMap.js +33 -0
- package/lib/isNotNaN.js +44 -0
- package/lib/isNotNil.js +28 -0
- package/lib/isNotNilOrEmpty.js +35 -0
- package/lib/isNotNull.js +31 -0
- package/lib/isNotNumber.js +32 -0
- package/lib/isNotObj.js +38 -0
- package/lib/isNotObjLike.js +38 -0
- package/lib/isNotPair.js +34 -0
- package/lib/isNotPlainObj.js +44 -0
- package/lib/isNotPrimitive.js +31 -0
- package/lib/isNotRegExp.js +31 -0
- package/lib/isNotSet.js +32 -0
- package/lib/isNotString.js +30 -0
- package/lib/isNotUndefined.js +31 -0
- package/lib/isNotValidDate.js +31 -0
- package/lib/isNotValidNumber.js +34 -0
- package/lib/isNull.js +27 -0
- package/lib/isNumber.js +29 -0
- package/lib/isObj.js +42 -0
- package/lib/isObjLike.js +40 -0
- package/lib/isOdd.js +33 -0
- package/lib/isPair.js +34 -0
- package/lib/isPlainObj.js +64 -0
- package/lib/isPositive.js +33 -0
- package/lib/isPositiveZero.js +28 -0
- package/lib/isPrimitive.js +47 -0
- package/lib/isPromise.js +36 -0
- package/lib/isPrototypeOf.js +43 -0
- package/lib/isRegExp.js +27 -0
- package/lib/isSafeInteger.js +46 -0
- package/lib/isSentinelValue.js +35 -0
- package/lib/isSet.js +28 -0
- package/lib/isSparseArray.js +39 -0
- package/lib/isString.js +26 -0
- package/lib/isSymbol.js +33 -0
- package/lib/isThenable.js +35 -0
- package/lib/isTrue.js +31 -0
- package/lib/isTruthy.js +33 -0
- package/lib/isUndefined.js +31 -0
- package/lib/isValidDate.js +36 -0
- package/lib/isValidNumber.js +36 -0
- package/lib/lastP.js +76 -0
- package/lib/lengthEq.js +31 -0
- package/lib/lengthGt.js +31 -0
- package/lib/lengthGte.js +33 -0
- package/lib/lengthLt.js +31 -0
- package/lib/lengthLte.js +32 -0
- package/lib/lengthNotEq.js +31 -0
- package/lib/lensEq.js +33 -0
- package/lib/lensIso.js +62 -0
- package/lib/lensNotEq.js +35 -0
- package/lib/lensNotSatisfy.js +37 -0
- package/lib/lensSatisfies.js +40 -0
- package/lib/lensTraverse.js +51 -0
- package/lib/liftF.js +46 -0
- package/lib/liftFN.js +56 -0
- package/lib/list.js +25 -0
- package/lib/mapIndexed.js +32 -0
- package/lib/mergePath.js +39 -0
- package/lib/mergePaths.js +36 -0
- package/lib/mergeProp.js +39 -0
- package/lib/mergeProps.js +32 -0
- package/lib/mergeRight.js +32 -0
- package/lib/move.js +31 -0
- package/lib/nand.js +33 -0
- package/lib/neither.js +45 -0
- package/lib/noneP.js +39 -0
- package/lib/nonePass.js +37 -0
- package/lib/noop.js +28 -0
- package/lib/nor.js +34 -0
- package/lib/notAllPass.js +37 -0
- package/lib/notAllUnique.js +32 -0
- package/lib/notBoth.js +45 -0
- package/lib/notEqual.js +36 -0
- package/lib/omitBy.js +32 -0
- package/lib/omitIndexes.js +34 -0
- package/lib/overlaps.js +38 -0
- package/lib/padCharsEnd.js +44 -0
- package/lib/padCharsStart.js +42 -0
- package/lib/padEnd.js +32 -0
- package/lib/padStart.js +30 -0
- package/lib/pathNotEq.js +38 -0
- package/lib/pathOrLazy.js +31 -0
- package/lib/paths.js +33 -0
- package/lib/pickIndexes.js +37 -0
- package/lib/propNotEq.js +35 -0
- package/lib/rangeStep.js +45 -0
- package/lib/reduceIndexed.js +36 -0
- package/lib/reduceP.js +122 -0
- package/lib/reduceRightP.js +129 -0
- package/lib/rejectP.js +29 -0
- package/lib/renameKeyWith.js +37 -0
- package/lib/renameKeys.js +51 -0
- package/lib/renameKeysWith.js +32 -0
- package/lib/repeatStr.js +37 -0
- package/lib/replaceAll.js +42 -0
- package/lib/resolveP.js +35 -0
- package/lib/round.js +30 -0
- package/lib/seq.js +50 -0
- package/lib/sign.js +39 -0
- package/lib/skipTake.js +28 -0
- package/lib/sliceFrom.js +28 -0
- package/lib/sliceTo.js +28 -0
- package/lib/sortByProps.js +58 -0
- package/lib/spreadPath.js +31 -0
- package/lib/spreadProp.js +34 -0
- package/lib/stubArray.js +25 -0
- package/lib/stubNull.js +24 -0
- package/lib/stubObj.js +26 -0
- package/lib/stubString.js +24 -0
- package/lib/stubUndefined.js +25 -0
- package/lib/subtractNum.js +25 -0
- package/lib/thenCatchP.js +33 -0
- package/lib/thenP.js +34 -0
- package/lib/toArray.js +40 -0
- package/lib/toInteger32.js +30 -0
- package/lib/toUinteger32.js +32 -0
- package/lib/trimCharsEnd.js +31 -0
- package/lib/trimCharsStart.js +31 -0
- package/lib/trimEnd.js +36 -0
- package/lib/trimStart.js +35 -0
- package/lib/trunc.js +39 -0
- package/lib/unzipObjWith.js +35 -0
- package/lib/viewOr.js +36 -0
- package/lib/weave.js +42 -0
- package/lib/weaveLazy.js +44 -0
- package/lib/zipObjWith.js +32 -0
- package/package.json +204 -0
- package/src/Y.js +32 -0
- package/src/allEqual.js +28 -0
- package/src/allEqualTo.js +25 -0
- package/src/allIdentical.js +26 -0
- package/src/allIdenticalTo.js +25 -0
- package/src/allP.js +27 -0
- package/src/allSettledP.js +34 -0
- package/src/allUnique.js +25 -0
- package/src/anyP.js +33 -0
- package/src/appendFlipped.js +24 -0
- package/src/argsPass.js +40 -0
- package/src/async.js +60 -0
- package/src/cata.js +86 -0
- package/src/catchP.js +25 -0
- package/src/ceil.js +28 -0
- package/src/compact.js +23 -0
- package/src/concatAll.js +34 -0
- package/src/concatRight.js +30 -0
- package/src/contained.js +30 -0
- package/src/curryRight.js +26 -0
- package/src/curryRightN.js +29 -0
- package/src/defaultWhen.js +26 -0
- package/src/delayP.js +45 -0
- package/src/dispatch.js +74 -0
- package/src/divideNum.js +20 -0
- package/src/dropArgs.js +23 -0
- package/src/ensureArray.js +24 -0
- package/src/escapeRegExp.js +22 -0
- package/src/fantasy-land/Identity.js +270 -0
- package/src/fantasy-land/mapping.js +20 -0
- package/src/fantasy-land/traits.js +57 -0
- package/src/fantasy-land/util.js +23 -0
- package/src/filterIndexed.js +28 -0
- package/src/findOr.js +30 -0
- package/src/flattenDepth.js +39 -0
- package/src/flattenPath.js +26 -0
- package/src/flattenProp.js +28 -0
- package/src/floor.js +27 -0
- package/src/fnull.js +38 -0
- package/src/hasPath.js +40 -0
- package/src/inRange.js +34 -0
- package/src/index.js +241 -0
- package/src/internal/ap.js +30 -0
- package/src/internal/compareLength.js +7 -0
- package/src/internal/isOfTypeObject.js +3 -0
- package/src/internal/makeFlat.js +42 -0
- package/src/internal/ponyfills/Array.from.js +34 -0
- package/src/internal/ponyfills/Math.sign.js +3 -0
- package/src/internal/ponyfills/Math.trunc.js +14 -0
- package/src/internal/ponyfills/Number.MAX_SAFE_INTEGER.js +3 -0
- package/src/internal/ponyfills/Number.MIN_SAFE_INTEGER.js +3 -0
- package/src/internal/ponyfills/Number.isFinite.js +8 -0
- package/src/internal/ponyfills/Number.isInteger.js +10 -0
- package/src/internal/ponyfills/Number.isNaN.js +8 -0
- package/src/internal/ponyfills/Number.isSafeInteger.js +11 -0
- package/src/internal/ponyfills/Promise.allSettled.js +18 -0
- package/src/internal/ponyfills/Promise.any.js +29 -0
- package/src/internal/ponyfills/String.padEnd.js +25 -0
- package/src/internal/ponyfills/String.padStart.js +27 -0
- package/src/internal/ponyfills/String.repeat.js +49 -0
- package/src/internal/ponyfills/String.replaceAll.js +44 -0
- package/src/internal/ponyfills/String.trimEnd.js +5 -0
- package/src/internal/ponyfills/String.trimStart.js +5 -0
- package/src/invoke.js +22 -0
- package/src/invokeArgs.js +36 -0
- package/src/isArray.js +27 -0
- package/src/isArrayLike.js +79 -0
- package/src/isAsyncFunction.js +23 -0
- package/src/isBigInt.js +24 -0
- package/src/isBoolean.js +22 -0
- package/src/isDate.js +21 -0
- package/src/isEmptyArray.js +28 -0
- package/src/isEmptyString.js +28 -0
- package/src/isError.js +21 -0
- package/src/isEven.js +31 -0
- package/src/isFalse.js +31 -0
- package/src/isFalsy.js +28 -0
- package/src/isFinite.js +37 -0
- package/src/isFloat.js +36 -0
- package/src/isFunction.js +32 -0
- package/src/isGeneratorFunction.js +43 -0
- package/src/isIndexed.js +24 -0
- package/src/isInteger.js +40 -0
- package/src/isInteger32.js +28 -0
- package/src/isIterable.js +37 -0
- package/src/isMap.js +25 -0
- package/src/isNaN.js +45 -0
- package/src/isNaturalNumber.js +28 -0
- package/src/isNegative.js +27 -0
- package/src/isNegativeZero.js +23 -0
- package/src/isNilOrEmpty.js +26 -0
- package/src/isNonEmptyArray.js +29 -0
- package/src/isNonEmptyString.js +32 -0
- package/src/isNonNegative.js +30 -0
- package/src/isNonPositive.js +30 -0
- package/src/isNotArray.js +24 -0
- package/src/isNotArrayLike.js +26 -0
- package/src/isNotAsyncFunction.js +27 -0
- package/src/isNotBoolean.js +24 -0
- package/src/isNotDate.js +23 -0
- package/src/isNotEmpty.js +26 -0
- package/src/isNotFinite.js +31 -0
- package/src/isNotFloat.js +35 -0
- package/src/isNotFunction.js +29 -0
- package/src/isNotGeneratorFunction.js +27 -0
- package/src/isNotInteger.js +36 -0
- package/src/isNotMap.js +27 -0
- package/src/isNotNaN.js +37 -0
- package/src/isNotNil.js +23 -0
- package/src/isNotNilOrEmpty.js +28 -0
- package/src/isNotNull.js +24 -0
- package/src/isNotNumber.js +25 -0
- package/src/isNotObj.js +29 -0
- package/src/isNotObjLike.js +29 -0
- package/src/isNotPair.js +27 -0
- package/src/isNotPlainObj.js +35 -0
- package/src/isNotPrimitive.js +25 -0
- package/src/isNotRegExp.js +24 -0
- package/src/isNotSet.js +26 -0
- package/src/isNotString.js +23 -0
- package/src/isNotUndefined.js +24 -0
- package/src/isNotValidDate.js +24 -0
- package/src/isNotValidNumber.js +27 -0
- package/src/isNull.js +22 -0
- package/src/isNumber.js +24 -0
- package/src/isObj.js +31 -0
- package/src/isObjLike.js +30 -0
- package/src/isOdd.js +29 -0
- package/src/isPair.js +27 -0
- package/src/isPlainObj.js +65 -0
- package/src/isPositive.js +26 -0
- package/src/isPositiveZero.js +23 -0
- package/src/isPrimitive.js +45 -0
- package/src/isPromise.js +32 -0
- package/src/isPrototypeOf.js +36 -0
- package/src/isRegExp.js +22 -0
- package/src/isSafeInteger.js +40 -0
- package/src/isSentinelValue.js +26 -0
- package/src/isSet.js +24 -0
- package/src/isSparseArray.js +43 -0
- package/src/isString.js +21 -0
- package/src/isSymbol.js +29 -0
- package/src/isThenable.js +28 -0
- package/src/isTrue.js +27 -0
- package/src/isTruthy.js +28 -0
- package/src/isUndefined.js +24 -0
- package/src/isValidDate.js +29 -0
- package/src/isValidNumber.js +28 -0
- package/src/lastP.js +54 -0
- package/src/lengthEq.js +24 -0
- package/src/lengthGt.js +24 -0
- package/src/lengthGte.js +26 -0
- package/src/lengthLt.js +24 -0
- package/src/lengthLte.js +25 -0
- package/src/lengthNotEq.js +24 -0
- package/src/lensEq.js +28 -0
- package/src/lensIso.js +51 -0
- package/src/lensNotEq.js +28 -0
- package/src/lensNotSatisfy.js +30 -0
- package/src/lensSatisfies.js +33 -0
- package/src/lensTraverse.js +44 -0
- package/src/liftF.js +37 -0
- package/src/liftFN.js +45 -0
- package/src/list.js +20 -0
- package/src/mapIndexed.js +27 -0
- package/src/mergePath.js +32 -0
- package/src/mergePaths.js +29 -0
- package/src/mergeProp.js +30 -0
- package/src/mergeProps.js +27 -0
- package/src/mergeRight.js +27 -0
- package/src/move.js +26 -0
- package/src/nand.js +27 -0
- package/src/neither.js +38 -0
- package/src/noneP.js +35 -0
- package/src/nonePass.js +32 -0
- package/src/noop.js +21 -0
- package/src/nor.js +28 -0
- package/src/notAllPass.js +32 -0
- package/src/notAllUnique.js +25 -0
- package/src/notBoth.js +38 -0
- package/src/notEqual.js +31 -0
- package/src/omitBy.js +25 -0
- package/src/omitIndexes.js +27 -0
- package/src/overlaps.js +32 -0
- package/src/padCharsEnd.js +37 -0
- package/src/padCharsStart.js +35 -0
- package/src/padEnd.js +25 -0
- package/src/padStart.js +23 -0
- package/src/pathNotEq.js +31 -0
- package/src/pathOrLazy.js +30 -0
- package/src/paths.js +26 -0
- package/src/pickIndexes.js +30 -0
- package/src/propNotEq.js +30 -0
- package/src/rangeStep.js +37 -0
- package/src/reduceIndexed.js +31 -0
- package/src/reduceP.js +96 -0
- package/src/reduceRightP.js +101 -0
- package/src/rejectP.js +24 -0
- package/src/renameKeyWith.js +30 -0
- package/src/renameKeys.js +40 -0
- package/src/renameKeysWith.js +27 -0
- package/src/repeatStr.js +30 -0
- package/src/replaceAll.js +35 -0
- package/src/resolveP.js +28 -0
- package/src/round.js +26 -0
- package/src/seq.js +38 -0
- package/src/sign.js +33 -0
- package/src/skipTake.js +33 -0
- package/src/sliceFrom.js +23 -0
- package/src/sliceTo.js +23 -0
- package/src/sortByProps.js +31 -0
- package/src/spreadPath.js +26 -0
- package/src/spreadProp.js +25 -0
- package/src/stubArray.js +18 -0
- package/src/stubNull.js +19 -0
- package/src/stubObj.js +19 -0
- package/src/stubString.js +19 -0
- package/src/stubUndefined.js +19 -0
- package/src/subtractNum.js +20 -0
- package/src/thenCatchP.js +27 -0
- package/src/thenP.js +29 -0
- package/src/toArray.js +32 -0
- package/src/toInteger32.js +22 -0
- package/src/toUinteger32.js +26 -0
- package/src/trimCharsEnd.js +25 -0
- package/src/trimCharsStart.js +25 -0
- package/src/trimEnd.js +30 -0
- package/src/trimStart.js +29 -0
- package/src/trunc.js +33 -0
- package/src/unzipObjWith.js +40 -0
- package/src/viewOr.js +32 -0
- package/src/weave.js +35 -0
- package/src/weaveLazy.js +37 -0
- package/src/zipObjWith.js +27 -0
- package/tonicExample.js +4 -0
- package/types/index.d.ts +1553 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { replace } from 'ramda';
|
|
2
|
+
import isRegExp from '../../isRegExp';
|
|
3
|
+
import escapeRegExp from '../../escapeRegExp';
|
|
4
|
+
|
|
5
|
+
var checkArguments = function checkArguments(searchValue, replaceValue, str) {
|
|
6
|
+
if (str == null || searchValue == null || replaceValue == null) {
|
|
7
|
+
throw TypeError('Input values must not be `null` or `undefined`');
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
var checkValue = function checkValue(value, valueName) {
|
|
12
|
+
if (typeof value !== 'string') {
|
|
13
|
+
if (!(value instanceof String)) {
|
|
14
|
+
throw TypeError("`".concat(valueName, "` must be a string"));
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
var checkSearchValue = function checkSearchValue(searchValue) {
|
|
20
|
+
if (typeof searchValue !== 'string' && !(searchValue instanceof String) && !(searchValue instanceof RegExp)) {
|
|
21
|
+
throw TypeError('`searchValue` must be a string or an regexp');
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
var replaceAll = function replaceAll(searchValue, replaceValue, str) {
|
|
26
|
+
checkArguments(searchValue, replaceValue, str);
|
|
27
|
+
checkValue(str, 'str');
|
|
28
|
+
checkValue(replaceValue, 'replaceValue');
|
|
29
|
+
checkSearchValue(searchValue);
|
|
30
|
+
var regexp = new RegExp(isRegExp(searchValue) ? searchValue : escapeRegExp(searchValue), 'g');
|
|
31
|
+
return replace(regexp, replaceValue, str);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export default replaceAll;
|
package/es/invoke.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { __ } from 'ramda';
|
|
2
|
+
import invokeArgs from './invokeArgs';
|
|
3
|
+
/**
|
|
4
|
+
* Invokes the method at path of object.
|
|
5
|
+
*
|
|
6
|
+
* @func invoke
|
|
7
|
+
* @memberOf RA
|
|
8
|
+
* @since {@link https://char0n.github.io/ramda-adjunct/2.31.0|v2.31.0}
|
|
9
|
+
* @category Object
|
|
10
|
+
* @sig Array -> Object -> *
|
|
11
|
+
* @param {Array.<string|number>} path The path of the method to invoke
|
|
12
|
+
* @param {Object} obj The object to query
|
|
13
|
+
* @return {*}
|
|
14
|
+
* @example
|
|
15
|
+
*
|
|
16
|
+
* RA.invoke(['random'], Math); //=> 0.5113253820009047
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
var invoke = invokeArgs(__, [], __);
|
|
20
|
+
export default invoke;
|
package/es/invokeArgs.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { curryN, path, apply, init, bind } from 'ramda';
|
|
2
|
+
import isNotFunction from './isNotFunction';
|
|
3
|
+
import isEmptyArray from './isEmptyArray';
|
|
4
|
+
/**
|
|
5
|
+
* Invokes the method at path of object with given arguments.
|
|
6
|
+
*
|
|
7
|
+
* @func invokeArgs
|
|
8
|
+
* @memberOf RA
|
|
9
|
+
* @since {@link https://char0n.github.io/ramda-adjunct/2.27.0|v2.27.0}
|
|
10
|
+
* @category Object
|
|
11
|
+
* @sig Array -> Array -> Object -> *
|
|
12
|
+
* @param {Array.<string|number>} path The path of the method to invoke
|
|
13
|
+
* @param {Array} args The arguments to invoke the method with
|
|
14
|
+
* @param {Object} obj The object to query
|
|
15
|
+
* @return {*}
|
|
16
|
+
* @example
|
|
17
|
+
*
|
|
18
|
+
* RA.invokeArgs(['abs'], [-1], Math); //=> 1
|
|
19
|
+
* RA.invokeArgs(['path', 'to', 'non-existent', 'method'], [-1], Math); //=> undefined
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
var invokeArgs = curryN(3, function (mpath, args, obj) {
|
|
23
|
+
var method = path(mpath, obj);
|
|
24
|
+
var context = path(init(mpath), obj);
|
|
25
|
+
if (isNotFunction(method)) return undefined;
|
|
26
|
+
if (isEmptyArray(mpath)) return undefined;
|
|
27
|
+
var boundMethod = bind(method, context);
|
|
28
|
+
return apply(boundMethod, args);
|
|
29
|
+
});
|
|
30
|
+
export default invokeArgs;
|
package/es/isArray.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { curryN, pipe, type, identical } from 'ramda';
|
|
2
|
+
import isFunction from './isFunction';
|
|
3
|
+
/**
|
|
4
|
+
* Checks if input value is `Array`.
|
|
5
|
+
*
|
|
6
|
+
* @func isArray
|
|
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.isNotArray|isNotArray}
|
|
14
|
+
* @example
|
|
15
|
+
*
|
|
16
|
+
* RA.isArray([]); //=> true
|
|
17
|
+
* RA.isArray(null); //=> false
|
|
18
|
+
* RA.isArray({}); //=> false
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
var isArray = curryN(1, isFunction(Array.isArray) ? Array.isArray : pipe(type, identical('Array')));
|
|
22
|
+
export default isArray;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
2
|
+
|
|
3
|
+
import { has, curryN } from 'ramda';
|
|
4
|
+
import isArray from './isArray';
|
|
5
|
+
import isString from './isString';
|
|
6
|
+
/* eslint-disable max-len */
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Tests whether or not an object is similar to an array.
|
|
10
|
+
*
|
|
11
|
+
* @func isArrayLike
|
|
12
|
+
* @memberOf RA
|
|
13
|
+
* @since {@link https://char0n.github.io/ramda-adjunct/1.9.0|v1.9.0}
|
|
14
|
+
* @licence https://github.com/ramda/ramda/blob/master/LICENSE.txt
|
|
15
|
+
* @category List
|
|
16
|
+
* @category Type
|
|
17
|
+
* @sig * -> Boolean
|
|
18
|
+
* @param {*} val The value to test
|
|
19
|
+
* @returns {boolean} `true` if `val` has a numeric length property and extreme indices defined; `false` otherwise.
|
|
20
|
+
* @see {@link RA.isNotArrayLike|isNotArrayLike}
|
|
21
|
+
|
|
22
|
+
* @example
|
|
23
|
+
*
|
|
24
|
+
* RA.isArrayLike([]); //=> true
|
|
25
|
+
* RA.isArrayLike(true); //=> false
|
|
26
|
+
* RA.isArrayLike({}); //=> false
|
|
27
|
+
* RA.isArrayLike({length: 10}); //=> false
|
|
28
|
+
* RA.isArrayLike({0: 'zero', 9: 'nine', length: 10}); //=> true
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
/* eslint-enable max-len */
|
|
32
|
+
|
|
33
|
+
var isArrayLike = curryN(1, function (val) {
|
|
34
|
+
if (isArray(val)) {
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (!val) {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (isString(val)) {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (_typeof(val) !== 'object') {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (val.nodeType === 1) {
|
|
51
|
+
return !!val.length;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (val.length === 0) {
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (val.length > 0) {
|
|
59
|
+
return has(0, val) && has(val.length - 1, val);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return false;
|
|
63
|
+
});
|
|
64
|
+
export default isArrayLike;
|
|
65
|
+
/**
|
|
66
|
+
The MIT License (MIT)
|
|
67
|
+
|
|
68
|
+
Copyright (c) 2013-2016 Scott Sauyet and Michael Hurley
|
|
69
|
+
|
|
70
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
71
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
72
|
+
in the Software without restriction, including without limitation the rights
|
|
73
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
74
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
75
|
+
furnished to do so, subject to the following conditions:
|
|
76
|
+
|
|
77
|
+
The above copyright notice and this permission notice shall be included in
|
|
78
|
+
all copies or substantial portions of the Software.
|
|
79
|
+
|
|
80
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
81
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
82
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
83
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
84
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
85
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
86
|
+
THE SOFTWARE.
|
|
87
|
+
*/
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { pipe, type, identical, curryN } from 'ramda';
|
|
2
|
+
/**
|
|
3
|
+
* Checks if input value is `Async Function`.
|
|
4
|
+
*
|
|
5
|
+
* @func isAsyncFunction
|
|
6
|
+
* @memberOf RA
|
|
7
|
+
* @since {@link https://char0n.github.io/ramda-adjunct/0.5.0|v0.5.0}
|
|
8
|
+
* @category Type
|
|
9
|
+
* @sig * -> Boolean
|
|
10
|
+
* @param {*} val The value to test
|
|
11
|
+
* @return {boolean}
|
|
12
|
+
* @see {@link RA.isFunction|isFunction}, {@link RA.isNotAsyncFunction|isNotAsyncFunction}, {@link RA.isGeneratorFunction|isGeneratorFunction}
|
|
13
|
+
* @example
|
|
14
|
+
*
|
|
15
|
+
* RA.isAsyncFunction(async function test() { }); //=> true
|
|
16
|
+
* RA.isAsyncFunction(null); //=> false
|
|
17
|
+
* RA.isAsyncFunction(function test() { }); //=> false
|
|
18
|
+
* RA.isAsyncFunction(() => {}); //=> false
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
var isAsyncFunction = curryN(1, pipe(type, identical('AsyncFunction')));
|
|
22
|
+
export default isAsyncFunction;
|
package/es/isBigInt.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type, pipe, identical, curryN } from 'ramda';
|
|
2
|
+
/**
|
|
3
|
+
* Checks if value is a BigInt.
|
|
4
|
+
*
|
|
5
|
+
* @func isBigInt
|
|
6
|
+
* @memberOf RA
|
|
7
|
+
* @category Type
|
|
8
|
+
* @since {@link https://char0n.github.io/ramda-adjunct/2.27.0|v2.27.0}
|
|
9
|
+
* @sig * -> Boolean
|
|
10
|
+
* @param {*} val The value to test
|
|
11
|
+
* @return {boolean}
|
|
12
|
+
* @example
|
|
13
|
+
*
|
|
14
|
+
* RA.isBigInt(5); // => false
|
|
15
|
+
* RA.isBigInt(Number.MAX_VALUE); // => false
|
|
16
|
+
* RA.isBigInt(-Infinity); // => false
|
|
17
|
+
* RA.isBigInt(10); // => false
|
|
18
|
+
* RA.isBigInt(10n); // => true
|
|
19
|
+
* RA.isBigInt(BitInt(9007199254740991)); // => true
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
var isBigInt = curryN(1, pipe(type, identical('BigInt')));
|
|
23
|
+
export default isBigInt;
|
package/es/isBoolean.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type, identical, pipe, curryN } from 'ramda';
|
|
2
|
+
/**
|
|
3
|
+
* Checks if input value is `Boolean`.
|
|
4
|
+
*
|
|
5
|
+
* @func isBoolean
|
|
6
|
+
* @memberOf RA
|
|
7
|
+
* @since {@link https://char0n.github.io/ramda-adjunct/0.3.0|v0.3.0}
|
|
8
|
+
* @category Type
|
|
9
|
+
* @sig * -> Boolean
|
|
10
|
+
* @param {*} val The value to test
|
|
11
|
+
* @return {boolean}
|
|
12
|
+
* @see {@link RA.isNotBoolean|isNotBoolean}
|
|
13
|
+
* @example
|
|
14
|
+
*
|
|
15
|
+
* RA.isBoolean(false); //=> true
|
|
16
|
+
* RA.isBoolean(true); //=> true
|
|
17
|
+
* RA.isBoolean(null); //=> false
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
var isBoolean = curryN(1, pipe(type, identical('Boolean')));
|
|
21
|
+
export default isBoolean;
|
package/es/isDate.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type, identical, pipe, curryN } from 'ramda';
|
|
2
|
+
/**
|
|
3
|
+
* Checks if value is `Date` object.
|
|
4
|
+
*
|
|
5
|
+
* @func isDate
|
|
6
|
+
* @memberOf RA
|
|
7
|
+
* @since {@link https://char0n.github.io/ramda-adjunct/0.6.0|v0.6.0}
|
|
8
|
+
* @category Type
|
|
9
|
+
* @sig * -> Boolean
|
|
10
|
+
* @param {*} val The value to test
|
|
11
|
+
* @return {boolean}
|
|
12
|
+
* @see {@link RA.isNotDate|isNotDate}, {@link RA.isValidDate|isValidDate}, {@link RA.isNotValidDate|isNotValidDate}
|
|
13
|
+
* @example
|
|
14
|
+
*
|
|
15
|
+
* RA.isDate(new Date()); //=> true
|
|
16
|
+
* RA.isDate('1997-07-16T19:20+01:00'); //=> false
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
var isDate = curryN(1, pipe(type, identical('Date')));
|
|
20
|
+
export default isDate;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { both, isEmpty } from 'ramda';
|
|
2
|
+
import isArray from './isArray';
|
|
3
|
+
/**
|
|
4
|
+
* Checks if input value is an empty `Array`.
|
|
5
|
+
*
|
|
6
|
+
* @func isEmptyArray
|
|
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.isNotEmptyArray|isNotEmptyArray}
|
|
14
|
+
* @example
|
|
15
|
+
*
|
|
16
|
+
* RA.isEmptyArray([]); // => true
|
|
17
|
+
* RA.isEmptyArray([42]); // => false
|
|
18
|
+
* RA.isEmptyArray({}); // => false
|
|
19
|
+
* RA.isEmptyArray(null); // => false
|
|
20
|
+
* RA.isEmptyArray(undefined); // => false
|
|
21
|
+
* RA.isEmptyArray(42); // => false
|
|
22
|
+
* RA.isEmptyArray('42'); // => false
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
var isEmptyArray = both(isArray, isEmpty);
|
|
26
|
+
export default isEmptyArray;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { equals } from 'ramda';
|
|
2
|
+
/**
|
|
3
|
+
* Checks if input value is an empty `String`.
|
|
4
|
+
*
|
|
5
|
+
* @func isEmptyString
|
|
6
|
+
* @memberOf RA
|
|
7
|
+
* @since {@link https://char0n.github.io/ramda-adjunct/2.4.0|v2.4.0}
|
|
8
|
+
* @category Type
|
|
9
|
+
* @sig * -> Boolean
|
|
10
|
+
* @param {*} val The value to test
|
|
11
|
+
* @return {boolean}
|
|
12
|
+
* @see {@link RA.isNotEmptyString|isNotEmptyString}
|
|
13
|
+
* @example
|
|
14
|
+
*
|
|
15
|
+
* RA.isEmptyString(''); // => true
|
|
16
|
+
* RA.isEmptyString('42'); // => false
|
|
17
|
+
* RA.isEmptyString(new String('42')); // => false
|
|
18
|
+
* RA.isEmptyString(new String('')); // => false
|
|
19
|
+
* RA.isEmptyString([42]); // => false
|
|
20
|
+
* RA.isEmptyString({}); // => false
|
|
21
|
+
* RA.isEmptyString(null); // => false
|
|
22
|
+
* RA.isEmptyString(undefined); // => false
|
|
23
|
+
* RA.isEmptyString(42); // => false
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
var isEmptyString = equals('');
|
|
27
|
+
export default isEmptyString;
|
package/es/isError.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type, identical, pipe, curryN } from 'ramda';
|
|
2
|
+
/**
|
|
3
|
+
* Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, `SyntaxError`, `TypeError` or `URIError` object.
|
|
4
|
+
*
|
|
5
|
+
* @func isError
|
|
6
|
+
* @category Type
|
|
7
|
+
* @memberOf RA
|
|
8
|
+
* @since {@link https://char0n.github.io/ramda-adjunct/2.30.0|v2.30.0}
|
|
9
|
+
* @sig * -> Boolean
|
|
10
|
+
* @param {*} val The value to test
|
|
11
|
+
* @return {boolean} Returns `true` if value is an error object, `false` otherwise
|
|
12
|
+
* @example
|
|
13
|
+
*
|
|
14
|
+
* RA.isError(new Error()); //=> true
|
|
15
|
+
* RA.isError(Error); //=> false
|
|
16
|
+
* RA.isError(1); // => false
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
var isError = curryN(1, pipe(type, identical('Error')));
|
|
20
|
+
export default isError;
|
package/es/isEven.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { both, complement, curryN } from 'ramda';
|
|
2
|
+
import isInteger from './isInteger';
|
|
3
|
+
import isOdd from './isOdd';
|
|
4
|
+
/**
|
|
5
|
+
* Checks if value is even integer number.
|
|
6
|
+
* An even number is an integer which is "evenly divisible" by two.
|
|
7
|
+
* Zero is an even number because zero divided by two equals zero,
|
|
8
|
+
* which despite not being a natural number, is an integer.
|
|
9
|
+
* Even numbers are either positive or negative.
|
|
10
|
+
*
|
|
11
|
+
* @func isEven
|
|
12
|
+
* @memberOf RA
|
|
13
|
+
* @since {@link https://char0n.github.io/ramda-adjunct/1.18.0|v1.18.0}
|
|
14
|
+
* @category Type
|
|
15
|
+
* @sig * -> Boolean
|
|
16
|
+
* @param {*} val The value to test
|
|
17
|
+
* @return {boolean}
|
|
18
|
+
* @see {@link RA.isOdd|isOdd}
|
|
19
|
+
* @example
|
|
20
|
+
*
|
|
21
|
+
* RA.isEven(0); // => true
|
|
22
|
+
* RA.isEven(1); // => false
|
|
23
|
+
* RA.isEven(-Infinity); // => false
|
|
24
|
+
* RA.isEven(4); // => true
|
|
25
|
+
* RA.isEven(3); // => false
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
var isEven = curryN(1, both(isInteger, complement(isOdd)));
|
|
29
|
+
export default isEven;
|
package/es/isFalse.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { identical } from 'ramda';
|
|
2
|
+
/**
|
|
3
|
+
* Checks if input value is the Boolean primitive `false`. Will return false for all values created
|
|
4
|
+
* using the `Boolean` function as a constructor.
|
|
5
|
+
*
|
|
6
|
+
* @func isFalse
|
|
7
|
+
* @memberOf RA
|
|
8
|
+
* @since {@link https://char0n.github.io/ramda-adjunct/2.6.0|v2.6.0}
|
|
9
|
+
* @category Type
|
|
10
|
+
* @sig * -> Boolean
|
|
11
|
+
* @param {*} val The value to test
|
|
12
|
+
* @return {boolean}
|
|
13
|
+
* @see {@link RA.isTrue|isTrue}, {@link RA.isTruthy|isTruthy}, {@link RA.isFalsy|isFalsy}
|
|
14
|
+
* @example
|
|
15
|
+
*
|
|
16
|
+
* RA.isFalse(false); // => true
|
|
17
|
+
* RA.isFalse(Boolean(false)); // => true
|
|
18
|
+
* RA.isFalse(true); // => false
|
|
19
|
+
* RA.isFalse(0); // => false
|
|
20
|
+
* RA.isFalse(''); // => false
|
|
21
|
+
* RA.isFalse(null); // => false
|
|
22
|
+
* RA.isFalse(undefined); // => false
|
|
23
|
+
* RA.isFalse(NaN); // => false
|
|
24
|
+
* RA.isFalse([]); // => false
|
|
25
|
+
* RA.isFalse(new Boolean(false)); // => false
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
var isFalse = identical(false);
|
|
29
|
+
export default isFalse;
|
package/es/isFalsy.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { complement } from 'ramda';
|
|
2
|
+
import isTruthy from './isTruthy';
|
|
3
|
+
/**
|
|
4
|
+
* A falsy value is a value that translates to false when evaluated in a Boolean context.
|
|
5
|
+
* Falsy values are `false`, `0`, `""`, `null`, `undefined`, and `NaN`.
|
|
6
|
+
*
|
|
7
|
+
* @func isFalsy
|
|
8
|
+
* @memberOf RA
|
|
9
|
+
* @since {@link https://char0n.github.io/ramda-adjunct/2.2.0|v2.2..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/Glossary/Falsy|falsy}, {@link RA.isTruthy|isTruthy}
|
|
15
|
+
* @example
|
|
16
|
+
*
|
|
17
|
+
* RA.isFalsy(false); // => true
|
|
18
|
+
* RA.isFalsy(0); // => true
|
|
19
|
+
* RA.isFalsy(''); // => true
|
|
20
|
+
* RA.isFalsy(null); // => true
|
|
21
|
+
* RA.isFalsy(undefined); // => true
|
|
22
|
+
* RA.isFalsy(NaN); // => true
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
var isFalsy = complement(isTruthy);
|
|
26
|
+
export default isFalsy;
|
package/es/isFinite.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { bind, curryN } from 'ramda';
|
|
2
|
+
import isFunction from './isFunction';
|
|
3
|
+
import ponyfill from './internal/ponyfills/Number.isFinite';
|
|
4
|
+
export var isFinitePonyfill = curryN(1, ponyfill);
|
|
5
|
+
/**
|
|
6
|
+
* Checks whether the passed value is a finite `Number`.
|
|
7
|
+
*
|
|
8
|
+
* @func isFinite
|
|
9
|
+
* @memberOf RA
|
|
10
|
+
* @since {@link https://char0n.github.io/ramda-adjunct/0.7.0|v0.7.0}
|
|
11
|
+
* @category Type
|
|
12
|
+
* @sig * -> Boolean
|
|
13
|
+
* @param {*} val The value to test
|
|
14
|
+
* @return {boolean}
|
|
15
|
+
* @see {@link RA.isNotFinite|isNotFinite}
|
|
16
|
+
* @example
|
|
17
|
+
*
|
|
18
|
+
* RA.isFinite(Infinity); //=> false
|
|
19
|
+
* RA.isFinite(NaN); //=> false
|
|
20
|
+
* RA.isFinite(-Infinity); //=> false
|
|
21
|
+
*
|
|
22
|
+
* RA.isFinite(0); // true
|
|
23
|
+
* RA.isFinite(2e64); // true
|
|
24
|
+
*
|
|
25
|
+
* RA.isFinite('0'); // => false
|
|
26
|
+
* // would've been true with global isFinite('0')
|
|
27
|
+
* RA.isFinite(null); // => false
|
|
28
|
+
* // would've been true with global isFinite(null)
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
var _isFinite = isFunction(Number.isFinite) ? curryN(1, bind(Number.isFinite, Number)) : isFinitePonyfill;
|
|
32
|
+
|
|
33
|
+
export default _isFinite;
|
package/es/isFloat.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { complement, both } from 'ramda';
|
|
2
|
+
import isInteger from './isInteger';
|
|
3
|
+
import isFinite from './isFinite';
|
|
4
|
+
/**
|
|
5
|
+
* Checks whether the passed value is a `float`.
|
|
6
|
+
*
|
|
7
|
+
* @func isFloat
|
|
8
|
+
* @memberOf RA
|
|
9
|
+
* @since {@link https://char0n.github.io/ramda-adjunct/1.14.0|v1.14.0}
|
|
10
|
+
* @category Type
|
|
11
|
+
* @sig * -> Boolean
|
|
12
|
+
* @param {*} val The value to test
|
|
13
|
+
* @return {boolean}
|
|
14
|
+
* @see {@link RA.isNotFloat|isNotFloat}
|
|
15
|
+
* @example
|
|
16
|
+
*
|
|
17
|
+
* RA.isFloat(0); //=> false
|
|
18
|
+
* RA.isFloat(1); //=> false
|
|
19
|
+
* RA.isFloat(-100000); //=> false
|
|
20
|
+
*
|
|
21
|
+
* RA.isFloat(0.1); //=> true
|
|
22
|
+
* RA.isFloat(Math.PI); //=> true
|
|
23
|
+
*
|
|
24
|
+
* RA.isFloat(NaN); //=> false
|
|
25
|
+
* RA.isFloat(Infinity); //=> false
|
|
26
|
+
* RA.isFloat(-Infinity); //=> false
|
|
27
|
+
* RA.isFloat('10'); //=> false
|
|
28
|
+
* RA.isFloat(true); //=> false
|
|
29
|
+
* RA.isFloat(false); //=> false
|
|
30
|
+
* RA.isFloat([1]); //=> false
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
var isFloat = both(isFinite, complement(isInteger));
|
|
34
|
+
export default isFloat;
|
package/es/isFunction.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { anyPass, type, pipe, identical } from 'ramda';
|
|
2
|
+
import isGeneratorFunction from './isGeneratorFunction';
|
|
3
|
+
import isAsyncFunction from './isAsyncFunction';
|
|
4
|
+
/**
|
|
5
|
+
* Checks if input value is `Function`.
|
|
6
|
+
*
|
|
7
|
+
* @func isFunction
|
|
8
|
+
* @memberOf RA
|
|
9
|
+
* @since {@link https://char0n.github.io/ramda-adjunct/0.5.0|v0.5.0}
|
|
10
|
+
* @category Type
|
|
11
|
+
* @sig * -> Boolean
|
|
12
|
+
* @param {*} val The value to test
|
|
13
|
+
* @return {boolean}
|
|
14
|
+
* @see {@link RA.isNotFunction|isNotFunction}, {@link RA.isAsyncFunction|isNotAsyncFunction}, {@link RA.isGeneratorFunction|isGeneratorFunction}
|
|
15
|
+
* @example
|
|
16
|
+
*
|
|
17
|
+
* RA.isFunction(function test() { }); //=> true
|
|
18
|
+
* RA.isFunction(function* test() { }); //=> true
|
|
19
|
+
* RA.isFunction(async function test() { }); //=> true
|
|
20
|
+
* RA.isFunction(() => {}); //=> true
|
|
21
|
+
* RA.isFunction(null); //=> false
|
|
22
|
+
* RA.isFunction('abc'); //=> false
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
var isFunction = anyPass([pipe(type, identical('Function')), isGeneratorFunction, isAsyncFunction]);
|
|
26
|
+
export default isFunction;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type, is, F as stubFalse, either, identical, pipe, curryN } from 'ramda';
|
|
2
|
+
var GeneratorFunction = null;
|
|
3
|
+
var legacyCheck = null;
|
|
4
|
+
|
|
5
|
+
try {
|
|
6
|
+
GeneratorFunction = new Function('return function* () {}')().constructor; // eslint-disable-line no-new-func
|
|
7
|
+
|
|
8
|
+
legacyCheck = is(GeneratorFunction);
|
|
9
|
+
} catch (e) {
|
|
10
|
+
legacyCheck = stubFalse;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Checks if input value is `Generator Function`.
|
|
14
|
+
*
|
|
15
|
+
* @func isGeneratorFunction
|
|
16
|
+
* @memberOf RA
|
|
17
|
+
* @since {@link https://char0n.github.io/ramda-adjunct/0.5.0|v0.5.0}
|
|
18
|
+
* @category Type
|
|
19
|
+
* @sig * -> Boolean
|
|
20
|
+
* @param {*} val The value to test
|
|
21
|
+
* @return {boolean}
|
|
22
|
+
* @see {@link RA.isFunction|isFunction}, {@link RA.isAsyncFunction|isAsyncFunction}, {@link RA.isNotGeneratorFunction|isNotGeneratorFunction}
|
|
23
|
+
* @example
|
|
24
|
+
*
|
|
25
|
+
* RA.isGeneratorFunction(function* test() { }); //=> true
|
|
26
|
+
* RA.isGeneratorFunction(null); //=> false
|
|
27
|
+
* RA.isGeneratorFunction(function test() { }); //=> false
|
|
28
|
+
* RA.isGeneratorFunction(() => {}); //=> false
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
var isGeneratorFunction = curryN(1, either(pipe(type, identical('GeneratorFunction')), legacyCheck));
|
|
33
|
+
export default isGeneratorFunction;
|
package/es/isIndexed.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { either, curryN } from 'ramda';
|
|
2
|
+
import isArray from './isArray';
|
|
3
|
+
import isString from './isString';
|
|
4
|
+
/**
|
|
5
|
+
* Determine if input value is an indexed data type.
|
|
6
|
+
*
|
|
7
|
+
* @func isIndexed
|
|
8
|
+
* @memberOf RA
|
|
9
|
+
* @since {@link https://char0n.github.io/ramda-adjunct/2.26.0|v2.26.0}
|
|
10
|
+
* @category Type
|
|
11
|
+
* @sig * -> Boolean
|
|
12
|
+
* @param {*} val The value to test
|
|
13
|
+
* @return {boolean}
|
|
14
|
+
* @example
|
|
15
|
+
*
|
|
16
|
+
* RA.isIndexed([1]) //=> true
|
|
17
|
+
* RA.isIndexed('test') //=> true
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
var isIndexed = curryN(1, either(isString, isArray));
|
|
21
|
+
export default isIndexed;
|
package/es/isInteger.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { bind, curryN } from 'ramda';
|
|
2
|
+
import isFunction from './isFunction';
|
|
3
|
+
import ponyfill from './internal/ponyfills/Number.isInteger';
|
|
4
|
+
export var isIntegerPonyfill = curryN(1, ponyfill);
|
|
5
|
+
/**
|
|
6
|
+
* Checks whether the passed value is an `integer`.
|
|
7
|
+
*
|
|
8
|
+
* @func isInteger
|
|
9
|
+
* @memberOf RA
|
|
10
|
+
* @since {@link https://char0n.github.io/ramda-adjunct/0.7.0|v0.7.0}
|
|
11
|
+
* @category Type
|
|
12
|
+
* @sig * -> Boolean
|
|
13
|
+
* @param {*} val The value to test
|
|
14
|
+
* @return {boolean}
|
|
15
|
+
* @see {@link RA.isNotInteger|isNotInteger}
|
|
16
|
+
* @example
|
|
17
|
+
*
|
|
18
|
+
* RA.isInteger(0); //=> true
|
|
19
|
+
* RA.isInteger(1); //=> true
|
|
20
|
+
* RA.isInteger(-100000); //=> true
|
|
21
|
+
*
|
|
22
|
+
* RA.isInteger(0.1); //=> false
|
|
23
|
+
* RA.isInteger(Math.PI); //=> false
|
|
24
|
+
*
|
|
25
|
+
* RA.isInteger(NaN); //=> false
|
|
26
|
+
* RA.isInteger(Infinity); //=> false
|
|
27
|
+
* RA.isInteger(-Infinity); //=> false
|
|
28
|
+
* RA.isInteger('10'); //=> false
|
|
29
|
+
* RA.isInteger(true); //=> false
|
|
30
|
+
* RA.isInteger(false); //=> false
|
|
31
|
+
* RA.isInteger([1]); //=> false
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
var isInteger = isFunction(Number.isInteger) ? curryN(1, bind(Number.isInteger, Number)) : isIntegerPonyfill;
|
|
35
|
+
export default isInteger;
|