ramda-adjunct 3.3.0 → 4.0.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/CHANGELOG.md +28 -0
- package/README.md +2 -2
- package/dist/RA.node.js +235 -1605
- package/dist/RA.node.min.js +1 -1
- package/dist/RA.web.js +235 -1605
- package/dist/RA.web.min.js +1 -1
- package/dist/RA.web.standalone.js +1356 -2116
- 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 +3 -2
- 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 +2 -11
- package/es/divideNum.js +1 -1
- package/es/dropArgs.js +1 -1
- package/es/ensureArray.js +2 -2
- 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 +2 -13
- package/es/flattenPath.js +1 -1
- package/es/flattenProp.js +2 -2
- 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 +1 -13
- 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 +1 -11
- package/es/internal/ponyfills/Promise.any.js +4 -32
- 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 +3 -2
- 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 +3 -3
- 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 +1 -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 +3 -3
- package/es/isPrimitive.js +1 -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 +3 -2
- 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 +2 -10
- 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 +13 -4
- 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 +2 -2
- 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 +5 -7
- package/es/pathOrLazy.js +1 -1
- package/es/paths.js +1 -1
- package/es/pickIndexes.js +3 -2
- package/es/propNotEq.js +4 -4
- package/es/rangeStep.js +1 -1
- package/es/reduceIndexed.js +1 -1
- package/es/reduceP.js +5 -17
- package/es/reduceRightP.js +7 -20
- 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 +4 -12
- package/es/spreadPath.js +1 -1
- package/es/spreadProp.js +2 -2
- 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 -5
- 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 +3 -6
- 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 +36 -16
- package/lib/divideNum.js +0 -2
- package/lib/dropArgs.js +0 -2
- package/lib/ensureArray.js +1 -5
- 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 +2 -15
- package/lib/flattenPath.js +0 -2
- package/lib/flattenProp.js +1 -5
- 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 +1 -19
- 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 +1 -15
- package/lib/internal/ponyfills/Promise.any.js +4 -37
- 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 +2 -3
- 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 +1 -3
- 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 +1 -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 +1 -3
- package/lib/isPrimitive.js +1 -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 +1 -6
- 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 +2 -3
- 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 +1 -17
- 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 +11 -7
- 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 +1 -5
- 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 +4 -8
- package/lib/pathOrLazy.js +0 -2
- package/lib/paths.js +0 -2
- package/lib/pickIndexes.js +1 -3
- package/lib/propNotEq.js +3 -5
- package/lib/rangeStep.js +0 -4
- package/lib/reduceIndexed.js +0 -2
- package/lib/reduceP.js +4 -22
- package/lib/reduceRightP.js +5 -25
- 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 +0 -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 +4 -14
- package/lib/spreadPath.js +0 -2
- package/lib/spreadProp.js +1 -5
- 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 +1 -4
- package/lib/toNumber.js +0 -4
- package/lib/toUinteger32.js +1 -4
- 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 +41 -39
- package/src/concatAll.js +2 -1
- package/src/ensureArray.js +1 -1
- package/src/flattenProp.js +1 -1
- package/src/index.js +1 -0
- package/src/isFalse.js +2 -2
- package/src/isGeneratorFunction.js +2 -19
- package/src/isNegativeZero.js +2 -2
- package/src/isPositiveZero.js +2 -2
- package/src/isTrue.js +2 -2
- package/src/lensTraverse.js +18 -6
- package/src/mergeProp.js +1 -1
- package/src/pathNotEq.js +4 -4
- package/src/propNotEq.js +3 -3
- package/src/sortByProp.js +45 -0
- package/src/sortByProps.js +1 -1
- package/src/spreadProp.js +1 -1
- package/tmp-test-bundle.js.LICENSE.txt +618 -0
- package/types/.eslintrc.js +23 -0
- package/types/dtslint.eslint.js +13 -0
- package/types/index.d.ts +24 -5
package/es/renameKeys.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { curry, has } from 'ramda';
|
|
2
2
|
import renameKeysWith from './renameKeysWith';
|
|
3
|
-
|
|
4
3
|
var valueOrKey = function valueOrKey(keysMap) {
|
|
5
4
|
return function (key) {
|
|
6
5
|
if (has(key, keysMap)) {
|
|
7
6
|
return keysMap[key];
|
|
8
7
|
}
|
|
9
|
-
|
|
10
8
|
return key;
|
|
11
9
|
};
|
|
12
10
|
};
|
|
11
|
+
|
|
13
12
|
/**
|
|
14
13
|
* Creates a new object with the own properties of the provided object, but the
|
|
15
14
|
* keys renamed according to the keysMap object as `{oldKey: newKey}`.
|
|
@@ -34,8 +33,6 @@ var valueOrKey = function valueOrKey(keysMap) {
|
|
|
34
33
|
* RA.renameKeys({ firstName: 'name', type: 'kind', foo: 'bar' })(input);
|
|
35
34
|
* //=> { name: 'Elisia', age: 22, kind: 'human' }
|
|
36
35
|
*/
|
|
37
|
-
|
|
38
|
-
|
|
39
36
|
var renameKeys = curry(function (keysMap, obj) {
|
|
40
37
|
return renameKeysWith(valueOrKey(keysMap), obj);
|
|
41
38
|
});
|
package/es/renameKeysWith.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { curry, toPairs, pipe, map, over, lensIndex, fromPairs } from 'ramda';
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* Creates a new object with the own properties of the provided object, but the
|
|
4
5
|
* keys renamed according to logic of renaming function.
|
|
@@ -19,7 +20,6 @@ import { curry, toPairs, pipe, map, over, lensIndex, fromPairs } from 'ramda';
|
|
|
19
20
|
*
|
|
20
21
|
* RA.renameKeysWith(R.concat('a'), { A: 1, B: 2, C: 3 }) //=> { aA: 1, aB: 2, aC: 3 }
|
|
21
22
|
*/
|
|
22
|
-
|
|
23
23
|
var renameKeysWith = curry(function (fn, obj) {
|
|
24
24
|
return pipe(toPairs, map(over(lensIndex(0), fn)), fromPairs)(obj);
|
|
25
25
|
});
|
package/es/repeatStr.js
CHANGED
|
@@ -3,6 +3,7 @@ import ponyfill from './internal/ponyfills/String.repeat';
|
|
|
3
3
|
import isFunction from './isFunction';
|
|
4
4
|
export var repeatStrPonyfill = curry(ponyfill);
|
|
5
5
|
export var repeatStrInvoker = flip(invoker(1, 'repeat'));
|
|
6
|
+
|
|
6
7
|
/**
|
|
7
8
|
* Constructs and returns a new string which contains the specified
|
|
8
9
|
* number of copies of the string on which it was called, concatenated together.
|
|
@@ -19,6 +20,5 @@ export var repeatStrInvoker = flip(invoker(1, 'repeat'));
|
|
|
19
20
|
*
|
|
20
21
|
* RA.repeatStr('a', 3); //=> 'aaa'
|
|
21
22
|
*/
|
|
22
|
-
|
|
23
23
|
var repeatStr = isFunction(String.prototype.repeat) ? repeatStrInvoker : repeatStrPonyfill;
|
|
24
24
|
export default repeatStr;
|
package/es/replaceAll.js
CHANGED
|
@@ -3,6 +3,7 @@ import isFunction from './isFunction';
|
|
|
3
3
|
import ponyfill from './internal/ponyfills/String.replaceAll';
|
|
4
4
|
export var replaceAllPonyfill = curryN(3, ponyfill);
|
|
5
5
|
export var replaceAllInvoker = invoker(2, 'replaceAll');
|
|
6
|
+
|
|
6
7
|
/**
|
|
7
8
|
* Replaces all substring matches in a string with a replacement.
|
|
8
9
|
*
|
|
@@ -24,6 +25,5 @@ export var replaceAllInvoker = invoker(2, 'replaceAll');
|
|
|
24
25
|
* RA.replaceAll(/x/g, 'v', 'xxx'); //=> 'vvv'
|
|
25
26
|
* RA.replaceAll(/x/, 'v', 'xxx'); //=> TypeError
|
|
26
27
|
*/
|
|
27
|
-
|
|
28
28
|
var replaceAll = isFunction(String.prototype.replaceAll) ? replaceAllInvoker : replaceAllPonyfill;
|
|
29
29
|
export default replaceAll;
|
package/es/resolveP.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { bind } from 'ramda';
|
|
2
|
-
/* eslint-disable max-len */
|
|
3
2
|
|
|
3
|
+
/* eslint-disable max-len */
|
|
4
4
|
/**
|
|
5
5
|
* Composable shortcut for `Promise.resolve`.
|
|
6
6
|
*
|
|
@@ -22,8 +22,6 @@ import { bind } from 'ramda';
|
|
|
22
22
|
* RA.resolveP('a'); //=> Promise('a')
|
|
23
23
|
* RA.resolveP([1, 2, 3]); //=> Promise([1, 2, 3])
|
|
24
24
|
*/
|
|
25
|
-
|
|
26
25
|
/* eslint-enable max-len */
|
|
27
|
-
|
|
28
26
|
var resolveP = bind(Promise.resolve, Promise);
|
|
29
27
|
export default resolveP;
|
package/es/round.js
CHANGED
package/es/seq.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { curry, map, tap } from 'ramda';
|
|
2
|
-
/* eslint-disable max-len */
|
|
3
2
|
|
|
3
|
+
/* eslint-disable max-len */
|
|
4
4
|
/**
|
|
5
5
|
* Runs the given list of functions in order with the supplied object, then returns the object.
|
|
6
6
|
* Also known as the normal order sequencing combinator.
|
|
@@ -31,7 +31,6 @@ import { curry, map, tap } from 'ramda';
|
|
|
31
31
|
* R.toUpper
|
|
32
32
|
* )('test'); //=> 'PREFIX TEST'
|
|
33
33
|
*/
|
|
34
|
-
|
|
35
34
|
/* eslint-enable max-len */
|
|
36
35
|
|
|
37
36
|
var seq = curry(function (fns, x) {
|
package/es/sign.js
CHANGED
|
@@ -2,6 +2,7 @@ import { bind, curryN } from 'ramda';
|
|
|
2
2
|
import isFunction from './isFunction';
|
|
3
3
|
import ponyfill from './internal/ponyfills/Math.sign';
|
|
4
4
|
export var signPonyfill = curryN(1, ponyfill);
|
|
5
|
+
|
|
5
6
|
/**
|
|
6
7
|
* Returns the sign of a number, indicating whether the number is positive, negative or zero.
|
|
7
8
|
*
|
package/es/skipTake.js
CHANGED
package/es/sliceFrom.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { __, slice } from 'ramda';
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* Returns the elements of the given list or string (or object with a slice method)
|
|
4
5
|
* from fromIndex (inclusive).
|
|
@@ -17,6 +18,5 @@ import { __, slice } from 'ramda';
|
|
|
17
18
|
*
|
|
18
19
|
* RA.sliceFrom(1, [1, 2, 3]); //=> [2, 3]
|
|
19
20
|
*/
|
|
20
|
-
|
|
21
21
|
var sliceFrom = slice(__, Infinity);
|
|
22
22
|
export default sliceFrom;
|
package/es/sliceTo.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { slice } from 'ramda';
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* Returns the elements of the given list or string (or object with a slice method)
|
|
4
5
|
* to toIndex (exclusive).
|
|
@@ -17,6 +18,5 @@ import { slice } from 'ramda';
|
|
|
17
18
|
*
|
|
18
19
|
* RA.sliceTo(2, [1, 2, 3]); //=> [1, 2]
|
|
19
20
|
*/
|
|
20
|
-
|
|
21
21
|
var sliceTo = slice(0);
|
|
22
22
|
export default sliceTo;
|
package/es/sortByPaths.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ascend, identity, map, path, pipe, sortWith, useWith } from 'ramda';
|
|
2
2
|
var pathToAscendSort = pipe(path, ascend);
|
|
3
3
|
var mapPathsToAscendSort = map(pathToAscendSort);
|
|
4
|
+
|
|
4
5
|
/**
|
|
5
6
|
* Sort a list of objects by a list of paths (if first path value is equivalent, sort by second, etc).
|
|
6
7
|
*
|
package/es/sortByProp.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { __, append, identity, useWith } from 'ramda';
|
|
2
|
+
import sortByProps from './sortByProps';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Sort a list of objects by a property.
|
|
6
|
+
*
|
|
7
|
+
* @func sortByProp
|
|
8
|
+
* @memberOf RA
|
|
9
|
+
* @since {@link https://char0n.github.io/ramda-adjunct/3.4.0|v3.4.0}
|
|
10
|
+
* @category List
|
|
11
|
+
* @sig k -> [{k: v}] -> [{k: v}]
|
|
12
|
+
* @param {Array.<string>} prop The property in the list param to sort by
|
|
13
|
+
* @param {Array.<object>} list A list of objects to be sorted
|
|
14
|
+
* @return {Array.<object>} A new list sorted by the property in the prop param
|
|
15
|
+
* @example
|
|
16
|
+
*
|
|
17
|
+
* // sorting list of tuples
|
|
18
|
+
* const sortByFirstItem = sortByProp(0);
|
|
19
|
+
* const listOfTuples = [[-1, 1], [-2, 2], [-3, 3]];
|
|
20
|
+
* sortByFirstItem(listOfTuples); // => [[-3, 3], [-2, 2], [-1, 1]]
|
|
21
|
+
*
|
|
22
|
+
* // sorting list of objects
|
|
23
|
+
* const sortByName = sortByProp('name');
|
|
24
|
+
* const alice = {
|
|
25
|
+
* name: 'ALICE',
|
|
26
|
+
* age: 101,
|
|
27
|
+
* };
|
|
28
|
+
* const bob = {
|
|
29
|
+
* name: 'Bob',
|
|
30
|
+
* age: -10,
|
|
31
|
+
* };
|
|
32
|
+
* const clara = {
|
|
33
|
+
* name: 'clara',
|
|
34
|
+
* age: 314.159,
|
|
35
|
+
* };
|
|
36
|
+
* const people = [clara, bob, alice];
|
|
37
|
+
* sortByName(people); // => [alice, bob, clara]
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
var addValueInAnArray = append(__, []);
|
|
41
|
+
var sortByProp = useWith(sortByProps, [addValueInAnArray, identity]);
|
|
42
|
+
export default sortByProp;
|
package/es/sortByProps.js
CHANGED
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
function _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); }
|
|
2
|
-
|
|
3
2
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
-
|
|
5
3
|
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 _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; }
|
|
8
|
-
|
|
4
|
+
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; }
|
|
9
5
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
10
|
-
|
|
11
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import { comparator, curry, either, lt, map, prop, reduce, sort } from 'ramda';
|
|
12
8
|
|
|
13
|
-
import { reduce, either, curry, prop, sort, comparator, map, lt } from 'ramda';
|
|
14
9
|
/**
|
|
15
10
|
* Sort a list of objects by a list of props (if first prop value is equivalent, sort by second, etc).
|
|
16
11
|
*
|
|
@@ -35,18 +30,15 @@ import { reduce, either, curry, prop, sort, comparator, map, lt } from 'ramda';
|
|
|
35
30
|
var sortByProps = curry(function (props, list) {
|
|
36
31
|
var firstTruthy = function firstTruthy(_ref) {
|
|
37
32
|
var _ref2 = _toArray(_ref),
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
33
|
+
head = _ref2[0],
|
|
34
|
+
tail = _ref2.slice(1);
|
|
41
35
|
return reduce(either, head, tail);
|
|
42
36
|
};
|
|
43
|
-
|
|
44
37
|
var makeComparator = function makeComparator(propName) {
|
|
45
38
|
return comparator(function (a, b) {
|
|
46
39
|
return lt(prop(propName, a), prop(propName, b));
|
|
47
40
|
});
|
|
48
41
|
};
|
|
49
|
-
|
|
50
42
|
return sort(firstTruthy(map(makeComparator, props)), list);
|
|
51
43
|
});
|
|
52
44
|
export default sortByProps;
|
package/es/spreadPath.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { curryN, converge, mergeRight, dissocPath, pathOr } from 'ramda';
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* Spreads object under property path onto provided object.
|
|
4
5
|
* It's like {@link RA.flattenPath|flattenPath}, but removes object under the property path.
|
|
@@ -20,6 +21,5 @@ import { curryN, converge, mergeRight, dissocPath, pathOr } from 'ramda';
|
|
|
20
21
|
* { a: 1, b1: { b2: { c: 3, d: 4 } } }
|
|
21
22
|
* ); // => { a: 1, c: 3, d: 4, b1: {} };
|
|
22
23
|
*/
|
|
23
|
-
|
|
24
24
|
var spreadPath = curryN(2, converge(mergeRight, [dissocPath, pathOr({})]));
|
|
25
25
|
export default spreadPath;
|
package/es/spreadProp.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { of, curry } from 'ramda';
|
|
2
2
|
import spreadPath from './spreadPath';
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* Spreads object under property onto provided object.
|
|
5
6
|
* It's like {@link RA.flattenProp|flattenProp}, but removes object under the property.
|
|
@@ -18,8 +19,7 @@ import spreadPath from './spreadPath';
|
|
|
18
19
|
*
|
|
19
20
|
* RA.spreadProp('b', { a: 1, b: { c: 3, d: 4 } }); // => { a: 1, c: 3, d: 4 };
|
|
20
21
|
*/
|
|
21
|
-
|
|
22
22
|
var spreadProp = curry(function (prop, obj) {
|
|
23
|
-
return spreadPath(of(prop), obj);
|
|
23
|
+
return spreadPath(of(Array, prop), obj);
|
|
24
24
|
});
|
|
25
25
|
export default spreadProp;
|
package/es/stubArray.js
CHANGED
package/es/stubNull.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { always } from 'ramda';
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* A function that returns `null`.
|
|
4
5
|
*
|
|
@@ -13,6 +14,5 @@ import { always } from 'ramda';
|
|
|
13
14
|
* RA.stubNull(); //=> null
|
|
14
15
|
* RA.stubNull(1, 2, 3); //=> null
|
|
15
16
|
*/
|
|
16
|
-
|
|
17
17
|
var stubNull = always(null);
|
|
18
18
|
export default stubNull;
|
package/es/stubObj.js
CHANGED
package/es/stubString.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { always } from 'ramda';
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* A function that returns empty string.
|
|
4
5
|
*
|
|
@@ -13,6 +14,5 @@ import { always } from 'ramda';
|
|
|
13
14
|
* RA.stubString(); //=> ''
|
|
14
15
|
* RA.stubString(1, 2, 3); //=> ''
|
|
15
16
|
*/
|
|
16
|
-
|
|
17
17
|
var stubString = always('');
|
|
18
18
|
export default stubString;
|
package/es/stubUndefined.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { always } from 'ramda';
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* A function that returns `undefined`.
|
|
4
5
|
*
|
|
@@ -13,7 +14,6 @@ import { always } from 'ramda';
|
|
|
13
14
|
* RA.stubUndefined(); //=> undefined
|
|
14
15
|
* RA.stubUndefined(1, 2, 3); //=> undefined
|
|
15
16
|
*/
|
|
16
|
-
|
|
17
17
|
var stubUndefined = always(void 0); // eslint-disable-line no-void
|
|
18
18
|
|
|
19
19
|
export default stubUndefined;
|
package/es/subtractNum.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { flip, subtract } from 'ramda';
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* Subtracts its first argument from its second argument.
|
|
4
5
|
*
|
|
@@ -14,6 +15,5 @@ import { flip, subtract } from 'ramda';
|
|
|
14
15
|
*
|
|
15
16
|
* RA.subtractNum(3, 5); //=> 2
|
|
16
17
|
*/
|
|
17
|
-
|
|
18
18
|
var subtractNum = flip(subtract);
|
|
19
19
|
export default subtractNum;
|
package/es/thenCatchP.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { invoker } from 'ramda';
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* Composable shortcut for `Promise.then` that allows for success and failure callbacks.
|
|
4
5
|
* The thenCatchP function returns a Promise. It takes three arguments: a callback function for the success of the Promise,
|
|
@@ -21,6 +22,5 @@ import { invoker } from 'ramda';
|
|
|
21
22
|
*
|
|
22
23
|
* RA.thenCatchP(add1, console.error, promise); // => Promise(2)
|
|
23
24
|
*/
|
|
24
|
-
|
|
25
25
|
export var thenCatchP = invoker(2, 'then');
|
|
26
26
|
export default thenCatchP;
|
package/es/toArray.js
CHANGED
|
@@ -4,6 +4,7 @@ import isFunction from './isFunction';
|
|
|
4
4
|
import ponyfill from './internal/ponyfills/Array.from';
|
|
5
5
|
export var fromPonyfill = curryN(1, ponyfill);
|
|
6
6
|
var fromArray = isFunction(Array.from) ? curryN(1, Array.from) : fromPonyfill;
|
|
7
|
+
|
|
7
8
|
/**
|
|
8
9
|
* Converts value to an array.
|
|
9
10
|
*
|
package/es/toInteger32.js
CHANGED
package/es/toNumber.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ifElse, always } from 'ramda';
|
|
2
2
|
import isCoercible from './internal/isCoercible';
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* Converts value to a number.
|
|
5
6
|
*
|
|
@@ -17,6 +18,5 @@ import isCoercible from './internal/isCoercible';
|
|
|
17
18
|
* RA.toNumber('3.2'); //=> 3.2
|
|
18
19
|
* RA.toNumber(Symbol('3.2')); //=> NaN
|
|
19
20
|
*/
|
|
20
|
-
|
|
21
21
|
var toNumber = ifElse(isCoercible, Number, always(NaN));
|
|
22
22
|
export default toNumber;
|
package/es/toUinteger32.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { curryN } from 'ramda';
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* Converts double-precision 64-bit binary format IEEE 754 to unsigned 32 bit integer number.
|
|
4
5
|
*
|
|
@@ -18,8 +19,8 @@ import { curryN } from 'ramda';
|
|
|
18
19
|
* RA.toInteger32(2 ** 31); // => 2147483648
|
|
19
20
|
* RA.toInteger32(2 ** 30); // => 1073741824
|
|
20
21
|
*/
|
|
21
|
-
// eslint-disable-next-line no-bitwise
|
|
22
22
|
|
|
23
|
+
// eslint-disable-next-line no-bitwise
|
|
23
24
|
var toUinteger32 = curryN(1, function (val) {
|
|
24
25
|
return val >>> 0;
|
|
25
26
|
});
|
package/es/trimCharsEnd.js
CHANGED
package/es/trimCharsStart.js
CHANGED
package/es/trimEnd.js
CHANGED
package/es/trimStart.js
CHANGED
package/es/trunc.js
CHANGED
|
@@ -2,6 +2,7 @@ import { bind, curryN } from 'ramda';
|
|
|
2
2
|
import ponyfill from './internal/ponyfills/Math.trunc';
|
|
3
3
|
import isFunction from './isFunction';
|
|
4
4
|
export var truncPonyfill = curryN(1, ponyfill);
|
|
5
|
+
|
|
5
6
|
/**
|
|
6
7
|
* Returns the integer part of a number by removing any fractional digits.
|
|
7
8
|
*
|
package/es/unzipObjWith.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { apply, curryN, flip, map, pipe, toPairs, transpose, when } from 'ramda';
|
|
2
2
|
import lengthEq from './lengthEq';
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* Creates a new list out of the supplied object by applying the function to each key/value pairing.
|
|
5
6
|
*
|
|
@@ -17,7 +18,6 @@ import lengthEq from './lengthEq';
|
|
|
17
18
|
* RA.unzipObjWith((v, k) => [`new${k.toUpperCase()}`, 2 * v], { a: 1, b: 2, c: 3 });
|
|
18
19
|
* //=> [['newA', 'newB', 'newC'], [2, 4, 6]]
|
|
19
20
|
*/
|
|
20
|
-
|
|
21
21
|
var unzipObjWith = curryN(2, function (fn, obj) {
|
|
22
22
|
return pipe(toPairs, map(pipe(flip, apply)(fn)), transpose, when(lengthEq(0), function () {
|
|
23
23
|
return [[], []];
|
package/es/viewOr.js
CHANGED
package/es/weave.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { curryN } from 'ramda';
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* Weaves a configuration into function returning the runnable monad like `Reader` or `Free`.
|
|
4
5
|
* This allows us to pre-bind the configuration in advance and use the weaved function
|
|
@@ -27,7 +28,6 @@ import { curryN } from 'ramda';
|
|
|
27
28
|
* const wlog = RA.weave(log, console);
|
|
28
29
|
* wlog('test'); //=> prints 'test'
|
|
29
30
|
*/
|
|
30
|
-
|
|
31
31
|
var weave = curryN(2, function (fn, config) {
|
|
32
32
|
return curryN(fn.length, function () {
|
|
33
33
|
return fn.apply(void 0, arguments).run(config);
|
package/es/weaveLazy.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { curryN } from 'ramda';
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* Weaves a configuration into function returning the runnable monad like `Reader` or `Free`.
|
|
4
5
|
* This allows us to pre-bind the configuration in advance and use the weaved function
|
|
@@ -29,7 +30,6 @@ import { curryN } from 'ramda';
|
|
|
29
30
|
* const wlog = RA.weaveLazy(log, consoleAccessor);
|
|
30
31
|
* wlog('test'); //=> prints 'test'
|
|
31
32
|
*/
|
|
32
|
-
|
|
33
33
|
var weaveLazy = curryN(2, function (fn, configAccessor) {
|
|
34
34
|
return curryN(fn.length, function () {
|
|
35
35
|
return fn.apply(void 0, arguments).run(configAccessor());
|
package/es/zipObjWith.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { apply, curryN, fromPairs, map, pipe, zip } from 'ramda';
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* Creates a new object out of a list of keys and a list of values by applying the function
|
|
4
5
|
* to each equally-positioned pair in the lists.
|
|
@@ -19,7 +20,6 @@ import { apply, curryN, fromPairs, map, pipe, zip } from 'ramda';
|
|
|
19
20
|
* RA.zipObjWith((value, key) => [key, `${key}${value + 1}`]), ['a', 'b', 'c'], [1, 2, 3]);
|
|
20
21
|
* // => { a: 'a2', b: 'b3', c: 'c4' }
|
|
21
22
|
*/
|
|
22
|
-
|
|
23
23
|
var zipObjWith = curryN(3, function (fn, keys, values) {
|
|
24
24
|
return pipe(zip, map(apply(fn)), fromPairs)(values, keys);
|
|
25
25
|
});
|
package/lib/Y.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
|
* Y-combinator
|
|
10
8
|
*
|
|
@@ -31,6 +29,7 @@ var _ramda = require("ramda");
|
|
|
31
29
|
*
|
|
32
30
|
* factorial(5); //=> 120
|
|
33
31
|
*/
|
|
32
|
+
|
|
34
33
|
var Y = (0, _ramda.curryN)(1, function (le) {
|
|
35
34
|
return function (f) {
|
|
36
35
|
return f(f);
|
package/lib/allEqual.js
CHANGED
|
@@ -2,16 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports["default"] = void 0;
|
|
5
|
-
|
|
6
5
|
var _ramda = require("ramda");
|
|
7
|
-
|
|
8
6
|
var _lengthLte = _interopRequireDefault(require("./lengthLte"));
|
|
9
|
-
|
|
10
7
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
-
|
|
12
8
|
// Original idea for this function was conceived by https://github.com/jackmellis
|
|
13
9
|
// in https://github.com/char0n/ramda-adjunct/pull/513.
|
|
14
|
-
|
|
15
10
|
/**
|
|
16
11
|
* Returns true if all items in the list are equivalent using `R.equals` for equality comparisons.
|
|
17
12
|
*
|
package/lib/allEqualTo.js
CHANGED
package/lib/allIdentical.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 _lengthLte = _interopRequireDefault(require("./lengthLte"));
|
|
9
|
-
|
|
10
7
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
-
|
|
12
8
|
/**
|
|
13
9
|
* Returns true if all items in the list are equivalent using `R.identical` for equality comparisons.
|
|
14
10
|
*
|
package/lib/allIdenticalTo.js
CHANGED
package/lib/allP.js
CHANGED
package/lib/allSettledP.js
CHANGED
|
@@ -2,16 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports["default"] = exports.allSettledPPonyfill = void 0;
|
|
5
|
-
|
|
6
5
|
var _ramda = require("ramda");
|
|
7
|
-
|
|
8
6
|
var _isFunction = _interopRequireDefault(require("./isFunction"));
|
|
9
|
-
|
|
10
7
|
var _Promise = _interopRequireDefault(require("./internal/ponyfills/Promise.allSettled"));
|
|
11
|
-
|
|
12
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
-
|
|
14
9
|
var allSettledPPonyfill = (0, _ramda.curryN)(1, _Promise["default"]);
|
|
10
|
+
|
|
15
11
|
/**
|
|
16
12
|
* Returns a promise that is fulfilled with an array of promise state snapshots,
|
|
17
13
|
* but only after all the original promises have settled, i.e. become either fulfilled or rejected.
|
|
@@ -34,7 +30,6 @@ var allSettledPPonyfill = (0, _ramda.curryN)(1, _Promise["default"]);
|
|
|
34
30
|
* Promise.reject(3),
|
|
35
31
|
* ]); //=> Promise([{ status: 'fulfilled', value: 1 }, { status: 'fulfilled', value: 2 }, { status: 'rejected', reason: 3 }])
|
|
36
32
|
*/
|
|
37
|
-
|
|
38
33
|
exports.allSettledPPonyfill = allSettledPPonyfill;
|
|
39
34
|
var allSettledP = (0, _isFunction["default"])(Promise.allSettled) ? (0, _ramda.curryN)(1, (0, _ramda.bind)(Promise.allSettled, Promise)) : allSettledPPonyfill;
|
|
40
35
|
var _default = allSettledP;
|
package/lib/allUnique.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 _lengthEq = _interopRequireDefault(require("./lengthEq"));
|
|
9
|
-
|
|
10
7
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
-
|
|
12
8
|
/**
|
|
13
9
|
* Returns true if all items in the list are unique. `R.equals` is used to determine equality.
|
|
14
10
|
*
|