ramda-adjunct 3.2.0 → 3.4.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 -1
- package/CHANGELOG.md +23 -0
- package/README.md +1 -1
- package/dist/RA.node.js +165 -1571
- package/dist/RA.node.min.js +1 -1
- package/dist/RA.web.js +165 -1571
- package/dist/RA.web.min.js +1 -1
- package/dist/RA.web.standalone.js +166 -1571
- package/dist/RA.web.standalone.min.js +1 -1
- package/es/Y.js +1 -0
- package/es/allEqual.js +3 -2
- package/es/allEqualTo.js +1 -1
- package/es/allIdentical.js +1 -1
- package/es/allIdenticalTo.js +1 -1
- package/es/allP.js +1 -1
- package/es/allSettledP.js +1 -1
- package/es/allUnique.js +1 -1
- package/es/anyP.js +1 -1
- package/es/appendFlipped.js +1 -1
- package/es/argsPass.js +1 -1
- package/es/async.js +1 -5
- package/es/cata.js +1 -4
- package/es/catchP.js +1 -1
- package/es/ceil.js +1 -0
- package/es/compact.js +1 -1
- package/es/concatAll.js +1 -1
- package/es/concatRight.js +1 -1
- package/es/copyKeys.js +5 -5
- package/es/curryRight.js +1 -1
- package/es/curryRightN.js +1 -2
- package/es/defaultWhen.js +1 -1
- package/es/delayP.js +1 -3
- package/es/dispatch.js +1 -10
- package/es/divideNum.js +1 -1
- package/es/dropArgs.js +1 -1
- package/es/ensureArray.js +1 -1
- package/es/escapeRegExp.js +1 -1
- package/es/fantasy-land/Identity.js +15 -20
- package/es/fantasy-land/traits.js +4 -5
- package/es/fantasy-land/util.js +8 -4
- package/es/filterIndexed.js +1 -1
- package/es/findOr.js +1 -0
- package/es/flattenDepth.js +1 -12
- package/es/flattenPath.js +1 -1
- package/es/flattenProp.js +1 -1
- package/es/floor.js +1 -0
- package/es/fnull.js +1 -1
- package/es/inRange.js +1 -1
- package/es/included.js +1 -1
- package/es/index.js +18 -29
- package/es/internal/ap.js +0 -1
- package/es/internal/isOfTypeObject.js +0 -2
- package/es/internal/makeFlat.js +1 -6
- package/es/internal/ponyfills/Array.from.js +0 -12
- package/es/internal/ponyfills/Math.sign.js +0 -1
- package/es/internal/ponyfills/Math.trunc.js +2 -5
- package/es/internal/ponyfills/Number.isFinite.js +2 -1
- package/es/internal/ponyfills/Number.isNaN.js +2 -1
- package/es/internal/ponyfills/Promise.allSettled.js +0 -10
- package/es/internal/ponyfills/Promise.any.js +3 -31
- package/es/internal/ponyfills/String.padEnd.js +0 -6
- package/es/internal/ponyfills/String.padStart.js +4 -9
- package/es/internal/ponyfills/String.repeat.js +3 -13
- package/es/internal/ponyfills/String.replaceAll.js +0 -5
- package/es/invoke.js +1 -1
- package/es/invokeArgs.js +1 -0
- package/es/isArray.js +1 -1
- package/es/isArrayLike.js +2 -11
- package/es/isAsyncFunction.js +1 -1
- package/es/isBigInt.js +1 -1
- package/es/isBlank.js +0 -1
- package/es/isBoolean.js +1 -1
- package/es/isDate.js +1 -1
- package/es/isEmptyArray.js +1 -1
- package/es/isEmptyString.js +1 -1
- package/es/isError.js +1 -1
- package/es/isEven.js +1 -1
- package/es/isFalse.js +1 -0
- package/es/isFalsy.js +1 -1
- package/es/isFinite.js +1 -2
- package/es/isFloat.js +1 -1
- package/es/isFunction.js +1 -1
- package/es/isGeneratorFunction.js +2 -13
- package/es/isIndexed.js +1 -0
- package/es/isInteger.js +1 -1
- package/es/isInteger32.js +1 -1
- package/es/isIterable.js +1 -2
- package/es/isMap.js +1 -0
- package/es/isNaN.js +1 -2
- package/es/isNaturalNumber.js +1 -0
- package/es/isNegative.js +1 -1
- package/es/isNegativeZero.js +1 -1
- package/es/isNilOrEmpty.js +1 -1
- package/es/isNonEmptyArray.js +1 -1
- package/es/isNonEmptyString.js +1 -1
- package/es/isNonNegative.js +1 -1
- package/es/isNonPositive.js +1 -1
- package/es/isNotArray.js +1 -1
- package/es/isNotArrayLike.js +1 -1
- package/es/isNotAsyncFunction.js +1 -3
- package/es/isNotBoolean.js +1 -1
- package/es/isNotDate.js +1 -1
- package/es/isNotEmpty.js +1 -1
- package/es/isNotFinite.js +1 -1
- package/es/isNotFloat.js +1 -1
- package/es/isNotFunction.js +1 -3
- package/es/isNotGeneratorFunction.js +1 -3
- package/es/isNotInteger.js +1 -1
- package/es/isNotMap.js +1 -0
- package/es/isNotNaN.js +1 -1
- package/es/isNotNil.js +1 -1
- package/es/isNotNilOrEmpty.js +1 -1
- package/es/isNotNull.js +1 -1
- package/es/isNotNumber.js +1 -1
- package/es/isNotObj.js +1 -3
- package/es/isNotObjLike.js +1 -3
- package/es/isNotPair.js +1 -1
- package/es/isNotPlainObj.js +1 -3
- package/es/isNotPrimitive.js +2 -0
- package/es/isNotRegExp.js +1 -1
- package/es/isNotSet.js +1 -0
- package/es/isNotString.js +1 -1
- package/es/isNotUndefined.js +1 -1
- package/es/isNotValidDate.js +1 -1
- package/es/isNotValidNumber.js +1 -1
- package/es/isNull.js +1 -1
- package/es/isNumber.js +1 -1
- package/es/isObj.js +1 -3
- package/es/isObjLike.js +1 -3
- package/es/isOdd.js +1 -1
- package/es/isPair.js +1 -1
- package/es/isPlainObj.js +1 -6
- package/es/isPositive.js +1 -1
- package/es/isPositiveZero.js +1 -1
- package/es/isPrimitive.js +2 -0
- package/es/isPromise.js +1 -1
- package/es/isPrototypeOf.js +1 -1
- package/es/isRegExp.js +1 -1
- package/es/isSafeInteger.js +1 -0
- package/es/isSentinelValue.js +1 -1
- package/es/isSet.js +1 -0
- package/es/isSparseArray.js +1 -1
- package/es/isString.js +1 -1
- package/es/isSymbol.js +1 -2
- package/es/isThenable.js +1 -1
- package/es/isTrue.js +1 -0
- package/es/isTruthy.js +1 -1
- package/es/isUinteger32.js +1 -1
- package/es/isUndefined.js +1 -1
- package/es/isValidDate.js +1 -3
- package/es/isValidNumber.js +1 -1
- package/es/lastP.js +1 -9
- package/es/lengthEq.js +1 -1
- package/es/lengthGt.js +1 -1
- package/es/lengthGte.js +1 -1
- package/es/lengthLt.js +1 -1
- package/es/lengthLte.js +1 -1
- package/es/lengthNotEq.js +1 -1
- package/es/lensEq.js +1 -1
- package/es/lensIso.js +9 -8
- package/es/lensNotEq.js +1 -1
- package/es/lensNotSatisfy.js +1 -1
- package/es/lensSatisfies.js +1 -1
- package/es/lensTraverse.js +1 -1
- package/es/liftF.js +1 -1
- package/es/liftFN.js +1 -2
- package/es/list.js +1 -1
- package/es/mapIndexed.js +1 -1
- package/es/mergePath.js +1 -1
- package/es/mergePaths.js +1 -1
- package/es/mergeProp.js +1 -1
- package/es/mergeProps.js +1 -1
- package/es/move.js +1 -1
- package/es/nand.js +1 -1
- package/es/neither.js +1 -3
- package/es/noneP.js +1 -1
- package/es/nonePass.js +1 -1
- package/es/noop.js +1 -1
- package/es/nor.js +1 -1
- package/es/notAllPass.js +1 -1
- package/es/notAllUnique.js +1 -1
- package/es/notBoth.js +1 -3
- package/es/notEqual.js +1 -1
- package/es/omitBy.js +1 -3
- package/es/omitIndexes.js +3 -2
- package/es/overlaps.js +1 -1
- package/es/padCharsEnd.js +1 -1
- package/es/padCharsStart.js +1 -1
- package/es/padEnd.js +1 -1
- package/es/padStart.js +1 -1
- package/es/pathNotEq.js +1 -3
- package/es/pathOrLazy.js +1 -1
- package/es/paths.js +1 -1
- package/es/pickIndexes.js +3 -2
- package/es/propNotEq.js +1 -1
- package/es/rangeStep.js +1 -1
- package/es/reduceIndexed.js +1 -1
- package/es/reduceP.js +4 -16
- package/es/reduceRightP.js +6 -19
- package/es/rejectP.js +1 -1
- package/es/renameKeyWith.js +1 -1
- package/es/renameKeys.js +1 -4
- package/es/renameKeysWith.js +1 -1
- package/es/repeatStr.js +1 -1
- package/es/replaceAll.js +1 -1
- package/es/resolveP.js +1 -3
- package/es/round.js +1 -0
- package/es/seq.js +1 -2
- package/es/sign.js +1 -0
- package/es/skipTake.js +1 -0
- package/es/sliceFrom.js +1 -1
- package/es/sliceTo.js +1 -1
- package/es/sortByPaths.js +1 -0
- package/es/sortByProp.js +42 -0
- package/es/sortByProps.js +3 -11
- package/es/spreadPath.js +1 -1
- package/es/spreadProp.js +1 -1
- package/es/stubArray.js +1 -1
- package/es/stubNull.js +1 -1
- package/es/stubObj.js +1 -1
- package/es/stubString.js +1 -1
- package/es/stubUndefined.js +1 -1
- package/es/subtractNum.js +1 -1
- package/es/thenCatchP.js +1 -1
- package/es/toArray.js +1 -0
- package/es/toInteger32.js +0 -1
- package/es/toNumber.js +1 -1
- package/es/toUinteger32.js +2 -1
- package/es/trimCharsEnd.js +1 -0
- package/es/trimCharsStart.js +1 -0
- package/es/trimEnd.js +1 -0
- package/es/trimStart.js +1 -0
- package/es/trunc.js +1 -0
- package/es/unzipObjWith.js +1 -1
- package/es/viewOr.js +1 -0
- package/es/weave.js +1 -1
- package/es/weaveLazy.js +1 -1
- package/es/zipObjWith.js +1 -1
- package/lib/Y.js +1 -2
- package/lib/allEqual.js +0 -4
- package/lib/allEqualTo.js +0 -2
- package/lib/allIdentical.js +0 -4
- package/lib/allIdenticalTo.js +0 -2
- package/lib/allP.js +0 -2
- package/lib/allSettledP.js +1 -6
- package/lib/allUnique.js +0 -4
- package/lib/anyP.js +0 -10
- package/lib/appendFlipped.js +0 -2
- package/lib/argsPass.js +0 -5
- package/lib/async.js +0 -9
- package/lib/cata.js +0 -7
- package/lib/catchP.js +0 -2
- package/lib/ceil.js +1 -2
- package/lib/compact.js +0 -4
- package/lib/concatAll.js +1 -5
- package/lib/concatRight.js +0 -2
- package/lib/copyKeys.js +4 -8
- package/lib/curryRight.js +0 -4
- package/lib/curryRightN.js +0 -3
- package/lib/defaultWhen.js +0 -2
- package/lib/delayP.js +1 -8
- package/lib/dispatch.js +0 -15
- package/lib/divideNum.js +0 -2
- package/lib/dropArgs.js +0 -2
- package/lib/ensureArray.js +0 -4
- package/lib/escapeRegExp.js +0 -4
- package/lib/fantasy-land/Identity.js +14 -27
- package/lib/fantasy-land/traits.js +4 -28
- package/lib/fantasy-land/util.js +6 -5
- package/lib/filterIndexed.js +0 -2
- package/lib/findOr.js +1 -2
- package/lib/flattenDepth.js +1 -14
- package/lib/flattenPath.js +0 -2
- package/lib/flattenProp.js +0 -4
- package/lib/floor.js +1 -2
- package/lib/fnull.js +1 -6
- package/lib/inRange.js +1 -4
- package/lib/included.js +0 -2
- package/lib/index.js +4 -425
- package/lib/internal/ap.js +0 -9
- package/lib/internal/compareLength.js +0 -2
- package/lib/internal/isCoercible.js +0 -6
- package/lib/internal/isOfTypeObject.js +0 -3
- package/lib/internal/makeFlat.js +0 -8
- package/lib/internal/ponyfills/Array.from.js +0 -18
- package/lib/internal/ponyfills/Math.sign.js +0 -2
- package/lib/internal/ponyfills/Math.trunc.js +2 -7
- package/lib/internal/ponyfills/Number.isFinite.js +0 -4
- package/lib/internal/ponyfills/Number.isInteger.js +0 -4
- package/lib/internal/ponyfills/Number.isNaN.js +0 -4
- package/lib/internal/ponyfills/Number.isSafeInteger.js +0 -5
- package/lib/internal/ponyfills/Promise.allSettled.js +0 -14
- package/lib/internal/ponyfills/Promise.any.js +3 -36
- package/lib/internal/ponyfills/String.padEnd.js +0 -10
- package/lib/internal/ponyfills/String.padStart.js +4 -13
- package/lib/internal/ponyfills/String.repeat.js +3 -16
- package/lib/internal/ponyfills/String.replaceAll.js +0 -9
- package/lib/internal/ponyfills/String.trimEnd.js +0 -2
- package/lib/internal/ponyfills/String.trimStart.js +0 -2
- package/lib/invoke.js +0 -4
- package/lib/invokeArgs.js +1 -5
- package/lib/isArray.js +0 -4
- package/lib/isArrayLike.js +0 -16
- package/lib/isAsyncFunction.js +0 -2
- package/lib/isBigInt.js +0 -2
- package/lib/isBlank.js +0 -4
- package/lib/isBoolean.js +0 -2
- package/lib/isDate.js +0 -2
- package/lib/isEmptyArray.js +0 -4
- package/lib/isEmptyString.js +0 -2
- package/lib/isError.js +0 -2
- package/lib/isEven.js +0 -5
- package/lib/isFalse.js +1 -2
- package/lib/isFalsy.js +0 -4
- package/lib/isFinite.js +1 -8
- package/lib/isFloat.js +0 -5
- package/lib/isFunction.js +0 -5
- package/lib/isGeneratorFunction.js +1 -15
- package/lib/isIndexed.js +1 -5
- package/lib/isInteger.js +1 -6
- package/lib/isInteger32.js +0 -4
- package/lib/isIterable.js +0 -5
- package/lib/isMap.js +1 -2
- package/lib/isNaN.js +1 -8
- package/lib/isNaturalNumber.js +1 -5
- package/lib/isNegative.js +0 -4
- package/lib/isNegativeZero.js +0 -2
- package/lib/isNilOrEmpty.js +0 -2
- package/lib/isNonEmptyArray.js +0 -5
- package/lib/isNonEmptyString.js +0 -6
- package/lib/isNonNegative.js +0 -4
- package/lib/isNonPositive.js +0 -4
- package/lib/isNotArray.js +0 -4
- package/lib/isNotArrayLike.js +0 -4
- package/lib/isNotAsyncFunction.js +0 -6
- package/lib/isNotBoolean.js +0 -4
- package/lib/isNotDate.js +0 -4
- package/lib/isNotEmpty.js +0 -2
- package/lib/isNotFinite.js +0 -4
- package/lib/isNotFloat.js +0 -4
- package/lib/isNotFunction.js +0 -6
- package/lib/isNotGeneratorFunction.js +0 -6
- package/lib/isNotInteger.js +0 -4
- package/lib/isNotMap.js +1 -4
- package/lib/isNotNaN.js +0 -4
- package/lib/isNotNil.js +0 -2
- package/lib/isNotNilOrEmpty.js +0 -4
- package/lib/isNotNull.js +0 -4
- package/lib/isNotNumber.js +0 -4
- package/lib/isNotObj.js +0 -6
- package/lib/isNotObjLike.js +0 -6
- package/lib/isNotPair.js +0 -4
- package/lib/isNotPlainObj.js +0 -6
- package/lib/isNotPrimitive.js +2 -4
- package/lib/isNotRegExp.js +0 -4
- package/lib/isNotSet.js +1 -4
- package/lib/isNotString.js +0 -4
- package/lib/isNotUndefined.js +0 -4
- package/lib/isNotValidDate.js +0 -4
- package/lib/isNotValidNumber.js +0 -4
- package/lib/isNull.js +0 -2
- package/lib/isNumber.js +0 -2
- package/lib/isObj.js +0 -8
- package/lib/isObjLike.js +0 -7
- package/lib/isOdd.js +0 -4
- package/lib/isPair.js +0 -4
- package/lib/isPlainObj.js +1 -12
- package/lib/isPositive.js +0 -4
- package/lib/isPositiveZero.js +0 -2
- package/lib/isPrimitive.js +2 -11
- package/lib/isPromise.js +0 -4
- package/lib/isPrototypeOf.js +0 -4
- package/lib/isRegExp.js +0 -2
- package/lib/isSafeInteger.js +1 -6
- package/lib/isSentinelValue.js +0 -4
- package/lib/isSet.js +1 -2
- package/lib/isSparseArray.js +0 -4
- package/lib/isString.js +0 -2
- package/lib/isSymbol.js +0 -3
- package/lib/isThenable.js +0 -4
- package/lib/isTrue.js +1 -2
- package/lib/isTruthy.js +0 -2
- package/lib/isUinteger32.js +0 -4
- package/lib/isUndefined.js +0 -4
- package/lib/isValidDate.js +0 -7
- package/lib/isValidNumber.js +0 -5
- package/lib/lastP.js +0 -16
- package/lib/lengthEq.js +0 -4
- package/lib/lengthGt.js +0 -4
- package/lib/lengthGte.js +0 -4
- package/lib/lengthLt.js +0 -4
- package/lib/lengthLte.js +0 -4
- package/lib/lengthNotEq.js +0 -4
- package/lib/lensEq.js +0 -2
- package/lib/lensIso.js +6 -8
- package/lib/lensNotEq.js +0 -4
- package/lib/lensNotSatisfy.js +0 -4
- package/lib/lensSatisfies.js +0 -4
- package/lib/lensTraverse.js +0 -4
- package/lib/liftF.js +0 -4
- package/lib/liftFN.js +0 -5
- package/lib/list.js +0 -2
- package/lib/mapIndexed.js +0 -2
- package/lib/mergePath.js +0 -2
- package/lib/mergePaths.js +0 -4
- package/lib/mergeProp.js +0 -4
- package/lib/mergeProps.js +0 -2
- package/lib/move.js +0 -2
- package/lib/nand.js +0 -3
- package/lib/neither.js +0 -4
- package/lib/noneP.js +0 -6
- package/lib/nonePass.js +0 -2
- package/lib/noop.js +0 -4
- package/lib/nor.js +0 -3
- package/lib/notAllPass.js +0 -2
- package/lib/notAllUnique.js +0 -4
- package/lib/notBoth.js +0 -4
- package/lib/notEqual.js +0 -2
- package/lib/omitBy.js +0 -4
- package/lib/omitIndexes.js +1 -3
- package/lib/overlaps.js +1 -5
- package/lib/padCharsEnd.js +1 -6
- package/lib/padCharsStart.js +1 -6
- package/lib/padEnd.js +0 -3
- package/lib/padStart.js +0 -3
- package/lib/pathNotEq.js +0 -4
- package/lib/pathOrLazy.js +0 -2
- package/lib/paths.js +0 -2
- package/lib/pickIndexes.js +1 -3
- package/lib/propNotEq.js +0 -2
- package/lib/rangeStep.js +0 -4
- package/lib/reduceIndexed.js +0 -2
- package/lib/reduceP.js +3 -21
- package/lib/reduceRightP.js +4 -24
- package/lib/rejectP.js +0 -2
- package/lib/renameKeyWith.js +0 -4
- package/lib/renameKeys.js +1 -7
- package/lib/renameKeysWith.js +0 -2
- package/lib/repeatStr.js +1 -6
- package/lib/replaceAll.js +1 -6
- package/lib/resolveP.js +0 -4
- package/lib/round.js +1 -2
- package/lib/seq.js +1 -4
- package/lib/sign.js +1 -6
- package/lib/skipTake.js +1 -2
- package/lib/sliceFrom.js +0 -2
- package/lib/sliceTo.js +0 -2
- package/lib/sortByPaths.js +1 -2
- package/lib/sortByProp.js +47 -0
- package/lib/sortByProps.js +3 -13
- package/lib/spreadPath.js +0 -2
- package/lib/spreadProp.js +0 -4
- package/lib/stubArray.js +1 -2
- package/lib/stubNull.js +0 -2
- package/lib/stubObj.js +1 -2
- package/lib/stubString.js +0 -2
- package/lib/stubUndefined.js +0 -3
- package/lib/subtractNum.js +0 -2
- package/lib/thenCatchP.js +0 -2
- package/lib/toArray.js +1 -6
- package/lib/toInteger32.js +0 -2
- package/lib/toNumber.js +0 -4
- package/lib/toUinteger32.js +1 -2
- package/lib/trimCharsEnd.js +1 -4
- package/lib/trimCharsStart.js +1 -4
- package/lib/trimEnd.js +1 -6
- package/lib/trimStart.js +1 -6
- package/lib/trunc.js +1 -6
- package/lib/unzipObjWith.js +0 -4
- package/lib/viewOr.js +1 -2
- package/lib/weave.js +0 -2
- package/lib/weaveLazy.js +0 -2
- package/lib/zipObjWith.js +0 -2
- package/package.json +34 -32
- package/src/index.js +1 -0
- package/src/isGeneratorFunction.js +2 -19
- package/src/isNotPrimitive.js +1 -0
- package/src/isPrimitive.js +1 -0
- package/src/sortByProp.js +45 -0
- package/src/sortByProps.js +1 -1
- package/types/.eslintrc.js +23 -0
- package/types/dtslint.eslint.js +13 -0
- package/types/index.d.ts +1792 -1551
package/lib/async.js
CHANGED
|
@@ -2,15 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports["default"] = void 0;
|
|
5
|
-
|
|
6
5
|
var _ramda = require("ramda");
|
|
7
|
-
|
|
8
6
|
var _resolveP = _interopRequireDefault(require("./resolveP"));
|
|
9
|
-
|
|
10
7
|
var _rejectP = _interopRequireDefault(require("./rejectP"));
|
|
11
|
-
|
|
12
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
-
|
|
14
9
|
/**
|
|
15
10
|
* Takes a generator function and returns an async function.
|
|
16
11
|
* The async function returned is a curried function whose arity matches that of the generator function.
|
|
@@ -40,7 +35,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
40
35
|
var async = (0, _ramda.curryN)(1, function (generatorFn) {
|
|
41
36
|
function asyncWrapper() {
|
|
42
37
|
var iterator = (0, _ramda.bind)(generatorFn, this).apply(void 0, arguments);
|
|
43
|
-
|
|
44
38
|
var handle = function handle(result) {
|
|
45
39
|
var resolved = (0, _resolveP["default"])(result.value);
|
|
46
40
|
return result.done ? resolved : resolved.then(function (value) {
|
|
@@ -49,18 +43,15 @@ var async = (0, _ramda.curryN)(1, function (generatorFn) {
|
|
|
49
43
|
return handle(iterator["throw"](error));
|
|
50
44
|
});
|
|
51
45
|
};
|
|
52
|
-
|
|
53
46
|
try {
|
|
54
47
|
return handle(iterator.next());
|
|
55
48
|
} catch (error) {
|
|
56
49
|
return (0, _rejectP["default"])(error);
|
|
57
50
|
}
|
|
58
51
|
}
|
|
59
|
-
|
|
60
52
|
if (generatorFn.length > 0) {
|
|
61
53
|
return (0, _ramda.curryN)(generatorFn.length, asyncWrapper);
|
|
62
54
|
}
|
|
63
|
-
|
|
64
55
|
return asyncWrapper;
|
|
65
56
|
});
|
|
66
57
|
var _default = async;
|
package/lib/cata.js
CHANGED
|
@@ -2,13 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports["default"] = void 0;
|
|
5
|
-
|
|
6
5
|
var _ramda = require("ramda");
|
|
7
|
-
|
|
8
6
|
var _isFunction = _interopRequireDefault(require("./isFunction"));
|
|
9
|
-
|
|
10
7
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
-
|
|
12
8
|
/**
|
|
13
9
|
* The catamorphism is a way of folding a type into a value.
|
|
14
10
|
*
|
|
@@ -93,17 +89,14 @@ var catamorphism = (0, _ramda.curry)(function (leftFn, rightFn, catamorphicObj)
|
|
|
93
89
|
}
|
|
94
90
|
});
|
|
95
91
|
}
|
|
96
|
-
|
|
97
92
|
if ((0, _isFunction["default"])(catamorphicObj.cata)) {
|
|
98
93
|
return catamorphicObj.cata(leftFn, rightFn);
|
|
99
94
|
}
|
|
100
|
-
|
|
101
95
|
if ((0, _isFunction["default"])(catamorphicObj.getOrElse)) {
|
|
102
96
|
var elseValue = "RA.cata".concat(Math.random());
|
|
103
97
|
var value = catamorphicObj.getOrElse(elseValue);
|
|
104
98
|
return value === elseValue ? leftFn() : rightFn(value);
|
|
105
99
|
}
|
|
106
|
-
|
|
107
100
|
return catamorphicObj.either(leftFn, rightFn);
|
|
108
101
|
});
|
|
109
102
|
var _default = catamorphism;
|
package/lib/catchP.js
CHANGED
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports["default"] = void 0;
|
|
5
|
-
|
|
6
5
|
var _ramda = require("ramda");
|
|
7
|
-
|
|
8
6
|
/**
|
|
9
7
|
* Composable shortcut for `Promise.catch`.
|
|
10
8
|
* The catchP function returns a Promise. It takes two arguments: a callback function for the failure of the Promise
|
package/lib/ceil.js
CHANGED
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports["default"] = void 0;
|
|
5
|
-
|
|
6
5
|
var _ramda = require("ramda");
|
|
7
|
-
|
|
8
6
|
/**
|
|
9
7
|
* Returns the smallest integer greater than or equal to a given number.
|
|
10
8
|
*
|
|
@@ -27,6 +25,7 @@ var _ramda = require("ramda");
|
|
|
27
25
|
* RA.ceil(-7.004); //=> -7
|
|
28
26
|
* RA.ceil(null); //=> 0
|
|
29
27
|
*/
|
|
28
|
+
|
|
30
29
|
var ceil = (0, _ramda.curryN)(1, (0, _ramda.bind)(Math.ceil, Math));
|
|
31
30
|
var _default = ceil;
|
|
32
31
|
exports["default"] = _default;
|
package/lib/compact.js
CHANGED
|
@@ -2,13 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports["default"] = void 0;
|
|
5
|
-
|
|
6
5
|
var _ramda = require("ramda");
|
|
7
|
-
|
|
8
6
|
var _isFalsy = _interopRequireDefault(require("./isFalsy"));
|
|
9
|
-
|
|
10
7
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
-
|
|
12
8
|
/**
|
|
13
9
|
* Creates an array with all falsy values removed.
|
|
14
10
|
* The values false, null, 0, "", undefined, and NaN are falsy.
|
package/lib/concatAll.js
CHANGED
|
@@ -2,16 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports["default"] = void 0;
|
|
5
|
-
|
|
6
5
|
var _ramda = require("ramda");
|
|
7
|
-
|
|
8
6
|
var _stubUndefined = _interopRequireDefault(require("./stubUndefined"));
|
|
9
|
-
|
|
10
7
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
-
|
|
12
8
|
var leftIdentitySemigroup = {
|
|
13
9
|
concat: _ramda.identity
|
|
14
10
|
};
|
|
11
|
+
|
|
15
12
|
/**
|
|
16
13
|
* Returns the result of concatenating the given lists or strings.
|
|
17
14
|
* 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.
|
|
@@ -34,7 +31,6 @@ var leftIdentitySemigroup = {
|
|
|
34
31
|
* concatAll(['1', '2', '3']); //=> '123'
|
|
35
32
|
* concatAll([]); //=> undefined;
|
|
36
33
|
*/
|
|
37
|
-
|
|
38
34
|
var concatAll = (0, _ramda.pipe)((0, _ramda.reduce)(_ramda.concat, leftIdentitySemigroup), (0, _ramda.when)((0, _ramda.identical)(leftIdentitySemigroup), _stubUndefined["default"]));
|
|
39
35
|
var _default = concatAll;
|
|
40
36
|
exports["default"] = _default;
|
package/lib/concatRight.js
CHANGED
package/lib/copyKeys.js
CHANGED
|
@@ -2,19 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports["default"] = void 0;
|
|
5
|
-
|
|
6
5
|
var _ramda = require("ramda");
|
|
7
|
-
|
|
8
6
|
var _renameKeys = _interopRequireDefault(require("./renameKeys"));
|
|
9
|
-
|
|
10
7
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
-
|
|
8
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
12
9
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
13
|
-
|
|
14
10
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
15
|
-
|
|
16
|
-
function
|
|
17
|
-
|
|
11
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
13
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
18
14
|
/**
|
|
19
15
|
* Creates a new object with the own properties of the provided object, and the
|
|
20
16
|
* keys copied according to the keysMap object as `{oldKey: newKey}`.
|
package/lib/curryRight.js
CHANGED
|
@@ -2,13 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports["default"] = void 0;
|
|
5
|
-
|
|
6
5
|
var _ramda = require("ramda");
|
|
7
|
-
|
|
8
6
|
var _curryRightN = _interopRequireDefault(require("./curryRightN"));
|
|
9
|
-
|
|
10
7
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
-
|
|
12
8
|
/**
|
|
13
9
|
* Returns a curried equivalent of the provided function.
|
|
14
10
|
* This function is like curry, except that the provided arguments order is reversed.
|
package/lib/curryRightN.js
CHANGED
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports["default"] = void 0;
|
|
5
|
-
|
|
6
5
|
var _ramda = require("ramda");
|
|
7
|
-
|
|
8
6
|
/**
|
|
9
7
|
* Returns a curried equivalent of the provided function, with the specified arity.
|
|
10
8
|
* This function is like curryN, except that the provided arguments order is reversed.
|
|
@@ -30,7 +28,6 @@ var curryRightN = (0, _ramda.curryN)(2, function (arity, fn) {
|
|
|
30
28
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
31
29
|
args[_key] = arguments[_key];
|
|
32
30
|
}
|
|
33
|
-
|
|
34
31
|
return fn.apply(this, (0, _ramda.reverse)(args));
|
|
35
32
|
});
|
|
36
33
|
});
|
package/lib/defaultWhen.js
CHANGED
package/lib/delayP.js
CHANGED
|
@@ -2,15 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports["default"] = void 0;
|
|
5
|
-
|
|
6
5
|
var _ramda = require("ramda");
|
|
7
|
-
|
|
8
6
|
var _isNonNegative = _interopRequireDefault(require("./isNonNegative"));
|
|
9
|
-
|
|
10
7
|
var _isInteger = _interopRequireDefault(require("./isInteger"));
|
|
11
|
-
|
|
12
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
-
|
|
14
9
|
/**
|
|
15
10
|
* Creates a promise which resolves/rejects after the specified milliseconds.
|
|
16
11
|
*
|
|
@@ -28,22 +23,20 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
28
23
|
* RA.delayP.reject(100); //=> Promise(undefined)
|
|
29
24
|
* RA.delayP.reject({ timeout: 100, value: new Error('error') }); //=> Promise(Error('error'))
|
|
30
25
|
*/
|
|
26
|
+
|
|
31
27
|
var makeDelay = (0, _ramda.curry)(function (settleFnPicker, opts) {
|
|
32
28
|
var timeout;
|
|
33
29
|
var value;
|
|
34
|
-
|
|
35
30
|
if ((0, _isInteger["default"])(opts) && (0, _isNonNegative["default"])(opts)) {
|
|
36
31
|
timeout = opts;
|
|
37
32
|
} else {
|
|
38
33
|
timeout = (0, _ramda.propOr)(0, 'timeout', opts);
|
|
39
34
|
value = (0, _ramda.propOr)(value, 'value', opts);
|
|
40
35
|
}
|
|
41
|
-
|
|
42
36
|
return new Promise(function () {
|
|
43
37
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
44
38
|
args[_key] = arguments[_key];
|
|
45
39
|
}
|
|
46
|
-
|
|
47
40
|
var settleFn = settleFnPicker(args);
|
|
48
41
|
setTimeout((0, _ramda.partial)(settleFn, [value]), timeout);
|
|
49
42
|
});
|
package/lib/dispatch.js
CHANGED
|
@@ -2,29 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports["default"] = void 0;
|
|
5
|
-
|
|
6
5
|
var _ramda = require("ramda");
|
|
7
|
-
|
|
8
6
|
var _isNotNil = _interopRequireDefault(require("./isNotNil"));
|
|
9
|
-
|
|
10
7
|
var _isNonEmptyArray = _interopRequireDefault(require("./isNonEmptyArray"));
|
|
11
|
-
|
|
12
8
|
var _stubUndefined = _interopRequireDefault(require("./stubUndefined"));
|
|
13
|
-
|
|
14
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
-
|
|
16
10
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
17
|
-
|
|
18
11
|
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."); }
|
|
19
|
-
|
|
20
12
|
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); }
|
|
21
|
-
|
|
22
13
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
23
|
-
|
|
24
14
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
25
|
-
|
|
26
15
|
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; }
|
|
27
|
-
|
|
28
16
|
var byArity = (0, _ramda.comparator)(function (a, b) {
|
|
29
17
|
return a.length > b.length;
|
|
30
18
|
});
|
|
@@ -33,18 +21,15 @@ var iteratorFn = (0, _ramda.curry)(function (args, accumulator, fn) {
|
|
|
33
21
|
var result = fn.apply(void 0, _toConsumableArray(args));
|
|
34
22
|
return (0, _isNotNil["default"])(result) ? (0, _ramda.reduced)(result) : accumulator;
|
|
35
23
|
});
|
|
36
|
-
|
|
37
24
|
var dispatchImpl = function dispatchImpl(functions) {
|
|
38
25
|
var arity = getMaxArity(functions);
|
|
39
26
|
return (0, _ramda.curryN)(arity, function () {
|
|
40
27
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
41
28
|
args[_key] = arguments[_key];
|
|
42
29
|
}
|
|
43
|
-
|
|
44
30
|
return (0, _ramda.reduce)(iteratorFn(args), undefined, functions);
|
|
45
31
|
});
|
|
46
32
|
};
|
|
47
|
-
|
|
48
33
|
var dispatch = (0, _ramda.ifElse)(_isNonEmptyArray["default"], dispatchImpl, _stubUndefined["default"]);
|
|
49
34
|
var _default = dispatch;
|
|
50
35
|
exports["default"] = _default;
|
package/lib/divideNum.js
CHANGED
package/lib/dropArgs.js
CHANGED
package/lib/ensureArray.js
CHANGED
|
@@ -2,13 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports["default"] = void 0;
|
|
5
|
-
|
|
6
5
|
var _ramda = require("ramda");
|
|
7
|
-
|
|
8
6
|
var _isNotArray = _interopRequireDefault(require("./isNotArray"));
|
|
9
|
-
|
|
10
7
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
-
|
|
12
8
|
/**
|
|
13
9
|
* Returns a singleton array containing the value provided.
|
|
14
10
|
* If value is already an array, it is returned as is.
|
package/lib/escapeRegExp.js
CHANGED
|
@@ -2,13 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports["default"] = void 0;
|
|
5
|
-
|
|
6
5
|
var _ramda = require("ramda");
|
|
7
|
-
|
|
8
6
|
var _isString = _interopRequireDefault(require("./isString"));
|
|
9
|
-
|
|
10
7
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
-
|
|
12
8
|
/**
|
|
13
9
|
* Escapes the RegExp special characters.
|
|
14
10
|
*
|
|
@@ -1,26 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
3
|
exports.__esModule = true;
|
|
6
4
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
5
|
var _ramda = require("ramda");
|
|
9
|
-
|
|
10
6
|
var fl = _interopRequireWildcard(require("./mapping"));
|
|
11
|
-
|
|
12
7
|
var _traits = require("./traits");
|
|
13
|
-
|
|
14
8
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
-
|
|
16
9
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
-
|
|
10
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
18
11
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
19
|
-
|
|
20
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
21
|
-
|
|
12
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
22
13
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
23
|
-
|
|
14
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
15
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
24
16
|
/**
|
|
25
17
|
* The simplest {@link https://github.com/fantasyland/fantasy-land|fantasy-land}
|
|
26
18
|
* compatible monad which attaches no information to values.
|
|
@@ -53,9 +45,9 @@ var Identity = /*#__PURE__*/function (_fl$of, _fl$ap, _fl$map, _fl$equals, _fl$c
|
|
|
53
45
|
*/
|
|
54
46
|
function Identity(value) {
|
|
55
47
|
_classCallCheck(this, Identity);
|
|
56
|
-
|
|
57
48
|
this.value = value;
|
|
58
49
|
}
|
|
50
|
+
|
|
59
51
|
/**
|
|
60
52
|
* Catamorphism for a value.
|
|
61
53
|
* @returns {*}
|
|
@@ -64,13 +56,12 @@ var Identity = /*#__PURE__*/function (_fl$of, _fl$ap, _fl$map, _fl$equals, _fl$c
|
|
|
64
56
|
* const a = Identity.of(1);
|
|
65
57
|
* a.get(); //=> 1
|
|
66
58
|
*/
|
|
67
|
-
|
|
68
|
-
|
|
69
59
|
_createClass(Identity, [{
|
|
70
60
|
key: "get",
|
|
71
61
|
value: function get() {
|
|
72
62
|
return this.value;
|
|
73
63
|
}
|
|
64
|
+
|
|
74
65
|
/**
|
|
75
66
|
* Fantasy land {@link https://github.com/fantasyland/fantasy-land#apply|Apply} specification.
|
|
76
67
|
*
|
|
@@ -84,7 +75,6 @@ var Identity = /*#__PURE__*/function (_fl$of, _fl$ap, _fl$map, _fl$equals, _fl$c
|
|
|
84
75
|
*
|
|
85
76
|
* a.ap(b); //=> Identity(2)
|
|
86
77
|
*/
|
|
87
|
-
|
|
88
78
|
}, {
|
|
89
79
|
key: _fl$ap,
|
|
90
80
|
value: function value(applyWithFn) {
|
|
@@ -95,6 +85,7 @@ var Identity = /*#__PURE__*/function (_fl$of, _fl$ap, _fl$map, _fl$equals, _fl$c
|
|
|
95
85
|
value: function ap(applyWithFn) {
|
|
96
86
|
return this[fl.ap](applyWithFn);
|
|
97
87
|
}
|
|
88
|
+
|
|
98
89
|
/**
|
|
99
90
|
* Fantasy land {@link https://github.com/fantasyland/fantasy-land#functor|Functor} specification.
|
|
100
91
|
*
|
|
@@ -106,7 +97,6 @@ var Identity = /*#__PURE__*/function (_fl$of, _fl$ap, _fl$map, _fl$equals, _fl$c
|
|
|
106
97
|
* const a = Identity.of(1);
|
|
107
98
|
* a.map(a => a + 1); //=> Identity(2)
|
|
108
99
|
*/
|
|
109
|
-
|
|
110
100
|
}, {
|
|
111
101
|
key: _fl$map,
|
|
112
102
|
value: function value(fn) {
|
|
@@ -117,6 +107,7 @@ var Identity = /*#__PURE__*/function (_fl$of, _fl$ap, _fl$map, _fl$equals, _fl$c
|
|
|
117
107
|
value: function map(fn) {
|
|
118
108
|
return this[fl.map](fn);
|
|
119
109
|
}
|
|
110
|
+
|
|
120
111
|
/**
|
|
121
112
|
* Fantasy land {@link https://github.com/fantasyland/fantasy-land#setoid|Setoid} specification.
|
|
122
113
|
*
|
|
@@ -132,7 +123,6 @@ var Identity = /*#__PURE__*/function (_fl$of, _fl$ap, _fl$map, _fl$equals, _fl$c
|
|
|
132
123
|
* a.equals(b); //=> true
|
|
133
124
|
* a.equals(c); //=> false
|
|
134
125
|
*/
|
|
135
|
-
|
|
136
126
|
}, {
|
|
137
127
|
key: _fl$equals,
|
|
138
128
|
value: function value(setoid) {
|
|
@@ -143,6 +133,7 @@ var Identity = /*#__PURE__*/function (_fl$of, _fl$ap, _fl$map, _fl$equals, _fl$c
|
|
|
143
133
|
value: function equals(setoid) {
|
|
144
134
|
return this[fl.equals](setoid);
|
|
145
135
|
}
|
|
136
|
+
|
|
146
137
|
/**
|
|
147
138
|
* Fantasy land {@link https://github.com/fantasyland/fantasy-land#semigroup|Semigroup} specification.
|
|
148
139
|
*
|
|
@@ -163,7 +154,6 @@ var Identity = /*#__PURE__*/function (_fl$of, _fl$ap, _fl$map, _fl$equals, _fl$c
|
|
|
163
154
|
* const f = Identity.of(['f']);
|
|
164
155
|
* e.concat(f); //=> ['e', 'f']
|
|
165
156
|
*/
|
|
166
|
-
|
|
167
157
|
}, {
|
|
168
158
|
key: _fl$concat,
|
|
169
159
|
value: function value(semigroup) {
|
|
@@ -174,6 +164,7 @@ var Identity = /*#__PURE__*/function (_fl$of, _fl$ap, _fl$map, _fl$equals, _fl$c
|
|
|
174
164
|
value: function concat(semigroup) {
|
|
175
165
|
return this[fl.concat](semigroup);
|
|
176
166
|
}
|
|
167
|
+
|
|
177
168
|
/**
|
|
178
169
|
* Fantasy land {@link https://github.com/fantasyland/fantasy-land#chain|Chain} specification.
|
|
179
170
|
*
|
|
@@ -187,7 +178,6 @@ var Identity = /*#__PURE__*/function (_fl$of, _fl$ap, _fl$map, _fl$equals, _fl$c
|
|
|
187
178
|
*
|
|
188
179
|
* a.chain(fn).chain(fn); //=> Identity(3)
|
|
189
180
|
*/
|
|
190
|
-
|
|
191
181
|
}, {
|
|
192
182
|
key: _fl$chain,
|
|
193
183
|
value: function value(fn) {
|
|
@@ -198,6 +188,7 @@ var Identity = /*#__PURE__*/function (_fl$of, _fl$ap, _fl$map, _fl$equals, _fl$c
|
|
|
198
188
|
value: function chain(fn) {
|
|
199
189
|
return this[fl.chain](fn);
|
|
200
190
|
}
|
|
191
|
+
|
|
201
192
|
/**
|
|
202
193
|
* Fantasy land {@link https://github.com/fantasyland/fantasy-land#ord|Ord} specification.
|
|
203
194
|
*
|
|
@@ -214,7 +205,6 @@ var Identity = /*#__PURE__*/function (_fl$of, _fl$ap, _fl$map, _fl$equals, _fl$c
|
|
|
214
205
|
* a.lte(c); //=> true
|
|
215
206
|
* c.lte(a); //=> false
|
|
216
207
|
*/
|
|
217
|
-
|
|
218
208
|
}, {
|
|
219
209
|
key: _fl$lte,
|
|
220
210
|
value: function value(ord) {
|
|
@@ -225,6 +215,7 @@ var Identity = /*#__PURE__*/function (_fl$of, _fl$ap, _fl$map, _fl$equals, _fl$c
|
|
|
225
215
|
value: function lte(ord) {
|
|
226
216
|
return this[fl.lte](ord);
|
|
227
217
|
}
|
|
218
|
+
|
|
228
219
|
/**
|
|
229
220
|
* Fantasy land {@link https://github.com/fantasyland/fantasy-land#monoid|Monoid*} specification.
|
|
230
221
|
* Partial implementation of Monoid specification. `empty` method on instance only, returning
|
|
@@ -241,7 +232,6 @@ var Identity = /*#__PURE__*/function (_fl$of, _fl$ap, _fl$map, _fl$equals, _fl$c
|
|
|
241
232
|
* a.concat(i); //=> Identity('string');
|
|
242
233
|
* i.concat(a); //=> Identity('string');
|
|
243
234
|
*/
|
|
244
|
-
|
|
245
235
|
}, {
|
|
246
236
|
key: _fl$empty,
|
|
247
237
|
value: function value() {
|
|
@@ -252,6 +242,7 @@ var Identity = /*#__PURE__*/function (_fl$of, _fl$ap, _fl$map, _fl$equals, _fl$c
|
|
|
252
242
|
value: function empty() {
|
|
253
243
|
return this[fl.empty]();
|
|
254
244
|
}
|
|
245
|
+
|
|
255
246
|
/**
|
|
256
247
|
* Fantasy land {@link https://github.com/fantasyland/fantasy-land#contravariant|Contravariant} specification.
|
|
257
248
|
*
|
|
@@ -268,12 +259,10 @@ var Identity = /*#__PURE__*/function (_fl$of, _fl$ap, _fl$map, _fl$equals, _fl$c
|
|
|
268
259
|
* Identity.of(identity).contramap(divide2).contramap(add1).get()(3); //=> 2
|
|
269
260
|
* Identity.of(identity).contramap(a => divide2(add1(a))).get()(3); //=> 2
|
|
270
261
|
*/
|
|
271
|
-
|
|
272
262
|
}, {
|
|
273
263
|
key: _fl$contramap,
|
|
274
264
|
value: function value(fn) {
|
|
275
265
|
var _this = this;
|
|
276
|
-
|
|
277
266
|
return this.constructor.of(function (value) {
|
|
278
267
|
return _this.value(fn(value));
|
|
279
268
|
});
|
|
@@ -305,19 +294,17 @@ var Identity = /*#__PURE__*/function (_fl$of, _fl$ap, _fl$map, _fl$equals, _fl$c
|
|
|
305
294
|
value: function of(value) {
|
|
306
295
|
return new Identity(value);
|
|
307
296
|
}
|
|
297
|
+
|
|
308
298
|
/**
|
|
309
299
|
* @static
|
|
310
300
|
*/
|
|
311
|
-
|
|
312
301
|
}, {
|
|
313
302
|
key: '@@type',
|
|
314
303
|
get: function get() {
|
|
315
304
|
return 'RA/Identity';
|
|
316
305
|
}
|
|
317
306
|
}]);
|
|
318
|
-
|
|
319
307
|
return Identity;
|
|
320
308
|
}(fl.of, fl.ap, fl.map, fl.equals, fl.concat, fl.chain, fl.lte, fl.empty, fl.contramap);
|
|
321
|
-
|
|
322
309
|
var _default = Identity;
|
|
323
310
|
exports["default"] = _default;
|
|
@@ -1,55 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
3
|
exports.__esModule = true;
|
|
6
4
|
exports.setoidTrait = exports.semigroupTrait = exports.ordTrait = exports.functorTrait = exports.chainTrait = exports.applyTrait = void 0;
|
|
7
|
-
|
|
8
5
|
var _ramda = require("ramda");
|
|
9
|
-
|
|
10
6
|
var _isString = _interopRequireDefault(require("../isString"));
|
|
11
|
-
|
|
12
7
|
var _isNumber = _interopRequireDefault(require("../isNumber"));
|
|
13
|
-
|
|
14
8
|
var _isFunction = _interopRequireDefault(require("../isFunction"));
|
|
15
|
-
|
|
16
9
|
var _util = require("./util");
|
|
17
|
-
|
|
18
10
|
var fl = _interopRequireWildcard(require("./mapping"));
|
|
19
|
-
|
|
20
11
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
-
|
|
22
12
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
-
|
|
24
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
|
-
|
|
26
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
27
|
-
|
|
14
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
15
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
16
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
17
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
28
18
|
var functorTrait = _defineProperty({}, fl.map, function (fn) {
|
|
29
19
|
return this.constructor[fl.of](fn(this.value));
|
|
30
20
|
});
|
|
31
|
-
|
|
32
21
|
exports.functorTrait = functorTrait;
|
|
33
|
-
|
|
34
22
|
var applyTrait = _defineProperty({}, fl.ap, function (applyWithFn) {
|
|
35
23
|
var _this = this;
|
|
36
|
-
|
|
37
24
|
return applyWithFn.map(function (fn) {
|
|
38
25
|
return fn(_this.value);
|
|
39
26
|
});
|
|
40
27
|
});
|
|
41
|
-
|
|
42
28
|
exports.applyTrait = applyTrait;
|
|
43
|
-
|
|
44
29
|
var setoidTrait = _defineProperty({}, fl.equals, function (setoid) {
|
|
45
30
|
return (0, _util.isSameType)(this, setoid) && (0, _ramda.equals)(this.value, setoid.value);
|
|
46
31
|
});
|
|
47
|
-
|
|
48
32
|
exports.setoidTrait = setoidTrait;
|
|
49
|
-
|
|
50
33
|
var semigroupTrait = _defineProperty({}, fl.concat, function (semigroup) {
|
|
51
34
|
var concatenatedValue = this.value;
|
|
52
|
-
|
|
53
35
|
if ((0, _isString["default"])(this.value) || (0, _isNumber["default"])(this.value)) {
|
|
54
36
|
concatenatedValue = this.value + semigroup.value;
|
|
55
37
|
} else if ((0, _ramda.pathSatisfies)(_isFunction["default"], ['value', fl.concat], this)) {
|
|
@@ -57,21 +39,15 @@ var semigroupTrait = _defineProperty({}, fl.concat, function (semigroup) {
|
|
|
57
39
|
} else if ((0, _ramda.pathSatisfies)(_isFunction["default"], ['value', 'concat'], this)) {
|
|
58
40
|
concatenatedValue = this.value.concat(semigroup.value);
|
|
59
41
|
}
|
|
60
|
-
|
|
61
42
|
return this.constructor[fl.of](concatenatedValue);
|
|
62
43
|
});
|
|
63
|
-
|
|
64
44
|
exports.semigroupTrait = semigroupTrait;
|
|
65
|
-
|
|
66
45
|
var chainTrait = _defineProperty({}, fl.chain, function (fn) {
|
|
67
46
|
var newChain = fn(this.value);
|
|
68
47
|
return (0, _util.isSameType)(this, newChain) ? newChain : this;
|
|
69
48
|
});
|
|
70
|
-
|
|
71
49
|
exports.chainTrait = chainTrait;
|
|
72
|
-
|
|
73
50
|
var ordTrait = _defineProperty({}, fl.lte, function (ord) {
|
|
74
51
|
return (0, _util.isSameType)(this, ord) && (this.value < ord.value || this[fl.equals](ord));
|
|
75
52
|
});
|
|
76
|
-
|
|
77
53
|
exports.ordTrait = ordTrait;
|