ramda-adjunct 2.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.nvmrc +1 -0
- package/CHANGELOG.md +973 -0
- package/LICENSE.md +25 -0
- package/README.md +297 -0
- package/SECURITY.md +43 -0
- package/dist/RA.node.js +11172 -0
- package/dist/RA.node.min.js +2 -0
- package/dist/RA.node.min.js.LICENSE.txt +22 -0
- package/dist/RA.web.js +11172 -0
- package/dist/RA.web.min.js +2 -0
- package/dist/RA.web.min.js.LICENSE.txt +22 -0
- package/dist/RA.web.standalone.js +27797 -0
- package/dist/RA.web.standalone.min.js +2 -0
- package/dist/RA.web.standalone.min.js.LICENSE.txt +22 -0
- package/es/Y.js +38 -0
- package/es/allEqual.js +25 -0
- package/es/allEqualTo.js +26 -0
- package/es/allIdentical.js +24 -0
- package/es/allIdenticalTo.js +26 -0
- package/es/allP.js +26 -0
- package/es/allSettledP.js +29 -0
- package/es/allUnique.js +23 -0
- package/es/anyP.js +28 -0
- package/es/appendFlipped.js +23 -0
- package/es/argsPass.js +38 -0
- package/es/async.js +57 -0
- package/es/cata.js +101 -0
- package/es/catchP.js +24 -0
- package/es/ceil.js +26 -0
- package/es/compact.js +21 -0
- package/es/concatAll.js +30 -0
- package/es/concatRight.js +29 -0
- package/es/contained.js +29 -0
- package/es/curryRight.js +24 -0
- package/es/curryRightN.js +32 -0
- package/es/defaultWhen.js +25 -0
- package/es/delayP.js +44 -0
- package/es/dispatch.js +75 -0
- package/es/divideNum.js +19 -0
- package/es/dropArgs.js +22 -0
- package/es/ensureArray.js +22 -0
- package/es/escapeRegExp.js +20 -0
- package/es/fantasy-land/Identity.js +309 -0
- package/es/fantasy-land/mapping.js +20 -0
- package/es/fantasy-land/traits.js +41 -0
- package/es/fantasy-land/util.js +11 -0
- package/es/filterIndexed.js +27 -0
- package/es/findOr.js +28 -0
- package/es/flattenDepth.js +50 -0
- package/es/flattenPath.js +27 -0
- package/es/flattenProp.js +28 -0
- package/es/floor.js +25 -0
- package/es/fnull.js +37 -0
- package/es/hasPath.js +38 -0
- package/es/inRange.js +29 -0
- package/es/index.js +252 -0
- package/es/internal/ap.js +20 -0
- package/es/internal/compareLength.js +5 -0
- package/es/internal/isOfTypeObject.js +7 -0
- package/es/internal/makeFlat.js +46 -0
- package/es/internal/ponyfills/Array.from.js +40 -0
- package/es/internal/ponyfills/Math.sign.js +5 -0
- package/es/internal/ponyfills/Math.trunc.js +14 -0
- package/es/internal/ponyfills/Number.MAX_SAFE_INTEGER.js +2 -0
- package/es/internal/ponyfills/Number.MIN_SAFE_INTEGER.js +2 -0
- package/es/internal/ponyfills/Number.isFinite.js +5 -0
- package/es/internal/ponyfills/Number.isInteger.js +4 -0
- package/es/internal/ponyfills/Number.isNaN.js +5 -0
- package/es/internal/ponyfills/Number.isSafeInteger.js +7 -0
- package/es/internal/ponyfills/Promise.allSettled.js +38 -0
- package/es/internal/ponyfills/Promise.any.js +77 -0
- package/es/internal/ponyfills/String.padEnd.js +24 -0
- package/es/internal/ponyfills/String.padStart.js +26 -0
- package/es/internal/ponyfills/String.repeat.js +46 -0
- package/es/internal/ponyfills/String.replaceAll.js +34 -0
- package/es/internal/ponyfills/String.trimEnd.js +3 -0
- package/es/internal/ponyfills/String.trimStart.js +3 -0
- package/es/invoke.js +20 -0
- package/es/invokeArgs.js +30 -0
- package/es/isArray.js +22 -0
- package/es/isArrayLike.js +87 -0
- package/es/isAsyncFunction.js +22 -0
- package/es/isBigInt.js +23 -0
- package/es/isBoolean.js +21 -0
- package/es/isDate.js +20 -0
- package/es/isEmptyArray.js +26 -0
- package/es/isEmptyString.js +27 -0
- package/es/isError.js +20 -0
- package/es/isEven.js +29 -0
- package/es/isFalse.js +29 -0
- package/es/isFalsy.js +26 -0
- package/es/isFinite.js +33 -0
- package/es/isFloat.js +34 -0
- package/es/isFunction.js +26 -0
- package/es/isGeneratorFunction.js +33 -0
- package/es/isIndexed.js +21 -0
- package/es/isInteger.js +35 -0
- package/es/isInteger32.js +28 -0
- package/es/isIterable.js +33 -0
- package/es/isMap.js +23 -0
- package/es/isNaN.js +41 -0
- package/es/isNaturalNumber.js +25 -0
- package/es/isNegative.js +25 -0
- package/es/isNegativeZero.js +22 -0
- package/es/isNilOrEmpty.js +25 -0
- package/es/isNonEmptyArray.js +27 -0
- package/es/isNonEmptyString.js +30 -0
- package/es/isNonNegative.js +28 -0
- package/es/isNonPositive.js +28 -0
- package/es/isNotArray.js +22 -0
- package/es/isNotArrayLike.js +24 -0
- package/es/isNotAsyncFunction.js +27 -0
- package/es/isNotBoolean.js +22 -0
- package/es/isNotDate.js +21 -0
- package/es/isNotEmpty.js +25 -0
- package/es/isNotFinite.js +29 -0
- package/es/isNotFloat.js +33 -0
- package/es/isNotFunction.js +29 -0
- package/es/isNotGeneratorFunction.js +27 -0
- package/es/isNotInteger.js +34 -0
- package/es/isNotMap.js +24 -0
- package/es/isNotNaN.js +35 -0
- package/es/isNotNil.js +22 -0
- package/es/isNotNilOrEmpty.js +26 -0
- package/es/isNotNull.js +22 -0
- package/es/isNotNumber.js +23 -0
- package/es/isNotObj.js +29 -0
- package/es/isNotObjLike.js +29 -0
- package/es/isNotPair.js +25 -0
- package/es/isNotPlainObj.js +35 -0
- package/es/isNotPrimitive.js +22 -0
- package/es/isNotRegExp.js +22 -0
- package/es/isNotSet.js +23 -0
- package/es/isNotString.js +21 -0
- package/es/isNotUndefined.js +22 -0
- package/es/isNotValidDate.js +22 -0
- package/es/isNotValidNumber.js +25 -0
- package/es/isNull.js +21 -0
- package/es/isNumber.js +23 -0
- package/es/isObj.js +31 -0
- package/es/isObjLike.js +30 -0
- package/es/isOdd.js +24 -0
- package/es/isPair.js +25 -0
- package/es/isPlainObj.js +52 -0
- package/es/isPositive.js +24 -0
- package/es/isPositiveZero.js +22 -0
- package/es/isPrimitive.js +31 -0
- package/es/isPromise.js +27 -0
- package/es/isPrototypeOf.js +34 -0
- package/es/isRegExp.js +21 -0
- package/es/isSafeInteger.js +34 -0
- package/es/isSentinelValue.js +26 -0
- package/es/isSet.js +22 -0
- package/es/isSparseArray.js +30 -0
- package/es/isString.js +20 -0
- package/es/isSymbol.js +27 -0
- package/es/isThenable.js +26 -0
- package/es/isTrue.js +25 -0
- package/es/isTruthy.js +27 -0
- package/es/isUndefined.js +22 -0
- package/es/isValidDate.js +26 -0
- package/es/isValidNumber.js +26 -0
- package/es/lastP.js +63 -0
- package/es/lengthEq.js +22 -0
- package/es/lengthGt.js +22 -0
- package/es/lengthGte.js +24 -0
- package/es/lengthLt.js +22 -0
- package/es/lengthLte.js +23 -0
- package/es/lengthNotEq.js +22 -0
- package/es/lensEq.js +27 -0
- package/es/lensIso.js +55 -0
- package/es/lensNotEq.js +26 -0
- package/es/lensNotSatisfy.js +28 -0
- package/es/lensSatisfies.js +31 -0
- package/es/lensTraverse.js +42 -0
- package/es/liftF.js +37 -0
- package/es/liftFN.js +47 -0
- package/es/list.js +19 -0
- package/es/mapIndexed.js +26 -0
- package/es/mergePath.js +30 -0
- package/es/mergePaths.js +27 -0
- package/es/mergeProp.js +30 -0
- package/es/mergeProps.js +26 -0
- package/es/mergeRight.js +26 -0
- package/es/move.js +25 -0
- package/es/nand.js +27 -0
- package/es/neither.js +39 -0
- package/es/noneP.js +28 -0
- package/es/nonePass.js +31 -0
- package/es/noop.js +19 -0
- package/es/nor.js +28 -0
- package/es/notAllPass.js +31 -0
- package/es/notAllUnique.js +23 -0
- package/es/notBoth.js +39 -0
- package/es/notEqual.js +30 -0
- package/es/omitBy.js +26 -0
- package/es/omitIndexes.js +27 -0
- package/es/overlaps.js +29 -0
- package/es/padCharsEnd.js +31 -0
- package/es/padCharsStart.js +29 -0
- package/es/padEnd.js +24 -0
- package/es/padStart.js +22 -0
- package/es/pathNotEq.js +32 -0
- package/es/pathOrLazy.js +25 -0
- package/es/paths.js +27 -0
- package/es/pickIndexes.js +30 -0
- package/es/propNotEq.js +29 -0
- package/es/rangeStep.js +36 -0
- package/es/reduceIndexed.js +30 -0
- package/es/reduceP.js +111 -0
- package/es/reduceRightP.js +117 -0
- package/es/rejectP.js +23 -0
- package/es/renameKeyWith.js +28 -0
- package/es/renameKeys.js +42 -0
- package/es/renameKeysWith.js +26 -0
- package/es/repeatStr.js +24 -0
- package/es/replaceAll.js +29 -0
- package/es/resolveP.js +29 -0
- package/es/round.js +24 -0
- package/es/seq.js +44 -0
- package/es/sign.js +27 -0
- package/es/skipTake.js +22 -0
- package/es/sliceFrom.js +22 -0
- package/es/sliceTo.js +22 -0
- package/es/sortByProps.js +52 -0
- package/es/spreadPath.js +25 -0
- package/es/spreadProp.js +25 -0
- package/es/stubArray.js +19 -0
- package/es/stubNull.js +18 -0
- package/es/stubObj.js +20 -0
- package/es/stubString.js +18 -0
- package/es/stubUndefined.js +19 -0
- package/es/subtractNum.js +19 -0
- package/es/thenCatchP.js +26 -0
- package/es/thenP.js +28 -0
- package/es/toArray.js +27 -0
- package/es/toInteger32.js +24 -0
- package/es/toUinteger32.js +26 -0
- package/es/trimCharsEnd.js +22 -0
- package/es/trimCharsStart.js +22 -0
- package/es/trimEnd.js +23 -0
- package/es/trimStart.js +22 -0
- package/es/trunc.js +27 -0
- package/es/unzipObjWith.js +26 -0
- package/es/viewOr.js +30 -0
- package/es/weave.js +36 -0
- package/es/weaveLazy.js +38 -0
- package/es/zipObjWith.js +26 -0
- package/lib/Y.js +44 -0
- package/lib/allEqual.js +35 -0
- package/lib/allEqualTo.js +32 -0
- package/lib/allIdentical.js +33 -0
- package/lib/allIdenticalTo.js +32 -0
- package/lib/allP.js +32 -0
- package/lib/allSettledP.js +41 -0
- package/lib/allUnique.js +32 -0
- package/lib/anyP.js +47 -0
- package/lib/appendFlipped.js +29 -0
- package/lib/argsPass.js +48 -0
- package/lib/async.js +67 -0
- package/lib/cata.js +110 -0
- package/lib/catchP.js +30 -0
- package/lib/ceil.js +32 -0
- package/lib/compact.js +30 -0
- package/lib/concatAll.js +40 -0
- package/lib/concatRight.js +35 -0
- package/lib/contained.js +35 -0
- package/lib/curryRight.js +33 -0
- package/lib/curryRightN.js +38 -0
- package/lib/defaultWhen.js +31 -0
- package/lib/delayP.js +54 -0
- package/lib/dispatch.js +50 -0
- package/lib/divideNum.js +25 -0
- package/lib/dropArgs.js +28 -0
- package/lib/ensureArray.js +31 -0
- package/lib/escapeRegExp.js +29 -0
- package/lib/fantasy-land/Identity.js +323 -0
- package/lib/fantasy-land/mapping.js +44 -0
- package/lib/fantasy-land/traits.js +77 -0
- package/lib/fantasy-land/util.js +21 -0
- package/lib/filterIndexed.js +33 -0
- package/lib/findOr.js +34 -0
- package/lib/flattenDepth.js +58 -0
- package/lib/flattenPath.js +33 -0
- package/lib/flattenProp.js +37 -0
- package/lib/floor.js +31 -0
- package/lib/fnull.js +47 -0
- package/lib/hasPath.js +47 -0
- package/lib/inRange.js +37 -0
- package/lib/index.js +863 -0
- package/lib/internal/ap.js +37 -0
- package/lib/internal/compareLength.js +12 -0
- package/lib/internal/isOfTypeObject.js +13 -0
- package/lib/internal/makeFlat.js +54 -0
- package/lib/internal/ponyfills/Array.from.js +52 -0
- package/lib/internal/ponyfills/Math.sign.js +11 -0
- package/lib/internal/ponyfills/Math.trunc.js +22 -0
- package/lib/internal/ponyfills/Number.MAX_SAFE_INTEGER.js +7 -0
- package/lib/internal/ponyfills/Number.MIN_SAFE_INTEGER.js +7 -0
- package/lib/internal/ponyfills/Number.isFinite.js +15 -0
- package/lib/internal/ponyfills/Number.isInteger.js +14 -0
- package/lib/internal/ponyfills/Number.isNaN.js +15 -0
- package/lib/internal/ponyfills/Number.isSafeInteger.js +18 -0
- package/lib/internal/ponyfills/Promise.allSettled.js +48 -0
- package/lib/internal/ponyfills/Promise.any.js +89 -0
- package/lib/internal/ponyfills/String.padEnd.js +34 -0
- package/lib/internal/ponyfills/String.padStart.js +36 -0
- package/lib/internal/ponyfills/String.repeat.js +55 -0
- package/lib/internal/ponyfills/String.replaceAll.js +44 -0
- package/lib/internal/ponyfills/String.trimEnd.js +10 -0
- package/lib/internal/ponyfills/String.trimStart.js +10 -0
- package/lib/invoke.js +29 -0
- package/lib/invokeArgs.js +40 -0
- package/lib/isArray.js +31 -0
- package/lib/isArrayLike.js +98 -0
- package/lib/isAsyncFunction.js +28 -0
- package/lib/isBigInt.js +29 -0
- package/lib/isBoolean.js +27 -0
- package/lib/isDate.js +26 -0
- package/lib/isEmptyArray.js +35 -0
- package/lib/isEmptyString.js +33 -0
- package/lib/isError.js +26 -0
- package/lib/isEven.js +39 -0
- package/lib/isFalse.js +35 -0
- package/lib/isFalsy.js +35 -0
- package/lib/isFinite.js +46 -0
- package/lib/isFloat.js +44 -0
- package/lib/isFunction.js +36 -0
- package/lib/isGeneratorFunction.js +40 -0
- package/lib/isIndexed.js +31 -0
- package/lib/isInteger.js +47 -0
- package/lib/isInteger32.js +37 -0
- package/lib/isIterable.js +42 -0
- package/lib/isMap.js +29 -0
- package/lib/isNaN.js +54 -0
- package/lib/isNaturalNumber.js +35 -0
- package/lib/isNegative.js +34 -0
- package/lib/isNegativeZero.js +28 -0
- package/lib/isNilOrEmpty.js +31 -0
- package/lib/isNonEmptyArray.js +37 -0
- package/lib/isNonEmptyString.js +41 -0
- package/lib/isNonNegative.js +37 -0
- package/lib/isNonPositive.js +37 -0
- package/lib/isNotArray.js +31 -0
- package/lib/isNotArrayLike.js +33 -0
- package/lib/isNotAsyncFunction.js +36 -0
- package/lib/isNotBoolean.js +31 -0
- package/lib/isNotDate.js +30 -0
- package/lib/isNotEmpty.js +31 -0
- package/lib/isNotFinite.js +38 -0
- package/lib/isNotFloat.js +42 -0
- package/lib/isNotFunction.js +38 -0
- package/lib/isNotGeneratorFunction.js +36 -0
- package/lib/isNotInteger.js +43 -0
- package/lib/isNotMap.js +33 -0
- package/lib/isNotNaN.js +44 -0
- package/lib/isNotNil.js +28 -0
- package/lib/isNotNilOrEmpty.js +35 -0
- package/lib/isNotNull.js +31 -0
- package/lib/isNotNumber.js +32 -0
- package/lib/isNotObj.js +38 -0
- package/lib/isNotObjLike.js +38 -0
- package/lib/isNotPair.js +34 -0
- package/lib/isNotPlainObj.js +44 -0
- package/lib/isNotPrimitive.js +31 -0
- package/lib/isNotRegExp.js +31 -0
- package/lib/isNotSet.js +32 -0
- package/lib/isNotString.js +30 -0
- package/lib/isNotUndefined.js +31 -0
- package/lib/isNotValidDate.js +31 -0
- package/lib/isNotValidNumber.js +34 -0
- package/lib/isNull.js +27 -0
- package/lib/isNumber.js +29 -0
- package/lib/isObj.js +42 -0
- package/lib/isObjLike.js +40 -0
- package/lib/isOdd.js +33 -0
- package/lib/isPair.js +34 -0
- package/lib/isPlainObj.js +64 -0
- package/lib/isPositive.js +33 -0
- package/lib/isPositiveZero.js +28 -0
- package/lib/isPrimitive.js +47 -0
- package/lib/isPromise.js +36 -0
- package/lib/isPrototypeOf.js +43 -0
- package/lib/isRegExp.js +27 -0
- package/lib/isSafeInteger.js +46 -0
- package/lib/isSentinelValue.js +35 -0
- package/lib/isSet.js +28 -0
- package/lib/isSparseArray.js +39 -0
- package/lib/isString.js +26 -0
- package/lib/isSymbol.js +33 -0
- package/lib/isThenable.js +35 -0
- package/lib/isTrue.js +31 -0
- package/lib/isTruthy.js +33 -0
- package/lib/isUndefined.js +31 -0
- package/lib/isValidDate.js +36 -0
- package/lib/isValidNumber.js +36 -0
- package/lib/lastP.js +76 -0
- package/lib/lengthEq.js +31 -0
- package/lib/lengthGt.js +31 -0
- package/lib/lengthGte.js +33 -0
- package/lib/lengthLt.js +31 -0
- package/lib/lengthLte.js +32 -0
- package/lib/lengthNotEq.js +31 -0
- package/lib/lensEq.js +33 -0
- package/lib/lensIso.js +62 -0
- package/lib/lensNotEq.js +35 -0
- package/lib/lensNotSatisfy.js +37 -0
- package/lib/lensSatisfies.js +40 -0
- package/lib/lensTraverse.js +51 -0
- package/lib/liftF.js +46 -0
- package/lib/liftFN.js +56 -0
- package/lib/list.js +25 -0
- package/lib/mapIndexed.js +32 -0
- package/lib/mergePath.js +39 -0
- package/lib/mergePaths.js +36 -0
- package/lib/mergeProp.js +39 -0
- package/lib/mergeProps.js +32 -0
- package/lib/mergeRight.js +32 -0
- package/lib/move.js +31 -0
- package/lib/nand.js +33 -0
- package/lib/neither.js +45 -0
- package/lib/noneP.js +39 -0
- package/lib/nonePass.js +37 -0
- package/lib/noop.js +28 -0
- package/lib/nor.js +34 -0
- package/lib/notAllPass.js +37 -0
- package/lib/notAllUnique.js +32 -0
- package/lib/notBoth.js +45 -0
- package/lib/notEqual.js +36 -0
- package/lib/omitBy.js +32 -0
- package/lib/omitIndexes.js +34 -0
- package/lib/overlaps.js +38 -0
- package/lib/padCharsEnd.js +44 -0
- package/lib/padCharsStart.js +42 -0
- package/lib/padEnd.js +32 -0
- package/lib/padStart.js +30 -0
- package/lib/pathNotEq.js +38 -0
- package/lib/pathOrLazy.js +31 -0
- package/lib/paths.js +33 -0
- package/lib/pickIndexes.js +37 -0
- package/lib/propNotEq.js +35 -0
- package/lib/rangeStep.js +45 -0
- package/lib/reduceIndexed.js +36 -0
- package/lib/reduceP.js +122 -0
- package/lib/reduceRightP.js +129 -0
- package/lib/rejectP.js +29 -0
- package/lib/renameKeyWith.js +37 -0
- package/lib/renameKeys.js +51 -0
- package/lib/renameKeysWith.js +32 -0
- package/lib/repeatStr.js +37 -0
- package/lib/replaceAll.js +42 -0
- package/lib/resolveP.js +35 -0
- package/lib/round.js +30 -0
- package/lib/seq.js +50 -0
- package/lib/sign.js +39 -0
- package/lib/skipTake.js +28 -0
- package/lib/sliceFrom.js +28 -0
- package/lib/sliceTo.js +28 -0
- package/lib/sortByProps.js +58 -0
- package/lib/spreadPath.js +31 -0
- package/lib/spreadProp.js +34 -0
- package/lib/stubArray.js +25 -0
- package/lib/stubNull.js +24 -0
- package/lib/stubObj.js +26 -0
- package/lib/stubString.js +24 -0
- package/lib/stubUndefined.js +25 -0
- package/lib/subtractNum.js +25 -0
- package/lib/thenCatchP.js +33 -0
- package/lib/thenP.js +34 -0
- package/lib/toArray.js +40 -0
- package/lib/toInteger32.js +30 -0
- package/lib/toUinteger32.js +32 -0
- package/lib/trimCharsEnd.js +31 -0
- package/lib/trimCharsStart.js +31 -0
- package/lib/trimEnd.js +36 -0
- package/lib/trimStart.js +35 -0
- package/lib/trunc.js +39 -0
- package/lib/unzipObjWith.js +35 -0
- package/lib/viewOr.js +36 -0
- package/lib/weave.js +42 -0
- package/lib/weaveLazy.js +44 -0
- package/lib/zipObjWith.js +32 -0
- package/package.json +204 -0
- package/src/Y.js +32 -0
- package/src/allEqual.js +28 -0
- package/src/allEqualTo.js +25 -0
- package/src/allIdentical.js +26 -0
- package/src/allIdenticalTo.js +25 -0
- package/src/allP.js +27 -0
- package/src/allSettledP.js +34 -0
- package/src/allUnique.js +25 -0
- package/src/anyP.js +33 -0
- package/src/appendFlipped.js +24 -0
- package/src/argsPass.js +40 -0
- package/src/async.js +60 -0
- package/src/cata.js +86 -0
- package/src/catchP.js +25 -0
- package/src/ceil.js +28 -0
- package/src/compact.js +23 -0
- package/src/concatAll.js +34 -0
- package/src/concatRight.js +30 -0
- package/src/contained.js +30 -0
- package/src/curryRight.js +26 -0
- package/src/curryRightN.js +29 -0
- package/src/defaultWhen.js +26 -0
- package/src/delayP.js +45 -0
- package/src/dispatch.js +74 -0
- package/src/divideNum.js +20 -0
- package/src/dropArgs.js +23 -0
- package/src/ensureArray.js +24 -0
- package/src/escapeRegExp.js +22 -0
- package/src/fantasy-land/Identity.js +270 -0
- package/src/fantasy-land/mapping.js +20 -0
- package/src/fantasy-land/traits.js +57 -0
- package/src/fantasy-land/util.js +23 -0
- package/src/filterIndexed.js +28 -0
- package/src/findOr.js +30 -0
- package/src/flattenDepth.js +39 -0
- package/src/flattenPath.js +26 -0
- package/src/flattenProp.js +28 -0
- package/src/floor.js +27 -0
- package/src/fnull.js +38 -0
- package/src/hasPath.js +40 -0
- package/src/inRange.js +34 -0
- package/src/index.js +241 -0
- package/src/internal/ap.js +30 -0
- package/src/internal/compareLength.js +7 -0
- package/src/internal/isOfTypeObject.js +3 -0
- package/src/internal/makeFlat.js +42 -0
- package/src/internal/ponyfills/Array.from.js +34 -0
- package/src/internal/ponyfills/Math.sign.js +3 -0
- package/src/internal/ponyfills/Math.trunc.js +14 -0
- package/src/internal/ponyfills/Number.MAX_SAFE_INTEGER.js +3 -0
- package/src/internal/ponyfills/Number.MIN_SAFE_INTEGER.js +3 -0
- package/src/internal/ponyfills/Number.isFinite.js +8 -0
- package/src/internal/ponyfills/Number.isInteger.js +10 -0
- package/src/internal/ponyfills/Number.isNaN.js +8 -0
- package/src/internal/ponyfills/Number.isSafeInteger.js +11 -0
- package/src/internal/ponyfills/Promise.allSettled.js +18 -0
- package/src/internal/ponyfills/Promise.any.js +29 -0
- package/src/internal/ponyfills/String.padEnd.js +25 -0
- package/src/internal/ponyfills/String.padStart.js +27 -0
- package/src/internal/ponyfills/String.repeat.js +49 -0
- package/src/internal/ponyfills/String.replaceAll.js +44 -0
- package/src/internal/ponyfills/String.trimEnd.js +5 -0
- package/src/internal/ponyfills/String.trimStart.js +5 -0
- package/src/invoke.js +22 -0
- package/src/invokeArgs.js +36 -0
- package/src/isArray.js +27 -0
- package/src/isArrayLike.js +79 -0
- package/src/isAsyncFunction.js +23 -0
- package/src/isBigInt.js +24 -0
- package/src/isBoolean.js +22 -0
- package/src/isDate.js +21 -0
- package/src/isEmptyArray.js +28 -0
- package/src/isEmptyString.js +28 -0
- package/src/isError.js +21 -0
- package/src/isEven.js +31 -0
- package/src/isFalse.js +31 -0
- package/src/isFalsy.js +28 -0
- package/src/isFinite.js +37 -0
- package/src/isFloat.js +36 -0
- package/src/isFunction.js +32 -0
- package/src/isGeneratorFunction.js +43 -0
- package/src/isIndexed.js +24 -0
- package/src/isInteger.js +40 -0
- package/src/isInteger32.js +28 -0
- package/src/isIterable.js +37 -0
- package/src/isMap.js +25 -0
- package/src/isNaN.js +45 -0
- package/src/isNaturalNumber.js +28 -0
- package/src/isNegative.js +27 -0
- package/src/isNegativeZero.js +23 -0
- package/src/isNilOrEmpty.js +26 -0
- package/src/isNonEmptyArray.js +29 -0
- package/src/isNonEmptyString.js +32 -0
- package/src/isNonNegative.js +30 -0
- package/src/isNonPositive.js +30 -0
- package/src/isNotArray.js +24 -0
- package/src/isNotArrayLike.js +26 -0
- package/src/isNotAsyncFunction.js +27 -0
- package/src/isNotBoolean.js +24 -0
- package/src/isNotDate.js +23 -0
- package/src/isNotEmpty.js +26 -0
- package/src/isNotFinite.js +31 -0
- package/src/isNotFloat.js +35 -0
- package/src/isNotFunction.js +29 -0
- package/src/isNotGeneratorFunction.js +27 -0
- package/src/isNotInteger.js +36 -0
- package/src/isNotMap.js +27 -0
- package/src/isNotNaN.js +37 -0
- package/src/isNotNil.js +23 -0
- package/src/isNotNilOrEmpty.js +28 -0
- package/src/isNotNull.js +24 -0
- package/src/isNotNumber.js +25 -0
- package/src/isNotObj.js +29 -0
- package/src/isNotObjLike.js +29 -0
- package/src/isNotPair.js +27 -0
- package/src/isNotPlainObj.js +35 -0
- package/src/isNotPrimitive.js +25 -0
- package/src/isNotRegExp.js +24 -0
- package/src/isNotSet.js +26 -0
- package/src/isNotString.js +23 -0
- package/src/isNotUndefined.js +24 -0
- package/src/isNotValidDate.js +24 -0
- package/src/isNotValidNumber.js +27 -0
- package/src/isNull.js +22 -0
- package/src/isNumber.js +24 -0
- package/src/isObj.js +31 -0
- package/src/isObjLike.js +30 -0
- package/src/isOdd.js +29 -0
- package/src/isPair.js +27 -0
- package/src/isPlainObj.js +65 -0
- package/src/isPositive.js +26 -0
- package/src/isPositiveZero.js +23 -0
- package/src/isPrimitive.js +45 -0
- package/src/isPromise.js +32 -0
- package/src/isPrototypeOf.js +36 -0
- package/src/isRegExp.js +22 -0
- package/src/isSafeInteger.js +40 -0
- package/src/isSentinelValue.js +26 -0
- package/src/isSet.js +24 -0
- package/src/isSparseArray.js +43 -0
- package/src/isString.js +21 -0
- package/src/isSymbol.js +29 -0
- package/src/isThenable.js +28 -0
- package/src/isTrue.js +27 -0
- package/src/isTruthy.js +28 -0
- package/src/isUndefined.js +24 -0
- package/src/isValidDate.js +29 -0
- package/src/isValidNumber.js +28 -0
- package/src/lastP.js +54 -0
- package/src/lengthEq.js +24 -0
- package/src/lengthGt.js +24 -0
- package/src/lengthGte.js +26 -0
- package/src/lengthLt.js +24 -0
- package/src/lengthLte.js +25 -0
- package/src/lengthNotEq.js +24 -0
- package/src/lensEq.js +28 -0
- package/src/lensIso.js +51 -0
- package/src/lensNotEq.js +28 -0
- package/src/lensNotSatisfy.js +30 -0
- package/src/lensSatisfies.js +33 -0
- package/src/lensTraverse.js +44 -0
- package/src/liftF.js +37 -0
- package/src/liftFN.js +45 -0
- package/src/list.js +20 -0
- package/src/mapIndexed.js +27 -0
- package/src/mergePath.js +32 -0
- package/src/mergePaths.js +29 -0
- package/src/mergeProp.js +30 -0
- package/src/mergeProps.js +27 -0
- package/src/mergeRight.js +27 -0
- package/src/move.js +26 -0
- package/src/nand.js +27 -0
- package/src/neither.js +38 -0
- package/src/noneP.js +35 -0
- package/src/nonePass.js +32 -0
- package/src/noop.js +21 -0
- package/src/nor.js +28 -0
- package/src/notAllPass.js +32 -0
- package/src/notAllUnique.js +25 -0
- package/src/notBoth.js +38 -0
- package/src/notEqual.js +31 -0
- package/src/omitBy.js +25 -0
- package/src/omitIndexes.js +27 -0
- package/src/overlaps.js +32 -0
- package/src/padCharsEnd.js +37 -0
- package/src/padCharsStart.js +35 -0
- package/src/padEnd.js +25 -0
- package/src/padStart.js +23 -0
- package/src/pathNotEq.js +31 -0
- package/src/pathOrLazy.js +30 -0
- package/src/paths.js +26 -0
- package/src/pickIndexes.js +30 -0
- package/src/propNotEq.js +30 -0
- package/src/rangeStep.js +37 -0
- package/src/reduceIndexed.js +31 -0
- package/src/reduceP.js +96 -0
- package/src/reduceRightP.js +101 -0
- package/src/rejectP.js +24 -0
- package/src/renameKeyWith.js +30 -0
- package/src/renameKeys.js +40 -0
- package/src/renameKeysWith.js +27 -0
- package/src/repeatStr.js +30 -0
- package/src/replaceAll.js +35 -0
- package/src/resolveP.js +28 -0
- package/src/round.js +26 -0
- package/src/seq.js +38 -0
- package/src/sign.js +33 -0
- package/src/skipTake.js +33 -0
- package/src/sliceFrom.js +23 -0
- package/src/sliceTo.js +23 -0
- package/src/sortByProps.js +31 -0
- package/src/spreadPath.js +26 -0
- package/src/spreadProp.js +25 -0
- package/src/stubArray.js +18 -0
- package/src/stubNull.js +19 -0
- package/src/stubObj.js +19 -0
- package/src/stubString.js +19 -0
- package/src/stubUndefined.js +19 -0
- package/src/subtractNum.js +20 -0
- package/src/thenCatchP.js +27 -0
- package/src/thenP.js +29 -0
- package/src/toArray.js +32 -0
- package/src/toInteger32.js +22 -0
- package/src/toUinteger32.js +26 -0
- package/src/trimCharsEnd.js +25 -0
- package/src/trimCharsStart.js +25 -0
- package/src/trimEnd.js +30 -0
- package/src/trimStart.js +29 -0
- package/src/trunc.js +33 -0
- package/src/unzipObjWith.js +40 -0
- package/src/viewOr.js +32 -0
- package/src/weave.js +35 -0
- package/src/weaveLazy.js +37 -0
- package/src/zipObjWith.js +27 -0
- package/tonicExample.js +4 -0
- package/types/index.d.ts +1553 -0
package/es/index.js
ADDED
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @namespace RA
|
|
3
|
+
*/
|
|
4
|
+
// Type
|
|
5
|
+
export { default as isNotUndefined } from './isNotUndefined';
|
|
6
|
+
export { default as isUndefined } from './isUndefined';
|
|
7
|
+
export { default as isNull } from './isNull';
|
|
8
|
+
export { default as isNotNull } from './isNotNull';
|
|
9
|
+
export { default as isNotNil } from './isNotNil';
|
|
10
|
+
export { default as isArray } from './isArray';
|
|
11
|
+
export { default as isIterable } from './isIterable';
|
|
12
|
+
export { default as isEmptyArray } from './isEmptyArray';
|
|
13
|
+
export { default as isNotArray } from './isNotArray';
|
|
14
|
+
export { default as isNonEmptyArray } from './isNonEmptyArray';
|
|
15
|
+
export { default as isBoolean } from './isBoolean';
|
|
16
|
+
export { default as isNotBoolean } from './isNotBoolean';
|
|
17
|
+
export { default as isNilOrEmpty } from './isNilOrEmpty';
|
|
18
|
+
export { default as isString } from './isString';
|
|
19
|
+
export { default as isEmptyString } from './isEmptyString';
|
|
20
|
+
export { default as isNotString } from './isNotString';
|
|
21
|
+
export { default as isNonEmptyString } from './isNonEmptyString';
|
|
22
|
+
export { default as isArrayLike } from './isArrayLike';
|
|
23
|
+
export { default as isNotArrayLike } from './isNotArrayLike';
|
|
24
|
+
export { default as isGeneratorFunction } from './isGeneratorFunction';
|
|
25
|
+
export { default as isNotGeneratorFunction } from './isNotGeneratorFunction';
|
|
26
|
+
export { default as isAsyncFunction } from './isAsyncFunction';
|
|
27
|
+
export { default as isNotAsyncFunction } from './isNotAsyncFunction';
|
|
28
|
+
export { default as isFunction } from './isFunction';
|
|
29
|
+
export { default as isNotFunction } from './isNotFunction';
|
|
30
|
+
export { default as isObj } from './isObj';
|
|
31
|
+
export { default as isObject } from './isObj'; // alias of isObject
|
|
32
|
+
|
|
33
|
+
export { default as isNotObj } from './isNotObj';
|
|
34
|
+
export { default as isNotObject } from './isNotObj'; // alias of isNotObj
|
|
35
|
+
|
|
36
|
+
export { default as isObjLike } from './isObjLike';
|
|
37
|
+
export { default as isObjectLike } from './isObjLike'; // alias of isObjLike
|
|
38
|
+
|
|
39
|
+
export { default as isNotObjLike } from './isNotObjLike';
|
|
40
|
+
export { default as isNotObjectLike } from './isNotObjLike'; // alias of isNotObjLike
|
|
41
|
+
|
|
42
|
+
export { default as isPlainObj } from './isPlainObj';
|
|
43
|
+
export { default as isPlainObject } from './isPlainObj';
|
|
44
|
+
export { default as isNotPlainObj } from './isNotPlainObj';
|
|
45
|
+
export { default as isNotPlainObject } from './isNotPlainObj'; // alias of isNotPlainObject
|
|
46
|
+
|
|
47
|
+
export { default as isDate } from './isDate';
|
|
48
|
+
export { default as isNotDate } from './isNotDate';
|
|
49
|
+
export { default as isValidDate } from './isValidDate';
|
|
50
|
+
export { default as isNotValidDate } from './isNotValidDate';
|
|
51
|
+
export { default as isInvalidDate } from './isNotValidDate'; // alias of isNotValidDate
|
|
52
|
+
|
|
53
|
+
export { default as isNumber } from './isNumber';
|
|
54
|
+
export { default as isNotNumber } from './isNotNumber';
|
|
55
|
+
export { default as isPositive } from './isPositive';
|
|
56
|
+
export { default as isNegative } from './isNegative';
|
|
57
|
+
export { default as isPositiveZero } from './isPositiveZero';
|
|
58
|
+
export { default as isNegativeZero } from './isNegativeZero';
|
|
59
|
+
export { default as isNotNilOrEmpty } from './isNotNilOrEmpty';
|
|
60
|
+
export { default as isNonPositive } from './isNonPositive';
|
|
61
|
+
export { default as isNonNegative } from './isNonNegative';
|
|
62
|
+
export { default as isMap } from './isMap';
|
|
63
|
+
export { default as isNotMap } from './isNotMap';
|
|
64
|
+
export { default as isNaN } from './isNaN';
|
|
65
|
+
export { default as isNotNaN } from './isNotNaN';
|
|
66
|
+
export { default as isFinite } from './isFinite';
|
|
67
|
+
export { default as isNotFinite } from './isNotFinite';
|
|
68
|
+
export { default as isInteger } from './isInteger';
|
|
69
|
+
export { default as isInteger32 } from './isInteger32';
|
|
70
|
+
export { default as isInt32 } from './isInteger32'; // alias of isInteger32
|
|
71
|
+
|
|
72
|
+
export { default as isNotInteger } from './isNotInteger';
|
|
73
|
+
export { default as isBigInt } from './isBigInt';
|
|
74
|
+
export { default as isFloat } from './isFloat';
|
|
75
|
+
export { default as isNotFloat } from './isNotFloat';
|
|
76
|
+
export { default as isValidNumber } from './isValidNumber';
|
|
77
|
+
export { default as isNotValidNumber } from './isNotValidNumber';
|
|
78
|
+
export { default as isOdd } from './isOdd';
|
|
79
|
+
export { default as isEven } from './isEven';
|
|
80
|
+
export { default as isPair } from './isPair';
|
|
81
|
+
export { default as isNotPair } from './isNotPair';
|
|
82
|
+
export { default as isThenable } from './isThenable';
|
|
83
|
+
export { default as isPromise } from './isPromise';
|
|
84
|
+
export { default as isTrue } from './isTrue';
|
|
85
|
+
export { default as isFalse } from './isFalse';
|
|
86
|
+
export { default as isTruthy } from './isTruthy';
|
|
87
|
+
export { default as isFalsy } from './isFalsy';
|
|
88
|
+
export { default as isRegExp } from './isRegExp';
|
|
89
|
+
export { default as isNotRegExp } from './isNotRegExp';
|
|
90
|
+
export { default as isSet } from './isSet';
|
|
91
|
+
export { default as isNotSet } from './isNotSet';
|
|
92
|
+
export { default as isSparseArray } from './isSparseArray';
|
|
93
|
+
export { default as isSymbol } from './isSymbol';
|
|
94
|
+
export { default as isSafeInteger } from './isSafeInteger';
|
|
95
|
+
export { default as isIndexed } from './isIndexed';
|
|
96
|
+
export { default as isError } from './isError';
|
|
97
|
+
export { default as isNaturalNumber } from './isNaturalNumber';
|
|
98
|
+
export { default as isPrimitive } from './isPrimitive';
|
|
99
|
+
export { default as isNotPrimitive } from './isNotPrimitive';
|
|
100
|
+
export { default as isSentinelValue } from './isSentinelValue'; // Function
|
|
101
|
+
|
|
102
|
+
export { default as stubUndefined } from './stubUndefined';
|
|
103
|
+
export { default as stubNull } from './stubNull';
|
|
104
|
+
export { default as stubObj } from './stubObj';
|
|
105
|
+
export { default as stubObject } from './stubObj';
|
|
106
|
+
export { default as stubString } from './stubString';
|
|
107
|
+
export { default as stubArray } from './stubArray';
|
|
108
|
+
export { default as noop } from './noop';
|
|
109
|
+
export { default as liftFN } from './liftFN';
|
|
110
|
+
export { default as liftF } from './liftF';
|
|
111
|
+
export { default as cata } from './cata';
|
|
112
|
+
export { default as weave } from './weave';
|
|
113
|
+
export { default as weaveLazy } from './weaveLazy';
|
|
114
|
+
export { default as curryRightN } from './curryRightN';
|
|
115
|
+
export { default as curryRight } from './curryRight';
|
|
116
|
+
export { default as allP } from './allP';
|
|
117
|
+
export { default as catchP } from './catchP';
|
|
118
|
+
export { default as noneP } from './noneP';
|
|
119
|
+
export { default as resolveP } from './resolveP';
|
|
120
|
+
export { default as rejectP } from './rejectP';
|
|
121
|
+
export { default as delayP } from './delayP';
|
|
122
|
+
export { default as thenP } from './thenP';
|
|
123
|
+
export { default as then } from './thenP';
|
|
124
|
+
export { default as thenCatchP } from './thenCatchP';
|
|
125
|
+
export { default as allSettledP } from './allSettledP';
|
|
126
|
+
export { default as Y } from './Y';
|
|
127
|
+
export { default as seq } from './seq';
|
|
128
|
+
export { default as sequencing } from './seq';
|
|
129
|
+
export { default as dispatch } from './dispatch';
|
|
130
|
+
export { default as async } from './async';
|
|
131
|
+
export { default as anyP } from './anyP';
|
|
132
|
+
export { default as firstP } from './anyP'; // alias of anyP
|
|
133
|
+
|
|
134
|
+
export { default as lastP } from './lastP';
|
|
135
|
+
export { default as fnull } from './fnull'; // List
|
|
136
|
+
|
|
137
|
+
export { default as mapIndexed } from './mapIndexed';
|
|
138
|
+
export { default as reduceIndexed } from './reduceIndexed';
|
|
139
|
+
export { default as filterIndexed } from './filterIndexed';
|
|
140
|
+
export { default as pickIndexes } from './pickIndexes';
|
|
141
|
+
export { default as list } from './list';
|
|
142
|
+
export { default as ensureArray } from './ensureArray';
|
|
143
|
+
export { default as concatAll } from './concatAll';
|
|
144
|
+
export { default as concatRight } from './concatRight';
|
|
145
|
+
export { default as reduceP } from './reduceP';
|
|
146
|
+
export { default as reduceRightP } from './reduceRightP';
|
|
147
|
+
export { default as sliceFrom } from './sliceFrom';
|
|
148
|
+
export { default as sliceTo } from './sliceTo';
|
|
149
|
+
export { default as omitIndexes } from './omitIndexes';
|
|
150
|
+
export { default as compact } from './compact';
|
|
151
|
+
export { default as appendFlipped } from './appendFlipped';
|
|
152
|
+
export { default as contained } from './contained';
|
|
153
|
+
export { default as included } from './contained';
|
|
154
|
+
export { default as move } from './move';
|
|
155
|
+
export { default as lengthGt } from './lengthGt';
|
|
156
|
+
export { default as lengthLt } from './lengthLt';
|
|
157
|
+
export { default as lengthGte } from './lengthGte';
|
|
158
|
+
export { default as lengthLte } from './lengthLte';
|
|
159
|
+
export { default as lengthEq } from './lengthEq';
|
|
160
|
+
export { default as lengthNotEq } from './lengthNotEq';
|
|
161
|
+
export { default as allEqual } from './allEqual';
|
|
162
|
+
export { default as repeatStr } from './repeatStr';
|
|
163
|
+
export { default as allIdentical } from './allIdentical';
|
|
164
|
+
export { default as allIdenticalTo } from './allIdenticalTo';
|
|
165
|
+
export { default as allEqualTo } from './allEqualTo';
|
|
166
|
+
export { default as flattenDepth } from './flattenDepth';
|
|
167
|
+
export { default as toArray } from './toArray';
|
|
168
|
+
export { default as allUnique } from './allUnique';
|
|
169
|
+
export { default as notAllUnique } from './notAllUnique';
|
|
170
|
+
export { default as sortByProps } from './sortByProps';
|
|
171
|
+
export { default as skipTake } from './skipTake';
|
|
172
|
+
export { default as rangeStep } from './rangeStep';
|
|
173
|
+
export { default as findOr } from './findOr'; // Object
|
|
174
|
+
|
|
175
|
+
export { default as invoke } from './invoke';
|
|
176
|
+
export { default as invokeArgs } from './invokeArgs';
|
|
177
|
+
export { default as paths } from './paths';
|
|
178
|
+
export { default as renameKeys } from './renameKeys';
|
|
179
|
+
export { default as renameKeysWith } from './renameKeysWith';
|
|
180
|
+
export { default as renameKeyWith } from './renameKeyWith';
|
|
181
|
+
export { default as mergeRight } from './mergeRight';
|
|
182
|
+
export { default as mergeLeft } from './mergeRight';
|
|
183
|
+
export { default as resetToDefault } from './mergeRight';
|
|
184
|
+
export { default as mergeProps } from './mergeProps';
|
|
185
|
+
export { default as mergePaths } from './mergePaths';
|
|
186
|
+
export { default as mergeProp } from './mergeProp';
|
|
187
|
+
export { default as mergePath } from './mergePath';
|
|
188
|
+
export { default as omitBy } from './omitBy';
|
|
189
|
+
export { default as pathOrLazy } from './pathOrLazy';
|
|
190
|
+
export { default as viewOr } from './viewOr';
|
|
191
|
+
export { default as hasPath } from './hasPath';
|
|
192
|
+
export { default as spreadProp } from './spreadProp';
|
|
193
|
+
export { default as spreadPath } from './spreadPath';
|
|
194
|
+
export { default as flattenProp } from './flattenProp';
|
|
195
|
+
export { default as flattenPath } from './flattenPath';
|
|
196
|
+
export { default as unzipObjWith } from './unzipObjWith';
|
|
197
|
+
export { default as zipObjWith } from './zipObjWith';
|
|
198
|
+
export { default as isPrototypeOf } from './isPrototypeOf'; // Relation
|
|
199
|
+
|
|
200
|
+
export { default as lensEq } from './lensEq';
|
|
201
|
+
export { default as lensNotEq } from './lensNotEq';
|
|
202
|
+
export { default as lensSatisfies } from './lensSatisfies';
|
|
203
|
+
export { default as lensNotSatisfy } from './lensNotSatisfy';
|
|
204
|
+
export { default as lensTraverse } from './lensTraverse';
|
|
205
|
+
export { default as lensIso } from './lensIso';
|
|
206
|
+
export { default as propNotEq } from './propNotEq';
|
|
207
|
+
export { default as pathNotEq } from './pathNotEq';
|
|
208
|
+
export { default as inRange } from './inRange';
|
|
209
|
+
export { default as notEqual } from './notEqual';
|
|
210
|
+
export { default as overlaps } from './overlaps'; // Logic
|
|
211
|
+
|
|
212
|
+
export { default as isNotEmpty } from './isNotEmpty';
|
|
213
|
+
export { default as defaultWhen } from './defaultWhen';
|
|
214
|
+
export { default as notBoth } from './notBoth';
|
|
215
|
+
export { default as nand } from './nand';
|
|
216
|
+
export { default as neither } from './neither';
|
|
217
|
+
export { default as nor } from './nor';
|
|
218
|
+
export { default as notAllPass } from './notAllPass';
|
|
219
|
+
export { default as nonePass } from './nonePass';
|
|
220
|
+
export { default as argsPass } from './argsPass';
|
|
221
|
+
export { default as dropArgs } from './dropArgs'; // Math
|
|
222
|
+
|
|
223
|
+
export { default as round } from './round';
|
|
224
|
+
export { default as ceil } from './ceil';
|
|
225
|
+
export { default as divideNum } from './divideNum';
|
|
226
|
+
export { default as floor } from './floor';
|
|
227
|
+
export { default as trunc } from './trunc';
|
|
228
|
+
export { default as sign } from './sign';
|
|
229
|
+
export { default as subtractNum } from './subtractNum';
|
|
230
|
+
export { default as toInteger32 } from './toInteger32';
|
|
231
|
+
export { default as toInt32 } from './toInteger32'; // alias of toInteger32
|
|
232
|
+
|
|
233
|
+
export { default as toUinteger32 } from './toUinteger32';
|
|
234
|
+
export { default as toUint32 } from './toUinteger32'; // alias of to toUinteger32
|
|
235
|
+
// String
|
|
236
|
+
|
|
237
|
+
export { default as replaceAll } from './replaceAll';
|
|
238
|
+
export { default as escapeRegExp } from './escapeRegExp';
|
|
239
|
+
export { default as trimStart } from './trimStart';
|
|
240
|
+
export { default as trimLeft } from './trimStart'; // alias of trimStart
|
|
241
|
+
|
|
242
|
+
export { default as trimEnd } from './trimEnd';
|
|
243
|
+
export { default as trimRight } from './trimEnd'; // alias of trimEnd
|
|
244
|
+
|
|
245
|
+
export { default as trimCharsEnd } from './trimCharsEnd';
|
|
246
|
+
export { default as trimCharsStart } from './trimCharsStart';
|
|
247
|
+
export { default as padCharsStart } from './padCharsStart';
|
|
248
|
+
export { default as padCharsEnd } from './padCharsEnd';
|
|
249
|
+
export { default as padEnd } from './padEnd';
|
|
250
|
+
export { default as padStart } from './padStart'; // Types
|
|
251
|
+
|
|
252
|
+
export { default as Identity } from './fantasy-land/Identity';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ap as apR, curryN, pathSatisfies, both, either } from 'ramda';
|
|
2
|
+
import isFunction from '../isFunction';
|
|
3
|
+
import * as fl from '../fantasy-land/mapping';
|
|
4
|
+
var isFunctor = either(pathSatisfies(isFunction, ['map']), pathSatisfies(isFunction, [fl.map]));
|
|
5
|
+
var isApply = both(isFunctor, either(pathSatisfies(isFunction, ['ap']), pathSatisfies(isFunction, [fl.ap])));
|
|
6
|
+
var ap = curryN(2, function (applyF, applyX) {
|
|
7
|
+
// return original ramda `ap` if not Apply spec
|
|
8
|
+
if (!isApply(applyF) || !isApply(applyX)) {
|
|
9
|
+
return apR(applyF, applyX);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
try {
|
|
13
|
+
// new version of `ap` starting from ramda version > 0.23.0
|
|
14
|
+
return applyF.ap(applyX);
|
|
15
|
+
} catch (e) {
|
|
16
|
+
// old version of `ap` till ramda version <= 0.23.0
|
|
17
|
+
return applyX.ap(applyF);
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
export default ap;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
2
|
+
|
|
3
|
+
var isOfTypeObject = function isOfTypeObject(val) {
|
|
4
|
+
return _typeof(val) === 'object';
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export default isOfTypeObject;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import isArrayLike from '../isArrayLike';
|
|
2
|
+
/**
|
|
3
|
+
* `makeFlat` is a helper function that returns a one-level or fully recursive
|
|
4
|
+
* function based on the flag passed in.
|
|
5
|
+
*
|
|
6
|
+
* @func makeFlat
|
|
7
|
+
* @memberOf RA
|
|
8
|
+
*
|
|
9
|
+
* @category List
|
|
10
|
+
* @param {!bool} = should recursively flatten
|
|
11
|
+
* @param {!Array} = the nested list to be flattened
|
|
12
|
+
* @return {!Array} = the flattened list
|
|
13
|
+
* @sig Bool -> List -> List
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
var makeFlat = function makeFlat(recursive) {
|
|
18
|
+
return function flatt(list) {
|
|
19
|
+
var value;
|
|
20
|
+
var jlen;
|
|
21
|
+
var j;
|
|
22
|
+
var result = [];
|
|
23
|
+
var idx = 0;
|
|
24
|
+
|
|
25
|
+
while (idx < list.length) {
|
|
26
|
+
if (isArrayLike(list[idx])) {
|
|
27
|
+
value = recursive ? flatt(list[idx]) : list[idx];
|
|
28
|
+
j = 0;
|
|
29
|
+
jlen = value.length;
|
|
30
|
+
|
|
31
|
+
while (j < jlen) {
|
|
32
|
+
result[result.length] = value[j];
|
|
33
|
+
j += 1;
|
|
34
|
+
}
|
|
35
|
+
} else {
|
|
36
|
+
result[result.length] = list[idx];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
idx += 1;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return result;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export default makeFlat;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
+
|
|
3
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
+
|
|
5
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
+
|
|
7
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
8
|
+
|
|
9
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
10
|
+
|
|
11
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
12
|
+
|
|
13
|
+
import { bind } from 'ramda';
|
|
14
|
+
import isIterable from '../../isIterable';
|
|
15
|
+
import isNotUndefined from '../../isNotUndefined';
|
|
16
|
+
import isNotNil from '../../isNotNil';
|
|
17
|
+
import isNotFunction from '../../isNotFunction';
|
|
18
|
+
|
|
19
|
+
var copyArray = function copyArray(items, mapFn, thisArg) {
|
|
20
|
+
var boundMapFn = isNotUndefined(thisArg) ? bind(mapFn, thisArg) : mapFn;
|
|
21
|
+
return isNotUndefined(mapFn) ? _toConsumableArray(items).map(boundMapFn) : _toConsumableArray(items);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
var fromArray = function fromArray(items, mapFn, thisArg) {
|
|
25
|
+
if (items == null) {
|
|
26
|
+
throw new TypeError('Array.from requires an array-like object - not null or undefined');
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (isNotNil(mapFn) && isNotFunction(mapFn)) {
|
|
30
|
+
throw new TypeError('Array.from: when provided, the second argument must be a function');
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (isIterable(items)) {
|
|
34
|
+
return copyArray(items, mapFn, thisArg);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return [];
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export default fromArray;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import isFinite from '../../isFinite';
|
|
2
|
+
|
|
3
|
+
var truncPonyfill = function truncPonyfill(v) {
|
|
4
|
+
var numV = Number(v);
|
|
5
|
+
|
|
6
|
+
if (!isFinite(numV)) {
|
|
7
|
+
return numV;
|
|
8
|
+
} // eslint-disable-next-line no-nested-ternary
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
return numV - numV % 1 || (numV < 0 ? -0 : numV === 0 ? numV : 0);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default truncPonyfill;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { both } from 'ramda';
|
|
2
|
+
import isInteger from '../../isInteger';
|
|
3
|
+
import MAX_SAFE_INTEGER from './Number.MAX_SAFE_INTEGER';
|
|
4
|
+
var isSafeIntegerPonyfill = both(isInteger, function (value) {
|
|
5
|
+
return Math.abs(value) <= MAX_SAFE_INTEGER;
|
|
6
|
+
});
|
|
7
|
+
export default isSafeIntegerPonyfill;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
+
|
|
3
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
+
|
|
5
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
+
|
|
7
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
8
|
+
|
|
9
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
10
|
+
|
|
11
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
12
|
+
|
|
13
|
+
import { map } from 'ramda';
|
|
14
|
+
import allP from '../../allP';
|
|
15
|
+
import resolveP from '../../resolveP';
|
|
16
|
+
|
|
17
|
+
var onFulfill = function onFulfill(value) {
|
|
18
|
+
return {
|
|
19
|
+
status: 'fulfilled',
|
|
20
|
+
value: value
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
var onReject = function onReject(reason) {
|
|
25
|
+
return {
|
|
26
|
+
status: 'rejected',
|
|
27
|
+
reason: reason
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
var allSettledPonyfill = function allSettledPonyfill(iterable) {
|
|
32
|
+
var array = map(function (p) {
|
|
33
|
+
return resolveP(p).then(onFulfill)["catch"](onReject);
|
|
34
|
+
}, _toConsumableArray(iterable));
|
|
35
|
+
return allP(array);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export default allSettledPonyfill;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
2
|
+
|
|
3
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
4
|
+
|
|
5
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
+
|
|
7
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8
|
+
|
|
9
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
10
|
+
|
|
11
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
12
|
+
|
|
13
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
14
|
+
|
|
15
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
16
|
+
|
|
17
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
18
|
+
|
|
19
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
20
|
+
|
|
21
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
22
|
+
|
|
23
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
24
|
+
|
|
25
|
+
function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
|
|
26
|
+
|
|
27
|
+
function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
|
|
28
|
+
|
|
29
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
30
|
+
|
|
31
|
+
function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
|
|
32
|
+
|
|
33
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
34
|
+
|
|
35
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
36
|
+
|
|
37
|
+
import { map } from 'ramda';
|
|
38
|
+
import resolveP from '../../resolveP';
|
|
39
|
+
export var AggregatedError = /*#__PURE__*/function (_Error) {
|
|
40
|
+
_inherits(AggregatedError, _Error);
|
|
41
|
+
|
|
42
|
+
var _super = _createSuper(AggregatedError);
|
|
43
|
+
|
|
44
|
+
function AggregatedError() {
|
|
45
|
+
var _this;
|
|
46
|
+
|
|
47
|
+
var errors = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
48
|
+
var message = arguments.length > 1 ? arguments[1] : undefined;
|
|
49
|
+
|
|
50
|
+
_classCallCheck(this, AggregatedError);
|
|
51
|
+
|
|
52
|
+
_this = _super.call(this, message);
|
|
53
|
+
_this.errors = errors;
|
|
54
|
+
return _this;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return AggregatedError;
|
|
58
|
+
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
59
|
+
|
|
60
|
+
var anyPonyfill = function anyPonyfill(iterable) {
|
|
61
|
+
var exceptions = [];
|
|
62
|
+
return new Promise(function (resolve, reject) {
|
|
63
|
+
var onReject = function onReject(e) {
|
|
64
|
+
exceptions.push(e);
|
|
65
|
+
|
|
66
|
+
if (exceptions.length === iterable.length) {
|
|
67
|
+
reject(new AggregatedError(exceptions));
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
map(function (p) {
|
|
72
|
+
return resolveP(p).then(resolve)["catch"](onReject);
|
|
73
|
+
}, _toConsumableArray(iterable));
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export default anyPonyfill;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import isFunction from '../../isFunction';
|
|
2
|
+
import isNotUndefined from '../../isNotUndefined';
|
|
3
|
+
import repeat from './String.repeat';
|
|
4
|
+
|
|
5
|
+
var padEndPonyfill = function padEndPonyfill(padString, targetLength, value) {
|
|
6
|
+
// eslint-disable-next-line no-bitwise
|
|
7
|
+
var finalLength = targetLength >> 0;
|
|
8
|
+
var finalPadString = String(isNotUndefined(padString) ? padString : ' ');
|
|
9
|
+
|
|
10
|
+
if (value.length > finalLength) {
|
|
11
|
+
return String(value);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
finalLength -= value.length;
|
|
15
|
+
|
|
16
|
+
if (finalLength > finalPadString.length) {
|
|
17
|
+
var remainingLength = finalLength / finalPadString.length;
|
|
18
|
+
finalPadString += isFunction(String.prototype.repeat) ? finalPadString.repeat(remainingLength) : repeat(finalPadString, remainingLength);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return String(value) + finalPadString.slice(0, finalLength);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default padEndPonyfill;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import isFunction from '../../isFunction';
|
|
2
|
+
import isNotUndefined from '../../isNotUndefined';
|
|
3
|
+
import repeat from './String.repeat';
|
|
4
|
+
|
|
5
|
+
var padStartPonyfill = function padStartPonyfill(padString, targetLength, value) {
|
|
6
|
+
// eslint-disable-next-line no-bitwise
|
|
7
|
+
var finalLength = targetLength >> 0; // truncate if number, or convert non-number to 0;
|
|
8
|
+
|
|
9
|
+
var finalPadString = String(isNotUndefined(padString) ? padString : ' '); // return the original string, if targeted length is less than original strings length
|
|
10
|
+
|
|
11
|
+
if (value.length >= finalLength) {
|
|
12
|
+
return String(value);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
finalLength -= value.length;
|
|
16
|
+
|
|
17
|
+
if (finalLength > finalPadString.length) {
|
|
18
|
+
var lenghtToPad = finalLength / finalPadString.length; // append to original to ensure we are longer than needed
|
|
19
|
+
|
|
20
|
+
finalPadString += isFunction(String.prototype.repeat) ? finalPadString.repeat(lenghtToPad) : repeat(finalPadString, lenghtToPad);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return finalPadString.slice(0, finalLength) + String(value);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export default padStartPonyfill;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import isNotFinite from '../../isNotFinite';
|
|
2
|
+
import isNegative from '../../isNegative';
|
|
3
|
+
|
|
4
|
+
var repeat = function repeat(value, count) {
|
|
5
|
+
var validCount = Number(count);
|
|
6
|
+
|
|
7
|
+
if (validCount !== count) {
|
|
8
|
+
validCount = 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
if (isNegative(validCount)) {
|
|
12
|
+
throw new RangeError('repeat count must be non-negative');
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (isNotFinite(validCount)) {
|
|
16
|
+
throw new RangeError('repeat count must be less than infinity');
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
validCount = Math.floor(validCount);
|
|
20
|
+
|
|
21
|
+
if (value.length === 0 || validCount === 0) {
|
|
22
|
+
return '';
|
|
23
|
+
} // Ensuring validCount is a 31-bit integer allows us to heavily optimize the
|
|
24
|
+
// main part. But anyway, most current (August 2014) browsers can't handle
|
|
25
|
+
// strings 1 << 28 chars or longer, so:
|
|
26
|
+
// eslint-disable-next-line no-bitwise
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
if (value.length * validCount >= 1 << 28) {
|
|
30
|
+
throw new RangeError('repeat count must not overflow maximum string size');
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
var maxCount = value.length * validCount;
|
|
34
|
+
validCount = Math.floor(Math.log(validCount) / Math.log(2));
|
|
35
|
+
var result = value;
|
|
36
|
+
|
|
37
|
+
while (validCount) {
|
|
38
|
+
result += value;
|
|
39
|
+
validCount -= 1;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
result += result.substring(0, maxCount - result.length);
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export default repeat;
|