From 26302cc036cc237621c101ced811bd9a22183fe2 Mon Sep 17 00:00:00 2001 From: char0n Date: Mon, 29 Apr 2024 15:19:45 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20char0n/r?= =?UTF-8?q?amda-adjunct@285091e1a6e275733edd36c9e27c3d593ce51778=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 5.0.0/RA.Identity.html | 1867 + 5.0.0/RA.html | 44204 ++++++++++++++++ 5.0.0/Y.js.html | 105 + 5.0.0/allEqual.js.html | 101 + 5.0.0/allEqualTo.js.html | 98 + 5.0.0/allIdentical.js.html | 99 + 5.0.0/allIdenticalTo.js.html | 98 + 5.0.0/allP.js.html | 100 + 5.0.0/allSettledP.js.html | 107 + 5.0.0/allUnique.js.html | 98 + 5.0.0/anyP.js.html | 106 + 5.0.0/appendFlipped.js.html | 97 + 5.0.0/argsPass.js.html | 113 + 5.0.0/async.js.html | 133 + 5.0.0/cata.js.html | 159 + 5.0.0/catchP.js.html | 98 + 5.0.0/ceil.js.html | 101 + 5.0.0/compact.js.html | 96 + 5.0.0/concatAll.js.html | 108 + 5.0.0/concatRight.js.html | 103 + 5.0.0/copyKeys.js.html | 104 + 5.0.0/curryRight.js.html | 99 + 5.0.0/curryRightN.js.html | 102 + 5.0.0/defaultWhen.js.html | 99 + 5.0.0/delayP.js.html | 118 + 5.0.0/dispatch.js.html | 147 + 5.0.0/divideNum.js.html | 93 + 5.0.0/dropArgs.js.html | 96 + 5.0.0/ensureArray.js.html | 97 + 5.0.0/escapeRegExp.js.html | 95 + 5.0.0/fantasy-land_Identity.js.html | 343 + 5.0.0/filterIndexed.js.html | 101 + 5.0.0/findOr.js.html | 103 + 5.0.0/flattenDepth.js.html | 112 + 5.0.0/flattenPath.js.html | 101 + 5.0.0/flattenProp.js.html | 101 + 5.0.0/floor.js.html | 100 + 5.0.0/fnull.js.html | 111 + 5.0.0/inRange.js.html | 107 + 5.0.0/included.js.html | 101 + 5.0.0/index.html | 274 + 5.0.0/index.js.html | 314 + 5.0.0/internal_makeFlat.js.html | 115 + 5.0.0/invoke.js.html | 95 + 5.0.0/invokeArgs.js.html | 109 + 5.0.0/isArray.js.html | 100 + 5.0.0/isArrayLike.js.html | 152 + 5.0.0/isAsyncFunction.js.html | 96 + 5.0.0/isBigInt.js.html | 97 + 5.0.0/isBlank.js.html | 106 + 5.0.0/isBoolean.js.html | 95 + 5.0.0/isDate.js.html | 94 + 5.0.0/isEmptyArray.js.html | 101 + 5.0.0/isEmptyString.js.html | 101 + 5.0.0/isError.js.html | 94 + 5.0.0/isEven.js.html | 104 + 5.0.0/isFalse.js.html | 104 + 5.0.0/isFalsy.js.html | 101 + 5.0.0/isFinite.js.html | 110 + 5.0.0/isFloat.js.html | 109 + 5.0.0/isFunction.js.html | 105 + 5.0.0/isGeneratorFunction.js.html | 99 + 5.0.0/isIndexed.js.html | 97 + 5.0.0/isInteger.js.html | 113 + 5.0.0/isInteger32.js.html | 101 + 5.0.0/isIterable.js.html | 110 + 5.0.0/isMap.js.html | 98 + 5.0.0/isNaN.js.html | 118 + 5.0.0/isNaturalNumber.js.html | 101 + 5.0.0/isNegative.js.html | 100 + 5.0.0/isNegativeZero.js.html | 96 + 5.0.0/isNilOrEmpty.js.html | 99 + 5.0.0/isNonEmptyArray.js.html | 101 + 5.0.0/isNonEmptyString.js.html | 104 + 5.0.0/isNonNegative.js.html | 103 + 5.0.0/isNonPositive.js.html | 103 + 5.0.0/isNotArray.js.html | 97 + 5.0.0/isNotArrayLike.js.html | 99 + 5.0.0/isNotAsyncFunction.js.html | 100 + 5.0.0/isNotBoolean.js.html | 97 + 5.0.0/isNotDate.js.html | 96 + 5.0.0/isNotFinite.js.html | 104 + 5.0.0/isNotFloat.js.html | 108 + 5.0.0/isNotFunction.js.html | 102 + 5.0.0/isNotGeneratorFunction.js.html | 100 + 5.0.0/isNotInteger.js.html | 109 + 5.0.0/isNotMap.js.html | 100 + 5.0.0/isNotNaN.js.html | 110 + 5.0.0/isNotNil.js.html | 96 + 5.0.0/isNotNilOrEmpty.js.html | 101 + 5.0.0/isNotNull.js.html | 97 + 5.0.0/isNotNumber.js.html | 98 + 5.0.0/isNotObj.js.html | 102 + 5.0.0/isNotObjLike.js.html | 102 + 5.0.0/isNotPair.js.html | 100 + 5.0.0/isNotPlainObj.js.html | 108 + 5.0.0/isNotPrimitive.js.html | 99 + 5.0.0/isNotRegExp.js.html | 97 + 5.0.0/isNotSet.js.html | 99 + 5.0.0/isNotString.js.html | 96 + 5.0.0/isNotUndefined.js.html | 97 + 5.0.0/isNotValidDate.js.html | 97 + 5.0.0/isNotValidNumber.js.html | 100 + 5.0.0/isNull.js.html | 95 + 5.0.0/isNumber.js.html | 97 + 5.0.0/isObj.js.html | 104 + 5.0.0/isObjLike.js.html | 103 + 5.0.0/isOdd.js.html | 102 + 5.0.0/isPair.js.html | 100 + 5.0.0/isPlainObj.js.html | 138 + 5.0.0/isPositive.js.html | 99 + 5.0.0/isPositiveZero.js.html | 96 + 5.0.0/isPrimitive.js.html | 119 + 5.0.0/isPromise.js.html | 105 + 5.0.0/isPrototypeOf.js.html | 109 + 5.0.0/isRegExp.js.html | 95 + 5.0.0/isSafeInteger.js.html | 113 + 5.0.0/isSentinelValue.js.html | 99 + 5.0.0/isSet.js.html | 97 + 5.0.0/isSparseArray.js.html | 116 + 5.0.0/isString.js.html | 94 + 5.0.0/isSymbol.js.html | 102 + 5.0.0/isThenable.js.html | 101 + 5.0.0/isTrue.js.html | 100 + 5.0.0/isTruthy.js.html | 101 + 5.0.0/isUinteger32.js.html | 102 + 5.0.0/isUndefined.js.html | 97 + 5.0.0/isValidDate.js.html | 102 + 5.0.0/isValidNumber.js.html | 101 + 5.0.0/lastP.js.html | 127 + 5.0.0/lengthEq.js.html | 97 + 5.0.0/lengthGt.js.html | 97 + 5.0.0/lengthGte.js.html | 99 + 5.0.0/lengthLt.js.html | 97 + 5.0.0/lengthLte.js.html | 98 + 5.0.0/lengthNotEq.js.html | 97 + 5.0.0/lensEq.js.html | 101 + 5.0.0/lensIso.js.html | 124 + 5.0.0/lensNotEq.js.html | 101 + 5.0.0/lensNotSatisfy.js.html | 103 + 5.0.0/lensSatisfies.js.html | 106 + 5.0.0/lensTraverse.js.html | 129 + 5.0.0/liftF.js.html | 110 + 5.0.0/liftFN.js.html | 118 + 5.0.0/list.js.html | 93 + 5.0.0/mapIndexed.js.html | 100 + 5.0.0/mergePath.js.html | 103 + 5.0.0/mergePaths.js.html | 102 + 5.0.0/mergeProp.js.html | 103 + 5.0.0/mergeProps.js.html | 100 + 5.0.0/move.js.html | 99 + 5.0.0/nand.js.html | 100 + 5.0.0/neither.js.html | 111 + 5.0.0/noneP.js.html | 108 + 5.0.0/nonePass.js.html | 105 + 5.0.0/noop.js.html | 94 + 5.0.0/nor.js.html | 101 + 5.0.0/notAllPass.js.html | 105 + 5.0.0/notAllUnique.js.html | 98 + 5.0.0/notBoth.js.html | 111 + 5.0.0/notEqual.js.html | 104 + 5.0.0/omitBy.js.html | 98 + 5.0.0/omitIndexes.js.html | 100 + 5.0.0/overlaps.js.html | 103 + 5.0.0/padCharsEnd.js.html | 110 + 5.0.0/padCharsStart.js.html | 108 + 5.0.0/padEnd.js.html | 98 + 5.0.0/padStart.js.html | 96 + 5.0.0/pathNotEq.js.html | 104 + 5.0.0/pathOrLazy.js.html | 103 + 5.0.0/paths.js.html | 99 + 5.0.0/pickIndexes.js.html | 103 + 5.0.0/propNotEq.js.html | 103 + 5.0.0/rangeStep.js.html | 110 + 5.0.0/reduceIndexed.js.html | 104 + 5.0.0/reduceP.js.html | 169 + 5.0.0/reduceRightP.js.html | 174 + 5.0.0/rejectP.js.html | 97 + 5.0.0/renameKey.js.html | 106 + 5.0.0/renameKeyWith.js.html | 103 + 5.0.0/renameKeys.js.html | 113 + 5.0.0/renameKeysWith.js.html | 100 + 5.0.0/repeatStr.js.html | 103 + 5.0.0/replaceAll.js.html | 108 + 5.0.0/resolveP.js.html | 101 + 5.0.0/round.js.html | 99 + 5.0.0/scripts/RA.web.min.js | 1 + 5.0.0/scripts/linenumber.js | 25 + 5.0.0/scripts/prettify/Apache-License-2.0.txt | 202 + 5.0.0/scripts/prettify/lang-css.js | 2 + 5.0.0/scripts/prettify/prettify.js | 28 + 5.0.0/scripts/ramda.min.js | 1 + 5.0.0/scripts/search.js | 26 + 5.0.0/seq.js.html | 111 + 5.0.0/sign.js.html | 106 + 5.0.0/skipTake.js.html | 106 + 5.0.0/sliceFrom.js.html | 96 + 5.0.0/sliceTo.js.html | 96 + 5.0.0/sortByPaths.js.html | 128 + 5.0.0/sortByProp.js.html | 118 + 5.0.0/sortByProps.js.html | 104 + 5.0.0/spreadPath.js.html | 99 + 5.0.0/spreadProp.js.html | 98 + 5.0.0/stubArray.js.html | 91 + 5.0.0/stubNull.js.html | 92 + 5.0.0/stubObj.js.html | 92 + 5.0.0/stubString.js.html | 92 + 5.0.0/stubUndefined.js.html | 92 + 5.0.0/styles/jsdoc.css | 792 + 5.0.0/styles/prettify.css | 79 + 5.0.0/subtractNum.js.html | 93 + 5.0.0/thenCatchP.js.html | 100 + 5.0.0/toArray.js.html | 105 + 5.0.0/toInteger32.js.html | 95 + 5.0.0/toNumber.js.html | 97 + 5.0.0/toUinteger32.js.html | 99 + 5.0.0/trimCharsEnd.js.html | 98 + 5.0.0/trimCharsStart.js.html | 98 + 5.0.0/trimEnd.js.html | 103 + 5.0.0/trimStart.js.html | 102 + 5.0.0/trunc.js.html | 106 + 5.0.0/unzipObjWith.js.html | 113 + 5.0.0/viewOr.js.html | 105 + 5.0.0/weave.js.html | 108 + 5.0.0/weaveLazy.js.html | 110 + 5.0.0/zipObjWith.js.html | 100 + 226 files changed, 70200 insertions(+) create mode 100644 5.0.0/RA.Identity.html create mode 100644 5.0.0/RA.html create mode 100644 5.0.0/Y.js.html create mode 100644 5.0.0/allEqual.js.html create mode 100644 5.0.0/allEqualTo.js.html create mode 100644 5.0.0/allIdentical.js.html create mode 100644 5.0.0/allIdenticalTo.js.html create mode 100644 5.0.0/allP.js.html create mode 100644 5.0.0/allSettledP.js.html create mode 100644 5.0.0/allUnique.js.html create mode 100644 5.0.0/anyP.js.html create mode 100644 5.0.0/appendFlipped.js.html create mode 100644 5.0.0/argsPass.js.html create mode 100644 5.0.0/async.js.html create mode 100644 5.0.0/cata.js.html create mode 100644 5.0.0/catchP.js.html create mode 100644 5.0.0/ceil.js.html create mode 100644 5.0.0/compact.js.html create mode 100644 5.0.0/concatAll.js.html create mode 100644 5.0.0/concatRight.js.html create mode 100644 5.0.0/copyKeys.js.html create mode 100644 5.0.0/curryRight.js.html create mode 100644 5.0.0/curryRightN.js.html create mode 100644 5.0.0/defaultWhen.js.html create mode 100644 5.0.0/delayP.js.html create mode 100644 5.0.0/dispatch.js.html create mode 100644 5.0.0/divideNum.js.html create mode 100644 5.0.0/dropArgs.js.html create mode 100644 5.0.0/ensureArray.js.html create mode 100644 5.0.0/escapeRegExp.js.html create mode 100644 5.0.0/fantasy-land_Identity.js.html create mode 100644 5.0.0/filterIndexed.js.html create mode 100644 5.0.0/findOr.js.html create mode 100644 5.0.0/flattenDepth.js.html create mode 100644 5.0.0/flattenPath.js.html create mode 100644 5.0.0/flattenProp.js.html create mode 100644 5.0.0/floor.js.html create mode 100644 5.0.0/fnull.js.html create mode 100644 5.0.0/inRange.js.html create mode 100644 5.0.0/included.js.html create mode 100644 5.0.0/index.html create mode 100644 5.0.0/index.js.html create mode 100644 5.0.0/internal_makeFlat.js.html create mode 100644 5.0.0/invoke.js.html create mode 100644 5.0.0/invokeArgs.js.html create mode 100644 5.0.0/isArray.js.html create mode 100644 5.0.0/isArrayLike.js.html create mode 100644 5.0.0/isAsyncFunction.js.html create mode 100644 5.0.0/isBigInt.js.html create mode 100644 5.0.0/isBlank.js.html create mode 100644 5.0.0/isBoolean.js.html create mode 100644 5.0.0/isDate.js.html create mode 100644 5.0.0/isEmptyArray.js.html create mode 100644 5.0.0/isEmptyString.js.html create mode 100644 5.0.0/isError.js.html create mode 100644 5.0.0/isEven.js.html create mode 100644 5.0.0/isFalse.js.html create mode 100644 5.0.0/isFalsy.js.html create mode 100644 5.0.0/isFinite.js.html create mode 100644 5.0.0/isFloat.js.html create mode 100644 5.0.0/isFunction.js.html create mode 100644 5.0.0/isGeneratorFunction.js.html create mode 100644 5.0.0/isIndexed.js.html create mode 100644 5.0.0/isInteger.js.html create mode 100644 5.0.0/isInteger32.js.html create mode 100644 5.0.0/isIterable.js.html create mode 100644 5.0.0/isMap.js.html create mode 100644 5.0.0/isNaN.js.html create mode 100644 5.0.0/isNaturalNumber.js.html create mode 100644 5.0.0/isNegative.js.html create mode 100644 5.0.0/isNegativeZero.js.html create mode 100644 5.0.0/isNilOrEmpty.js.html create mode 100644 5.0.0/isNonEmptyArray.js.html create mode 100644 5.0.0/isNonEmptyString.js.html create mode 100644 5.0.0/isNonNegative.js.html create mode 100644 5.0.0/isNonPositive.js.html create mode 100644 5.0.0/isNotArray.js.html create mode 100644 5.0.0/isNotArrayLike.js.html create mode 100644 5.0.0/isNotAsyncFunction.js.html create mode 100644 5.0.0/isNotBoolean.js.html create mode 100644 5.0.0/isNotDate.js.html create mode 100644 5.0.0/isNotFinite.js.html create mode 100644 5.0.0/isNotFloat.js.html create mode 100644 5.0.0/isNotFunction.js.html create mode 100644 5.0.0/isNotGeneratorFunction.js.html create mode 100644 5.0.0/isNotInteger.js.html create mode 100644 5.0.0/isNotMap.js.html create mode 100644 5.0.0/isNotNaN.js.html create mode 100644 5.0.0/isNotNil.js.html create mode 100644 5.0.0/isNotNilOrEmpty.js.html create mode 100644 5.0.0/isNotNull.js.html create mode 100644 5.0.0/isNotNumber.js.html create mode 100644 5.0.0/isNotObj.js.html create mode 100644 5.0.0/isNotObjLike.js.html create mode 100644 5.0.0/isNotPair.js.html create mode 100644 5.0.0/isNotPlainObj.js.html create mode 100644 5.0.0/isNotPrimitive.js.html create mode 100644 5.0.0/isNotRegExp.js.html create mode 100644 5.0.0/isNotSet.js.html create mode 100644 5.0.0/isNotString.js.html create mode 100644 5.0.0/isNotUndefined.js.html create mode 100644 5.0.0/isNotValidDate.js.html create mode 100644 5.0.0/isNotValidNumber.js.html create mode 100644 5.0.0/isNull.js.html create mode 100644 5.0.0/isNumber.js.html create mode 100644 5.0.0/isObj.js.html create mode 100644 5.0.0/isObjLike.js.html create mode 100644 5.0.0/isOdd.js.html create mode 100644 5.0.0/isPair.js.html create mode 100644 5.0.0/isPlainObj.js.html create mode 100644 5.0.0/isPositive.js.html create mode 100644 5.0.0/isPositiveZero.js.html create mode 100644 5.0.0/isPrimitive.js.html create mode 100644 5.0.0/isPromise.js.html create mode 100644 5.0.0/isPrototypeOf.js.html create mode 100644 5.0.0/isRegExp.js.html create mode 100644 5.0.0/isSafeInteger.js.html create mode 100644 5.0.0/isSentinelValue.js.html create mode 100644 5.0.0/isSet.js.html create mode 100644 5.0.0/isSparseArray.js.html create mode 100644 5.0.0/isString.js.html create mode 100644 5.0.0/isSymbol.js.html create mode 100644 5.0.0/isThenable.js.html create mode 100644 5.0.0/isTrue.js.html create mode 100644 5.0.0/isTruthy.js.html create mode 100644 5.0.0/isUinteger32.js.html create mode 100644 5.0.0/isUndefined.js.html create mode 100644 5.0.0/isValidDate.js.html create mode 100644 5.0.0/isValidNumber.js.html create mode 100644 5.0.0/lastP.js.html create mode 100644 5.0.0/lengthEq.js.html create mode 100644 5.0.0/lengthGt.js.html create mode 100644 5.0.0/lengthGte.js.html create mode 100644 5.0.0/lengthLt.js.html create mode 100644 5.0.0/lengthLte.js.html create mode 100644 5.0.0/lengthNotEq.js.html create mode 100644 5.0.0/lensEq.js.html create mode 100644 5.0.0/lensIso.js.html create mode 100644 5.0.0/lensNotEq.js.html create mode 100644 5.0.0/lensNotSatisfy.js.html create mode 100644 5.0.0/lensSatisfies.js.html create mode 100644 5.0.0/lensTraverse.js.html create mode 100644 5.0.0/liftF.js.html create mode 100644 5.0.0/liftFN.js.html create mode 100644 5.0.0/list.js.html create mode 100644 5.0.0/mapIndexed.js.html create mode 100644 5.0.0/mergePath.js.html create mode 100644 5.0.0/mergePaths.js.html create mode 100644 5.0.0/mergeProp.js.html create mode 100644 5.0.0/mergeProps.js.html create mode 100644 5.0.0/move.js.html create mode 100644 5.0.0/nand.js.html create mode 100644 5.0.0/neither.js.html create mode 100644 5.0.0/noneP.js.html create mode 100644 5.0.0/nonePass.js.html create mode 100644 5.0.0/noop.js.html create mode 100644 5.0.0/nor.js.html create mode 100644 5.0.0/notAllPass.js.html create mode 100644 5.0.0/notAllUnique.js.html create mode 100644 5.0.0/notBoth.js.html create mode 100644 5.0.0/notEqual.js.html create mode 100644 5.0.0/omitBy.js.html create mode 100644 5.0.0/omitIndexes.js.html create mode 100644 5.0.0/overlaps.js.html create mode 100644 5.0.0/padCharsEnd.js.html create mode 100644 5.0.0/padCharsStart.js.html create mode 100644 5.0.0/padEnd.js.html create mode 100644 5.0.0/padStart.js.html create mode 100644 5.0.0/pathNotEq.js.html create mode 100644 5.0.0/pathOrLazy.js.html create mode 100644 5.0.0/paths.js.html create mode 100644 5.0.0/pickIndexes.js.html create mode 100644 5.0.0/propNotEq.js.html create mode 100644 5.0.0/rangeStep.js.html create mode 100644 5.0.0/reduceIndexed.js.html create mode 100644 5.0.0/reduceP.js.html create mode 100644 5.0.0/reduceRightP.js.html create mode 100644 5.0.0/rejectP.js.html create mode 100644 5.0.0/renameKey.js.html create mode 100644 5.0.0/renameKeyWith.js.html create mode 100644 5.0.0/renameKeys.js.html create mode 100644 5.0.0/renameKeysWith.js.html create mode 100644 5.0.0/repeatStr.js.html create mode 100644 5.0.0/replaceAll.js.html create mode 100644 5.0.0/resolveP.js.html create mode 100644 5.0.0/round.js.html create mode 100644 5.0.0/scripts/RA.web.min.js create mode 100644 5.0.0/scripts/linenumber.js create mode 100644 5.0.0/scripts/prettify/Apache-License-2.0.txt create mode 100644 5.0.0/scripts/prettify/lang-css.js create mode 100644 5.0.0/scripts/prettify/prettify.js create mode 100644 5.0.0/scripts/ramda.min.js create mode 100644 5.0.0/scripts/search.js create mode 100644 5.0.0/seq.js.html create mode 100644 5.0.0/sign.js.html create mode 100644 5.0.0/skipTake.js.html create mode 100644 5.0.0/sliceFrom.js.html create mode 100644 5.0.0/sliceTo.js.html create mode 100644 5.0.0/sortByPaths.js.html create mode 100644 5.0.0/sortByProp.js.html create mode 100644 5.0.0/sortByProps.js.html create mode 100644 5.0.0/spreadPath.js.html create mode 100644 5.0.0/spreadProp.js.html create mode 100644 5.0.0/stubArray.js.html create mode 100644 5.0.0/stubNull.js.html create mode 100644 5.0.0/stubObj.js.html create mode 100644 5.0.0/stubString.js.html create mode 100644 5.0.0/stubUndefined.js.html create mode 100644 5.0.0/styles/jsdoc.css create mode 100644 5.0.0/styles/prettify.css create mode 100644 5.0.0/subtractNum.js.html create mode 100644 5.0.0/thenCatchP.js.html create mode 100644 5.0.0/toArray.js.html create mode 100644 5.0.0/toInteger32.js.html create mode 100644 5.0.0/toNumber.js.html create mode 100644 5.0.0/toUinteger32.js.html create mode 100644 5.0.0/trimCharsEnd.js.html create mode 100644 5.0.0/trimCharsStart.js.html create mode 100644 5.0.0/trimEnd.js.html create mode 100644 5.0.0/trimStart.js.html create mode 100644 5.0.0/trunc.js.html create mode 100644 5.0.0/unzipObjWith.js.html create mode 100644 5.0.0/viewOr.js.html create mode 100644 5.0.0/weave.js.html create mode 100644 5.0.0/weaveLazy.js.html create mode 100644 5.0.0/zipObjWith.js.html diff --git a/5.0.0/RA.Identity.html b/5.0.0/RA.Identity.html new file mode 100644 index 0000000000..10ea37fca6 --- /dev/null +++ b/5.0.0/RA.Identity.html @@ -0,0 +1,1867 @@ + + + + + Identity - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

Identity

+ + + + + + + +
+ +
+ +

+ RA. + + Identity +

+ +

The simplest fantasy-land +compatible monad which attaches no information to values.

+

The Identity type is a very simple type that has no interesting side effects and +is effectively just a container of some value. So why does it exist ? +The Identity type is often used as the base monad of a monad +transformer when no other behaviour is required.

+ + +
+ +
+
+ + + + +

Constructor

+ +
+

new Identity(value) → {RA.Identity}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + +
Implements:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Private constructor. Use Identity.of instead.

+
+ + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +* + + + +
+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +RA.Identity + + +
+
+ + + + + +
+ + + + + + + + + + + + +

Members

+ + + +

(static) @@type

+ + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + +
+

fl.ap(applyWithFn) → {RA.Identity}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • ap :: Apply f => f a ~> f (a -> b) -> f b
  • + +
+
+ + + + + + + + + + + + +
+ + + + + +
+

Fantasy land Apply specification.

+
+ + + + + + + + + +
Example
+ +
const a = Identity.of(1);
+const b = Identity.of(1).map(a => b => a + b);
+
+a.ap(b); //=> Identity(2)
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
applyWithFn + + +RA.Identity + + + +
+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +RA.Identity + + +
+
+ + + + + + + + +
+

fl.chain(fn) → {RA.Identity}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • chain :: Chain m => m a ~> (a -> m b) -> m b
  • + +
+
+ + + + + + + + + + + + +
+ + + + + +
+

Fantasy land Chain specification.

+
+ + + + + + + + + +
Example
+ +
const a = Identity.of(1);
+const fn = val => Identity.of(val + 1);
+
+a.chain(fn).chain(fn); //=> Identity(3)
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fn + + +function + + + +

Function returning the value of the same Chain

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +RA.Identity + + +
+
+ + + + + + + + +
+

fl.concat(semigroup) → {RA.Identity}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • concat :: Semigroup a => a ~> a -> a
  • + +
+
+ + + + + + + + + + + + +
+ + + + + +
+

Fantasy land Semigroup specification.

+
+ + + + + + + + + +
Example
+ +
const a = Identity.of(1);
+const b = Identity.of(1);
+a.concat(b); //=> 2
+
+const c = Identity.of('c');
+const d = Identity.of('d');
+c.concat(d); //=> 'cd'
+
+const e = Identity.of(['e']);
+const f = Identity.of(['f']);
+e.concat(f); //=> ['e', 'f']
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
semigroup + + +RA.Identity + + + +
+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +RA.Identity + + +
+
+ + + + + + + + +
+

fl.contramap(fn) → {RA.Identity}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • contramap :: Contravariant f => f a ~> (b -> a) -> f b
  • + +
+
+ + + + + + + + + + + + +
+ + + + + +
+

Fantasy land Contravariant specification.

+
+ + + + + + + + + +
Example
+ +
const identity = a => a;
+const add1 = a => a + 1;
+const divide2 = a => a / 2;
+
+Identity.of(divide2).contramap(add1).get()(3); //=> 2
+Identity.of(identity).contramap(divide2).contramap(add1).get()(3); //=> 2
+Identity.of(identity).contramap(a => divide2(add1(a))).get()(3); //=> 2
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fn + + +function + + + +
+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +RA.Identity + + +
+
+ + + + + + + + +
+

fl.empty() → {RA.Identity}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • empty :: Monoid m => () -> m
  • + +
+
+ + + + + + + + + + + + +
+ + + + + +
+

Fantasy land Monoid* specification. +Partial implementation of Monoid specification. empty method on instance only, returning +identity value of the wrapped type. Using R.empty under the hood.

+
+ + + + + + + + + +
Example
+ +
const a = Identity.of('test');
+const i = a.empty();
+
+a.concat(i); //=> Identity('string');
+i.concat(a); //=> Identity('string');
+ + + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +RA.Identity + + +
+
+ + + + + + + + +
+

fl.equals(setoid) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • equals :: Setoid a => a ~> a -> Boolean
  • + +
+
+ + + + + + + + + + + + +
+ + + + + +
+

Fantasy land Setoid specification.

+
+ + + + + + + + + +
Example
+ +
const a = Identity.of(1);
+const b = Identity.of(1);
+const c = Identity.of(2);
+
+a.equals(b); //=> true
+a.equals(c); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
setoid + + +RA.Identity + + + +
+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

fl.lte(ord) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • lte :: Ord a => a ~> a -> Boolean
  • + +
+
+ + + + + + + + + + + + +
+ + + + + +
+

Fantasy land Ord specification.

+
+ + + + + + + + + +
Example
+ +
const a = Identity.of(1);
+const b = Identity.of(1);
+const c = Identity.of(2);
+
+a.lte(b); //=> true
+a.lte(c); //=> true
+c.lte(a); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
ord + + +RA.Identity + + + +
+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

fl.map(fn) → {RA.Identity}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • map :: Functor f => f a ~> (a -> b) -> f b
  • + +
+
+ + + + + + + + + + + + +
+ + + + + +
+

Fantasy land Functor specification.

+
+ + + + + + + + + +
Example
+ +
const a = Identity.of(1);
+a.map(a => a + 1); //=> Identity(2)
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fn + + +function + + + +
+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +RA.Identity + + +
+
+ + + + + + + + +
+

get() → {*}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+

Catamorphism for a value.

+
+ + + + + + + + + +
Example
+ +
const a = Identity.of(1);
+a.get(); //=> 1
+ + + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +* + + +
+
+ + + + + + + + + + +
+ +
+ + + + +
+ +
+ + + + + + + \ No newline at end of file diff --git a/5.0.0/RA.html b/5.0.0/RA.html new file mode 100644 index 0000000000..927b163ff2 --- /dev/null +++ b/5.0.0/RA.html @@ -0,0 +1,44204 @@ + + + + + RA - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

RA

+ + + + + + + +
+ +
+ +

+ RA +

+ + +
+ +
+
+ + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + +

Classes

+ +
+
Identity
+
+
+ + + + + + + + + +

Methods

+ + + + + +
+

(static) Y(le) → {function}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • (a, ... -> b -> b) -> (a, ... -> b)
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Function
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Y-combinator

+

The Y combinator is an interesting function which only works with functional languages, +showing how recursion can still be done even without any variable or function declarations, +only functions and parameters

+
+ + + + + + + + + +
Example
+ +
const makeFact = givenFact => (n) => {
+  if (n < 2) { return 1 }
+  return n * givenFact(n - 1);
+};
+
+const factorial = RA.Y(makeFact);
+
+factorial(5); //=> 120
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
le + + +function + + + +

Recursive function maker

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +function + + +
+
+ + + + + + + + +
+

(static) allEqual(list) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • [a] -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • List
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Returns true if all items in the list are equivalent using R.equals for equality comparisons.

+
+ + + + + + + + + +
Example
+ +
RA.allEqual([ 1, 2, 3, 4 ]); //=> false
+RA.allEqual([ 1, 1, 1, 1 ]); //=> true
+RA.allEqual([]); //=> true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
list + + +Array + + + +

The list of values

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) allEqualTo(val, list) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • a -> [b] -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • List
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Returns true if all items in the list are equivalent to user provided value using R.equals for equality comparisons.

+
+ + + + + + + + + +
Example
+ +
RA.allEqualTo(1, [ 1, 2, 3, 4 ]); //=> false
+RA.allEqualTo(1, [ 1, 1, 1, 1 ]); //=> true
+RA.allEqualTo({}, [ {}, {} ]); //=> true
+RA.allEqualTo(1, []); //=> true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

User provided value to check the list against

list + + +Array + + + +

The list of values

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) allIdentical(list) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • [a] -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • List
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Returns true if all items in the list are equivalent using R.identical for equality comparisons.

+
+ + + + + + + + + +
Example
+ +
RA.allIdentical([ 1, 2, 3, 4 ]); //=> false
+RA.allIdentical([ 1, 1, 1, 1 ]); //=> true
+RA.allIdentical([]); //=> true
+RA.allIdentical([ {}, {} ]); //=> false
+RA.allIdentical([ () => {}, () => {} ]); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
list + + +Array + + + +

The list of values

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) allIdenticalTo(val, list) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • a -> [b] -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • List
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Returns true if all items in the list are equivalent to user provided value using R.identical for equality comparisons.

+
+ + + + + + + + + +
Example
+ +
RA.allIdenticalTo(1, [ 1, 2, 3, 4 ]); //=> false
+RA.allIdenticalTo(1, [ 1, 1, 1, 1 ]); //=> true
+RA.allIdenticalTo(1, []); //=> true
+RA.allIdenticalTo({}, [ {}, {} ]); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

User provided value to check the list against

list + + +Array + + + +

The list of values

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) allP(iterable) → {Promise}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • [Promise a] -> Promise [a]
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Function
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Composable shortcut for Promise.all.

+

The allP method returns a single Promise that resolves when all of the promises +in the iterable argument have resolved or when the iterable argument contains no promises. +It rejects with the reason of the first promise that rejects.

+
+ + + + + + + + + +
Example
+ +
RA.allP([1, 2]); //=> Promise([1, 2])
+RA.allP([1, Promise.resolve(2)]); //=> Promise([1, 2])
+RA.allP([Promise.resolve(1), Promise.resolve(2)]); //=> Promise([1, 2])
+RA.allP([1, Promise.reject(2)]); //=> Promise(2)
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
iterable + + +Iterable.<*> + + + +

An iterable object such as an Array or String

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

An already resolved Promise if the iterable passed is empty. An asynchronously resolved Promise if the iterable passed contains no promises. Note, Google Chrome 58 returns an already resolved promise in this case. A pending Promise in all other cases. This returned promise is then resolved/rejected asynchronously (as soon as the stack is empty) when all the promises in the given iterable have resolved, or if any of the promises reject. See the example about "Asynchronicity or synchronicity of allP" below.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + +
+

(static) allSettledP(iterable) → {Promise}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • [Promise a] -> Promise [Settlement a]
  • + +
+
+ + +
+
    + +
  • Settlement = { status: String, value: * }
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Function
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Returns a promise that is fulfilled with an array of promise state snapshots, +but only after all the original promises have settled, i.e. become either fulfilled or rejected. +We say that a promise is settled if it is not pending, i.e. if it is either fulfilled or rejected.

+
+ + + + + + + + + +
Example
+ +
RA.allSettledP([
+  Promise.resolve(1),
+  2,
+  Promise.reject(3),
+]); //=> Promise([{ status: 'fulfilled', value: 1 }, { status: 'fulfilled', value: 2 }, { status: 'rejected', reason: 3 }])
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
iterable + + +Iterable.<*> + + + +

An iterable object such as an Array or String

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

Returns a promise that is fulfilled with an array of promise state snapshots

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + +
+

(static) allUnique(list) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • [a] -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • List
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Returns true if all items in the list are unique. R.equals is used to determine equality.

+
+ + + + + + + + + +
Example
+ +
RA.allUnique([ 1, 2, 3, 4 ]); //=> true
+RA.allUnique([ 1, 1, 2, 3 ]); //=> false
+RA.allUnique([]); //=> true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
list + + +Array + + + +

The list of values

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) anyP(iterable) → {Promise}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • [Promise a] -> Promise a
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Function
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Returns a promise that is fulfilled by the first given promise to be fulfilled, +or rejected with an array of rejection reasons if all of the given promises are rejected.

+
+ + + + + + + + + +
Example
+ +
RA.anyP([
+  Promise.resolve(1),
+  2,
+  Promise.reject(3),
+]); //=> Promise(1)
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
iterable + + +Iterable.<*> + + + +

An iterable object such as an Array or String

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

A promise that is fulfilled by the first given promise to be fulfilled, or rejected with an array of rejection reasons if all of the given promises are rejected

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + +
+

(static) appendFlipped(list, el) → {Array}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • [a] -> a -> [a]
  • + +
+
+ + + + + + + + +
Category:
+
+
  • List
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Returns a new list containing the contents of the given list, followed by the given element. +Like R.append but with argument order reversed.

+
+ + + + + + + + + +
Example
+ +
RA.appendFlipped(['write', 'more'], 'tests'); //=> ['write', 'more', 'tests']
+RA.appendFlipped([], 'tests'); //=> ['tests']
+RA.appendFlipped(['write', 'more'], ['tests']); //=> ['write', 'more', ['tests']]
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
list + + +Array + + + +

The list of elements to add a new item to

el + + +* + + + +

The element to add to the end of the new list

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

A new list containing the elements of the old list followed by el

+
+ + + +
+
+ Type +
+
+ +Array + + +
+
+ + + + + + + + +
+

(static) argsPass(combiningPredicate, functions) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • ((* -> Boolean) -> [*] -> Boolean) -> [(* -> Boolean), ...] -> (*...) -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Logic
+
+ + + + + +
+ + + + + +
+

Takes a combining predicate and a list of functions and returns a function which will map the +arguments it receives to the list of functions and returns the result of passing the values +returned from each function to the combining predicate. A combining predicate is a function that +combines a list of Boolean values into a single Boolean value, such as R.any or R.all. It +will test each value using RA.isTruthy, meaning the functions don't necessarily have to be +predicates.

+

The function returned is curried to the number of functions supplied, and if called with more +arguments than functions, any remaining arguments are passed in to the combining predicate +untouched.

+
+ + + + + + + + + +
Example
+ +
RA.argsPass(R.all, [RA.isArray, RA.isBoolean, RA.isString])([], false, 'abc') //=> true
+RA.argsPass(R.all, [RA.isArray, RA.isBoolean, RA.isString])([], false, 1) //=> false
+RA.argsPass(R.any, [RA.isArray, RA.isBoolean, RA.isString])({}, 1, 'abc') //=> true
+RA.argsPass(R.any, [RA.isArray, RA.isBoolean, RA.isString])({}, 1, false) //=> false
+RA.argsPass(R.none, [RA.isArray, RA.isBoolean, RA.isString])({}, 1, false) //=> true
+RA.argsPass(R.none, [RA.isArray, RA.isBoolean, RA.isString])({}, 1, 'abc') //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
combiningPredicate + + +function + + + +

The predicate used to combine the values returned from the +list of functions

functions + + +Array + + + +

List of functions

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

Returns the combined result of mapping arguments to functions

+
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) async(generatorFn) → {function}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • Promise c => (a, b, ...) -> a -> b -> ... -> c
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Function
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Takes a generator function and returns an async function. +The async function returned is a curried function whose arity matches that of the generator function.

+

Note: This function is handy for environments that does support generators but doesn't support async/await.

+
+ + + + + + + + + +
Example
+ +
const asyncFn = RA.async(function* generator(val1, val2) {
+  const a = yield Promise.resolve(val1);
+  const b = yield Promise.resolve(val2);
+
+  return a + b;
+});
+
+asyncFn(1, 2); //=> Promise(3)
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
generatorFn + + +function + + + +

The generator function

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

Curried async function

+
+ + + +
+
+ Type +
+
+ +function + + +
+
+ + + + + + + + +
+

(static) cata(leftFn, rightFn, catamorphicObj) → {*}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • (a -> b) -> (a -> c) -> Cata a -> b | c
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Function
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

The catamorphism is a way of folding a type into a value.

+

Either

+

If the either is right then the right function will be executed with +the right value and the value of the function returned. Otherwise the left function +will be called with the left value.

+

Maybe

+

If the maybe is Some than the right function will be executed with the some value and the value of the function +returned. Otherwise the left function with be called without an argument.

+

Result

+

If the result is Ok than the right function will be executed with the Ok value and the value of the function +returned. Otherwise the left function will be called with the Error value.

+

Validation

+

If the validation is Success than the right function will be executed with the Success value and the value of the function +returned. Otherwise the left function will be called with the Failure value.

+

Supported monadic libraries: monet.js, folktale, ramda-fantasy

+
+ + + + + + + + + +
Example
+ +
// Either
+const eitherR = Either.Right(1);
+const eitherL = Either.Left(2);
+
+RA.cata(identity, identity, eitherR); //=> 1
+RA.cata(identity, identity, eitherL); //=> 2
+
+// Maybe
+const maybeSome = Maybe.Some(1);
+const maybeNothing = Maybe.Nothing();
+
+RA.cata(identity, identity, maybeSome); //=> 1
+RA.cata(identity, identity, maybeNothing); //=> undefined
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
leftFn + + +function + + + +

The left function that consumes the left value

rightFn + + +function + + + +

The right function that consumes the right value

catamorphicObj + + +Cata + + + +

Either, Maybe or any other type with catamorphic capabilities (cata or either method)

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +* + + +
+
+ + + + + + + + +
+

(static) catchP(onRejected, promise) → {Promise}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • (a -> Promise b | b) -> Promise b
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Function
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Composable shortcut for Promise.catch. +The catchP function returns a Promise. It takes two arguments: a callback function for the failure of the Promise +and the promise instance itself.

+
+ + + + + + + + + +
Example
+ +
RA.catchP(() => 'b', Promise.resolve('a')); //=> Promise('a')
+RA.catchP(() => 'b', Promise.reject('a')); //=> Promise('b')
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
onRejected + + +function + + + +

A Function called if the Promise is rejected. This function has one argument, the rejection reason.

promise + + +Promise + + + +

Any Promise

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

Returns a Promise with dealt rejected cases

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + +
+

(static) ceil(number) → {number}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • Number -> Number
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Math
+
+ + + + + +
+ + + + + +
+

Returns the smallest integer greater than or equal to a given number.

+

Note: ceil(null) returns integer 0 and does not give a NaN error.

+
+ + + + + + + + + +
Example
+ +
RA.ceil(.95); //=> 1
+RA.ceil(4); //=> 4
+RA.ceil(7.004); //=> 8
+RA.ceil(-0.95); //=> -0
+RA.ceil(-4); //=> -4
+RA.ceil(-7.004); //=> -7
+RA.ceil(null); //=> 0
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
number + + +number + + + +

The number to ceil

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

The smallest integer greater than or equal to the given number

+
+ + + +
+
+ Type +
+
+ +number + + +
+
+ + + + + + + + +
+

(static) compact(list) → {Array}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • Filterable f => f a -> f a
  • + +
+
+ + + + + + + + +
Category:
+
+
  • List
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Creates an array with all falsy values removed. +The values false, null, 0, "", undefined, and NaN are falsy.

+
+ + + + + + + + + +
Example
+ +
RA.compact([0, 1, false, 2, '', 3]); //=> [1, 2, 3]
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
list + + +Array + + + +

The array to compact

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

Returns the new array of filtered values

+
+ + + +
+
+ Type +
+
+ +Array + + +
+
+ + + + + + + + +
+

(static) concatAll(list) → {Array|string|undefined}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • [[a]] -> [a] | Undefined
  • + +
  • [String] -> String | Undefined
  • + +
  • Semigroup s => Foldable s f => f -> s | Undefined
  • + +
+
+ + + + + + + + +
Category:
+
+
  • List
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Returns the result of concatenating the given lists or strings. +Note: RA.concatAll expects all elements to be of the same type. It will throw an error if you concat an Array with a non-Array value. +Dispatches to the concat method of the preceding element, if present. Can also concatenate multiple elements of a fantasy-land compatible semigroup. +Returns undefined if empty array was passed.

+
+ + + + + + + + + +
Example
+ +
concatAll([[1], [2], [3]]); //=> [1, 2, 3]
+concatAll(['1', '2', '3']); //=> '123'
+concatAll([]); //=> undefined
+concatAll(null); //=> undefined
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
list + + +Array.<(Array|string)> + + + +

List containing elements that will be concatenated

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

Concatenated elements

+
+ + + +
+
+ Type +
+
+ +Array +| + +string +| + +undefined + + +
+
+ + + + + + + + +
+

(static) concatRight(firstList, secondList) → {Array|String}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • [a] -> [a] -> [a]
  • + +
  • String -> String -> String
  • + +
+
+ + + + + + + + +
Category:
+
+
  • List
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Returns the result of concatenating the given lists or strings.

+

Note: R.concat expects both arguments to be of the same type, unlike +the native Array.prototype.concat method. +It will throw an error if you concat an Array with a non-Array value. +Dispatches to the concat method of the second argument, if present.

+
+ + + + + + + + + +
Example
+ +
RA.concatRight('ABC', 'DEF'); //=> 'DEFABC'
+RA.concatRight([4, 5, 6], [1, 2, 3]); //=> [1, 2, 3, 4, 5, 6]
+RA.concatRight([], []); //=> []
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
firstList + + +Array +| + +String + + + +

The first list

secondList + + +Array +| + +String + + + +

The second list

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

A list consisting of the elements of secondList +followed by the elements of firstList.

+
+ + + +
+
+ Type +
+
+ +Array +| + +String + + +
+
+ + + + + + + + +
+

(static) copyKeys(keysMapnon-null, objnon-null) → (non-null) {Object}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • {a: b} -> {a: *} -> {b: *}
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Object
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Creates a new object with the own properties of the provided object, and the +keys copied according to the keysMap object as {oldKey: newKey}. +When no key from the keysMap is found, then a shallow clone of an object is returned.

+

Keep in mind that in the case of keys conflict is behaviour undefined and +the result may vary between various JS engines!

+
+ + + + + + + + + +
Example
+ +
copyKeys({ a: 'b' }, { a: true }); //=> { a: true, b: true }
+copyKeys({ a: 'b' }, { a: true, b: false }); //=> { a: true, b: true }
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
keysMap + + +Object + + + +
obj + + +Object + + + +
+ + + + + + + + + + + + + + +
Returns:
+ + +
+

New object with copied keys

+
+ + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + +
+

(static) curryRight(fn) → {function}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • (* -> a) -> (* -> a)
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Function
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Returns a curried equivalent of the provided function. +This function is like curry, except that the provided arguments order is reversed.

+
+ + + + + + + + + +
Example
+ +
const concatStrings = (a, b, c) => a + b + c;
+const concatStringsCurried = RA.curryRight(concatStrings);
+
+concatStringCurried('a')('b')('c'); // => 'cba'
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fn + + +function + + + +

The function to curry

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

A new, curried function

+
+ + + +
+
+ Type +
+
+ +function + + +
+
+ + + + + + + + +
+

(static) curryRightN(length, fn) → {function}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • Number -> (* -> a) -> (* -> a)
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Function
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Returns a curried equivalent of the provided function, with the specified arity. +This function is like curryN, except that the provided arguments order is reversed.

+
+ + + + + + + + + +
Example
+ +
const concatStrings = (a, b, c) => a + b + c;
+const concatStringsCurried = RA.curryRightN(3, concatStrings);
+
+concatStringCurried('a')('b')('c'); // => 'cba'
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
length + + +number + + + +

The arity for the returned function

fn + + +function + + + +

The function to curry

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

A new, curried function

+
+ + + +
+
+ Type +
+
+ +function + + +
+
+ + + + + + + + +
+

(static) defaultWhen(predicatenon-null, defaultVal, val) → {*}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • (a -> Boolean) -> b -> a -> a | b
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Logic
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Returns the second argument if predicate function returns true, +otherwise the third argument is returned.

+
+ + + + + + + + + +
Example
+ +
RA.defaultWhen(RA.isNull, 1, null); // => 1
+RA.defaultWhen(RA.isNull, 1, 2); // => 2
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
predicate + + +function + + + +

The predicate function

defaultVal + + +* + + + +

The default value

val + + +* + + + +

val will be returned instead of defaultVal if predicate returns false

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

The val if predicate returns false, otherwise the default value

+
+ + + +
+
+ Type +
+
+ +* + + +
+
+ + + + + + + + +
+

(static) delayP(milliseconds) → {Promise}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • Number -> Promise Undefined
  • + +
  • {timeout: Number, value: a} -> Promise a
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Function
+
+ + + + + +
+ + + + + +
+

Creates a promise which resolves/rejects after the specified milliseconds.

+
+ + + + + + + + + +
Example
+ +
RA.delayP(200); //=> Promise(undefined)
+RA.delayP({ timeout: 1000, value: 'hello world' }); //=> Promise('hello world')
+RA.delayP.reject(100); //=> Promise(undefined)
+RA.delayP.reject({ timeout: 100, value: new Error('error') }); //=> Promise(Error('error'))
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
milliseconds + + +number +| + +Object + + + +

number of milliseconds or options object

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise that is resolved/rejected with the given value (if provided) after the specified delay

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + +
+

(static) dispatch(functionsnon-null) → {*|undefined}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • [((a, b, ...) -> x1), ((a, b, ...) -> x2), ...] -> x1 | x2 | ...
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Function
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Can be used as a way to compose multiple invokers together to form polymorphic functions, +or functions that exhibit different behaviors based on their argument(s). +Consumes dispatching functions and keep trying to invoke each in turn, until a non-nil value is returned.

+

Accepts a list of dispatching functions and returns a new function. +When invoked, this new function is applied to some arguments, +each dispatching function is applied to those same arguments until one of the +dispatching functions returns a non-nil value.

+
+ + + + + + + + + +
Example
+ +
// returns first non-nil value
+const stubNil = () => null;
+const stubUndefined = () => undefined;
+const addOne = v => v + 1;
+const addTwo = v => v + 2;
+
+RA.dispatch([stubNil, stubUndefined, addOne, addTwo])(1); //=> 2
+
+// acts as a switch
+const fnSwitch = RA.dispatch([
+  R.ifElse(RA.isString, s => `${s}-join`, RA.stubUndefined),
+  R.ifElse(RA.isNumber, n => n + 1, RA.stubUndefined),
+  R.ifElse(RA.isDate, R.T, RA.stubUndefined),
+]);
+fnSwitch(1); //=> 2
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
functions + + +Array + + + +

A list of functions

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

Returns the first not-nil value, or undefined if either an empty list is provided or none of the dispatching functions returns a non-nil value

+
+ + + +
+
+ Type +
+
+ +* +| + +undefined + + +
+
+ + + + + + + + +
+

(static) divideNum(divisor, dividend) → {number}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • Number -> Number -> Number
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Math
+
+ + + + + +
+ + + + + +
+

Divides two numbers, where the second number is divided by the first number.

+
+ + + + + + + + + +
Example
+ +
RA.divideNum(2, 1); //=> 0.5
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
divisor + + +number + + + +

the number to divide by

dividend + + +number + + + +

the number to divide

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

A number representing the quotient of dividing the dividend by the divisor

+
+ + + +
+
+ Type +
+
+ +number + + +
+
+ + + + + + + + +
+

(static) dropArgs(fn) → {function}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • (...a -> b)-> () -> b
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Logic
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Accepts a function with any arity and returns a function with arity of zero. +The returned function ignores any arguments supplied to it.

+
+ + + + + + + + + +
Example
+ +
const fn = (a = 1, b = 2) => a + b;
+
+RA.dropArgs(fn)('ignore1', 'ignore2'); //=> 3
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fn + + +function + + + +

The function with any arity

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

Returns function with arity of zero

+
+ + + +
+
+ Type +
+
+ +function + + +
+
+ + + + + + + + +
+

(static) ensureArray(val) → {Array}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • a | [a] -> [a]
  • + +
+
+ + + + + + + + +
Category:
+
+
  • List
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Returns a singleton array containing the value provided. +If value is already an array, it is returned as is.

+
+ + + + + + + + + +
Example
+ +
RA.ensureArray(42); //=> [42]
+RA.ensureArray([42]); //=> [42]
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* +| + +Array + + + +

the value ensure as Array

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Array + + +
+
+ + + + + + + + +
+

(static) escapeRegExp(val) → {string}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • String -> String
  • + +
+
+ + + + + + + + +
Category:
+
+
  • String
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Escapes the RegExp special characters.

+
+ + + + + + + + + +
Example
+ +
RA.escapeRegExp('[ramda-adjunct](https://github.com/char0n/ramda-adjunct)'); //=> '\[ramda\-adjunct\]\(https://github\.com/char0n/ramda\-adjunct\)'
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +string + + + +

the value to escape

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + +
+

(static) filterIndexed(pred, list) → {Array}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • Filterable f => ((a, Idx, f a) -> Boolean) -> f a -> f a
  • + +
+
+ + +
+
    + +
  • Idx = Number
  • + +
+
+ + + + + + + + +
Category:
+
+
  • List
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

R.filter function that more closely resembles Array.prototype.filter. +It takes two new parameters to its callback function: the current index, and the entire list.

+

filterIndexed implementation is simple: const filterIndexed = R.addIndex(R.filter);

+
+ + + + + + + + + +
Example
+ +
const isValueGtIndex = (val, idx) => val > idx;
+RA.filterIndexed(isValueGtIndex, [5, 4, 3, 2, 1, 0]); //=> [5, 4, 3]
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
pred + + +function + + + +

The predicate function

list + + +Array + + + +

The collection to filter

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

Filterable

+
+ + + +
+
+ Type +
+
+ +Array + + +
+
+ + + + + + + + +
+

(static) findOr(defaultValue, fn, list) → {*}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • a -> (b -> Boolean) -> [b] -> b | a
  • + +
+
+ + + + + + + + +
Category:
+
+
  • List
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Returns the first element of the list which matches the predicate. +Returns default value if no element matches or matched element is null, undefined or NaN. +Dispatches to the find method of the second argument, if present. +Acts as a transducer if a transformer is given in list position.

+
+ + + + + + + + + +
Example
+ +
RA.findOr(1, isUndefined, [1, 2, undefined]); // => 1
+RA.findOr(1, val => val === 2, [1, 2, undefined]); // => 2
+RA.findOr(1, val => val === 3, [1, 2, undefined]); // => 1
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
defaultValue + + +* + + + +

The default value

fn + + +function + + + +

The predicate function used to determine if the element is the desired one.

list + + +Array + + + +

The array to consider.

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

The element found, or the default value.

+
+ + + +
+
+ Type +
+
+ +* + + +
+
+ + + + + + + + +
+

(static) flattenDepth(depthnon-null, listnon-null) → (non-null) {Array}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • Number -> [a] -> [b]
  • + +
+
+ + + + + + + + +
Category:
+
+
  • List
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Flattens the list to the specified depth.

+
+ + + + + + + + + +
Example
+ +
RA.flattenDepth(
+  2,
+  [1, [2], [3, [4, 5], 6, [[[7], 8]]], 9, 10]
+); //=> [1, 2, 3, 4, 5, 6, [[7], 8], 9, 10];
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
depth + + +number + + + +

The maximum recursion depth

list + + +Array + + + +

The array to flatten

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

Returns the new flattened array

+
+ + + +
+
+ Type +
+
+ +Array + + +
+
+ + + + + + + + +
+

(static) flattenPath(pathnon-null, objnon-null) → (non-null) {Object}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • [Idx] -> {k: v} -> {k: v}
  • + +
+
+ + +
+
    + +
  • Idx = String | Int
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Object
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Flattens a property path so that its fields are spread out into the provided object. +It's like spreadPath, but preserves object under the property path.

+
+ + + + + + + + + +
Example
+ +
RA.flattenPath(
+  ['b1', 'b2'],
+  { a: 1, b1: { b2: { c: 3, d: 4 } } }
+); // => { a: 1, c: 3, d: 4, b1: { b2: { c: 3, d: 4 } } };
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
path + + +Array.<(string|number)> + + + +

The property path to flatten

obj + + +Object + + + +

The provided object

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

The flattened object

+
+ + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + +
+

(static) flattenProp(prop, objnon-null) → (non-null) {Object}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • [Idx] -> {k: v} -> {k: v}
  • + +
+
+ + +
+
    + +
  • Idx = String | Int
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Object
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Flattens a property so that its fields are spread out into the provided object. +It's like spreadProp, but preserves object under the property path.

+
+ + + + + + + + + +
Example
+ +
RA.flattenProp(
+  'b',
+  { a: 1, b: { c: 3, d: 4 } }
+); // => { a: 1, c: 3, d: 4, b: { c: 3, d: 4 } };
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
prop + + +string +| + +number + + + +

The property to flatten

obj + + +Object + + + +

The provided object

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

The flattened object

+
+ + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + +
+

(static) floor(number) → {number}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • Number -> Number
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Math
+
+ + + + + +
+ + + + + +
+

Returns the largest integer less than or equal to a given number.

+

Note: floor(null) returns integer 0 and do not give a NaN error.

+
+ + + + + + + + + +
Example
+ +
RA.floor(45.95); //=> 45
+RA.floor(45.05); //=> 45
+RA.floor(4); //=> 4
+RA.floor(-45.05); //=> -46
+RA.floor(-45.95); //=> -46
+RA.floor(null); //=> 0
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
number + + +number + + + +

The number to floor

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

A number representing the largest integer less than or equal to the specified number

+
+ + + +
+
+ Type +
+
+ +number + + +
+
+ + + + + + + + +
+

(static) fnull(function, defaults) → {function}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • (a ... -> b) -> [c] -> a ... | c -> b
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Function
+
+ + + + + +
+ + + + + +
+

Returns a function which is called with the given arguments. If any of the given arguments are null or undefined, +the corresponding default value for that argument is used instead.

+
+ + + + + + + + + +
Example
+ +
const addDefaults = RA.fnull((a, b) => a + b, [4, 5])
+
+addDefaults(1, 2); // => 3
+addDefaults(null, 2); // => 6
+addDefaults(2, null); // => 7
+addDefaults(undefined, undefined); // => 9
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
function + + +function + + + +

to be executed

defaults + + +Array + + + +

default arguments

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

will apply provided arguments or default ones

+
+ + + +
+
+ Type +
+
+ +function + + +
+
+ + + + + + + + +
+

(static) inRange(low, high, value) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • Number -> Number -> Number -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Relation
+
+ + + + + +
+ + + + + +
+

Checks if value is between low and up to but not including high.

+
+ + + + + + + + + +
Example
+ +
RA.inRange(0, 5, 3); //=> true
+RA.inRange(0, 5, 0); //=> true
+RA.inRange(0, 5, 4); //=> true
+RA.inRange(0, 5, 5); //=> false
+RA.inRange(0, 5, -1); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
low + + +number + + + +

Start of the range

high + + +number + + + +

The end of the range

value + + +number + + + +

The value to test

+ + + + + + + + + + + + +
Throws:
+ + + +
+
+
+

When low is greater than or equal to high

+
+
+
+
+
+
+ Type +
+
+ +Error + + +
+
+
+
+
+ + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) included(list, a) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • [a] -> a -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • List
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Returns true if the specified value is equal, in R.equals terms, +to at least one element of the given list or false otherwise. +Given list can be a string.

+

Like R.includes but with argument order reversed.

+
+ + + + + + + + + +
Example
+ +
RA.included([1, 2, 3], 3); //=> true
+RA.included([1, 2, 3], 4); //=> false
+RA.included([{ name: 'Fred' }], { name: 'Fred' }); //=> true
+RA.included([[42]], [42]); //=> true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
list + + +Array +| + +String + + + +

The list to consider

a + + +* + + + +

The item to compare against

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

Returns Boolean true if an equivalent item is in the list or false otherwise

+
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) invoke(path, obj) → {*}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • Array -> Object -> *
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Object
+
+ + + + + +
+ + + + + +
+

Invokes the method at path of object.

+
+ + + + + + + + + +
Example
+ +
RA.invoke(['random'], Math); //=> 0.5113253820009047
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
path + + +Array.<(string|number)> + + + +

The path of the method to invoke

obj + + +Object + + + +

The object to query

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +* + + +
+
+ + + + + + + + +
+

(static) invokeArgs(path, args, obj) → {*}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • Array -> Array -> Object -> *
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Object
+
+ + + + + +
+ + + + + +
+

Invokes the method at path of object with given arguments.

+
+ + + + + + + + + +
Example
+ +
RA.invokeArgs(['abs'], [-1], Math); //=> 1
+RA.invokeArgs(['path', 'to', 'non-existent', 'method'], [-1], Math); //=> undefined
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
path + + +Array.<(string|number)> + + + +

The path of the method to invoke

args + + +Array + + + +

The arguments to invoke the method with

obj + + +Object + + + +

The object to query

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +* + + +
+
+ + + + + + + + +
+

(static) isArray(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if input value is Array.

+
+ + + + + + + + + +
Example
+ +
RA.isArray([]); //=> true
+RA.isArray(null); //=> false
+RA.isArray({}); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isArrayLike(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Tests whether or not an object is similar to an array.

+
+ + + + + + + + + +
Example
+ +
RA.isArrayLike([]); //=> true
+RA.isArrayLike(true); //=> false
+RA.isArrayLike({}); //=> false
+RA.isArrayLike({length: 10}); //=> false
+RA.isArrayLike({0: 'zero', 9: 'nine', length: 10}); //=> true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

true if val has a numeric length property and extreme indices defined; false otherwise.

+
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isAsyncFunction(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if input value is Async Function.

+
+ + + + + + + + + +
Example
+ +
RA.isAsyncFunction(async function test() { }); //=> true
+RA.isAsyncFunction(null); //=> false
+RA.isAsyncFunction(function test() { }); //=> false
+RA.isAsyncFunction(() => {}); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isBigInt(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + + + +
+ + + + + +
+

Checks if value is a BigInt.

+
+ + + + + + + + + +
Example
+ +
RA.isBigInt(5); // => false
+RA.isBigInt(Number.MAX_VALUE); // => false
+RA.isBigInt(-Infinity); // => false
+RA.isBigInt(10); // => false
+RA.isBigInt(10n); // => true
+RA.isBigInt(BitInt(9007199254740991)); // => true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isBlank(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Returns true if the given value is its type's empty value, false, undefined +as well as strings containing only whitespace characters; false otherwise.

+
+ + + + + + + + + +
Example
+ +
RA.isBlank(''); //=> true
+RA.isBlank('   '); //=> true
+RA.isBlank('\t\n'); //=> true
+RA.isBlank({}); //=> true
+RA.isBlank(null); //=> true
+RA.isBlank(undefined); //=> true
+RA.isBlank([]); //=> true
+RA.isBlank(false); //=> true
+RA.isBlank('value'); //=> false
+RA.isBlank({ foo: 'foo' }); //=> false
+RA.isBlank([1, 2, 3]); //=> false
+RA.isBlank(true); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isBoolean(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if input value is Boolean.

+
+ + + + + + + + + +
Example
+ +
RA.isBoolean(false); //=> true
+RA.isBoolean(true); //=> true
+RA.isBoolean(null); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isDate(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if value is Date object.

+
+ + + + + + + + + +
Example
+ +
RA.isDate(new Date()); //=> true
+RA.isDate('1997-07-16T19:20+01:00'); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isEmptyArray(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+
    +
  • isNotEmptyArray
  • +
+
+ + + +
+ + + + + +
+

Checks if input value is an empty Array.

+
+ + + + + + + + + +
Example
+ +
RA.isEmptyArray([]); // => true
+RA.isEmptyArray([42]); // => false
+RA.isEmptyArray({}); // => false
+RA.isEmptyArray(null); // => false
+RA.isEmptyArray(undefined); // => false
+RA.isEmptyArray(42); // => false
+RA.isEmptyArray('42'); // => false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isEmptyString(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+
    +
  • isNotEmptyString
  • +
+
+ + + +
+ + + + + +
+

Checks if input value is an empty String.

+
+ + + + + + + + + +
Example
+ +
RA.isEmptyString(''); // => true
+RA.isEmptyString('42'); // => false
+RA.isEmptyString(new String('42')); // => false
+RA.isEmptyString(new String('')); // => false
+RA.isEmptyString([42]); // => false
+RA.isEmptyString({}); // => false
+RA.isEmptyString(null); // => false
+RA.isEmptyString(undefined); // => false
+RA.isEmptyString(42); // => false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isError(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + + + +
+ + + + + +
+

Checks if value is an Error, EvalError, RangeError, ReferenceError, SyntaxError, TypeError or URIError object.

+
+ + + + + + + + + +
Example
+ +
RA.isError(new Error()); //=> true
+RA.isError(Error); //=> false
+RA.isError(1); // => false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

Returns true if value is an error object, false otherwise

+
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isEven(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if value is even integer number. +An even number is an integer which is "evenly divisible" by two. +Zero is an even number because zero divided by two equals zero, +which despite not being a natural number, is an integer. +Even numbers are either positive or negative.

+
+ + + + + + + + + +
Example
+ +
RA.isEven(0); // => true
+RA.isEven(1); // => false
+RA.isEven(-Infinity); // => false
+RA.isEven(4); // => true
+RA.isEven(3); // => false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isFalse(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if input value is the Boolean primitive false. Will return false for all values created +using the Boolean function as a constructor.

+
+ + + + + + + + + +
Example
+ +
RA.isFalse(false); // => true
+RA.isFalse(Boolean(false)); // => true
+RA.isFalse(true); // => false
+RA.isFalse(0); // => false
+RA.isFalse(''); // => false
+RA.isFalse(null); // => false
+RA.isFalse(undefined); // => false
+RA.isFalse(NaN); // => false
+RA.isFalse([]); // => false
+RA.isFalse(new Boolean(false)); // => false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isFalsy(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

A falsy value is a value that translates to false when evaluated in a Boolean context. +Falsy values are false, 0, "", null, undefined, and NaN.

+
+ + + + + + + + + +
Example
+ +
RA.isFalsy(false); // => true
+RA.isFalsy(0); // => true
+RA.isFalsy(''); // => true
+RA.isFalsy(null); // => true
+RA.isFalsy(undefined); // => true
+RA.isFalsy(NaN); // => true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isFinite(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks whether the passed value is a finite Number.

+
+ + + + + + + + + +
Example
+ +
RA.isFinite(Infinity); //=> false
+RA.isFinite(NaN); //=> false
+RA.isFinite(-Infinity); //=> false
+
+RA.isFinite(0); // true
+RA.isFinite(2e64); // true
+
+RA.isFinite('0');  // => false
+                   // would've been true with global isFinite('0')
+RA.isFinite(null); // => false
+                   // would've been true with global isFinite(null)
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isFloat(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks whether the passed value is a float.

+
+ + + + + + + + + +
Example
+ +
RA.isFloat(0); //=> false
+RA.isFloat(1); //=> false
+RA.isFloat(-100000); //=> false
+
+RA.isFloat(0.1);       //=> true
+RA.isFloat(Math.PI);   //=> true
+
+RA.isFloat(NaN);       //=> false
+RA.isFloat(Infinity);  //=> false
+RA.isFloat(-Infinity); //=> false
+RA.isFloat('10');      //=> false
+RA.isFloat(true);      //=> false
+RA.isFloat(false);     //=> false
+RA.isFloat([1]);       //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isFunction(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if input value is Function.

+
+ + + + + + + + + +
Example
+ +
RA.isFunction(function test() { }); //=> true
+RA.isFunction(function* test() { }); //=> true
+RA.isFunction(async function test() { }); //=> true
+RA.isFunction(() => {}); //=> true
+RA.isFunction(null); //=> false
+RA.isFunction('abc'); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isGeneratorFunction(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if input value is Generator Function.

+
+ + + + + + + + + +
Example
+ +
RA.isGeneratorFunction(function* test() { }); //=> true
+RA.isGeneratorFunction(null); //=> false
+RA.isGeneratorFunction(function test() { }); //=> false
+RA.isGeneratorFunction(() => {}); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isIndexed(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + + + +
+ + + + + +
+

Determine if input value is an indexed data type.

+
+ + + + + + + + + +
Example
+ +
RA.isIndexed([1]) //=> true
+RA.isIndexed('test') //=> true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isInteger(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks whether the passed value is an integer.

+
+ + + + + + + + + +
Example
+ +
RA.isInteger(0); //=> true
+RA.isInteger(1); //=> true
+RA.isInteger(-100000); //=> true
+
+RA.isInteger(0.1);       //=> false
+RA.isInteger(Math.PI);   //=> false
+
+RA.isInteger(NaN);       //=> false
+RA.isInteger(Infinity);  //=> false
+RA.isInteger(-Infinity); //=> false
+RA.isInteger('10');      //=> false
+RA.isInteger(true);      //=> false
+RA.isInteger(false);     //=> false
+RA.isInteger([1]);       //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isInteger32(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + +
Aliases:
+
+
  • isInt32
+
+ + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks whether the passed value is a signed 32 bit integer.

+
+ + + + + + + + + +
Example
+ +
RA.isInteger32(0); //=> true
+RA.isInteger32((-2) ** 31); //=> true
+
+RA.isInteger32(Infinity); //=> false
+RA.isInteger32(NaN); //=> false
+RA.isInteger32(2 ** 31); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isIterable(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks whether the passed value is iterable.

+
+ + + + + + + + + +
Example
+ +
RA.isIterable(['arrays', 'are', 'iterable']); //=> true
+RA.isIterable('strings are iterable, too'); //=> true
+RA.isIterable((function* () {})()); //=> true (generator objects are both iterable and iterators)
+
+RA.isIterable({}); //=> false
+RA.isIterable(-0); //=> false
+RA.isIterable(null); //=> false
+RA.isIterable(undefined); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isMap(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Predicate for determining if a provided value is an instance of a Map.

+
+ + + + + + + + + +
Example
+ +
RA.isMap(new Map()); //=> true
+RA.isMap(new Map([[1, 2], [2, 1]])); //=> true
+RA.isSet(new Set()); //=> false
+RA.isSet(new Set([1,2]); //=> false
+RA.isSet(new Object()); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isNaN(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks whether the passed value is NaN and its type is Number. +It is a more robust version of the original, global isNaN().

+
+ + + + + + + + + +
Example
+ +
RA.isNaN(NaN); // => true
+RA.isNaN(Number.NaN); // => true
+RA.isNaN(0 / 0); // => true
+
+// e.g. these would have been true with global isNaN().
+RA.isNaN('NaN'); // => false
+RA.isNaN(undefined); // => false
+RA.isNaN({}); // => false
+RA.isNaN('blabla'); // => false
+
+RA.isNaN(true); // => false
+RA.isNaN(null); // => false
+RA.isNaN(37); // => false
+RA.isNaN('37'); // => false
+RA.isNaN('37.37'); // => false
+RA.isNaN(''); // => false
+RA.isNaN(' '); // => false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isNaturalNumber(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + + + +
+ + + + + +
+

Checks if value is a natural number. +Natural numbers correspond to all non-negative integers and 0.

+
+ + + + + + + + + +
Example
+ +
RA.isNaturalNumber(5); // => true
+RA.isNaturalNumber(Number.MAX_VALUE); // => true
+RA.isNaturalNumber(0); // => true
+RA.isNaturalNumber(-1); // => false
+RA.isNaturalNumber(0.9); // => false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isNegative(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if value is a negative Number primitive or object. Zero is not considered neither +positive or negative.

+
+ + + + + + + + + +
Example
+ +
RA.isNegative(-1); // => true
+RA.isNegative(Number.MIN_VALUE); // => false
+RA.isNegative(+Infinity); // => false
+RA.isNegative(NaN); // => false
+RA.isNegative('5'); // => false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isNegativeZero(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if value is a negative zero (-0).

+
+ + + + + + + + + +
Example
+ +
RA.isNegativeZero(-0); //=> true
+RA.isNegativeZero(+0); //=> false
+RA.isNegativeZero(0); //=> false
+RA.isNegativeZero(null); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isNilOrEmpty(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Returns true if the given value is its type's empty value, null or undefined.

+
+ + + + + + + + + +
Example
+ +
RA.isNilOrEmpty([1, 2, 3]); //=> false
+RA.isNilOrEmpty([]); //=> true
+RA.isNilOrEmpty(''); //=> true
+RA.isNilOrEmpty(null); //=> true
+RA.isNilOrEmpty(undefined): //=> true
+RA.isNilOrEmpty({}); //=> true
+RA.isNilOrEmpty({length: 0}); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isNonEmptyArray(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if input value is not an empty Array.

+
+ + + + + + + + + +
Example
+ +
RA.isNonEmptyArray([42]); // => true
+RA.isNonEmptyArray([]); // => false
+RA.isNonEmptyArray({}); // => false
+RA.isNonEmptyArray(null); // => false
+RA.isNonEmptyArray(undefined); // => false
+RA.isNonEmptyArray(42); // => false
+RA.isNonEmptyArray('42'); // => false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isNonEmptyString(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if input value is not an empty String.

+
+ + + + + + + + + +
Example
+ +
RA.isNonEmptyString('42'); // => true
+RA.isNonEmptyString(''); // => false
+RA.isNonEmptyString(new String('42')); // => false
+RA.isNonEmptyString(new String('')); // => false
+RA.isNonEmptyString([42]); // => false
+RA.isNonEmptyString({}); // => false
+RA.isNonEmptyString(null); // => false
+RA.isNonEmptyString(undefined); // => false
+RA.isNonEmptyString(42); // => false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isNonNegative(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if value is a non-negative Number primitive or object. This includes all positive +numbers and zero.

+
+ + + + + + + + + +
Example
+ +
RA.isNonNegative(0); // => true
+RA.isNonNegative(1); // => true
+RA.isNonNegative(Infinity); // => true
+RA.isNonNegative(Number.MAX_VALUE); // => true
+
+RA.isNonNegative(-Infinity); // => false
+RA.isNonNegative(Number.MIN_VALUE); // => false
+RA.isNonNegative(NaN); // => false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isNonPositive(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if value is a non-positive Number primitive or object. This includes all negative +numbers and zero.

+
+ + + + + + + + + +
Example
+ +
RA.isNonPositive(0); // => true
+RA.isNonPositive(-1); // => true
+RA.isNonPositive(-Infinity); // => true
+RA.isNonPositive(Number.MIN_VALUE); // => true
+
+RA.isNonPositive(Infinity); // => false
+RA.isNonPositive(Number.MAX_VALUE); // => false
+RA.isNonPositive(NaN); // => false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isNotArray(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if input value is complement of Array

+
+ + + + + + + + + +
Example
+ +
RA.isNotArray([]); //=> false
+RA.isNotArray(null); //=> true
+RA.isNotArray({}); //=> true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isNotArrayLike(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Tests whether or not an object is similar to an array.

+
+ + + + + + + + + +
Example
+ +
RA.isNotArrayLike([]); //=> false
+RA.isNotArrayLike(true); //=> true
+RA.isNotArrayLike({}); //=> true
+RA.isNotArrayLike({length: 10}); //=> true
+RA.isNotArrayLike({0: 'zero', 9: 'nine', length: 10}); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isNotAsyncFunction(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if input value is complement of Async Function

+
+ + + + + + + + + +
Example
+ +
RA.isNotAsyncFunction(async function test() { }); //=> false
+RA.isNotAsyncFunction(null); //=> true
+RA.isNotAsyncFunction(function test() { }); //=> true
+RA.isNotAsyncFunction(() => {}); //=> true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isNotBoolean(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if input value is complement of Boolean.

+
+ + + + + + + + + +
Example
+ +
RA.isNotBoolean(false); //=> false
+RA.isNotBoolean(true); //=> false
+RA.isNotBoolean(null); //=> true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isNotDate(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if value is complement of Date object.

+
+ + + + + + + + + +
Example
+ +
RA.isNotDate(new Date()); //=> false
+RA.isNotDate('1997-07-16T19:20+01:00'); //=> true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isNotFinite(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks whether the passed value is complement of finite Number.

+
+ + + + + + + + + +
Example
+ +
RA.isNotFinite(Infinity); //=> true
+RA.isNotFinite(NaN); //=> true
+RA.isNotFinite(-Infinity); //=> true
+
+RA.isNotFinite(0); // false
+RA.isNotFinite(2e64); // false
+
+RA.isNotFinite('0');  // => true
+RA.isNotFinite(null); // => true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isNotFloat(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks whether the passed value is complement of a float.

+
+ + + + + + + + + +
Example
+ +
RA.isNotFloat(0); //=> true
+RA.isNotFloat(1); //=> true
+RA.isNotFloat(-100000); //=> true
+
+RA.isNotFloat(0.1);       //=> false
+RA.isNotFloat(Math.PI);   //=> false
+
+RA.isNotFloat(NaN);       //=> true
+RA.isNotFloat(Infinity);  //=> true
+RA.isNotFloat(-Infinity); //=> true
+RA.isNotFloat('10');      //=> true
+RA.isNotFloat(true);      //=> true
+RA.isNotFloat(false);     //=> true
+RA.isNotFloat([1]);       //=> true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isNotFunction(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if input value is complement of Function.

+
+ + + + + + + + + +
Example
+ +
RA.isNotFunction(function test() { }); //=> false
+RA.isNotFunction(function* test() { }); //=> false
+RA.isNotFunction(async function test() { }); //=> false
+RA.isNotFunction(() => {}); //=> false
+RA.isNotFunction(null); //=> true
+RA.isNotFunction('abc'); //=> true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isNotGeneratorFunction(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if input value is complement of Generator Function

+
+ + + + + + + + + +
Example
+ +
RA.isNotGeneratorFunction(function* test() { }); //=> false
+RA.isNotGeneratorFunction(null); //=> true
+RA.isNotGeneratorFunction(function test() { }); //=> true
+RA.isNotGeneratorFunction(() => {}); //=> true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isNotInteger(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks whether the passed value is complement of an integer.

+
+ + + + + + + + + +
Example
+ +
RA.isNotInteger(0); //=> false
+RA.isNotInteger(1); //=> false
+RA.isNotInteger(-100000); //=> false
+
+RA.isNotInteger(0.1);       //=> true
+RA.isNotInteger(Math.PI);   //=> true
+
+RA.isNotInteger(NaN);       //=> true
+RA.isNotInteger(Infinity);  //=> true
+RA.isNotInteger(-Infinity); //=> true
+RA.isNotInteger('10');      //=> true
+RA.isNotInteger(true);      //=> true
+RA.isNotInteger(false);     //=> true
+RA.isNotInteger([1]);       //=> true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isNotMap(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if value is complement of Map object.

+
+ + + + + + + + + +
Example
+ +
RA.isNotMap(new Map()); //=> false
+RA.isNotMap(new Map([[1, 2], [2, 1]])); //=> false
+RA.isNotMap(new Set()); //=> true
+RA.isNotMap({}); //=> true
+RA.isNotMap(12); //=> true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isNotNaN(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks whether the passed value is complement of NaN and its type is not Number.

+
+ + + + + + + + + +
Example
+ +
RA.isNotNaN(NaN); // => false
+RA.isNotNaN(Number.NaN); // => false
+RA.isNotNaN(0 / 0); // => false
+
+RA.isNotNaN('NaN'); // => true
+RA.isNotNaN(undefined); // => true
+RA.isNotNaN({}); // => true
+RA.isNotNaN('blabla'); // => true
+
+RA.isNotNaN(true); // => true
+RA.isNotNaN(null); // => true
+RA.isNotNaN(37); // => true
+RA.isNotNaN('37'); // => true
+RA.isNotNaN('37.37'); // => true
+RA.isNotNaN(''); // => true
+RA.isNotNaN(' '); // => true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isNotNil(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if input value is complement of null or undefined.

+
+ + + + + + + + + +
Example
+ +
RA.isNotNil(null); //=> false
+RA.isNotNil(undefined); //=> false
+RA.isNotNil(0); //=> true
+RA.isNotNil([]); //=> true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isNotNilOrEmpty(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Returns false if the given value is its type's empty value, null or undefined.

+
+ + + + + + + + + +
Example
+ +
RA.isNotNilOrEmpty([1, 2, 3]); //=> true
+RA.isNotNilOrEmpty([]); //=> false
+RA.isNotNilOrEmpty(''); //=> false
+RA.isNotNilOrEmpty(null); //=> false
+RA.isNotNilOrEmpty(undefined): //=> false
+RA.isNotNilOrEmpty({}); //=> false
+RA.isNotNilOrEmpty({length: 0}); //=> true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isNotNull(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if input value is complement of null.

+
+ + + + + + + + + +
Example
+ +
RA.isNotNull(1); //=> true
+RA.isNotNull(undefined); //=> true
+RA.isNotNull(null); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isNotNumber(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if value is a complement of Number primitive or object.

+
+ + + + + + + + + +
Example
+ +
RA.isNotNumber(5); // => false
+RA.isNotNumber(Number.MAX_VALUE); // => false
+RA.isNotNumber(-Infinity); // => false
+RA.isNotNumber('5'); // => true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isNotObj(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + +
Aliases:
+
+
  • isNotObject
+
+ + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if input value is complement of language type of Object.

+
+ + + + + + + + + +
Example
+ +
RA.isNotObj({}); //=> false
+RA.isNotObj([]); //=> false
+RA.isNotObj(() => {}); //=> false
+RA.isNotObj(null); //=> true
+RA.isNotObj(undefined); //=> true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isNotObjLike(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + +
Aliases:
+
+
  • isNotObjectLike
+
+ + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if value is not object-like. A value is object-like if it's not null and has a typeof result of "object".

+
+ + + + + + + + + +
Example
+ +
RA.isNotObjLike({}); //=> false
+RA.isNotObjLike([]); //=> false
+RA.isNotObjLike(() => {}); //=> true
+RA.isNotObjLike(null); //=> true
+RA.isNotObjLike(undefined); //=> true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isNotPair(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if input value is complement of a pair.

+
+ + + + + + + + + +
Example
+ +
RA.isNotPair([]); // => true
+RA.isNotPair([0]); // => true
+RA.isNotPair([0, 1]); // => false
+RA.isNotPair([0, 1, 2]); // => true
+RA.isNotPair({0: 0, 1: 1}); // => true
+RA.isNotPair({foo: 0, bar: 0}); // => true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isNotPlainObj(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + +
Aliases:
+
+
  • isNotPlainObject
+
+ + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Check to see if an object is a not plain object (created using {}, new Object() or Object.create(null)).

+
+ + + + + + + + + +
Example
+ +
class Bar {
+  constructor() {
+    this.prop = 'value';
+  }
+}
+
+RA.isNotPlainObj(new Bar()); //=> true
+RA.isNotPlainObj({ prop: 'value' }); //=> false
+RA.isNotPlainObj(['a', 'b', 'c']); //=> true
+RA.isNotPlainObj(Object.create(null); //=> false
+RA.isNotPlainObj(new Object()); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isNotPrimitive(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if value is not a primitive data type. There are 6 primitive data types: string, number, bigint, boolean, undefined, symbol and a special case of null.

+
+ + + + + + + + + +
Example
+ +
RA.isNotPrimitive(new String("string")); //=> true
+RA.isNotPrimitive(new Number(1)); //=> true
+RA.isNotPrimitive("string"); //=> false
+RA.isNotPrimitive(1); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isNotRegExp(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if value is complement of RegExp object.

+
+ + + + + + + + + +
Example
+ +
RA.isNotRegExp(1); //=> true
+RA.isNotRegExp(/(?:)/); //=> false
+RA.isNotRegExp(new RegExp()); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isNotSet(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if value is complement of Set object.

+
+ + + + + + + + + +
Example
+ +
RA.isNotSet(new Map()); //=> true
+RA.isNotSet(new Set()); //=> false
+RA.isNotSet(new Set([1,2]); //=> false
+RA.isNotSet(new Object()); //=> true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isNotString(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if input value is complement of String.

+
+ + + + + + + + + +
Example
+ +
RA.isNotString('abc'); //=> false
+RA.isNotString(1); //=> true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isNotUndefined(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if input value is complement undefined.

+
+ + + + + + + + + +
Example
+ +
RA.isNotUndefined(1); //=> true
+RA.isNotUndefined(undefined); //=> false
+RA.isNotUndefined(null); //=> true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isNotValidDate(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + +
Aliases:
+
+
  • isInvalidDate
+
+ + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if value is complement of valid Date object.

+
+ + + + + + + + + +
Example
+ +
RA.isNotValidDate(new Date()); //=> false
+RA.isNotValidDate(new Date('a')); //=> true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isNotValidNumber(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if value is not a valid Number. A valid Number is a number that is not NaN, +Infinity or -Infinity.

+
+ + + + + + + + + +
Example
+ +
RA.isNotValidNumber(1); //=> false
+RA.isNotValidNumber(''); //=> true
+RA.isNotValidNumber(NaN); //=> true
+RA.isNotValidNumber(Infinity); //=> true
+RA.isNotValidNumber(-Infinity); //=> true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isNull(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if input value is null.

+
+ + + + + + + + + +
Example
+ +
RA.isNull(1); //=> false
+RA.isNull(undefined); //=> false
+RA.isNull(null); //=> true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isNumber(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if value is a Number primitive or object.

+
+ + + + + + + + + +
Example
+ +
RA.isNumber(5); // => true
+RA.isNumber(Number.MAX_VALUE); // => true
+RA.isNumber(-Infinity); // => true
+RA.isNumber(NaN); // => true
+RA.isNumber('5'); // => false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isObj(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + +
Aliases:
+
+
  • isObject
+
+ + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if input value is language type of Object.

+
+ + + + + + + + + +
Example
+ +
RA.isObj({}); //=> true
+RA.isObj([]); //=> true
+RA.isObj(() => {}); //=> true
+RA.isObj(null); //=> false
+RA.isObj(undefined); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isObjLike(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + +
Aliases:
+
+
  • isObjectLike
+
+ + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if value is object-like. A value is object-like if it's not null and has a typeof result of "object".

+
+ + + + + + + + + +
Example
+ +
RA.isObjLike({}); //=> true
+RA.isObjLike([]); //=> true
+RA.isObjLike(() => {}); //=> false
+RA.isObjLike(null); //=> false
+RA.isObjLike(undefined); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isOdd(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if value is odd integer number. +An odd number is an integer which is not a multiple DIVISIBLE of two.

+
+ + + + + + + + + +
Example
+ +
RA.isOdd(1); // => true
+RA.isOdd(-Infinity); // => false
+RA.isOdd(4); // => false
+RA.isOdd(3); // => true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isPair(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if input value is a pair.

+
+ + + + + + + + + +
Example
+ +
RA.isPair([]); // => false
+RA.isPair([0]); // => false
+RA.isPair([0, 1]); // => true
+RA.isPair([0, 1, 2]); // => false
+RA.isPair({ 0: 0, 1: 1 }); // => false
+RA.isPair({ foo: 0, bar: 0 }); // => false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isPlainObj(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + +
Aliases:
+
+
  • isPlainObject
+
+ + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Check to see if an object is a plain object (created using {}, new Object() or Object.create(null)).

+
+ + + + + + + + + +
Example
+ +
class Bar {
+  constructor() {
+    this.prop = 'value';
+  }
+}
+
+RA.isPlainObj(new Bar()); //=> false
+RA.isPlainObj({ prop: 'value' }); //=> true
+RA.isPlainObj(['a', 'b', 'c']); //=> false
+RA.isPlainObj(Object.create(null); //=> true
+RA.isPlainObj(new Object()); //=> true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isPositive(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if value is a positive Number primitive or object. Zero is not considered positive.

+
+ + + + + + + + + +
Example
+ +
RA.isPositive(1); // => true
+RA.isPositive(Number.MAX_VALUE); // => true
+RA.isPositive(-Infinity); // => false
+RA.isPositive(NaN); // => false
+RA.isPositive('5'); // => false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isPositiveZero(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if value is a positive zero (+0).

+
+ + + + + + + + + +
Example
+ +
RA.isPositiveZero(+0); //=> true
+RA.isPositiveZero(0); //=> true
+RA.isPositiveZero(-0); //=> false
+RA.isPositiveZero(null); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isPrimitive(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if value is a primitive data type. There are 6 primitive data types: string, number, bigint, boolean, undefined, symbol and a special case of null. +See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Primitive_values +for definition of what sub-types comprise a primitive.

+
+ + + + + + + + + +
Example
+ +
RA.isPrimitive("string"); //=> true
+RA.isPrimitive(1); //=> true
+RA.isPrimitive(new String("string")); //=> false
+RA.isPrimitive(new Number(1)); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isPromise(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if input value is a native Promise. +The Promise object represents the eventual completion (or failure) +of an asynchronous operation, and its resulting value.

+
+ + + + + + + + + +
Example
+ +
RA.isPromise(null); // => false
+RA.isPromise(undefined); // => false
+RA.isPromise([]); // => false
+RA.isPromise(Promise.resolve()); // => true
+RA.isPromise(Promise.reject()); // => true
+RA.isPromise({ then: () => 1 }); // => false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isPrototypeOf(type, object) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Object
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if an object exists in another object's prototype chain.

+
+ + + + + + + + + +
Example
+ +
function Foo() {}
+function Bar() {}
+function Baz() {}
+
+Bar.prototype = Object.create(Foo.prototype);
+Baz.prototype = Object.create(Bar.prototype);
+
+const baz = new Baz();
+
+RA.isPrototypeOf(Baz, baz); // => true
+RA.isPrototypeOf(Bar, baz); // => true
+RA.isPrototypeOf(Foo, baz); // => true
+RA.isPrototypeOf(Object, baz); // => true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
type + + +Object + + + +

The prototype that we're searching for

object + + +Object + + + +

The object whose prototype chain will be searched

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isRegExp(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if value is RegExp object.

+
+ + + + + + + + + +
Example
+ +
RA.isRegExp(new RegExp()); //=> true
+RA.isRegExp(/(?:)/); //=> true
+RA.isRegExp(1); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isSafeInteger(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + + + +
+ + + + + +
+

Checks whether the passed value is a safe integer.

+
+ + + + + + + + + +
Example
+ +
RA.isSafeInteger(3); //=> true
+RA.isSafeInteger(Math.pow(2, 53)) //=> false
+RA.isSafeInteger(Math.pow(2, 53) - 1); //=> true
+RA.isSafeInteger(NaN); //=> false
+RA.isSafeInteger(Infinity); //=> false
+RA.isSafeInteger('3') //=> false
+RA.isSafeInteger(3.1); //=> false
+RA.isSafeInteger(3.0); //=> true
+RA.isSafeInteger('string'); //=> false
+RA.isSafeInteger(null); //=> false
+RA.isSafeInteger(undefined); //=> false
+RA.isSafeInteger({}); //=> false
+RA.isSafeInteger(() => { }); //=> false
+RA.isSafeInteger(true); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isSentinelValue(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + + + +
+ + + + + +
+

Checks whether the passed value is a sentinel value.

+
+ + + + + + + + + +
Example
+ +
RA.isSentinelValue(-1); //=> true
+
+RA.isSentinelValue('-1'); //=> false
+RA.isSentinelValue(1); //=> false
+RA.isSentinelValue([-1]); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isSet(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Predicate for determining if a provided value is an instance of a Set.

+
+ + + + + + + + + +
Example
+ +
RA.isSet(new Map()); //=> false
+RA.isSet(new Set()); //=> true
+RA.isSet(new Set([1,2]); //=> true
+RA.isSet(new Object()); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isSparseArray(list) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if input value is a sparse Array. +An array with at least one "empty slot" in it is often called a "sparse array." +Empty slot doesn't mean that the slot contains null or undefined values, +but rather that the slots don't exist.

+
+ + + + + + + + + +
Example
+ +
RA.isSparseArray(new Array(3)); // => true
+RA.isSparseArray([1,,3]); // => true
+
+const list = [1, 2, 3];
+delete list[1];
+RA.isSparseArray(list); // => true
+
+RA.isSparseArray([1, 2, 3]); // => false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
list + + +* + + + +

The list to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isString(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if input value is String.

+
+ + + + + + + + + +
Example
+ +
RA.isString('abc'); //=> true
+RA.isString(1); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isSymbol(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if input value is a Symbol.

+
+ + + + + + + + + +
Example
+ +
RA.isSymbol(Symbol('1')); //=> true
+RA.isSymbol(Symbol(1)); //=> true
+RA.isSymbol('string'); //=> false
+RA.isSymbol(undefined); //=> false
+RA.isSymbol(null); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isThenable(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if input value is a thenable. +thenable is an object or function that defines a then method.

+
+ + + + + + + + + +
Example
+ +
RA.isThenable(null); // => false
+RA.isThenable(undefined); // => false
+RA.isThenable([]); // => false
+RA.isThenable(Promise.resolve()); // => true
+RA.isThenable(Promise.reject()); // => true
+RA.isThenable({ then: () => 1 }); // => true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isTrue(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if input value is the Boolean primitive true. Will return false for Boolean objects +created using the Boolean function as a constructor.

+
+ + + + + + + + + +
Example
+ +
RA.isTrue(true); // => true
+RA.isTrue(Boolean(true)); // => true
+RA.isTrue(false); // => false
+RA.isTrue(1); // => false
+RA.isTrue('true'); // => false
+RA.isTrue(new Boolean(true)); // => false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isTruthy(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

In JavaScript, a truthy value is a value that is considered true +when evaluated in a Boolean context. All values are truthy unless +they are defined as falsy (i.e., except for false, 0, "", null, undefined, and NaN).

+
+ + + + + + + + + +
Example
+ +
RA.isTruthy({}); // => true
+RA.isTruthy([]); // => true
+RA.isTruthy(42); // => true
+RA.isTruthy(3.14); // => true
+RA.isTruthy('foo'); // => true
+RA.isTruthy(new Date()); // => true
+RA.isTruthy(Infinity); // => true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isUinteger32(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + +
Aliases:
+
+
  • isUint32
+
+ + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks whether the passed value is an unsigned 32 bit integer.

+
+ + + + + + + + + +
Example
+ +
RA.isUinteger32(0); //=> true
+RA.isUinteger32(2 ** 32 - 1); //=> true
+
+RA.isUinteger32(Infinity); //=> false
+RA.isUinteger32(NaN); //=> false
+RA.isUinteger32(-1); //=> false
+RA.isUinteger32(2 ** 32); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isUndefined(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if input value is undefined.

+
+ + + + + + + + + +
Example
+ +
RA.isUndefined(1); //=> false
+RA.isUndefined(undefined); //=> true
+RA.isUndefined(null); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isValidDate(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if value is valid Date object.

+
+ + + + + + + + + +
Example
+ +
RA.isValidDate(new Date()); //=> true
+RA.isValidDate(new Date('a')); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) isValidNumber(val) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Type
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Checks if value is a valid Number. A valid Number is a number that is not NaN, Infinity +or -Infinity.

+
+ + + + + + + + + +
Example
+ +
RA.isValidNumber(1); //=> true
+RA.isValidNumber(''); //=> false
+RA.isValidNumber(NaN); //=> false
+RA.isValidNumber(Infinity); //=> false
+RA.isValidNumber(-Infinity); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to test

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) lastP(iterable) → {Promise}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • [Promise a] -> Promise a
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Function
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Returns a promise that is fulfilled by the last given promise to be fulfilled, +or rejected with an array of rejection reasons if all of the given promises are rejected.

+
+ + + + + + + + + +
Example
+ +
const delayP = timeout => new Promise(resolve => setTimeout(() => resolve(timeout), timeout));
+delayP.reject = timeout => new Promise((resolve, reject) => setTimeout(() => reject(timeout), timeout));
+RA.lastP([
+  1,
+  delayP(10),
+  delayP(100),
+  delayP.reject(1000),
+]); //=> Promise(100)
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
iterable + + +Iterable.<*> + + + +

An iterable object such as an Array or String

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

A promise that is fulfilled by the last given promise to be fulfilled, or rejected with an array of rejection reasons if all of the given promises are rejected.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + +
+

(static) lengthEq(valueLength, value) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • Number -> [*] -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • List
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Returns true if the supplied list or string has a length equal to valueLength.

+
+ + + + + + + + + +
Example
+ +
RA.lengthEq(3, [1,2,3]); //=> true
+RA.lengthEq(3, [1,2,3,4]); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
valueLength + + +number + + + +

The length of the list or string

value + + +Array +| + +string + + + +

The list or string

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) lengthGt(valueLength, value) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • Number -> [*] -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • List
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Returns true if the supplied list or string has a length greater than valueLength.

+
+ + + + + + + + + +
Example
+ +
RA.lengthGt(3, [1,2,3,4]); //=> true
+RA.lengthGt(3, [1,2,3]); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
valueLength + + +number + + + +

The length of the list or string

value + + +Array +| + +string + + + +

The list or string

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) lengthGte(valueLength, value) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • Number -> [*] -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • List
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Returns true if the supplied list or string has a length greater than or equal to +valueLength.

+
+ + + + + + + + + +
Example
+ +
RA.lengthGte(3, [1,2,3,4]); //=> true
+RA.lengthGte(3, [1,2,3]); //=> true
+RA.lengthGte(3, [1,2]); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
valueLength + + +number + + + +

The length of the list or string

value + + +Array +| + +string + + + +

The list or string

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) lengthLt(valueLength, value) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • Number -> [*] -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • List
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Returns true if the supplied list or string has a length less than valueLength.

+
+ + + + + + + + + +
Example
+ +
RA.lengthLt(3, [1,2]); //=> true
+RA.lengthLt(3, [1,2,3]); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
valueLength + + +number + + + +

The length of the list or string

value + + +Array +| + +string + + + +

The list or string

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) lengthLte(valueLength, value) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • Number -> [*] -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • List
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Returns true if the supplied list or string has a length less than or equal to valueLength.

+
+ + + + + + + + + +
Example
+ +
RA.lengthLte(3, [1,2]); //=> true
+RA.lengthLte(3, [1,2,3]); //=> true
+RA.lengthLte(3, [1,2,3,4]); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
valueLength + + +number + + + +

The length of the list or string

value + + +Array +| + +string + + + +

The list or string

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) lengthNotEq(valueLength, value) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • Number -> [*] -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • List
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Returns true if the supplied list or string has a length not equal to valueLength.

+
+ + + + + + + + + +
Example
+ +
RA.lengthNotEq(3, [1,2,3,4]); //=> true
+RA.lengthNotEq(3, [1,2,3]); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
valueLength + + +number + + + +

The length of the list or string

value + + +Array +| + +string + + + +

The list or string

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) lensEq(lens, value, data) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • Lens s a -> b -> s -> Boolean
  • + +
+
+ + +
+
    + +
  • Lens s a = Functor f => (a -> f a) -> s -> f s
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Relation
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Returns true if data structure focused by the given lens equals provided value.

+
+ + + + + + + + + +
Example
+ +
RA.lensEq(R.lensIndex(0), 1, [0, 1, 2]); // => false
+RA.lensEq(R.lensIndex(1), 1, [0, 1, 2]); // => true
+RA.lensEq(R.lensPath(['a', 'b']), 'foo', { a: { b: 'foo' } }) // => true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
lens + + +function + + + +

Van Laarhoven lens

value + + +* + + + +

The value to compare the focused data structure with

data + + +* + + + +

The data structure

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

true if the focused data structure equals value, false otherwise

+
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) lensIso(tonon-null, fromnon-null) → (non-null) {function}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • (s -> a) -> (a -> s) -> Lens s a
  • + +
+
+ + +
+
    + +
  • Lens s a = Functor f => (a -> f a) -> s -> f s
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Relation
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Defines an isomorphism that will work like a lens. It takes two functions. +The function that converts and the function that recovers.

+
+ + + + + + + + + +
Example
+ +
const lensJSON = RA.lensIso(JSON.parse, JSON.stringify);
+
+R.over(lensJSON, assoc('b', 2), '{"a":1}'); //=> '{"a":1,"b":2}'
+R.over(RA.lensIso.from(lensJSON), R.replace('}', ',"b":2}'), { a: 1 }); // => { a: 1, b: 2 }
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
to + + +function + + + +

The function that converts

from + + +function + + + +

The function that recovers

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

The isomorphic lens

+
+ + + +
+
+ Type +
+
+ +function + + +
+
+ + + + + + + + +
+

(static) lensNotEq(lens, value, data) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • Lens s a -> b -> s -> Boolean
  • + +
+
+ + +
+
    + +
  • Lens s a = Functor f => (a -> f a) -> s -> f s
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Relation
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Returns true if data structure focused by the given lens doesn't equal provided value.

+
+ + + + + + + + + +
Example
+ +
RA.lensNotEq(R.lensIndex(0), 1, [0, 1, 2]); // => true
+RA.lensNotEq(R.lensIndex(1), 1, [0, 1, 2]); // => false
+RA.lensNotEq(R.lensPath(['a', 'b']), 'foo', { a: { b: 'foo' } }) // => false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
lens + + +function + + + +

Van Laarhoven lens

value + + +* + + + +

The value to compare the focused data structure with

data + + +* + + + +

The data structure

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

false if the focused data structure equals value, true otherwise

+
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) lensNotSatisfy(predicate, lens, data) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • Boolean b => (a -> b) -> Lens s a -> s -> b
  • + +
+
+ + +
+
    + +
  • Lens s a = Functor f => (a -> f a) -> s -> f s
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Relation
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Returns true if data structure focused by the given lens doesn't satisfy the predicate. +Note that the predicate is expected to return boolean value.

+
+ + + + + + + + + +
Example
+ +
RA.lensNotSatisfy(RA.isTrue, R.lensIndex(0), [false, true, 1]); // => true
+RA.lensNotSatisfy(RA.isTrue, R.lensIndex(1), [false, true, 1]); // => false
+RA.lensNotSatisfy(RA.isTrue, R.lensIndex(2), [false, true, 1]); // => true
+RA.lensNotSatisfy(R.identity, R.lensProp('x'), { x: 1 }); // => true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
predicate + + +function + + + +

The predicate function

lens + + +function + + + +

Van Laarhoven lens

data + + +* + + + +

The data structure

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

false if the focused data structure satisfies the predicate, true otherwise

+
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) lensSatisfies(predicate, lens, data) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • Boolean b => (a -> b) -> Lens s a -> s -> b
  • + +
+
+ + +
+
    + +
  • Lens s a = Functor f => (a -> f a) -> s -> f s
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Relation
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Returns true if data structure focused by the given lens satisfies the predicate. +Note that the predicate is expected to return boolean value and will be evaluated +as false unless the predicate returns true.

+
+ + + + + + + + + +
Example
+ +
RA.lensSatisfies(RA.isTrue, R.lensIndex(0), [false, true, 1]); // => false
+RA.lensSatisfies(RA.isTrue, R.lensIndex(1), [false, true, 1]); // => true
+RA.lensSatisfies(RA.isTrue, R.lensIndex(2), [false, true, 1]); // => false
+RA.lensSatisfies(R.identity, R.lensProp('x'), { x: 1 }); // => false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
predicate + + +function + + + +

The predicate function

lens + + +function + + + +

Van Laarhoven lens

data + + +* + + + +

The data structure

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

true if the focused data structure satisfies the predicate, false otherwise

+
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) lensTraverse(TypeRepresentative) → (non-null) {function}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • fantasy-land/of :: TypeRep f => f ~> a → f a
  • + +
  • Applicative f => (a -> f a) -> Lens s a
  • + +
  • Applicative f => TypeRep f -> Lens s a
  • + +
+
+ + +
+
    + +
  • Lens s a = Functor f => (a -> f a) -> s -> f s
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Relation
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Creates a Traversable lens +from an Applicative-returning function.

+

When executed, it maps an Applicative-returning +function over a Traversable, +then uses sequence to transform the resulting Traversable of Applicative +into an Applicative of Traversable.

+

Dispatches to the traverse method of the third argument, if present.

+
+ + + + + + + + + +
Example
+ +
const maybeLens = RA.lensTraverse(Maybe.of);
+const safeDiv = n => d => d === 0 ? Maybe.Nothing() : Maybe.Just(n / d)
+
+R.over(maybeLens, safeDiv(10), [2, 4, 5]); // => Just([5, 2.5, 2])
+R.over(maybeLens, safeDiv(10), [2, 0, 5]); // => Nothing
+
+R.view(maybeLens, [Maybe.Just(2), Maybe.Just(3)]); // => Maybe.Just([2, 3])
+
+R.set(maybeLens, Maybe.Just(1), [Maybe.just(2), Maybe.Just(3)]); // => Maybe.Just([1, 1])
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
TypeRepresentative + + +Object +| + +function + + + +

with an of or fantasy-land/of method

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

The Traversable lens

+
+ + + +
+
+ Type +
+
+ +function + + +
+
+ + + + + + + + +
+

(static) liftF(fn) → {function}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • Apply a => (a... -> a) -> (a... -> a)
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Function
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

"lifts" a function to be the specified arity, so that it may "map over" objects that satisfy +the fantasy land Apply spec of algebraic structures.

+

Lifting is specific for scalaz and function Java implementations. +Old version of fantasy land spec were not compatible with this approach, +but as of fantasy land 1.0.0 Apply spec also adopted this approach.

+

This function acts as interop for ramda <= 0.23.0 and monet.js.

+

More info here.

+
+ + + + + + + + + +
Example
+ +
const { Maybe } = require('monet');
+
+const add3 = (a, b, c) => a + b + c;
+const madd3 = RA.liftF(add3);
+
+madd3(Maybe.Some(10), Maybe.Some(15), Maybe.Some(17)); //=> Maybe.Some(42)
+madd3(Maybe.Some(10), Maybe.Nothing(), Maybe.Some(17)); //=> Maybe.Nothing()
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fn + + +function + + + +

The function to lift into higher context

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

The lifted function

+
+ + + +
+
+ Type +
+
+ +function + + +
+
+ + + + + + + + +
+

(static) liftFN(arity, fn) → {function}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • Apply a => Number -> (a... -> a) -> (a... -> a)
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Function
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

"lifts" a function to be the specified arity, so that it may "map over" objects that satisfy +the fantasy land Apply spec of algebraic structures.

+

Lifting is specific for scalaz and functional java implementations. +Old version of fantasy land spec were not compatible with this approach, +but as of fantasy land 1.0.0 Apply spec also adopted this approach.

+

This function acts as interop for ramda <= 0.23.0 and monet.js.

+

More info here.

+
+ + + + + + + + + +
Example
+ +
const { Maybe } = require('monet');
+
+const add3 = (a, b, c) => a + b + c;
+const madd3 = RA.liftFN(3, add3);
+
+madd3(Maybe.Some(10), Maybe.Some(15), Maybe.Some(17)); //=> Maybe.Some(42)
+madd3(Maybe.Some(10), Maybe.Nothing(), Maybe.Some(17)); //=> Maybe.Nothing()
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
arity + + +number + + + +

The arity of the lifter function

fn + + +function + + + +

The function to lift into higher context

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

The lifted function

+
+ + + +
+
+ Type +
+
+ +function + + +
+
+ + + + + + + + +
+

(static) list(…items) → {Array}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • a... -> [a...]
  • + +
+
+ + + + + + + + +
Category:
+
+
  • List
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Creates a list from arguments.

+
+ + + + + + + + + +
Example
+ +
RA.list('a', 'b', 'c'); //=> ['a', 'b', 'c']
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
items + + +* + + + + + + + + + + <repeatable>
+ +

The items of the feature list

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

New list created from items

+
+ + + +
+
+ Type +
+
+ +Array + + +
+
+ + + + + + + + +
+

(static) makeFlat(=non-null, =non-null) → (non-null) {Array}

+ + + + + + +
+ + +
Source:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • Bool -> List -> List
  • + +
+
+ + + + + + + + +
Category:
+
+
  • List
+
+ + + + + +
+ + + + + +
+

makeFlat is a helper function that returns a one-level or fully recursive +function based on the flag passed in.

+
+ + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
= + + +bool + + + +

should recursively flatten

= + + +Array + + + +

the nested list to be flattened

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

= the flattened list

+
+ + + +
+
+ Type +
+
+ +Array + + +
+
+ + + + + + + + +
+

(static) mapIndexed(fn, list) → {Array}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • Functor f => ((a, Idx, f a) => b) => f a -> f b
  • + +
+
+ + +
+
    + +
  • Idx = Number
  • + +
+
+ + + + + + + + +
Category:
+
+
  • List
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

R.map function that more closely resembles Array.prototype.map. +It takes two new parameters to its callback function: the current index, and the entire list.

+

mapIndexed implementation is simple : const mapIndexed = R.addIndex(R.map);

+
+ + + + + + + + + +
Example
+ +
RA.mapIndexed((val, idx, list) => idx + '-' + val, ['f', 'o', 'o', 'b', 'a', 'r']);
+//=> ['0-f', '1-o', '2-o', '3-b', '4-a', '5-r']
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fn + + +function + + + +

The function to be called on every element of the input list

list + + +Array + + + +

The list to be iterated over

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

The new list

+
+ + + +
+
+ Type +
+
+ +Array + + +
+
+ + + + + + + + +
+

(static) mergePath(pathnon-null, sourcenon-null, objnon-null) → (non-null) {Object}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • [k] -> {a} -> {k: {a}} -> {k: {a}}
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Object
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Create a new object with the own properties of the object under the path +merged with the own properties of the provided source. +If a key exists in both objects, the value from the source object will be used.

+
+ + + + + + + + + +
Example
+ +
RA.mergePath(
+ ['outer', 'inner'],
+ { foo: 3, bar: 4 },
+ { outer: { inner: { foo: 2 } } }
+); //=> { outer: { inner: { foo: 3, bar: 4 } }
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
path + + +Array + + + +

The property path of the destination object

source + + +Object + + + +

The source object

obj + + +Object + + + +

The object that has destination object under corresponding property path

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

The new version of object

+
+ + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + +
+

(static) mergePaths(pathsnon-null, objnon-null) → (non-null) {Object}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • [[k]] -> {k: {a}} -> {a}
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Object
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Merge objects under corresponding paths.

+
+ + + + + + + + + +
Example
+ +
const obj = {
+  foo: { fooInner: { fooInner2: 1 } },
+  bar: { barInner: 2 }
+};
+
+{ ...obj.foo.fooInner, ...obj.bar }; //=>  { fooInner2: 1, barInner: 2 }
+RA.mergePaths([['foo', 'fooInner'], ['bar']], obj); //=> { fooInner2: 1, barInner: 2 }
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
paths + + +Array + + + +

The property paths to merge

obj + + +Object + + + +

The object to query

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

The object composed of merged property paths of obj

+
+ + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + +
+

(static) mergeProp(pnon-null, sourcenon-null, objnon-null) → (non-null) {Object}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • [k] -> {a} -> {k: {a}} -> {k: {a}}
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Object
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Create a new object with the own properties of the object under the p +merged with the own properties of the provided source. +If a key exists in both objects, the value from the source object will be used.

+
+ + + + + + + + + +
Example
+ +
RA.mergeProp(
+ 'outer',
+ { foo: 3, bar: 4 },
+ { outer: { foo: 2 } }
+); //=> { outer: { foo: 3, bar: 4 } };
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
p + + +Array + + + +

The property of the destination object

source + + +Object + + + +

The source object

obj + + +Object + + + +

The object that has destination object under corresponding property

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

The new version of object

+
+ + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + +
+

(static) mergeProps(psnon-null, objnon-null) → (non-null) {Object}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • [k] -> {k: {a}} -> {a}
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Object
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Functional equivalent of merging object properties with object spread operator.

+
+ + + + + + + + + +
Example
+ +
const obj = {
+  foo: { fooInner: 1 },
+  bar: { barInner: 2 }
+};
+
+{ ...obj.foo, ...obj.bar }; //=> { fooInner: 1, barInner: 2 }
+RA.mergeProps(['foo', 'bar'], obj); //=> { fooInner: 1, barInner: 2 }
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
ps + + +Array + + + +

The property names to merge

obj + + +Object + + + +

The object to query

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

The object composed of merged properties of obj

+
+ + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + +
+

(static) move(fromIdx, toIdx, list) → {Array}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • Number -> Number -> [a] -> [a]
  • + +
+
+ + + + + + + + +
Category:
+
+
  • List
+
+ + + + + +
+ + + + + +
+

Returns a new list with the item at the position fromIdx moved to the position toIdx. If the +toIdx is out of the list range, the item will be placed at the last position of the list. +When negative indices are provided, the behavior of the move is unspecified.

+
+ + + + + + + + + +
Example
+ +
const list = ['a', 'b', 'c', 'd', 'e'];
+RA.move(1, 3, list) //=> ['a', 'c', 'd', 'b', 'e']
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fromIdx + + +number + + + +

The position of item to be moved

toIdx + + +number + + + +

The position of item after move

list + + +Array + + + +

The list containing the item to be moved

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Array + + +
+
+ + + + + + + + +
+

(static) nand(a, b) → {Boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • a -> b -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Logic
+
+ + + + + +
+ + + + + +
+

Returns false if both arguments are truthy; true otherwise.

+
+ + + + + + + + + +
Example
+ +
RA.nand(true, true); //=> false
+RA.nand(false, true); //=> true
+RA.nand(true, false); //=> true
+RA.nand(false, false); //=> true
+RA.nand(1.0, 1.0); //=> false
+RA.nand(1.0, 0); //=> true
+RA.nand(0, 1.0); //=> true
+RA.nand(0, 0); //=> true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
a + + +* + + + +
b + + +* + + + +
+ + + + + + + + + + + + + + +
Returns:
+ + +
+

false if both arguments are truesy

+
+ + + +
+
+ Type +
+
+ +Boolean + + +
+
+ + + + + + + + +
+

(static) neither(f, g) → {function}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • (*... -> Boolean) -> (*... -> Boolean) -> (*... -> Boolean)
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Logic
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

A function which calls the two provided functions and returns the complement of ||ing the +results. +It returns false if the first function is truth-y and the complement of the second function +otherwise. Note that this is short-circuited, meaning that the second function will not be +invoked if the first returns a truth-y value. In short it will return true if neither predicate +returns true.

+

In addition to functions, RA.neither also accepts any fantasy-land compatible +applicative functor.

+
+ + + + + + + + + +
Example
+ +
const gt10 = R.gt(R.__, 10)
+const even = (x) => x % 2 === 0;
+const f = RA.neither(gt10, even);
+
+f(12); //=> false
+f(8); //=> false
+f(11); //=> false
+f(9); //=> true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
f + + +function + + + +

A predicate

g + + +function + + + +

Another predicate

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

Returns a function that applies its arguments to f and g and returns the complement of ||ing their outputs together.

+
+ + + +
+
+ Type +
+
+ +function + + +
+
+ + + + + + + + +
+

(static) noneP(iterable) → {Promise}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • [Promise a] -> Promise [a]
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Function
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Returns a Promise that is resolved with an array of reasons when all of the provided Promises reject, or rejected when any Promise is resolved. +This pattern is like allP, but fulfillments and rejections are transposed - rejections become the fulfillment values and vice versa.

+
+ + + + + + + + + +
Example
+ +
RA.noneP([Promise.reject('hello'), Promise.reject('world')]); //=> Promise(['hello', 'world'])
+RA.noneP([]); //=> Promise([])
+RA.noneP([Promise.reject(), Promise.resolve('hello world')]); //=> Promise('hello world')
+RA.noneP([Promise.reject(), 'hello world']); //=> Promise('hello world')
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
iterable + + +Iterable.<*> + + + +

An iterable object such as an Array or String

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise that is resolved with a list of rejection reasons if all Promises are rejected, or a Promise that is rejected with the fulfillment value of the first Promise that resolves.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + +
+

(static) nonePass(predicates) → {function}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • [(*... -> Boolean)] -> (*... -> Boolean)
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Logic
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Takes a list of predicates and returns a predicate that returns true for a given list of +arguments if none of the provided predicates are satisfied by those arguments. It is the +complement of Ramda's anyPass.

+

The function returned is a curried function whose arity matches that of the +highest-arity predicate.

+
+ + + + + + + + + +
Example
+ +
const gt10 = R.gt(R.__, 10)
+const even = (x) => x % 2 === 0;
+const f = RA.nonePass([gt10, even]);
+
+f(12); //=> false
+f(8); //=> false
+f(11); //=> false
+f(9); //=> true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
predicates + + +Array + + + +

An array of predicates to check

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

The combined predicate

+
+ + + +
+
+ Type +
+
+ +function + + +
+
+ + + + + + + + +
+

(static) noop() → {undefined}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • ... -> undefined
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Function
+
+ + + + + +
+ + + + + +
+

A function that performs no operations.

+
+ + + + + + + + + +
Example
+ +
RA.noop(); //=> undefined
+RA.noop(1, 2, 3); //=> undefined
+ + + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +undefined + + +
+
+ + + + + + + + +
+

(static) nor(a, b) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • a -> b -> a ⊽ b
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Logic
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Returns true if both arguments are falsy; false otherwise.

+
+ + + + + + + + + +
Example
+ +
RA.nor(true, true); //=> false
+RA.nor(false, true); //=> false
+RA.nor(true, false); //=> false
+RA.nor(false, false); //=> true
+RA.nor(1, 1); //=> false
+RA.nor(1, 0); //=> false
+RA.nor(0, 1); //=> false
+RA.nor(0, 0); //=> true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
a + + +* + + + +
b + + +* + + + +
+ + + + + + + + + + + + + + +
Returns:
+ + +
+

true if both arguments are falsy

+
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) notAllPass(predicates) → {function}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • [(*... -> Boolean)] -> (*... -> Boolean)
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Logic
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Takes a list of predicates and returns a predicate that returns true for a given list of +arguments if one or more of the provided predicates is not satisfied by those arguments. It is +the complement of Ramda's allPass.

+

The function returned is a curried function whose arity matches that of the +highest-arity predicate.

+
+ + + + + + + + + +
Example
+ +
const gt10 = R.gt(R.__, 10)
+const even = (x) => x % 2 === 0;
+const f = RA.notAllPass([gt10, even]);
+
+f(12); //=> false
+f(8); //=> true
+f(11); //=> true
+f(9); //=> true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
predicates + + +Array + + + +

An array of predicates to check

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

The combined predicate

+
+ + + +
+
+ Type +
+
+ +function + + +
+
+ + + + + + + + +
+

(static) notAllUnique(list) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • [a] -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • List
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Returns true if at least one item of the list is repeated. R.equals is used to determine equality.

+
+ + + + + + + + + +
Example
+ +
RA.notAllUnique([ 1, 1, 2, 3 ]); //=> true
+RA.notAllUnique([ 1, 2, 3, 4 ]); //=> false
+RA.notAllUnique([]); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
list + + +Array + + + +

The list of values

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) notBoth(f, g) → {function}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • (*... -> Boolean) -> (*... -> Boolean) -> (*... -> Boolean)
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Logic
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

A function which calls the two provided functions and returns the complement of &&ing the +results. +It returns true if the first function is false-y and the complement of the second function +otherwise. Note that this is short-circuited, meaning that the second function will not be +invoked if the first returns a false-y value. In short it will return true unless both predicates +return true.

+

In addition to functions, RA.notBoth also accepts any fantasy-land compatible +applicative functor.

+
+ + + + + + + + + +
Example
+ +
const gt10 = R.gt(R.__, 10)
+const even = (x) => x % 2 === 0;
+const f = RA.notBoth(gt10, even);
+
+f(12); //=> false
+f(8); //=> true
+f(11); //=> true
+f(9); //=> true
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
f + + +function + + + +

A predicate

g + + +function + + + +

Another predicate

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

Returns a function that applies its arguments to f and g and returns the complement of &&ing their outputs together.

+
+ + + +
+
+ Type +
+
+ +function + + +
+
+ + + + + + + + +
+

(static) notEqual(a, b) → {Boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • a -> b -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Relation
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Returns true if its arguments are not equivalent, false otherwise. Handles +cyclical data structures.

+

Dispatches symmetrically to the equals methods of both arguments, if +present.

+
+ + + + + + + + + +
Example
+ +
RA.notEqual(1, 1); //=> false
+RA.notEqual(1, '1'); //=> true
+RA.notEqual([1, 2, 3], [1, 2, 3]); //=> false
+
+const a = {}; a.v = a;
+const b = {}; b.v = b;
+RA.notEqual(a, b); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
a + + +* + + + +
b + + +* + + + +
+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Boolean + + +
+
+ + + + + + + + +
+

(static) omitBy(prednon-null, objnon-null) → (non-null) {Object}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • ((v, k) -> Boolean) -> {k: v} -> {k: v}
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Object
+
+ + + + + +
+ + + + + +
+

Returns a partial copy of an object containing only the keys +that don't satisfy the supplied predicate.

+
+ + + + + + + + + +
Example
+ +
const isLowerCase = (val, key) => key.toLowerCase() === key;
+RA.omitBy(isLowerCase, {a: 1, b: 2, A: 3, B: 4}); //=> {A: 3, B: 4}
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
pred + + +function + + + +

A predicate to determine whether or not a key should be included on the output object

obj + + +Object + + + +

The object to copy from

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

A new object only with properties that don't satisfy pred

+
+ + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + +
+

(static) omitIndexes(indexesnon-null, listnon-null) → (non-null) {Array}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • [Int] -> [a] -> [a]
  • + +
+
+ + + + + + + + +
Category:
+
+
  • List
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Returns a partial copy of an array omitting the indexes specified.

+
+ + + + + + + + + +
Example
+ +
RA.omitIndexes([-1, 1, 3], ['a', 'b', 'c', 'd']); //=> ['a', 'c']
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
indexes + + +Array + + + +

The array of indexes to omit from the new array

list + + +Array + + + +

The array to copy from

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

The new array with omitted indexes

+
+ + + +
+
+ Type +
+
+ +Array + + +
+
+ + + + + + + + +
+

(static) overlaps(list1, list2) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • [a] -> [a] -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Relation
+
+ + + + + +
+ + + + + +
+

Returns true if two lists have at least one element common to both lists.

+
+ + + + + + + + + +
Example
+ +
RA.overlaps(['-v', '--verbose'], ['node', 'script.js', '-v']); //=> true
+RA.overlaps(['-v', '--verbose'], []); //=> false
+RA.overlaps([1, 2, 3], [3, 4, 5]); //=> true
+RA.overlaps([1, 2, 3], [4, 5]); //=> false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
list1 + + +Array + + + +

The first list

list2 + + +Array + + + +

The second list

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

True if two lists have at least one element common to both lists

+
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) padCharsEnd(padString, targetLength, value) → {string}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • String -> Number -> String -> String
  • + +
+
+ + + + + + + + +
Category:
+
+
  • String
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

The function pads the current string with a given string +(repeated, if needed) so that the resulting string reaches a given length. +The padding is applied from the end of the current string.

+
+ + + + + + + + + +
Example
+ +
RA.padCharsEnd('-', 3, 'a'); // => 'a--'
+RA.padCharsEnd('foo', 10, 'abc'); // => 'abcfoofoof'
+RA.padCharsEnd('123456', 6, 'abc'); // => 'abc123'
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
padString + + +string + + + +

The string to pad the current string with

targetLength + + +number + + + +

The length of the resulting string once +the current string has been padded

value + + +string + + + +

String value to be padded

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

A new string of the specified length with the pad string +applied at the end of the current string

+
+ + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + +
+

(static) padCharsStart(padString, targetLength, value) → {string}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • String -> Number -> String -> String
  • + +
+
+ + + + + + + + +
Category:
+
+
  • String
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

The function pads the current string with a given string +(repeated, if needed) so that the resulting string reaches a given length. +The padding is applied from the start of the current string.

+
+ + + + + + + + + +
Example
+ +
RA.padCharsStart('-', 3, 'a'); // => '--a'
+RA.padCharsStart('foo', 10, 'abc'); // => 'foofoofabc'
+RA.padCharsStart('123456', 6, 'abc'); // => '123abc'
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
padString + + +string + + + +

The string to pad the current string with

targetLength + + +number + + + +

The length of the resulting string once the current string has been padded

value + + +string + + + +

String value to be padded

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

A new string of the specified length with the pad string on the start of current string

+
+ + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + +
+

(static) padEnd(targetLength, value) → {string}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • Number -> String -> String
  • + +
+
+ + + + + + + + +
Category:
+
+
  • String
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

The function pads the current string with an empty string +so that the resulting string reaches a given length. +The padding is applied from the end of the current string.

+
+ + + + + + + + + +
Example
+ +
RA.padEnd(3, 'a'); // => 'a  '
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
targetLength + + +number + + + +

The length of the resulting string once +the current string has been padded

value + + +string + + + +

String value to be padded

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

A new string of the specified length with the pad string +applied at the end of the current string

+
+ + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + +
+

(static) padStart(targetLength, value) → {string}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • Number -> String -> String
  • + +
+
+ + + + + + + + +
Category:
+
+
  • String
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Pads string on the left side if it's shorter than length.

+
+ + + + + + + + + +
Example
+ +
RA.padStart(3, 'a'); // => '  a'
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
targetLength + + +number + + + +

The length of the resulting string once +the current string has been padded

value + + +string + + + +

String value to be padded

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

A new string of the specified length with the empty string +applied to the beginning of the current string

+
+ + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + +
+

(static) pathNotEq(val, path, object) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • a => [Idx] => {a} => Boolean
  • + +
  • Idx = String | Int | Symbol
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Relation
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Determines whether a nested path on an object doesn't have a specific value, +in R.equals terms. Most likely used to filter a list.

+
+ + + + + + + + + +
Example
+ +
const user1 = { address: { zipCode: 90210 } };
+const user2 = { address: { zipCode: 55555 } };
+const user3 = { name: 'Bob' };
+const users = [ user1, user2, user3 ];
+const isFamous = RA.pathNotEq(90210, ['address', 'zipCode']);
+R.filter(isFamous, users); //=> [ user2, user3 ]
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +a + + + +

The value to compare the nested property with

path + + +Array + + + +

The path of the nested property to use

object + + +Object + + + +

The object to check the nested property in

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

Returns Boolean false if the value equals the nested object property, true otherwise

+
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) pathOrLazy(defaultFn, path, obj) → {*}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • ({a} -> a) -> [Idx] -> {a} -> a
  • + +
+
+ + +
+
    + +
  • Idx = String | Int
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Object
+
+ + + + + +
+ + + + + +
+

If the given, non-null object has a value at the given path, returns the value at that path. +Otherwise returns the result of invoking the provided function with the object.

+
+ + + + + + + + + +
Example
+ +
RA.pathOrLazy(() => 'N/A', ['a', 'b'], {a: {b: 2}}); //=> 2
+RA.pathOrLazy(() => 'N/A', ['a', 'b'], {c: {b: 2}}); //=> "N/A"
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
defaultFn + + +function + + + +

The function that will return the default value.

path + + +Array + + + +

The path to use.

obj + + +Object + + + +

The object to retrieve the nested property from.

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

The data at path of the supplied object or the default value.

+
+ + + +
+
+ Type +
+
+ +* + + +
+
+ + + + + + + + +
+

(static) paths(ps, obj) → {Array}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • [[k]] -> {k: v} - [v]
  • + +
+
+ + + + + + + + +
Category:
+
+
  • List
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Acts as multiple path: arrays of paths in, array of values out. Preserves order.

+
+ + + + + + + + + +
Example
+ +
const obj = {
+  a: { b: { c: 1 } },
+  x: 2,
+};
+
+RA.paths([['a', 'b', 'c'], ['x']], obj); //=> [1, 2]
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
ps + + +Array + + + +

The property paths to fetch

obj + + +Object + + + +

The object to query

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

The corresponding values or partially applied function

+
+ + + +
+
+ Type +
+
+ +Array + + +
+
+ + + + + + + + +
+

(static) pickIndexes(indexes, list) → {Array}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • [Number] -> [a] -> [a]
  • + +
+
+ + + + + + + + +
Category:
+
+
  • List
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Picks values from list by indexes.

+

Note: pickIndexes will skip non existing indexes. If you want to include them +use ramda's props function.

+
+ + + + + + + + + +
Example
+ +
RA.pickIndexes([0, 2], ['a', 'b', 'c']); //=> ['a', 'c']
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
indexes + + +Array + + + +

The indexes to pick

list + + +Array + + + +

The list to pick values from

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

New array containing only values at indexes

+
+ + + +
+
+ Type +
+
+ +Array + + +
+
+ + + + + + + + +
+

(static) propNotEq(val, name, object) → {boolean}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • a -> String -> Object -> Boolean
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Relation
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Returns true if the specified object property is not equal, +in R.equals terms, to the given value; false otherwise.

+
+ + + + + + + + + +
Example
+ +
const abby = { name: 'Abby', age: 7, hair: 'blond' };
+const fred = { name: 'Fred', age: 12, hair: 'brown' };
+const rusty = { name: 'Rusty', age: 10, hair: 'brown' };
+const alois = { name: 'Alois', age: 15, disposition: 'surly' };
+const kids = [abby, fred, rusty, alois];
+const hasNotBrownHair = RA.propNotEq('brown', 'hair');
+
+R.filter(hasNotBrownHair, kids); //=> [abby, alois]
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +a + + + +

The value to compare to

name + + +String + + + +

The property to pick

object + + +Object + + + +

The object, that presumably contains value under the property

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

Comparison result

+
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + +
+

(static) rangeStep(step, from, to) → {Array.<number>}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • Number -> Number -> Number -> [Number]
  • + +
+
+ + + + + + + + +
Category:
+
+
  • List
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end.

+

Note: JavaScript follows the IEEE-754 standard for resolving floating-point values which can produce unexpected results.

+
+ + + + + + + + + +
Example
+ +
RA.rangeStep(1, 0, 4); // => [0, 1 ,2, 3]
+RA.rangeStep(-1, 0, -4); // => [0, -1, -2, -3]
+RA.rangeStep(1, 1, 5); // => [1, 2, 3, 4]
+RA.rangeStep(5, 0, 20); // => [0, 5, 10, 15]
+RA.rangeStep(-1, 0, -4); // => [0, -1, -2, -3]
+RA.rangeStep(0, 1, 4); // => [1, 1, 1]
+RA.rangeStep(1, 0, 0); // => []
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
step + + +number + + + +

The value to increment or decrement by

from + + +number + + + +

The start of the range

to + + +number + + + +

The end of the range

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

Returns the range of numbers

+
+ + + +
+
+ Type +
+
+ +Array.<number> + + +
+
+ + + + + + + + +
+

(static) reduceIndexed(fn, acc, list) → {*}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • ((a, b, Idx, [b]) => a) -> a -> [b] -> a
  • + +
+
+ + +
+
    + +
  • Idx = Number
  • + +
+
+ + + + + + + + +
Category:
+
+
  • List
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

R.reduce function that more closely resembles Array.prototype.reduce. +It takes two new parameters to its callback function: the current index, and the entire list.

+

reduceIndexed implementation is simple : const reduceIndexed = R.addIndex(R.reduce);

+
+ + + + + + + + + +
Example
+ +
const initialList = ['f', 'o', 'o', 'b', 'a', 'r'];
+
+reduceIndexed((acc, val, idx, list) => acc + '-' + val + idx, '', initialList);
+//=> "-f0-o1-o2-b3-a4-r5"
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fn + + +function + + + +

The iterator function. Receives four values, +the accumulator, the current element from the array, index and the entire list

acc + + +* + + + +

The accumulator value

list + + +Array + + + +

The list to iterate over

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

The final, accumulated value

+
+ + + +
+
+ Type +
+
+ +* + + +
+
+ + + + + + + + +
+

(static) reduceP(fn, acc, list) → {Promise}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • ((Promise a, MaybePromise b) -> Promise a) -> MaybePromise a -> MaybePromise [MaybePromise b] -> Promise a
  • + +
+
+ + +
+
    + +
  • MaybePromise = Promise.<*> | *
  • + +
+
+ + + + + + + + +
Category:
+
+
  • List
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Given an Iterable(arrays are Iterable), or a promise of an Iterable, +which produces promises (or a mix of promises and values), +iterate over all the values in the Iterable into an array and +reduce the array to a value using the given iterator function.

+

If the iterator function returns a promise, then the result of the promise is awaited, +before continuing with next iteration. If any promise in the array is rejected or a promise +returned by the iterator function is rejected, the result is rejected as well.

+

If initialValue is undefined (or a promise that resolves to undefined) and +the Iterable contains only 1 item, the callback will not be called and +the Iterable's single item is returned. If the Iterable is empty, the callback +will not be called and initialValue is returned (which may be undefined).

+

This function is basically equivalent to bluebird.reduce.

+
+ + + + + + + + + +
Example
+ +
RA.reduceP(
+  (total, fileName) => fs
+    .readFileAsync(fileName, 'utf8')
+    .then(contents => total + parseInt(contents, 10)),
+  0,
+  ['file1.txt', 'file2.txt', 'file3.txt']
+); // => Promise(10)
+
+RA.reduceP(
+  (total, fileName) => fs
+    .readFileAsync(fileName, 'utf8')
+    .then(contents => total + parseInt(contents, 10)),
+  Promise.resolve(0),
+  ['file1.txt', 'file2.txt', 'file3.txt']
+); // => Promise(10)
+
+RA.reduceP(
+  (total, fileName) => fs
+    .readFileAsync(fileName, 'utf8')
+    .then(contents => total + parseInt(contents, 10)),
+  0,
+  [Promise.resolve('file1.txt'), 'file2.txt', 'file3.txt']
+); // => Promise(10)
+
+RA.reduceP(
+  (total, fileName) => fs
+    .readFileAsync(fileName, 'utf8')
+    .then(contents => total + parseInt(contents, 10)),
+  0,
+  Promise.resolve([Promise.resolve('file1.txt'), 'file2.txt', 'file3.txt'])
+); // => Promise(10)
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fn + + +function + + + +

The iterator function. Receives two values, the accumulator and the current element from the list

acc + + +* +| + +Promise.<*> + + + +

The accumulator value

list + + +Array.<*> +| + +Promise.<Array.<(*|Promise.<*>)>> + + + +

The list to iterate over

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

The final, accumulated value

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + +
+

(static) reduceRightP(fn, acc, list) → {Promise}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • ((MaybePromise b, Promise a) -> Promise a) -> MaybePromise a -> MaybePromise [MaybePromise b] -> Promise a
  • + +
+
+ + +
+
    + +
  • MaybePromise = Promise.<*> | *
  • + +
+
+ + + + + + + + +
Category:
+
+
  • List
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Given an Iterable(arrays are Iterable), or a promise of an Iterable, +which produces promises (or a mix of promises and values), +iterate over all the values in the Iterable into an array and +reduce the array to a value using the given iterator function.

+

Similar to reduceP except moves through the input list from the right to the left. +The iterator function receives two values: (value, acc), +while the arguments' order of reduceP's iterator function is (acc, value).

+
+ + + + + + + + + +
Example
+ +
RA.reduceRightP(
+  (fileName, total) => fs
+    .readFileAsync(fileName, 'utf8')
+    .then(contents => total + parseInt(contents, 10)),
+  0,
+  ['file1.txt', 'file2.txt', 'file3.txt']
+); // => Promise(10)
+
+RA.reduceRightP(
+  (fileName, total) => fs
+    .readFileAsync(fileName, 'utf8')
+    .then(contents => total + parseInt(contents, 10)),
+  Promise.resolve(0),
+  ['file1.txt', 'file2.txt', 'file3.txt']
+); // => Promise(10)
+
+RA.reduceRightP(
+  (fileName, total) => fs
+    .readFileAsync(fileName, 'utf8')
+    .then(contents => total + parseInt(contents, 10)),
+  0,
+  [Promise.resolve('file1.txt'), 'file2.txt', 'file3.txt']
+); // => Promise(10)
+
+RA.reduceRightP(
+  (fileName, total) => fs
+    .readFileAsync(fileName, 'utf8')
+    .then(contents => total + parseInt(contents, 10)),
+  0,
+  Promise.resolve([Promise.resolve('file1.txt'), 'file2.txt', 'file3.txt'])
+); // => Promise(10)
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fn + + +function + + + +

The iterator function. Receives two values, the current element from the list and the accumulator

acc + + +* +| + +Promise.<*> + + + +

The accumulator value

list + + +Array.<*> +| + +Promise.<Array.<(*|Promise.<*>)>> + + + +

The list to iterate over

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

The final, accumulated value

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + +
+

(static) rejectP(reasonopt) → {Promise}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • a -> Promise a
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Function
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Composable shortcut for Promise.reject.

+

Returns a Promise object that is rejected with the given reason.

+
+ + + + + + + + + +
Example
+ +
RA.rejectP(); //=> Promise(undefined)
+RA.rejectP('a'); //=> Promise('a')
+RA.rejectP([1, 2, 3]); //=> Promise([1, 2, 3])
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
reason + + +* + + + + + + <optional>
+ + + + + +

Reason why this Promise rejected

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise that is rejected with the given reason

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + +
+

(static) renameKey(oldKeynon-null, newKeynon-null, objnon-null) → (non-null) {Object}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • (String a, String b) => a -> b -> {a: *} -> {b: *}
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Object
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Creates a new object with the own properties of the provided object, but a +single key is renamed from oldKey to newKey.

+

Keep in mind that in the case of keys conflict is behavior undefined and +the result may vary between various JS engines!

+
+ + + + + + + + + +
Example
+ +
const input = { firstName: 'Elisia', age: 22, type: 'human' };
+
+RA.renameKey('firstName', 'name')(input);
+//=> { name: 'Elisia', age: 22, type: 'human' }
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
oldKey + + +string + + + +
newKey + + +string + + + +
obj + + +Object + + + +
+ + + + + + + + + + + + + + +
Returns:
+ + +
+

New object with renamed key

+
+ + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + +
+

(static) renameKeyWith(fn, keynon-null, objnon-null) → (non-null) {Object}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • (k -> k) -> k -> {k: v} -> {k: v}
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Object
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Creates a new object with the own properties of the provided object, but the +key key renamed according to logic of renaming function.

+

Keep in mind that in case the new key name already existed on the object, +the behaviour is undefined and the result may vary between various JS engines!

+
+ + + + + + + + + +
Example
+ +
RA.renameKeyWith(R.concat('a'), 'A', { A: 1 }) //=> { aA: 1 }
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fn + + +function + + + +

Function that renames the keys

key + + +string + + + +

Key to rename

obj + + +Object + + + +

Provided object

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

New object with renamed key

+
+ + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + +
+

(static) renameKeys(keysMapnon-null, objnon-null) → (non-null) {Object}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • {a: b} -> {a: *} -> {b: *}
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Object
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Creates a new object with the own properties of the provided object, but the +keys renamed according to the keysMap object as {oldKey: newKey}. +When some key is not found in the keysMap, then it's passed as-is.

+

Keep in mind that in the case of keys conflict is behaviour undefined and +the result may vary between various JS engines!

+
+ + + + + + + + + +
Example
+ +
const input = { firstName: 'Elisia', age: 22, type: 'human' };
+
+RA.renameKeys({ firstName: 'name', type: 'kind', foo: 'bar' })(input);
+//=> { name: 'Elisia', age: 22, kind: 'human' }
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
keysMap + + +Object + + + +
obj + + +Object + + + +
+ + + + + + + + + + + + + + +
Returns:
+ + +
+

New object with renamed keys

+
+ + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + +
+

(static) renameKeysWith(fn, objnon-null) → (non-null) {Object}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • (a -> b) -> {a: *} -> {b: *}
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Object
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Creates a new object with the own properties of the provided object, but the +keys renamed according to logic of renaming function.

+

Keep in mind that in the case of keys conflict is behaviour undefined and +the result may vary between various JS engines!

+
+ + + + + + + + + +
Example
+ +
RA.renameKeysWith(R.concat('a'), { A: 1, B: 2, C: 3 }) //=> { aA: 1, aB: 2, aC: 3 }
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fn + + +function + + + +

Function that renames the keys

obj + + +Object + + + +

Provided object

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

New object with renamed keys

+
+ + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + +
+

(static) repeatStr(value, count) → {string}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • String -> Number -> String
  • + +
+
+ + + + + + + + +
Category:
+
+
  • List
+
+ + + + + +
+ + + + + +
+

Constructs and returns a new string which contains the specified +number of copies of the string on which it was called, concatenated together.

+
+ + + + + + + + + +
Example
+ +
RA.repeatStr('a', 3); //=> 'aaa'
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +string + + + +

String value to be repeated

count + + +number + + + +

An integer between 0 and +∞: [0, +∞), indicating the number of times to repeat the string in the newly-created string that is to be returned

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

A new string containing the specified number of copies of the given string

+
+ + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + +
+

(static) replaceAll(searchValue, replaceValue, str) → {string}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • String -> String -> String -> String
  • + +
+
+ + + + + + + + +
Category:
+
+
  • String
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Replaces all substring matches in a string with a replacement.

+
+ + + + + + + + + +
Example
+ +
RA.replaceAll('ac', 'ef', 'ac ab ac ab'); //=> 'ef ab ef ab'
+RA.replaceAll('', '_', 'xxx'); //=> '_x_x_x_'
+RA.replaceAll(/x/g, 'v', 'xxx'); //=> 'vvv'
+RA.replaceAll(/x/, 'v', 'xxx'); //=> TypeError
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
searchValue + + +string + + + +

The substring or a global RegExp to match

replaceValue + + +string + + + +

The string to replace the matches with

str + + +string + + + +

The String to do the search and replacement in

+ + + + + + + + + + + + +
Throws:
+ + + +
+
+
+

When invalid arguments provided

+
+
+
+
+
+
+ Type +
+
+ +TypeError + + +
+
+
+
+
+ + + + + +
Returns:
+ + +
+

A new string containing all the searchValue replaced with the replaceValue

+
+ + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + +
+

(static) resolveP(valueopt) → {Promise}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • a -> Promise a
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Function
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Composable shortcut for Promise.resolve.

+

Returns a Promise object that is resolved with the given value. +If the value is a thenable (i.e. has a "then" method), the returned promise will +"follow" that thenable, adopting its eventual state.

+
+ + + + + + + + + +
Example
+ +
RA.resolveP(); //=> Promise(undefined)
+RA.resolveP('a'); //=> Promise('a')
+RA.resolveP([1, 2, 3]); //=> Promise([1, 2, 3])
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +* + + + + + + <optional>
+ + + + + +

Argument to be resolved by this Promise. Can also be a Promise or a thenable to resolve

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise that is resolved with the given value, or the promise passed as value, if the value was a promise object

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + +
+

(static) round(number) → {number}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • Number -> Number
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Math
+
+ + + + + +
+ + + + + +
+

Returns the value of a number rounded to the nearest integer.

+
+ + + + + + + + + +
Example
+ +
RA.round(0.9); //=> 1
+RA.round(5.95); //=> 6
+RA.round(5.5); //=> 6
+RA.round(5.05); //=> 5
+RA.round(-5.05); //=> -5
+RA.round(-5.5); //=> -5
+RA.round(-5.95); //=> -6
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
number + + +number + + + +

The number to round

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

The value of the given number rounded to the nearest integer

+
+ + + +
+
+ Type +
+
+ +number + + +
+
+ + + + + + + + +
+

(static) seq(fns, x) → {*}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • [(a -> *), (a -> *), ...] -> a -> a
  • + +
+
+ + + + + + +
Aliases:
+
+
  • sequencing
+
+ + + +
Category:
+
+
  • Function
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Runs the given list of functions in order with the supplied object, then returns the object. +Also known as the normal order sequencing combinator.

+

Acts as a transducer if a transformer is given as second parameter.

+
+ + + + + + + + + +
Example
+ +
RA.seq([console.info, console.log])('foo'); //=> prints 'foo' via info then log
+
+// usage in composition
+R.pipe(
+  R.concat('prefix '),
+  RA.seq([
+    console.info, //=> prints 'prefix test'
+    console.log //=> prints 'prefix test'
+  ]),
+  R.toUpper
+)('test'); //=> 'PREFIX TEST'
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fns + + +Array + + + +

The list of functions to call in order with x whose return values will be thrown away

x + + +* + + + +
+ + + + + + + + + + + + + + +
Returns:
+ + +
+

x

+
+ + + +
+
+ Type +
+
+ +* + + +
+
+ + + + + + + + +
+

(static) sign(number) → {number}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • Number | String -> Number
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Math
+
+ + + + + +
+ + + + + +
+

Returns the sign of a number, indicating whether the number is positive, negative or zero.

+
+ + + + + + + + + +
Example
+ +
RA.sign(3); //  1
+RA.sign(-3); // -1
+RA.sign('-3'); // -1
+RA.sign(0); //  0
+RA.sign(-0); // -0
+RA.sign(NaN); // NaN
+RA.sign('foo'); // NaN
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
number + + +number + + + +

A number

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

A number representing the sign of the given argument. If the argument is a positive number, negative number, positive zero or negative zero, the function will return 1, -1, 0 or -0 respectively. Otherwise, NaN is returned

+
+ + + +
+
+ Type +
+
+ +number + + +
+
+ + + + + + + + +
+

(static) skipTake(the, value) → {Array}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • Number -> [a] -> [a]
  • + +
+
+ + + + + + + + +
Category:
+
+
  • List
+
+ + + + + +
+ + + + + +
+

When given a number n and an array, returns an array containing every nth element.

+
+ + + + + + + + + +
Example
+ +
RA.skipTake(2, [1,2,3,4]) //=> [1, 3]
+RA.skipTake(3, R.range(0, 20)); //=> [0, 3, 6, 9, 12, 15, 18]
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
the + + +number + + + +

nth element to extract

value + + +Array + + + +

the input array

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

An array containing every nth element

+
+ + + +
+
+ Type +
+
+ +Array + + +
+
+ + + + + + + + +
+

(static) sliceFrom(fromIndex, list) → {Array|string}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • Number -> [a] -> [a]
  • + +
+
+ + + + + + + + +
Category:
+
+
  • List
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Returns the elements of the given list or string (or object with a slice method) +from fromIndex (inclusive). +Dispatches to the slice method of the second argument, if present.

+
+ + + + + + + + + +
Example
+ +
RA.sliceFrom(1, [1, 2, 3]); //=> [2, 3]
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fromIndex + + +number + + + +

The start index (inclusive)

list + + +Array +| + +string + + + +

The list or string to slice

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

The sliced list or string

+
+ + + +
+
+ Type +
+
+ +Array +| + +string + + +
+
+ + + + + + + + +
+

(static) sliceTo(toIndex, list) → {Array|string}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • Number -> [a] -> [a]
  • + +
+
+ + + + + + + + +
Category:
+
+
  • List
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Returns the elements of the given list or string (or object with a slice method) +to toIndex (exclusive). +Dispatches to the slice method of the second argument, if present.

+
+ + + + + + + + + +
Example
+ +
RA.sliceTo(2, [1, 2, 3]); //=> [1, 2]
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
toIndex + + +number + + + +

The end index (exclusive)

list + + +Array +| + +string + + + +

The list or string to slice

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

The sliced list or string

+
+ + + +
+
+ Type +
+
+ +Array +| + +string + + +
+
+ + + + + + + + +
+

(static) sortByPaths(paths, list) → {Array.<object>}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • [[k]] -> [{k: v}] -> [{k: v}]
  • + +
+
+ + + + + + + + +
Category:
+
+
  • List
+
+ + + + + +
+ + + + + +
+

Sort a list of objects by a list of paths (if first path value is equivalent, sort by second, etc).

+
+ + + + + + + + + +
Example
+ +
const alice = {
+  name: 'Alice',
+  address: {
+    street: 31,
+    zipCode: 97777,
+  },
+};
+const bob = {
+  name: 'Bob',
+  address: {
+    street: 31,
+    zipCode: 55555,
+  },
+};
+const clara = {
+  name: 'Clara',
+  address: {
+    street: 32,
+    zipCode: 90210,
+  },
+};
+const people = [clara, bob, alice]
+
+RA.sortByPaths([
+  ['address', 'street'],
+  ['address', 'zipCode'],
+], people); // => [bob, alice, clara]
+
+RA.sortByPaths([
+  ['address', 'zipCode'],
+  ['address', 'street'],
+], people); // => [bob, clara, alice]
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
paths + + +Array.<Array.<string>> + + + +

A list of paths in the list param to sort by

list + + +Array.<object> + + + +

A list of objects to be sorted

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

A new list sorted by the paths in the paths param

+
+ + + +
+
+ Type +
+
+ +Array.<object> + + +
+
+ + + + + + + + +
+

(static) sortByProp(prop, list) → {Array.<object>}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • k -> [{k: v}] -> [{k: v}]
  • + +
+
+ + + + + + + + +
Category:
+
+
  • List
+
+ + + + + +
+ + + + + +
+

Sort a list of objects by a property.

+
+ + + + + + + + + +
Example
+ +
// sorting list of tuples
+const sortByFirstItem = sortByProp(0);
+const listOfTuples = [[-1, 1], [-2, 2], [-3, 3]];
+sortByFirstItem(listOfTuples); // => [[-3, 3], [-2, 2], [-1, 1]]
+
+// sorting list of objects
+const sortByName = sortByProp('name');
+const alice = {
+  name: 'ALICE',
+  age: 101,
+};
+const bob = {
+  name: 'Bob',
+  age: -10,
+};
+const clara = {
+  name: 'clara',
+  age: 314.159,
+};
+const people = [clara, bob, alice];
+sortByName(people); // => [alice, bob, clara]
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
prop + + +Array.<string> + + + +

The property in the list param to sort by

list + + +Array.<object> + + + +

A list of objects to be sorted

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

A new list sorted by the property in the prop param

+
+ + + +
+
+ Type +
+
+ +Array.<object> + + +
+
+ + + + + + + + +
+

(static) sortByProps(props, list) → {Array.<object>}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • [k] -> [{k: v}] -> [{k: v}]
  • + +
+
+ + + + + + + + +
Category:
+
+
  • List
+
+ + + + + +
+ + + + + +
+

Sort a list of objects by a list of props (if first prop value is equivalent, sort by second, etc).

+
+ + + + + + + + + +
Example
+ +
sortByProps(['num'], [{num: 3}, {num: 2}, {num: 1}])
+//=> [{num: 1}, {num: 2} {num: 3}]
+sortByProps(['letter', 'num'], [{num: 3, letter: 'a'}, {num: 2, letter: 'a'} {num: 1, letter: 'z'}])
+//=> [ {num: 2, letter: 'a'}, {num: 3, letter: 'a'}, {num: 1, letter: 'z'}]
+sortByProps(['name', 'num'], [{num: 3}, {num: 2}, {num: 1}])
+//=> [{num: 1}, {num: 2}, {num: 3}]
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
props + + +Array.<string> + + + +

A list of properties in the list param to sort by

list + + +Array.<object> + + + +

A list of objects to be sorted

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

A new list sorted by the properties in the props param

+
+ + + +
+
+ Type +
+
+ +Array.<object> + + +
+
+ + + + + + + + +
+

(static) spreadPath(pathnon-null, objnon-null) → (non-null) {Object}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • [Idx] -> {k: v} -> {k: v}
  • + +
+
+ + +
+
    + +
  • Idx = String | Int
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Object
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Spreads object under property path onto provided object. +It's like flattenPath, but removes object under the property path.

+
+ + + + + + + + + +
Example
+ +
RA.spreadPath(
+  ['b1', 'b2'],
+  { a: 1, b1: { b2: { c: 3, d: 4 } } }
+); // => { a: 1, c: 3, d: 4, b1: {} };
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
path + + +Array.<(string|number)> + + + +

The property path to spread

obj + + +Object + + + +

The provided object

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

The result of the spread

+
+ + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + +
+

(static) spreadProp(prop, objnon-null) → (non-null) {Object}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • Idx -> {k: v} -> {k: v}
  • + +
+
+ + +
+
    + +
  • Idx = String | Int
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Object
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Spreads object under property onto provided object. +It's like flattenProp, but removes object under the property.

+
+ + + + + + + + + +
Example
+ +
RA.spreadProp('b', { a: 1, b: { c: 3, d: 4 } }); // => { a: 1, c: 3, d: 4 };
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
prop + + +string +| + +number + + + +

The property to spread

obj + + +Object + + + +

The provided object

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

The result of the spread

+
+ + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + +
+

(static) stubArray() → {Array}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • ... -> Array
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Function
+
+ + + + + +
+ + + + + +
+

A function that returns new empty array on every call.

+
+ + + + + + + + + +
Example
+ +
RA.stubArray(); //=> []
+RA.stubArray(1, 2, 3); //=> []
+ + + + + + + + + + + + + + + + +
Returns:
+ + +
+

New empty array

+
+ + + +
+
+ Type +
+
+ +Array + + +
+
+ + + + + + + + +
+

(static) stubNull() → {null}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • ... -> null
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Function
+
+ + + + + +
+ + + + + +
+

A function that returns null.

+
+ + + + + + + + + +
Example
+ +
RA.stubNull(); //=> null
+RA.stubNull(1, 2, 3); //=> null
+ + + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +null + + +
+
+ + + + + + + + +
+

(static) stubObj() → {Object}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • ... -> Object
  • + +
+
+ + + + + + +
Aliases:
+
+
  • stubObject
+
+ + + +
Category:
+
+
  • Function
+
+ + + + + +
+ + + + + +
+

This function returns a new empty object.

+
+ + + + + + + + + +
Example
+ +
RA.stubObj(); //=> {}
+RA.stubObj(1, 2, 3); //=> {}
+ + + + + + + + + + + + + + + + +
Returns:
+ + +
+

Returns the new empty object.

+
+ + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + +
+

(static) stubString() → {string}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • ... -> String
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Function
+
+ + + + + +
+ + + + + +
+

A function that returns empty string.

+
+ + + + + + + + + +
Example
+ +
RA.stubString(); //=> ''
+RA.stubString(1, 2, 3); //=> ''
+ + + + + + + + + + + + + + + + +
Returns:
+ + +
+

The empty string

+
+ + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + +
+

(static) stubUndefined() → {undefined}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • ... -> undefined
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Function
+
+ + + + + +
+ + + + + +
+

A function that returns undefined.

+
+ + + + + + + + + +
Example
+ +
RA.stubUndefined(); //=> undefined
+RA.stubUndefined(1, 2, 3); //=> undefined
+ + + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +undefined + + +
+
+ + + + + + + + +
+

(static) subtractNum(subtrahend, minuend) → {number}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • Number -> Number -> Number
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Math
+
+ + + + + +
+ + + + + +
+

Subtracts its first argument from its second argument.

+
+ + + + + + + + + +
Example
+ +
RA.subtractNum(3, 5); //=> 2
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
subtrahend + + +number + + + +

the number to subtract

minuend + + +number + + + +

the number to subtract from

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

A number representing the difference of subtracting the subtrahend from the minuend

+
+ + + +
+
+ Type +
+
+ +number + + +
+
+ + + + + + + + +
+

(static) thenCatchP(onFulfilled, onRejected, promise) → {Promise}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • (a -> b) -> (c -> d) -> Promise a -> Promise b | d
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Function
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Composable shortcut for Promise.then that allows for success and failure callbacks. +The thenCatchP function returns a Promise. It takes three arguments: a callback function for the success of the Promise, +a callback function for the failure of the Promise, and the promise instance itself.

+
+ + + + + + + + + +
Example
+ +
const promise = Promise.resolve(1);
+const add1 = x => x + 1;
+
+RA.thenCatchP(add1, console.error, promise); // => Promise(2)
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
onFulfilled + + +function + + + +

A Function called if the Promise is fulfilled. This function has one argument, the fulfillment value

onRejected + + +function + + + +

A Function called if the Promise is rejected. This function has one argument, the error

promise + + +Promise + + + +

Any Promise or Thenable object

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + +
+

(static) toArray(val) → {Array}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • * -> [a]
  • + +
+
+ + + + + + + + +
Category:
+
+
  • List
+
+ + + + + +
+ + + + + +
+

Converts value to an array.

+
+ + + + + + + + + +
Example
+ +
RA.toArray([1, 2]); //=> [1, 2]
+RA.toArray({'foo': 1, 'bar': 2}); //=> [1, 2]
+RA.toArray('abc'); //=> ['a', 'b', 'c']
+RA.toArray(1); //=> []
+RA.toArray(null); //=> []
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to convert

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Array + + +
+
+ + + + + + + + +
+

(static) toInteger32(number) → {number}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • Number -> Number
  • + +
+
+ + + + + + +
Aliases:
+
+
  • toInt32
+
+ + + +
Category:
+
+
  • Math
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Converts double-precision 64-bit binary format IEEE 754 to signed 32 bit integer number.

+
+ + + + + + + + + +
Example
+ +
RA.toInteger32(2 ** 35); // => 0
+RA.toInteger32(2 ** 30); // => 1073741824
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
number + + +number + + + +

A number

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

A signed 32-bit integer number

+
+ + + +
+
+ Type +
+
+ +number + + +
+
+ + + + + + + + +
+

(static) toNumber(val) → {Number}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Category:
+
+
  • Type
+
+ + + + + +
+ + + + + +
+

Converts value to a number.

+
+ + + + + + + + + +
Example
+ +
RA.toNumber(3.2); //=> 3.2
+RA.toNumber(Number.MIN_VALUE); //=> 5e-324
+RA.toNumber(Infinity); //=> Infinity
+RA.toNumber('3.2'); //=> 3.2
+RA.toNumber(Symbol('3.2')); //=> NaN
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +* + + + +

The value to convert

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Number + + +
+
+ + + + + + + + +
+

(static) toUinteger32(val) → {number}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • Number -> Number
  • + +
+
+ + + + + + +
Aliases:
+
+
  • toUint32
+
+ + + +
Category:
+
+
  • Math
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Converts double-precision 64-bit binary format IEEE 754 to unsigned 32 bit integer number.

+
+ + + + + + + + + +
Example
+ +
RA.toUinteger32(1.5); //=> 1
+RA.toInteger32(2 ** 35); // => 0
+RA.toInteger32(2 ** 31); // => 2147483648
+RA.toInteger32(2 ** 30); // => 1073741824
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +number + + + +

Value to be converted.

+ + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +number + + +
+
+ + + + + + + + +
+

(static) trimCharsEnd(chars, value) → {string}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • String -> String
  • + +
+
+ + + + + + + + +
Category:
+
+
  • String
+
+ + + + + +
+ + + + + +
+

Removes specified characters from the end of a string.

+
+ + + + + + + + + +
Example
+ +
RA.trimCharsEnd('_-', '-_-abc-_-'); //=> '-_-abc'
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
chars + + +string + + + +

The characters to trim

value + + +string + + + +

The string to trim

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

Returns the trimmed string.

+
+ + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + +
+

(static) trimCharsStart(chars, value) → {string}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • String -> String
  • + +
+
+ + + + + + + + +
Category:
+
+
  • String
+
+ + + + + +
+ + + + + +
+

Removes specified characters from the beginning of a string.

+
+ + + + + + + + + +
Example
+ +
RA.trimCharsStart('_-', '-_-abc-_-'); //=> 'abc-_-'
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
chars + + +string + + + +

The characters to trim

value + + +string + + + +

The string to trim

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

Returns the trimmed string.

+
+ + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + +
+

(static) trimEnd(value) → {string}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • String -> String
  • + +
+
+ + + + + + + + +
Category:
+
+
  • String
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Removes whitespace from the end of a string.

+
+ + + + + + + + + +
Example
+ +
RA.trimEnd('abc   '); //=> 'abc'
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +string + + + +

String value to have the whitespace removed from the end

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

A new string representing the calling string stripped of whitespace from its end (right end).

+
+ + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + +
+

(static) trimStart(value) → {string}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • String -> String
  • + +
+
+ + + + + + + + +
Category:
+
+
  • String
+
+ + + + + +
+ + + + + +
+

Removes whitespace from the beginning of a string.

+
+ + + + + + + + + +
Example
+ +
RA.trimStart('  abc'); //=> 'abc'
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +string + + + +

String value to have the whitespace removed from the beginning

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

A new string representing the calling string stripped of whitespace from its beginning (left end).

+
+ + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + +
+

(static) trunc(number) → {number}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • Number | String -> Number
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Math
+
+ + + + + +
+ + + + + +
+

Returns the integer part of a number by removing any fractional digits.

+
+ + + + + + + + + +
Example
+ +
RA.trunc(13.37); //=> 13
+RA.trunc(42.84); //=> 42
+RA.trunc(0.123); //=>  0
+RA.trunc(-0.123); //=> -0
+RA.trunc('-1.123'); //=> -1
+RA.trunc(NaN); //=> NaN
+RA.trunc('foo'); //=> NaN
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
number + + +number +| + +string + + + +

The number to trunc

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

The integer part of the given number

+
+ + + +
+
+ Type +
+
+ +number + + +
+
+ + + + + + + + +
+

(static) unzipObjWith(fn, obj) → {Array}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • (v, k) => [k, v] -> { k: v } -> [[k], [v]]
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Object
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Creates a new list out of the supplied object by applying the function to each key/value pairing.

+
+ + + + + + + + + +
Example
+ +
RA.unzipObjWith((v, k) => [`new${k.toUpperCase()}`, 2 * v], { a: 1, b: 2, c: 3 });
+//=> [['newA', 'newB', 'newC'], [2, 4, 6]]
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fn + + +function + + + +

The function to transform each value-key pair

obj + + +Object + + + +

Object to unzip

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

A pair of tw lists: a list of keys and a list of values

+
+ + + +
+
+ Type +
+
+ +Array + + +
+
+ + + + + + + + +
+

(static) viewOr(defaultValue, lens, data) → {*}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • a -> Lens s b -> s -> b | a
  • + +
+
+ + +
+
    + +
  • Lens s b = Functor f => (b -> f b) -> s -> f s
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Object
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Returns a "view" of the given data structure, determined by the given lens. +The lens's focus determines which portion of the data structure is visible. +Returns the defaultValue if "view" is null, undefined or NaN; otherwise the "view" is returned.

+
+ + + + + + + + + +
Example
+ +
RA.viewOr('N/A', R.lensProp('x'), {}); // => 'N/A'
+RA.viewOr('N/A', R.lensProp('x'), { x: 1 }); // => 1
+RA.viewOr('some', R.lensProp('y'), { y: null }); // => 'some'
+RA.viewOr('some', R.lensProp('y'), { y: false }); // => false
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
defaultValue + + +* + + + +

The default value

lens + + +function + + + +

Van Laarhoven lens

data + + +* + + + +

The data structure

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

"view" or defaultValue

+
+ + + +
+
+ Type +
+
+ +* + + +
+
+ + + + + + + + +
+

(static) weave(fn, config) → {function}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • (*... -> *) -> * -> (*... -> *)
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Function
+
+ + + + + +
+ + + + + +
+

Weaves a configuration into function returning the runnable monad like Reader or Free. +This allows us to pre-bind the configuration in advance and use the weaved function +without need to explicitly pass the configuration on every call.

+
+ + + + + + + + + +
Example
+ +
const { Reader: reader } = require('monet');
+
+const log = value => reader(
+  config => config.log(value)
+);
+
+// no weaving
+log('test').run(console); //=> prints 'test'
+
+// weaving
+const wlog = RA.weave(log, console);
+wlog('test'); //=> prints 'test'
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fn + + +function + + + +

The function to weave

config + + +* + + + +

The configuration to weave into fn

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

Auto-curried weaved function

+
+ + + +
+
+ Type +
+
+ +function + + +
+
+ + + + + + + + +
+

(static) weaveLazy(fn, configAccessor) → {function}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • (*... -> *) -> (* -> *) -> (*... -> *)
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Function
+
+ + + + + +
+ + + + + +
+

Weaves a configuration into function returning the runnable monad like Reader or Free. +This allows us to pre-bind the configuration in advance and use the weaved function +without need to explicitly pass the configuration on every call.

+
+ + + + + + + + + +
Example
+ +
const { Reader: reader } = require('monet');
+
+const log = value => reader(
+  config => config.log(value)
+);
+
+const consoleAccessor = R.always(console);
+
+// no weaving
+log('test').run(console); //=> prints 'test'
+
+// weaving
+const wlog = RA.weaveLazy(log, consoleAccessor);
+wlog('test'); //=> prints 'test'
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fn + + +function + + + +

The function to weave

configAccessor + + +function + + + +

The function that returns the configuration object

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

Auto-curried weaved function

+
+ + + +
+
+ Type +
+
+ +function + + +
+
+ + + + + + + + +
+

(static) zipObjWith(fn, keys, values) → {Object}

+ + + + + + +
+ + +
Source:
+
+ + + + + +
Since:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Signature:
+
+
    + +
  • (b, a) -> [k, v] -> [a] -> [b] -> { k: v }
  • + +
+
+ + + + + + + + +
Category:
+
+
  • Object
+
+ + + +
See also:
+
+ +
+ + + +
+ + + + + +
+

Creates a new object out of a list of keys and a list of values by applying the function +to each equally-positioned pair in the lists. +Key/value pairing is truncated to the length of the shorter of the two lists.

+
+ + + + + + + + + +
Example
+ +
RA.zipObjWith((value, key) => [key, `${key}${value + 1}`]), ['a', 'b', 'c'], [1, 2, 3]);
+ // => { a: 'a2', b: 'b3', c: 'c4' }
+ + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fn + + +function + + + +

The function to transform each value-key pair

keys + + +Array + + + +

Array to transform into the properties on the output object

values + + +Array + + + +

Array to transform into the values on the output object

+ + + + + + + + + + + + + + +
Returns:
+ + +
+

The object made by pairing up and transforming same-indexed elements of keys and values.

+
+ + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + + + +
+ +
+ + + + +
+ +
+ + + + + + + \ No newline at end of file diff --git a/5.0.0/Y.js.html b/5.0.0/Y.js.html new file mode 100644 index 0000000000..59f6b9f306 --- /dev/null +++ b/5.0.0/Y.js.html @@ -0,0 +1,105 @@ + + + + + Y.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

Y.js

+ + + + + + + +
+
+
import { curryN } from 'ramda';
+
+/**
+ * Y-combinator
+ *
+ * The Y combinator is an interesting function which only works with functional languages,
+ * showing how recursion can still be done even without any variable or function declarations,
+ * only functions and parameters
+ *
+ * @func Y
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.3.0|v2.3.0}
+ * @category Function
+ * @sig (a, ... -> b -> b) -> (a, ... -> b)
+ * @param {Function} le Recursive function maker
+ * @return {Function}
+ * @see {@link http://kestas.kuliukas.com/YCombinatorExplained/|Y combinator explained}
+ * @example
+ *
+ * const makeFact = givenFact => (n) => {
+ *   if (n < 2) { return 1 }
+ *   return n * givenFact(n - 1);
+ * };
+ *
+ * const factorial = RA.Y(makeFact);
+ *
+ * factorial(5); //=> 120
+ */
+
+const Y = curryN(1, (le) => ((f) => f(f))((g) => le((x) => g(g)(x))));
+
+export default Y;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/allEqual.js.html b/5.0.0/allEqual.js.html new file mode 100644 index 0000000000..4c0df4c11b --- /dev/null +++ b/5.0.0/allEqual.js.html @@ -0,0 +1,101 @@ + + + + + allEqual.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

allEqual.js

+ + + + + + + +
+
+
import { pipe, uniq, curryN } from 'ramda';
+
+import lengthLte from './lengthLte.js';
+
+// Original idea for this function was conceived by https://github.com/jackmellis
+// in https://github.com/char0n/ramda-adjunct/pull/513.
+
+/**
+ * Returns true if all items in the list are equivalent using `R.equals` for equality comparisons.
+ *
+ * @func allEqual
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.9.0|v2.9.0}
+ * @category List
+ * @sig [a] -> Boolean
+ * @param {Array} list The list of values
+ * @return {boolean}
+ * @see {@link https://ramdajs.com/docs/#equals|equals}
+ * @example
+ *
+ * RA.allEqual([ 1, 2, 3, 4 ]); //=> false
+ * RA.allEqual([ 1, 1, 1, 1 ]); //=> true
+ * RA.allEqual([]); //=> true
+ *
+ */
+const allEqual = curryN(1, pipe(uniq, lengthLte(1)));
+
+export default allEqual;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/allEqualTo.js.html b/5.0.0/allEqualTo.js.html new file mode 100644 index 0000000000..2b73e7722a --- /dev/null +++ b/5.0.0/allEqualTo.js.html @@ -0,0 +1,98 @@ + + + + + allEqualTo.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

allEqualTo.js

+ + + + + + + +
+
+
import { all, equals, curry } from 'ramda';
+
+/**
+ * Returns true if all items in the list are equivalent to user provided value using `R.equals` for equality comparisons.
+ *
+ * @func allEqualTo
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.11.0|v2.11.0}
+ * @category List
+ * @sig a -> [b] -> Boolean
+ * @param {*} val User provided value to check the `list` against
+ * @param {Array} list The list of values
+ * @return {boolean}
+ * @see {@link RA.allEqual|allEqual}, {@link https://ramdajs.com/docs/#equals|equals}
+ * @example
+ *
+ * RA.allEqualTo(1, [ 1, 2, 3, 4 ]); //=> false
+ * RA.allEqualTo(1, [ 1, 1, 1, 1 ]); //=> true
+ * RA.allEqualTo({}, [ {}, {} ]); //=> true
+ * RA.allEqualTo(1, []); //=> true
+ *
+ */
+const allEqualTo = curry((val, list) => all(equals(val), list));
+
+export default allEqualTo;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/allIdentical.js.html b/5.0.0/allIdentical.js.html new file mode 100644 index 0000000000..c3659de558 --- /dev/null +++ b/5.0.0/allIdentical.js.html @@ -0,0 +1,99 @@ + + + + + allIdentical.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

allIdentical.js

+ + + + + + + +
+
+
import { uniqWith, identical, pipe, curryN } from 'ramda';
+
+import lengthLte from './lengthLte.js';
+
+/**
+ * Returns true if all items in the list are equivalent using `R.identical` for equality comparisons.
+ *
+ * @func allIdentical
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.11.0|v2.11.0}
+ * @category List
+ * @sig [a] -> Boolean
+ * @param {Array} list The list of values
+ * @return {boolean}
+ * @see {@link https://ramdajs.com/docs/#identical|identical}
+ * @example
+ *
+ * RA.allIdentical([ 1, 2, 3, 4 ]); //=> false
+ * RA.allIdentical([ 1, 1, 1, 1 ]); //=> true
+ * RA.allIdentical([]); //=> true
+ * RA.allIdentical([ {}, {} ]); //=> false
+ * RA.allIdentical([ () => {}, () => {} ]); //=> false
+ */
+const allIdentical = curryN(1, pipe(uniqWith(identical), lengthLte(1)));
+
+export default allIdentical;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/allIdenticalTo.js.html b/5.0.0/allIdenticalTo.js.html new file mode 100644 index 0000000000..42dc448063 --- /dev/null +++ b/5.0.0/allIdenticalTo.js.html @@ -0,0 +1,98 @@ + + + + + allIdenticalTo.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

allIdenticalTo.js

+ + + + + + + +
+
+
import { curry, identical, all } from 'ramda';
+
+/**
+ * Returns true if all items in the list are equivalent to user provided value using `R.identical` for equality comparisons.
+ *
+ * @func allIdenticalTo
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.11.0|v2.11.0}
+ * @category List
+ * @sig a -> [b] -> Boolean
+ * @param {*} val User provided value to check the `list` against
+ * @param {Array} list The list of values
+ * @return {boolean}
+ * @see {@link RA.allIdentical|allIdentical}, {@link http://ramdajs.com/docs/#identical|R.identical}
+ * @example
+ *
+ * RA.allIdenticalTo(1, [ 1, 2, 3, 4 ]); //=> false
+ * RA.allIdenticalTo(1, [ 1, 1, 1, 1 ]); //=> true
+ * RA.allIdenticalTo(1, []); //=> true
+ * RA.allIdenticalTo({}, [ {}, {} ]); //=> false
+ *
+ */
+const allIdenticalTo = curry((val, list) => all(identical(val), list));
+
+export default allIdenticalTo;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/allP.js.html b/5.0.0/allP.js.html new file mode 100644 index 0000000000..c462002e61 --- /dev/null +++ b/5.0.0/allP.js.html @@ -0,0 +1,100 @@ + + + + + allP.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

allP.js

+ + + + + + + +
+
+
import { bind, curryN } from 'ramda';
+
+/**
+ * Composable shortcut for `Promise.all`.
+ *
+ * The `allP` method returns a single Promise that resolves when all of the promises
+ * in the iterable argument have resolved or when the iterable argument contains no promises.
+ * It rejects with the reason of the first promise that rejects.
+ *
+ * @func allP
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.3.0|v2.3.0}
+ * @category Function
+ * @sig [Promise a] -> Promise [a]
+ * @param {Iterable.<*>} iterable An iterable object such as an Array or String
+ * @return {Promise} An already resolved Promise if the iterable passed is empty. An asynchronously resolved Promise if the iterable passed contains no promises. Note, Google Chrome 58 returns an already resolved promise in this case. A pending Promise in all other cases. This returned promise is then resolved/rejected asynchronously (as soon as the stack is empty) when all the promises in the given iterable have resolved, or if any of the promises reject. See the example about "Asynchronicity or synchronicity of allP" below.
+ * @see {@link RA.resolveP|resolveP}, {@link RA.rejectP|rejectP}
+ * @example
+ *
+ * RA.allP([1, 2]); //=> Promise([1, 2])
+ * RA.allP([1, Promise.resolve(2)]); //=> Promise([1, 2])
+ * RA.allP([Promise.resolve(1), Promise.resolve(2)]); //=> Promise([1, 2])
+ * RA.allP([1, Promise.reject(2)]); //=> Promise(2)
+ */
+const allP = curryN(1, bind(Promise.all, Promise));
+
+export default allP;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/allSettledP.js.html b/5.0.0/allSettledP.js.html new file mode 100644 index 0000000000..6327e39a3f --- /dev/null +++ b/5.0.0/allSettledP.js.html @@ -0,0 +1,107 @@ + + + + + allSettledP.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

allSettledP.js

+ + + + + + + +
+
+
import { bind, curryN } from 'ramda';
+
+import isFunction from './isFunction.js';
+import ponyfill from './internal/ponyfills/Promise.allSettled.js';
+
+export const allSettledPPonyfill = curryN(1, ponyfill);
+
+/**
+ * Returns a promise that is fulfilled with an array of promise state snapshots,
+ * but only after all the original promises have settled, i.e. become either fulfilled or rejected.
+ * We say that a promise is settled if it is not pending, i.e. if it is either fulfilled or rejected.
+ *
+ * @func allSettledP
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.18.0|v2.18.0}
+ * @category Function
+ * @typedef Settlement = { status: String, value: * }
+ * @sig [Promise a] -> Promise [Settlement a]
+ * @param {Iterable.<*>} iterable An iterable object such as an Array or String
+ * @return {Promise} Returns a promise that is fulfilled with an array of promise state snapshots
+ * @see {@link RA.allP|allP}
+ * @example
+ *
+ * RA.allSettledP([
+ *   Promise.resolve(1),
+ *   2,
+ *   Promise.reject(3),
+ * ]); //=> Promise([{ status: 'fulfilled', value: 1 }, { status: 'fulfilled', value: 2 }, { status: 'rejected', reason: 3 }])
+ */
+const allSettledP = isFunction(Promise.allSettled)
+  ? curryN(1, bind(Promise.allSettled, Promise))
+  : allSettledPPonyfill;
+
+export default allSettledP;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/allUnique.js.html b/5.0.0/allUnique.js.html new file mode 100644 index 0000000000..1e0d2068b4 --- /dev/null +++ b/5.0.0/allUnique.js.html @@ -0,0 +1,98 @@ + + + + + allUnique.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

allUnique.js

+ + + + + + + +
+
+
import { converge, length, uniq } from 'ramda';
+
+import lengthEq from './lengthEq.js';
+
+/**
+ * Returns true if all items in the list are unique. `R.equals` is used to determine equality.
+ *
+ * @func allUnique
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.22.0|v2.22.0}
+ * @category List
+ * @sig [a] -> Boolean
+ * @param {Array} list The list of values
+ * @return {boolean}
+ * @see {@link RA.notAllUnique|notAllUnique},  {@link https://ramdajs.com/docs/#equals|equals}
+ * @example
+ *
+ * RA.allUnique([ 1, 2, 3, 4 ]); //=> true
+ * RA.allUnique([ 1, 1, 2, 3 ]); //=> false
+ * RA.allUnique([]); //=> true
+ *
+ */
+const allUnique = converge(lengthEq, [length, uniq]);
+
+export default allUnique;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/anyP.js.html b/5.0.0/anyP.js.html new file mode 100644 index 0000000000..dbd29d6a07 --- /dev/null +++ b/5.0.0/anyP.js.html @@ -0,0 +1,106 @@ + + + + + anyP.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

anyP.js

+ + + + + + + +
+
+
import { bind, curryN } from 'ramda';
+
+import isFunction from './isFunction.js';
+import ponyfill, { AggregatedError } from './internal/ponyfills/Promise.any.js';
+
+export const anyPPonyfill = curryN(1, ponyfill);
+export { AggregatedError };
+
+/**
+ * Returns a promise that is fulfilled by the first given promise to be fulfilled,
+ * or rejected with an array of rejection reasons if all of the given promises are rejected.
+ *
+ * @func anyP
+ * @memberOf RA
+ * @category Function
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.22.0|v2.22.0}
+ * @sig [Promise a] -> Promise a
+ * @param {Iterable.<*>} iterable An iterable object such as an Array or String
+ * @return {Promise} A promise that is fulfilled by the first given promise to be fulfilled, or rejected with an array of rejection reasons if all of the given promises are rejected
+ * @see {@link RA.lastP|lastP}
+ * @example
+ *
+ * RA.anyP([
+ *   Promise.resolve(1),
+ *   2,
+ *   Promise.reject(3),
+ * ]); //=> Promise(1)
+ */
+const anyP = isFunction(Promise.any)
+  ? curryN(1, bind(Promise.any, Promise))
+  : anyPPonyfill;
+
+export default anyP;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/appendFlipped.js.html b/5.0.0/appendFlipped.js.html new file mode 100644 index 0000000000..4a88fbf205 --- /dev/null +++ b/5.0.0/appendFlipped.js.html @@ -0,0 +1,97 @@ + + + + + appendFlipped.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

appendFlipped.js

+ + + + + + + +
+
+
import { append, flip } from 'ramda';
+
+/**
+ * Returns a new list containing the contents of the given list, followed by the given element.
+ * Like {@link http://ramdajs.com/docs/#append|R.append} but with argument order reversed.
+ *
+ * @func appendFlipped
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.5.0|v2.5.0}
+ * @category List
+ * @sig [a] -> a -> [a]
+ * @param {Array} list The list of elements to add a new item to
+ * @param {*} el The element to add to the end of the new list
+ * @return {Array} A new list containing the elements of the old list followed by `el`
+ * @see {@link http://ramdajs.com/docs/#append|R.append}
+ * @example
+ *
+ * RA.appendFlipped(['write', 'more'], 'tests'); //=> ['write', 'more', 'tests']
+ * RA.appendFlipped([], 'tests'); //=> ['tests']
+ * RA.appendFlipped(['write', 'more'], ['tests']); //=> ['write', 'more', ['tests']]
+ */
+const appendFlipped = flip(append);
+
+export default appendFlipped;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/argsPass.js.html b/5.0.0/argsPass.js.html new file mode 100644 index 0000000000..c8ea1f03fb --- /dev/null +++ b/5.0.0/argsPass.js.html @@ -0,0 +1,113 @@ + + + + + argsPass.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

argsPass.js

+ + + + + + + +
+
+
import { useWith, curry, compose } from 'ramda';
+
+import list from './list.js';
+import isTruthy from './isTruthy.js';
+
+/**
+ * Takes a combining predicate and a list of functions and returns a function which will map the
+ * arguments it receives to the list of functions and returns the result of passing the values
+ * returned from each function to the combining predicate. A combining predicate is a function that
+ * combines a list of Boolean values into a single Boolean value, such as `R.any` or `R.all`. It
+ * will test each value using `RA.isTruthy`, meaning the functions don't necessarily have to be
+ * predicates.
+ *
+ * The function returned is curried to the number of functions supplied, and if called with more
+ * arguments than functions, any remaining arguments are passed in to the combining predicate
+ * untouched.
+ *
+ * @func argsPass
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.7.0|v2.7.0}
+ * @category Logic
+ * @sig ((* -> Boolean) -> [*] -> Boolean) -> [(* -> Boolean), ...] -> (*...) -> Boolean
+ * @param {Function} combiningPredicate The predicate used to combine the values returned from the
+ * list of functions
+ * @param {Array} functions List of functions
+ * @return {boolean} Returns the combined result of mapping arguments to functions
+ * @example
+ *
+ * RA.argsPass(R.all, [RA.isArray, RA.isBoolean, RA.isString])([], false, 'abc') //=> true
+ * RA.argsPass(R.all, [RA.isArray, RA.isBoolean, RA.isString])([], false, 1) //=> false
+ * RA.argsPass(R.any, [RA.isArray, RA.isBoolean, RA.isString])({}, 1, 'abc') //=> true
+ * RA.argsPass(R.any, [RA.isArray, RA.isBoolean, RA.isString])({}, 1, false) //=> false
+ * RA.argsPass(R.none, [RA.isArray, RA.isBoolean, RA.isString])({}, 1, false) //=> true
+ * RA.argsPass(R.none, [RA.isArray, RA.isBoolean, RA.isString])({}, 1, 'abc') //=> false
+ */
+const argsPass = curry((combiningPredicate, predicates) =>
+  useWith(compose(combiningPredicate(isTruthy), list), predicates)
+);
+
+export default argsPass;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/async.js.html b/5.0.0/async.js.html new file mode 100644 index 0000000000..f0ce41478d --- /dev/null +++ b/5.0.0/async.js.html @@ -0,0 +1,133 @@ + + + + + async.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

async.js

+ + + + + + + +
+
+
import { curryN, bind } from 'ramda';
+
+import resolveP from './resolveP.js';
+import rejectP from './rejectP.js';
+
+/**
+ * Takes a generator function and returns an async function.
+ * The async function returned is a curried function whose arity matches that of the generator function.
+ *
+ * Note: This function is handy for environments that does support generators but doesn't support async/await.
+ *
+ * @func async
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.16.0|v2.16.0}
+ * @category Function
+ * @sig Promise c => (a, b, ...) -> a -> b -> ... -> c
+ * @param {Function} generatorFn The generator function
+ * @return {Function} Curried async function
+ * @see {@link https://www.promisejs.org/generators/}
+ * @example
+ *
+ * const asyncFn = RA.async(function* generator(val1, val2) {
+ *   const a = yield Promise.resolve(val1);
+ *   const b = yield Promise.resolve(val2);
+ *
+ *   return a + b;
+ * });
+ *
+ * asyncFn(1, 2); //=> Promise(3)
+ *
+ */
+const async = curryN(1, (generatorFn) => {
+  function asyncWrapper(...args) {
+    const iterator = bind(generatorFn, this)(...args);
+
+    const handle = (result) => {
+      const resolved = resolveP(result.value);
+
+      return result.done
+        ? resolved
+        : resolved.then(
+            (value) => handle(iterator.next(value)),
+            (error) => handle(iterator.throw(error))
+          );
+    };
+
+    try {
+      return handle(iterator.next());
+    } catch (error) {
+      return rejectP(error);
+    }
+  }
+
+  if (generatorFn.length > 0) {
+    return curryN(generatorFn.length, asyncWrapper);
+  }
+  return asyncWrapper;
+});
+
+export default async;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/cata.js.html b/5.0.0/cata.js.html new file mode 100644 index 0000000000..f055d325a0 --- /dev/null +++ b/5.0.0/cata.js.html @@ -0,0 +1,159 @@ + + + + + cata.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

cata.js

+ + + + + + + +
+
+
import { curry } from 'ramda';
+
+import isFunction from './isFunction.js';
+
+/**
+ * The catamorphism is a way of folding a type into a value.
+ *
+ * **Either**
+ *
+ * If the either is right then the right function will be executed with
+ * the `right` value and the value of the function returned. Otherwise the left function
+ * will be called with the `left` value.
+ *
+ * **Maybe**
+ *
+ * If the maybe is Some than the right function will be executed with the `some` value and the value of the function
+ * returned. Otherwise the left function with be called without an argument.
+ *
+ * **Result**
+ *
+ * If the result is Ok than the right function will be executed with the `Ok` value and the value of the function
+ * returned. Otherwise the left function will be called with the `Error` value.
+ *
+ * **Validation**
+ *
+ * If the validation is Success than the right function will be executed with the `Success` value and the value of the function
+ * returned. Otherwise the left function will be called with the `Failure` value.
+ *
+ * Supported monadic libraries: {@link https://monet.github.io/monet.js/|monet.js}, {@link https://folktale.origamitower.com/|folktale}, {@link https://github.com/ramda/ramda-fantasy|ramda-fantasy}
+ *
+ * @func cata
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.4.0|v1.4.0}
+ * @category Function
+ * @sig (a -> b) -> (a -> c) -> Cata a -> b | c
+ * @param {Function} leftFn The left function that consumes the left value
+ * @param {Function} rightFn The right function that consumes the right value
+ * @param {Cata} catamorphicObj Either, Maybe or any other type with catamorphic capabilities (`cata` or `either` method)
+ * @return {*}
+ * @see {@link https://monet.github.io/monet.js/#cata|cata explained}
+ * @example
+ *
+ * // Either
+ * const eitherR = Either.Right(1);
+ * const eitherL = Either.Left(2);
+ *
+ * RA.cata(identity, identity, eitherR); //=> 1
+ * RA.cata(identity, identity, eitherL); //=> 2
+ *
+ * // Maybe
+ * const maybeSome = Maybe.Some(1);
+ * const maybeNothing = Maybe.Nothing();
+ *
+ * RA.cata(identity, identity, maybeSome); //=> 1
+ * RA.cata(identity, identity, maybeNothing); //=> undefined
+ */
+const catamorphism = curry((leftFn, rightFn, catamorphicObj) => {
+  // folktale support
+  if (isFunction(catamorphicObj.matchWith)) {
+    return catamorphicObj.matchWith({
+      // Result type
+      Ok: ({ value }) => rightFn(value),
+      Error: ({ value }) => leftFn(value),
+      // Maybe type
+      Just: ({ value }) => rightFn(value),
+      Nothing: () => leftFn(undefined),
+      // Validation type
+      Success: ({ value }) => rightFn(value),
+      Failure: ({ value }) => leftFn(value),
+    });
+  }
+
+  if (isFunction(catamorphicObj.cata)) {
+    return catamorphicObj.cata(leftFn, rightFn);
+  }
+
+  if (isFunction(catamorphicObj.getOrElse)) {
+    const elseValue = `RA.cata${Math.random()}`;
+    const value = catamorphicObj.getOrElse(elseValue);
+    return value === elseValue ? leftFn() : rightFn(value);
+  }
+
+  return catamorphicObj.either(leftFn, rightFn);
+});
+
+export default catamorphism;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/catchP.js.html b/5.0.0/catchP.js.html new file mode 100644 index 0000000000..c5b85d00a2 --- /dev/null +++ b/5.0.0/catchP.js.html @@ -0,0 +1,98 @@ + + + + + catchP.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

catchP.js

+ + + + + + + +
+
+
import { invoker } from 'ramda';
+
+/**
+ * Composable shortcut for `Promise.catch`.
+ * The catchP function returns a Promise. It takes two arguments: a callback function for the failure of the Promise
+ * and the promise instance itself.
+ *
+ * @func catchP
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.29.0|v2.29.0}
+ * @category Function
+ * @sig (a -> Promise b | b) -> Promise b
+ * @param {Function} onRejected A Function called if the Promise is rejected. This function has one argument, the rejection reason.
+ * @param {Promise} promise Any Promise
+ * @return {Promise} Returns a Promise with dealt rejected cases
+ * @see {@link RA.thenP|thenP}, {@link RA.resolveP|resolveP}, {@link RA.rejectP|rejectP}, {@link RA.allP|allP}
+ *
+ * @example
+ *
+ * RA.catchP(() => 'b', Promise.resolve('a')); //=> Promise('a')
+ * RA.catchP(() => 'b', Promise.reject('a')); //=> Promise('b')
+ */
+const catchP = invoker(1, 'catch');
+
+export default catchP;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/ceil.js.html b/5.0.0/ceil.js.html new file mode 100644 index 0000000000..d7ac644498 --- /dev/null +++ b/5.0.0/ceil.js.html @@ -0,0 +1,101 @@ + + + + + ceil.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

ceil.js

+ + + + + + + +
+
+
import { bind, curryN } from 'ramda';
+
+/**
+ * Returns the smallest integer greater than or equal to a given number.
+ *
+ * Note: ceil(null) returns integer 0 and does not give a NaN error.
+ *
+ * @func ceil
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.15.0|v2.15.0}
+ * @category Math
+ * @sig Number -> Number
+ * @param {number} number The number to ceil
+ * @return {number} The smallest integer greater than or equal to the given number
+ * @example
+ *
+ * RA.ceil(.95); //=> 1
+ * RA.ceil(4); //=> 4
+ * RA.ceil(7.004); //=> 8
+ * RA.ceil(-0.95); //=> -0
+ * RA.ceil(-4); //=> -4
+ * RA.ceil(-7.004); //=> -7
+ * RA.ceil(null); //=> 0
+ */
+
+const ceil = curryN(1, bind(Math.ceil, Math));
+
+export default ceil;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/compact.js.html b/5.0.0/compact.js.html new file mode 100644 index 0000000000..0d20d036b5 --- /dev/null +++ b/5.0.0/compact.js.html @@ -0,0 +1,96 @@ + + + + + compact.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

compact.js

+ + + + + + + +
+
+
import { reject } from 'ramda';
+
+import isFalsy from './isFalsy.js';
+
+/**
+ * Creates an array with all falsy values removed.
+ * The values false, null, 0, "", undefined, and NaN are falsy.
+ *
+ * @func compact
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.5.0|v2.5.0}
+ * @category List
+ * @sig Filterable f => f a -> f a
+ * @param {Array} list The array to compact
+ * @return {Array} Returns the new array of filtered values
+ * @see {@link RA.isFalsy|isFalsy}
+ * @example
+ *
+ * RA.compact([0, 1, false, 2, '', 3]); //=> [1, 2, 3]
+ */
+const compact = reject(isFalsy);
+
+export default compact;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/concatAll.js.html b/5.0.0/concatAll.js.html new file mode 100644 index 0000000000..6241041da9 --- /dev/null +++ b/5.0.0/concatAll.js.html @@ -0,0 +1,108 @@ + + + + + concatAll.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

concatAll.js

+ + + + + + + +
+
+
import { concat, identical, identity, pipe, reduce, when } from 'ramda';
+
+import stubUndefined from './stubUndefined.js';
+
+const leftIdentitySemigroup = { concat: identity };
+
+/**
+ * Returns the result of concatenating the given lists or strings.
+ * Note: RA.concatAll expects all elements to be of the same type. It will throw an error if you concat an Array with a non-Array value.
+ * Dispatches to the concat method of the preceding element, if present. Can also concatenate multiple elements of a [fantasy-land compatible semigroup](https://github.com/fantasyland/fantasy-land#semigroup).
+ * Returns undefined if empty array was passed.
+ *
+ * @func concatAll
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.6.0|v2.6.0}
+ * @category List
+ * @sig [[a]] -> [a] | Undefined
+ * @sig [String] -> String | Undefined
+ * @sig Semigroup s => Foldable s f => f -> s | Undefined
+ * @param {Array.<Array|string>} list List containing elements that will be concatenated
+ * @return {Array|string|undefined} Concatenated elements
+ * @see {@link http://ramdajs.com/docs/#concat|R.concat}, {@link RA.concatRight|concatRight}, {@link http://ramdajs.com/docs/#unnest|R.unnest}, {@link http://ramdajs.com/docs/#join|R.join}
+ * @example
+ *
+ * concatAll([[1], [2], [3]]); //=> [1, 2, 3]
+ * concatAll(['1', '2', '3']); //=> '123'
+ * concatAll([]); //=> undefined
+ * concatAll(null); //=> undefined
+ */
+const concatAll = pipe(
+  reduce(concat, leftIdentitySemigroup),
+  when(identical(leftIdentitySemigroup), stubUndefined)
+);
+
+export default concatAll;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/concatRight.js.html b/5.0.0/concatRight.js.html new file mode 100644 index 0000000000..f1020c85db --- /dev/null +++ b/5.0.0/concatRight.js.html @@ -0,0 +1,103 @@ + + + + + concatRight.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

concatRight.js

+ + + + + + + +
+
+
import { concat, flip } from 'ramda';
+
+/**
+ * Returns the result of concatenating the given lists or strings.
+ *
+ * Note: R.concat expects both arguments to be of the same type, unlike
+ * the native Array.prototype.concat method.
+ * It will throw an error if you concat an Array with a non-Array value.
+ * Dispatches to the concat method of the second argument, if present.
+ *
+ * @func concatRight
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.11.0|v1.11.0}
+ * @category List
+ * @sig [a] -> [a] -> [a]
+ * @sig String -> String -> String
+ * @param {Array|String} firstList The first list
+ * @param {Array|String} secondList The second list
+ * @return {Array|String} A list consisting of the elements of `secondList`
+ * followed by the elements of `firstList`.
+ * @see {@link http://ramdajs.com/docs/#concat|R.concat}
+ * @example
+ *
+ * RA.concatRight('ABC', 'DEF'); //=> 'DEFABC'
+ * RA.concatRight([4, 5, 6], [1, 2, 3]); //=> [1, 2, 3, 4, 5, 6]
+ * RA.concatRight([], []); //=> []
+ */
+const concatRight = flip(concat);
+
+export default concatRight;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/copyKeys.js.html b/5.0.0/copyKeys.js.html new file mode 100644 index 0000000000..317c686527 --- /dev/null +++ b/5.0.0/copyKeys.js.html @@ -0,0 +1,104 @@ + + + + + copyKeys.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

copyKeys.js

+ + + + + + + +
+
+
import { curryN } from 'ramda';
+
+import renameKeys from './renameKeys.js';
+
+/**
+ * Creates a new object with the own properties of the provided object, and the
+ * keys copied according to the keysMap object as `{oldKey: newKey}`.
+ * When no key from the keysMap is found, then a shallow clone of an object is returned.
+ *
+ * Keep in mind that in the case of keys conflict is behaviour undefined and
+ * the result may vary between various JS engines!
+ *
+ * @func copyKeys
+ * @memberOf RA
+ * @category Object
+ * @sig {a: b} -> {a: *} -> {b: *}
+ * @param {!Object} keysMap
+ * @param {!Object} obj
+ * @return {!Object} New object with copied keys
+ * @see {@link RA.renameKeys|renameKeys}
+ * @example
+ *
+ * copyKeys({ a: 'b' }, { a: true }); //=> { a: true, b: true }
+ * copyKeys({ a: 'b' }, { a: true, b: false }); //=> { a: true, b: true }
+ */
+const copyKeys = curryN(2, (keysMap, obj) => ({
+  ...obj,
+  ...renameKeys(keysMap, obj),
+}));
+
+export default copyKeys;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/curryRight.js.html b/5.0.0/curryRight.js.html new file mode 100644 index 0000000000..004445bf65 --- /dev/null +++ b/5.0.0/curryRight.js.html @@ -0,0 +1,99 @@ + + + + + curryRight.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

curryRight.js

+ + + + + + + +
+
+
import { converge, length, identity } from 'ramda';
+
+import curryRightN from './curryRightN.js';
+
+/**
+ * Returns a curried equivalent of the provided function.
+ * This function is like curry, except that the provided arguments order is reversed.
+ *
+ * @func curryRight
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.12.0|v1.12.0}
+ * @category Function
+ * @sig (* -> a) -> (* -> a)
+ * @param {Function} fn The function to curry
+ * @return {Function}  A new, curried function
+ * @see {@link http://ramdajs.com/docs/#curry|R.curry}, {@link RA.curryRightN|curryRightN}
+ * @example
+ *
+ * const concatStrings = (a, b, c) => a + b + c;
+ * const concatStringsCurried = RA.curryRight(concatStrings);
+ *
+ * concatStringCurried('a')('b')('c'); // => 'cba'
+ */
+const curryRight = converge(curryRightN, [length, identity]);
+
+export default curryRight;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/curryRightN.js.html b/5.0.0/curryRightN.js.html new file mode 100644 index 0000000000..b3cfb30767 --- /dev/null +++ b/5.0.0/curryRightN.js.html @@ -0,0 +1,102 @@ + + + + + curryRightN.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

curryRightN.js

+ + + + + + + +
+
+
import { curryN, reverse } from 'ramda';
+
+/**
+ * Returns a curried equivalent of the provided function, with the specified arity.
+ * This function is like curryN, except that the provided arguments order is reversed.
+ *
+ * @func curryRightN
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.12.0|v1.12.0}
+ * @category Function
+ * @sig Number -> (* -> a) -> (* -> a)
+ * @param {number} length The arity for the returned function
+ * @param {Function} fn The function to curry
+ * @return {Function}  A new, curried function
+ * @see {@link http://ramdajs.com/docs/#curryN|R.curryN}, {@link RA.curryRight|curryRight}
+ * @example
+ *
+ * const concatStrings = (a, b, c) => a + b + c;
+ * const concatStringsCurried = RA.curryRightN(3, concatStrings);
+ *
+ * concatStringCurried('a')('b')('c'); // => 'cba'
+ */
+const curryRightN = curryN(2, (arity, fn) =>
+  curryN(arity, function wrapper(...args) {
+    return fn.apply(this, reverse(args));
+  })
+);
+
+export default curryRightN;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/defaultWhen.js.html b/5.0.0/defaultWhen.js.html new file mode 100644 index 0000000000..bf84f0b9ac --- /dev/null +++ b/5.0.0/defaultWhen.js.html @@ -0,0 +1,99 @@ + + + + + defaultWhen.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

defaultWhen.js

+ + + + + + + +
+
+
import { curry } from 'ramda';
+
+/**
+ * Returns the second argument if predicate function returns `true`,
+ * otherwise the third argument is returned.
+ *
+ * @func defaultWhen
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.2.0|v2.2.0}
+ * @category Logic
+ * @sig  (a -> Boolean) -> b -> a -> a | b
+ * @param {!function} predicate The predicate function
+ * @param {*} defaultVal The default value
+ * @param {*} val `val` will be returned instead of `defaultVal` if predicate returns false
+ * @return {*} The `val` if predicate returns `false`, otherwise the default value
+ * @see {@link http://ramdajs.com/docs/#defaultTo|R.defaultTo}
+ * @example
+ *
+ * RA.defaultWhen(RA.isNull, 1, null); // => 1
+ * RA.defaultWhen(RA.isNull, 1, 2); // => 2
+ */
+const defaultWhen = curry((predicate, defaultVal, val) =>
+  predicate(val) ? defaultVal : val
+);
+
+export default defaultWhen;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/delayP.js.html b/5.0.0/delayP.js.html new file mode 100644 index 0000000000..5ab6203fa6 --- /dev/null +++ b/5.0.0/delayP.js.html @@ -0,0 +1,118 @@ + + + + + delayP.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

delayP.js

+ + + + + + + +
+
+
import { curry, propOr, partial, nth } from 'ramda';
+
+import isNonNegative from './isNonNegative.js';
+import isInteger from './isInteger.js';
+
+/**
+ * Creates a promise which resolves/rejects after the specified milliseconds.
+ *
+ * @func delayP
+ * @memberOf RA
+ * @category Function
+ * @sig Number -> Promise Undefined
+ * @sig {timeout: Number, value: a} -> Promise a
+ * @param {number|Object} milliseconds number of milliseconds or options object
+ * @return {Promise} A Promise that is resolved/rejected with the given value (if provided) after the specified delay
+ * @example
+ *
+ * RA.delayP(200); //=> Promise(undefined)
+ * RA.delayP({ timeout: 1000, value: 'hello world' }); //=> Promise('hello world')
+ * RA.delayP.reject(100); //=> Promise(undefined)
+ * RA.delayP.reject({ timeout: 100, value: new Error('error') }); //=> Promise(Error('error'))
+ */
+
+const makeDelay = curry((settleFnPicker, opts) => {
+  let timeout;
+  let value;
+
+  if (isInteger(opts) && isNonNegative(opts)) {
+    timeout = opts;
+  } else {
+    timeout = propOr(0, 'timeout', opts);
+    value = propOr(value, 'value', opts);
+  }
+
+  return new Promise((...args) => {
+    const settleFn = settleFnPicker(args);
+
+    setTimeout(partial(settleFn, [value]), timeout);
+  });
+});
+
+const delayP = makeDelay(nth(0));
+delayP.reject = makeDelay(nth(1));
+
+export default delayP;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/dispatch.js.html b/5.0.0/dispatch.js.html new file mode 100644 index 0000000000..184a770c14 --- /dev/null +++ b/5.0.0/dispatch.js.html @@ -0,0 +1,147 @@ + + + + + dispatch.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

dispatch.js

+ + + + + + + +
+
+
import {
+  sort,
+  comparator,
+  prop,
+  pipe,
+  head,
+  curryN,
+  reduce,
+  reduced,
+  curry,
+  ifElse,
+} from 'ramda';
+
+/**
+ * Can be used as a way to compose multiple invokers together to form polymorphic functions,
+ * or functions that exhibit different behaviors based on their argument(s).
+ * Consumes dispatching functions and keep trying to invoke each in turn, until a non-nil value is returned.
+ *
+ * Accepts a list of dispatching functions and returns a new function.
+ * When invoked, this new function is applied to some arguments,
+ * each dispatching function is applied to those same arguments until one of the
+ * dispatching functions returns a non-nil value.
+ *
+ * @func dispatch
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.6.0|v2.6.0}
+ * @category Function
+ * @sig [((a, b, ...) -> x1), ((a, b, ...) -> x2), ...] -> x1 | x2 | ...
+ * @param {!Array} functions A list of functions
+ * @return {*|undefined} Returns the first not-nil value, or undefined if either an empty list is provided or none of the dispatching functions returns a non-nil value
+ * @see {@link RA.isNotNil}
+ * @example
+ *
+ * // returns first non-nil value
+ * const stubNil = () => null;
+ * const stubUndefined = () => undefined;
+ * const addOne = v => v + 1;
+ * const addTwo = v => v + 2;
+ *
+ * RA.dispatch([stubNil, stubUndefined, addOne, addTwo])(1); //=> 2
+ *
+ * // acts as a switch
+ * const fnSwitch = RA.dispatch([
+ *   R.ifElse(RA.isString, s => `${s}-join`, RA.stubUndefined),
+ *   R.ifElse(RA.isNumber, n => n + 1, RA.stubUndefined),
+ *   R.ifElse(RA.isDate, R.T, RA.stubUndefined),
+ * ]);
+ * fnSwitch(1); //=> 2
+ */
+import isNotNil from './isNotNil.js';
+import isNonEmptyArray from './isNonEmptyArray.js';
+import stubUndefined from './stubUndefined.js';
+
+const byArity = comparator((a, b) => a.length > b.length);
+
+const getMaxArity = pipe(sort(byArity), head, prop('length'));
+
+const iteratorFn = curry((args, accumulator, fn) => {
+  const result = fn(...args);
+
+  return isNotNil(result) ? reduced(result) : accumulator;
+});
+
+const dispatchImpl = (functions) => {
+  const arity = getMaxArity(functions);
+
+  return curryN(arity, (...args) =>
+    reduce(iteratorFn(args), undefined, functions)
+  );
+};
+
+const dispatch = ifElse(isNonEmptyArray, dispatchImpl, stubUndefined);
+
+export default dispatch;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/divideNum.js.html b/5.0.0/divideNum.js.html new file mode 100644 index 0000000000..c2a47c2469 --- /dev/null +++ b/5.0.0/divideNum.js.html @@ -0,0 +1,93 @@ + + + + + divideNum.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

divideNum.js

+ + + + + + + +
+
+
import { divide, flip } from 'ramda';
+
+/**
+ * Divides two numbers, where the second number is divided by the first number.
+ *
+ * @func divideNum
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.22.0|v2.22.0}
+ * @category Math
+ * @sig Number -> Number -> Number
+ * @param {number} divisor the number to divide by
+ * @param {number} dividend the number to divide
+ * @return {number} A number representing the quotient of dividing the dividend by the divisor
+ * @example
+ *
+ * RA.divideNum(2, 1); //=> 0.5
+ */
+const divideNum = flip(divide);
+
+export default divideNum;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/dropArgs.js.html b/5.0.0/dropArgs.js.html new file mode 100644 index 0000000000..d22588d721 --- /dev/null +++ b/5.0.0/dropArgs.js.html @@ -0,0 +1,96 @@ + + + + + dropArgs.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

dropArgs.js

+ + + + + + + +
+
+
import { nAry } from 'ramda';
+
+/**
+ * Accepts a function with any arity and returns a function with arity of zero.
+ * The returned function ignores any arguments supplied to it.
+ *
+ * @func dropArgs
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.10.0|v2.10.0}
+ * @category Logic
+ * @sig (...a -> b)-> () -> b
+ * @param {Function} fn The function with any arity
+ * @return {Function} Returns function with arity of zero
+ * @see {@link http://ramdajs.com/docs/#nAry|R.nAry}
+ * @example
+ *
+ * const fn = (a = 1, b = 2) => a + b;
+ *
+ * RA.dropArgs(fn)('ignore1', 'ignore2'); //=> 3
+ */
+const dropArgs = nAry(0);
+
+export default dropArgs;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/ensureArray.js.html b/5.0.0/ensureArray.js.html new file mode 100644 index 0000000000..8d2e7d71eb --- /dev/null +++ b/5.0.0/ensureArray.js.html @@ -0,0 +1,97 @@ + + + + + ensureArray.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

ensureArray.js

+ + + + + + + +
+
+
import { when, of } from 'ramda';
+
+import isNotArray from './isNotArray.js';
+
+/**
+ * Returns a singleton array containing the value provided.
+ * If value is already an array, it is returned as is.
+ *
+ * @func ensureArray
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.6.0|v2.6.0}
+ * @category List
+ * @sig a | [a] -> [a]
+ * @param {*|Array} val the value ensure as Array
+ * @return {Array}
+ * @see {@link http://ramdajs.com/docs/#of|R.of}
+ * @example
+ *
+ * RA.ensureArray(42); //=> [42]
+ * RA.ensureArray([42]); //=> [42]
+ */
+const ensureArray = when(isNotArray, of(Array));
+
+export default ensureArray;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/escapeRegExp.js.html b/5.0.0/escapeRegExp.js.html new file mode 100644 index 0000000000..d384b5344f --- /dev/null +++ b/5.0.0/escapeRegExp.js.html @@ -0,0 +1,95 @@ + + + + + escapeRegExp.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

escapeRegExp.js

+ + + + + + + +
+
+
import { when, replace } from 'ramda';
+
+import isString from './isString.js';
+
+/**
+ * Escapes the RegExp special characters.
+ *
+ * @func escapeRegExp
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.21.0|v2.21.0}
+ * @category String
+ * @sig String -> String
+ * @param {string} val the value to escape
+ * @return {string}
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#Escaping|MDN Regular Expressions Escaping}
+ * @example
+ *
+ * RA.escapeRegExp('[ramda-adjunct](https://github.com/char0n/ramda-adjunct)'); //=> '\[ramda\-adjunct\]\(https://github\.com/char0n/ramda\-adjunct\)'
+ */
+const escapeRegExp = when(isString, replace(/[.*+?^${}()|[\]\\-]/g, '\\$&'));
+
+export default escapeRegExp;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/fantasy-land_Identity.js.html b/5.0.0/fantasy-land_Identity.js.html new file mode 100644 index 0000000000..98ee25de0a --- /dev/null +++ b/5.0.0/fantasy-land_Identity.js.html @@ -0,0 +1,343 @@ + + + + + fantasy-land/Identity.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

fantasy-land/Identity.js

+ + + + + + + +
+
+
import { empty as emptyR } from 'ramda';
+
+import * as fl from './mapping.js';
+import {
+  applyTrait,
+  functorTrait,
+  setoidTrait,
+  semigroupTrait,
+  chainTrait,
+  ordTrait,
+} from './traits.js';
+
+/**
+ * The simplest {@link https://github.com/fantasyland/fantasy-land|fantasy-land}
+ * compatible monad which attaches no information to values.
+ *
+ * The Identity type is a very simple type that has no interesting side effects and
+ * is effectively just a container of some value. So why does it exist ?
+ * The Identity type is often used as the base monad of a monad
+ * transformer when no other behaviour is required.
+ *
+ * @memberOf RA
+ * @implements
+ * {@link https://github.com/fantasyland/fantasy-land#apply|Apply},
+ * {@link https://github.com/fantasyland/fantasy-land#applicative|Applicative},
+ * {@link https://github.com/fantasyland/fantasy-land#functor|Functor},
+ * {@link https://github.com/fantasyland/fantasy-land#setoid|Setoid},
+ * {@link https://github.com/fantasyland/fantasy-land#semigroup|Semigroup},
+ * {@link https://github.com/fantasyland/fantasy-land#chain|Chain},
+ * {@link https://github.com/fantasyland/fantasy-land#monad|Monad},
+ * {@link https://github.com/fantasyland/fantasy-land#ord|Ord},
+ * {@link https://github.com/fantasyland/fantasy-land#monoid|Monoid*},
+ * {@link https://github.com/fantasyland/fantasy-land#contravariant|Contravariant}
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.8.0|v1.8.0}
+ */
+class Identity {
+  /**
+   * Fantasy land {@link https://github.com/fantasyland/fantasy-land#applicative|Applicative} specification.
+   *
+   * @static
+   * @sig of :: Applicative f => a -> f a
+   * @param {*} value
+   * @returns {RA.Identity}
+   * @example
+   *
+   * const a = Identity.of(1); //=> Identity(1)
+   */
+  static [fl.of](value) {
+    return new Identity(value);
+  }
+
+  static of(value) {
+    return new Identity(value);
+  }
+
+  /**
+   * @static
+   */
+  static get ['@@type']() {
+    return 'RA/Identity';
+  }
+
+  /**
+   * Private constructor. Use {@link RA.Identity.of|Identity.of} instead.
+   *
+   * @param {*} value
+   * @return {RA.Identity}
+   */
+  constructor(value) {
+    this.value = value;
+  }
+
+  /**
+   * Catamorphism for a value.
+   * @returns {*}
+   * @example
+   *
+   * const a = Identity.of(1);
+   * a.get(); //=> 1
+   */
+  get() {
+    return this.value;
+  }
+
+  /**
+   * Fantasy land {@link https://github.com/fantasyland/fantasy-land#apply|Apply} specification.
+   *
+   * @sig ap :: Apply f => f a ~> f (a -> b) -> f b
+   * @param {RA.Identity} applyWithFn
+   * @return {RA.Identity}
+   * @example
+   *
+   * const a = Identity.of(1);
+   * const b = Identity.of(1).map(a => b => a + b);
+   *
+   * a.ap(b); //=> Identity(2)
+   */
+  [fl.ap](applyWithFn) {
+    return applyTrait[fl.ap].call(this, applyWithFn);
+  }
+
+  ap(applyWithFn) {
+    return this[fl.ap](applyWithFn);
+  }
+
+  /**
+   * Fantasy land {@link https://github.com/fantasyland/fantasy-land#functor|Functor} specification.
+   *
+   * @sig map :: Functor f => f a ~> (a -> b) -> f b
+   * @param {Function} fn
+   * @return {RA.Identity}
+   * @example
+   *
+   * const a = Identity.of(1);
+   * a.map(a => a + 1); //=> Identity(2)
+   */
+  [fl.map](fn) {
+    return functorTrait[fl.map].call(this, fn);
+  }
+
+  map(fn) {
+    return this[fl.map](fn);
+  }
+
+  /**
+   * Fantasy land {@link https://github.com/fantasyland/fantasy-land#setoid|Setoid} specification.
+   *
+   * @sig equals :: Setoid a => a ~> a -> Boolean
+   * @param {RA.Identity} setoid
+   * @return {boolean}
+   * @example
+   *
+   * const a = Identity.of(1);
+   * const b = Identity.of(1);
+   * const c = Identity.of(2);
+   *
+   * a.equals(b); //=> true
+   * a.equals(c); //=> false
+   */
+  [fl.equals](setoid) {
+    return setoidTrait[fl.equals].call(this, setoid);
+  }
+
+  equals(setoid) {
+    return this[fl.equals](setoid);
+  }
+
+  /**
+   * Fantasy land {@link https://github.com/fantasyland/fantasy-land#semigroup|Semigroup} specification.
+   *
+   * @sig concat :: Semigroup a => a ~> a -> a
+   * @param {RA.Identity} semigroup
+   * @return {RA.Identity}
+   * @example
+   *
+   * const a = Identity.of(1);
+   * const b = Identity.of(1);
+   * a.concat(b); //=> 2
+   *
+   * const c = Identity.of('c');
+   * const d = Identity.of('d');
+   * c.concat(d); //=> 'cd'
+   *
+   * const e = Identity.of(['e']);
+   * const f = Identity.of(['f']);
+   * e.concat(f); //=> ['e', 'f']
+   */
+  [fl.concat](semigroup) {
+    return semigroupTrait[fl.concat].call(this, semigroup);
+  }
+
+  concat(semigroup) {
+    return this[fl.concat](semigroup);
+  }
+
+  /**
+   * Fantasy land {@link https://github.com/fantasyland/fantasy-land#chain|Chain} specification.
+   *
+   * @sig chain :: Chain m => m a ~> (a -> m b) -> m b
+   * @param {Function} fn Function returning the value of the same {@link https://github.com/fantasyland/fantasy-land#semigroup|Chain}
+   * @return {RA.Identity}
+   * @example
+   *
+   * const a = Identity.of(1);
+   * const fn = val => Identity.of(val + 1);
+   *
+   * a.chain(fn).chain(fn); //=> Identity(3)
+   */
+  [fl.chain](fn) {
+    return chainTrait[fl.chain].call(this, fn);
+  }
+
+  chain(fn) {
+    return this[fl.chain](fn);
+  }
+
+  /**
+   * Fantasy land {@link https://github.com/fantasyland/fantasy-land#ord|Ord} specification.
+   *
+   * @sig lte :: Ord a => a ~> a -> Boolean
+   * @param {RA.Identity} ord
+   * @return {boolean}
+   * @example
+   *
+   * const a = Identity.of(1);
+   * const b = Identity.of(1);
+   * const c = Identity.of(2);
+   *
+   * a.lte(b); //=> true
+   * a.lte(c); //=> true
+   * c.lte(a); //=> false
+   */
+  [fl.lte](ord) {
+    return ordTrait[fl.lte].call(this, ord);
+  }
+
+  lte(ord) {
+    return this[fl.lte](ord);
+  }
+
+  /**
+   * Fantasy land {@link https://github.com/fantasyland/fantasy-land#monoid|Monoid*} specification.
+   * Partial implementation of Monoid specification. `empty` method on instance only, returning
+   * identity value of the wrapped type. Using `R.empty` under the hood.
+   *
+   *
+   * @sig empty :: Monoid m => () -> m
+   * @return {RA.Identity}
+   * @example
+   *
+   * const a = Identity.of('test');
+   * const i = a.empty();
+   *
+   * a.concat(i); //=> Identity('string');
+   * i.concat(a); //=> Identity('string');
+   */
+  [fl.empty]() {
+    return this.constructor.of(emptyR(this.value));
+  }
+
+  empty() {
+    return this[fl.empty]();
+  }
+
+  /**
+   * Fantasy land {@link https://github.com/fantasyland/fantasy-land#contravariant|Contravariant} specification.
+   *
+   * @sig contramap :: Contravariant f => f a ~> (b -> a) -> f b
+   * @param {Function} fn
+   * @return {RA.Identity}
+   * @example
+   *
+   * const identity = a => a;
+   * const add1 = a => a + 1;
+   * const divide2 = a => a / 2;
+   *
+   * Identity.of(divide2).contramap(add1).get()(3); //=> 2
+   * Identity.of(identity).contramap(divide2).contramap(add1).get()(3); //=> 2
+   * Identity.of(identity).contramap(a => divide2(add1(a))).get()(3); //=> 2
+   */
+  [fl.contramap](fn) {
+    return this.constructor.of((value) => this.value(fn(value)));
+  }
+
+  contramap(fn) {
+    return this[fl.contramap](fn);
+  }
+}
+
+export default Identity;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/filterIndexed.js.html b/5.0.0/filterIndexed.js.html new file mode 100644 index 0000000000..973f084b54 --- /dev/null +++ b/5.0.0/filterIndexed.js.html @@ -0,0 +1,101 @@ + + + + + filterIndexed.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

filterIndexed.js

+ + + + + + + +
+
+
import { addIndex, filter } from 'ramda';
+
+/**
+ * {@link http://ramdajs.com/docs/#filter|R.filter} function that more closely resembles `Array.prototype.filter`.
+ * It takes two new parameters to its callback function: the current index, and the entire list.
+ *
+ * `filterIndexed` implementation is simple: `
+ *  const filterIndexed = R.addIndex(R.filter);
+ * `
+ *
+ * @func filterIndexed
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.31.0|v2.31.0}
+ * @category List
+ * @typedef Idx = Number
+ * @sig Filterable f => ((a, Idx, f a) -> Boolean) -> f a -> f a
+ * @param {Function} pred The predicate function
+ * @param {Array} list The collection to filter
+ * @return {Array} Filterable
+ * @see {@link http://ramdajs.com/docs/#addIndex|R.addIndex}, {@link http://ramdajs.com/docs/#filter|R.filter}
+ * @example
+ *
+ * const isValueGtIndex = (val, idx) => val > idx;
+ * RA.filterIndexed(isValueGtIndex, [5, 4, 3, 2, 1, 0]); //=> [5, 4, 3]
+ */
+const filterIndexed = addIndex(filter);
+
+export default filterIndexed;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/findOr.js.html b/5.0.0/findOr.js.html new file mode 100644 index 0000000000..74a0e5106c --- /dev/null +++ b/5.0.0/findOr.js.html @@ -0,0 +1,103 @@ + + + + + findOr.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

findOr.js

+ + + + + + + +
+
+
import { pipe, curry, find, defaultTo } from 'ramda';
+
+/**
+ * Returns the first element of the list which matches the predicate.
+ * Returns default value if no element matches or matched element is `null`, `undefined` or `NaN`.
+ * Dispatches to the find method of the second argument, if present.
+ * Acts as a transducer if a transformer is given in list position.
+ *
+ * @func findOr
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.32.0|v2.32.0}
+ * @category List
+ * @sig  a -> (b -> Boolean) -> [b] -> b | a
+ * @param {*} defaultValue The default value
+ * @param {Function} fn The predicate function used to determine if the element is the desired one.
+ * @param {Array} list The array to consider.
+ * @return {*} The element found, or the default value.
+ * @see {@link http://ramdajs.com/docs/#defaultTo|R.defaultTo}, {@link http://ramdajs.com/docs/#find|R.find}
+ * @example
+ *
+ * RA.findOr(1, isUndefined, [1, 2, undefined]); // => 1
+ * RA.findOr(1, val => val === 2, [1, 2, undefined]); // => 2
+ * RA.findOr(1, val => val === 3, [1, 2, undefined]); // => 1
+ */
+
+const findOr = curry((defaultVal, fn, list) =>
+  pipe(find(fn), defaultTo(defaultVal))(list)
+);
+
+export default findOr;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/flattenDepth.js.html b/5.0.0/flattenDepth.js.html new file mode 100644 index 0000000000..dbc89e75d5 --- /dev/null +++ b/5.0.0/flattenDepth.js.html @@ -0,0 +1,112 @@ + + + + + flattenDepth.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

flattenDepth.js

+ + + + + + + +
+
+
import { curry } from 'ramda';
+
+import _makeFlat from './internal/makeFlat.js';
+
+const flatten1 = _makeFlat(false);
+
+/**
+ * Flattens the list to the specified depth.
+ *
+ * @func flattenDepth
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.19.0|v2.19.0}
+ * @category List
+ * @sig Number -> [a] -> [b]
+ * @param {!number} depth The maximum recursion depth
+ * @param {!Array} list The array to flatten
+ * @return {!Array} Returns the new flattened array
+ * @see {@link http://ramdajs.com/docs/#flatten|R.flatten}, {@link http://ramdajs.com/docs/#unnest|R.unnest}
+ * @example
+ *
+ * RA.flattenDepth(
+ *   2,
+ *   [1, [2], [3, [4, 5], 6, [[[7], 8]]], 9, 10]
+ * ); //=> [1, 2, 3, 4, 5, 6, [[7], 8], 9, 10];
+ */
+const flattenDepth = curry((depth, list) => {
+  let currentDept = depth;
+  let flatList = [...list];
+
+  while (currentDept > 0) {
+    flatList = flatten1(flatList);
+
+    currentDept -= 1;
+  }
+
+  return flatList;
+});
+
+export default flattenDepth;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/flattenPath.js.html b/5.0.0/flattenPath.js.html new file mode 100644 index 0000000000..fdfaced958 --- /dev/null +++ b/5.0.0/flattenPath.js.html @@ -0,0 +1,101 @@ + + + + + flattenPath.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

flattenPath.js

+ + + + + + + +
+
+
import { pathOr, curry, mergeRight } from 'ramda';
+
+/**
+ * Flattens a property path so that its fields are spread out into the provided object.
+ * It's like {@link RA.spreadPath|spreadPath}, but preserves object under the property path.
+ *
+ * @func flattenPath
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.19.0|v1.19.0}
+ * @category Object
+ * @typedef Idx = String | Int
+ * @sig [Idx] -> {k: v} -> {k: v}
+ * @param {!Array.<string|number>} path The property path to flatten
+ * @param {!Object} obj The provided object
+ * @return {!Object} The flattened object
+ * @see {@link RA.flattenProp|flattenProp}, {@link RA.spreadPath|spreadPath}
+ * @example
+ *
+ * RA.flattenPath(
+ *   ['b1', 'b2'],
+ *   { a: 1, b1: { b2: { c: 3, d: 4 } } }
+ * ); // => { a: 1, c: 3, d: 4, b1: { b2: { c: 3, d: 4 } } };
+ */
+const flattenPath = curry((path, obj) =>
+  mergeRight(obj, pathOr({}, path, obj))
+);
+
+export default flattenPath;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/flattenProp.js.html b/5.0.0/flattenProp.js.html new file mode 100644 index 0000000000..33a86bd39e --- /dev/null +++ b/5.0.0/flattenProp.js.html @@ -0,0 +1,101 @@ + + + + + flattenProp.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

flattenProp.js

+ + + + + + + +
+
+
import { of, curry } from 'ramda';
+
+import flattenPath from './flattenPath.js';
+
+/**
+ * Flattens a property so that its fields are spread out into the provided object.
+ * It's like {@link RA.spreadProp|spreadProp}, but preserves object under the property path.
+ *
+ * @func flattenProp
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.19.0|v1.19.0}
+ * @category Object
+ * @typedef Idx = String | Int
+ * @sig [Idx] -> {k: v} -> {k: v}
+ * @param {!string|number} prop The property to flatten
+ * @param {!Object} obj The provided object
+ * @return {!Object} The flattened object
+ * @see {@link RA.flattenPath|flattenPath}, {@link RA.spreadProp|spreadProp}
+ * @example
+ *
+ * RA.flattenProp(
+ *   'b',
+ *   { a: 1, b: { c: 3, d: 4 } }
+ * ); // => { a: 1, c: 3, d: 4, b: { c: 3, d: 4 } };
+ */
+const flattenProp = curry((prop, obj) => flattenPath(of(Array, prop), obj));
+
+export default flattenProp;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/floor.js.html b/5.0.0/floor.js.html new file mode 100644 index 0000000000..6b0247523c --- /dev/null +++ b/5.0.0/floor.js.html @@ -0,0 +1,100 @@ + + + + + floor.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

floor.js

+ + + + + + + +
+
+
import { bind, curryN } from 'ramda';
+
+/**
+ * Returns the largest integer less than or equal to a given number.
+ *
+ * Note: floor(null) returns integer 0 and do not give a NaN error.
+ *
+ * @func floor
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.15.0|v2.15.0}
+ * @category Math
+ * @sig Number -> Number
+ * @param {number} number The number to floor
+ * @return {number} A number representing the largest integer less than or equal to the specified number
+ * @example
+ *
+ * RA.floor(45.95); //=> 45
+ * RA.floor(45.05); //=> 45
+ * RA.floor(4); //=> 4
+ * RA.floor(-45.05); //=> -46
+ * RA.floor(-45.95); //=> -46
+ * RA.floor(null); //=> 0
+ */
+
+const floor = curryN(1, bind(Math.floor, Math));
+
+export default floor;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/fnull.js.html b/5.0.0/fnull.js.html new file mode 100644 index 0000000000..6e1741dbb4 --- /dev/null +++ b/5.0.0/fnull.js.html @@ -0,0 +1,111 @@ + + + + + fnull.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

fnull.js

+ + + + + + + +
+
+
import { isNil, curryN, curry, apply } from 'ramda';
+
+import defaultWhen from './defaultWhen.js';
+import mapIndexed from './mapIndexed.js';
+
+/**
+ * Returns a function which is called with the given arguments. If any of the given arguments are null or undefined,
+ * the corresponding default value for that argument is used instead.
+ *
+ * @func fnull
+ * @memberOf RA
+ * @category Function
+ * @sig (a ... -> b) -> [c] -> a ... | c -> b
+ * @param {Function} function to be executed
+ * @param {Array} defaults default arguments
+ * @return {Function} will apply provided arguments or default ones
+ * @example
+ *
+ * const addDefaults = RA.fnull((a, b) => a + b, [4, 5])
+ *
+ * addDefaults(1, 2); // => 3
+ * addDefaults(null, 2); // => 6
+ * addDefaults(2, null); // => 7
+ * addDefaults(undefined, undefined); // => 9
+ */
+
+const fnull = curry((fn, defaults) =>
+  curryN(fn.length, (...args) => {
+    const argsWithDefaults = mapIndexed(
+      (val, idx) => defaultWhen(isNil, defaults[idx], val),
+      args
+    );
+
+    return apply(fn, argsWithDefaults);
+  })
+);
+
+export default fnull;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/inRange.js.html b/5.0.0/inRange.js.html new file mode 100644 index 0000000000..a3bbcf6aed --- /dev/null +++ b/5.0.0/inRange.js.html @@ -0,0 +1,107 @@ + + + + + inRange.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

inRange.js

+ + + + + + + +
+
+
import { ifElse, curry, useWith, both, gte, lte, gt } from 'ramda';
+
+const inRangeImp = ifElse(
+  gte,
+  () => {
+    throw new Error(
+      'low must not be greater than high in inRange(low, high, value)'
+    );
+  },
+  useWith(both, [lte, gt])
+);
+
+/**
+ * Checks if `value` is between `low` and up to but not including `high`.
+ *
+ * @func inRange
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.7.0|v2.7.0}
+ * @category Relation
+ * @sig Number -> Number -> Number -> Boolean
+ * @param {number} low Start of the range
+ * @param {number} high The end of the range
+ * @param {number} value The value to test
+ * @return {boolean}
+ * @throws {Error} When `low` is greater than or equal to `high`
+ * @example
+ *
+ * RA.inRange(0, 5, 3); //=> true
+ * RA.inRange(0, 5, 0); //=> true
+ * RA.inRange(0, 5, 4); //=> true
+ * RA.inRange(0, 5, 5); //=> false
+ * RA.inRange(0, 5, -1); //=> false
+ */
+export default curry((low, high, value) => inRangeImp(low, high)(value));
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/included.js.html b/5.0.0/included.js.html new file mode 100644 index 0000000000..27ad5aa871 --- /dev/null +++ b/5.0.0/included.js.html @@ -0,0 +1,101 @@ + + + + + included.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

included.js

+ + + + + + + +
+
+
import { flip, includes } from 'ramda';
+
+/**
+ * Returns true if the specified value is equal, in R.equals terms,
+ * to at least one element of the given list or false otherwise.
+ * Given list can be a string.
+ *
+ * Like {@link http://ramdajs.com/docs/#includes|R.includes} but with argument order reversed.
+ *
+ * @func included
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/3.0.0|v3.0.0}
+ * @category List
+ * @sig [a] -> a -> Boolean
+ * @param {Array|String} list The list to consider
+ * @param {*} a The item to compare against
+ * @return {boolean} Returns Boolean `true` if an equivalent item is in the list or `false` otherwise
+ * @see {@link http://ramdajs.com/docs/#includes|R.includes}
+ * @example
+ *
+ * RA.included([1, 2, 3], 3); //=> true
+ * RA.included([1, 2, 3], 4); //=> false
+ * RA.included([{ name: 'Fred' }], { name: 'Fred' }); //=> true
+ * RA.included([[42]], [42]); //=> true
+ */
+const included = flip(includes);
+
+export default included;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/index.html b/5.0.0/index.html new file mode 100644 index 0000000000..e1356f2e73 --- /dev/null +++ b/5.0.0/index.html @@ -0,0 +1,274 @@ + + + + + Ramda Adjunct 5.0.0 - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

Ramda Adjunct 5.0.0

+ + + + + + + + + + + + + + + + + + + +
+

Node.js workflow +codecov +jsdoc +npmversion +npm + +Dependabot enabled +startwithwhy +contributions welcome +try on RunKit +FOSSA Status +Backers on Open Collective +Sponsors on Open Collective +Join the chat at https://gitter.im/ramda-adjunct/Lobby +Open Source Helpers +Tidelift

+

Ramda Adjunct Tweet

+

+

Ramda Adjunct is the most popular and most comprehensive set of functional utilities for use with Ramda, providing a variety of useful, well tested functions with excellent documentation.

+

For a full list of functions see the Documentation For The Latest Release.

+

Adjunct is a thing added to something else as a supplementary rather than an essential part. And that something is being ramda.

+

Follow Ramda Adjunct on medium.com/ramda-adjunct to read latest news and +articles about the library.

+ + + + + +
+ Tidelift + + + Get professionally supported ramda-adjunct with Tidelift Subscription. + +
+

Getting Started

+

Installation

+
npm i ramda-adjunct
+
+

or

+
yarn add ramda-adjunct
+
+

Usage

+

ES6

+
import * as RA from 'ramda-adjunct'
+
+RA.isArray([]);
+
+

or

+
import { isArray } from 'ramda-adjunct';
+
+isArray([]);
+
+

Node

+
const RA = require('ramda-adjunct');
+
+RA.isArray([]);
+
+

or

+
const { isArray } = require('ramda-adjunct');
+
+isArray([]);
+
+

Web browser

+
<script src="ramda.js"></script>
+<script src="RA.web.js"></script>
+
+

or

+
<script src="RA.web.standalone.js"></script>
+
+

Including Ramda Adjunct into HTML document exposes global variable RA on window object.

+
RA.isArray([]);
+
+

Motivation

+

It's very common for people to create their own utils and recipes by composing Ramda's functions and creating more complex aggregate functions. Ramda Adjunct eliminates this repetitive wheel of reinvention and centralizes commonly used and useful utils.

+

Benefits

+

1. Centralization

+

All Ramda recipes and aggregate utils not present in Ramda are centralized here. There is no more need for everybody to create their own utils in their own libraries or in each codebases.

+

2. Tests

+

Ramda Adjunct maintains maximal code coverage and mimics Ramda's test patterns. You can trust our functions.

+

3. Impeccable documentation

+

You cannot call a library great if it lacks great documentation. Ramda Adjunct generates its documentation directly from its codebase and uses patterns found in both Ramda and Lodash to document its API.

+

Do you want to find out more about why this library exists ? Read this article.

+

Requirements

+
    +
  • ramda >= 0.30.0
  • +
  • node >= 0.10.48
  • +
+

Ramda Adjunct is being automatically tested against all LTS and Current Node.js versions.

+

Legacy builds

+

We are building our npm distributions using Webpack/Babel to support legacy versions of node starting from 0.10.48. +Although all tests are run against all LTS and Current Node.js versions, we rely on Webpack/Babel to transpile ramda-adjunct into legacy ES5. +It is also possible that our ES5 distributions run on node versions older than 0.10.48 as long as they support ES5.

+

API Documentation

+

LATEST, +PREVIOUS, +ALL VERSIONS

+

Wrote about us

+ +

Contributing

+

If you want to contribute to this project, please consult the CONTRIBUTING.md guidelines.

+

Obtaining project copy

+
 $ git clone https://github.com/char0n/ramda-adjunct
+ $ npm i
+
+

Running tests

+
 $ npm run test
+
+

Running tests in browser

+
 $ npm run test:web
+
+

Running compatibility tests for supported ramda versions

+
 $ npm run test:ramda
+
+

Running code coverage numbers

+
 $ npm run coverage
+
+

Running linter

+

We're using eslint and airbnb codestyle rules with prettier integrated as an eslint plugin.

+
 $ npm run lint
+
+

Builds

+
 $ npm run build:es
+
+

If you use a bundler that supports tree shaking and ES2015 imports. package.json is automatically pre-configured to tell ES2015 import to import from this directory.

+

es/* - ES5 code containing ES2015 imports.

+
 $ npm run build:commonjs
+
+

If you use node to import ramda-adjunct. package.json is automatically pre-configured to tell require to import from this directory.

+

lib/* - ES5 code containing commonjs imports.

+
 $ npm run build:umd
+
+

The command will create three types of bundles.

+

dist/RA.node.js - ES5 compliant bundle, running on all node versions.

+

dist/RA.web.js - ES5 compliant bundle, running in browsers. Requires ramda.js to be required before.

+

dist/RA.web.standalone.js - ES5 compliant bundle, running in browsers. It has ramda.js pre-bundled.

+

You can always find fresh build files in exposed as artifacts of GitHub Actions.

+

Tree shaking support

+

Tree shaking is a term commonly used in a JavaScript context for dead-code elimination. It relies on the static structure of ES2015's module syntax, i.e. import and export. Ramda Adjunct natively supports tree shaking thanks to the way the code is organized and its use of ES2015 imports.

+
  import * as RA from 'ramda-adjunct';
+
+  RA.isArray([]); //=> true
+
+
  import { isArray } from 'ramda-adjunct';
+
+  isArray([]); //=> true
+
+

These two statements are equivalent and only isArray should be incorporated into your bundle. You can pick and choose the functions you need without worrying about the whole library being included in your build.

+

Assimilated libraries

+
    +
  • rcb - Ramda Cookbook implementation
  • +
+

Typescript support

+

Although Ramda Adjunct is written in ES2016, we also support Typescript. When Ramda Adjunct gets imported into a Typescript project, typings are automatically imported and used.

+

Author

+

char0n (Vladimir Gorej)

+

vladimir.gorej@gmail.com

+

https://www.linkedin.com/in/vladimirgorej/

+

Contributors

+

This project exists thanks to all the people who contribute. [Contribute]. +

+

Support us

+

Although we love working on ramda-adjunct, we must invest our free time to make this library great. Support this project's evolution via Open Collective or Github Sponsors.

+

Support via Open Collective

+

Backers

+

Thank you to all our backers! 🙏 [Become a backer]

+

+

Sponsors

+

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]

+

+

License

+

FOSSA Status

+
+ + + + + + +
+ +
+ + + + + + + \ No newline at end of file diff --git a/5.0.0/index.js.html b/5.0.0/index.js.html new file mode 100644 index 0000000000..4a79febfb0 --- /dev/null +++ b/5.0.0/index.js.html @@ -0,0 +1,314 @@ + + + + + index.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

index.js

+ + + + + + + +
+
+
/**
+ * @namespace RA
+ */
+
+// Type
+export { default as isNotUndefined } from './isNotUndefined.js';
+export { default as isUndefined } from './isUndefined.js';
+export { default as isNull } from './isNull.js';
+export { default as isNotNull } from './isNotNull.js';
+export { default as isNotNil } from './isNotNil.js';
+export { default as isArray } from './isArray.js';
+export { default as isIterable } from './isIterable.js';
+export { default as isEmptyArray } from './isEmptyArray.js';
+export { default as isNotArray } from './isNotArray.js';
+export { default as isNonEmptyArray } from './isNonEmptyArray.js';
+export { default as isBoolean } from './isBoolean.js';
+export { default as isNotBoolean } from './isNotBoolean.js';
+export { default as isNilOrEmpty } from './isNilOrEmpty.js';
+export { default as isString } from './isString.js';
+export { default as isEmptyString } from './isEmptyString.js';
+export { default as isNotString } from './isNotString.js';
+export { default as isNonEmptyString } from './isNonEmptyString.js';
+export { default as isArrayLike } from './isArrayLike.js';
+export { default as isNotArrayLike } from './isNotArrayLike.js';
+export { default as isGeneratorFunction } from './isGeneratorFunction.js';
+export { default as isNotGeneratorFunction } from './isNotGeneratorFunction.js';
+export { default as isAsyncFunction } from './isAsyncFunction.js';
+export { default as isNotAsyncFunction } from './isNotAsyncFunction.js';
+export { default as isFunction } from './isFunction.js';
+export { default as isNotFunction } from './isNotFunction.js';
+export { default as isObj } from './isObj.js';
+export { default as isObject } from './isObj.js'; // alias of isObj
+export { default as isNotObj } from './isNotObj.js';
+export { default as isNotObject } from './isNotObj.js'; // alias of isNotObj
+export { default as isObjLike } from './isObjLike.js';
+export { default as isObjectLike } from './isObjLike.js'; // alias of isObjLike
+export { default as isNotObjLike } from './isNotObjLike.js';
+export { default as isNotObjectLike } from './isNotObjLike.js'; // alias of isNotObjLike
+export { default as isPlainObj } from './isPlainObj.js';
+export { default as isPlainObject } from './isPlainObj.js';
+export { default as isNotPlainObj } from './isNotPlainObj.js';
+export { default as isNotPlainObject } from './isNotPlainObj.js'; // alias of isNotPlainObj
+export { default as isDate } from './isDate.js';
+export { default as isNotDate } from './isNotDate.js';
+export { default as isValidDate } from './isValidDate.js';
+export { default as isNotValidDate } from './isNotValidDate.js';
+export { default as isInvalidDate } from './isNotValidDate.js'; // alias of isNotValidDate
+export { default as isNumber } from './isNumber.js';
+export { default as isNotNumber } from './isNotNumber.js';
+export { default as isPositive } from './isPositive.js';
+export { default as isNegative } from './isNegative.js';
+export { default as isPositiveZero } from './isPositiveZero.js';
+export { default as isNegativeZero } from './isNegativeZero.js';
+export { default as isNotNilOrEmpty } from './isNotNilOrEmpty.js';
+export { default as isNonPositive } from './isNonPositive.js';
+export { default as isNonNegative } from './isNonNegative.js';
+export { default as isMap } from './isMap.js';
+export { default as isNotMap } from './isNotMap.js';
+export { default as isNaN } from './isNaN.js';
+export { default as isNotNaN } from './isNotNaN.js';
+export { default as isFinite } from './isFinite.js';
+export { default as isNotFinite } from './isNotFinite.js';
+export { default as isInteger } from './isInteger.js';
+export { default as isInteger32 } from './isInteger32.js';
+export { default as isInt32 } from './isInteger32.js'; // alias of isInteger32
+export { default as isUinteger32 } from './isUinteger32.js';
+export { default as isUint32 } from './isUinteger32.js'; // alias of isUinteger32
+export { default as isNotInteger } from './isNotInteger.js';
+export { default as isBigInt } from './isBigInt.js';
+export { default as isFloat } from './isFloat.js';
+export { default as isNotFloat } from './isNotFloat.js';
+export { default as isValidNumber } from './isValidNumber.js';
+export { default as isNotValidNumber } from './isNotValidNumber.js';
+export { default as isOdd } from './isOdd.js';
+export { default as isEven } from './isEven.js';
+export { default as isPair } from './isPair.js';
+export { default as isNotPair } from './isNotPair.js';
+export { default as isThenable } from './isThenable.js';
+export { default as isPromise } from './isPromise.js';
+export { default as isTrue } from './isTrue.js';
+export { default as isFalse } from './isFalse.js';
+export { default as isTruthy } from './isTruthy.js';
+export { default as isFalsy } from './isFalsy.js';
+export { default as isRegExp } from './isRegExp.js';
+export { default as isNotRegExp } from './isNotRegExp.js';
+export { default as isSet } from './isSet.js';
+export { default as isNotSet } from './isNotSet.js';
+export { default as isSparseArray } from './isSparseArray.js';
+export { default as isSymbol } from './isSymbol.js';
+export { default as isSafeInteger } from './isSafeInteger.js';
+export { default as isIndexed } from './isIndexed.js';
+export { default as isError } from './isError.js';
+export { default as isNaturalNumber } from './isNaturalNumber.js';
+export { default as isPrimitive } from './isPrimitive.js';
+export { default as isNotPrimitive } from './isNotPrimitive.js';
+export { default as isSentinelValue } from './isSentinelValue.js';
+export { default as isBlank } from './isBlank.js';
+// Function
+export { default as stubUndefined } from './stubUndefined.js';
+export { default as stubNull } from './stubNull.js';
+export { default as stubObj } from './stubObj.js';
+export { default as stubObject } from './stubObj.js';
+export { default as stubString } from './stubString.js';
+export { default as stubArray } from './stubArray.js';
+export { default as noop } from './noop.js';
+export { default as liftFN } from './liftFN.js';
+export { default as liftF } from './liftF.js';
+export { default as cata } from './cata.js';
+export { default as weave } from './weave.js';
+export { default as weaveLazy } from './weaveLazy.js';
+export { default as curryRightN } from './curryRightN.js';
+export { default as curryRight } from './curryRight.js';
+export { default as allP } from './allP.js';
+export { default as catchP } from './catchP.js';
+export { default as noneP } from './noneP.js';
+export { default as resolveP } from './resolveP.js';
+export { default as rejectP } from './rejectP.js';
+export { default as delayP } from './delayP.js';
+export { default as thenCatchP } from './thenCatchP.js';
+export { default as allSettledP } from './allSettledP.js';
+export { default as Y } from './Y.js';
+export { default as seq } from './seq.js';
+export { default as sequencing } from './seq.js';
+export { default as dispatch } from './dispatch.js';
+export { default as async } from './async.js';
+export { default as anyP } from './anyP.js';
+export { default as firstP } from './anyP.js'; // alias of anyP
+export { default as lastP } from './lastP.js';
+export { default as fnull } from './fnull.js';
+// List
+export { default as mapIndexed } from './mapIndexed.js';
+export { default as reduceIndexed } from './reduceIndexed.js';
+export { default as filterIndexed } from './filterIndexed.js';
+export { default as pickIndexes } from './pickIndexes.js';
+export { default as list } from './list.js';
+export { default as ensureArray } from './ensureArray.js';
+export { default as concatAll } from './concatAll.js';
+export { default as concatRight } from './concatRight.js';
+export { default as reduceP } from './reduceP.js';
+export { default as reduceRightP } from './reduceRightP.js';
+export { default as sliceFrom } from './sliceFrom.js';
+export { default as sliceTo } from './sliceTo.js';
+export { default as omitIndexes } from './omitIndexes.js';
+export { default as compact } from './compact.js';
+export { default as appendFlipped } from './appendFlipped.js';
+export { default as included } from './included.js';
+export { default as move } from './move.js';
+export { default as lengthGt } from './lengthGt.js';
+export { default as lengthLt } from './lengthLt.js';
+export { default as lengthGte } from './lengthGte.js';
+export { default as lengthLte } from './lengthLte.js';
+export { default as lengthEq } from './lengthEq.js';
+export { default as lengthNotEq } from './lengthNotEq.js';
+export { default as allEqual } from './allEqual.js';
+export { default as repeatStr } from './repeatStr.js';
+export { default as allIdentical } from './allIdentical.js';
+export { default as allIdenticalTo } from './allIdenticalTo.js';
+export { default as allEqualTo } from './allEqualTo.js';
+export { default as flattenDepth } from './flattenDepth.js';
+export { default as toArray } from './toArray.js';
+export { default as allUnique } from './allUnique.js';
+export { default as notAllUnique } from './notAllUnique.js';
+export { default as sortByProps } from './sortByProps.js';
+export { default as sortByProp } from './sortByProp.js';
+export { default as sortByPaths } from './sortByPaths.js';
+export { default as skipTake } from './skipTake.js';
+export { default as rangeStep } from './rangeStep.js';
+export { default as findOr } from './findOr.js';
+// Object
+export { default as invoke } from './invoke.js';
+export { default as invokeArgs } from './invokeArgs.js';
+export { default as paths } from './paths.js';
+export { default as renameKey } from './renameKey.js';
+export { default as renameKeys } from './renameKeys.js';
+export { default as renameKeysWith } from './renameKeysWith.js';
+export { default as renameKeyWith } from './renameKeyWith.js';
+export { default as copyKeys } from './copyKeys.js';
+export { default as mergeProps } from './mergeProps.js';
+export { default as mergePaths } from './mergePaths.js';
+export { default as mergeProp } from './mergeProp.js';
+export { default as mergePath } from './mergePath.js';
+export { default as omitBy } from './omitBy.js';
+export { default as pathOrLazy } from './pathOrLazy.js';
+export { default as viewOr } from './viewOr.js';
+export { default as spreadProp } from './spreadProp.js';
+export { default as spreadPath } from './spreadPath.js';
+export { default as flattenProp } from './flattenProp.js';
+export { default as flattenPath } from './flattenPath.js';
+export { default as unzipObjWith } from './unzipObjWith.js';
+export { default as zipObjWith } from './zipObjWith.js';
+export { default as isPrototypeOf } from './isPrototypeOf.js';
+// Relation
+export { default as lensEq } from './lensEq.js';
+export { default as lensNotEq } from './lensNotEq.js';
+export { default as lensSatisfies } from './lensSatisfies.js';
+export { default as lensNotSatisfy } from './lensNotSatisfy.js';
+export { default as lensTraverse } from './lensTraverse.js';
+export { default as lensIso } from './lensIso.js';
+export { default as propNotEq } from './propNotEq.js';
+export { default as pathNotEq } from './pathNotEq.js';
+export { default as inRange } from './inRange.js';
+export { default as notEqual } from './notEqual.js';
+export { default as overlaps } from './overlaps.js';
+// Logic
+export { default as defaultWhen } from './defaultWhen.js';
+export { default as notBoth } from './notBoth.js';
+export { default as nand } from './nand.js';
+export { default as neither } from './neither.js';
+export { default as nor } from './nor.js';
+export { default as notAllPass } from './notAllPass.js';
+export { default as nonePass } from './nonePass.js';
+export { default as argsPass } from './argsPass.js';
+export { default as dropArgs } from './dropArgs.js';
+// Math
+export { default as round } from './round.js';
+export { default as ceil } from './ceil.js';
+export { default as divideNum } from './divideNum.js';
+export { default as floor } from './floor.js';
+export { default as trunc } from './trunc.js';
+export { default as sign } from './sign.js';
+export { default as subtractNum } from './subtractNum.js';
+export { default as toInteger32 } from './toInteger32.js';
+export { default as toInt32 } from './toInteger32.js'; // alias of toInteger32
+export { default as toUinteger32 } from './toUinteger32.js';
+export { default as toUint32 } from './toUinteger32.js'; // alias of to toUinteger32
+export { default as toNumber } from './toNumber.js';
+// String
+export { default as replaceAll } from './replaceAll.js';
+export { default as escapeRegExp } from './escapeRegExp.js';
+export { default as trimStart } from './trimStart.js';
+export { default as trimLeft } from './trimStart.js'; // alias of trimStart
+export { default as trimEnd } from './trimEnd.js';
+export { default as trimRight } from './trimEnd.js'; // alias of trimEnd
+export { default as trimCharsEnd } from './trimCharsEnd.js';
+export { default as trimCharsStart } from './trimCharsStart.js';
+export { default as padCharsStart } from './padCharsStart.js';
+export { default as padCharsEnd } from './padCharsEnd.js';
+export { default as padEnd } from './padEnd.js';
+export { default as padStart } from './padStart.js';
+// Types
+export { default as Identity } from './fantasy-land/Identity.js';
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/internal_makeFlat.js.html b/5.0.0/internal_makeFlat.js.html new file mode 100644 index 0000000000..0f4c79b4ca --- /dev/null +++ b/5.0.0/internal_makeFlat.js.html @@ -0,0 +1,115 @@ + + + + + internal/makeFlat.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

internal/makeFlat.js

+ + + + + + + +
+
+
import isArrayLike from '../isArrayLike.js';
+
+/**
+ * `makeFlat` is a helper function that returns a one-level or fully recursive
+ * function based on the flag passed in.
+ *
+ * @func makeFlat
+ * @memberOf RA
+ *
+ * @category List
+ * @param {!bool} = should recursively flatten
+ * @param {!Array} = the nested list to be flattened
+ * @return {!Array} = the flattened list
+ * @sig Bool -> List -> List
+ *
+ */
+const makeFlat = (recursive) =>
+  function flatt(list) {
+    let value;
+    let jlen;
+    let j;
+    const result = [];
+    let idx = 0;
+
+    while (idx < list.length) {
+      if (isArrayLike(list[idx])) {
+        value = recursive ? flatt(list[idx]) : list[idx];
+        j = 0;
+        jlen = value.length;
+        while (j < jlen) {
+          result[result.length] = value[j];
+          j += 1;
+        }
+      } else {
+        result[result.length] = list[idx];
+      }
+      idx += 1;
+    }
+    return result;
+  };
+
+export default makeFlat;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/invoke.js.html b/5.0.0/invoke.js.html new file mode 100644 index 0000000000..7bdaac455c --- /dev/null +++ b/5.0.0/invoke.js.html @@ -0,0 +1,95 @@ + + + + + invoke.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

invoke.js

+ + + + + + + +
+
+
import { __ } from 'ramda';
+
+import invokeArgs from './invokeArgs.js';
+
+/**
+ * Invokes the method at path of object.
+ *
+ * @func invoke
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.31.0|v2.31.0}
+ * @category Object
+ * @sig Array -> Object -> *
+ * @param {Array.<string|number>} path The path of the method to invoke
+ * @param {Object} obj The object to query
+ * @return {*}
+ * @example
+ *
+ * RA.invoke(['random'], Math); //=> 0.5113253820009047
+ */
+const invoke = invokeArgs(__, [], __);
+
+export default invoke;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/invokeArgs.js.html b/5.0.0/invokeArgs.js.html new file mode 100644 index 0000000000..b861025dcc --- /dev/null +++ b/5.0.0/invokeArgs.js.html @@ -0,0 +1,109 @@ + + + + + invokeArgs.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

invokeArgs.js

+ + + + + + + +
+
+
import { curryN, path, apply, init, bind } from 'ramda';
+
+import isNotFunction from './isNotFunction.js';
+import isEmptyArray from './isEmptyArray.js';
+
+/**
+ * Invokes the method at path of object with given arguments.
+ *
+ * @func invokeArgs
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.27.0|v2.27.0}
+ * @category Object
+ * @sig Array -> Array -> Object -> *
+ * @param {Array.<string|number>} path The path of the method to invoke
+ * @param {Array} args The arguments to invoke the method with
+ * @param {Object} obj The object to query
+ * @return {*}
+ * @example
+ *
+ * RA.invokeArgs(['abs'], [-1], Math); //=> 1
+ * RA.invokeArgs(['path', 'to', 'non-existent', 'method'], [-1], Math); //=> undefined
+ */
+
+const invokeArgs = curryN(3, (mpath, args, obj) => {
+  const method = path(mpath, obj);
+  const context = path(init(mpath), obj);
+
+  if (isNotFunction(method)) return undefined;
+  if (isEmptyArray(mpath)) return undefined;
+
+  const boundMethod = bind(method, context);
+
+  return apply(boundMethod, args);
+});
+
+export default invokeArgs;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isArray.js.html b/5.0.0/isArray.js.html new file mode 100644 index 0000000000..cbe20d8645 --- /dev/null +++ b/5.0.0/isArray.js.html @@ -0,0 +1,100 @@ + + + + + isArray.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isArray.js

+ + + + + + + +
+
+
import { curryN, pipe, type, identical } from 'ramda';
+
+import isFunction from './isFunction.js';
+
+/**
+ * Checks if input value is `Array`.
+ *
+ * @func isArray
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/0.3.0|v0.3.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isNotArray|isNotArray}
+ * @example
+ *
+ * RA.isArray([]); //=> true
+ * RA.isArray(null); //=> false
+ * RA.isArray({}); //=> false
+ */
+const isArray = curryN(
+  1,
+  isFunction(Array.isArray) ? Array.isArray : pipe(type, identical('Array'))
+);
+
+export default isArray;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isArrayLike.js.html b/5.0.0/isArrayLike.js.html new file mode 100644 index 0000000000..7d66852ffa --- /dev/null +++ b/5.0.0/isArrayLike.js.html @@ -0,0 +1,152 @@ + + + + + isArrayLike.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isArrayLike.js

+ + + + + + + +
+
+
import { has, curryN } from 'ramda';
+
+import isArray from './isArray.js';
+import isString from './isString.js';
+
+/* eslint-disable max-len */
+/**
+ * Tests whether or not an object is similar to an array.
+ *
+ * @func isArrayLike
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.9.0|v1.9.0}
+ * @licence https://github.com/ramda/ramda/blob/master/LICENSE.txt
+ * @category List
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @returns {boolean} `true` if `val` has a numeric length property and extreme indices defined; `false` otherwise.
+ * @see {@link RA.isNotArrayLike|isNotArrayLike}
+
+ * @example
+ *
+ * RA.isArrayLike([]); //=> true
+ * RA.isArrayLike(true); //=> false
+ * RA.isArrayLike({}); //=> false
+ * RA.isArrayLike({length: 10}); //=> false
+ * RA.isArrayLike({0: 'zero', 9: 'nine', length: 10}); //=> true
+ */
+/* eslint-enable max-len */
+const isArrayLike = curryN(1, (val) => {
+  if (isArray(val)) {
+    return true;
+  }
+  if (!val) {
+    return false;
+  }
+  if (isString(val)) {
+    return false;
+  }
+  if (typeof val !== 'object') {
+    return false;
+  }
+  if (val.nodeType === 1) {
+    return !!val.length;
+  }
+  if (val.length === 0) {
+    return true;
+  }
+  if (val.length > 0) {
+    return has(0, val) && has(val.length - 1, val);
+  }
+  return false;
+});
+
+export default isArrayLike;
+
+/**
+ The MIT License (MIT)
+
+ Copyright (c) 2013-2016 Scott Sauyet and Michael Hurley
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+*/
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isAsyncFunction.js.html b/5.0.0/isAsyncFunction.js.html new file mode 100644 index 0000000000..2d17163700 --- /dev/null +++ b/5.0.0/isAsyncFunction.js.html @@ -0,0 +1,96 @@ + + + + + isAsyncFunction.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isAsyncFunction.js

+ + + + + + + +
+
+
import { pipe, type, identical, curryN } from 'ramda';
+
+/**
+ * Checks if input value is `Async Function`.
+ *
+ * @func isAsyncFunction
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/0.5.0|v0.5.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isFunction|isFunction}, {@link RA.isNotAsyncFunction|isNotAsyncFunction}, {@link RA.isGeneratorFunction|isGeneratorFunction}
+ * @example
+ *
+ * RA.isAsyncFunction(async function test() { }); //=> true
+ * RA.isAsyncFunction(null); //=> false
+ * RA.isAsyncFunction(function test() { }); //=> false
+ * RA.isAsyncFunction(() => {}); //=> false
+ */
+const isAsyncFunction = curryN(1, pipe(type, identical('AsyncFunction')));
+
+export default isAsyncFunction;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isBigInt.js.html b/5.0.0/isBigInt.js.html new file mode 100644 index 0000000000..309bb3d015 --- /dev/null +++ b/5.0.0/isBigInt.js.html @@ -0,0 +1,97 @@ + + + + + isBigInt.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isBigInt.js

+ + + + + + + +
+
+
import { type, pipe, identical, curryN } from 'ramda';
+
+/**
+ * Checks if value is a BigInt.
+ *
+ * @func isBigInt
+ * @memberOf RA
+ * @category Type
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.27.0|v2.27.0}
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @example
+ *
+ * RA.isBigInt(5); // => false
+ * RA.isBigInt(Number.MAX_VALUE); // => false
+ * RA.isBigInt(-Infinity); // => false
+ * RA.isBigInt(10); // => false
+ * RA.isBigInt(10n); // => true
+ * RA.isBigInt(BitInt(9007199254740991)); // => true
+ */
+const isBigInt = curryN(1, pipe(type, identical('BigInt')));
+
+export default isBigInt;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isBlank.js.html b/5.0.0/isBlank.js.html new file mode 100644 index 0000000000..00dfd65cf3 --- /dev/null +++ b/5.0.0/isBlank.js.html @@ -0,0 +1,106 @@ + + + + + isBlank.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isBlank.js

+ + + + + + + +
+
+
import { isEmpty, isNil, anyPass, test } from 'ramda';
+
+import isFalse from './isFalse.js';
+/**
+ * Returns `true` if the given value is its type's empty value, `false`, `undefined`
+ * as well as strings containing only whitespace characters; `false` otherwise.
+ *
+ * @func isBlank
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/3.1.0|v3.1.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link https://blog.appsignal.com/2018/09/11/differences-between-nil-empty-blank-and-present.html|Differences Between #nil?, #empty?, #blank?, and #present?}
+ * @example
+ *
+ * RA.isBlank(''); //=> true
+ * RA.isBlank('   '); //=> true
+ * RA.isBlank('\t\n'); //=> true
+ * RA.isBlank({}); //=> true
+ * RA.isBlank(null); //=> true
+ * RA.isBlank(undefined); //=> true
+ * RA.isBlank([]); //=> true
+ * RA.isBlank(false); //=> true
+ * RA.isBlank('value'); //=> false
+ * RA.isBlank({ foo: 'foo' }); //=> false
+ * RA.isBlank([1, 2, 3]); //=> false
+ * RA.isBlank(true); //=> false
+ */
+const isBlank = anyPass([isFalse, isNil, isEmpty, test(/^\s+$/gm)]);
+
+export default isBlank;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isBoolean.js.html b/5.0.0/isBoolean.js.html new file mode 100644 index 0000000000..e79ff7155e --- /dev/null +++ b/5.0.0/isBoolean.js.html @@ -0,0 +1,95 @@ + + + + + isBoolean.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isBoolean.js

+ + + + + + + +
+
+
import { type, identical, pipe, curryN } from 'ramda';
+
+/**
+ * Checks if input value is `Boolean`.
+ *
+ * @func isBoolean
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/0.3.0|v0.3.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isNotBoolean|isNotBoolean}
+ * @example
+ *
+ * RA.isBoolean(false); //=> true
+ * RA.isBoolean(true); //=> true
+ * RA.isBoolean(null); //=> false
+ */
+const isBoolean = curryN(1, pipe(type, identical('Boolean')));
+
+export default isBoolean;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isDate.js.html b/5.0.0/isDate.js.html new file mode 100644 index 0000000000..d18e77e2cf --- /dev/null +++ b/5.0.0/isDate.js.html @@ -0,0 +1,94 @@ + + + + + isDate.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isDate.js

+ + + + + + + +
+
+
import { type, identical, pipe, curryN } from 'ramda';
+
+/**
+ * Checks if value is `Date` object.
+ *
+ * @func isDate
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/0.6.0|v0.6.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isNotDate|isNotDate}, {@link RA.isValidDate|isValidDate}, {@link RA.isNotValidDate|isNotValidDate}
+ * @example
+ *
+ * RA.isDate(new Date()); //=> true
+ * RA.isDate('1997-07-16T19:20+01:00'); //=> false
+ */
+const isDate = curryN(1, pipe(type, identical('Date')));
+
+export default isDate;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isEmptyArray.js.html b/5.0.0/isEmptyArray.js.html new file mode 100644 index 0000000000..031eaaa905 --- /dev/null +++ b/5.0.0/isEmptyArray.js.html @@ -0,0 +1,101 @@ + + + + + isEmptyArray.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isEmptyArray.js

+ + + + + + + +
+
+
import { both, isEmpty } from 'ramda';
+
+import isArray from './isArray.js';
+
+/**
+ * Checks if input value is an empty `Array`.
+ *
+ * @func isEmptyArray
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.4.0|v2.4.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isNotEmptyArray|isNotEmptyArray}
+ * @example
+ *
+ * RA.isEmptyArray([]); // => true
+ * RA.isEmptyArray([42]); // => false
+ * RA.isEmptyArray({}); // => false
+ * RA.isEmptyArray(null); // => false
+ * RA.isEmptyArray(undefined); // => false
+ * RA.isEmptyArray(42); // => false
+ * RA.isEmptyArray('42'); // => false
+ */
+const isEmptyArray = both(isArray, isEmpty);
+
+export default isEmptyArray;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isEmptyString.js.html b/5.0.0/isEmptyString.js.html new file mode 100644 index 0000000000..713f0e83de --- /dev/null +++ b/5.0.0/isEmptyString.js.html @@ -0,0 +1,101 @@ + + + + + isEmptyString.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isEmptyString.js

+ + + + + + + +
+
+
import { equals } from 'ramda';
+
+/**
+ * Checks if input value is an empty `String`.
+ *
+ * @func isEmptyString
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.4.0|v2.4.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isNotEmptyString|isNotEmptyString}
+ * @example
+ *
+ * RA.isEmptyString(''); // => true
+ * RA.isEmptyString('42'); // => false
+ * RA.isEmptyString(new String('42')); // => false
+ * RA.isEmptyString(new String('')); // => false
+ * RA.isEmptyString([42]); // => false
+ * RA.isEmptyString({}); // => false
+ * RA.isEmptyString(null); // => false
+ * RA.isEmptyString(undefined); // => false
+ * RA.isEmptyString(42); // => false
+ */
+const isEmptyString = equals('');
+
+export default isEmptyString;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isError.js.html b/5.0.0/isError.js.html new file mode 100644 index 0000000000..8710ca0aaf --- /dev/null +++ b/5.0.0/isError.js.html @@ -0,0 +1,94 @@ + + + + + isError.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isError.js

+ + + + + + + +
+
+
import { type, identical, pipe, curryN } from 'ramda';
+
+/**
+ * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, `SyntaxError`, `TypeError` or `URIError` object.
+ *
+ * @func isError
+ * @category Type
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.30.0|v2.30.0}
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean} Returns `true` if value is an error object, `false` otherwise
+ * @example
+ *
+ * RA.isError(new Error()); //=> true
+ * RA.isError(Error); //=> false
+ * RA.isError(1); // => false
+ */
+const isError = curryN(1, pipe(type, identical('Error')));
+
+export default isError;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isEven.js.html b/5.0.0/isEven.js.html new file mode 100644 index 0000000000..d4b19ed999 --- /dev/null +++ b/5.0.0/isEven.js.html @@ -0,0 +1,104 @@ + + + + + isEven.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isEven.js

+ + + + + + + +
+
+
import { both, complement, curryN } from 'ramda';
+
+import isInteger from './isInteger.js';
+import isOdd from './isOdd.js';
+
+/**
+ * Checks if value is even integer number.
+ * An even number is an integer which is "evenly divisible" by two.
+ * Zero is an even number because zero divided by two equals zero,
+ * which despite not being a natural number, is an integer.
+ * Even numbers are either positive or negative.
+ *
+ * @func isEven
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.18.0|v1.18.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isOdd|isOdd}
+ * @example
+ *
+ * RA.isEven(0); // => true
+ * RA.isEven(1); // => false
+ * RA.isEven(-Infinity); // => false
+ * RA.isEven(4); // => true
+ * RA.isEven(3); // => false
+ */
+const isEven = curryN(1, both(isInteger, complement(isOdd)));
+
+export default isEven;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isFalse.js.html b/5.0.0/isFalse.js.html new file mode 100644 index 0000000000..bcce7b5e39 --- /dev/null +++ b/5.0.0/isFalse.js.html @@ -0,0 +1,104 @@ + + + + + isFalse.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isFalse.js

+ + + + + + + +
+
+
import { identical, curryN } from 'ramda';
+
+/**
+ * Checks if input value is the Boolean primitive `false`. Will return false for all values created
+ * using the `Boolean` function as a constructor.
+ *
+ * @func isFalse
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.6.0|v2.6.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isTrue|isTrue}, {@link RA.isTruthy|isTruthy}, {@link RA.isFalsy|isFalsy}
+ * @example
+ *
+ * RA.isFalse(false); // => true
+ * RA.isFalse(Boolean(false)); // => true
+ * RA.isFalse(true); // => false
+ * RA.isFalse(0); // => false
+ * RA.isFalse(''); // => false
+ * RA.isFalse(null); // => false
+ * RA.isFalse(undefined); // => false
+ * RA.isFalse(NaN); // => false
+ * RA.isFalse([]); // => false
+ * RA.isFalse(new Boolean(false)); // => false
+ */
+
+const isFalse = curryN(1, identical(false));
+
+export default isFalse;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isFalsy.js.html b/5.0.0/isFalsy.js.html new file mode 100644 index 0000000000..86e168f451 --- /dev/null +++ b/5.0.0/isFalsy.js.html @@ -0,0 +1,101 @@ + + + + + isFalsy.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isFalsy.js

+ + + + + + + +
+
+
import { complement } from 'ramda';
+
+import isTruthy from './isTruthy.js';
+
+/**
+ * A falsy value is a value that translates to false when evaluated in a Boolean context.
+ * Falsy values are `false`, `0`, `""`, `null`, `undefined`, and `NaN`.
+ *
+ * @func isFalsy
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.2.0|v2.2..0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link https://developer.mozilla.org/en-US/docs/Glossary/Falsy|falsy}, {@link RA.isTruthy|isTruthy}
+ * @example
+ *
+ * RA.isFalsy(false); // => true
+ * RA.isFalsy(0); // => true
+ * RA.isFalsy(''); // => true
+ * RA.isFalsy(null); // => true
+ * RA.isFalsy(undefined); // => true
+ * RA.isFalsy(NaN); // => true
+ */
+const isFalsy = complement(isTruthy);
+
+export default isFalsy;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isFinite.js.html b/5.0.0/isFinite.js.html new file mode 100644 index 0000000000..e36001ed20 --- /dev/null +++ b/5.0.0/isFinite.js.html @@ -0,0 +1,110 @@ + + + + + isFinite.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isFinite.js

+ + + + + + + +
+
+
import { bind, curryN } from 'ramda';
+
+import isFunction from './isFunction.js';
+import ponyfill from './internal/ponyfills/Number.isFinite.js';
+
+export const isFinitePonyfill = curryN(1, ponyfill);
+
+/**
+ * Checks whether the passed value is a finite `Number`.
+ *
+ * @func isFinite
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/0.7.0|v0.7.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isNotFinite|isNotFinite}
+ * @example
+ *
+ * RA.isFinite(Infinity); //=> false
+ * RA.isFinite(NaN); //=> false
+ * RA.isFinite(-Infinity); //=> false
+ *
+ * RA.isFinite(0); // true
+ * RA.isFinite(2e64); // true
+ *
+ * RA.isFinite('0');  // => false
+ *                    // would've been true with global isFinite('0')
+ * RA.isFinite(null); // => false
+ *                    // would've been true with global isFinite(null)
+ */
+const _isFinite = isFunction(Number.isFinite)
+  ? curryN(1, bind(Number.isFinite, Number))
+  : isFinitePonyfill;
+
+export default _isFinite;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isFloat.js.html b/5.0.0/isFloat.js.html new file mode 100644 index 0000000000..bbb5380001 --- /dev/null +++ b/5.0.0/isFloat.js.html @@ -0,0 +1,109 @@ + + + + + isFloat.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isFloat.js

+ + + + + + + +
+
+
import { complement, both } from 'ramda';
+
+import isInteger from './isInteger.js';
+import isFinite from './isFinite.js';
+
+/**
+ * Checks whether the passed value is a `float`.
+ *
+ * @func isFloat
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.14.0|v1.14.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isNotFloat|isNotFloat}
+ * @example
+ *
+ * RA.isFloat(0); //=> false
+ * RA.isFloat(1); //=> false
+ * RA.isFloat(-100000); //=> false
+ *
+ * RA.isFloat(0.1);       //=> true
+ * RA.isFloat(Math.PI);   //=> true
+ *
+ * RA.isFloat(NaN);       //=> false
+ * RA.isFloat(Infinity);  //=> false
+ * RA.isFloat(-Infinity); //=> false
+ * RA.isFloat('10');      //=> false
+ * RA.isFloat(true);      //=> false
+ * RA.isFloat(false);     //=> false
+ * RA.isFloat([1]);       //=> false
+ */
+const isFloat = both(isFinite, complement(isInteger));
+
+export default isFloat;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isFunction.js.html b/5.0.0/isFunction.js.html new file mode 100644 index 0000000000..6cbbcfac59 --- /dev/null +++ b/5.0.0/isFunction.js.html @@ -0,0 +1,105 @@ + + + + + isFunction.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isFunction.js

+ + + + + + + +
+
+
import { anyPass, type, pipe, identical } from 'ramda';
+
+import isGeneratorFunction from './isGeneratorFunction.js';
+import isAsyncFunction from './isAsyncFunction.js';
+
+/**
+ * Checks if input value is `Function`.
+ *
+ * @func isFunction
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/0.5.0|v0.5.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isNotFunction|isNotFunction}, {@link RA.isAsyncFunction|isNotAsyncFunction}, {@link RA.isGeneratorFunction|isGeneratorFunction}
+ * @example
+ *
+ * RA.isFunction(function test() { }); //=> true
+ * RA.isFunction(function* test() { }); //=> true
+ * RA.isFunction(async function test() { }); //=> true
+ * RA.isFunction(() => {}); //=> true
+ * RA.isFunction(null); //=> false
+ * RA.isFunction('abc'); //=> false
+ */
+const isFunction = anyPass([
+  pipe(type, identical('Function')),
+  isGeneratorFunction,
+  isAsyncFunction,
+]);
+
+export default isFunction;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isGeneratorFunction.js.html b/5.0.0/isGeneratorFunction.js.html new file mode 100644 index 0000000000..350473531c --- /dev/null +++ b/5.0.0/isGeneratorFunction.js.html @@ -0,0 +1,99 @@ + + + + + isGeneratorFunction.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isGeneratorFunction.js

+ + + + + + + +
+
+
import { type, identical, pipe, curryN } from 'ramda';
+
+/**
+ * Checks if input value is `Generator Function`.
+ *
+ * @func isGeneratorFunction
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/0.5.0|v0.5.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isFunction|isFunction}, {@link RA.isAsyncFunction|isAsyncFunction}, {@link RA.isNotGeneratorFunction|isNotGeneratorFunction}
+ * @example
+ *
+ * RA.isGeneratorFunction(function* test() { }); //=> true
+ * RA.isGeneratorFunction(null); //=> false
+ * RA.isGeneratorFunction(function test() { }); //=> false
+ * RA.isGeneratorFunction(() => {}); //=> false
+ */
+const isGeneratorFunction = curryN(
+  1,
+  pipe(type, identical('GeneratorFunction'))
+);
+
+export default isGeneratorFunction;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isIndexed.js.html b/5.0.0/isIndexed.js.html new file mode 100644 index 0000000000..5bbc25d2bc --- /dev/null +++ b/5.0.0/isIndexed.js.html @@ -0,0 +1,97 @@ + + + + + isIndexed.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isIndexed.js

+ + + + + + + +
+
+
import { either, curryN } from 'ramda';
+
+import isArray from './isArray.js';
+import isString from './isString.js';
+
+/**
+ * Determine if input value is an indexed data type.
+ *
+ * @func isIndexed
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.26.0|v2.26.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @example
+ *
+ * RA.isIndexed([1]) //=> true
+ * RA.isIndexed('test') //=> true
+ */
+
+const isIndexed = curryN(1, either(isString, isArray));
+
+export default isIndexed;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isInteger.js.html b/5.0.0/isInteger.js.html new file mode 100644 index 0000000000..22f4df1ad3 --- /dev/null +++ b/5.0.0/isInteger.js.html @@ -0,0 +1,113 @@ + + + + + isInteger.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isInteger.js

+ + + + + + + +
+
+
import { bind, curryN } from 'ramda';
+
+import isFunction from './isFunction.js';
+import ponyfill from './internal/ponyfills/Number.isInteger.js';
+
+export const isIntegerPonyfill = curryN(1, ponyfill);
+
+/**
+ * Checks whether the passed value is an `integer`.
+ *
+ * @func isInteger
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/0.7.0|v0.7.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isNotInteger|isNotInteger}
+ * @example
+ *
+ * RA.isInteger(0); //=> true
+ * RA.isInteger(1); //=> true
+ * RA.isInteger(-100000); //=> true
+ *
+ * RA.isInteger(0.1);       //=> false
+ * RA.isInteger(Math.PI);   //=> false
+ *
+ * RA.isInteger(NaN);       //=> false
+ * RA.isInteger(Infinity);  //=> false
+ * RA.isInteger(-Infinity); //=> false
+ * RA.isInteger('10');      //=> false
+ * RA.isInteger(true);      //=> false
+ * RA.isInteger(false);     //=> false
+ * RA.isInteger([1]);       //=> false
+ */
+const isInteger = isFunction(Number.isInteger)
+  ? curryN(1, bind(Number.isInteger, Number))
+  : isIntegerPonyfill;
+
+export default isInteger;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isInteger32.js.html b/5.0.0/isInteger32.js.html new file mode 100644 index 0000000000..d283c7bfce --- /dev/null +++ b/5.0.0/isInteger32.js.html @@ -0,0 +1,101 @@ + + + + + isInteger32.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isInteger32.js

+ + + + + + + +
+
+
import { curryN } from 'ramda';
+
+import toInteger32 from './toInteger32.js';
+
+/**
+ * Checks whether the passed value is a signed 32 bit integer.
+ *
+ * @func isInteger32
+ * @aliases isInt32
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.32.0|v2.32.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.toInteger32|toInteger32}
+ * @example
+ *
+ * RA.isInteger32(0); //=> true
+ * RA.isInteger32((-2) ** 31); //=> true
+ *
+ * RA.isInteger32(Infinity); //=> false
+ * RA.isInteger32(NaN); //=> false
+ * RA.isInteger32(2 ** 31); //=> false
+ */
+const isInteger32 = curryN(1, (val) => toInteger32(val) === val);
+
+export default isInteger32;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isIterable.js.html b/5.0.0/isIterable.js.html new file mode 100644 index 0000000000..82f8888fd5 --- /dev/null +++ b/5.0.0/isIterable.js.html @@ -0,0 +1,110 @@ + + + + + isIterable.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isIterable.js

+ + + + + + + +
+
+
import { hasIn, curryN } from 'ramda';
+
+import isFunction from './isFunction.js';
+
+/**
+ * Checks whether the passed value is iterable.
+ *
+ * @func isIterable
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.18.0|v2.18.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol}
+ * @return {boolean}
+ * @example
+ *
+ * RA.isIterable(['arrays', 'are', 'iterable']); //=> true
+ * RA.isIterable('strings are iterable, too'); //=> true
+ * RA.isIterable((function* () {})()); //=> true (generator objects are both iterable and iterators)
+ *
+ * RA.isIterable({}); //=> false
+ * RA.isIterable(-0); //=> false
+ * RA.isIterable(null); //=> false
+ * RA.isIterable(undefined); //=> false
+ */
+const isIterable = curryN(1, (val) => {
+  if (typeof Symbol === 'undefined') {
+    return false;
+  }
+
+  return (
+    hasIn(Symbol.iterator, Object(val)) && isFunction(val[Symbol.iterator])
+  );
+});
+
+export default isIterable;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isMap.js.html b/5.0.0/isMap.js.html new file mode 100644 index 0000000000..6688412b48 --- /dev/null +++ b/5.0.0/isMap.js.html @@ -0,0 +1,98 @@ + + + + + isMap.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isMap.js

+ + + + + + + +
+
+
import { type, identical, pipe, curryN } from 'ramda';
+
+/**
+ * Predicate for determining if a provided value is an instance of a Map.
+ *
+ * @func isMap
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.22.0|v2.22.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isSet|isSet}}
+ * @example
+ *
+ * RA.isMap(new Map()); //=> true
+ * RA.isMap(new Map([[1, 2], [2, 1]])); //=> true
+ * RA.isSet(new Set()); //=> false
+ * RA.isSet(new Set([1,2]); //=> false
+ * RA.isSet(new Object()); //=> false
+ */
+
+const isMap = curryN(1, pipe(type, identical('Map')));
+
+export default isMap;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isNaN.js.html b/5.0.0/isNaN.js.html new file mode 100644 index 0000000000..4f880440d5 --- /dev/null +++ b/5.0.0/isNaN.js.html @@ -0,0 +1,118 @@ + + + + + isNaN.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isNaN.js

+ + + + + + + +
+
+
import { curryN } from 'ramda';
+
+import isFunction from './isFunction.js';
+import ponyfill from './internal/ponyfills/Number.isNaN.js';
+
+export const isNaNPonyfill = curryN(1, ponyfill);
+
+/**
+ * Checks whether the passed value is `NaN` and its type is `Number`.
+ * It is a more robust version of the original, global isNaN().
+ *
+ *
+ * @func isNaN
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/0.6.0|v0.6.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isNotNaN|isNotNaN}
+ * @example
+ *
+ * RA.isNaN(NaN); // => true
+ * RA.isNaN(Number.NaN); // => true
+ * RA.isNaN(0 / 0); // => true
+ *
+ * // e.g. these would have been true with global isNaN().
+ * RA.isNaN('NaN'); // => false
+ * RA.isNaN(undefined); // => false
+ * RA.isNaN({}); // => false
+ * RA.isNaN('blabla'); // => false
+ *
+ * RA.isNaN(true); // => false
+ * RA.isNaN(null); // => false
+ * RA.isNaN(37); // => false
+ * RA.isNaN('37'); // => false
+ * RA.isNaN('37.37'); // => false
+ * RA.isNaN(''); // => false
+ * RA.isNaN(' '); // => false
+ */
+const _isNaN = isFunction(Number.isNaN)
+  ? curryN(1, Number.isNaN)
+  : isNaNPonyfill;
+
+export default _isNaN;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isNaturalNumber.js.html b/5.0.0/isNaturalNumber.js.html new file mode 100644 index 0000000000..7585a8e273 --- /dev/null +++ b/5.0.0/isNaturalNumber.js.html @@ -0,0 +1,101 @@ + + + + + isNaturalNumber.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isNaturalNumber.js

+ + + + + + + +
+
+
import { both, complement, curryN } from 'ramda';
+
+import isInteger from './isInteger.js';
+import isNegative from './isNegative.js';
+
+/**
+ * Checks if value is a natural number.
+ * Natural numbers correspond to all non-negative integers and 0.
+ *
+ * @func isNaturalNumber
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.29.0|v2.29.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @example
+ *
+ * RA.isNaturalNumber(5); // => true
+ * RA.isNaturalNumber(Number.MAX_VALUE); // => true
+ * RA.isNaturalNumber(0); // => true
+ * RA.isNaturalNumber(-1); // => false
+ * RA.isNaturalNumber(0.9); // => false
+ */
+
+const isNaturalNumber = curryN(1, both(isInteger, complement(isNegative)));
+
+export default isNaturalNumber;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isNegative.js.html b/5.0.0/isNegative.js.html new file mode 100644 index 0000000000..4574b5604e --- /dev/null +++ b/5.0.0/isNegative.js.html @@ -0,0 +1,100 @@ + + + + + isNegative.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isNegative.js

+ + + + + + + +
+
+
import { both, gt, curryN } from 'ramda';
+
+import isNumber from './isNumber.js';
+
+/**
+ * Checks if value is a negative `Number` primitive or object. Zero is not considered neither
+ * positive or negative.
+ *
+ * @func isNegative
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.15.0|v1.15.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isPositive|isPositive}
+ * @example
+ *
+ * RA.isNegative(-1); // => true
+ * RA.isNegative(Number.MIN_VALUE); // => false
+ * RA.isNegative(+Infinity); // => false
+ * RA.isNegative(NaN); // => false
+ * RA.isNegative('5'); // => false
+ */
+const isNegative = curryN(1, both(isNumber, gt(0)));
+
+export default isNegative;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isNegativeZero.js.html b/5.0.0/isNegativeZero.js.html new file mode 100644 index 0000000000..93a530faf1 --- /dev/null +++ b/5.0.0/isNegativeZero.js.html @@ -0,0 +1,96 @@ + + + + + isNegativeZero.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isNegativeZero.js

+ + + + + + + +
+
+
import { identical, curryN } from 'ramda';
+
+/**
+ * Checks if value is a negative zero (-0).
+ *
+ * @func isNegativeZero
+ * @memberof RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.22.0|v2.22.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see @see {@link RA.isPositiveZero|isPositiveZero}
+ * @example
+ *
+ * RA.isNegativeZero(-0); //=> true
+ * RA.isNegativeZero(+0); //=> false
+ * RA.isNegativeZero(0); //=> false
+ * RA.isNegativeZero(null); //=> false
+ */
+const isNegativeZero = curryN(1, identical(-0));
+
+export default isNegativeZero;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isNilOrEmpty.js.html b/5.0.0/isNilOrEmpty.js.html new file mode 100644 index 0000000000..3b1ebd1190 --- /dev/null +++ b/5.0.0/isNilOrEmpty.js.html @@ -0,0 +1,99 @@ + + + + + isNilOrEmpty.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isNilOrEmpty.js

+ + + + + + + +
+
+
import { either, isEmpty, isNil, curryN } from 'ramda';
+
+/**
+ * Returns `true` if the given value is its type's empty value, `null` or `undefined`.
+ *
+ * @func isNilOrEmpty
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/0.4.0|v0.4.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link http://ramdajs.com/docs/#isEmpty|R.isEmpty}, {@link http://ramdajs.com/docs/#isNil|R.isNil}
+ * @example
+ *
+ * RA.isNilOrEmpty([1, 2, 3]); //=> false
+ * RA.isNilOrEmpty([]); //=> true
+ * RA.isNilOrEmpty(''); //=> true
+ * RA.isNilOrEmpty(null); //=> true
+ * RA.isNilOrEmpty(undefined): //=> true
+ * RA.isNilOrEmpty({}); //=> true
+ * RA.isNilOrEmpty({length: 0}); //=> false
+ */
+const isNilOrEmpty = curryN(1, either(isNil, isEmpty));
+
+export default isNilOrEmpty;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isNonEmptyArray.js.html b/5.0.0/isNonEmptyArray.js.html new file mode 100644 index 0000000000..7d1ef80dc9 --- /dev/null +++ b/5.0.0/isNonEmptyArray.js.html @@ -0,0 +1,101 @@ + + + + + isNonEmptyArray.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isNonEmptyArray.js

+ + + + + + + +
+
+
import { both, isNotEmpty } from 'ramda';
+
+import isArray from './isArray.js';
+
+/**
+ * Checks if input value is not an empty `Array`.
+ *
+ * @func isNonEmptyArray
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.4.0|v2.4.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isEmptyArray|isEmptyArray}
+ * @example
+ *
+ * RA.isNonEmptyArray([42]); // => true
+ * RA.isNonEmptyArray([]); // => false
+ * RA.isNonEmptyArray({}); // => false
+ * RA.isNonEmptyArray(null); // => false
+ * RA.isNonEmptyArray(undefined); // => false
+ * RA.isNonEmptyArray(42); // => false
+ * RA.isNonEmptyArray('42'); // => false
+ */
+const isNonEmptyArray = both(isArray, isNotEmpty);
+
+export default isNonEmptyArray;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isNonEmptyString.js.html b/5.0.0/isNonEmptyString.js.html new file mode 100644 index 0000000000..2553e34035 --- /dev/null +++ b/5.0.0/isNonEmptyString.js.html @@ -0,0 +1,104 @@ + + + + + isNonEmptyString.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isNonEmptyString.js

+ + + + + + + +
+
+
import { allPass, isNotEmpty } from 'ramda';
+
+import isString from './isString.js';
+import isNotObj from './isNotObj.js';
+
+/**
+ * Checks if input value is not an empty `String`.
+ *
+ * @func isNonEmptyString
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.4.0|v2.4.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isEmptyString|isEmptyString}
+ * @example
+ *
+ * RA.isNonEmptyString('42'); // => true
+ * RA.isNonEmptyString(''); // => false
+ * RA.isNonEmptyString(new String('42')); // => false
+ * RA.isNonEmptyString(new String('')); // => false
+ * RA.isNonEmptyString([42]); // => false
+ * RA.isNonEmptyString({}); // => false
+ * RA.isNonEmptyString(null); // => false
+ * RA.isNonEmptyString(undefined); // => false
+ * RA.isNonEmptyString(42); // => false
+ */
+const isNonEmptyString = allPass([isString, isNotObj, isNotEmpty]);
+
+export default isNonEmptyString;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isNonNegative.js.html b/5.0.0/isNonNegative.js.html new file mode 100644 index 0000000000..c8b50f8c9f --- /dev/null +++ b/5.0.0/isNonNegative.js.html @@ -0,0 +1,103 @@ + + + + + isNonNegative.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isNonNegative.js

+ + + + + + + +
+
+
import { both, gte, flip, curryN } from 'ramda';
+
+import isNumber from './isNumber.js';
+
+/**
+ * Checks if value is a non-negative `Number` primitive or object. This includes all positive
+ * numbers and zero.
+ *
+ * @func isNonNegative
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.6.0|v2.6.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isPositive|isPositive}, {@link RA.isNonPositive|isNonPositive}
+ * @example
+ *
+ * RA.isNonNegative(0); // => true
+ * RA.isNonNegative(1); // => true
+ * RA.isNonNegative(Infinity); // => true
+ * RA.isNonNegative(Number.MAX_VALUE); // => true
+ *
+ * RA.isNonNegative(-Infinity); // => false
+ * RA.isNonNegative(Number.MIN_VALUE); // => false
+ * RA.isNonNegative(NaN); // => false
+ */
+const isNonNegative = curryN(1, both(isNumber, flip(gte)(0)));
+
+export default isNonNegative;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isNonPositive.js.html b/5.0.0/isNonPositive.js.html new file mode 100644 index 0000000000..28d468342e --- /dev/null +++ b/5.0.0/isNonPositive.js.html @@ -0,0 +1,103 @@ + + + + + isNonPositive.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isNonPositive.js

+ + + + + + + +
+
+
import { both, lte, flip, curryN } from 'ramda';
+
+import isNumber from './isNumber.js';
+
+/**
+ * Checks if value is a non-positive `Number` primitive or object. This includes all negative
+ * numbers and zero.
+ *
+ * @func isNonPositive
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.6.0|v2.6.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isNegative|isNegative}, {@link RA.isNonNegative|isNonNegative}
+ * @example
+ *
+ * RA.isNonPositive(0); // => true
+ * RA.isNonPositive(-1); // => true
+ * RA.isNonPositive(-Infinity); // => true
+ * RA.isNonPositive(Number.MIN_VALUE); // => true
+ *
+ * RA.isNonPositive(Infinity); // => false
+ * RA.isNonPositive(Number.MAX_VALUE); // => false
+ * RA.isNonPositive(NaN); // => false
+ */
+const isNonPositive = curryN(1, both(isNumber, flip(lte)(0)));
+
+export default isNonPositive;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isNotArray.js.html b/5.0.0/isNotArray.js.html new file mode 100644 index 0000000000..916ea33d74 --- /dev/null +++ b/5.0.0/isNotArray.js.html @@ -0,0 +1,97 @@ + + + + + isNotArray.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isNotArray.js

+ + + + + + + +
+
+
import { complement } from 'ramda';
+
+import isArray from './isArray.js';
+
+/**
+ * Checks if input value is complement of `Array`
+ *
+ * @func isNotArray
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/0.3.0|v0.3.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isArray|isArray}
+ * @example
+ *
+ * RA.isNotArray([]); //=> false
+ * RA.isNotArray(null); //=> true
+ * RA.isNotArray({}); //=> true
+ */
+const isNotArray = complement(isArray);
+
+export default isNotArray;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isNotArrayLike.js.html b/5.0.0/isNotArrayLike.js.html new file mode 100644 index 0000000000..539ab22854 --- /dev/null +++ b/5.0.0/isNotArrayLike.js.html @@ -0,0 +1,99 @@ + + + + + isNotArrayLike.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isNotArrayLike.js

+ + + + + + + +
+
+
import { complement } from 'ramda';
+
+import isArrayLike from './isArrayLike.js';
+
+/**
+ * Tests whether or not an object is similar to an array.
+ *
+ * @func isNotArrayLike
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/0.5.0|v0.5.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isArrayLike|isArrayLike}
+ * @example
+ *
+ * RA.isNotArrayLike([]); //=> false
+ * RA.isNotArrayLike(true); //=> true
+ * RA.isNotArrayLike({}); //=> true
+ * RA.isNotArrayLike({length: 10}); //=> true
+ * RA.isNotArrayLike({0: 'zero', 9: 'nine', length: 10}); //=> false
+ */
+const isNotArrayLike = complement(isArrayLike);
+
+export default isNotArrayLike;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isNotAsyncFunction.js.html b/5.0.0/isNotAsyncFunction.js.html new file mode 100644 index 0000000000..fa6cbf1091 --- /dev/null +++ b/5.0.0/isNotAsyncFunction.js.html @@ -0,0 +1,100 @@ + + + + + isNotAsyncFunction.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isNotAsyncFunction.js

+ + + + + + + +
+
+
import { complement } from 'ramda';
+
+import isAsyncFunction from './isAsyncFunction.js';
+
+/* eslint-disable max-len */
+/**
+ * Checks if input value is complement of `Async Function`
+ *
+ * @func isNotAsyncFunction
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/0.5.0|v0.5.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isFunction|isFunction}, {@link RA.isAsyncFunction|isAsyncFunction}, {@link RA.isGeneratorFunction|isGeneratorFunction}
+ * @example
+ *
+ * RA.isNotAsyncFunction(async function test() { }); //=> false
+ * RA.isNotAsyncFunction(null); //=> true
+ * RA.isNotAsyncFunction(function test() { }); //=> true
+ * RA.isNotAsyncFunction(() => {}); //=> true
+ */
+/* eslint-enable max-len */
+const isNotAsyncFunction = complement(isAsyncFunction);
+
+export default isNotAsyncFunction;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isNotBoolean.js.html b/5.0.0/isNotBoolean.js.html new file mode 100644 index 0000000000..4701bc6382 --- /dev/null +++ b/5.0.0/isNotBoolean.js.html @@ -0,0 +1,97 @@ + + + + + isNotBoolean.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isNotBoolean.js

+ + + + + + + +
+
+
import { complement } from 'ramda';
+
+import isBoolean from './isBoolean.js';
+
+/**
+ * Checks if input value is complement of `Boolean`.
+ *
+ * @func isNotBoolean
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/0.3.0|v0.3.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isBoolean|isBoolean}
+ * @example
+ *
+ * RA.isNotBoolean(false); //=> false
+ * RA.isNotBoolean(true); //=> false
+ * RA.isNotBoolean(null); //=> true
+ */
+const isNotBoolean = complement(isBoolean);
+
+export default isNotBoolean;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isNotDate.js.html b/5.0.0/isNotDate.js.html new file mode 100644 index 0000000000..0069b6dd6c --- /dev/null +++ b/5.0.0/isNotDate.js.html @@ -0,0 +1,96 @@ + + + + + isNotDate.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isNotDate.js

+ + + + + + + +
+
+
import { complement } from 'ramda';
+
+import isDate from './isDate.js';
+
+/**
+ * Checks if value is complement of `Date` object.
+ *
+ * @func isNotDate
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/0.6.0|v0.6.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isDate|isDate}
+ * @example
+ *
+ * RA.isNotDate(new Date()); //=> false
+ * RA.isNotDate('1997-07-16T19:20+01:00'); //=> true
+ */
+const isNotDate = complement(isDate);
+
+export default isNotDate;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isNotFinite.js.html b/5.0.0/isNotFinite.js.html new file mode 100644 index 0000000000..d654c98553 --- /dev/null +++ b/5.0.0/isNotFinite.js.html @@ -0,0 +1,104 @@ + + + + + isNotFinite.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isNotFinite.js

+ + + + + + + +
+
+
import { complement } from 'ramda';
+
+import _isFinite from './isFinite.js';
+
+/**
+ * Checks whether the passed value is complement of finite `Number`.
+ *
+ *
+ * @func isNotFinite
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/0.7.0|v0.7.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isFinite|isFinite}
+ * @example
+ *
+ * RA.isNotFinite(Infinity); //=> true
+ * RA.isNotFinite(NaN); //=> true
+ * RA.isNotFinite(-Infinity); //=> true
+ *
+ * RA.isNotFinite(0); // false
+ * RA.isNotFinite(2e64); // false
+ *
+ * RA.isNotFinite('0');  // => true
+ * RA.isNotFinite(null); // => true
+ */
+const isNotFinite = complement(_isFinite);
+
+export default isNotFinite;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isNotFloat.js.html b/5.0.0/isNotFloat.js.html new file mode 100644 index 0000000000..3cd0620a18 --- /dev/null +++ b/5.0.0/isNotFloat.js.html @@ -0,0 +1,108 @@ + + + + + isNotFloat.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isNotFloat.js

+ + + + + + + +
+
+
import { complement, curryN } from 'ramda';
+
+import isFloat from './isFloat.js';
+
+/**
+ * Checks whether the passed value is complement of a `float`.
+ *
+ * @func isNotFloat
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.14.0|v1.14.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isFloat|isFloat}
+ * @example
+ *
+ * RA.isNotFloat(0); //=> true
+ * RA.isNotFloat(1); //=> true
+ * RA.isNotFloat(-100000); //=> true
+ *
+ * RA.isNotFloat(0.1);       //=> false
+ * RA.isNotFloat(Math.PI);   //=> false
+ *
+ * RA.isNotFloat(NaN);       //=> true
+ * RA.isNotFloat(Infinity);  //=> true
+ * RA.isNotFloat(-Infinity); //=> true
+ * RA.isNotFloat('10');      //=> true
+ * RA.isNotFloat(true);      //=> true
+ * RA.isNotFloat(false);     //=> true
+ * RA.isNotFloat([1]);       //=> true
+ */
+const isNotFloat = curryN(1, complement(isFloat));
+
+export default isNotFloat;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isNotFunction.js.html b/5.0.0/isNotFunction.js.html new file mode 100644 index 0000000000..f153519e51 --- /dev/null +++ b/5.0.0/isNotFunction.js.html @@ -0,0 +1,102 @@ + + + + + isNotFunction.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isNotFunction.js

+ + + + + + + +
+
+
import { complement } from 'ramda';
+
+import isFunction from './isFunction.js';
+
+/* eslint-disable max-len */
+/**
+ * Checks if input value is complement of `Function`.
+ *
+ * @func isNotFunction
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/0.5.0|v0.5.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isFunction|isFunction}, {@link RA.isAsyncFunction|isNotAsyncFunction}, {@link RA.isGeneratorFunction|isGeneratorFunction}
+ * @example
+ *
+ * RA.isNotFunction(function test() { }); //=> false
+ * RA.isNotFunction(function* test() { }); //=> false
+ * RA.isNotFunction(async function test() { }); //=> false
+ * RA.isNotFunction(() => {}); //=> false
+ * RA.isNotFunction(null); //=> true
+ * RA.isNotFunction('abc'); //=> true
+ */
+/* eslint-enable max-len */
+const isNotFunction = complement(isFunction);
+
+export default isNotFunction;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isNotGeneratorFunction.js.html b/5.0.0/isNotGeneratorFunction.js.html new file mode 100644 index 0000000000..1e0a3e1b6f --- /dev/null +++ b/5.0.0/isNotGeneratorFunction.js.html @@ -0,0 +1,100 @@ + + + + + isNotGeneratorFunction.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isNotGeneratorFunction.js

+ + + + + + + +
+
+
import { complement } from 'ramda';
+
+import isGeneratorFunction from './isGeneratorFunction.js';
+
+/* eslint-disable max-len */
+/**
+ * Checks if input value is complement of `Generator Function`
+ *
+ * @func isNotGeneratorFunction
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/0.5.0|v0.5.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isFunction|isFunction}, {@link RA.isAsyncFunction|isAsyncFunction}, {@link RA.isGeneratorFunction|isGeneratorFunction}
+ * @example
+ *
+ * RA.isNotGeneratorFunction(function* test() { }); //=> false
+ * RA.isNotGeneratorFunction(null); //=> true
+ * RA.isNotGeneratorFunction(function test() { }); //=> true
+ * RA.isNotGeneratorFunction(() => {}); //=> true
+ */
+/* eslint-enable max-len */
+const isNotGeneratorFunction = complement(isGeneratorFunction);
+
+export default isNotGeneratorFunction;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isNotInteger.js.html b/5.0.0/isNotInteger.js.html new file mode 100644 index 0000000000..ee5f35ec10 --- /dev/null +++ b/5.0.0/isNotInteger.js.html @@ -0,0 +1,109 @@ + + + + + isNotInteger.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isNotInteger.js

+ + + + + + + +
+
+
import { complement } from 'ramda';
+
+import isInteger from './isInteger.js';
+
+/**
+ * Checks whether the passed value is complement of an `integer`.
+ *
+ *
+ * @func isNotInteger
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/0.7.0|v0.7.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isInteger|isInteger}
+ * @example
+ *
+ * RA.isNotInteger(0); //=> false
+ * RA.isNotInteger(1); //=> false
+ * RA.isNotInteger(-100000); //=> false
+ *
+ * RA.isNotInteger(0.1);       //=> true
+ * RA.isNotInteger(Math.PI);   //=> true
+ *
+ * RA.isNotInteger(NaN);       //=> true
+ * RA.isNotInteger(Infinity);  //=> true
+ * RA.isNotInteger(-Infinity); //=> true
+ * RA.isNotInteger('10');      //=> true
+ * RA.isNotInteger(true);      //=> true
+ * RA.isNotInteger(false);     //=> true
+ * RA.isNotInteger([1]);       //=> true
+ */
+const isNotInteger = complement(isInteger);
+
+export default isNotInteger;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isNotMap.js.html b/5.0.0/isNotMap.js.html new file mode 100644 index 0000000000..a3786cdcdc --- /dev/null +++ b/5.0.0/isNotMap.js.html @@ -0,0 +1,100 @@ + + + + + isNotMap.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isNotMap.js

+ + + + + + + +
+
+
import { complement } from 'ramda';
+
+import isMap from './isMap.js';
+
+/**
+ * Checks if value is complement of `Map` object.
+ *
+ * @func isNotMap
+ * @memberOf RA
+ * @category Type
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.27.0|v2.27.0}
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isMap|isMap}
+ * @example
+ *
+ * RA.isNotMap(new Map()); //=> false
+ * RA.isNotMap(new Map([[1, 2], [2, 1]])); //=> false
+ * RA.isNotMap(new Set()); //=> true
+ * RA.isNotMap({}); //=> true
+ * RA.isNotMap(12); //=> true
+ */
+
+const isNotMap = complement(isMap);
+
+export default isNotMap;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isNotNaN.js.html b/5.0.0/isNotNaN.js.html new file mode 100644 index 0000000000..4e7a6f6740 --- /dev/null +++ b/5.0.0/isNotNaN.js.html @@ -0,0 +1,110 @@ + + + + + isNotNaN.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isNotNaN.js

+ + + + + + + +
+
+
import { complement } from 'ramda';
+
+import _isNaN from './isNaN.js';
+
+/**
+ * Checks whether the passed value is complement of `NaN` and its type is not `Number`.
+ *
+ * @func isNotNaN
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/0.6.0|v0.6.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isNaN|isNaN}
+ * @example
+ *
+ * RA.isNotNaN(NaN); // => false
+ * RA.isNotNaN(Number.NaN); // => false
+ * RA.isNotNaN(0 / 0); // => false
+ *
+ * RA.isNotNaN('NaN'); // => true
+ * RA.isNotNaN(undefined); // => true
+ * RA.isNotNaN({}); // => true
+ * RA.isNotNaN('blabla'); // => true
+ *
+ * RA.isNotNaN(true); // => true
+ * RA.isNotNaN(null); // => true
+ * RA.isNotNaN(37); // => true
+ * RA.isNotNaN('37'); // => true
+ * RA.isNotNaN('37.37'); // => true
+ * RA.isNotNaN(''); // => true
+ * RA.isNotNaN(' '); // => true
+ */
+const isNotNaN = complement(_isNaN);
+
+export default isNotNaN;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isNotNil.js.html b/5.0.0/isNotNil.js.html new file mode 100644 index 0000000000..24faf44833 --- /dev/null +++ b/5.0.0/isNotNil.js.html @@ -0,0 +1,96 @@ + + + + + isNotNil.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isNotNil.js

+ + + + + + + +
+
+
import { isNil, complement } from 'ramda';
+
+/**
+ * Checks if input value is complement of `null` or `undefined`.
+ *
+ * @func isNotNil
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/0.3.0|v0.3.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link http://ramdajs.com/docs/#isNil|R.isNil}
+ * @example
+ *
+ * RA.isNotNil(null); //=> false
+ * RA.isNotNil(undefined); //=> false
+ * RA.isNotNil(0); //=> true
+ * RA.isNotNil([]); //=> true
+ */
+const isNotNil = complement(isNil);
+
+export default isNotNil;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isNotNilOrEmpty.js.html b/5.0.0/isNotNilOrEmpty.js.html new file mode 100644 index 0000000000..c98b0b58a6 --- /dev/null +++ b/5.0.0/isNotNilOrEmpty.js.html @@ -0,0 +1,101 @@ + + + + + isNotNilOrEmpty.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isNotNilOrEmpty.js

+ + + + + + + +
+
+
import { complement } from 'ramda';
+
+import isNilOrEmpty from './isNilOrEmpty.js';
+
+/**
+ * Returns `false` if the given value is its type's empty value, `null` or `undefined`.
+ *
+ * @func isNotNilOrEmpty
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.18.0|v2.18.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isNilOrEmpty|isNilOrEmpty}
+ * @example
+ *
+ * RA.isNotNilOrEmpty([1, 2, 3]); //=> true
+ * RA.isNotNilOrEmpty([]); //=> false
+ * RA.isNotNilOrEmpty(''); //=> false
+ * RA.isNotNilOrEmpty(null); //=> false
+ * RA.isNotNilOrEmpty(undefined): //=> false
+ * RA.isNotNilOrEmpty({}); //=> false
+ * RA.isNotNilOrEmpty({length: 0}); //=> true
+ */
+const isNotNilOrEmpty = complement(isNilOrEmpty);
+
+export default isNotNilOrEmpty;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isNotNull.js.html b/5.0.0/isNotNull.js.html new file mode 100644 index 0000000000..87cc3217f9 --- /dev/null +++ b/5.0.0/isNotNull.js.html @@ -0,0 +1,97 @@ + + + + + isNotNull.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isNotNull.js

+ + + + + + + +
+
+
import { complement } from 'ramda';
+
+import isNull from './isNull.js';
+
+/**
+ * Checks if input value is complement of `null`.
+ *
+ * @func isNotNull
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/0.1.0|v0.1.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isNull|isNull}
+ * @example
+ *
+ * RA.isNotNull(1); //=> true
+ * RA.isNotNull(undefined); //=> true
+ * RA.isNotNull(null); //=> false
+ */
+const isNotNull = complement(isNull);
+
+export default isNotNull;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isNotNumber.js.html b/5.0.0/isNotNumber.js.html new file mode 100644 index 0000000000..56c5767750 --- /dev/null +++ b/5.0.0/isNotNumber.js.html @@ -0,0 +1,98 @@ + + + + + isNotNumber.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isNotNumber.js

+ + + + + + + +
+
+
import { complement } from 'ramda';
+
+import isNumber from './isNumber.js';
+
+/**
+ * Checks if value is a complement of `Number` primitive or object.
+ *
+ * @func isNotNumber
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/0.6.0|v0.6.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isNumber|isNumber}
+ * @example
+ *
+ * RA.isNotNumber(5); // => false
+ * RA.isNotNumber(Number.MAX_VALUE); // => false
+ * RA.isNotNumber(-Infinity); // => false
+ * RA.isNotNumber('5'); // => true
+ */
+const isNotNumber = complement(isNumber);
+
+export default isNotNumber;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isNotObj.js.html b/5.0.0/isNotObj.js.html new file mode 100644 index 0000000000..f8c72a7bfd --- /dev/null +++ b/5.0.0/isNotObj.js.html @@ -0,0 +1,102 @@ + + + + + isNotObj.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isNotObj.js

+ + + + + + + +
+
+
import { complement } from 'ramda';
+
+import isObj from './isObj.js';
+
+/* eslint-disable max-len */
+/**
+ * Checks if input value is complement of language type of `Object`.
+ *
+ * @func isNotObj
+ * @aliases isNotObject
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/0.5.0|v0.5.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isObj|isObj}, {@link RA.isObjLike|isObjLike}, {@link RA.isPlainObj|isPlainObj}
+ * @example
+ *
+ * RA.isNotObj({}); //=> false
+ * RA.isNotObj([]); //=> false
+ * RA.isNotObj(() => {}); //=> false
+ * RA.isNotObj(null); //=> true
+ * RA.isNotObj(undefined); //=> true
+ */
+/* eslint-enable max-len */
+const isNotObj = complement(isObj);
+
+export default isNotObj;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isNotObjLike.js.html b/5.0.0/isNotObjLike.js.html new file mode 100644 index 0000000000..4c4fe69ef7 --- /dev/null +++ b/5.0.0/isNotObjLike.js.html @@ -0,0 +1,102 @@ + + + + + isNotObjLike.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isNotObjLike.js

+ + + + + + + +
+
+
import { complement } from 'ramda';
+
+import isObjLike from './isObjLike.js';
+
+/* eslint-disable max-len */
+/**
+ * Checks if value is not object-like. A value is object-like if it's not null and has a typeof result of "object".
+ *
+ * @func isNotObjLike
+ * @aliases isNotObjectLike
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/0.5.0|v0.5.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isObjLike|isObjLike}, {@link RA.isObj|isObj}, {@link RA.isPlainObj|isPlainObj}
+ * @example
+ *
+ * RA.isNotObjLike({}); //=> false
+ * RA.isNotObjLike([]); //=> false
+ * RA.isNotObjLike(() => {}); //=> true
+ * RA.isNotObjLike(null); //=> true
+ * RA.isNotObjLike(undefined); //=> true
+ */
+/* eslint-enable max-len */
+const isNotObjLike = complement(isObjLike);
+
+export default isNotObjLike;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isNotPair.js.html b/5.0.0/isNotPair.js.html new file mode 100644 index 0000000000..63157bce3b --- /dev/null +++ b/5.0.0/isNotPair.js.html @@ -0,0 +1,100 @@ + + + + + isNotPair.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isNotPair.js

+ + + + + + + +
+
+
import { complement } from 'ramda';
+
+import isPair from './isPair.js';
+
+/**
+ * Checks if input value is complement of a pair.
+ *
+ * @func isNotPair
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.19.0|v1.19.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link http://ramdajs.com/docs/#pair|R.pair}, {@link RA.isPair|isPair}
+ * @example
+ *
+ * RA.isNotPair([]); // => true
+ * RA.isNotPair([0]); // => true
+ * RA.isNotPair([0, 1]); // => false
+ * RA.isNotPair([0, 1, 2]); // => true
+ * RA.isNotPair({0: 0, 1: 1}); // => true
+ * RA.isNotPair({foo: 0, bar: 0}); // => true
+ */
+const isNotPair = complement(isPair);
+
+export default isNotPair;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isNotPlainObj.js.html b/5.0.0/isNotPlainObj.js.html new file mode 100644 index 0000000000..0a1324492b --- /dev/null +++ b/5.0.0/isNotPlainObj.js.html @@ -0,0 +1,108 @@ + + + + + isNotPlainObj.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isNotPlainObj.js

+ + + + + + + +
+
+
import { complement } from 'ramda';
+
+import isPlainObj from './isPlainObj.js';
+
+/* eslint-disable max-len */
+/**
+ * Check to see if an object is a not plain object (created using `{}`, `new Object()` or `Object.create(null)`).
+ *
+ * @func isNotPlainObj
+ * @aliases isNotPlainObject
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/0.5.0|v0.5.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isPlainObj|isPlainObj}, {@link RA.isObjLike|isObjLike}, {@link RA.isObj|isObj}
+ * @example
+ *
+ * class Bar {
+ *   constructor() {
+ *     this.prop = 'value';
+ *   }
+ * }
+ *
+ * RA.isNotPlainObj(new Bar()); //=> true
+ * RA.isNotPlainObj({ prop: 'value' }); //=> false
+ * RA.isNotPlainObj(['a', 'b', 'c']); //=> true
+ * RA.isNotPlainObj(Object.create(null); //=> false
+ * RA.isNotPlainObj(new Object()); //=> false
+ */
+/* eslint-enable max-len */
+const isNotPlainObj = complement(isPlainObj);
+
+export default isNotPlainObj;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isNotPrimitive.js.html b/5.0.0/isNotPrimitive.js.html new file mode 100644 index 0000000000..e6e8662833 --- /dev/null +++ b/5.0.0/isNotPrimitive.js.html @@ -0,0 +1,99 @@ + + + + + isNotPrimitive.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isNotPrimitive.js

+ + + + + + + +
+
+
import { complement, curryN } from 'ramda';
+
+import isPrimitive from './isPrimitive.js';
+
+/**
+ * Checks if value is not a primitive data type. There are 6 primitive data types: `string`, `number`, `bigint`, `boolean`, `undefined`, `symbol` and a special case of `null`.
+ *
+ * @func isNotPrimitive
+ * @memberOf RA
+ * @category Type
+ * @sig * -> Boolean
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.32.0|v2.32.0}
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isPrimitive|isPrimitive}, {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#primitive_values|MDN Primitive values}, {@link https://developer.mozilla.org/en-US/docs/Glossary/Primitive|MDN Primitive}
+ * @example
+ *
+ * RA.isNotPrimitive(new String("string")); //=> true
+ * RA.isNotPrimitive(new Number(1)); //=> true
+ * RA.isNotPrimitive("string"); //=> false
+ * RA.isNotPrimitive(1); //=> false
+ */
+
+const isNotPrimitive = curryN(1, complement(isPrimitive));
+
+export default isNotPrimitive;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isNotRegExp.js.html b/5.0.0/isNotRegExp.js.html new file mode 100644 index 0000000000..90bf2b00ec --- /dev/null +++ b/5.0.0/isNotRegExp.js.html @@ -0,0 +1,97 @@ + + + + + isNotRegExp.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isNotRegExp.js

+ + + + + + + +
+
+
import { complement } from 'ramda';
+
+import isRegExp from './isRegExp.js';
+
+/**
+ * Checks if value is complement of `RegExp` object.
+ *
+ * @func isNotRegExp
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.5.0|v2.5.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isRegExp|isRegExp}
+ * @example
+ *
+ * RA.isNotRegExp(1); //=> true
+ * RA.isNotRegExp(/(?:)/); //=> false
+ * RA.isNotRegExp(new RegExp()); //=> false
+ */
+const isNotRegExp = complement(isRegExp);
+
+export default isNotRegExp;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isNotSet.js.html b/5.0.0/isNotSet.js.html new file mode 100644 index 0000000000..a35a4989b4 --- /dev/null +++ b/5.0.0/isNotSet.js.html @@ -0,0 +1,99 @@ + + + + + isNotSet.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isNotSet.js

+ + + + + + + +
+
+
import { complement } from 'ramda';
+
+import isSet from './isSet.js';
+
+/**
+ * Checks if value is complement of `Set` object.
+ *
+ * @func isNotSet
+ * @memberOf RA
+ * @category Type
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.27.0|v2.27.0}
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isSet|isSet}
+ * @example
+ *
+ * RA.isNotSet(new Map()); //=> true
+ * RA.isNotSet(new Set()); //=> false
+ * RA.isNotSet(new Set([1,2]); //=> false
+ * RA.isNotSet(new Object()); //=> true
+ */
+
+const isNotSet = complement(isSet);
+
+export default isNotSet;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isNotString.js.html b/5.0.0/isNotString.js.html new file mode 100644 index 0000000000..3832c16e87 --- /dev/null +++ b/5.0.0/isNotString.js.html @@ -0,0 +1,96 @@ + + + + + isNotString.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isNotString.js

+ + + + + + + +
+
+
import { complement } from 'ramda';
+
+import isString from './isString.js';
+
+/**
+ * Checks if input value is complement of `String`.
+ *
+ * @func isNotString
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/0.4.0|v0.4.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isString|isString}
+ * @example
+ *
+ * RA.isNotString('abc'); //=> false
+ * RA.isNotString(1); //=> true
+ */
+const isNotString = complement(isString);
+
+export default isNotString;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isNotUndefined.js.html b/5.0.0/isNotUndefined.js.html new file mode 100644 index 0000000000..0328dbc6b3 --- /dev/null +++ b/5.0.0/isNotUndefined.js.html @@ -0,0 +1,97 @@ + + + + + isNotUndefined.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isNotUndefined.js

+ + + + + + + +
+
+
import { complement } from 'ramda';
+
+import isUndefined from './isUndefined.js';
+
+/**
+ * Checks if input value is complement `undefined`.
+ *
+ * @func isNotUndefined
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/0.0.1|v0.0.1}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isUndefined|isUndefined}
+ * @example
+ *
+ * RA.isNotUndefined(1); //=> true
+ * RA.isNotUndefined(undefined); //=> false
+ * RA.isNotUndefined(null); //=> true
+ */
+const isNotUndefined = complement(isUndefined);
+
+export default isNotUndefined;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isNotValidDate.js.html b/5.0.0/isNotValidDate.js.html new file mode 100644 index 0000000000..5c83dc7f5b --- /dev/null +++ b/5.0.0/isNotValidDate.js.html @@ -0,0 +1,97 @@ + + + + + isNotValidDate.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isNotValidDate.js

+ + + + + + + +
+
+
import { complement } from 'ramda';
+
+import isValidDate from './isValidDate.js';
+
+/**
+ * Checks if value is complement of valid `Date` object.
+ *
+ * @func isNotValidDate
+ * @aliases isInvalidDate
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.8.0|v1.8.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isValidDate|isValidDate}, {@link RA.isDate|isDate}, {@link RA.isNotDate|isNotDate}
+ * @example
+ *
+ * RA.isNotValidDate(new Date()); //=> false
+ * RA.isNotValidDate(new Date('a')); //=> true
+ */
+const isNotValidDate = complement(isValidDate);
+
+export default isNotValidDate;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isNotValidNumber.js.html b/5.0.0/isNotValidNumber.js.html new file mode 100644 index 0000000000..e9d80353cd --- /dev/null +++ b/5.0.0/isNotValidNumber.js.html @@ -0,0 +1,100 @@ + + + + + isNotValidNumber.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isNotValidNumber.js

+ + + + + + + +
+
+
import { complement } from 'ramda';
+
+import isValidNumber from './isValidNumber.js';
+
+/**
+ * Checks if value is not a valid `Number`. A valid `Number` is a number that is not `NaN`,
+ * `Infinity` or `-Infinity`.
+ *
+ * @func isNotValidNumber
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.2.0|v2.2.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isValidNumber|isValidNumber}
+ * @example
+ *
+ * RA.isNotValidNumber(1); //=> false
+ * RA.isNotValidNumber(''); //=> true
+ * RA.isNotValidNumber(NaN); //=> true
+ * RA.isNotValidNumber(Infinity); //=> true
+ * RA.isNotValidNumber(-Infinity); //=> true
+ */
+const isNotValidNumber = complement(isValidNumber);
+
+export default isNotValidNumber;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isNull.js.html b/5.0.0/isNull.js.html new file mode 100644 index 0000000000..c757061cf4 --- /dev/null +++ b/5.0.0/isNull.js.html @@ -0,0 +1,95 @@ + + + + + isNull.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isNull.js

+ + + + + + + +
+
+
import { equals } from 'ramda';
+
+/**
+ * Checks if input value is `null`.
+ *
+ * @func isNull
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/0.1.0|v0.1.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isNotNull|isNotNull}
+ * @example
+ *
+ * RA.isNull(1); //=> false
+ * RA.isNull(undefined); //=> false
+ * RA.isNull(null); //=> true
+ */
+const isNull = equals(null);
+
+export default isNull;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isNumber.js.html b/5.0.0/isNumber.js.html new file mode 100644 index 0000000000..b74118b41f --- /dev/null +++ b/5.0.0/isNumber.js.html @@ -0,0 +1,97 @@ + + + + + isNumber.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isNumber.js

+ + + + + + + +
+
+
import { curryN, pipe, type, identical } from 'ramda';
+
+/**
+ * Checks if value is a `Number` primitive or object.
+ *
+ * @func isNumber
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/0.6.0|v0.6.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isNotNumber|isNotNumber}
+ * @example
+ *
+ * RA.isNumber(5); // => true
+ * RA.isNumber(Number.MAX_VALUE); // => true
+ * RA.isNumber(-Infinity); // => true
+ * RA.isNumber(NaN); // => true
+ * RA.isNumber('5'); // => false
+ */
+const isNumber = curryN(1, pipe(type, identical('Number')));
+
+export default isNumber;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isObj.js.html b/5.0.0/isObj.js.html new file mode 100644 index 0000000000..a5521799e1 --- /dev/null +++ b/5.0.0/isObj.js.html @@ -0,0 +1,104 @@ + + + + + isObj.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isObj.js

+ + + + + + + +
+
+
import { both, either, curryN } from 'ramda';
+
+import isNotNull from './isNotNull.js';
+import isFunction from './isFunction.js';
+import isOfTypeObject from './internal/isOfTypeObject.js';
+
+/* eslint-disable max-len */
+/**
+ * Checks if input value is language type of `Object`.
+ *
+ * @func isObj
+ * @aliases isObject
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/0.5.0|v0.5.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isNotObj|isNotObj}, {@link RA.isObjLike|isObjLike}, {@link RA.isPlainObj|isPlainObj}
+ * @example
+ *
+ * RA.isObj({}); //=> true
+ * RA.isObj([]); //=> true
+ * RA.isObj(() => {}); //=> true
+ * RA.isObj(null); //=> false
+ * RA.isObj(undefined); //=> false
+ */
+/* eslint-enable max-len */
+const isObj = curryN(1, both(isNotNull, either(isOfTypeObject, isFunction)));
+
+export default isObj;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isObjLike.js.html b/5.0.0/isObjLike.js.html new file mode 100644 index 0000000000..c8fe83c98b --- /dev/null +++ b/5.0.0/isObjLike.js.html @@ -0,0 +1,103 @@ + + + + + isObjLike.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isObjLike.js

+ + + + + + + +
+
+
import { both, curryN } from 'ramda';
+
+import isNotNull from './isNotNull.js';
+import isOfTypeObject from './internal/isOfTypeObject.js';
+
+/* eslint-disable max-len */
+/**
+ * Checks if value is object-like. A value is object-like if it's not null and has a typeof result of "object".
+ *
+ * @func isObjLike
+ * @aliases isObjectLike
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/0.5.0|v0.5.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isNotObjLike|isNotObjLike}, {@link RA.isObj|isObj}, {@link RA.isPlainObj|isPlainObj}
+ * @example
+ *
+ * RA.isObjLike({}); //=> true
+ * RA.isObjLike([]); //=> true
+ * RA.isObjLike(() => {}); //=> false
+ * RA.isObjLike(null); //=> false
+ * RA.isObjLike(undefined); //=> false
+ */
+/* eslint-enable max-len */
+const isObjLike = curryN(1, both(isNotNull, isOfTypeObject));
+
+export default isObjLike;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isOdd.js.html b/5.0.0/isOdd.js.html new file mode 100644 index 0000000000..1118ef797e --- /dev/null +++ b/5.0.0/isOdd.js.html @@ -0,0 +1,102 @@ + + + + + isOdd.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isOdd.js

+ + + + + + + +
+
+
import { both, pipe, modulo, flip, equals, complement, curryN } from 'ramda';
+
+import isInteger from './isInteger.js';
+
+/**
+ * Checks if value is odd integer number.
+ * An odd number is an integer which is not a multiple DIVISIBLE of two.
+ *
+ * @func isOdd
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.18.0|v1.18.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isEven|isEven}
+ * @example
+ *
+ * RA.isOdd(1); // => true
+ * RA.isOdd(-Infinity); // => false
+ * RA.isOdd(4); // => false
+ * RA.isOdd(3); // => true
+ */
+const isOdd = curryN(
+  1,
+  both(isInteger, pipe(flip(modulo)(2), complement(equals)(0)))
+);
+
+export default isOdd;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isPair.js.html b/5.0.0/isPair.js.html new file mode 100644 index 0000000000..c96a6e8008 --- /dev/null +++ b/5.0.0/isPair.js.html @@ -0,0 +1,100 @@ + + + + + isPair.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isPair.js

+ + + + + + + +
+
+
import { both, equals, length, pipe, curryN } from 'ramda';
+
+import isArray from './isArray.js';
+
+/**
+ * Checks if input value is a pair.
+ *
+ * @func isPair
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.19.0|v1.19.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link http://ramdajs.com/docs/#pair|R.pair}, {@link RA.isNotPair|isNotPair}
+ * @example
+ *
+ * RA.isPair([]); // => false
+ * RA.isPair([0]); // => false
+ * RA.isPair([0, 1]); // => true
+ * RA.isPair([0, 1, 2]); // => false
+ * RA.isPair({ 0: 0, 1: 1 }); // => false
+ * RA.isPair({ foo: 0, bar: 0 }); // => false
+ */
+const isPair = curryN(1, both(isArray, pipe(length, equals(2))));
+
+export default isPair;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isPlainObj.js.html b/5.0.0/isPlainObj.js.html new file mode 100644 index 0000000000..5d3f8c86cf --- /dev/null +++ b/5.0.0/isPlainObj.js.html @@ -0,0 +1,138 @@ + + + + + isPlainObj.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isPlainObj.js

+ + + + + + + +
+
+
import {
+  pipe,
+  type,
+  identical,
+  both,
+  equals,
+  toString,
+  pathSatisfies,
+  curryN,
+} from 'ramda';
+
+import isNull from './isNull.js';
+import isObjLike from './isObjLike.js';
+import isFunction from './isFunction.js';
+
+const isObject = pipe(type, identical('Object'));
+const isObjectConstructor = pipe(toString, equals(toString(Object)));
+const hasObjectConstructor = pathSatisfies(
+  both(isFunction, isObjectConstructor),
+  ['constructor']
+);
+
+/* eslint-disable max-len */
+/**
+ * Check to see if an object is a plain object (created using `{}`, `new Object()` or `Object.create(null)`).
+ *
+ * @func isPlainObj
+ * @aliases isPlainObject
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/0.5.0|v0.5.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isNotPlainObj|isNotPlainObj}, {@link RA.isObjLike|isObjLike}, {@link RA.isObj|isObj}
+ * @example
+ *
+ * class Bar {
+ *   constructor() {
+ *     this.prop = 'value';
+ *   }
+ * }
+ *
+ * RA.isPlainObj(new Bar()); //=> false
+ * RA.isPlainObj({ prop: 'value' }); //=> true
+ * RA.isPlainObj(['a', 'b', 'c']); //=> false
+ * RA.isPlainObj(Object.create(null); //=> true
+ * RA.isPlainObj(new Object()); //=> true
+ */
+/* eslint-enable max-len */
+const isPlainObj = curryN(1, (val) => {
+  if (!isObjLike(val) || !isObject(val)) {
+    return false;
+  }
+
+  const proto = Object.getPrototypeOf(val);
+
+  if (isNull(proto)) {
+    return true;
+  }
+
+  return hasObjectConstructor(proto);
+});
+
+export default isPlainObj;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isPositive.js.html b/5.0.0/isPositive.js.html new file mode 100644 index 0000000000..0be8e1375e --- /dev/null +++ b/5.0.0/isPositive.js.html @@ -0,0 +1,99 @@ + + + + + isPositive.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isPositive.js

+ + + + + + + +
+
+
import { both, lt } from 'ramda';
+
+import isNumber from './isNumber.js';
+
+/**
+ * Checks if value is a positive `Number` primitive or object. Zero is not considered positive.
+ *
+ * @func isPositive
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.15.0|v1.15.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isNegative|isNegative}
+ * @example
+ *
+ * RA.isPositive(1); // => true
+ * RA.isPositive(Number.MAX_VALUE); // => true
+ * RA.isPositive(-Infinity); // => false
+ * RA.isPositive(NaN); // => false
+ * RA.isPositive('5'); // => false
+ */
+const isPositive = both(isNumber, lt(0));
+
+export default isPositive;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isPositiveZero.js.html b/5.0.0/isPositiveZero.js.html new file mode 100644 index 0000000000..bc11487341 --- /dev/null +++ b/5.0.0/isPositiveZero.js.html @@ -0,0 +1,96 @@ + + + + + isPositiveZero.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isPositiveZero.js

+ + + + + + + +
+
+
import { identical, curryN } from 'ramda';
+
+/**
+ * Checks if value is a positive zero (+0).
+ *
+ * @func isPositiveZero
+ * @memberof RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.22.0|v2.22.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isNegativeZero|isNegativeZero}
+ * @example
+ *
+ * RA.isPositiveZero(+0); //=> true
+ * RA.isPositiveZero(0); //=> true
+ * RA.isPositiveZero(-0); //=> false
+ * RA.isPositiveZero(null); //=> false
+ */
+const isPositiveZero = curryN(1, identical(+0));
+
+export default isPositiveZero;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isPrimitive.js.html b/5.0.0/isPrimitive.js.html new file mode 100644 index 0000000000..7b708b72af --- /dev/null +++ b/5.0.0/isPrimitive.js.html @@ -0,0 +1,119 @@ + + + + + isPrimitive.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isPrimitive.js

+ + + + + + + +
+
+
import { both, anyPass } from 'ramda';
+
+import isNotObj from './isNotObj.js';
+import isString from './isString.js';
+import isNumber from './isNumber.js';
+import isBigInt from './isBigInt.js';
+import isBoolean from './isBoolean.js';
+import isUndefined from './isUndefined.js';
+import isNull from './isNull.js';
+import isSymbol from './isSymbol.js';
+
+/**
+ * Checks if value is a primitive data type. There are 6 primitive data types: `string`, `number`, `bigint`, `boolean`, `undefined`, `symbol` and a special case of `null`.
+ * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Primitive_values
+ * for definition of what sub-types comprise a primitive.
+ *
+ * @func isPrimitive
+ * @memberOf RA
+ * @category Type
+ * @sig * -> Boolean
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.32.0|v2.32.0}
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isNotPrimitive|isNotPrimitive}, {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#primitive_values|MDN Primitive values}, {@link https://developer.mozilla.org/en-US/docs/Glossary/Primitive|MDN Primitive}
+ * @example
+ *
+ * RA.isPrimitive("string"); //=> true
+ * RA.isPrimitive(1); //=> true
+ * RA.isPrimitive(new String("string")); //=> false
+ * RA.isPrimitive(new Number(1)); //=> false
+ */
+
+const isPrimitive = both(
+  isNotObj,
+  anyPass([
+    isString,
+    isNumber,
+    isBigInt,
+    isBoolean,
+    isUndefined,
+    isNull,
+    isSymbol,
+  ])
+);
+
+export default isPrimitive;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isPromise.js.html b/5.0.0/isPromise.js.html new file mode 100644 index 0000000000..0872564bff --- /dev/null +++ b/5.0.0/isPromise.js.html @@ -0,0 +1,105 @@ + + + + + isPromise.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isPromise.js

+ + + + + + + +
+
+
import { both, pipe, toString, equals, curryN } from 'ramda';
+
+import isObj from './isObj.js';
+
+/**
+ * Checks if input value is a native `Promise`.
+ * The Promise object represents the eventual completion (or failure)
+ * of an asynchronous operation, and its resulting value.
+ *
+ * @func isPromise
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.1.0|v2.1.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link https://promisesaplus.com/|Promises/A+}, {@link RA.isThenable|isThenable}
+ * @example
+ *
+ * RA.isPromise(null); // => false
+ * RA.isPromise(undefined); // => false
+ * RA.isPromise([]); // => false
+ * RA.isPromise(Promise.resolve()); // => true
+ * RA.isPromise(Promise.reject()); // => true
+ * RA.isPromise({ then: () => 1 }); // => false
+ */
+const isPromise = curryN(
+  1,
+  both(isObj, pipe(toString, equals('[object Promise]')))
+);
+
+export default isPromise;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isPrototypeOf.js.html b/5.0.0/isPrototypeOf.js.html new file mode 100644 index 0000000000..a17b423172 --- /dev/null +++ b/5.0.0/isPrototypeOf.js.html @@ -0,0 +1,109 @@ + + + + + isPrototypeOf.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isPrototypeOf.js

+ + + + + + + +
+
+
import { curry } from 'ramda';
+
+import invokeArgs from './invokeArgs.js';
+
+/**
+ * Checks if an object exists in another object's prototype chain.
+ *
+ * @func isPrototypeOf
+ * @category Object
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.31.0|v2.31.0}
+ * @sig * -> Boolean
+ * @param {Object} type The prototype that we're searching for
+ * @param {Object} object The object whose prototype chain will be searched
+ * @return {boolean}
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isPrototypeOf|Object.prorotype.isPrototypeOf}
+ * @example
+ * function Foo() {}
+ * function Bar() {}
+ * function Baz() {}
+ *
+ * Bar.prototype = Object.create(Foo.prototype);
+ * Baz.prototype = Object.create(Bar.prototype);
+ *
+ * const baz = new Baz();
+ *
+ * RA.isPrototypeOf(Baz, baz); // => true
+ * RA.isPrototypeOf(Bar, baz); // => true
+ * RA.isPrototypeOf(Foo, baz); // => true
+ * RA.isPrototypeOf(Object, baz); // => true
+ */
+const isPrototypeOf = curry((type, object) =>
+  Boolean(invokeArgs(['prototype', 'isPrototypeOf'], [object], type))
+);
+
+export default isPrototypeOf;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isRegExp.js.html b/5.0.0/isRegExp.js.html new file mode 100644 index 0000000000..09b09958bc --- /dev/null +++ b/5.0.0/isRegExp.js.html @@ -0,0 +1,95 @@ + + + + + isRegExp.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isRegExp.js

+ + + + + + + +
+
+
import { type, identical, pipe, curryN } from 'ramda';
+
+/**
+ * Checks if value is `RegExp` object.
+ *
+ * @func isRegExp
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.5.0|v2.5.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isNotRegExp|isNotRegExp}
+ * @example
+ *
+ * RA.isRegExp(new RegExp()); //=> true
+ * RA.isRegExp(/(?:)/); //=> true
+ * RA.isRegExp(1); //=> false
+ */
+const isRegExp = curryN(1, pipe(type, identical('RegExp')));
+
+export default isRegExp;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isSafeInteger.js.html b/5.0.0/isSafeInteger.js.html new file mode 100644 index 0000000000..cb1dc06504 --- /dev/null +++ b/5.0.0/isSafeInteger.js.html @@ -0,0 +1,113 @@ + + + + + isSafeInteger.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isSafeInteger.js

+ + + + + + + +
+
+
import { bind, curryN } from 'ramda';
+
+import isFunction from './isFunction.js';
+import ponyfill from './internal/ponyfills/Number.isSafeInteger.js';
+
+export const isSafeIntegerPonyfill = curryN(1, ponyfill);
+
+/**
+ * Checks whether the passed value is a safe `integer`.
+ *
+ * @func isSafeInteger
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.22.0|v2.22.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @example
+ *
+ * RA.isSafeInteger(3); //=> true
+ * RA.isSafeInteger(Math.pow(2, 53)) //=> false
+ * RA.isSafeInteger(Math.pow(2, 53) - 1); //=> true
+ * RA.isSafeInteger(NaN); //=> false
+ * RA.isSafeInteger(Infinity); //=> false
+ * RA.isSafeInteger('3') //=> false
+ * RA.isSafeInteger(3.1); //=> false
+ * RA.isSafeInteger(3.0); //=> true
+ * RA.isSafeInteger('string'); //=> false
+ * RA.isSafeInteger(null); //=> false
+ * RA.isSafeInteger(undefined); //=> false
+ * RA.isSafeInteger({}); //=> false
+ * RA.isSafeInteger(() => { }); //=> false
+ * RA.isSafeInteger(true); //=> false
+ */
+
+const isSafeInteger = isFunction(Number.isSafeInteger)
+  ? curryN(1, bind(Number.isSafeInteger, Number))
+  : isSafeIntegerPonyfill;
+
+export default isSafeInteger;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isSentinelValue.js.html b/5.0.0/isSentinelValue.js.html new file mode 100644 index 0000000000..adc84a0a0f --- /dev/null +++ b/5.0.0/isSentinelValue.js.html @@ -0,0 +1,99 @@ + + + + + isSentinelValue.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isSentinelValue.js

+ + + + + + + +
+
+
import { curryN } from 'ramda';
+
+import isInteger32 from './isInteger32.js';
+
+/**
+ * Checks whether the passed value is {@link https://github.com/getify/You-Dont-Know-JS/blob/9959fc904d584bbf0b02cf41c192f74ff4238581/types-grammar/ch4.md#the-curious-case-of-the-|a sentinel value}.
+ *
+ * @func isSentinelValue
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.33.0|v2.33.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @example
+ *
+ * RA.isSentinelValue(-1); //=> true
+ *
+ * RA.isSentinelValue('-1'); //=> false
+ * RA.isSentinelValue(1); //=> false
+ * RA.isSentinelValue([-1]); //=> false
+ */
+// eslint-disable-next-line no-bitwise
+const isSentinelValue = curryN(1, (val) => isInteger32(val) && ~val === 0);
+
+export default isSentinelValue;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isSet.js.html b/5.0.0/isSet.js.html new file mode 100644 index 0000000000..ce2ffee0e7 --- /dev/null +++ b/5.0.0/isSet.js.html @@ -0,0 +1,97 @@ + + + + + isSet.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isSet.js

+ + + + + + + +
+
+
import { type, identical, pipe, curryN } from 'ramda';
+
+/**
+ * Predicate for determining if a provided value is an instance of a Set.
+ *
+ * @func isSet
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.22.0|v2.22.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isMap|isMap}}
+ * @example
+ *
+ * RA.isSet(new Map()); //=> false
+ * RA.isSet(new Set()); //=> true
+ * RA.isSet(new Set([1,2]); //=> true
+ * RA.isSet(new Object()); //=> false
+ */
+
+const isSet = curryN(1, pipe(type, identical('Set')));
+
+export default isSet;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isSparseArray.js.html b/5.0.0/isSparseArray.js.html new file mode 100644 index 0000000000..1bac7b5377 --- /dev/null +++ b/5.0.0/isSparseArray.js.html @@ -0,0 +1,116 @@ + + + + + isSparseArray.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isSparseArray.js

+ + + + + + + +
+
+
import {
+  values,
+  both,
+  complement,
+  pipe,
+  converge,
+  identical,
+  length,
+} from 'ramda';
+
+import isArray from './isArray.js';
+
+/**
+ * Checks if input value is a sparse Array.
+ * An array with at least one "empty slot" in it is often called a "sparse array."
+ * Empty slot doesn't mean that the slot contains `null` or `undefined` values,
+ * but rather that the slots don't exist.
+ *
+ * @func isSparseArray
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.20.0|v2.20.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} list The list to test
+ * @return {boolean}
+ * @see {@link https://github.com/getify/You-Dont-Know-JS/blob/f0d591b6502c080b92e18fc470432af8144db610/types%20%26%20grammar/ch3.md#array|Sparse Arrays}, {@link RA.isArray|isArray}
+ * @example
+ *
+ * RA.isSparseArray(new Array(3)); // => true
+ * RA.isSparseArray([1,,3]); // => true
+ *
+ * const list = [1, 2, 3];
+ * delete list[1];
+ * RA.isSparseArray(list); // => true
+ *
+ * RA.isSparseArray([1, 2, 3]); // => false
+ */
+const isSparseArray = both(
+  isArray,
+  converge(complement(identical), [pipe(values, length), length])
+);
+
+export default isSparseArray;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isString.js.html b/5.0.0/isString.js.html new file mode 100644 index 0000000000..62c4c205f9 --- /dev/null +++ b/5.0.0/isString.js.html @@ -0,0 +1,94 @@ + + + + + isString.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isString.js

+ + + + + + + +
+
+
import { curryN, pipe, type, identical } from 'ramda';
+
+/**
+ * Checks if input value is `String`.
+ *
+ * @func isString
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/0.4.0|v0.4.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isNotString|isNotString}
+ * @example
+ *
+ * RA.isString('abc'); //=> true
+ * RA.isString(1); //=> false
+ */
+const isString = curryN(1, pipe(type, identical('String')));
+
+export default isString;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isSymbol.js.html b/5.0.0/isSymbol.js.html new file mode 100644 index 0000000000..2bc78ce4f6 --- /dev/null +++ b/5.0.0/isSymbol.js.html @@ -0,0 +1,102 @@ + + + + + isSymbol.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isSymbol.js

+ + + + + + + +
+
+
import { type, curryN } from 'ramda';
+
+/**
+ * Checks if input value is a Symbol.
+ *
+ * @func isSymbol
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.22.0|v2.22.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol|MDN Symbol}
+ * @example
+ *
+ * RA.isSymbol(Symbol('1')); //=> true
+ * RA.isSymbol(Symbol(1)); //=> true
+ * RA.isSymbol('string'); //=> false
+ * RA.isSymbol(undefined); //=> false
+ * RA.isSymbol(null); //=> false
+ */
+const isSymbol = curryN(
+  1,
+  (val) =>
+    typeof val === 'symbol' ||
+    (typeof val === 'object' && type(val) === 'Symbol')
+);
+
+export default isSymbol;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isThenable.js.html b/5.0.0/isThenable.js.html new file mode 100644 index 0000000000..a3cea55484 --- /dev/null +++ b/5.0.0/isThenable.js.html @@ -0,0 +1,101 @@ + + + + + isThenable.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isThenable.js

+ + + + + + + +
+
+
import { pathSatisfies } from 'ramda';
+
+import isFunction from './isFunction.js';
+
+/**
+ * Checks if input value is a `thenable`.
+ * `thenable` is an object or function that defines a `then` method.
+ *
+ * @func isThenable
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.1.0|v2.1.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isPromise|isPromise}
+ * @example
+ *
+ * RA.isThenable(null); // => false
+ * RA.isThenable(undefined); // => false
+ * RA.isThenable([]); // => false
+ * RA.isThenable(Promise.resolve()); // => true
+ * RA.isThenable(Promise.reject()); // => true
+ * RA.isThenable({ then: () => 1 }); // => true
+ */
+const isThenable = pathSatisfies(isFunction, ['then']);
+
+export default isThenable;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isTrue.js.html b/5.0.0/isTrue.js.html new file mode 100644 index 0000000000..9904745775 --- /dev/null +++ b/5.0.0/isTrue.js.html @@ -0,0 +1,100 @@ + + + + + isTrue.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isTrue.js

+ + + + + + + +
+
+
import { identical, curryN } from 'ramda';
+
+/**
+ * Checks if input value is the Boolean primitive `true`. Will return false for Boolean objects
+ * created using the `Boolean` function as a constructor.
+ *
+ * @func isTrue
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.6.0|v2.6.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isFalse|isFalse}, {@link RA.isTruthy|isTruthy}, {@link RA.isFalsy|isFalsy}
+ * @example
+ *
+ * RA.isTrue(true); // => true
+ * RA.isTrue(Boolean(true)); // => true
+ * RA.isTrue(false); // => false
+ * RA.isTrue(1); // => false
+ * RA.isTrue('true'); // => false
+ * RA.isTrue(new Boolean(true)); // => false
+ */
+
+const isTrue = curryN(1, identical(true));
+
+export default isTrue;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isTruthy.js.html b/5.0.0/isTruthy.js.html new file mode 100644 index 0000000000..81b887fb26 --- /dev/null +++ b/5.0.0/isTruthy.js.html @@ -0,0 +1,101 @@ + + + + + isTruthy.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isTruthy.js

+ + + + + + + +
+
+
import { curryN } from 'ramda';
+
+/**
+ * In JavaScript, a `truthy` value is a value that is considered true
+ * when evaluated in a Boolean context. All values are truthy unless
+ * they are defined as falsy (i.e., except for `false`, `0`, `""`, `null`, `undefined`, and `NaN`).
+ *
+ * @func isTruthy
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.2.0|v2.2.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link https://developer.mozilla.org/en-US/docs/Glossary/Truthy|truthy}, {@link RA.isFalsy|isFalsy}
+ * @example
+ *
+ * RA.isTruthy({}); // => true
+ * RA.isTruthy([]); // => true
+ * RA.isTruthy(42); // => true
+ * RA.isTruthy(3.14); // => true
+ * RA.isTruthy('foo'); // => true
+ * RA.isTruthy(new Date()); // => true
+ * RA.isTruthy(Infinity); // => true
+ */
+const isTruthy = curryN(1, Boolean);
+
+export default isTruthy;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isUinteger32.js.html b/5.0.0/isUinteger32.js.html new file mode 100644 index 0000000000..875f08945b --- /dev/null +++ b/5.0.0/isUinteger32.js.html @@ -0,0 +1,102 @@ + + + + + isUinteger32.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isUinteger32.js

+ + + + + + + +
+
+
import { curryN } from 'ramda';
+
+import toUinteger32 from './toUinteger32.js';
+
+/**
+ * Checks whether the passed value is an unsigned 32 bit integer.
+ *
+ * @func isUinteger32
+ * @aliases isUint32
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/3.2.0|v3.2.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.toUinteger32|toUinteger32}
+ * @example
+ *
+ * RA.isUinteger32(0); //=> true
+ * RA.isUinteger32(2 ** 32 - 1); //=> true
+ *
+ * RA.isUinteger32(Infinity); //=> false
+ * RA.isUinteger32(NaN); //=> false
+ * RA.isUinteger32(-1); //=> false
+ * RA.isUinteger32(2 ** 32); //=> false
+ */
+const isUinteger32 = curryN(1, (val) => toUinteger32(val) === val);
+
+export default isUinteger32;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isUndefined.js.html b/5.0.0/isUndefined.js.html new file mode 100644 index 0000000000..1579be18dc --- /dev/null +++ b/5.0.0/isUndefined.js.html @@ -0,0 +1,97 @@ + + + + + isUndefined.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isUndefined.js

+ + + + + + + +
+
+
import { equals } from 'ramda';
+
+import stubUndefined from './stubUndefined.js';
+
+/**
+ * Checks if input value is `undefined`.
+ *
+ * @func isUndefined
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/0.0.1|v0.0.1}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isNotUndefined|isNotUndefined}
+ * @example
+ *
+ * RA.isUndefined(1); //=> false
+ * RA.isUndefined(undefined); //=> true
+ * RA.isUndefined(null); //=> false
+ */
+const isUndefined = equals(stubUndefined());
+
+export default isUndefined;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isValidDate.js.html b/5.0.0/isValidDate.js.html new file mode 100644 index 0000000000..7808a7f0b9 --- /dev/null +++ b/5.0.0/isValidDate.js.html @@ -0,0 +1,102 @@ + + + + + isValidDate.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isValidDate.js

+ + + + + + + +
+
+
import { invoker, both, pipe, curryN } from 'ramda';
+
+import isDate from './isDate.js';
+import isNotNaN from './isNotNaN.js';
+
+/* eslint-disable max-len */
+/**
+ * Checks if value is valid `Date` object.
+ *
+ * @func isValidDate
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.8.0|v1.8.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isDate|isDate}, {@link RA.isNotDate|isNotDate}, {@link RA.isNotValidDate|isNotValidDate}
+ * @example
+ *
+ * RA.isValidDate(new Date()); //=> true
+ * RA.isValidDate(new Date('a')); //=> false
+ */
+/* eslint-enable max-len */
+const isValidDate = curryN(
+  1,
+  both(isDate, pipe(invoker(0, 'getTime'), isNotNaN))
+);
+
+export default isValidDate;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/isValidNumber.js.html b/5.0.0/isValidNumber.js.html new file mode 100644 index 0000000000..e504371815 --- /dev/null +++ b/5.0.0/isValidNumber.js.html @@ -0,0 +1,101 @@ + + + + + isValidNumber.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

isValidNumber.js

+ + + + + + + +
+
+
import { either, curryN } from 'ramda';
+
+import isFloat from './isFloat.js';
+import isInteger from './isInteger.js';
+
+/**
+ * Checks if value is a valid `Number`. A valid `Number` is a number that is not `NaN`, `Infinity`
+ * or `-Infinity`.
+ *
+ * @func isValidNumber
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.2.0|v2.2.0}
+ * @category Type
+ * @sig * -> Boolean
+ * @param {*} val The value to test
+ * @return {boolean}
+ * @see {@link RA.isNotValidNumber|isNotValidNumber}
+ * @example
+ *
+ * RA.isValidNumber(1); //=> true
+ * RA.isValidNumber(''); //=> false
+ * RA.isValidNumber(NaN); //=> false
+ * RA.isValidNumber(Infinity); //=> false
+ * RA.isValidNumber(-Infinity); //=> false
+ */
+const isValidNumber = curryN(1, either(isInteger, isFloat));
+
+export default isValidNumber;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/lastP.js.html b/5.0.0/lastP.js.html new file mode 100644 index 0000000000..bc2af5530f --- /dev/null +++ b/5.0.0/lastP.js.html @@ -0,0 +1,127 @@ + + + + + lastP.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

lastP.js

+ + + + + + + +
+
+
import { bind, last, map, curryN } from 'ramda';
+
+import allP from './allP.js';
+import lengthEq from './lengthEq.js';
+import lengthGte from './lengthGte.js';
+import rejectP from './rejectP.js';
+import resolveP from './resolveP.js';
+
+/**
+ * Returns a promise that is fulfilled by the last given promise to be fulfilled,
+ * or rejected with an array of rejection reasons if all of the given promises are rejected.
+ *
+ * @func lastP
+ * @memberOf RA
+ * @category Function
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.23.0|v2.23.0}
+ * @sig [Promise a] -> Promise a
+ * @param {Iterable.<*>} iterable An iterable object such as an Array or String
+ * @return {Promise} A promise that is fulfilled by the last given promise to be fulfilled, or rejected with an array of rejection reasons if all of the given promises are rejected.
+ * @see {@link RA.anyP|anyP}
+ * @example
+ *
+ * const delayP = timeout => new Promise(resolve => setTimeout(() => resolve(timeout), timeout));
+ * delayP.reject = timeout => new Promise((resolve, reject) => setTimeout(() => reject(timeout), timeout));
+ * RA.lastP([
+ *   1,
+ *   delayP(10),
+ *   delayP(100),
+ *   delayP.reject(1000),
+ * ]); //=> Promise(100)
+ */
+const lastP = curryN(1, (iterable) => {
+  const fulfilled = [];
+  const rejected = [];
+  const onFulfill = bind(fulfilled.push, fulfilled);
+  const onReject = bind(rejected.push, rejected);
+
+  const listOfPromises = map(
+    (p) => resolveP(p).then(onFulfill).catch(onReject),
+    [...iterable]
+  );
+
+  return allP(listOfPromises).then(() => {
+    if (lengthEq(0, fulfilled) && lengthEq(0, rejected)) {
+      return undefined;
+    }
+    if (lengthGte(1, fulfilled)) {
+      return last(fulfilled);
+    }
+    return rejectP(rejected);
+  });
+});
+
+export default lastP;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/lengthEq.js.html b/5.0.0/lengthEq.js.html new file mode 100644 index 0000000000..788aae0ffb --- /dev/null +++ b/5.0.0/lengthEq.js.html @@ -0,0 +1,97 @@ + + + + + lengthEq.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

lengthEq.js

+ + + + + + + +
+
+
import { equals } from 'ramda';
+
+import compareLength from './internal/compareLength.js';
+
+/**
+ * Returns `true` if the supplied list or string has a length equal to `valueLength`.
+ *
+ * @func lengthEq
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.8.0|v2.8.0}
+ * @category List
+ * @sig Number -> [*] -> Boolean
+ * @param {number} valueLength The length of the list or string
+ * @param {Array|string} value The list or string
+ * @return {boolean}
+ * @see {@link RA.lengthNotEq|lengthNotEq}, {@link RA.lengthLt|lengthLt}, {@link RA.lengthGt|lengthGt}, {@link RA.lengthLte|lengthLte}, {@link RA.lengthGte|lengthGte},, {@link http://ramdajs.com/docs/#equals|equals}, {@link http://ramdajs.com/docs/#length|length}
+ * @example
+ *
+ * RA.lengthEq(3, [1,2,3]); //=> true
+ * RA.lengthEq(3, [1,2,3,4]); //=> false
+ */
+const lengthEq = compareLength(equals);
+
+export default lengthEq;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/lengthGt.js.html b/5.0.0/lengthGt.js.html new file mode 100644 index 0000000000..ca9b7ddb51 --- /dev/null +++ b/5.0.0/lengthGt.js.html @@ -0,0 +1,97 @@ + + + + + lengthGt.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

lengthGt.js

+ + + + + + + +
+
+
import { flip, gt } from 'ramda';
+
+import compareLength from './internal/compareLength.js';
+
+/**
+ * Returns `true` if the supplied list or string has a length greater than `valueLength`.
+ *
+ * @func lengthGt
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.8.0|v2.8.0}
+ * @category List
+ * @sig Number -> [*] -> Boolean
+ * @param {number} valueLength The length of the list or string
+ * @param {Array|string} value The list or string
+ * @return {boolean}
+ * @see {@link RA.lengthEq|lengthEq}, {@link RA.lengthNotEq|lengthNotEq}, {@link RA.lengthLt|lengthLt}, {@link RA.lengthLte|lengthLte}, {@link RA.lengthGte|lengthGte}, {@link http://ramdajs.com/docs/#gt|gt},  {@link http://ramdajs.com/docs/#length|length}
+ * @example
+ *
+ * RA.lengthGt(3, [1,2,3,4]); //=> true
+ * RA.lengthGt(3, [1,2,3]); //=> false
+ */
+const lengthGt = compareLength(flip(gt));
+
+export default lengthGt;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/lengthGte.js.html b/5.0.0/lengthGte.js.html new file mode 100644 index 0000000000..c3ebd1c3b3 --- /dev/null +++ b/5.0.0/lengthGte.js.html @@ -0,0 +1,99 @@ + + + + + lengthGte.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

lengthGte.js

+ + + + + + + +
+
+
import { flip, gte } from 'ramda';
+
+import compareLength from './internal/compareLength.js';
+
+/**
+ * Returns `true` if the supplied list or string has a length greater than or equal to
+ * `valueLength`.
+ *
+ * @func lengthGte
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.8.0|v2.8.0}
+ * @category List
+ * @sig Number -> [*] -> Boolean
+ * @param {number} valueLength The length of the list or string
+ * @param {Array|string} value The list or string
+ * @return {boolean}
+ * @see {@link RA.lengthEq|lengthEq}, {@link RA.lengthNotEq|lengthNotEq}, {@link RA.lengthLt|lengthLt}, {@link RA.lengthGt|lengthGt}, {@link RA.lengthLte|lengthLte}, {@link http://ramdajs.com/docs/#gte|gte}, {@link http://ramdajs.com/docs/#length|length}
+ * @example
+ *
+ * RA.lengthGte(3, [1,2,3,4]); //=> true
+ * RA.lengthGte(3, [1,2,3]); //=> true
+ * RA.lengthGte(3, [1,2]); //=> false
+ */
+const lengthGte = compareLength(flip(gte));
+
+export default lengthGte;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/lengthLt.js.html b/5.0.0/lengthLt.js.html new file mode 100644 index 0000000000..8317c611a2 --- /dev/null +++ b/5.0.0/lengthLt.js.html @@ -0,0 +1,97 @@ + + + + + lengthLt.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

lengthLt.js

+ + + + + + + +
+
+
import { flip, lt } from 'ramda';
+
+import compareLength from './internal/compareLength.js';
+
+/**
+ * Returns `true` if the supplied list or string has a length less than `valueLength`.
+ *
+ * @func lengthLt
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.8.0|v2.8.0}
+ * @category List
+ * @sig Number -> [*] -> Boolean
+ * @param {number} valueLength The length of the list or string
+ * @param {Array|string} value The list or string
+ * @return {boolean}
+ * @see {@link RA.lengthEq|lengthEq}, {@link RA.lengthNotEq|lengthNotEq}, {@link RA.lengthGt|lengthGt}, {@link RA.lengthLte|lengthLte}, {@link RA.lengthGte|lengthGte}, {@link http://ramdajs.com/docs/#lt|lt}, {@link http://ramdajs.com/docs/#length|length}
+ * @example
+ *
+ * RA.lengthLt(3, [1,2]); //=> true
+ * RA.lengthLt(3, [1,2,3]); //=> false
+ */
+const lengthLt = compareLength(flip(lt));
+
+export default lengthLt;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/lengthLte.js.html b/5.0.0/lengthLte.js.html new file mode 100644 index 0000000000..b110fa9b20 --- /dev/null +++ b/5.0.0/lengthLte.js.html @@ -0,0 +1,98 @@ + + + + + lengthLte.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

lengthLte.js

+ + + + + + + +
+
+
import { flip, lte } from 'ramda';
+
+import compareLength from './internal/compareLength.js';
+
+/**
+ * Returns `true` if the supplied list or string has a length less than or equal to `valueLength`.
+ *
+ * @func lengthLte
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.8.0|v2.8.0}
+ * @category List
+ * @sig Number -> [*] -> Boolean
+ * @param {number} valueLength The length of the list or string
+ * @param {Array|string} value The list or string
+ * @return {boolean}
+ * @see {@link RA.lengthEq|lengthEq}, {@link RA.lengthNotEq|lengthNotEq}, {@link RA.lengthLt|lengthLt}, {@link RA.lengthGt|lengthGt}, {@link RA.lengthGte|lengthGte}, {@link http://ramdajs.com/docs/#lte|lte}, {@link http://ramdajs.com/docs/#length|length}
+ * @example
+ *
+ * RA.lengthLte(3, [1,2]); //=> true
+ * RA.lengthLte(3, [1,2,3]); //=> true
+ * RA.lengthLte(3, [1,2,3,4]); //=> false
+ */
+const lengthLte = compareLength(flip(lte));
+
+export default lengthLte;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/lengthNotEq.js.html b/5.0.0/lengthNotEq.js.html new file mode 100644 index 0000000000..5dd8e4257e --- /dev/null +++ b/5.0.0/lengthNotEq.js.html @@ -0,0 +1,97 @@ + + + + + lengthNotEq.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

lengthNotEq.js

+ + + + + + + +
+
+
import { complement, equals } from 'ramda';
+
+import compareLength from './internal/compareLength.js';
+
+/**
+ * Returns `true` if the supplied list or string has a length not equal to `valueLength`.
+ *
+ * @func lengthNotEq
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.8.0|v2.8.0}
+ * @category List
+ * @sig Number -> [*] -> Boolean
+ * @param {number} valueLength The length of the list or string
+ * @param {Array|string} value The list or string
+ * @return {boolean}
+ * @see {@link RA.lengthEq|lengthEq}, {@link RA.lengthLt|lengthLt}, {@link RA.lengthGt|lengthGt}, {@link RA.lengthLte|lengthLte}, {@link RA.lengthGte|lengthGte}, {@link http://ramdajs.com/docs/#equals|equals}, {@link http://ramdajs.com/docs/#length|length}
+ * @example
+ *
+ * RA.lengthNotEq(3, [1,2,3,4]); //=> true
+ * RA.lengthNotEq(3, [1,2,3]); //=> false
+ */
+const lengthNotEq = compareLength(complement(equals));
+
+export default lengthNotEq;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/lensEq.js.html b/5.0.0/lensEq.js.html new file mode 100644 index 0000000000..eb495eebd7 --- /dev/null +++ b/5.0.0/lensEq.js.html @@ -0,0 +1,101 @@ + + + + + lensEq.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

lensEq.js

+ + + + + + + +
+
+
import { view, curryN, equals, pipe } from 'ramda';
+
+/**
+ * Returns `true` if data structure focused by the given lens equals provided value.
+ *
+ * @func lensEq
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.13.0|1.13.0}
+ * @category Relation
+ * @typedef Lens s a = Functor f => (a -> f a) -> s -> f s
+ * @sig  Lens s a -> b -> s -> Boolean
+ * @see {@link RA.lensNotEq|lensNotEq}
+ * @param {function} lens Van Laarhoven lens
+ * @param {*} value The value to compare the focused data structure with
+ * @param {*} data The data structure
+ * @return {boolean} `true` if the focused data structure equals value, `false` otherwise
+ *
+ * @example
+ *
+ * RA.lensEq(R.lensIndex(0), 1, [0, 1, 2]); // => false
+ * RA.lensEq(R.lensIndex(1), 1, [0, 1, 2]); // => true
+ * RA.lensEq(R.lensPath(['a', 'b']), 'foo', { a: { b: 'foo' } }) // => true
+ */
+const lensEq = curryN(3, (lens, val, data) =>
+  pipe(view(lens), equals(val))(data)
+);
+
+export default lensEq;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/lensIso.js.html b/5.0.0/lensIso.js.html new file mode 100644 index 0000000000..58aa75f6ed --- /dev/null +++ b/5.0.0/lensIso.js.html @@ -0,0 +1,124 @@ + + + + + lensIso.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

lensIso.js

+ + + + + + + +
+
+
import { curry, map } from 'ramda';
+
+// This implementation was highly inspired by the implementations
+// in ramda-lens library.
+//
+// https://github.com/ramda/ramda-lens
+
+// isomorphic :: ((a -> b), (b -> a)) -> Isomorphism
+//     Isomorphism = x -> y
+const isomorphic = (to, from) => {
+  const isomorphism = (x) => to(x);
+  isomorphism.from = from;
+  return isomorphism;
+};
+
+// isomorphisms :: ((a -> b), (b -> a)) -> (a -> b)
+const isomorphisms = (to, from) =>
+  isomorphic(
+    curry((toFunctorFn, target) => map(from, toFunctorFn(to(target)))),
+    curry((toFunctorFn, target) => map(to, toFunctorFn(from(target))))
+  );
+
+// from :: Isomorphism -> a -> b
+const from = curry((isomorphism, x) => isomorphism.from(x));
+
+/**
+ * Defines an isomorphism that will work like a lens. It takes two functions.
+ * The function that converts and the function that recovers.
+ *
+ * @func lensIso
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.19.0|1.19.0}
+ * @category Relation
+ * @typedef Lens s a = Functor f => (a -> f a) -> s -> f s
+ * @sig (s -> a) -> (a -> s) -> Lens s a
+ * @param {!function} to The function that converts
+ * @param {!function} from The function that recovers
+ * @return {!function} The isomorphic lens
+ * @see {@link http://ramdajs.com/docs/#lens|R.lens}
+ *
+ * @example
+ *
+ * const lensJSON = RA.lensIso(JSON.parse, JSON.stringify);
+ *
+ * R.over(lensJSON, assoc('b', 2), '{"a":1}'); //=> '{"a":1,"b":2}'
+ * R.over(RA.lensIso.from(lensJSON), R.replace('}', ',"b":2}'), { a: 1 }); // => { a: 1, b: 2 }
+ */
+const lensIso = curry(isomorphisms);
+lensIso.from = from;
+
+export default lensIso;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/lensNotEq.js.html b/5.0.0/lensNotEq.js.html new file mode 100644 index 0000000000..8b55337977 --- /dev/null +++ b/5.0.0/lensNotEq.js.html @@ -0,0 +1,101 @@ + + + + + lensNotEq.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

lensNotEq.js

+ + + + + + + +
+
+
import { complement } from 'ramda';
+
+import lensEq from './lensEq.js';
+
+/**
+ * Returns `true` if data structure focused by the given lens doesn't equal provided value.
+ *
+ * @func lensNotEq
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.13.0|1.13.0}
+ * @category Relation
+ * @typedef Lens s a = Functor f => (a -> f a) -> s -> f s
+ * @sig Lens s a -> b -> s -> Boolean
+ * @see {@link RA.lensEq|lensEq}
+ * @param {function} lens Van Laarhoven lens
+ * @param {*} value The value to compare the focused data structure with
+ * @param {*} data The data structure
+ * @return {boolean} `false` if the focused data structure equals value, `true` otherwise
+ *
+ * @example
+ *
+ * RA.lensNotEq(R.lensIndex(0), 1, [0, 1, 2]); // => true
+ * RA.lensNotEq(R.lensIndex(1), 1, [0, 1, 2]); // => false
+ * RA.lensNotEq(R.lensPath(['a', 'b']), 'foo', { a: { b: 'foo' } }) // => false
+ */
+const lensNotEq = complement(lensEq);
+
+export default lensNotEq;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/lensNotSatisfy.js.html b/5.0.0/lensNotSatisfy.js.html new file mode 100644 index 0000000000..cc07e26ff7 --- /dev/null +++ b/5.0.0/lensNotSatisfy.js.html @@ -0,0 +1,103 @@ + + + + + lensNotSatisfy.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

lensNotSatisfy.js

+ + + + + + + +
+
+
import { complement } from 'ramda';
+
+import lensSatisfies from './lensSatisfies.js';
+
+/**
+ * Returns `true` if data structure focused by the given lens doesn't satisfy the predicate.
+ * Note that the predicate is expected to return boolean value.
+ *
+ * @func lensNotSatisfy
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.13.0|1.13.0}
+ * @category Relation
+ * @typedef Lens s a = Functor f => (a -> f a) -> s -> f s
+ * @sig  Boolean b => (a -> b) -> Lens s a -> s -> b
+ * @see {@link RA.lensSatisfies|lensSatisfies}
+ * @param {Function} predicate The predicate function
+ * @param {Function} lens Van Laarhoven lens
+ * @param {*} data The data structure
+ * @return {boolean} `false` if the focused data structure satisfies the predicate, `true` otherwise
+ *
+ * @example
+ *
+ * RA.lensNotSatisfy(RA.isTrue, R.lensIndex(0), [false, true, 1]); // => true
+ * RA.lensNotSatisfy(RA.isTrue, R.lensIndex(1), [false, true, 1]); // => false
+ * RA.lensNotSatisfy(RA.isTrue, R.lensIndex(2), [false, true, 1]); // => true
+ * RA.lensNotSatisfy(R.identity, R.lensProp('x'), { x: 1 }); // => true
+ */
+const lensNotSatisfy = complement(lensSatisfies);
+
+export default lensNotSatisfy;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/lensSatisfies.js.html b/5.0.0/lensSatisfies.js.html new file mode 100644 index 0000000000..1222143fa0 --- /dev/null +++ b/5.0.0/lensSatisfies.js.html @@ -0,0 +1,106 @@ + + + + + lensSatisfies.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

lensSatisfies.js

+ + + + + + + +
+
+
import { view, curryN, pipe } from 'ramda';
+
+import isTrue from './isTrue.js';
+
+/**
+ * Returns `true` if data structure focused by the given lens satisfies the predicate.
+ * Note that the predicate is expected to return boolean value and will be evaluated
+ * as `false` unless the predicate returns `true`.
+ *
+ * @func lensSatisfies
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.13.0|1.13.0}
+ * @category Relation
+ * @typedef Lens s a = Functor f => (a -> f a) -> s -> f s
+ * @sig  Boolean b => (a -> b) -> Lens s a -> s -> b
+ * @see {@link RA.lensNotSatisfy|lensNotSatisfy}
+ * @param {Function} predicate The predicate function
+ * @param {Function} lens Van Laarhoven lens
+ * @param {*} data The data structure
+ * @return {boolean} `true` if the focused data structure satisfies the predicate, `false` otherwise
+ *
+ * @example
+ *
+ * RA.lensSatisfies(RA.isTrue, R.lensIndex(0), [false, true, 1]); // => false
+ * RA.lensSatisfies(RA.isTrue, R.lensIndex(1), [false, true, 1]); // => true
+ * RA.lensSatisfies(RA.isTrue, R.lensIndex(2), [false, true, 1]); // => false
+ * RA.lensSatisfies(R.identity, R.lensProp('x'), { x: 1 }); // => false
+ */
+const lensSatisfies = curryN(3, (predicate, lens, data) =>
+  pipe(view(lens), predicate, isTrue)(data)
+);
+
+export default lensSatisfies;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/lensTraverse.js.html b/5.0.0/lensTraverse.js.html new file mode 100644 index 0000000000..2c574f1765 --- /dev/null +++ b/5.0.0/lensTraverse.js.html @@ -0,0 +1,129 @@ + + + + + lensTraverse.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

lensTraverse.js

+ + + + + + + +
+
+
import { traverse, curry, pipe, prop, curryN } from 'ramda';
+
+import Identity from './fantasy-land/Identity.js';
+
+/**
+ * Creates a [Traversable](https://github.com/fantasyland/fantasy-land#traversable) lens
+ * from an [Applicative](https://github.com/fantasyland/fantasy-land#applicative)-returning function.
+ *
+ * When executed, it maps an [Applicative](https://github.com/fantasyland/fantasy-land#applicative)-returning
+ * function over a [Traversable](https://github.com/fantasyland/fantasy-land#traversable),
+ * then uses [`sequence`](https://ramdajs.com/docs/#sequence) to transform the resulting Traversable of Applicative
+ * into an Applicative of Traversable.
+ *
+ * Dispatches to the `traverse` method of the third argument, if present.
+ *
+ * @func lensTraverse
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.7.0|2.7.0}
+ * @category Relation
+ * @typedef Lens s a = Functor f => (a -> f a) -> s -> f s
+ * @sig fantasy-land/of :: TypeRep f => f ~> a → f a
+ * @sig Applicative f => (a -> f a) -> Lens s a
+ * @sig Applicative f => TypeRep f -> Lens s a
+ * @param {!Object|!Function} TypeRepresentative with an `of` or `fantasy-land/of` method
+ * @return {!function} The Traversable lens
+ * @see {@link http://ramdajs.com/docs/#lens|R.lens}, {@link http://ramdajs.com/docs/#traverse|R.traverse}
+ *
+ * @example
+ *
+ * const maybeLens = RA.lensTraverse(Maybe.of);
+ * const safeDiv = n => d => d === 0 ? Maybe.Nothing() : Maybe.Just(n / d)
+ *
+ * R.over(maybeLens, safeDiv(10), [2, 4, 5]); // => Just([5, 2.5, 2])
+ * R.over(maybeLens, safeDiv(10), [2, 0, 5]); // => Nothing
+ *
+ * R.view(maybeLens, [Maybe.Just(2), Maybe.Just(3)]); // => Maybe.Just([2, 3])
+ *
+ * R.set(maybeLens, Maybe.Just(1), [Maybe.just(2), Maybe.Just(3)]); // => Maybe.Just([1, 1])
+ */
+/* eslint-disable no-nested-ternary */
+const lensTraverse = curryN(1, (F) => {
+  const of =
+    typeof F['fantasy-land/of'] === 'function'
+      ? F['fantasy-land/of']
+      : typeof F.of === 'function'
+        ? F.of
+        : F;
+  const TypeRep = { 'fantasy-land/of': of };
+
+  return curry((toFunctorFn, target) =>
+    Identity.of(traverse(TypeRep, pipe(toFunctorFn, prop('value')), target))
+  );
+});
+/* eslint-enable */
+
+export default lensTraverse;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/liftF.js.html b/5.0.0/liftF.js.html new file mode 100644 index 0000000000..72b7dc69dc --- /dev/null +++ b/5.0.0/liftF.js.html @@ -0,0 +1,110 @@ + + + + + liftF.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

liftF.js

+ + + + + + + +
+
+
import { curryN } from 'ramda';
+
+import liftFN from './liftFN.js';
+
+/**
+ * "lifts" a function to be the specified arity, so that it may "map over" objects that satisfy
+ * the fantasy land Apply spec of algebraic structures.
+ *
+ * Lifting is specific for {@link https://github.com/scalaz/scalaz|scalaz} and {@link http://functionaljava.org/|function Java} implementations.
+ * Old version of fantasy land spec were not compatible with this approach,
+ * but as of fantasy land 1.0.0 Apply spec also adopted this approach.
+ *
+ * This function acts as interop for ramda <= 0.23.0 and {@link https://monet.github.io/monet.js/|monet.js}.
+ *
+ * More info {@link https://github.com/fantasyland/fantasy-land/issues/50|here}.
+ *
+ * @func liftF
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.2.0|v1.2.0}
+ * @category Function
+ * @sig Apply a => (a... -> a) -> (a... -> a)
+ * @param {Function} fn The function to lift into higher context
+ * @return {Function} The lifted function
+ * @see {@link RA.liftFN|liftFN}
+ * @example
+ *
+ * const { Maybe } = require('monet');
+ *
+ * const add3 = (a, b, c) => a + b + c;
+ * const madd3 = RA.liftF(add3);
+ *
+ * madd3(Maybe.Some(10), Maybe.Some(15), Maybe.Some(17)); //=> Maybe.Some(42)
+ * madd3(Maybe.Some(10), Maybe.Nothing(), Maybe.Some(17)); //=> Maybe.Nothing()
+ */
+const liftF = curryN(1, (fn) => liftFN(fn.length, fn));
+
+export default liftF;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/liftFN.js.html b/5.0.0/liftFN.js.html new file mode 100644 index 0000000000..67bfbef0a1 --- /dev/null +++ b/5.0.0/liftFN.js.html @@ -0,0 +1,118 @@ + + + + + liftFN.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

liftFN.js

+ + + + + + + +
+
+
import { curry, head, slice, reduce, curryN, map } from 'ramda';
+
+import ap from './internal/ap.js';
+
+/**
+ * "lifts" a function to be the specified arity, so that it may "map over" objects that satisfy
+ * the fantasy land Apply spec of algebraic structures.
+ *
+ * Lifting is specific for {@link https://github.com/scalaz/scalaz|scalaz} and {@link http://www.functionaljava.org/|functional java} implementations.
+ * Old version of fantasy land spec were not compatible with this approach,
+ * but as of fantasy land 1.0.0 Apply spec also adopted this approach.
+ *
+ * This function acts as interop for ramda <= 0.23.0 and {@link https://monet.github.io/monet.js/|monet.js}.
+ *
+ * More info {@link https://github.com/fantasyland/fantasy-land/issues/50|here}.
+ *
+ * @func liftFN
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.2.0|v1.2.0}
+ * @category Function
+ * @sig Apply a => Number -> (a... -> a) -> (a... -> a)
+ * @param {number} arity The arity of the lifter function
+ * @param {Function} fn The function to lift into higher context
+ * @return {Function} The lifted function
+ * @see {@link http://ramdajs.com/docs/#lift|R.lift}, {@link http://ramdajs.com/docs/#ap|R.ap}
+ * @example
+ *
+ * const { Maybe } = require('monet');
+ *
+ * const add3 = (a, b, c) => a + b + c;
+ * const madd3 = RA.liftFN(3, add3);
+ *
+ * madd3(Maybe.Some(10), Maybe.Some(15), Maybe.Some(17)); //=> Maybe.Some(42)
+ * madd3(Maybe.Some(10), Maybe.Nothing(), Maybe.Some(17)); //=> Maybe.Nothing()
+ */
+const liftFN = curry((arity, fn) => {
+  const lifted = curryN(arity, fn);
+  return curryN(arity, (...args) => {
+    const accumulator = map(lifted, head(args));
+    const apps = slice(1, Infinity, args);
+    return reduce(ap, accumulator, apps);
+  });
+});
+
+export default liftFN;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/list.js.html b/5.0.0/list.js.html new file mode 100644 index 0000000000..53efc3e4f7 --- /dev/null +++ b/5.0.0/list.js.html @@ -0,0 +1,93 @@ + + + + + list.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

list.js

+ + + + + + + +
+
+
import { unapply, identity } from 'ramda';
+
+/**
+ * Creates a list from arguments.
+ *
+ * @func list
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.1.0|v1.1.0}
+ * @category List
+ * @sig  a... -> [a...]
+ * @param {...*} items The items of the feature list
+ * @return {Array} New list created from items
+ * @see {@link https://github.com/ramda/ramda/wiki/Cookbook#create-a-list-function|Ramda Cookbook}
+ * @example
+ *
+ * RA.list('a', 'b', 'c'); //=> ['a', 'b', 'c']
+ */
+const list = unapply(identity);
+
+export default list;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/mapIndexed.js.html b/5.0.0/mapIndexed.js.html new file mode 100644 index 0000000000..c17ae68972 --- /dev/null +++ b/5.0.0/mapIndexed.js.html @@ -0,0 +1,100 @@ + + + + + mapIndexed.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

mapIndexed.js

+ + + + + + + +
+
+
import { addIndex, map } from 'ramda';
+
+/**
+ * {@link http://ramdajs.com/docs/#map|R.map} function that more closely resembles Array.prototype.map.
+ * It takes two new parameters to its callback function: the current index, and the entire list.
+ *
+ * `mapIndexed` implementation is simple : `
+ * const mapIndexed = R.addIndex(R.map);
+ * `
+ * @func mapIndexed
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.5.0|v2.5.0}
+ * @category List
+ * @typedef Idx = Number
+ * @sig Functor f => ((a, Idx, f a) => b) => f a -> f b
+ * @param {Function} fn The function to be called on every element of the input `list`
+ * @param {Array} list The list to be iterated over
+ * @return {Array} The new list
+ * @see {@link http://ramdajs.com/docs/#addIndex|R.addIndex}, {@link http://ramdajs.com/docs/#map|R.map}
+ * @example
+ *
+ * RA.mapIndexed((val, idx, list) => idx + '-' + val, ['f', 'o', 'o', 'b', 'a', 'r']);
+ * //=> ['0-f', '1-o', '2-o', '3-b', '4-a', '5-r']
+ */
+const mapIndexed = addIndex(map);
+
+export default mapIndexed;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/mergePath.js.html b/5.0.0/mergePath.js.html new file mode 100644 index 0000000000..00258ad36a --- /dev/null +++ b/5.0.0/mergePath.js.html @@ -0,0 +1,103 @@ + + + + + mergePath.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

mergePath.js

+ + + + + + + +
+
+
import { curry, over, lensPath, mergeLeft } from 'ramda';
+
+/**
+ * Create a new object with the own properties of the object under the `path`
+ * merged with the own properties of the provided `source`.
+ * If a key exists in both objects, the value from the `source` object will be used.
+ *
+ * @func mergePath
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.18.0|v1.18.0}
+ * @category Object
+ * @sig [k] -> {a} -> {k: {a}} -> {k: {a}}
+ * @see {@link RA.mergeProp|mergeProp}
+ * @param {!Array} path The property path of the destination object
+ * @param {!Object} source The source object
+ * @param {!Object} obj The object that has destination object under corresponding property path
+ * @return {!Object} The new version of object
+ * @example
+ *
+ * RA.mergePath(
+ *  ['outer', 'inner'],
+ *  { foo: 3, bar: 4 },
+ *  { outer: { inner: { foo: 2 } } }
+ * ); //=> { outer: { inner: { foo: 3, bar: 4 } }
+ */
+const mergePath = curry((path, source, obj) =>
+  over(lensPath(path), mergeLeft(source), obj)
+);
+
+export default mergePath;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/mergePaths.js.html b/5.0.0/mergePaths.js.html new file mode 100644 index 0000000000..2bcdf879dc --- /dev/null +++ b/5.0.0/mergePaths.js.html @@ -0,0 +1,102 @@ + + + + + mergePaths.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

mergePaths.js

+ + + + + + + +
+
+
import { curryN, pipe, mergeAll } from 'ramda';
+
+import paths from './paths.js';
+
+/**
+ * Merge objects under corresponding paths.
+ *
+ * @func mergePaths
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.17.0|v1.17.0}
+ * @category Object
+ * @sig [[k]] -> {k: {a}} -> {a}
+ * @see {@link RA.mergeProps|mergeProps}
+ * @param {!Array} paths The property paths to merge
+ * @param {!Object} obj The object to query
+ * @return {!Object} The object composed of merged property paths of obj
+ * @example
+ *
+ * const obj = {
+ *   foo: { fooInner: { fooInner2: 1 } },
+ *   bar: { barInner: 2 }
+ * };
+ *
+ * { ...obj.foo.fooInner, ...obj.bar }; //=>  { fooInner2: 1, barInner: 2 }
+ * RA.mergePaths([['foo', 'fooInner'], ['bar']], obj); //=> { fooInner2: 1, barInner: 2 }
+ */
+const mergePaths = curryN(2, pipe(paths, mergeAll));
+
+export default mergePaths;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/mergeProp.js.html b/5.0.0/mergeProp.js.html new file mode 100644 index 0000000000..a9e7680289 --- /dev/null +++ b/5.0.0/mergeProp.js.html @@ -0,0 +1,103 @@ + + + + + mergeProp.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

mergeProp.js

+ + + + + + + +
+
+
import { curry, of } from 'ramda';
+
+import mergePath from './mergePath.js';
+
+/**
+ * Create a new object with the own properties of the object under the `p`
+ * merged with the own properties of the provided `source`.
+ * If a key exists in both objects, the value from the `source` object will be used.
+ *
+ * @func mergeProp
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.18.0|v1.18.0}
+ * @category Object
+ * @sig [k] -> {a} -> {k: {a}} -> {k: {a}}
+ * @see {@link RA.mergePath|mergePath}
+ * @param {!Array} p The property of the destination object
+ * @param {!Object} source The source object
+ * @param {!Object} obj The object that has destination object under corresponding property
+ * @return {!Object} The new version of object
+ * @example
+ *
+ * RA.mergeProp(
+ *  'outer',
+ *  { foo: 3, bar: 4 },
+ *  { outer: { foo: 2 } }
+ * ); //=> { outer: { foo: 3, bar: 4 } };
+ */
+const mergeProp = curry((p, subj, obj) => mergePath(of(Array, p), subj, obj));
+
+export default mergeProp;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/mergeProps.js.html b/5.0.0/mergeProps.js.html new file mode 100644 index 0000000000..9a532f0614 --- /dev/null +++ b/5.0.0/mergeProps.js.html @@ -0,0 +1,100 @@ + + + + + mergeProps.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

mergeProps.js

+ + + + + + + +
+
+
import { curryN, pipe, mergeAll, props } from 'ramda';
+
+/**
+ * Functional equivalent of merging object properties with object spread operator.
+ *
+ * @func mergeProps
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.17.0|v1.17.0}
+ * @category Object
+ * @sig [k] -> {k: {a}} -> {a}
+ * @see {@link RA.mergePaths|mergePaths}
+ * @param {!Array} ps The property names to merge
+ * @param {!Object} obj The object to query
+ * @return {!Object} The object composed of merged properties of obj
+ * @example
+ *
+ * const obj = {
+ *   foo: { fooInner: 1 },
+ *   bar: { barInner: 2 }
+ * };
+ *
+ * { ...obj.foo, ...obj.bar }; //=> { fooInner: 1, barInner: 2 }
+ * RA.mergeProps(['foo', 'bar'], obj); //=> { fooInner: 1, barInner: 2 }
+ */
+const mergeProps = curryN(2, pipe(props, mergeAll));
+
+export default mergeProps;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/move.js.html b/5.0.0/move.js.html new file mode 100644 index 0000000000..901e564a76 --- /dev/null +++ b/5.0.0/move.js.html @@ -0,0 +1,99 @@ + + + + + move.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

move.js

+ + + + + + + +
+
+
import { compose, curry, insert, nth, remove } from 'ramda';
+
+/**
+ * Returns a new list with the item at the position `fromIdx` moved to the position `toIdx`. If the
+ * `toIdx` is out of the `list` range, the item will be placed at the last position of the `list`.
+ * When negative indices are provided, the behavior of the move is unspecified.
+ *
+ * @func move
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.8.0|v2.8.0}
+ * @category List
+ * @sig Number -> Number -> [a] -> [a]
+ * @param {number} fromIdx The position of item to be moved
+ * @param {number} toIdx The position of item after move
+ * @param {Array} list The list containing the item to be moved
+ * @return {Array}
+ * @example
+ *
+ * const list = ['a', 'b', 'c', 'd', 'e'];
+ * RA.move(1, 3, list) //=> ['a', 'c', 'd', 'b', 'e']
+ */
+const move = curry((fromIdx, toIdx, list) =>
+  compose(insert(toIdx, nth(fromIdx, list)), remove(fromIdx, 1))(list)
+);
+
+export default move;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/nand.js.html b/5.0.0/nand.js.html new file mode 100644 index 0000000000..1e39588eca --- /dev/null +++ b/5.0.0/nand.js.html @@ -0,0 +1,100 @@ + + + + + nand.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

nand.js

+ + + + + + + +
+
+
import { and, complement } from 'ramda';
+
+/**
+ * Returns false if both arguments are truthy; true otherwise.
+ *
+ * @func nand
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.19.0|v2.19.0}
+ * @category Logic
+ * @sig a -> b -> Boolean
+ * @param {*} a
+ * @param {*} b
+ * @return {Boolean} false if both arguments are truesy
+ * @example
+ *
+ * RA.nand(true, true); //=> false
+ * RA.nand(false, true); //=> true
+ * RA.nand(true, false); //=> true
+ * RA.nand(false, false); //=> true
+ * RA.nand(1.0, 1.0); //=> false
+ * RA.nand(1.0, 0); //=> true
+ * RA.nand(0, 1.0); //=> true
+ * RA.nand(0, 0); //=> true
+ */
+const nand = complement(and); // eslint-disable-line ramda/complement-simplification
+
+export default nand;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/neither.js.html b/5.0.0/neither.js.html new file mode 100644 index 0000000000..b2932a1fcf --- /dev/null +++ b/5.0.0/neither.js.html @@ -0,0 +1,111 @@ + + + + + neither.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

neither.js

+ + + + + + + +
+
+
import { curry, compose, complement, either } from 'ramda';
+
+/* eslint-disable max-len */
+/**
+ * A function which calls the two provided functions and returns the complement of `||`ing the
+ * results.
+ * It returns false if the first function is truth-y and the complement of the second function
+ * otherwise. Note that this is short-circuited, meaning that the second function will not be
+ * invoked if the first returns a truth-y value. In short it will return true if neither predicate
+ * returns true.
+ *
+ * In addition to functions, `RA.neither` also accepts any fantasy-land compatible
+ * applicative functor.
+ *
+ * @func neither
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.3.0|v2.3.0}
+ * @category Logic
+ * @sig (*... -> Boolean) -> (*... -> Boolean) -> (*... -> Boolean)
+ * @param {Function} f A predicate
+ * @param {Function} g Another predicate
+ * @return {Function} Returns a function that applies its arguments to `f` and `g` and returns the complement of `||`ing their outputs together.
+ * @see {@link http://ramdajs.com/docs/#either|R.either}, {@link http://ramdajs.com/docs/#or|R.or}
+ * @example
+ *
+ * const gt10 = R.gt(R.__, 10)
+ * const even = (x) => x % 2 === 0;
+ * const f = RA.neither(gt10, even);
+ *
+ * f(12); //=> false
+ * f(8); //=> false
+ * f(11); //=> false
+ * f(9); //=> true
+ */
+/* eslint-enable max-len */
+const neither = curry(compose(complement, either));
+
+export default neither;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/noneP.js.html b/5.0.0/noneP.js.html new file mode 100644 index 0000000000..356ba05267 --- /dev/null +++ b/5.0.0/noneP.js.html @@ -0,0 +1,108 @@ + + + + + noneP.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

noneP.js

+ + + + + + + +
+
+
import { curryN, map, pipe } from 'ramda';
+
+import allP from './allP.js';
+import rejectP from './rejectP.js';
+import resolveP from './resolveP.js';
+
+/**
+ * Returns a Promise that is resolved with an array of reasons when all of the provided Promises reject, or rejected when any Promise is resolved.
+ * This pattern is like allP, but fulfillments and rejections are transposed - rejections become the fulfillment values and vice versa.
+ *
+ * @func noneP
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.22.0|v2.22.0}
+ * @category Function
+ * @sig [Promise a] -> Promise [a]
+ * @param {Iterable.<*>} iterable An iterable object such as an Array or String
+ * @return {Promise} A Promise that is resolved with a list of rejection reasons if all Promises are rejected, or a Promise that is rejected with the fulfillment value of the first Promise that resolves.
+ * @see {@link RA.allP|allP}
+ * @example
+ *
+ * RA.noneP([Promise.reject('hello'), Promise.reject('world')]); //=> Promise(['hello', 'world'])
+ * RA.noneP([]); //=> Promise([])
+ * RA.noneP([Promise.reject(), Promise.resolve('hello world')]); //=> Promise('hello world')
+ * RA.noneP([Promise.reject(), 'hello world']); //=> Promise('hello world')
+ */
+const noneP = curryN(
+  1,
+  pipe(
+    map(resolveP),
+    map((p) => p.then(rejectP, resolveP)),
+    allP
+  )
+);
+
+export default noneP;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/nonePass.js.html b/5.0.0/nonePass.js.html new file mode 100644 index 0000000000..1e9a263a2e --- /dev/null +++ b/5.0.0/nonePass.js.html @@ -0,0 +1,105 @@ + + + + + nonePass.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

nonePass.js

+ + + + + + + +
+
+
import { complement, compose, anyPass, curryN } from 'ramda';
+
+/**
+ * Takes a list of predicates and returns a predicate that returns true for a given list of
+ * arguments if none of the provided predicates are satisfied by those arguments. It is the
+ * complement of Ramda's anyPass.
+ *
+ * The function returned is a curried function whose arity matches that of the
+ * highest-arity predicate.
+ *
+ * @func nonePass
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.5.0|v2.5.0}
+ * @category Logic
+ * @sig [(*... -> Boolean)] -> (*... -> Boolean)
+ * @param {Array} predicates An array of predicates to check
+ * @return {Function} The combined predicate
+ * @see {@link http://ramdajs.com/docs/#anyPass|R.anyPass}
+ * @example
+ *
+ * const gt10 = R.gt(R.__, 10)
+ * const even = (x) => x % 2 === 0;
+ * const f = RA.nonePass([gt10, even]);
+ *
+ * f(12); //=> false
+ * f(8); //=> false
+ * f(11); //=> false
+ * f(9); //=> true
+ */
+const nonePass = curryN(1, compose(complement, anyPass));
+
+export default nonePass;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/noop.js.html b/5.0.0/noop.js.html new file mode 100644 index 0000000000..342a6cf538 --- /dev/null +++ b/5.0.0/noop.js.html @@ -0,0 +1,94 @@ + + + + + noop.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

noop.js

+ + + + + + + +
+
+
import { always } from 'ramda';
+
+import stubUndefined from './stubUndefined.js';
+
+/**
+ * A function that performs no operations.
+ *
+ * @func noop
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.0.0|v1.0.0}
+ * @category Function
+ * @sig ... -> undefined
+ * @return {undefined}
+ * @example
+ *
+ * RA.noop(); //=> undefined
+ * RA.noop(1, 2, 3); //=> undefined
+ */
+const noop = always(stubUndefined());
+
+export default noop;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/nor.js.html b/5.0.0/nor.js.html new file mode 100644 index 0000000000..865daeef30 --- /dev/null +++ b/5.0.0/nor.js.html @@ -0,0 +1,101 @@ + + + + + nor.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

nor.js

+ + + + + + + +
+
+
import { or, complement } from 'ramda';
+
+/**
+ * Returns true if both arguments are falsy; false otherwise.
+ *
+ * @func nor
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.20.0|v2.20.0}
+ * @category Logic
+ * @sig a -> b -> a ⊽ b
+ * @param {*} a
+ * @param {*} b
+ * @return {boolean} true if both arguments are falsy
+ * @see {@link RA.neither|neither}
+ * @example
+ *
+ * RA.nor(true, true); //=> false
+ * RA.nor(false, true); //=> false
+ * RA.nor(true, false); //=> false
+ * RA.nor(false, false); //=> true
+ * RA.nor(1, 1); //=> false
+ * RA.nor(1, 0); //=> false
+ * RA.nor(0, 1); //=> false
+ * RA.nor(0, 0); //=> true
+ */
+const nor = complement(or); // eslint-disable-line ramda/complement-simplification
+
+export default nor;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/notAllPass.js.html b/5.0.0/notAllPass.js.html new file mode 100644 index 0000000000..5c7be9f15b --- /dev/null +++ b/5.0.0/notAllPass.js.html @@ -0,0 +1,105 @@ + + + + + notAllPass.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

notAllPass.js

+ + + + + + + +
+
+
import { curry, complement, compose, allPass } from 'ramda';
+
+/**
+ * Takes a list of predicates and returns a predicate that returns true for a given list of
+ * arguments if one or more of the provided predicates is not satisfied by those arguments. It is
+ * the complement of Ramda's allPass.
+ *
+ * The function returned is a curried function whose arity matches that of the
+ * highest-arity predicate.
+ *
+ * @func notAllPass
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.4.0|v2.4.0}
+ * @category Logic
+ * @sig [(*... -> Boolean)] -> (*... -> Boolean)
+ * @param {Array} predicates An array of predicates to check
+ * @return {Function} The combined predicate
+ * @see {@link http://ramdajs.com/docs/#allPass|R.allPass}
+ * @example
+ *
+ * const gt10 = R.gt(R.__, 10)
+ * const even = (x) => x % 2 === 0;
+ * const f = RA.notAllPass([gt10, even]);
+ *
+ * f(12); //=> false
+ * f(8); //=> true
+ * f(11); //=> true
+ * f(9); //=> true
+ */
+const notAllPass = curry(compose(complement, allPass));
+
+export default notAllPass;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/notAllUnique.js.html b/5.0.0/notAllUnique.js.html new file mode 100644 index 0000000000..6f281ffe49 --- /dev/null +++ b/5.0.0/notAllUnique.js.html @@ -0,0 +1,98 @@ + + + + + notAllUnique.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

notAllUnique.js

+ + + + + + + +
+
+
import { complement } from 'ramda';
+
+import allUnique from './allUnique.js';
+
+/**
+ * Returns true if at least one item of the list is repeated. `R.equals` is used to determine equality.
+ *
+ * @func notAllUnique
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.22.0|v2.22.0}
+ * @category List
+ * @sig [a] -> Boolean
+ * @param {Array} list The list of values
+ * @return {boolean}
+ * @see {@link RA.allUnique|allUnique}, {@link https://ramdajs.com/docs/#equals|equals}
+ * @example
+ *
+ * RA.notAllUnique([ 1, 1, 2, 3 ]); //=> true
+ * RA.notAllUnique([ 1, 2, 3, 4 ]); //=> false
+ * RA.notAllUnique([]); //=> false
+ *
+ */
+const notAllUnique = complement(allUnique);
+
+export default notAllUnique;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/notBoth.js.html b/5.0.0/notBoth.js.html new file mode 100644 index 0000000000..eb773c9ce0 --- /dev/null +++ b/5.0.0/notBoth.js.html @@ -0,0 +1,111 @@ + + + + + notBoth.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

notBoth.js

+ + + + + + + +
+
+
import { curry, compose, complement, both } from 'ramda';
+
+/* eslint-disable max-len */
+/**
+ * A function which calls the two provided functions and returns the complement of `&&`ing the
+ * results.
+ * It returns true if the first function is false-y and the complement of the second function
+ * otherwise. Note that this is short-circuited, meaning that the second function will not be
+ * invoked if the first returns a false-y value. In short it will return true unless both predicates
+ * return true.
+ *
+ * In addition to functions, `RA.notBoth` also accepts any fantasy-land compatible
+ * applicative functor.
+ *
+ * @func notBoth
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.3.0|v2.3.0}
+ * @category Logic
+ * @sig (*... -> Boolean) -> (*... -> Boolean) -> (*... -> Boolean)
+ * @param {Function} f A predicate
+ * @param {Function} g Another predicate
+ * @return {Function} Returns a function that applies its arguments to `f` and `g` and returns the complement of `&&`ing their outputs together.
+ * @see {@link http://ramdajs.com/docs/#both|R.both}
+ * @example
+ *
+ * const gt10 = R.gt(R.__, 10)
+ * const even = (x) => x % 2 === 0;
+ * const f = RA.notBoth(gt10, even);
+ *
+ * f(12); //=> false
+ * f(8); //=> true
+ * f(11); //=> true
+ * f(9); //=> true
+ */
+/* eslint-enable max-len */
+const notBoth = curry(compose(complement, both));
+
+export default notBoth;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/notEqual.js.html b/5.0.0/notEqual.js.html new file mode 100644 index 0000000000..7ccbcc2af5 --- /dev/null +++ b/5.0.0/notEqual.js.html @@ -0,0 +1,104 @@ + + + + + notEqual.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

notEqual.js

+ + + + + + + +
+
+
import { complement, equals } from 'ramda';
+
+/**
+ * Returns `true` if its arguments are not equivalent, `false` otherwise. Handles
+ * cyclical data structures.
+ *
+ * Dispatches symmetrically to the `equals` methods of both arguments, if
+ * present.
+ *
+ * @func notEqual
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.29.0|v2.29.0}
+ * @category Relation
+ * @sig a -> b -> Boolean
+ * @param {*} a
+ * @param {*} b
+ * @return {Boolean}
+ * @see {@link https://ramdajs.com/docs/#equals|equals}
+ * @example
+ *
+ * RA.notEqual(1, 1); //=> false
+ * RA.notEqual(1, '1'); //=> true
+ * RA.notEqual([1, 2, 3], [1, 2, 3]); //=> false
+ *
+ * const a = {}; a.v = a;
+ * const b = {}; b.v = b;
+ * RA.notEqual(a, b); //=> false
+ */
+const notEqual = complement(equals);
+
+export default notEqual;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/omitBy.js.html b/5.0.0/omitBy.js.html new file mode 100644 index 0000000000..5086a67a2d --- /dev/null +++ b/5.0.0/omitBy.js.html @@ -0,0 +1,98 @@ + + + + + omitBy.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

omitBy.js

+ + + + + + + +
+
+
import { complement, identity, pickBy, useWith } from 'ramda';
+
+/* eslint-disable max-len */
+/**
+ * Returns a partial copy of an object containing only the keys
+ * that don't satisfy the supplied predicate.
+ *
+ * @func omitBy
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.6.0|v2.6.0}
+ * @category Object
+ * @sig ((v, k) -> Boolean) -> {k: v} -> {k: v}
+ * @param {!Function} pred A predicate to determine whether or not a key should be included on the output object
+ * @param {!Object} obj The object to copy from
+ * @return {!Object} A new object only with properties that don't satisfy `pred`
+ *
+ * @example
+ *
+ * const isLowerCase = (val, key) => key.toLowerCase() === key;
+ * RA.omitBy(isLowerCase, {a: 1, b: 2, A: 3, B: 4}); //=> {A: 3, B: 4}
+ */
+/* eslint-enable max-len */
+const omitBy = useWith(pickBy, [complement, identity]);
+
+export default omitBy;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/omitIndexes.js.html b/5.0.0/omitIndexes.js.html new file mode 100644 index 0000000000..2f85a53744 --- /dev/null +++ b/5.0.0/omitIndexes.js.html @@ -0,0 +1,100 @@ + + + + + omitIndexes.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

omitIndexes.js

+ + + + + + + +
+
+
import { includes, curry, addIndex, reject } from 'ramda';
+
+// helpers
+const rejectIndexed = addIndex(reject);
+const containsIndex = curry((indexes, val, index) => includes(index, indexes));
+
+/**
+ * Returns a partial copy of an array omitting the indexes specified.
+ *
+ * @func omitIndexes
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.19.0|v1.19.0}
+ * @category List
+ * @sig [Int] -> [a] -> [a]
+ * @see {@link http://ramdajs.com/docs/#omit|R.omit}, {@link RA.pickIndexes|pickIndexes}
+ * @param {!Array} indexes The array of indexes to omit from the new array
+ * @param {!Array} list The array to copy from
+ * @return {!Array} The new array with omitted indexes
+ * @example
+ *
+ * RA.omitIndexes([-1, 1, 3], ['a', 'b', 'c', 'd']); //=> ['a', 'c']
+ */
+const omitIndexes = curry((indexes, list) =>
+  rejectIndexed(containsIndex(indexes), list)
+);
+
+export default omitIndexes;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/overlaps.js.html b/5.0.0/overlaps.js.html new file mode 100644 index 0000000000..d0f8ca5ed1 --- /dev/null +++ b/5.0.0/overlaps.js.html @@ -0,0 +1,103 @@ + + + + + overlaps.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

overlaps.js

+ + + + + + + +
+
+
import { pipe, isNotEmpty, intersection, isEmpty, curryN } from 'ramda';
+
+/**
+ * Returns true if two lists have at least one element common to both lists.
+ *
+ * @func overlaps
+ * @memberOf RA
+ * @category Relation
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.30.0|v2.30.0}
+ * @sig [a] -> [a] -> Boolean
+ * @param {Array} list1 The first list
+ * @param {Array} list2 The second list
+ * @return {boolean} True if two lists have at least one element common to both lists
+ * @example
+ *
+ * RA.overlaps(['-v', '--verbose'], ['node', 'script.js', '-v']); //=> true
+ * RA.overlaps(['-v', '--verbose'], []); //=> false
+ * RA.overlaps([1, 2, 3], [3, 4, 5]); //=> true
+ * RA.overlaps([1, 2, 3], [4, 5]); //=> false
+ */
+
+const overlaps = curryN(2, (list1, list2) => {
+  if (isEmpty(list1)) {
+    return true;
+  }
+
+  return pipe(intersection, isNotEmpty)(list1, list2);
+});
+
+export default overlaps;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/padCharsEnd.js.html b/5.0.0/padCharsEnd.js.html new file mode 100644 index 0000000000..6fad3efda3 --- /dev/null +++ b/5.0.0/padCharsEnd.js.html @@ -0,0 +1,110 @@ + + + + + padCharsEnd.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

padCharsEnd.js

+ + + + + + + +
+
+
import { curry, invoker, flip } from 'ramda';
+
+import ponyfill from './internal/ponyfills/String.padEnd.js';
+import isFunction from './isFunction.js';
+
+export const padEndPonyfill = curry(ponyfill);
+
+export const padEndInvoker = flip(invoker(2, 'padEnd'));
+
+/**
+ * The function pads the current string with a given string
+ * (repeated, if needed) so that the resulting string reaches a given length.
+ * The padding is applied from the end of the current string.
+ *
+ * @func padCharsEnd
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.22.0|v2.22.0}
+ * @category String
+ * @sig String -> Number -> String -> String
+ * @param {string} padString The string to pad the current string with
+ * @param {number} targetLength The length of the resulting string once
+ * the current string has been padded
+ * @param {string} value String value to be padded
+ * @return {string} A new string of the specified length with the pad string
+ * applied at the end of the current string
+ * @see {@link RA.padEnd|padEnd}, {@link RA.padCharsStart|padCharsStart}, {@link RA.padStart|padStart}
+ * @example
+ *
+ * RA.padCharsEnd('-', 3, 'a'); // => 'a--'
+ * RA.padCharsEnd('foo', 10, 'abc'); // => 'abcfoofoof'
+ * RA.padCharsEnd('123456', 6, 'abc'); // => 'abc123'
+ */
+const padCharsEnd = isFunction(String.prototype.padEnd)
+  ? padEndInvoker
+  : padEndPonyfill;
+
+export default padCharsEnd;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/padCharsStart.js.html b/5.0.0/padCharsStart.js.html new file mode 100644 index 0000000000..c1ac48125e --- /dev/null +++ b/5.0.0/padCharsStart.js.html @@ -0,0 +1,108 @@ + + + + + padCharsStart.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

padCharsStart.js

+ + + + + + + +
+
+
import { flip, invoker, curry } from 'ramda';
+
+import isFunction from './isFunction.js';
+import ponyfill from './internal/ponyfills/String.padStart.js';
+
+export const padStartInvoker = flip(invoker(2, 'padStart'));
+
+export const padStartPonyfill = curry(ponyfill);
+
+/**
+ * The function pads the current string with a given string
+ * (repeated, if needed) so that the resulting string reaches a given length.
+ * The padding is applied from the start of the current string.
+ *
+ * @func padCharsStart
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.22.0|v2.22.0}
+ * @category String
+ * @sig String -> Number -> String -> String
+ * @param {string} padString The string to pad the current string with
+ * @param {number} targetLength The length of the resulting string once the current string has been padded
+ * @param {string} value String value to be padded
+ * @return {string} A new string of the specified length with the pad string on the start of current string
+ * @see {@link RA.padStart|padStart}, {@link RA.padEnd|padEnd}, {@link RA.padCharsEnd|padCharsEnd}
+ * @example
+ *
+ * RA.padCharsStart('-', 3, 'a'); // => '--a'
+ * RA.padCharsStart('foo', 10, 'abc'); // => 'foofoofabc'
+ * RA.padCharsStart('123456', 6, 'abc'); // => '123abc'
+ */
+const padCharsStart = isFunction(String.prototype.padStart)
+  ? padStartInvoker
+  : padStartPonyfill;
+
+export default padCharsStart;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/padEnd.js.html b/5.0.0/padEnd.js.html new file mode 100644 index 0000000000..2d1da30607 --- /dev/null +++ b/5.0.0/padEnd.js.html @@ -0,0 +1,98 @@ + + + + + padEnd.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

padEnd.js

+ + + + + + + +
+
+
import padCharsEnd from './padCharsEnd.js';
+
+/**
+ * The function pads the current string with an empty string
+ * so that the resulting string reaches a given length.
+ * The padding is applied from the end of the current string.
+ *
+ * @func padEnd
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.22.0|v2.22.0}
+ * @category String
+ * @sig Number -> String -> String
+ * @param {number} targetLength The length of the resulting string once
+ * the current string has been padded
+ * @param {string} value String value to be padded
+ * @return {string} A new string of the specified length with the pad string
+ * applied at the end of the current string
+ * @see {@link RA.padCharsEnd|padCharsEnd}, {@link RA.padCharsStart|padCharsStart}, {@link RA.padStart|padStart}
+ * @example
+ *
+ * RA.padEnd(3, 'a'); // => 'a  '
+ */
+const padEnd = padCharsEnd(' ');
+
+export default padEnd;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/padStart.js.html b/5.0.0/padStart.js.html new file mode 100644 index 0000000000..6186858b30 --- /dev/null +++ b/5.0.0/padStart.js.html @@ -0,0 +1,96 @@ + + + + + padStart.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

padStart.js

+ + + + + + + +
+
+
import padCharsStart from './padCharsStart.js';
+
+/**
+ * Pads string on the left side if it's shorter than length.
+ *
+ * @func padStart
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.25.0|v2.25.0}
+ * @category String
+ * @sig Number -> String -> String
+ * @param {number} targetLength The length of the resulting string once
+ * the current string has been padded
+ * @param {string} value String value to be padded
+ * @return {string} A new string of the specified length with the empty string
+ * applied to the beginning of the current string
+ * @see {@link RA.padCharsEnd|padCharsEnd}, {@link RA.padCharsStart|padCharsStart}, {@link RA.padEnd|padEnd}
+ * @example
+ *
+ * RA.padStart(3, 'a'); // => '  a'
+ */
+const padStart = padCharsStart(' ');
+
+export default padStart;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/pathNotEq.js.html b/5.0.0/pathNotEq.js.html new file mode 100644 index 0000000000..56dcec5b17 --- /dev/null +++ b/5.0.0/pathNotEq.js.html @@ -0,0 +1,104 @@ + + + + + pathNotEq.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

pathNotEq.js

+ + + + + + + +
+
+
import { pathEq, complement } from 'ramda';
+
+/* eslint-disable max-len */
+/**
+ * Determines whether a nested path on an object doesn't have a specific value,
+ * in R.equals terms. Most likely used to filter a list.
+ *
+ * @func pathNotEq
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.4.0|v2.4.0}
+ * @category Relation
+ * @sig a => [Idx] => {a} => Boolean
+ * @sig Idx = String | Int | Symbol
+ * @param {a} val The value to compare the nested property with
+ * @param {Array} path The path of the nested property to use
+ * @param {Object} object The object to check the nested property in
+ * @return {boolean} Returns Boolean `false` if the value equals the nested object property, `true` otherwise
+ * @see {@link http://ramdajs.com/docs/#pathEq|R.pathEq}
+ * @example
+ *
+ * const user1 = { address: { zipCode: 90210 } };
+ * const user2 = { address: { zipCode: 55555 } };
+ * const user3 = { name: 'Bob' };
+ * const users = [ user1, user2, user3 ];
+ * const isFamous = RA.pathNotEq(90210, ['address', 'zipCode']);
+ * R.filter(isFamous, users); //=> [ user2, user3 ]
+ */
+/* eslint-enable max-len */
+const pathNotEq = complement(pathEq);
+
+export default pathNotEq;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/pathOrLazy.js.html b/5.0.0/pathOrLazy.js.html new file mode 100644 index 0000000000..4b03e27da9 --- /dev/null +++ b/5.0.0/pathOrLazy.js.html @@ -0,0 +1,103 @@ + + + + + pathOrLazy.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

pathOrLazy.js

+ + + + + + + +
+
+
import { curryN, identical, partial, pathOr, unary, when } from 'ramda';
+
+/**
+ * If the given, non-null object has a value at the given path, returns the value at that path.
+ * Otherwise returns the result of invoking the provided function with the object.
+ *
+ * @func pathOrLazy
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.22.0|v2.22.0}
+ * @category Object
+ * @typedef Idx = String | Int
+ * @sig ({a} -> a) -> [Idx] -> {a} -> a
+ * @param {Function} defaultFn The function that will return the default value.
+ * @param {Array} path The path to use.
+ * @param {Object} obj The object to retrieve the nested property from.
+ * @return {*} The data at `path` of the supplied object or the default value.
+ * @example
+ *
+ * RA.pathOrLazy(() => 'N/A', ['a', 'b'], {a: {b: 2}}); //=> 2
+ * RA.pathOrLazy(() => 'N/A', ['a', 'b'], {c: {b: 2}}); //=> "N/A"
+ */
+const pathOrLazy = curryN(3, (defaultFn, path, obj) =>
+  when(
+    identical(defaultFn),
+    partial(unary(defaultFn), [obj]),
+    pathOr(defaultFn, path, obj)
+  )
+);
+
+export default pathOrLazy;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/paths.js.html b/5.0.0/paths.js.html new file mode 100644 index 0000000000..e074a1c8d4 --- /dev/null +++ b/5.0.0/paths.js.html @@ -0,0 +1,99 @@ + + + + + paths.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

paths.js

+ + + + + + + +
+
+
import { curry, ap, path, __ } from 'ramda';
+
+/**
+ * Acts as multiple path: arrays of paths in, array of values out. Preserves order.
+ *
+ * @func paths
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.2.0|v1.2.0}
+ * @category List
+ * @sig  [[k]] -> {k: v} - [v]
+ * @param {Array} ps The property paths to fetch
+ * @param {Object} obj The object to query
+ * @return {Array} The corresponding values or partially applied function
+ * @see {@link https://github.com/ramda/ramda/wiki/Cookbook#derivative-of-rprops-for-deep-fields|Ramda Cookbook}, {@link http://ramdajs.com/docs/#props|R.props}
+ * @example
+ *
+ * const obj = {
+ *   a: { b: { c: 1 } },
+ *   x: 2,
+ * };
+ *
+ * RA.paths([['a', 'b', 'c'], ['x']], obj); //=> [1, 2]
+ */
+const paths = curry((ps, obj) => ap([path(__, obj)], ps));
+
+export default paths;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/pickIndexes.js.html b/5.0.0/pickIndexes.js.html new file mode 100644 index 0000000000..2ec508cc80 --- /dev/null +++ b/5.0.0/pickIndexes.js.html @@ -0,0 +1,103 @@ + + + + + pickIndexes.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

pickIndexes.js

+ + + + + + + +
+
+
import { filter, addIndex, curry, includes } from 'ramda';
+
+// helpers
+const filterIndexed = addIndex(filter);
+const containsIndex = curry((indexes, val, index) => includes(index, indexes));
+
+/**
+ * Picks values from list by indexes.
+ *
+ * Note: pickIndexes will skip non existing indexes. If you want to include them
+ * use ramda's `props` function.
+ *
+ * @func pickIndexes
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.1.0|v1.1.0}
+ * @category List
+ * @sig  [Number] -> [a] -> [a]
+ * @param {Array} indexes The indexes to pick
+ * @param {Array} list The list to pick values from
+ * @return {Array} New array containing only values at `indexes`
+ * @see {@link http://ramdajs.com/docs/#pick|R.pick}, {@link RA.omitIndexes|omitIndexes}
+ * @example
+ *
+ * RA.pickIndexes([0, 2], ['a', 'b', 'c']); //=> ['a', 'c']
+ */
+const pickIndexes = curry((indexes, list) =>
+  filterIndexed(containsIndex(indexes), list)
+);
+
+export default pickIndexes;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/propNotEq.js.html b/5.0.0/propNotEq.js.html new file mode 100644 index 0000000000..f216bd41ec --- /dev/null +++ b/5.0.0/propNotEq.js.html @@ -0,0 +1,103 @@ + + + + + propNotEq.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

propNotEq.js

+ + + + + + + +
+
+
import { propEq, complement } from 'ramda';
+
+/**
+ * Returns true if the specified object property is not equal,
+ * in R.equals terms, to the given value; false otherwise.
+ *
+ * @func propNotEq
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.3.0|v2.3.0}
+ * @category Relation
+ * @sig  a -> String -> Object -> Boolean
+ * @param {a} val The value to compare to
+ * @param {String} name The property to pick
+ * @param {Object} object The object, that presumably contains value under the property
+ * @return {boolean} Comparison result
+ * @see {@link http://ramdajs.com/docs/#propEq|R.propEq}
+ * @example
+ *
+ * const abby = { name: 'Abby', age: 7, hair: 'blond' };
+ * const fred = { name: 'Fred', age: 12, hair: 'brown' };
+ * const rusty = { name: 'Rusty', age: 10, hair: 'brown' };
+ * const alois = { name: 'Alois', age: 15, disposition: 'surly' };
+ * const kids = [abby, fred, rusty, alois];
+ * const hasNotBrownHair = RA.propNotEq('brown', 'hair');
+ *
+ * R.filter(hasNotBrownHair, kids); //=> [abby, alois]
+ */
+const propNotEq = complement(propEq);
+
+export default propNotEq;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/rangeStep.js.html b/5.0.0/rangeStep.js.html new file mode 100644 index 0000000000..476b8745c8 --- /dev/null +++ b/5.0.0/rangeStep.js.html @@ -0,0 +1,110 @@ + + + + + rangeStep.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

rangeStep.js

+ + + + + + + +
+
+
import { curryN, map, range, always } from 'ramda';
+
+import floor from './floor.js';
+
+/**
+ * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end.
+ *
+ * `Note`: JavaScript follows the IEEE-754 standard for resolving floating-point values which can produce unexpected results.
+ *
+ * @func rangeStep
+ * @memberOf RA
+ * @category List
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.30.0|v2.30.0}
+ * @sig Number -> Number -> Number -> [Number]
+ * @param {number} step The value to increment or decrement by
+ * @param {number} from The start of the range
+ * @param {number} to The end of the range
+ * @return {number[]} Returns the range of numbers
+ * @see {@link http://ramdajs.com/docs/#range|R.range}
+ * @example
+ *
+ * RA.rangeStep(1, 0, 4); // => [0, 1 ,2, 3]
+ * RA.rangeStep(-1, 0, -4); // => [0, -1, -2, -3]
+ * RA.rangeStep(1, 1, 5); // => [1, 2, 3, 4]
+ * RA.rangeStep(5, 0, 20); // => [0, 5, 10, 15]
+ * RA.rangeStep(-1, 0, -4); // => [0, -1, -2, -3]
+ * RA.rangeStep(0, 1, 4); // => [1, 1, 1]
+ * RA.rangeStep(1, 0, 0); // => []
+ */
+const rangeStep = curryN(3, (step, from, to) => {
+  const callback = step === 0 ? always(from) : (n) => from + step * n;
+  const rangeEnd = step === 0 ? to - from : floor((to - from) / step);
+
+  return map(callback, range(0, rangeEnd));
+});
+
+export default rangeStep;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/reduceIndexed.js.html b/5.0.0/reduceIndexed.js.html new file mode 100644 index 0000000000..13414c1c6b --- /dev/null +++ b/5.0.0/reduceIndexed.js.html @@ -0,0 +1,104 @@ + + + + + reduceIndexed.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

reduceIndexed.js

+ + + + + + + +
+
+
import { addIndex, reduce } from 'ramda';
+
+/**
+ * {@link http://ramdajs.com/docs/#reduce|R.reduce} function that more closely resembles Array.prototype.reduce.
+ * It takes two new parameters to its callback function: the current index, and the entire list.
+ *
+ * `reduceIndexed` implementation is simple : `
+ * const reduceIndexed = R.addIndex(R.reduce);
+ * `
+ * @func reduceIndexed
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.5.0|v2.5.0}
+ * @category List
+ * @typedef Idx = Number
+ * @sig ((a, b, Idx, [b]) => a) -> a -> [b] -> a
+ * @param {Function} fn The iterator function. Receives four values,
+ * the accumulator, the current element from the array, index and the entire list
+ * @param {*} acc The accumulator value
+ * @param {Array} list The list to iterate over
+ * @return {*} The final, accumulated value
+ * @see {@link http://ramdajs.com/docs/#addIndex|R.addIndex}, {@link http://ramdajs.com/docs/#reduce|R.reduce}
+ * @example
+ *
+ * const initialList = ['f', 'o', 'o', 'b', 'a', 'r'];
+ *
+ * reduceIndexed((acc, val, idx, list) => acc + '-' + val + idx, '', initialList);
+ * //=> "-f0-o1-o2-b3-a4-r5"
+ */
+const reduceIndexed = addIndex(reduce);
+
+export default reduceIndexed;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/reduceP.js.html b/5.0.0/reduceP.js.html new file mode 100644 index 0000000000..a6c2345d7a --- /dev/null +++ b/5.0.0/reduceP.js.html @@ -0,0 +1,169 @@ + + + + + reduceP.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

reduceP.js

+ + + + + + + +
+
+
import { curryN, reduce, length } from 'ramda';
+
+import isUndefined from './isUndefined.js';
+import resolveP from './resolveP.js';
+import allP from './allP.js';
+
+/* eslint-disable max-len */
+/**
+ * Given an `Iterable`(arrays are `Iterable`), or a promise of an `Iterable`,
+ * which produces promises (or a mix of promises and values),
+ * iterate over all the values in the `Iterable` into an array and
+ * reduce the array to a value using the given iterator function.
+ *
+ * If the iterator function returns a promise, then the result of the promise is awaited,
+ * before continuing with next iteration. If any promise in the array is rejected or a promise
+ * returned by the iterator function is rejected, the result is rejected as well.
+ *
+ * If `initialValue` is `undefined` (or a promise that resolves to `undefined`) and
+ * the `Iterable` contains only 1 item, the callback will not be called and
+ * the `Iterable's` single item is returned. If the `Iterable` is empty, the callback
+ * will not be called and `initialValue` is returned (which may be undefined).
+ *
+ * This function is basically equivalent to {@link http://bluebirdjs.com/docs/api/promise.reduce.html|bluebird.reduce}.
+ *
+ * @func reduceP
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.13.0|v1.13.0}
+ * @category List
+ * @typedef MaybePromise = Promise.<*> | *
+ * @sig ((Promise a, MaybePromise b) -> Promise a) -> MaybePromise a -> MaybePromise [MaybePromise b] -> Promise a
+ * @param {Function} fn The iterator function. Receives two values, the accumulator and the current element from the list
+ * @param {*|Promise.<*>} acc The accumulator value
+ * @param {Array.<*>|Promise.<Array<*|Promise.<*>>>} list The list to iterate over
+ * @return {Promise} The final, accumulated value
+ * @see {@link http://ramdajs.com/docs/#reduce|R.reduce}, {@link RA.reduceRightP|reduceRightP}, {@link http://bluebirdjs.com/docs/api/promise.reduce.html|bluebird.reduce}
+ * @example
+ *
+ * RA.reduceP(
+ *   (total, fileName) => fs
+ *     .readFileAsync(fileName, 'utf8')
+ *     .then(contents => total + parseInt(contents, 10)),
+ *   0,
+ *   ['file1.txt', 'file2.txt', 'file3.txt']
+ * ); // => Promise(10)
+ *
+ * RA.reduceP(
+ *   (total, fileName) => fs
+ *     .readFileAsync(fileName, 'utf8')
+ *     .then(contents => total + parseInt(contents, 10)),
+ *   Promise.resolve(0),
+ *   ['file1.txt', 'file2.txt', 'file3.txt']
+ * ); // => Promise(10)
+ *
+ * RA.reduceP(
+ *   (total, fileName) => fs
+ *     .readFileAsync(fileName, 'utf8')
+ *     .then(contents => total + parseInt(contents, 10)),
+ *   0,
+ *   [Promise.resolve('file1.txt'), 'file2.txt', 'file3.txt']
+ * ); // => Promise(10)
+ *
+ * RA.reduceP(
+ *   (total, fileName) => fs
+ *     .readFileAsync(fileName, 'utf8')
+ *     .then(contents => total + parseInt(contents, 10)),
+ *   0,
+ *   Promise.resolve([Promise.resolve('file1.txt'), 'file2.txt', 'file3.txt'])
+ * ); // => Promise(10)
+ *
+ */
+/* esline-enable max-len */
+const reduceP = curryN(3, (fn, acc, list) =>
+  resolveP(list).then((iterable) => {
+    const listLength = length(iterable);
+
+    if (listLength === 0) {
+      return acc;
+    }
+
+    const reducer = reduce((accP, currentValueP) =>
+      accP
+        .then((previousValue) => allP([previousValue, currentValueP]))
+        .then(([previousValue, currentValue]) => {
+          if (isUndefined(previousValue) && listLength === 1) {
+            return currentValue;
+          }
+
+          return fn(previousValue, currentValue);
+        })
+    );
+
+    return reducer(resolveP(acc), iterable);
+  })
+);
+
+export default reduceP;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/reduceRightP.js.html b/5.0.0/reduceRightP.js.html new file mode 100644 index 0000000000..ac22add757 --- /dev/null +++ b/5.0.0/reduceRightP.js.html @@ -0,0 +1,174 @@ + + + + + reduceRightP.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

reduceRightP.js

+ + + + + + + +
+
+
import { curryN, pipe, equals, reduceRight, length, concat } from 'ramda';
+
+import isUndefined from './isUndefined.js';
+import resolveP from './resolveP.js';
+import allP from './allP.js';
+
+// in older ramda versions the order of the arguments is flipped
+const flipArgs = pipe(reduceRight(concat, ''), equals('ba'))(['a', 'b']);
+
+/* eslint-disable max-len */
+/**
+ * Given an `Iterable`(arrays are `Iterable`), or a promise of an `Iterable`,
+ * which produces promises (or a mix of promises and values),
+ * iterate over all the values in the `Iterable` into an array and
+ * reduce the array to a value using the given iterator function.
+ *
+ * Similar to {@link RA.reduceP|reduceP} except moves through the input list from the right to the left.
+ * The iterator function receives two values: (value, acc),
+ * while the arguments' order of reduceP's iterator function is (acc, value).
+ *
+ * @func reduceRightP
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.13.0|v1.13.0}
+ * @category List
+ * @typedef MaybePromise = Promise.<*> | *
+ * @sig ((MaybePromise b, Promise a) -> Promise a) -> MaybePromise a -> MaybePromise [MaybePromise b] -> Promise a
+ * @param {Function} fn The iterator function. Receives two values, the current element from the list and the accumulator
+ * @param {*|Promise.<*>} acc The accumulator value
+ * @param {Array.<*>|Promise.<Array<*|Promise.<*>>>} list The list to iterate over
+ * @return {Promise} The final, accumulated value
+ * @see {@link RA.reduceP|reduceP}, {@link http://bluebirdjs.com/docs/api/promise.reduce.html|bluebird.reduce}
+ * @example
+ *
+ * RA.reduceRightP(
+ *   (fileName, total) => fs
+ *     .readFileAsync(fileName, 'utf8')
+ *     .then(contents => total + parseInt(contents, 10)),
+ *   0,
+ *   ['file1.txt', 'file2.txt', 'file3.txt']
+ * ); // => Promise(10)
+ *
+ * RA.reduceRightP(
+ *   (fileName, total) => fs
+ *     .readFileAsync(fileName, 'utf8')
+ *     .then(contents => total + parseInt(contents, 10)),
+ *   Promise.resolve(0),
+ *   ['file1.txt', 'file2.txt', 'file3.txt']
+ * ); // => Promise(10)
+ *
+ * RA.reduceRightP(
+ *   (fileName, total) => fs
+ *     .readFileAsync(fileName, 'utf8')
+ *     .then(contents => total + parseInt(contents, 10)),
+ *   0,
+ *   [Promise.resolve('file1.txt'), 'file2.txt', 'file3.txt']
+ * ); // => Promise(10)
+ *
+ * RA.reduceRightP(
+ *   (fileName, total) => fs
+ *     .readFileAsync(fileName, 'utf8')
+ *     .then(contents => total + parseInt(contents, 10)),
+ *   0,
+ *   Promise.resolve([Promise.resolve('file1.txt'), 'file2.txt', 'file3.txt'])
+ * ); // => Promise(10)
+ *
+ */
+/* esline-enable max-len */
+const reduceRightP = curryN(3, (fn, acc, list) =>
+  resolveP(list).then((iterable) => {
+    const listLength = length(iterable);
+
+    if (listLength === 0) {
+      return acc;
+    }
+
+    const reducer = reduceRight((arg1, arg2) => {
+      let accP;
+      let currentValueP;
+
+      if (flipArgs) {
+        [accP, currentValueP] = [arg1, arg2];
+      } else {
+        [accP, currentValueP] = [arg2, arg1];
+      }
+
+      return accP
+        .then((previousValue) => allP([previousValue, currentValueP]))
+        .then(([previousValue, currentValue]) => {
+          if (isUndefined(previousValue) && listLength === 1) {
+            return currentValue;
+          }
+
+          return fn(currentValue, previousValue);
+        });
+    });
+
+    return reducer(resolveP(acc), iterable);
+  })
+);
+
+export default reduceRightP;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/rejectP.js.html b/5.0.0/rejectP.js.html new file mode 100644 index 0000000000..f9b6991c28 --- /dev/null +++ b/5.0.0/rejectP.js.html @@ -0,0 +1,97 @@ + + + + + rejectP.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

rejectP.js

+ + + + + + + +
+
+
import { bind } from 'ramda';
+
+/**
+ * Composable shortcut for `Promise.reject`.
+ *
+ * Returns a Promise object that is rejected with the given reason.
+ *
+ * @func rejectP
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.16.0|v1.16.0}
+ * @category Function
+ * @sig a -> Promise a
+ * @param {*} [reason=undefined] Reason why this Promise rejected
+ * @return {Promise} A Promise that is rejected with the given reason
+ * @see {@link RA.resolveP|resolveP}
+ * @example
+ *
+ * RA.rejectP(); //=> Promise(undefined)
+ * RA.rejectP('a'); //=> Promise('a')
+ * RA.rejectP([1, 2, 3]); //=> Promise([1, 2, 3])
+ */
+const rejectP = bind(Promise.reject, Promise);
+
+export default rejectP;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/renameKey.js.html b/5.0.0/renameKey.js.html new file mode 100644 index 0000000000..5b0be018f8 --- /dev/null +++ b/5.0.0/renameKey.js.html @@ -0,0 +1,106 @@ + + + + + renameKey.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

renameKey.js

+ + + + + + + +
+
+
import { curry } from 'ramda';
+
+import renameKeys from './renameKeys.js';
+
+/**
+ * Creates a new object with the own properties of the provided object, but a
+ * single key is renamed from `oldKey` to `newKey`.
+ *
+ * Keep in mind that in the case of keys conflict is behavior undefined and
+ * the result may vary between various JS engines!
+ *
+ * @func renameKey
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/4.1.0|v4.1.0}
+ * @category Object
+ * @sig (String a, String b) => a -> b ->  {a: *} -> {b: *}
+ * @param {!string} oldKey
+ * @param {!string} newKey
+ * @param {!Object} obj
+ * @return {!Object} New object with renamed key
+ * @see {@link https://github.com/ramda/ramda/wiki/Cookbook#rename-key-of-an-object|Ramda Cookbook}, {@link RA.renameKeyWith|renameKeyWith}
+ * @example
+ *
+ * const input = { firstName: 'Elisia', age: 22, type: 'human' };
+ *
+ * RA.renameKey('firstName', 'name')(input);
+ * //=> { name: 'Elisia', age: 22, type: 'human' }
+ */
+const renameKey = curry((oldKey, newKey, obj) =>
+  renameKeys({ [oldKey]: newKey }, obj)
+);
+
+export default renameKey;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/renameKeyWith.js.html b/5.0.0/renameKeyWith.js.html new file mode 100644 index 0000000000..ec4cb83f3c --- /dev/null +++ b/5.0.0/renameKeyWith.js.html @@ -0,0 +1,103 @@ + + + + + renameKeyWith.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

renameKeyWith.js

+ + + + + + + +
+
+
import { curry, equals, when } from 'ramda';
+
+import renameKeysWith from './renameKeysWith.js';
+
+/**
+ * Creates a new object with the own properties of the provided object, but the
+ * key `key` renamed according to logic of renaming function.
+ *
+ * Keep in mind that in case the new key name already existed on the object,
+ * the behaviour is undefined and the result may vary between various JS engines!
+ *
+ * @func renameKeyWith
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.29.0|v2.29.0}
+ * @category Object
+ * @sig (k -> k) -> k -> {k: v} -> {k: v}
+ * @param {Function} fn Function that renames the keys
+ * @param {!string} key Key to rename
+ * @param {!Object} obj Provided object
+ * @return {!Object} New object with renamed key
+ * @see {@link RA.renameKeysWith|renameKeysWith}
+ * @example
+ *
+ * RA.renameKeyWith(R.concat('a'), 'A', { A: 1 }) //=> { aA: 1 }
+ */
+const renameKeyWith = curry((fn, key, obj) =>
+  renameKeysWith(when(equals(key), fn), obj)
+);
+
+export default renameKeyWith;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/renameKeys.js.html b/5.0.0/renameKeys.js.html new file mode 100644 index 0000000000..8c099eebbc --- /dev/null +++ b/5.0.0/renameKeys.js.html @@ -0,0 +1,113 @@ + + + + + renameKeys.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

renameKeys.js

+ + + + + + + +
+
+
import { curry, has } from 'ramda';
+
+import renameKeysWith from './renameKeysWith.js';
+
+const valueOrKey = (keysMap) => (key) => {
+  if (has(key, keysMap)) {
+    return keysMap[key];
+  }
+  return key;
+};
+
+/**
+ * Creates a new object with the own properties of the provided object, but the
+ * keys renamed according to the keysMap object as `{oldKey: newKey}`.
+ * When some key is not found in the keysMap, then it's passed as-is.
+ *
+ * Keep in mind that in the case of keys conflict is behaviour undefined and
+ * the result may vary between various JS engines!
+ *
+ * @func renameKeys
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.5.0|v1.5.0}
+ * @category Object
+ * @sig {a: b} -> {a: *} -> {b: *}
+ * @param {!Object} keysMap
+ * @param {!Object} obj
+ * @return {!Object} New object with renamed keys
+ * @see {@link https://github.com/ramda/ramda/wiki/Cookbook#rename-keys-of-an-object|Ramda Cookbook}, {@link RA.renameKeysWith|renameKeysWith}
+ * @example
+ *
+ * const input = { firstName: 'Elisia', age: 22, type: 'human' };
+ *
+ * RA.renameKeys({ firstName: 'name', type: 'kind', foo: 'bar' })(input);
+ * //=> { name: 'Elisia', age: 22, kind: 'human' }
+ */
+const renameKeys = curry((keysMap, obj) =>
+  renameKeysWith(valueOrKey(keysMap), obj)
+);
+
+export default renameKeys;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/renameKeysWith.js.html b/5.0.0/renameKeysWith.js.html new file mode 100644 index 0000000000..feffa81401 --- /dev/null +++ b/5.0.0/renameKeysWith.js.html @@ -0,0 +1,100 @@ + + + + + renameKeysWith.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

renameKeysWith.js

+ + + + + + + +
+
+
import { curry, toPairs, pipe, map, over, lensIndex, fromPairs } from 'ramda';
+
+/**
+ * Creates a new object with the own properties of the provided object, but the
+ * keys renamed according to logic of renaming function.
+ *
+ * Keep in mind that in the case of keys conflict is behaviour undefined and
+ * the result may vary between various JS engines!
+ *
+ * @func renameKeysWith
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.5.0|v1.5.0}
+ * @category Object
+ * @sig (a -> b) -> {a: *} -> {b: *}
+ * @param {Function} fn Function that renames the keys
+ * @param {!Object} obj Provided object
+ * @return {!Object} New object with renamed keys
+ * @see {@link https://github.com/ramda/ramda/wiki/Cookbook#rename-keys-of-an-object-by-a-function|Ramda Cookbook}, {@link RA.renameKeys|renameKeys}
+ * @example
+ *
+ * RA.renameKeysWith(R.concat('a'), { A: 1, B: 2, C: 3 }) //=> { aA: 1, aB: 2, aC: 3 }
+ */
+const renameKeysWith = curry((fn, obj) =>
+  pipe(toPairs, map(over(lensIndex(0), fn)), fromPairs)(obj)
+);
+
+export default renameKeysWith;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/repeatStr.js.html b/5.0.0/repeatStr.js.html new file mode 100644 index 0000000000..0488f2d333 --- /dev/null +++ b/5.0.0/repeatStr.js.html @@ -0,0 +1,103 @@ + + + + + repeatStr.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

repeatStr.js

+ + + + + + + +
+
+
import { curry, invoker, flip } from 'ramda';
+
+import ponyfill from './internal/ponyfills/String.repeat.js';
+import isFunction from './isFunction.js';
+
+export const repeatStrPonyfill = curry(ponyfill);
+
+export const repeatStrInvoker = flip(invoker(1, 'repeat'));
+
+/**
+ * Constructs and returns a new string which contains the specified
+ * number of copies of the string on which it was called, concatenated together.
+ *
+ * @func repeatStr
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.11.0|v2.11.0}
+ * @category List
+ * @sig String -> Number -> String
+ * @param {string} value String value to be repeated
+ * @param {number} count An integer between 0 and +∞: [0, +∞), indicating the number of times to repeat the string in the newly-created string that is to be returned
+ * @return {string} A new string containing the specified number of copies of the given string
+ * @example
+ *
+ * RA.repeatStr('a', 3); //=> 'aaa'
+ */
+const repeatStr = isFunction(String.prototype.repeat)
+  ? repeatStrInvoker
+  : repeatStrPonyfill;
+
+export default repeatStr;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/replaceAll.js.html b/5.0.0/replaceAll.js.html new file mode 100644 index 0000000000..5d090e4bf2 --- /dev/null +++ b/5.0.0/replaceAll.js.html @@ -0,0 +1,108 @@ + + + + + replaceAll.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

replaceAll.js

+ + + + + + + +
+
+
import { curryN, invoker } from 'ramda';
+
+import isFunction from './isFunction.js';
+import ponyfill from './internal/ponyfills/String.replaceAll.js';
+
+export const replaceAllPonyfill = curryN(3, ponyfill);
+
+export const replaceAllInvoker = invoker(2, 'replaceAll');
+
+/**
+ * Replaces all substring matches in a string with a replacement.
+ *
+ * @func replaceAll
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.17.0|v2.17.0}
+ * @category String
+ * @sig String -> String -> String -> String
+ * @param {string} searchValue The substring or a global RegExp to match
+ * @param {string} replaceValue The string to replace the matches with
+ * @param {string} str The String to do the search and replacement in
+ * @return {string} A new string containing all the `searchValue` replaced with the `replaceValue`
+ * @throws {TypeError} When invalid arguments provided
+ * @see {@link http://ramdajs.com/docs/#replace|R.replace}, {@link https://github.com/tc39/proposal-string-replaceall|TC39 proposal}
+ * @example
+ *
+ * RA.replaceAll('ac', 'ef', 'ac ab ac ab'); //=> 'ef ab ef ab'
+ * RA.replaceAll('', '_', 'xxx'); //=> '_x_x_x_'
+ * RA.replaceAll(/x/g, 'v', 'xxx'); //=> 'vvv'
+ * RA.replaceAll(/x/, 'v', 'xxx'); //=> TypeError
+ */
+const replaceAll = isFunction(String.prototype.replaceAll)
+  ? replaceAllInvoker
+  : replaceAllPonyfill;
+
+export default replaceAll;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/resolveP.js.html b/5.0.0/resolveP.js.html new file mode 100644 index 0000000000..caef52f4f1 --- /dev/null +++ b/5.0.0/resolveP.js.html @@ -0,0 +1,101 @@ + + + + + resolveP.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

resolveP.js

+ + + + + + + +
+
+
import { bind } from 'ramda';
+
+/* eslint-disable max-len */
+/**
+ * Composable shortcut for `Promise.resolve`.
+ *
+ * Returns a Promise object that is resolved with the given value.
+ * If the value is a thenable (i.e. has a "then" method), the returned promise will
+ * "follow" that thenable, adopting its eventual state.
+ *
+ * @func resolveP
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.16.0|v1.16.0}
+ * @category Function
+ * @sig a -> Promise a
+ * @param {*} [value=undefined] Argument to be resolved by this Promise. Can also be a Promise or a thenable to resolve
+ * @return {Promise} A Promise that is resolved with the given value, or the promise passed as value, if the value was a promise object
+ * @see {@link RA.rejectP|rejectP}
+ * @example
+ *
+ * RA.resolveP(); //=> Promise(undefined)
+ * RA.resolveP('a'); //=> Promise('a')
+ * RA.resolveP([1, 2, 3]); //=> Promise([1, 2, 3])
+ */
+/* eslint-enable max-len */
+const resolveP = bind(Promise.resolve, Promise);
+
+export default resolveP;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/round.js.html b/5.0.0/round.js.html new file mode 100644 index 0000000000..705d5930f0 --- /dev/null +++ b/5.0.0/round.js.html @@ -0,0 +1,99 @@ + + + + + round.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

round.js

+ + + + + + + +
+
+
import { bind, curryN } from 'ramda';
+
+/**
+ * Returns the value of a number rounded to the nearest integer.
+ *
+ * @func round
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.15.0|v2.15.0}
+ * @category Math
+ * @sig Number -> Number
+ * @param {number} number The number to round
+ * @return {number} The value of the given number rounded to the nearest integer
+ * @example
+ *
+ * RA.round(0.9); //=> 1
+ * RA.round(5.95); //=> 6
+ * RA.round(5.5); //=> 6
+ * RA.round(5.05); //=> 5
+ * RA.round(-5.05); //=> -5
+ * RA.round(-5.5); //=> -5
+ * RA.round(-5.95); //=> -6
+ */
+
+const round = curryN(1, bind(Math.round, Math));
+
+export default round;
+
+
+
+ + + + +
+ +
+ + + + + + + diff --git a/5.0.0/scripts/RA.web.min.js b/5.0.0/scripts/RA.web.min.js new file mode 100644 index 0000000000..186e87d687 --- /dev/null +++ b/5.0.0/scripts/RA.web.min.js @@ -0,0 +1 @@ +!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports.RA=r():e.RA=r()}(self,(()=>(()=>{"use strict";var e={r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},r={};e.r(r),exports.__esModule=!0,exports.isNotSet=exports.isNotRegExp=exports.isNotPrimitive=exports.isNotPlainObject=exports.isNotPlainObj=exports.isNotPair=exports.isNotObjectLike=exports.isNotObject=exports.isNotObjLike=exports.isNotObj=exports.isNotNumber=exports.isNotNull=exports.isNotNilOrEmpty=exports.isNotNil=exports.isNotNaN=exports.isNotMap=exports.isNotInteger=exports.isNotGeneratorFunction=exports.isNotFunction=exports.isNotFloat=exports.isNotFinite=exports.isNotDate=exports.isNotBoolean=exports.isNotAsyncFunction=exports.isNotArrayLike=exports.isNotArray=exports.isNonPositive=exports.isNonNegative=exports.isNonEmptyString=exports.isNonEmptyArray=exports.isNilOrEmpty=exports.isNegativeZero=exports.isNegative=exports.isNaturalNumber=exports.isNaN=exports.isMap=exports.isIterable=exports.isInvalidDate=exports.isInteger32=exports.isInteger=exports.isInt32=exports.isIndexed=exports.isGeneratorFunction=exports.isFunction=exports.isFloat=exports.isFinite=exports.isFalsy=exports.isFalse=exports.isEven=exports.isError=exports.isEmptyString=exports.isEmptyArray=exports.isDate=exports.isBoolean=exports.isBlank=exports.isBigInt=exports.isAsyncFunction=exports.isArrayLike=exports.isArray=exports.invokeArgs=exports.invoke=exports.included=exports.inRange=exports.fnull=exports.floor=exports.flattenProp=exports.flattenPath=exports.flattenDepth=exports.firstP=exports.findOr=exports.filterIndexed=exports.escapeRegExp=exports.ensureArray=exports.dropArgs=exports.divideNum=exports.dispatch=exports.delayP=exports.defaultWhen=exports.curryRightN=exports.curryRight=exports.copyKeys=exports.concatRight=exports.concatAll=exports.compact=exports.ceil=exports.catchP=exports.cata=exports.async=exports.argsPass=exports.appendFlipped=exports.anyP=exports.allUnique=exports.allSettledP=exports.allP=exports.allIdenticalTo=exports.allIdentical=exports.allEqualTo=exports.allEqual=exports.Y=exports.Identity=void 0,exports.sortByProps=exports.sortByProp=exports.sortByPaths=exports.sliceTo=exports.sliceFrom=exports.skipTake=exports.sign=exports.sequencing=exports.seq=exports.round=exports.resolveP=exports.replaceAll=exports.repeatStr=exports.renameKeysWith=exports.renameKeys=exports.renameKeyWith=exports.renameKey=exports.rejectP=exports.reduceRightP=exports.reduceP=exports.reduceIndexed=exports.rangeStep=exports.propNotEq=exports.pickIndexes=exports.paths=exports.pathOrLazy=exports.pathNotEq=exports.padStart=exports.padEnd=exports.padCharsStart=exports.padCharsEnd=exports.overlaps=exports.omitIndexes=exports.omitBy=exports.notEqual=exports.notBoth=exports.notAllUnique=exports.notAllPass=exports.nor=exports.noop=exports.nonePass=exports.noneP=exports.neither=exports.nand=exports.move=exports.mergeProps=exports.mergeProp=exports.mergePaths=exports.mergePath=exports.mapIndexed=exports.list=exports.liftFN=exports.liftF=exports.lensTraverse=exports.lensSatisfies=exports.lensNotSatisfy=exports.lensNotEq=exports.lensIso=exports.lensEq=exports.lengthNotEq=exports.lengthLte=exports.lengthLt=exports.lengthGte=exports.lengthGt=exports.lengthEq=exports.lastP=exports.isValidNumber=exports.isValidDate=exports.isUndefined=exports.isUinteger32=exports.isUint32=exports.isTruthy=exports.isTrue=exports.isThenable=exports.isSymbol=exports.isString=exports.isSparseArray=exports.isSet=exports.isSentinelValue=exports.isSafeInteger=exports.isRegExp=exports.isPrototypeOf=exports.isPromise=exports.isPrimitive=exports.isPositiveZero=exports.isPositive=exports.isPlainObject=exports.isPlainObj=exports.isPair=exports.isOdd=exports.isObjectLike=exports.isObject=exports.isObjLike=exports.isObj=exports.isNumber=exports.isNull=exports.isNotValidNumber=exports.isNotValidDate=exports.isNotUndefined=exports.isNotString=void 0,exports.zipObjWith=exports.weaveLazy=exports.weave=exports.viewOr=exports.unzipObjWith=exports.trunc=exports.trimStart=exports.trimRight=exports.trimLeft=exports.trimEnd=exports.trimCharsStart=exports.trimCharsEnd=exports.toUinteger32=exports.toUint32=exports.toNumber=exports.toInteger32=exports.toInt32=exports.toArray=exports.thenCatchP=exports.subtractNum=exports.stubUndefined=exports.stubString=exports.stubObject=exports.stubObj=exports.stubNull=exports.stubArray=exports.spreadProp=exports.spreadPath=void 0;var t=Xt(require("./isNotUndefined.js"));exports.isNotUndefined=t.default;var s=Xt(require("./isUndefined.js"));exports.isUndefined=s.default;var a=Xt(require("./isNull.js"));exports.isNull=a.default;var i=Xt(require("./isNotNull.js"));exports.isNotNull=i.default;var o=Xt(require("./isNotNil.js"));exports.isNotNil=o.default;var p=Xt(require("./isArray.js"));exports.isArray=p.default;var u=Xt(require("./isIterable.js"));exports.isIterable=u.default;var l=Xt(require("./isEmptyArray.js"));exports.isEmptyArray=l.default;var x=Xt(require("./isNotArray.js"));exports.isNotArray=x.default;var d=Xt(require("./isNonEmptyArray.js"));exports.isNonEmptyArray=d.default;var n=Xt(require("./isBoolean.js"));exports.isBoolean=n.default;var f=Xt(require("./isNotBoolean.js"));exports.isNotBoolean=f.default;var v=Xt(require("./isNilOrEmpty.js"));exports.isNilOrEmpty=v.default;var j=Xt(require("./isString.js"));exports.isString=j.default;var q=Xt(require("./isEmptyString.js"));exports.isEmptyString=q.default;var N=Xt(require("./isNotString.js"));exports.isNotString=N.default;var c=Xt(require("./isNonEmptyString.js"));exports.isNonEmptyString=c.default;var y=Xt(require("./isArrayLike.js"));exports.isArrayLike=y.default;var g=Xt(require("./isNotArrayLike.js"));exports.isNotArrayLike=g.default;var P=Xt(require("./isGeneratorFunction.js"));exports.isGeneratorFunction=P.default;var m=Xt(require("./isNotGeneratorFunction.js"));exports.isNotGeneratorFunction=m.default;var h=Xt(require("./isAsyncFunction.js"));exports.isAsyncFunction=h.default;var b=Xt(require("./isNotAsyncFunction.js"));exports.isNotAsyncFunction=b.default;var E=Xt(require("./isFunction.js"));exports.isFunction=E.default;var S=Xt(require("./isNotFunction.js"));exports.isNotFunction=S.default;var O=Xt(require("./isObj.js"));exports.isObj=O.default,exports.isObject=O.default;var I=Xt(require("./isNotObj.js"));exports.isNotObj=I.default,exports.isNotObject=I.default;var A=Xt(require("./isObjLike.js"));exports.isObjLike=A.default,exports.isObjectLike=A.default;var F=Xt(require("./isNotObjLike.js"));exports.isNotObjLike=F.default,exports.isNotObjectLike=F.default;var k=Xt(require("./isPlainObj.js"));exports.isPlainObj=k.default,exports.isPlainObject=k.default;var L=Xt(require("./isNotPlainObj.js"));exports.isNotPlainObj=L.default,exports.isNotPlainObject=L.default;var R=Xt(require("./isDate.js"));exports.isDate=R.default;var B=Xt(require("./isNotDate.js"));exports.isNotDate=B.default;var T=Xt(require("./isValidDate.js"));exports.isValidDate=T.default;var U=Xt(require("./isNotValidDate.js"));exports.isNotValidDate=U.default,exports.isInvalidDate=U.default;var D=Xt(require("./isNumber.js"));exports.isNumber=D.default;var C=Xt(require("./isNotNumber.js"));exports.isNotNumber=C.default;var K=Xt(require("./isPositive.js"));exports.isPositive=K.default;var V=Xt(require("./isNegative.js"));exports.isNegative=V.default;var W=Xt(require("./isPositiveZero.js"));exports.isPositiveZero=W.default;var z=Xt(require("./isNegativeZero.js"));exports.isNegativeZero=z.default;var G=Xt(require("./isNotNilOrEmpty.js"));exports.isNotNilOrEmpty=G.default;var M=Xt(require("./isNonPositive.js"));exports.isNonPositive=M.default;var w=Xt(require("./isNonNegative.js"));exports.isNonNegative=w.default;var Z=Xt(require("./isMap.js"));exports.isMap=Z.default;var _=Xt(require("./isNotMap.js"));exports.isNotMap=_.default;var Y=Xt(require("./isNaN.js"));exports.isNaN=Y.default;var H=Xt(require("./isNotNaN.js"));exports.isNotNaN=H.default;var J=Xt(require("./isFinite.js"));exports.isFinite=J.default;var Q=Xt(require("./isNotFinite.js"));exports.isNotFinite=Q.default;var X=Xt(require("./isInteger.js"));exports.isInteger=X.default;var $=Xt(require("./isInteger32.js"));exports.isInteger32=$.default,exports.isInt32=$.default;var ee=Xt(require("./isUinteger32.js"));exports.isUinteger32=ee.default,exports.isUint32=ee.default;var re=Xt(require("./isNotInteger.js"));exports.isNotInteger=re.default;var te=Xt(require("./isBigInt.js"));exports.isBigInt=te.default;var se=Xt(require("./isFloat.js"));exports.isFloat=se.default;var ae=Xt(require("./isNotFloat.js"));exports.isNotFloat=ae.default;var ie=Xt(require("./isValidNumber.js"));exports.isValidNumber=ie.default;var oe=Xt(require("./isNotValidNumber.js"));exports.isNotValidNumber=oe.default;var pe=Xt(require("./isOdd.js"));exports.isOdd=pe.default;var ue=Xt(require("./isEven.js"));exports.isEven=ue.default;var le=Xt(require("./isPair.js"));exports.isPair=le.default;var xe=Xt(require("./isNotPair.js"));exports.isNotPair=xe.default;var de=Xt(require("./isThenable.js"));exports.isThenable=de.default;var ne=Xt(require("./isPromise.js"));exports.isPromise=ne.default;var fe=Xt(require("./isTrue.js"));exports.isTrue=fe.default;var ve=Xt(require("./isFalse.js"));exports.isFalse=ve.default;var je=Xt(require("./isTruthy.js"));exports.isTruthy=je.default;var qe=Xt(require("./isFalsy.js"));exports.isFalsy=qe.default;var Ne=Xt(require("./isRegExp.js"));exports.isRegExp=Ne.default;var ce=Xt(require("./isNotRegExp.js"));exports.isNotRegExp=ce.default;var ye=Xt(require("./isSet.js"));exports.isSet=ye.default;var ge=Xt(require("./isNotSet.js"));exports.isNotSet=ge.default;var Pe=Xt(require("./isSparseArray.js"));exports.isSparseArray=Pe.default;var me=Xt(require("./isSymbol.js"));exports.isSymbol=me.default;var he=Xt(require("./isSafeInteger.js"));exports.isSafeInteger=he.default;var be=Xt(require("./isIndexed.js"));exports.isIndexed=be.default;var Ee=Xt(require("./isError.js"));exports.isError=Ee.default;var Se=Xt(require("./isNaturalNumber.js"));exports.isNaturalNumber=Se.default;var Oe=Xt(require("./isPrimitive.js"));exports.isPrimitive=Oe.default;var Ie=Xt(require("./isNotPrimitive.js"));exports.isNotPrimitive=Ie.default;var Ae=Xt(require("./isSentinelValue.js"));exports.isSentinelValue=Ae.default;var Fe=Xt(require("./isBlank.js"));exports.isBlank=Fe.default;var ke=Xt(require("./stubUndefined.js"));exports.stubUndefined=ke.default;var Le=Xt(require("./stubNull.js"));exports.stubNull=Le.default;var Re=Xt(require("./stubObj.js"));exports.stubObj=Re.default,exports.stubObject=Re.default;var Be=Xt(require("./stubString.js"));exports.stubString=Be.default;var Te=Xt(require("./stubArray.js"));exports.stubArray=Te.default;var Ue=Xt(require("./noop.js"));exports.noop=Ue.default;var De=Xt(require("./liftFN.js"));exports.liftFN=De.default;var Ce=Xt(require("./liftF.js"));exports.liftF=Ce.default;var Ke=Xt(require("./cata.js"));exports.cata=Ke.default;var Ve=Xt(require("./weave.js"));exports.weave=Ve.default;var We=Xt(require("./weaveLazy.js"));exports.weaveLazy=We.default;var ze=Xt(require("./curryRightN.js"));exports.curryRightN=ze.default;var Ge=Xt(require("./curryRight.js"));exports.curryRight=Ge.default;var Me=Xt(require("./allP.js"));exports.allP=Me.default;var we=Xt(require("./catchP.js"));exports.catchP=we.default;var Ze=Xt(require("./noneP.js"));exports.noneP=Ze.default;var _e=Xt(require("./resolveP.js"));exports.resolveP=_e.default;var Ye=Xt(require("./rejectP.js"));exports.rejectP=Ye.default;var He=Xt(require("./delayP.js"));exports.delayP=He.default;var Je=Xt(require("./thenCatchP.js"));exports.thenCatchP=Je.default;var Qe=Xt(require("./allSettledP.js"));exports.allSettledP=Qe.default;var Xe=Xt(require("./Y.js"));exports.Y=Xe.default;var $e=Xt(require("./seq.js"));exports.seq=$e.default,exports.sequencing=$e.default;var er=Xt(require("./dispatch.js"));exports.dispatch=er.default;var rr=Xt(require("./async.js"));exports.async=rr.default;var tr=Xt(require("./anyP.js"));exports.anyP=tr.default,exports.firstP=tr.default;var sr=Xt(require("./lastP.js"));exports.lastP=sr.default;var ar=Xt(require("./fnull.js"));exports.fnull=ar.default;var ir=Xt(require("./mapIndexed.js"));exports.mapIndexed=ir.default;var or=Xt(require("./reduceIndexed.js"));exports.reduceIndexed=or.default;var pr=Xt(require("./filterIndexed.js"));exports.filterIndexed=pr.default;var ur=Xt(require("./pickIndexes.js"));exports.pickIndexes=ur.default;var lr=Xt(require("./list.js"));exports.list=lr.default;var xr=Xt(require("./ensureArray.js"));exports.ensureArray=xr.default;var dr=Xt(require("./concatAll.js"));exports.concatAll=dr.default;var nr=Xt(require("./concatRight.js"));exports.concatRight=nr.default;var fr=Xt(require("./reduceP.js"));exports.reduceP=fr.default;var vr=Xt(require("./reduceRightP.js"));exports.reduceRightP=vr.default;var jr=Xt(require("./sliceFrom.js"));exports.sliceFrom=jr.default;var qr=Xt(require("./sliceTo.js"));exports.sliceTo=qr.default;var Nr=Xt(require("./omitIndexes.js"));exports.omitIndexes=Nr.default;var cr=Xt(require("./compact.js"));exports.compact=cr.default;var yr=Xt(require("./appendFlipped.js"));exports.appendFlipped=yr.default;var gr=Xt(require("./included.js"));exports.included=gr.default;var Pr=Xt(require("./move.js"));exports.move=Pr.default;var mr=Xt(require("./lengthGt.js"));exports.lengthGt=mr.default;var hr=Xt(require("./lengthLt.js"));exports.lengthLt=hr.default;var br=Xt(require("./lengthGte.js"));exports.lengthGte=br.default;var Er=Xt(require("./lengthLte.js"));exports.lengthLte=Er.default;var Sr=Xt(require("./lengthEq.js"));exports.lengthEq=Sr.default;var Or=Xt(require("./lengthNotEq.js"));exports.lengthNotEq=Or.default;var Ir=Xt(require("./allEqual.js"));exports.allEqual=Ir.default;var Ar=Xt(require("./repeatStr.js"));exports.repeatStr=Ar.default;var Fr=Xt(require("./allIdentical.js"));exports.allIdentical=Fr.default;var kr=Xt(require("./allIdenticalTo.js"));exports.allIdenticalTo=kr.default;var Lr=Xt(require("./allEqualTo.js"));exports.allEqualTo=Lr.default;var Rr=Xt(require("./flattenDepth.js"));exports.flattenDepth=Rr.default;var Br=Xt(require("./toArray.js"));exports.toArray=Br.default;var Tr=Xt(require("./allUnique.js"));exports.allUnique=Tr.default;var Ur=Xt(require("./notAllUnique.js"));exports.notAllUnique=Ur.default;var Dr=Xt(require("./sortByProps.js"));exports.sortByProps=Dr.default;var Cr=Xt(require("./sortByProp.js"));exports.sortByProp=Cr.default;var Kr=Xt(require("./sortByPaths.js"));exports.sortByPaths=Kr.default;var Vr=Xt(require("./skipTake.js"));exports.skipTake=Vr.default;var Wr=Xt(require("./rangeStep.js"));exports.rangeStep=Wr.default;var zr=Xt(require("./findOr.js"));exports.findOr=zr.default;var Gr=Xt(require("./invoke.js"));exports.invoke=Gr.default;var Mr=Xt(require("./invokeArgs.js"));exports.invokeArgs=Mr.default;var wr=Xt(require("./paths.js"));exports.paths=wr.default;var Zr=Xt(require("./renameKey.js"));exports.renameKey=Zr.default;var _r=Xt(require("./renameKeys.js"));exports.renameKeys=_r.default;var Yr=Xt(require("./renameKeysWith.js"));exports.renameKeysWith=Yr.default;var Hr=Xt(require("./renameKeyWith.js"));exports.renameKeyWith=Hr.default;var Jr=Xt(require("./copyKeys.js"));exports.copyKeys=Jr.default;var Qr=Xt(require("./mergeProps.js"));exports.mergeProps=Qr.default;var Xr=Xt(require("./mergePaths.js"));exports.mergePaths=Xr.default;var $r=Xt(require("./mergeProp.js"));exports.mergeProp=$r.default;var et=Xt(require("./mergePath.js"));exports.mergePath=et.default;var rt=Xt(require("./omitBy.js"));exports.omitBy=rt.default;var tt=Xt(require("./pathOrLazy.js"));exports.pathOrLazy=tt.default;var st=Xt(require("./viewOr.js"));exports.viewOr=st.default;var at=Xt(require("./spreadProp.js"));exports.spreadProp=at.default;var it=Xt(require("./spreadPath.js"));exports.spreadPath=it.default;var ot=Xt(require("./flattenProp.js"));exports.flattenProp=ot.default;var pt=Xt(require("./flattenPath.js"));exports.flattenPath=pt.default;var ut=Xt(require("./unzipObjWith.js"));exports.unzipObjWith=ut.default;var lt=Xt(require("./zipObjWith.js"));exports.zipObjWith=lt.default;var xt=Xt(require("./isPrototypeOf.js"));exports.isPrototypeOf=xt.default;var dt=Xt(require("./lensEq.js"));exports.lensEq=dt.default;var nt=Xt(require("./lensNotEq.js"));exports.lensNotEq=nt.default;var ft=Xt(require("./lensSatisfies.js"));exports.lensSatisfies=ft.default;var vt=Xt(require("./lensNotSatisfy.js"));exports.lensNotSatisfy=vt.default;var jt=Xt(require("./lensTraverse.js"));exports.lensTraverse=jt.default;var qt=Xt(require("./lensIso.js"));exports.lensIso=qt.default;var Nt=Xt(require("./propNotEq.js"));exports.propNotEq=Nt.default;var ct=Xt(require("./pathNotEq.js"));exports.pathNotEq=ct.default;var yt=Xt(require("./inRange.js"));exports.inRange=yt.default;var gt=Xt(require("./notEqual.js"));exports.notEqual=gt.default;var Pt=Xt(require("./overlaps.js"));exports.overlaps=Pt.default;var mt=Xt(require("./defaultWhen.js"));exports.defaultWhen=mt.default;var ht=Xt(require("./notBoth.js"));exports.notBoth=ht.default;var bt=Xt(require("./nand.js"));exports.nand=bt.default;var Et=Xt(require("./neither.js"));exports.neither=Et.default;var St=Xt(require("./nor.js"));exports.nor=St.default;var Ot=Xt(require("./notAllPass.js"));exports.notAllPass=Ot.default;var It=Xt(require("./nonePass.js"));exports.nonePass=It.default;var At=Xt(require("./argsPass.js"));exports.argsPass=At.default;var Ft=Xt(require("./dropArgs.js"));exports.dropArgs=Ft.default;var kt=Xt(require("./round.js"));exports.round=kt.default;var Lt=Xt(require("./ceil.js"));exports.ceil=Lt.default;var Rt=Xt(require("./divideNum.js"));exports.divideNum=Rt.default;var Bt=Xt(require("./floor.js"));exports.floor=Bt.default;var Tt=Xt(require("./trunc.js"));exports.trunc=Tt.default;var Ut=Xt(require("./sign.js"));exports.sign=Ut.default;var Dt=Xt(require("./subtractNum.js"));exports.subtractNum=Dt.default;var Ct=Xt(require("./toInteger32.js"));exports.toInteger32=Ct.default,exports.toInt32=Ct.default;var Kt=Xt(require("./toUinteger32.js"));exports.toUinteger32=Kt.default,exports.toUint32=Kt.default;var Vt=Xt(require("./toNumber.js"));exports.toNumber=Vt.default;var Wt=Xt(require("./replaceAll.js"));exports.replaceAll=Wt.default;var zt=Xt(require("./escapeRegExp.js"));exports.escapeRegExp=zt.default;var Gt=Xt(require("./trimStart.js"));exports.trimStart=Gt.default,exports.trimLeft=Gt.default;var Mt=Xt(require("./trimEnd.js"));exports.trimEnd=Mt.default,exports.trimRight=Mt.default;var wt=Xt(require("./trimCharsEnd.js"));exports.trimCharsEnd=wt.default;var Zt=Xt(require("./trimCharsStart.js"));exports.trimCharsStart=Zt.default;var _t=Xt(require("./padCharsStart.js"));exports.padCharsStart=_t.default;var Yt=Xt(require("./padCharsEnd.js"));exports.padCharsEnd=Yt.default;var Ht=Xt(require("./padEnd.js"));exports.padEnd=Ht.default;var Jt=Xt(require("./padStart.js"));exports.padStart=Jt.default;var Qt=Xt(require("./fantasy-land/Identity.js"));function Xt(e){return e&&e.__esModule?e:{default:e}}return exports.Identity=Qt.default,r})())); \ No newline at end of file diff --git a/5.0.0/scripts/linenumber.js b/5.0.0/scripts/linenumber.js new file mode 100644 index 0000000000..8d52f7eafd --- /dev/null +++ b/5.0.0/scripts/linenumber.js @@ -0,0 +1,25 @@ +/*global document */ +(function() { + var source = document.getElementsByClassName('prettyprint source linenums'); + var i = 0; + var lineNumber = 0; + var lineId; + var lines; + var totalLines; + var anchorHash; + + if (source && source[0]) { + anchorHash = document.location.hash.substring(1); + lines = source[0].getElementsByTagName('li'); + totalLines = lines.length; + + for (; i < totalLines; i++) { + lineNumber++; + lineId = 'line' + lineNumber; + lines[i].id = lineId; + if (lineId === anchorHash) { + lines[i].className += ' selected'; + } + } + } +})(); diff --git a/5.0.0/scripts/prettify/Apache-License-2.0.txt b/5.0.0/scripts/prettify/Apache-License-2.0.txt new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/5.0.0/scripts/prettify/Apache-License-2.0.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/5.0.0/scripts/prettify/lang-css.js b/5.0.0/scripts/prettify/lang-css.js new file mode 100644 index 0000000000..041e1f5906 --- /dev/null +++ b/5.0.0/scripts/prettify/lang-css.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n "]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]*)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["com", +/^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]); diff --git a/5.0.0/scripts/prettify/prettify.js b/5.0.0/scripts/prettify/prettify.js new file mode 100644 index 0000000000..eef5ad7e6a --- /dev/null +++ b/5.0.0/scripts/prettify/prettify.js @@ -0,0 +1,28 @@ +var q=null;window.PR_SHOULD_USE_CONTINUATION=!0; +(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a= +[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;ci[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m), +l=[],p={},d=0,g=e.length;d=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, +q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/, +q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g, +"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a), +a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e} +for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], +"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"], +H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], +J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+ +I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]), +["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css", +/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}), +["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes", +hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p=0){var k=k.match(g),f,b;if(b= +!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p":Y(t,n)}function t(n,t){return M(function(t){return D(t)+": "+u(n[t])},t.slice().sort())}switch(Object.prototype.toString.call(r)){case"[object Arguments]":return"(function() { return arguments; }("+M(u,r).join(", ")+"))";case"[object Array]":return"["+M(u,r).concat(t(r,X(function(t){return/^\d+$/.test(t)},U(r)))).join(", ")+"]";case"[object Boolean]":return"object"===A(r)?"new Boolean("+u(r.valueOf())+")":""+r;case"[object Date]":return"new Date("+(isNaN(r.valueOf())?u(NaN):D(L(r)))+")";case"[object Map]":return"new Map("+u(Array.from(r))+")";case"[object Null]":return"null";case"[object Number]":return"object"===A(r)?"new Number("+u(r.valueOf())+")":1/r==-1/0?"-0":r.toString(10);case"[object Set]":return"new Set("+u(Array.from(r).sort())+")";case"[object String]":return"object"===A(r)?"new String("+u(r.valueOf())+")":D(r);case"[object Undefined]":return"undefined";default:if("function"==typeof r.toString){var n=""+r;if("[object Object]"!=n)return n}return"{"+t(r,U(r)).join(", ")+"}"}}var Z=o(function(t){return Y(t,[])}),Q=c(function(t,n){if(t===n)return n;function r(t,n){if(n ul li').each(function(index, el) { + var li = $(el); + var liText = li.text().toLowerCase(); + + if (liText.indexOf(val) === -1) { + li.hide(); + } else { + li.show(); + } + }); + }); + + categoryLabel.on('click', function(event) { + event.preventDefault(); + + var category = $(this).text(); + filterInput.val(category).trigger('input'); + }); +}); \ No newline at end of file diff --git a/5.0.0/seq.js.html b/5.0.0/seq.js.html new file mode 100644 index 0000000000..e3b5194992 --- /dev/null +++ b/5.0.0/seq.js.html @@ -0,0 +1,111 @@ + + + + + seq.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

seq.js

+ + + + + + + +
+
+
import { curry, map, tap } from 'ramda';
+
+/* eslint-disable max-len */
+/**
+ * Runs the given list of functions in order with the supplied object, then returns the object.
+ * Also known as the normal order sequencing combinator.
+ *
+ * Acts as a transducer if a transformer is given as second parameter.
+ *
+ * @func seq
+ * @aliases sequencing
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.3.0|v2.3.0}
+ * @category Function
+ * @sig [(a -> *), (a -> *), ...] -> a -> a
+ * @param {Array} fns The list of functions to call in order with `x` whose return values will be thrown away
+ * @param {*} x
+ * @return {*} `x`
+ * @see {@link http://ramdajs.com/docs/#tap|R.tap}, {@link http://www.cs.rpi.edu/academics/courses/spring11/proglang/handouts/lambda-calculus-chapter.pdf|sequencing combinator explained}
+ * @example
+ *
+ * RA.seq([console.info, console.log])('foo'); //=> prints 'foo' via info then log
+ *
+ * // usage in composition
+ * R.pipe(
+ *   R.concat('prefix '),
+ *   RA.seq([
+ *     console.info, //=> prints 'prefix test'
+ *     console.log //=> prints 'prefix test'
+ *   ]),
+ *   R.toUpper
+ * )('test'); //=> 'PREFIX TEST'
+ */
+/* eslint-enable max-len */
+
+const seq = curry((fns, x) => tap((tx) => map((fn) => fn(tx))(fns))(x));
+
+export default seq;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 4.0.2 on Mon Apr 29 2024 15:19:37 GMT+0000 (Coordinated Universal Time) using the docdash theme. +
+ + + + + diff --git a/5.0.0/sign.js.html b/5.0.0/sign.js.html new file mode 100644 index 0000000000..eea0f59238 --- /dev/null +++ b/5.0.0/sign.js.html @@ -0,0 +1,106 @@ + + + + + sign.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

sign.js

+ + + + + + + +
+
+
import { bind, curryN } from 'ramda';
+
+import isFunction from './isFunction.js';
+import ponyfill from './internal/ponyfills/Math.sign.js';
+
+export const signPonyfill = curryN(1, ponyfill);
+
+/**
+ * Returns the sign of a number, indicating whether the number is positive, negative or zero.
+ *
+ * @func sign
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.15.0|v2.15.0}
+ * @category Math
+ * @sig Number | String -> Number
+ * @param {number} number A number
+ * @return {number} A number representing the sign of the given argument. If the argument is a positive number, negative number, positive zero or negative zero, the function will return 1, -1, 0 or -0 respectively. Otherwise, NaN is returned
+ * @example
+ *
+ * RA.sign(3); //  1
+ * RA.sign(-3); // -1
+ * RA.sign('-3'); // -1
+ * RA.sign(0); //  0
+ * RA.sign(-0); // -0
+ * RA.sign(NaN); // NaN
+ * RA.sign('foo'); // NaN
+ */
+
+const sign = isFunction(Math.sign)
+  ? curryN(1, bind(Math.sign, Math))
+  : signPonyfill;
+
+export default sign;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 4.0.2 on Mon Apr 29 2024 15:19:37 GMT+0000 (Coordinated Universal Time) using the docdash theme. +
+ + + + + diff --git a/5.0.0/skipTake.js.html b/5.0.0/skipTake.js.html new file mode 100644 index 0000000000..ec86755172 --- /dev/null +++ b/5.0.0/skipTake.js.html @@ -0,0 +1,106 @@ + + + + + skipTake.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

skipTake.js

+ + + + + + + +
+
+
import {
+  curry,
+  addIndex,
+  filter,
+  pipe,
+  modulo,
+  identical,
+  nthArg,
+  __,
+} from 'ramda';
+
+/**
+ * When given a number n and an array, returns an array containing every nth element.
+ *
+ * @func skipTake
+ * @memberOf RA
+ * @category List
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.26.0|v2.26.0}
+ * @sig Number -> [a] -> [a]
+ * @param {number} the nth element to extract
+ * @param {Array} value the input array
+ * @return {Array} An array containing every nth element
+ * @example
+ *
+ * RA.skipTake(2, [1,2,3,4]) //=> [1, 3]
+ * RA.skipTake(3, R.range(0, 20)); //=> [0, 3, 6, 9, 12, 15, 18]
+ */
+
+const skipTake = curry((n, list) =>
+  addIndex(filter)(pipe(nthArg(1), modulo(__, n), identical(0)))(list)
+);
+
+export default skipTake;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 4.0.2 on Mon Apr 29 2024 15:19:37 GMT+0000 (Coordinated Universal Time) using the docdash theme. +
+ + + + + diff --git a/5.0.0/sliceFrom.js.html b/5.0.0/sliceFrom.js.html new file mode 100644 index 0000000000..2c411b3348 --- /dev/null +++ b/5.0.0/sliceFrom.js.html @@ -0,0 +1,96 @@ + + + + + sliceFrom.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

sliceFrom.js

+ + + + + + + +
+
+
import { __, slice } from 'ramda';
+
+/**
+ * Returns the elements of the given list or string (or object with a slice method)
+ * from fromIndex (inclusive).
+ * Dispatches to the slice method of the second argument, if present.
+ *
+ * @func sliceFrom
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.16.0|v1.16.0}
+ * @category List
+ * @sig  Number -> [a] -> [a]
+ * @param {number} fromIndex The start index (inclusive)
+ * @param {Array|string} list The list or string to slice
+ * @return {Array|string} The sliced list or string
+ * @see {@link http://ramdajs.com/docs/#slice|R.slice}, {@link RA.sliceTo|sliceTo}
+ * @example
+ *
+ * RA.sliceFrom(1, [1, 2, 3]); //=> [2, 3]
+ */
+const sliceFrom = slice(__, Infinity);
+
+export default sliceFrom;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 4.0.2 on Mon Apr 29 2024 15:19:37 GMT+0000 (Coordinated Universal Time) using the docdash theme. +
+ + + + + diff --git a/5.0.0/sliceTo.js.html b/5.0.0/sliceTo.js.html new file mode 100644 index 0000000000..c8b3845e81 --- /dev/null +++ b/5.0.0/sliceTo.js.html @@ -0,0 +1,96 @@ + + + + + sliceTo.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

sliceTo.js

+ + + + + + + +
+
+
import { slice } from 'ramda';
+
+/**
+ * Returns the elements of the given list or string (or object with a slice method)
+ * to toIndex (exclusive).
+ * Dispatches to the slice method of the second argument, if present.
+ *
+ * @func sliceTo
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.16.0|v1.16.0}
+ * @category List
+ * @sig  Number -> [a] -> [a]
+ * @param {number} toIndex The end index (exclusive)
+ * @param {Array|string} list The list or string to slice
+ * @return {Array|string} The sliced list or string
+ * @see {@link http://ramdajs.com/docs/#slice|R.slice}, {@link RA.sliceFrom|sliceFrom}
+ * @example
+ *
+ * RA.sliceTo(2, [1, 2, 3]); //=> [1, 2]
+ */
+const sliceTo = slice(0);
+
+export default sliceTo;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 4.0.2 on Mon Apr 29 2024 15:19:37 GMT+0000 (Coordinated Universal Time) using the docdash theme. +
+ + + + + diff --git a/5.0.0/sortByPaths.js.html b/5.0.0/sortByPaths.js.html new file mode 100644 index 0000000000..ede1d4abf1 --- /dev/null +++ b/5.0.0/sortByPaths.js.html @@ -0,0 +1,128 @@ + + + + + sortByPaths.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

sortByPaths.js

+ + + + + + + +
+
+
import { ascend, identity, map, path, pipe, sortWith, useWith } from 'ramda';
+
+const pathToAscendSort = pipe(path, ascend);
+const mapPathsToAscendSort = map(pathToAscendSort);
+
+/**
+ * Sort a list of objects by a list of paths (if first path value is equivalent, sort by second, etc).
+ *
+ * @func sortByPaths
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/3.1.0|v3.1.0}
+ * @category List
+ * @sig [[k]] -> [{k: v}] -> [{k: v}]
+ * @param {Array.<Array.<string>>} paths A list of paths in the list param to sort by
+ * @param {Array.<object>} list A list of objects to be sorted
+ * @return {Array.<object>} A new list sorted by the paths in the paths param
+ * @example
+ *
+ * const alice = {
+ *   name: 'Alice',
+ *   address: {
+ *     street: 31,
+ *     zipCode: 97777,
+ *   },
+ * };
+ * const bob = {
+ *   name: 'Bob',
+ *   address: {
+ *     street: 31,
+ *     zipCode: 55555,
+ *   },
+ * };
+ * const clara = {
+ *   name: 'Clara',
+ *   address: {
+ *     street: 32,
+ *     zipCode: 90210,
+ *   },
+ * };
+ * const people = [clara, bob, alice]
+ *
+ * RA.sortByPaths([
+ *   ['address', 'street'],
+ *   ['address', 'zipCode'],
+ * ], people); // => [bob, alice, clara]
+ *
+ * RA.sortByPaths([
+ *   ['address', 'zipCode'],
+ *   ['address', 'street'],
+ * ], people); // => [bob, clara, alice]
+ */
+
+const sortByPaths = useWith(sortWith, [mapPathsToAscendSort, identity]);
+
+export default sortByPaths;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 4.0.2 on Mon Apr 29 2024 15:19:37 GMT+0000 (Coordinated Universal Time) using the docdash theme. +
+ + + + + diff --git a/5.0.0/sortByProp.js.html b/5.0.0/sortByProp.js.html new file mode 100644 index 0000000000..d7f24c474f --- /dev/null +++ b/5.0.0/sortByProp.js.html @@ -0,0 +1,118 @@ + + + + + sortByProp.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

sortByProp.js

+ + + + + + + +
+
+
import { __, append, identity, useWith } from 'ramda';
+
+import sortByProps from './sortByProps.js';
+
+/**
+ * Sort a list of objects by a property.
+ *
+ * @func sortByProp
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/3.4.0|v3.4.0}
+ * @category List
+ * @sig k -> [{k: v}] -> [{k: v}]
+ * @param {Array.<string>} prop The property in the list param to sort by
+ * @param {Array.<object>} list A list of objects to be sorted
+ * @return {Array.<object>} A new list sorted by the property in the prop param
+ * @example
+ *
+ * // sorting list of tuples
+ * const sortByFirstItem = sortByProp(0);
+ * const listOfTuples = [[-1, 1], [-2, 2], [-3, 3]];
+ * sortByFirstItem(listOfTuples); // => [[-3, 3], [-2, 2], [-1, 1]]
+ *
+ * // sorting list of objects
+ * const sortByName = sortByProp('name');
+ * const alice = {
+ *   name: 'ALICE',
+ *   age: 101,
+ * };
+ * const bob = {
+ *   name: 'Bob',
+ *   age: -10,
+ * };
+ * const clara = {
+ *   name: 'clara',
+ *   age: 314.159,
+ * };
+ * const people = [clara, bob, alice];
+ * sortByName(people); // => [alice, bob, clara]
+ */
+
+const addValueInAnArray = append(__, []);
+
+const sortByProp = useWith(sortByProps, [addValueInAnArray, identity]);
+
+export default sortByProp;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 4.0.2 on Mon Apr 29 2024 15:19:37 GMT+0000 (Coordinated Universal Time) using the docdash theme. +
+ + + + + diff --git a/5.0.0/sortByProps.js.html b/5.0.0/sortByProps.js.html new file mode 100644 index 0000000000..98fff26f36 --- /dev/null +++ b/5.0.0/sortByProps.js.html @@ -0,0 +1,104 @@ + + + + + sortByProps.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

sortByProps.js

+ + + + + + + +
+
+
import { comparator, curry, either, lt, map, prop, reduce, sort } from 'ramda';
+
+/**
+ * Sort a list of objects by a list of props (if first prop value is equivalent, sort by second, etc).
+ *
+ * @func sortByProps
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.26.0|v2.26.0}
+ * @category List
+ * @sig [k] -> [{k: v}] -> [{k: v}]
+ * @param {Array.<string>} props A list of properties in the list param to sort by
+ * @param {Array.<object>} list A list of objects to be sorted
+ * @return {Array.<object>} A new list sorted by the properties in the props param
+ * @example
+ *
+ * sortByProps(['num'], [{num: 3}, {num: 2}, {num: 1}])
+ * //=> [{num: 1}, {num: 2} {num: 3}]
+ * sortByProps(['letter', 'num'], [{num: 3, letter: 'a'}, {num: 2, letter: 'a'} {num: 1, letter: 'z'}])
+ * //=> [ {num: 2, letter: 'a'}, {num: 3, letter: 'a'}, {num: 1, letter: 'z'}]
+ * sortByProps(['name', 'num'], [{num: 3}, {num: 2}, {num: 1}])
+ * //=> [{num: 1}, {num: 2}, {num: 3}]
+ */
+
+const sortByProps = curry((props, list) => {
+  const firstTruthy = ([head, ...tail]) => reduce(either, head, tail);
+  const makeComparator = (propName) =>
+    comparator((a, b) => lt(prop(propName, a), prop(propName, b)));
+  return sort(firstTruthy(map(makeComparator, props)), list);
+});
+
+export default sortByProps;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 4.0.2 on Mon Apr 29 2024 15:19:37 GMT+0000 (Coordinated Universal Time) using the docdash theme. +
+ + + + + diff --git a/5.0.0/spreadPath.js.html b/5.0.0/spreadPath.js.html new file mode 100644 index 0000000000..b87d610a03 --- /dev/null +++ b/5.0.0/spreadPath.js.html @@ -0,0 +1,99 @@ + + + + + spreadPath.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

spreadPath.js

+ + + + + + + +
+
+
import { curryN, converge, mergeRight, dissocPath, pathOr } from 'ramda';
+
+/**
+ * Spreads object under property path onto provided object.
+ * It's like {@link RA.flattenPath|flattenPath}, but removes object under the property path.
+ *
+ * @func spreadPath
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.19.0|v1.19.0}
+ * @category Object
+ * @typedef Idx = String | Int
+ * @sig [Idx] -> {k: v} -> {k: v}
+ * @param {!Array.<string|number>} path The property path to spread
+ * @param {!Object} obj The provided object
+ * @return {!Object} The result of the spread
+ * @see {@link RA.spreadProp|spreadProp}, {@link RA.flattenPath|flattenPath}
+ * @example
+ *
+ * RA.spreadPath(
+ *   ['b1', 'b2'],
+ *   { a: 1, b1: { b2: { c: 3, d: 4 } } }
+ * ); // => { a: 1, c: 3, d: 4, b1: {} };
+ */
+const spreadPath = curryN(2, converge(mergeRight, [dissocPath, pathOr({})]));
+
+export default spreadPath;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 4.0.2 on Mon Apr 29 2024 15:19:37 GMT+0000 (Coordinated Universal Time) using the docdash theme. +
+ + + + + diff --git a/5.0.0/spreadProp.js.html b/5.0.0/spreadProp.js.html new file mode 100644 index 0000000000..f5dbee5efa --- /dev/null +++ b/5.0.0/spreadProp.js.html @@ -0,0 +1,98 @@ + + + + + spreadProp.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

spreadProp.js

+ + + + + + + +
+
+
import { of, curry } from 'ramda';
+
+import spreadPath from './spreadPath.js';
+
+/**
+ * Spreads object under property onto provided object.
+ * It's like {@link RA.flattenProp|flattenProp}, but removes object under the property.
+ *
+ * @func spreadProp
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.19.0|v1.19.0}
+ * @category Object
+ * @typedef Idx = String | Int
+ * @sig Idx -> {k: v} -> {k: v}
+ * @param {!string|number} prop The property to spread
+ * @param {!Object} obj The provided object
+ * @return {!Object} The result of the spread
+ * @see {@link RA.spreadPath|spreadPath}, {@link RA.flattenProp|flattenProp}
+ * @example
+ *
+ * RA.spreadProp('b', { a: 1, b: { c: 3, d: 4 } }); // => { a: 1, c: 3, d: 4 };
+ */
+const spreadProp = curry((prop, obj) => spreadPath(of(Array, prop), obj));
+
+export default spreadProp;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 4.0.2 on Mon Apr 29 2024 15:19:37 GMT+0000 (Coordinated Universal Time) using the docdash theme. +
+ + + + + diff --git a/5.0.0/stubArray.js.html b/5.0.0/stubArray.js.html new file mode 100644 index 0000000000..8679dd66db --- /dev/null +++ b/5.0.0/stubArray.js.html @@ -0,0 +1,91 @@ + + + + + stubArray.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

stubArray.js

+ + + + + + + +
+
+
/**
+ * A function that returns new empty array on every call.
+ *
+ * @func stubArray
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.1.0|v2.1.0}
+ * @category Function
+ * @sig ... -> Array
+ * @return {Array} New empty array
+ * @example
+ *
+ * RA.stubArray(); //=> []
+ * RA.stubArray(1, 2, 3); //=> []
+ */
+
+const stubArray = () => [];
+
+export default stubArray;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 4.0.2 on Mon Apr 29 2024 15:19:37 GMT+0000 (Coordinated Universal Time) using the docdash theme. +
+ + + + + diff --git a/5.0.0/stubNull.js.html b/5.0.0/stubNull.js.html new file mode 100644 index 0000000000..be34f5dc9b --- /dev/null +++ b/5.0.0/stubNull.js.html @@ -0,0 +1,92 @@ + + + + + stubNull.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

stubNull.js

+ + + + + + + +
+
+
import { always } from 'ramda';
+
+/**
+ * A function that returns `null`.
+ *
+ * @func stubNull
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.6.0|v1.6.0}
+ * @category Function
+ * @sig ... -> null
+ * @return {null}
+ * @example
+ *
+ * RA.stubNull(); //=> null
+ * RA.stubNull(1, 2, 3); //=> null
+ */
+const stubNull = always(null);
+
+export default stubNull;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 4.0.2 on Mon Apr 29 2024 15:19:37 GMT+0000 (Coordinated Universal Time) using the docdash theme. +
+ + + + + diff --git a/5.0.0/stubObj.js.html b/5.0.0/stubObj.js.html new file mode 100644 index 0000000000..f3894e997f --- /dev/null +++ b/5.0.0/stubObj.js.html @@ -0,0 +1,92 @@ + + + + + stubObj.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

stubObj.js

+ + + + + + + +
+
+
/**
+ * This function returns a new empty object.
+ *
+ * @func stubObj
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.1.0|v2.1.0}
+ * @category Function
+ * @sig ... -> Object
+ * @aliases stubObject
+ * @return {Object} Returns the new empty object.
+ * @example
+ *
+ * RA.stubObj(); //=> {}
+ * RA.stubObj(1, 2, 3); //=> {}
+ */
+
+const stubObj = () => ({});
+
+export default stubObj;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 4.0.2 on Mon Apr 29 2024 15:19:37 GMT+0000 (Coordinated Universal Time) using the docdash theme. +
+ + + + + diff --git a/5.0.0/stubString.js.html b/5.0.0/stubString.js.html new file mode 100644 index 0000000000..48af861e84 --- /dev/null +++ b/5.0.0/stubString.js.html @@ -0,0 +1,92 @@ + + + + + stubString.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

stubString.js

+ + + + + + + +
+
+
import { always } from 'ramda';
+
+/**
+ * A function that returns empty string.
+ *
+ * @func stubString
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.1.0|v2.1.0}
+ * @category Function
+ * @sig ... -> String
+ * @return {string} The empty string
+ * @example
+ *
+ * RA.stubString(); //=> ''
+ * RA.stubString(1, 2, 3); //=> ''
+ */
+const stubString = always('');
+
+export default stubString;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 4.0.2 on Mon Apr 29 2024 15:19:37 GMT+0000 (Coordinated Universal Time) using the docdash theme. +
+ + + + + diff --git a/5.0.0/stubUndefined.js.html b/5.0.0/stubUndefined.js.html new file mode 100644 index 0000000000..35eec68805 --- /dev/null +++ b/5.0.0/stubUndefined.js.html @@ -0,0 +1,92 @@ + + + + + stubUndefined.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

stubUndefined.js

+ + + + + + + +
+
+
import { always } from 'ramda';
+
+/**
+ * A function that returns `undefined`.
+ *
+ * @func stubUndefined
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.0.0|v1.0.0}
+ * @category Function
+ * @sig ... -> undefined
+ * @return {undefined}
+ * @example
+ *
+ * RA.stubUndefined(); //=> undefined
+ * RA.stubUndefined(1, 2, 3); //=> undefined
+ */
+const stubUndefined = always(void 0); // eslint-disable-line no-void
+
+export default stubUndefined;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 4.0.2 on Mon Apr 29 2024 15:19:37 GMT+0000 (Coordinated Universal Time) using the docdash theme. +
+ + + + + diff --git a/5.0.0/styles/jsdoc.css b/5.0.0/styles/jsdoc.css new file mode 100644 index 0000000000..e01258f465 --- /dev/null +++ b/5.0.0/styles/jsdoc.css @@ -0,0 +1,792 @@ +@import url(https://fonts.googleapis.com/css?family=Montserrat:400,700); + +* { + box-sizing: border-box +} + +html, body { + height: 100%; + width: 100%; +} + +body { + color: #4d4e53; + background-color: #F8F8F8; + margin: 0 auto; + padding: 0 20px 0 0; + font-family: 'Helvetica Neue', Helvetica, sans-serif; + font-size: 16px; + line-height: 160%; +} + +img { + max-width: 100%; +} + +.hidden { + visibility: hidden; +} + +a, +a:active { + color: #606; + text-decoration: none; +} + +a:hover { + text-decoration: none; +} + +article a { + border-bottom: 1px solid #ddd; +} + +article a:hover, article a:active { + border-bottom-color: #222; +} + +p, ul, ol, blockquote { + margin-bottom: 1em; +} + +h1, h2, h3, h4, h5, h6 { + font-family: 'Montserrat', sans-serif; +} + +h1, h2, h3, h4, h5, h6 { + color: #000; + font-weight: 400; + margin: 0; +} + +h1 { + font-weight: 300; + font-size: 48px; + margin: 1em 0 .5em; +} + +h1.page-title { + /*font-size: 48px;*/ + margin: 1em 30px; + display: none; +} + +h2 { + font-size: 24px; + margin: 1.5em 0 .3em; +} + +h3 { + font-size: 24px; + margin: 1.2em 0 .3em; +} + +h4 { + font-size: 18px; + margin: 1em 0 .2em; + color: #4d4e53; +} + +h4.name { + color: #fff; + background: #6d426d; + box-shadow: 0 .25em .5em #d3d3d3; + border-top: 1px solid #d3d3d3; + border-bottom: 1px solid #d3d3d3; + margin: 1.5em 0 0.5em; + padding: .75em 0 .75em 10px; +} + +h4.name a { + color: #fc83ff; +} + +h4.name a:hover { + border-bottom-color: #fc83ff; +} + +h5, .container-overview .subsection-title { + font-size: 120%; + letter-spacing: -0.01em; + margin: 8px 0 3px 0; +} + +h6 { + font-size: 100%; + letter-spacing: -0.01em; + margin: 6px 0 3px 0; + font-style: italic; +} + +tt, code, kbd, samp { + font-family: Consolas, Monaco, 'Andale Mono', monospace; + background: #f4f4f4; + padding: 1px 5px; +} + +.class-description { + font-size: 130%; + line-height: 140%; + margin-bottom: 1em; + margin-top: 1em; +} + +.class-description:empty { + margin: 0 +} + +#main { + float: right; + min-width: 360px; + width: calc(100% - 270px); +} + +header { + display: block +} + +section { + display: block; + background-color: #fff; + padding: 0 0 0 30px; + border: 1px solid #CCCCCC; + border-radius: 5px; + margin-left: 30px; + margin-top: 15px; +} + +.variation { + display: none +} + +.signature-attributes { + font-size: 60%; + color: #eee; + font-style: italic; + font-weight: lighter; +} + +nav { + float: left; + display: block; + width: 280px; + background-color: #F8F8F8; + overflow: auto; + position: fixed; + height: 100%; + border-right: 1px solid #CCCCCC; +} + +nav h3 { + font-size: 13px; + text-transform: uppercase; + letter-spacing: 1px; + font-weight: 700; + line-height: 24px; + margin: 15px 0 10px; + padding: 0 0 0 20px; + color: #000; +} + +nav ul { + font-family: 'Lucida Grande', 'Lucida Sans Unicode', arial, sans-serif; + font-size: 100%; + line-height: 17px; + padding: 0; + margin: 0; + list-style-type: none; +} + +nav ul a, +nav ul a:active { + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; + line-height: 18px; + display: block; + font-size: 14px; +} + +nav a:hover, +nav a:active { + color: #606; +} + +nav > ul { + padding: 0 0 0 20px; +} + +nav > ul > li > a { + color: #606; +} + +nav ul ul { + margin-bottom: 10px +} + +nav ul ul + ul { + margin-top: -10px; +} + +nav ul ul a { + color: hsl(207, 1%, 60%); + /*border-left: 1px solid hsl(207, 10%, 86%);*/ +} + +nav ul ul a, +nav ul ul a:active { + padding-left: 9px; +} + +nav h2 { + font-size: 12px; + margin: 0; + padding: 0; +} + +nav > h2 > a { + display: block; + margin: 10px 0 -10px; + color: #606 !important; +} + +footer { + color: hsl(0, 0%, 28%); + margin-left: 290px; + display: block; + padding: 15px; + font-style: italic; + font-size: 90%; +} + +.ancestors { + color: #999 +} + +.ancestors a { + color: #999 !important; +} + +.clear { + clear: both +} + +.important { + font-weight: bold; + color: #950B02; +} + +.yes-def { + text-indent: -1000px +} + +.type-signature { + color: #CA79CA +} + +.type-signature:last-child { + color: #eee; +} + +.name, .signature { + font-family: Consolas, Monaco, 'Andale Mono', monospace +} + +.signature { + color: #fc83ff; +} + +.details { + margin-top: 6px; + border-left: 2px solid #DDD; + line-height: 20px; + font-size: 14px; +} + +.details dt { + width: 120px; + float: left; + padding-left: 10px; +} + +.details dd { + margin-left: 70px; + margin-top: 6px; + margin-bottom: 6px; +} + +.details ul { + margin: 0 +} + +.details ul { + list-style-type: none +} + +.details pre.prettyprint { + margin: 0; +} + +.details .tag-sig { + margin: 0 +} + +.details .tag-sig li { + margin-left: 80px; +} + + +.details .object-value { + padding-top: 0 +} + +.description { + margin-bottom: 1em; + margin-top: 1em; +} + +.code-caption { + font-style: italic; + font-size: 107%; + margin: 0; +} + +.prettyprint { + font-size: 14px; + overflow: auto; + background-color: #000000; +} + +.prettyprint.source { + width: inherit; + line-height: 18px; + display: block; + background-color: #0d152a; + color: #aeaeae; +} + +.prettyprint code { + line-height: 18px; + display: block; + background-color: #0d152a; + color: #4D4E53; +} + +.prettyprint > code { + padding: 15px; +} + +.prettyprint .linenums code { + padding: 0 15px +} + +.prettyprint .linenums li:first-of-type code { + padding-top: 15px +} + +.prettyprint code span.line { + display: inline-block +} + +.prettyprint.linenums { + padding-left: 70px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.prettyprint.linenums ol { + padding-left: 0 +} + +.prettyprint.linenums li { + border-left: 3px #34446B solid; +} + +.prettyprint.linenums li.selected, .prettyprint.linenums li.selected * { + background-color: #34446B; +} + +.prettyprint.linenums li * { + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; +} + +.params, .props { + border-spacing: 0; + border: 1px solid #ddd; + border-collapse: collapse; + border-radius: 3px; + box-shadow: 0 1px 3px rgba(0,0,0,0.1); + width: 100%; + font-size: 14px; + margin: 1em 0; +} + +.params .type { + white-space: normal; +} + +.params code { + white-space: pre; +} + +.params td, .params .name, .props .name, .name code { + color: #4D4E53; + font-family: Consolas, Monaco, 'Andale Mono', monospace; + font-size: 100%; +} + +.params td, .params th, .props td, .props th { + margin: 0; + text-align: left; + vertical-align: top; + padding: 10px; + display: table-cell; +} + +.params td { + border-top: 1px solid #eee +} + +.params thead tr, .props thead tr { + background-color: #fff; + font-weight: bold; +} + +.params .params thead tr, .props .props thead tr { + background-color: #fff; + font-weight: bold; +} + +.params td.description > p:first-child, .props td.description > p:first-child { + margin-top: 0; + padding-top: 0; +} + +.params td.description > p:last-child, .props td.description > p:last-child { + margin-bottom: 0; + padding-bottom: 0; +} + +span.param-type, .params td .param-type, .param-type dd { + color: #606; + font-family: Consolas, Monaco, 'Andale Mono', monospace +} + +.param-type dt, .param-type dd { + display: inline-block +} + +.param-type { + margin: 14px 0; +} + +.disabled { + color: #454545 +} + +/* navicon button */ +.navicon-button { + display: none; + position: relative; + padding: 2.0625rem 1.5rem; + transition: 0.25s; + cursor: pointer; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + opacity: .8; +} +.navicon-button .navicon:before, .navicon-button .navicon:after { + transition: 0.25s; +} +.navicon-button:hover { + transition: 0.5s; + opacity: 1; +} +.navicon-button:hover .navicon:before, .navicon-button:hover .navicon:after { + transition: 0.25s; +} +.navicon-button:hover .navicon:before { + top: .825rem; +} +.navicon-button:hover .navicon:after { + top: -.825rem; +} + +/* navicon */ +.navicon { + position: relative; + width: 2.5em; + height: .3125rem; + background: #000; + transition: 0.3s; + border-radius: 2.5rem; +} +.navicon:before, .navicon:after { + display: block; + content: ""; + height: .3125rem; + width: 2.5rem; + background: #000; + position: absolute; + z-index: -1; + transition: 0.3s 0.25s; + border-radius: 1rem; +} +.navicon:before { + top: .625rem; +} +.navicon:after { + top: -.625rem; +} + +/* open */ +.nav-trigger:checked + label:not(.steps) .navicon:before, +.nav-trigger:checked + label:not(.steps) .navicon:after { + top: 0 !important; +} + +.nav-trigger:checked + label .navicon:before, +.nav-trigger:checked + label .navicon:after { + transition: 0.5s; +} + +/* Minus */ +.nav-trigger:checked + label { + -webkit-transform: scale(0.75); + transform: scale(0.75); +} + +/* × and + */ +.nav-trigger:checked + label.plus .navicon, +.nav-trigger:checked + label.x .navicon { + background: transparent; +} + +.nav-trigger:checked + label.plus .navicon:before, +.nav-trigger:checked + label.x .navicon:before { + -webkit-transform: rotate(-45deg); + transform: rotate(-45deg); + background: #FFF; +} + +.nav-trigger:checked + label.plus .navicon:after, +.nav-trigger:checked + label.x .navicon:after { + -webkit-transform: rotate(45deg); + transform: rotate(45deg); + background: #FFF; +} + +.nav-trigger:checked + label.plus { + -webkit-transform: scale(0.75) rotate(45deg); + transform: scale(0.75) rotate(45deg); +} + +.label { + display: inline; + padding: .2em .6em .3em; + font-size: 75%; + font-weight: 700; + line-height: 1; + color: #fff; + text-align: center; + white-space: nowrap; + vertical-align: baseline; + border-radius: .25em; +} + +.label-category { + background: #e1d0e6; + color: #849; + float: right; +} + +.nav-trigger:checked ~ nav { + left: 0 !important; +} + +.nav-trigger:checked ~ .overlay { + display: block; +} + +.nav-trigger { + position: fixed; + top: 0; + clip: rect(0, 0, 0, 0); +} + +.overlay { + display: none; + position: fixed; + top: 0; + bottom: 0; + left: 0; + right: 0; + width: 100%; + height: 100%; + background: hsla(0, 0%, 0%, 0.5); + z-index: 1; +} + +@media only screen and (min-width: 320px) and (max-width: 680px) { + body { + overflow-x: hidden; + } + + nav { + background: #FFF; + width: 250px; + height: 100%; + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: -250px; + z-index: 3; + padding: 0 10px; + transition: left 0.2s; + } + + .navicon-button { + display: inline-block; + position: fixed; + top: 1.5em; + right: 0; + z-index: 2; + } + + #main { + width: 100%; + min-width: 360px; + } + + #main h1.page-title { + margin: 1em 0; + } + + #main section { + padding: 0; + } + + footer { + margin-left: 0; + } +} + +/** Add a '#' to static members */ +[data-type="member"] a::before { + content: '#'; + display: inline-block; + margin-left: -14px; + margin-right: 5px; +} + +[data-type="method"] { + padding-right: 4px; +} +[data-type="method"]:hover { + background-color: #e4e4e4 !important; +} +[data-type="method"] a { + padding-top: 7px; + padding-bottom: 7px; + color: #ad6cbe; + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; +} + +/** Custom extensions **/ +body > header { + position: fixed; + top: 0; + left: 0; + right: 0; + display: block; + min-height: 50px; + margin-bottom: 20px; +} + +body > header { + color: #fff; + background-color: #849; + box-shadow: 0 .25em .5em #d3d3d3; + border-bottom: 1px solid #d3d3d3; + margin: 0; + padding: .75em 10px .75em 40px; + z-index: 1000; +} + +body > header a { + color: #e1d0e6; +} + +body > header > ul { + float: right; + margin: 0; +} + +body > header > ul li { + position: relative; + float: left; + display: block; +} + +body > header > ul li a { + padding: 10px 15px; + font-size: 14px; +} +body > header > ul li a:hover { + color: #fff; +} + +body > nav { + top: 100px; + padding-bottom: 10px; + height: calc(100% - 100px); +} + +#main { + margin-top: 50px; +} + +#filter { + position: fixed; + top: 50px; + left: 0; + width: 280px; + height: 50px; + background-color: #F4F4F4; + border-bottom: 1px solid #CCCCCC; + border-right: 1px solid #CCCCCC; +} + +#filter input { + width: 240px; + height: 30px; + line-height: 30px; + margin-left: 20px; + margin-top: 10px; + border: 1px solid #ccc; + font-size: 15px; + border-radius: 4px; + padding-left: 10px; +} + +#filter input:focus { + outline: none !important; + border-color: #884499; + box-shadow: 0 0 3px #884499; +} + +#filter input::placeholder { + color: #CCCCCC; +} + +.section-id { + height: 0; + position: relative; + top: -50px; +} \ No newline at end of file diff --git a/5.0.0/styles/prettify.css b/5.0.0/styles/prettify.css new file mode 100644 index 0000000000..d9521ec85e --- /dev/null +++ b/5.0.0/styles/prettify.css @@ -0,0 +1,79 @@ +.pln { + color: #ddd; +} + +/* string content */ +.str { + color: #61ce3c; +} + +/* a keyword */ +.kwd { + color: #fbde2d; +} + +/* a comment */ +.com { + color: #aeaeae; +} + +/* a type name */ +.typ { + color: #8da6ce; +} + +/* a literal value */ +.lit { + color: #fbde2d; +} + +/* punctuation */ +.pun { + color: #ddd; +} + +/* lisp open bracket */ +.opn { + color: #000000; +} + +/* lisp close bracket */ +.clo { + color: #000000; +} + +/* a markup tag name */ +.tag { + color: #8da6ce; +} + +/* a markup attribute name */ +.atn { + color: #fbde2d; +} + +/* a markup attribute value */ +.atv { + color: #ddd; +} + +/* a declaration */ +.dec { + color: #EF5050; +} + +/* a variable name */ +.var { + color: #c82829; +} + +/* a function name */ +.fun { + color: #4271ae; +} + +/* Specify class=linenums on a pre to get line numbering */ +ol.linenums { + margin-top: 0; + margin-bottom: 0; +} diff --git a/5.0.0/subtractNum.js.html b/5.0.0/subtractNum.js.html new file mode 100644 index 0000000000..89c035e9e4 --- /dev/null +++ b/5.0.0/subtractNum.js.html @@ -0,0 +1,93 @@ + + + + + subtractNum.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

subtractNum.js

+ + + + + + + +
+
+
import { flip, subtract } from 'ramda';
+
+/**
+ * Subtracts its first argument from its second argument.
+ *
+ * @func subtractNum
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.22.0|v2.22.0}
+ * @category Math
+ * @sig Number -> Number -> Number
+ * @param {number} subtrahend the number to subtract
+ * @param {number} minuend the number to subtract from
+ * @return {number} A number representing the difference of subtracting the subtrahend from the minuend
+ * @example
+ *
+ * RA.subtractNum(3, 5); //=> 2
+ */
+const subtractNum = flip(subtract);
+
+export default subtractNum;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 4.0.2 on Mon Apr 29 2024 15:19:37 GMT+0000 (Coordinated Universal Time) using the docdash theme. +
+ + + + + diff --git a/5.0.0/thenCatchP.js.html b/5.0.0/thenCatchP.js.html new file mode 100644 index 0000000000..24c4d93f52 --- /dev/null +++ b/5.0.0/thenCatchP.js.html @@ -0,0 +1,100 @@ + + + + + thenCatchP.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

thenCatchP.js

+ + + + + + + +
+
+
import { invoker } from 'ramda';
+
+/**
+ * Composable shortcut for `Promise.then` that allows for success and failure callbacks.
+ * The thenCatchP function returns a Promise. It takes three arguments: a callback function for the success of the Promise,
+ * a callback function for the failure of the Promise, and the promise instance itself.
+ *
+ * @func thenCatchP
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.27.0|v2.27.0}
+ * @category Function
+ * @sig (a -> b) -> (c -> d) -> Promise a -> Promise b | d
+ * @param {Function} onFulfilled A Function called if the Promise is fulfilled. This function has one argument, the fulfillment value
+ * @param {Function} onRejected A Function called if the Promise is rejected. This function has one argument, the error
+ * @param {Promise} promise Any Promise or Thenable object
+ * @return {Promise}
+ * @see {@link RA.resolveP|resolveP}, {@link RA.rejectP|rejectP}, {@link RA.allP|allP}
+ * @example
+ *
+ * const promise = Promise.resolve(1);
+ * const add1 = x => x + 1;
+ *
+ * RA.thenCatchP(add1, console.error, promise); // => Promise(2)
+ */
+export const thenCatchP = invoker(2, 'then');
+
+export default thenCatchP;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 4.0.2 on Mon Apr 29 2024 15:19:37 GMT+0000 (Coordinated Universal Time) using the docdash theme. +
+ + + + + diff --git a/5.0.0/toArray.js.html b/5.0.0/toArray.js.html new file mode 100644 index 0000000000..84dc28a08d --- /dev/null +++ b/5.0.0/toArray.js.html @@ -0,0 +1,105 @@ + + + + + toArray.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

toArray.js

+ + + + + + + +
+
+
import { ifElse, values, curryN } from 'ramda';
+
+import isIterable from './isIterable.js';
+import isFunction from './isFunction.js';
+import ponyfill from './internal/ponyfills/Array.from.js';
+
+export const fromPonyfill = curryN(1, ponyfill);
+
+const fromArray = isFunction(Array.from) ? curryN(1, Array.from) : fromPonyfill;
+
+/**
+ * Converts value to an array.
+ *
+ * @func toArray
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.22.0|v2.22.0}
+ * @category List
+ * @sig * -> [a]
+ * @param {*} val The value to convert
+ * @return {Array}
+ * @example
+ *
+ * RA.toArray([1, 2]); //=> [1, 2]
+ * RA.toArray({'foo': 1, 'bar': 2}); //=> [1, 2]
+ * RA.toArray('abc'); //=> ['a', 'b', 'c']
+ * RA.toArray(1); //=> []
+ * RA.toArray(null); //=> []
+ */
+
+const toArray = ifElse(isIterable, fromArray, values);
+
+export default toArray;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 4.0.2 on Mon Apr 29 2024 15:19:37 GMT+0000 (Coordinated Universal Time) using the docdash theme. +
+ + + + + diff --git a/5.0.0/toInteger32.js.html b/5.0.0/toInteger32.js.html new file mode 100644 index 0000000000..f3200862eb --- /dev/null +++ b/5.0.0/toInteger32.js.html @@ -0,0 +1,95 @@ + + + + + toInteger32.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

toInteger32.js

+ + + + + + + +
+
+
import { curryN } from 'ramda';
+/**
+ * Converts double-precision 64-bit binary format IEEE 754 to signed 32 bit integer number.
+ *
+ * @func toInteger32
+ * @aliases toInt32
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.28.0|v2.28.0}
+ * @category Math
+ * @sig Number -> Number
+ * @param {number} number A number
+ * @return {number} A signed 32-bit integer number
+ * @see {@link RA.toUInteger32|toUInteger32}, {@link http://speakingjs.com/es5/ch11.html#integers_via_bitwise_operators}
+ * @example
+ *
+ * RA.toInteger32(2 ** 35); // => 0
+ * RA.toInteger32(2 ** 30); // => 1073741824
+ */
+// eslint-disable-next-line no-bitwise
+const toInteger32 = curryN(1, (val) => val >> 0);
+
+export default toInteger32;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 4.0.2 on Mon Apr 29 2024 15:19:37 GMT+0000 (Coordinated Universal Time) using the docdash theme. +
+ + + + + diff --git a/5.0.0/toNumber.js.html b/5.0.0/toNumber.js.html new file mode 100644 index 0000000000..d8c07c8dce --- /dev/null +++ b/5.0.0/toNumber.js.html @@ -0,0 +1,97 @@ + + + + + toNumber.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

toNumber.js

+ + + + + + + +
+
+
import { ifElse, always } from 'ramda';
+
+import isCoercible from './internal/isCoercible.js';
+
+/**
+ * Converts value to a number.
+ *
+ * @func toNumber
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.36.0|v2.36.0}
+ * @category Type
+ * @param {*} val The value to convert
+ * @return {Number}
+ * @example
+ *
+ * RA.toNumber(3.2); //=> 3.2
+ * RA.toNumber(Number.MIN_VALUE); //=> 5e-324
+ * RA.toNumber(Infinity); //=> Infinity
+ * RA.toNumber('3.2'); //=> 3.2
+ * RA.toNumber(Symbol('3.2')); //=> NaN
+ */
+const toNumber = ifElse(isCoercible, Number, always(NaN));
+
+export default toNumber;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 4.0.2 on Mon Apr 29 2024 15:19:37 GMT+0000 (Coordinated Universal Time) using the docdash theme. +
+ + + + + diff --git a/5.0.0/toUinteger32.js.html b/5.0.0/toUinteger32.js.html new file mode 100644 index 0000000000..8a1bcfc52e --- /dev/null +++ b/5.0.0/toUinteger32.js.html @@ -0,0 +1,99 @@ + + + + + toUinteger32.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

toUinteger32.js

+ + + + + + + +
+
+
import { curryN } from 'ramda';
+
+/**
+ * Converts double-precision 64-bit binary format IEEE 754 to unsigned 32 bit integer number.
+ *
+ * @func toUinteger32
+ * @aliases toUint32
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.28.0|v2.28.0}
+ * @category Math
+ * @sig Number -> Number
+ * @param {number} val Value to be converted.
+ * @return {number}
+ * @see {@link RA.toInteger32|toInteger32}, {@link http://speakingjs.com/es5/ch11.html#integers_via_bitwise_operators}
+ * @example
+ *
+ * RA.toUinteger32(1.5); //=> 1
+ * RA.toInteger32(2 ** 35); // => 0
+ * RA.toInteger32(2 ** 31); // => 2147483648
+ * RA.toInteger32(2 ** 30); // => 1073741824
+ */
+
+// eslint-disable-next-line no-bitwise
+const toUinteger32 = curryN(1, (val) => val >>> 0);
+
+export default toUinteger32;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 4.0.2 on Mon Apr 29 2024 15:19:37 GMT+0000 (Coordinated Universal Time) using the docdash theme. +
+ + + + + diff --git a/5.0.0/trimCharsEnd.js.html b/5.0.0/trimCharsEnd.js.html new file mode 100644 index 0000000000..0a12e2a288 --- /dev/null +++ b/5.0.0/trimCharsEnd.js.html @@ -0,0 +1,98 @@ + + + + + trimCharsEnd.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

trimCharsEnd.js

+ + + + + + + +
+
+
import { curry, dropLastWhile, join, pipe, split } from 'ramda';
+
+import included from './included.js';
+
+/**
+ * Removes specified characters from the end of a string.
+ *
+ * @func trimCharsEnd
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.25.0|v2.25.0}
+ * @category String
+ * @sig String -> String
+ * @param {string} chars The characters to trim
+ * @param {string} value The string to trim
+ * @return {string} Returns the trimmed string.
+ * @example
+ *
+ * RA.trimCharsEnd('_-', '-_-abc-_-'); //=> '-_-abc'
+ */
+
+const trimCharsEnd = curry((chars, value) =>
+  pipe(split(''), dropLastWhile(included(chars)), join(''))(value)
+);
+
+export default trimCharsEnd;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 4.0.2 on Mon Apr 29 2024 15:19:37 GMT+0000 (Coordinated Universal Time) using the docdash theme. +
+ + + + + diff --git a/5.0.0/trimCharsStart.js.html b/5.0.0/trimCharsStart.js.html new file mode 100644 index 0000000000..ff284a0127 --- /dev/null +++ b/5.0.0/trimCharsStart.js.html @@ -0,0 +1,98 @@ + + + + + trimCharsStart.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

trimCharsStart.js

+ + + + + + + +
+
+
import { curry, dropWhile, join, pipe, split } from 'ramda';
+
+import included from './included.js';
+
+/**
+ * Removes specified characters from the beginning of a string.
+ *
+ * @func trimCharsStart
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.24.0|v2.24.0}
+ * @category String
+ * @sig String -> String
+ * @param {string} chars The characters to trim
+ * @param {string} value The string to trim
+ * @return {string} Returns the trimmed string.
+ * @example
+ *
+ * RA.trimCharsStart('_-', '-_-abc-_-'); //=> 'abc-_-'
+ */
+
+const trimCharsStart = curry((chars, value) =>
+  pipe(split(''), dropWhile(included(chars)), join(''))(value)
+);
+
+export default trimCharsStart;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 4.0.2 on Mon Apr 29 2024 15:19:37 GMT+0000 (Coordinated Universal Time) using the docdash theme. +
+ + + + + diff --git a/5.0.0/trimEnd.js.html b/5.0.0/trimEnd.js.html new file mode 100644 index 0000000000..57cefc680c --- /dev/null +++ b/5.0.0/trimEnd.js.html @@ -0,0 +1,103 @@ + + + + + trimEnd.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

trimEnd.js

+ + + + + + + +
+
+
import { invoker } from 'ramda';
+
+import ponyfill from './internal/ponyfills/String.trimEnd.js';
+import isFunction from './isFunction.js';
+
+export const trimEndPonyfill = ponyfill;
+
+export const trimEndInvoker = invoker(0, 'trimEnd');
+
+/**
+ * Removes whitespace from the end of a string.
+ *
+ * @func trimEnd
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.22.0|v2.22.0}
+ * @category String
+ * @sig String -> String
+ * @param {string} value String value to have the whitespace removed from the end
+ * @return {string} A new string representing the calling string stripped of whitespace from its end (right end).
+ * @see {@link RA.trimEnd|trimEnd}
+ * @example
+ *
+ * RA.trimEnd('abc   '); //=> 'abc'
+ */
+
+const trimEnd = isFunction(String.prototype.trimEnd)
+  ? trimEndInvoker
+  : trimEndPonyfill;
+
+export default trimEnd;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 4.0.2 on Mon Apr 29 2024 15:19:37 GMT+0000 (Coordinated Universal Time) using the docdash theme. +
+ + + + + diff --git a/5.0.0/trimStart.js.html b/5.0.0/trimStart.js.html new file mode 100644 index 0000000000..54e7b0ce46 --- /dev/null +++ b/5.0.0/trimStart.js.html @@ -0,0 +1,102 @@ + + + + + trimStart.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

trimStart.js

+ + + + + + + +
+
+
import { invoker } from 'ramda';
+
+import ponyfill from './internal/ponyfills/String.trimStart.js';
+import isFunction from './isFunction.js';
+
+export const trimStartPonyfill = ponyfill;
+
+export const trimStartInvoker = invoker(0, 'trimStart');
+
+/**
+ * Removes whitespace from the beginning of a string.
+ *
+ * @func trimStart
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.22.0|v2.22.0}
+ * @category String
+ * @sig String -> String
+ * @param {string} value String value to have the whitespace removed from the beginning
+ * @return {string} A new string representing the calling string stripped of whitespace from its beginning (left end).
+ * @example
+ *
+ * RA.trimStart('  abc'); //=> 'abc'
+ */
+
+const trimStart = isFunction(String.prototype.trimStart)
+  ? trimStartInvoker
+  : trimStartPonyfill;
+
+export default trimStart;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 4.0.2 on Mon Apr 29 2024 15:19:37 GMT+0000 (Coordinated Universal Time) using the docdash theme. +
+ + + + + diff --git a/5.0.0/trunc.js.html b/5.0.0/trunc.js.html new file mode 100644 index 0000000000..0d31b31021 --- /dev/null +++ b/5.0.0/trunc.js.html @@ -0,0 +1,106 @@ + + + + + trunc.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

trunc.js

+ + + + + + + +
+
+
import { bind, curryN } from 'ramda';
+
+import ponyfill from './internal/ponyfills/Math.trunc.js';
+import isFunction from './isFunction.js';
+
+export const truncPonyfill = curryN(1, ponyfill);
+
+/**
+ * Returns the integer part of a number by removing any fractional digits.
+ *
+ * @func trunc
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.15.0|v2.15.0}
+ * @category Math
+ * @sig Number | String -> Number
+ * @param {number|string} number The number to trunc
+ * @return {number} The integer part of the given number
+ * @example
+ *
+ * RA.trunc(13.37); //=> 13
+ * RA.trunc(42.84); //=> 42
+ * RA.trunc(0.123); //=>  0
+ * RA.trunc(-0.123); //=> -0
+ * RA.trunc('-1.123'); //=> -1
+ * RA.trunc(NaN); //=> NaN
+ * RA.trunc('foo'); //=> NaN
+ */
+
+const trunc = isFunction(Math.trunc)
+  ? curryN(1, bind(Math.trunc, Math))
+  : truncPonyfill;
+
+export default trunc;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 4.0.2 on Mon Apr 29 2024 15:19:37 GMT+0000 (Coordinated Universal Time) using the docdash theme. +
+ + + + + diff --git a/5.0.0/unzipObjWith.js.html b/5.0.0/unzipObjWith.js.html new file mode 100644 index 0000000000..93d8746dcb --- /dev/null +++ b/5.0.0/unzipObjWith.js.html @@ -0,0 +1,113 @@ + + + + + unzipObjWith.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

unzipObjWith.js

+ + + + + + + +
+
+
import {
+  apply,
+  curryN,
+  flip,
+  map,
+  pipe,
+  toPairs,
+  transpose,
+  when,
+} from 'ramda';
+
+import lengthEq from './lengthEq.js';
+
+/**
+ * Creates a new list out of the supplied object by applying the function to each key/value pairing.
+ *
+ * @func unzipObjWith
+ * @memberOf RA
+ * @category Object
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.22.0|v2.22.0}
+ * @sig  (v, k) => [k, v] -> { k: v } -> [[k], [v]]
+ * @param {Function} fn The function to transform each value-key pair
+ * @param {Object} obj Object to unzip
+ * @return {Array} A pair of tw lists: a list of keys and a list of values
+ * @see {@link https://ramdajs.com/docs/#zipObj|zipObj}, {@link RA.zipObjWith|zipObjWith}
+ * @example
+ *
+ * RA.unzipObjWith((v, k) => [`new${k.toUpperCase()}`, 2 * v], { a: 1, b: 2, c: 3 });
+ * //=> [['newA', 'newB', 'newC'], [2, 4, 6]]
+ */
+const unzipObjWith = curryN(2, (fn, obj) =>
+  pipe(
+    toPairs,
+    map(pipe(flip, apply)(fn)),
+    transpose,
+    when(lengthEq(0), () => [[], []])
+  )(obj)
+);
+
+export default unzipObjWith;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 4.0.2 on Mon Apr 29 2024 15:19:37 GMT+0000 (Coordinated Universal Time) using the docdash theme. +
+ + + + + diff --git a/5.0.0/viewOr.js.html b/5.0.0/viewOr.js.html new file mode 100644 index 0000000000..f5fe8d81f3 --- /dev/null +++ b/5.0.0/viewOr.js.html @@ -0,0 +1,105 @@ + + + + + viewOr.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

viewOr.js

+ + + + + + + +
+
+
import { view, defaultTo, curryN } from 'ramda';
+
+/**
+ * Returns a "view" of the given data structure, determined by the given lens.
+ * The lens's focus determines which portion of the data structure is visible.
+ * Returns the defaultValue if "view" is null, undefined or NaN; otherwise the "view" is returned.
+ *
+ * @func viewOr
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.13.0|1.13.0}
+ * @category Object
+ * @typedef Lens s b = Functor f => (b -> f b) -> s -> f s
+ * @sig a -> Lens s b -> s -> b | a
+ * @see {@link http://ramdajs.com/docs/#view|R.view}
+ * @param {*} defaultValue The default value
+ * @param {Function} lens Van Laarhoven lens
+ * @param {*} data The data structure
+ * @returns {*} "view" or defaultValue
+ *
+ * @example
+ *
+ * RA.viewOr('N/A', R.lensProp('x'), {}); // => 'N/A'
+ * RA.viewOr('N/A', R.lensProp('x'), { x: 1 }); // => 1
+ * RA.viewOr('some', R.lensProp('y'), { y: null }); // => 'some'
+ * RA.viewOr('some', R.lensProp('y'), { y: false }); // => false
+ */
+
+const viewOr = curryN(3, (defaultValue, lens, data) =>
+  defaultTo(defaultValue, view(lens, data))
+);
+
+export default viewOr;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 4.0.2 on Mon Apr 29 2024 15:19:37 GMT+0000 (Coordinated Universal Time) using the docdash theme. +
+ + + + + diff --git a/5.0.0/weave.js.html b/5.0.0/weave.js.html new file mode 100644 index 0000000000..b2af5ec7a7 --- /dev/null +++ b/5.0.0/weave.js.html @@ -0,0 +1,108 @@ + + + + + weave.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

weave.js

+ + + + + + + +
+
+
import { curryN } from 'ramda';
+
+/**
+ * Weaves a configuration into function returning the runnable monad like `Reader` or `Free`.
+ * This allows us to pre-bind the configuration in advance and use the weaved function
+ * without need to explicitly pass the configuration on every call.
+ *
+ * @func weave
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.7.0|v1.7.0}
+ * @category Function
+ * @sig (*... -> *) -> * -> (*... -> *)
+ * @param {Function} fn The function to weave
+ * @param {*} config The configuration to weave into fn
+ * @return {Function} Auto-curried weaved function
+ * @example
+ *
+ * const { Reader: reader } = require('monet');
+ *
+ * const log = value => reader(
+ *   config => config.log(value)
+ * );
+ *
+ * // no weaving
+ * log('test').run(console); //=> prints 'test'
+ *
+ * // weaving
+ * const wlog = RA.weave(log, console);
+ * wlog('test'); //=> prints 'test'
+ */
+const weave = curryN(2, (fn, config) =>
+  curryN(fn.length, (...args) => fn(...args).run(config))
+);
+
+export default weave;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 4.0.2 on Mon Apr 29 2024 15:19:37 GMT+0000 (Coordinated Universal Time) using the docdash theme. +
+ + + + + diff --git a/5.0.0/weaveLazy.js.html b/5.0.0/weaveLazy.js.html new file mode 100644 index 0000000000..37f7983a14 --- /dev/null +++ b/5.0.0/weaveLazy.js.html @@ -0,0 +1,110 @@ + + + + + weaveLazy.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

weaveLazy.js

+ + + + + + + +
+
+
import { curryN } from 'ramda';
+
+/**
+ * Weaves a configuration into function returning the runnable monad like `Reader` or `Free`.
+ * This allows us to pre-bind the configuration in advance and use the weaved function
+ * without need to explicitly pass the configuration on every call.
+ *
+ * @func weaveLazy
+ * @memberOf RA
+ * @since {@link https://char0n.github.io/ramda-adjunct/1.10.0|v1.10.0}
+ * @category Function
+ * @sig (*... -> *) -> (* -> *) -> (*... -> *)
+ * @param {Function} fn The function to weave
+ * @param {Function} configAccessor The function that returns the configuration object
+ * @return {Function} Auto-curried weaved function
+ * @example
+ *
+ * const { Reader: reader } = require('monet');
+ *
+ * const log = value => reader(
+ *   config => config.log(value)
+ * );
+ *
+ * const consoleAccessor = R.always(console);
+ *
+ * // no weaving
+ * log('test').run(console); //=> prints 'test'
+ *
+ * // weaving
+ * const wlog = RA.weaveLazy(log, consoleAccessor);
+ * wlog('test'); //=> prints 'test'
+ */
+const weaveLazy = curryN(2, (fn, configAccessor) =>
+  curryN(fn.length, (...args) => fn(...args).run(configAccessor()))
+);
+
+export default weaveLazy;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 4.0.2 on Mon Apr 29 2024 15:19:37 GMT+0000 (Coordinated Universal Time) using the docdash theme. +
+ + + + + diff --git a/5.0.0/zipObjWith.js.html b/5.0.0/zipObjWith.js.html new file mode 100644 index 0000000000..7b47d076d8 --- /dev/null +++ b/5.0.0/zipObjWith.js.html @@ -0,0 +1,100 @@ + + + + + zipObjWith.js - Documentation + + + + + + + + + + + + + + + + + + +
+ Ramda Adjunct 5.0.0 +
+ + + +
+ +

zipObjWith.js

+ + + + + + + +
+
+
import { apply, curryN, fromPairs, map, pipe, zip } from 'ramda';
+
+/**
+ * Creates a new object out of a list of keys and a list of values by applying the function
+ * to each equally-positioned pair in the lists.
+ * Key/value pairing is truncated to the length of the shorter of the two lists.
+ *
+ * @func zipObjWith
+ * @memberOf RA
+ * @category Object
+ * @since {@link https://char0n.github.io/ramda-adjunct/2.22.0|v2.22.0}
+ * @sig (b, a) -> [k, v] -> [a] -> [b] -> { k: v }
+ * @param {Function} fn The function to transform each value-key pair
+ * @param {Array} keys Array to transform into the properties on the output object
+ * @param {Array} values Array to transform into the values on the output object
+ * @return {Object}  The object made by pairing up and transforming same-indexed elements of `keys` and `values`.
+ * @see {@link https://ramdajs.com/docs/#zipObj|zipObj}, {@link RA.unzipObjWith|unzipObjWith}
+ * @example
+ *
+ * RA.zipObjWith((value, key) => [key, `${key}${value + 1}`]), ['a', 'b', 'c'], [1, 2, 3]);
+ *  // => { a: 'a2', b: 'b3', c: 'c4' }
+ */
+const zipObjWith = curryN(3, (fn, keys, values) =>
+  pipe(zip, map(apply(fn)), fromPairs)(values, keys)
+);
+
+export default zipObjWith;
+
+
+
+ + + + +
+ +
+ +
+ Documentation generated by JSDoc 4.0.2 on Mon Apr 29 2024 15:19:37 GMT+0000 (Coordinated Universal Time) using the docdash theme. +
+ + + + +