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/es/isPlainObj.js
CHANGED
|
@@ -5,8 +5,8 @@ import isFunction from './isFunction';
|
|
|
5
5
|
var isObject = pipe(type, identical('Object'));
|
|
6
6
|
var isObjectConstructor = pipe(toString, equals(toString(Object)));
|
|
7
7
|
var hasObjectConstructor = pathSatisfies(both(isFunction, isObjectConstructor), ['constructor']);
|
|
8
|
-
/* eslint-disable max-len */
|
|
9
8
|
|
|
9
|
+
/* eslint-disable max-len */
|
|
10
10
|
/**
|
|
11
11
|
* Check to see if an object is a plain object (created using `{}`, `new Object()` or `Object.create(null)`).
|
|
12
12
|
*
|
|
@@ -33,20 +33,15 @@ var hasObjectConstructor = pathSatisfies(both(isFunction, isObjectConstructor),
|
|
|
33
33
|
* RA.isPlainObj(Object.create(null); //=> true
|
|
34
34
|
* RA.isPlainObj(new Object()); //=> true
|
|
35
35
|
*/
|
|
36
|
-
|
|
37
36
|
/* eslint-enable max-len */
|
|
38
|
-
|
|
39
37
|
var isPlainObj = curryN(1, function (val) {
|
|
40
38
|
if (!isObjLike(val) || !isObject(val)) {
|
|
41
39
|
return false;
|
|
42
40
|
}
|
|
43
|
-
|
|
44
41
|
var proto = Object.getPrototypeOf(val);
|
|
45
|
-
|
|
46
42
|
if (isNull(proto)) {
|
|
47
43
|
return true;
|
|
48
44
|
}
|
|
49
|
-
|
|
50
45
|
return hasObjectConstructor(proto);
|
|
51
46
|
});
|
|
52
47
|
export default isPlainObj;
|
package/es/isPositive.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { both, lt } from 'ramda';
|
|
2
2
|
import isNumber from './isNumber';
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* Checks if value is a positive `Number` primitive or object. Zero is not considered positive.
|
|
5
6
|
*
|
|
@@ -19,6 +20,5 @@ import isNumber from './isNumber';
|
|
|
19
20
|
* RA.isPositive(NaN); // => false
|
|
20
21
|
* RA.isPositive('5'); // => false
|
|
21
22
|
*/
|
|
22
|
-
|
|
23
23
|
var isPositive = both(isNumber, lt(0));
|
|
24
24
|
export default isPositive;
|
package/es/isPositiveZero.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { identical } from 'ramda';
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* Checks if value is a positive zero (+0).
|
|
4
5
|
*
|
|
@@ -17,6 +18,5 @@ import { identical } from 'ramda';
|
|
|
17
18
|
* RA.isPositiveZero(-0); //=> false
|
|
18
19
|
* RA.isPositiveZero(null); //=> false
|
|
19
20
|
*/
|
|
20
|
-
|
|
21
21
|
var isPositiveZero = identical(+0);
|
|
22
22
|
export default isPositiveZero;
|
package/es/isPrimitive.js
CHANGED
|
@@ -7,12 +7,14 @@ import isBoolean from './isBoolean';
|
|
|
7
7
|
import isUndefined from './isUndefined';
|
|
8
8
|
import isNull from './isNull';
|
|
9
9
|
import isSymbol from './isSymbol';
|
|
10
|
+
|
|
10
11
|
/**
|
|
11
12
|
* Checks if value is a primitive data type. There are 6 primitive data types: `string`, `number`, `bigint`, `boolean`, `undefined`, `symbol` and a special case of `null`.
|
|
12
13
|
* See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Primitive_values
|
|
13
14
|
* for definition of what sub-types comprise a primitive.
|
|
14
15
|
*
|
|
15
16
|
* @func isPrimitive
|
|
17
|
+
* @memberOf RA
|
|
16
18
|
* @category Type
|
|
17
19
|
* @sig * -> Boolean
|
|
18
20
|
* @since {@link https://char0n.github.io/ramda-adjunct/2.32.0|v2.32.0}
|
package/es/isPromise.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { both, pipe, toString, equals, curryN } from 'ramda';
|
|
2
2
|
import isObj from './isObj';
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* Checks if input value is a native `Promise`.
|
|
5
6
|
* The Promise object represents the eventual completion (or failure)
|
|
@@ -22,6 +23,5 @@ import isObj from './isObj';
|
|
|
22
23
|
* RA.isPromise(Promise.reject()); // => true
|
|
23
24
|
* RA.isPromise({ then: () => 1 }); // => false
|
|
24
25
|
*/
|
|
25
|
-
|
|
26
26
|
var isPromise = curryN(1, both(isObj, pipe(toString, equals('[object Promise]'))));
|
|
27
27
|
export default isPromise;
|
package/es/isPrototypeOf.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { curry } from 'ramda';
|
|
2
2
|
import invokeArgs from './invokeArgs';
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* Checks if an object exists in another object's prototype chain.
|
|
5
6
|
*
|
|
@@ -27,7 +28,6 @@ import invokeArgs from './invokeArgs';
|
|
|
27
28
|
* RA.isPrototypeOf(Foo, baz); // => true
|
|
28
29
|
* RA.isPrototypeOf(Object, baz); // => true
|
|
29
30
|
*/
|
|
30
|
-
|
|
31
31
|
var isPrototypeOf = curry(function (type, object) {
|
|
32
32
|
return Boolean(invokeArgs(['prototype', 'isPrototypeOf'], [object], type));
|
|
33
33
|
});
|
package/es/isRegExp.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type, identical, pipe, curryN } from 'ramda';
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* Checks if value is `RegExp` object.
|
|
4
5
|
*
|
|
@@ -16,6 +17,5 @@ import { type, identical, pipe, curryN } from 'ramda';
|
|
|
16
17
|
* RA.isRegExp(/(?:)/); //=> true
|
|
17
18
|
* RA.isRegExp(1); //=> false
|
|
18
19
|
*/
|
|
19
|
-
|
|
20
20
|
var isRegExp = curryN(1, pipe(type, identical('RegExp')));
|
|
21
21
|
export default isRegExp;
|
package/es/isSafeInteger.js
CHANGED
|
@@ -2,6 +2,7 @@ import { bind, curryN } from 'ramda';
|
|
|
2
2
|
import isFunction from './isFunction';
|
|
3
3
|
import ponyfill from './internal/ponyfills/Number.isSafeInteger';
|
|
4
4
|
export var isSafeIntegerPonyfill = curryN(1, ponyfill);
|
|
5
|
+
|
|
5
6
|
/**
|
|
6
7
|
* Checks whether the passed value is a safe `integer`.
|
|
7
8
|
*
|
package/es/isSentinelValue.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { curryN } from 'ramda';
|
|
2
2
|
import isInteger32 from './isInteger32';
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* Checks whether the passed value is {@link https://github.com/getify/You-Dont-Know-JS/blob/9959fc904d584bbf0b02cf41c192f74ff4238581/types-grammar/ch4.md#the-curious-case-of-the-|a sentinel value}.
|
|
5
6
|
*
|
|
@@ -19,7 +20,6 @@ import isInteger32 from './isInteger32';
|
|
|
19
20
|
* RA.isSentinelValue([-1]); //=> false
|
|
20
21
|
*/
|
|
21
22
|
// eslint-disable-next-line no-bitwise
|
|
22
|
-
|
|
23
23
|
var isSentinelValue = curryN(1, function (val) {
|
|
24
24
|
return isInteger32(val) && ~val === 0;
|
|
25
25
|
});
|
package/es/isSet.js
CHANGED
package/es/isSparseArray.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { values, both, complement, pipe, converge, identical, length } from 'ramda';
|
|
2
2
|
import isArray from './isArray';
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* Checks if input value is a sparse Array.
|
|
5
6
|
* An array with at least one "empty slot" in it is often called a "sparse array."
|
|
@@ -25,6 +26,5 @@ import isArray from './isArray';
|
|
|
25
26
|
*
|
|
26
27
|
* RA.isSparseArray([1, 2, 3]); // => false
|
|
27
28
|
*/
|
|
28
|
-
|
|
29
29
|
var isSparseArray = both(isArray, converge(complement(identical), [pipe(values, length), length]));
|
|
30
30
|
export default isSparseArray;
|
package/es/isString.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { curryN, pipe, type, identical } from 'ramda';
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* Checks if input value is `String`.
|
|
4
5
|
*
|
|
@@ -15,6 +16,5 @@ import { curryN, pipe, type, identical } from 'ramda';
|
|
|
15
16
|
* RA.isString('abc'); //=> true
|
|
16
17
|
* RA.isString(1); //=> false
|
|
17
18
|
*/
|
|
18
|
-
|
|
19
19
|
var isString = curryN(1, pipe(type, identical('String')));
|
|
20
20
|
export default isString;
|
package/es/isSymbol.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
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); }
|
|
2
|
-
|
|
3
2
|
import { type, curryN } from 'ramda';
|
|
3
|
+
|
|
4
4
|
/**
|
|
5
5
|
* Checks if input value is a Symbol.
|
|
6
6
|
*
|
|
@@ -20,7 +20,6 @@ import { type, curryN } from 'ramda';
|
|
|
20
20
|
* RA.isSymbol(undefined); //=> false
|
|
21
21
|
* RA.isSymbol(null); //=> false
|
|
22
22
|
*/
|
|
23
|
-
|
|
24
23
|
var isSymbol = curryN(1, function (val) {
|
|
25
24
|
return _typeof(val) === 'symbol' || _typeof(val) === 'object' && type(val) === 'Symbol';
|
|
26
25
|
});
|
package/es/isThenable.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { pathSatisfies } from 'ramda';
|
|
2
2
|
import isFunction from './isFunction';
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* Checks if input value is a `thenable`.
|
|
5
6
|
* `thenable` is an object or function that defines a `then` method.
|
|
@@ -21,6 +22,5 @@ import isFunction from './isFunction';
|
|
|
21
22
|
* RA.isThenable(Promise.reject()); // => true
|
|
22
23
|
* RA.isThenable({ then: () => 1 }); // => true
|
|
23
24
|
*/
|
|
24
|
-
|
|
25
25
|
var isThenable = pathSatisfies(isFunction, ['then']);
|
|
26
26
|
export default isThenable;
|
package/es/isTrue.js
CHANGED
package/es/isTruthy.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { curryN } from 'ramda';
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* In JavaScript, a `truthy` value is a value that is considered true
|
|
4
5
|
* when evaluated in a Boolean context. All values are truthy unless
|
|
@@ -22,6 +23,5 @@ import { curryN } from 'ramda';
|
|
|
22
23
|
* RA.isTruthy(new Date()); // => true
|
|
23
24
|
* RA.isTruthy(Infinity); // => true
|
|
24
25
|
*/
|
|
25
|
-
|
|
26
26
|
var isTruthy = curryN(1, Boolean);
|
|
27
27
|
export default isTruthy;
|
package/es/isUinteger32.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { curryN } from 'ramda';
|
|
2
2
|
import toUinteger32 from './toUinteger32';
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* Checks whether the passed value is an unsigned 32 bit integer.
|
|
5
6
|
*
|
|
@@ -22,7 +23,6 @@ import toUinteger32 from './toUinteger32';
|
|
|
22
23
|
* RA.isUinteger32(-1); //=> false
|
|
23
24
|
* RA.isUinteger32(2 ** 32); //=> false
|
|
24
25
|
*/
|
|
25
|
-
|
|
26
26
|
var isUinteger32 = curryN(1, function (val) {
|
|
27
27
|
return toUinteger32(val) === val;
|
|
28
28
|
});
|
package/es/isUndefined.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { equals } from 'ramda';
|
|
2
2
|
import stubUndefined from './stubUndefined';
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* Checks if input value is `undefined`.
|
|
5
6
|
*
|
|
@@ -17,6 +18,5 @@ import stubUndefined from './stubUndefined';
|
|
|
17
18
|
* RA.isUndefined(undefined); //=> true
|
|
18
19
|
* RA.isUndefined(null); //=> false
|
|
19
20
|
*/
|
|
20
|
-
|
|
21
21
|
var isUndefined = equals(stubUndefined());
|
|
22
22
|
export default isUndefined;
|
package/es/isValidDate.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { invoker, both, pipe, curryN } from 'ramda';
|
|
2
2
|
import isDate from './isDate';
|
|
3
3
|
import isNotNaN from './isNotNaN';
|
|
4
|
-
/* eslint-disable max-len */
|
|
5
4
|
|
|
5
|
+
/* eslint-disable max-len */
|
|
6
6
|
/**
|
|
7
7
|
* Checks if value is valid `Date` object.
|
|
8
8
|
*
|
|
@@ -19,8 +19,6 @@ import isNotNaN from './isNotNaN';
|
|
|
19
19
|
* RA.isValidDate(new Date()); //=> true
|
|
20
20
|
* RA.isValidDate(new Date('a')); //=> false
|
|
21
21
|
*/
|
|
22
|
-
|
|
23
22
|
/* eslint-enable max-len */
|
|
24
|
-
|
|
25
23
|
var isValidDate = curryN(1, both(isDate, pipe(invoker(0, 'getTime'), isNotNaN)));
|
|
26
24
|
export default isValidDate;
|
package/es/isValidNumber.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { either, curryN } from 'ramda';
|
|
2
2
|
import isFloat from './isFloat';
|
|
3
3
|
import isInteger from './isInteger';
|
|
4
|
+
|
|
4
5
|
/**
|
|
5
6
|
* Checks if value is a valid `Number`. A valid `Number` is a number that is not `NaN`, `Infinity`
|
|
6
7
|
* or `-Infinity`.
|
|
@@ -21,6 +22,5 @@ import isInteger from './isInteger';
|
|
|
21
22
|
* RA.isValidNumber(Infinity); //=> false
|
|
22
23
|
* RA.isValidNumber(-Infinity); //=> false
|
|
23
24
|
*/
|
|
24
|
-
|
|
25
25
|
var isValidNumber = curryN(1, either(isInteger, isFloat));
|
|
26
26
|
export default isValidNumber;
|
package/es/lastP.js
CHANGED
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
-
|
|
3
2
|
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
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
4
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
8
|
-
|
|
9
5
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
10
|
-
|
|
11
6
|
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
7
|
import { bind, last, map, curryN } from 'ramda';
|
|
14
8
|
import allP from './allP';
|
|
15
9
|
import lengthEq from './lengthEq';
|
|
16
10
|
import lengthGte from './lengthGte';
|
|
17
11
|
import rejectP from './rejectP';
|
|
18
12
|
import resolveP from './resolveP';
|
|
13
|
+
|
|
19
14
|
/**
|
|
20
15
|
* Returns a promise that is fulfilled by the last given promise to be fulfilled,
|
|
21
16
|
* or rejected with an array of rejection reasons if all of the given promises are rejected.
|
|
@@ -39,7 +34,6 @@ import resolveP from './resolveP';
|
|
|
39
34
|
* delayP.reject(1000),
|
|
40
35
|
* ]); //=> Promise(100)
|
|
41
36
|
*/
|
|
42
|
-
|
|
43
37
|
var lastP = curryN(1, function (iterable) {
|
|
44
38
|
var fulfilled = [];
|
|
45
39
|
var rejected = [];
|
|
@@ -52,11 +46,9 @@ var lastP = curryN(1, function (iterable) {
|
|
|
52
46
|
if (lengthEq(0, fulfilled) && lengthEq(0, rejected)) {
|
|
53
47
|
return undefined;
|
|
54
48
|
}
|
|
55
|
-
|
|
56
49
|
if (lengthGte(1, fulfilled)) {
|
|
57
50
|
return last(fulfilled);
|
|
58
51
|
}
|
|
59
|
-
|
|
60
52
|
return rejectP(rejected);
|
|
61
53
|
});
|
|
62
54
|
});
|
package/es/lengthEq.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { equals } from 'ramda';
|
|
2
2
|
import compareLength from './internal/compareLength';
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* Returns `true` if the supplied list or string has a length equal to `valueLength`.
|
|
5
6
|
*
|
|
@@ -17,6 +18,5 @@ import compareLength from './internal/compareLength';
|
|
|
17
18
|
* RA.lengthEq(3, [1,2,3]); //=> true
|
|
18
19
|
* RA.lengthEq(3, [1,2,3,4]); //=> false
|
|
19
20
|
*/
|
|
20
|
-
|
|
21
21
|
var lengthEq = compareLength(equals);
|
|
22
22
|
export default lengthEq;
|
package/es/lengthGt.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { flip, gt } from 'ramda';
|
|
2
2
|
import compareLength from './internal/compareLength';
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* Returns `true` if the supplied list or string has a length greater than `valueLength`.
|
|
5
6
|
*
|
|
@@ -17,6 +18,5 @@ import compareLength from './internal/compareLength';
|
|
|
17
18
|
* RA.lengthGt(3, [1,2,3,4]); //=> true
|
|
18
19
|
* RA.lengthGt(3, [1,2,3]); //=> false
|
|
19
20
|
*/
|
|
20
|
-
|
|
21
21
|
var lengthGt = compareLength(flip(gt));
|
|
22
22
|
export default lengthGt;
|
package/es/lengthGte.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { flip, gte } from 'ramda';
|
|
2
2
|
import compareLength from './internal/compareLength';
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* Returns `true` if the supplied list or string has a length greater than or equal to
|
|
5
6
|
* `valueLength`.
|
|
@@ -19,6 +20,5 @@ import compareLength from './internal/compareLength';
|
|
|
19
20
|
* RA.lengthGte(3, [1,2,3]); //=> true
|
|
20
21
|
* RA.lengthGte(3, [1,2]); //=> false
|
|
21
22
|
*/
|
|
22
|
-
|
|
23
23
|
var lengthGte = compareLength(flip(gte));
|
|
24
24
|
export default lengthGte;
|
package/es/lengthLt.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { flip, lt } from 'ramda';
|
|
2
2
|
import compareLength from './internal/compareLength';
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* Returns `true` if the supplied list or string has a length less than `valueLength`.
|
|
5
6
|
*
|
|
@@ -17,6 +18,5 @@ import compareLength from './internal/compareLength';
|
|
|
17
18
|
* RA.lengthLt(3, [1,2]); //=> true
|
|
18
19
|
* RA.lengthLt(3, [1,2,3]); //=> false
|
|
19
20
|
*/
|
|
20
|
-
|
|
21
21
|
var lengthLt = compareLength(flip(lt));
|
|
22
22
|
export default lengthLt;
|
package/es/lengthLte.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { flip, lte } from 'ramda';
|
|
2
2
|
import compareLength from './internal/compareLength';
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* Returns `true` if the supplied list or string has a length less than or equal to `valueLength`.
|
|
5
6
|
*
|
|
@@ -18,6 +19,5 @@ import compareLength from './internal/compareLength';
|
|
|
18
19
|
* RA.lengthLte(3, [1,2,3]); //=> true
|
|
19
20
|
* RA.lengthLte(3, [1,2,3,4]); //=> false
|
|
20
21
|
*/
|
|
21
|
-
|
|
22
22
|
var lengthLte = compareLength(flip(lte));
|
|
23
23
|
export default lengthLte;
|
package/es/lengthNotEq.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { complement, equals } from 'ramda';
|
|
2
2
|
import compareLength from './internal/compareLength';
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* Returns `true` if the supplied list or string has a length not equal to `valueLength`.
|
|
5
6
|
*
|
|
@@ -17,6 +18,5 @@ import compareLength from './internal/compareLength';
|
|
|
17
18
|
* RA.lengthNotEq(3, [1,2,3,4]); //=> true
|
|
18
19
|
* RA.lengthNotEq(3, [1,2,3]); //=> false
|
|
19
20
|
*/
|
|
20
|
-
|
|
21
21
|
var lengthNotEq = compareLength(complement(equals));
|
|
22
22
|
export default lengthNotEq;
|
package/es/lensEq.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { view, curryN, equals, pipe } from 'ramda';
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* Returns `true` if data structure focused by the given lens equals provided value.
|
|
4
5
|
*
|
|
@@ -20,7 +21,6 @@ import { view, curryN, equals, pipe } from 'ramda';
|
|
|
20
21
|
* RA.lensEq(R.lensIndex(1), 1, [0, 1, 2]); // => true
|
|
21
22
|
* RA.lensEq(R.lensPath(['a', 'b']), 'foo', { a: { b: 'foo' } }) // => true
|
|
22
23
|
*/
|
|
23
|
-
|
|
24
24
|
var lensEq = curryN(3, function (lens, val, data) {
|
|
25
25
|
return pipe(view(lens), equals(val))(data);
|
|
26
26
|
});
|
package/es/lensIso.js
CHANGED
|
@@ -1,32 +1,34 @@
|
|
|
1
|
-
import { curry, map } from 'ramda';
|
|
1
|
+
import { curry, map } from 'ramda';
|
|
2
|
+
|
|
3
|
+
// This implementation was highly inspired by the implementations
|
|
2
4
|
// in ramda-lens library.
|
|
3
5
|
//
|
|
4
6
|
// https://github.com/ramda/ramda-lens
|
|
7
|
+
|
|
5
8
|
// isomorphic :: ((a -> b), (b -> a)) -> Isomorphism
|
|
6
9
|
// Isomorphism = x -> y
|
|
7
|
-
|
|
8
10
|
var isomorphic = function isomorphic(to, from) {
|
|
9
11
|
var isomorphism = function isomorphism(x) {
|
|
10
12
|
return to(x);
|
|
11
13
|
};
|
|
12
|
-
|
|
13
14
|
isomorphism.from = from;
|
|
14
15
|
return isomorphism;
|
|
15
|
-
};
|
|
16
|
-
|
|
16
|
+
};
|
|
17
17
|
|
|
18
|
+
// isomorphisms :: ((a -> b), (b -> a)) -> (a -> b)
|
|
18
19
|
var isomorphisms = function isomorphisms(to, from) {
|
|
19
20
|
return isomorphic(curry(function (toFunctorFn, target) {
|
|
20
21
|
return map(from, toFunctorFn(to(target)));
|
|
21
22
|
}), curry(function (toFunctorFn, target) {
|
|
22
23
|
return map(to, toFunctorFn(from(target)));
|
|
23
24
|
}));
|
|
24
|
-
};
|
|
25
|
-
|
|
25
|
+
};
|
|
26
26
|
|
|
27
|
+
// from :: Isomorphism -> a -> b
|
|
27
28
|
var from = curry(function (isomorphism, x) {
|
|
28
29
|
return isomorphism.from(x);
|
|
29
30
|
});
|
|
31
|
+
|
|
30
32
|
/**
|
|
31
33
|
* Defines an isomorphism that will work like a lens. It takes two functions.
|
|
32
34
|
* The function that converts and the function that recovers.
|
|
@@ -49,7 +51,6 @@ var from = curry(function (isomorphism, x) {
|
|
|
49
51
|
* R.over(lensJSON, assoc('b', 2), '{"a":1}'); //=> '{"a":1,"b":2}'
|
|
50
52
|
* R.over(RA.lensIso.from(lensJSON), R.replace('}', ',"b":2}'), { a: 1 }); // => { a: 1, b: 2 }
|
|
51
53
|
*/
|
|
52
|
-
|
|
53
54
|
var lensIso = curry(isomorphisms);
|
|
54
55
|
lensIso.from = from;
|
|
55
56
|
export default lensIso;
|
package/es/lensNotEq.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { complement } from 'ramda';
|
|
2
2
|
import lensEq from './lensEq';
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* Returns `true` if data structure focused by the given lens doesn't equal provided value.
|
|
5
6
|
*
|
|
@@ -21,6 +22,5 @@ import lensEq from './lensEq';
|
|
|
21
22
|
* RA.lensNotEq(R.lensIndex(1), 1, [0, 1, 2]); // => false
|
|
22
23
|
* RA.lensNotEq(R.lensPath(['a', 'b']), 'foo', { a: { b: 'foo' } }) // => false
|
|
23
24
|
*/
|
|
24
|
-
|
|
25
25
|
var lensNotEq = complement(lensEq);
|
|
26
26
|
export default lensNotEq;
|
package/es/lensNotSatisfy.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { complement } from 'ramda';
|
|
2
2
|
import lensSatisfies from './lensSatisfies';
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* Returns `true` if data structure focused by the given lens doesn't satisfy the predicate.
|
|
5
6
|
* Note that the predicate is expected to return boolean value.
|
|
@@ -23,6 +24,5 @@ import lensSatisfies from './lensSatisfies';
|
|
|
23
24
|
* RA.lensNotSatisfy(RA.isTrue, R.lensIndex(2), [false, true, 1]); // => true
|
|
24
25
|
* RA.lensNotSatisfy(R.identity, R.lensProp('x'), { x: 1 }); // => true
|
|
25
26
|
*/
|
|
26
|
-
|
|
27
27
|
var lensNotSatisfy = complement(lensSatisfies);
|
|
28
28
|
export default lensNotSatisfy;
|
package/es/lensSatisfies.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { view, curryN, pipe } from 'ramda';
|
|
2
2
|
import isTrue from './isTrue';
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* Returns `true` if data structure focused by the given lens satisfies the predicate.
|
|
5
6
|
* Note that the predicate is expected to return boolean value and will be evaluated
|
|
@@ -24,7 +25,6 @@ import isTrue from './isTrue';
|
|
|
24
25
|
* RA.lensSatisfies(RA.isTrue, R.lensIndex(2), [false, true, 1]); // => false
|
|
25
26
|
* RA.lensSatisfies(R.identity, R.lensProp('x'), { x: 1 }); // => false
|
|
26
27
|
*/
|
|
27
|
-
|
|
28
28
|
var lensSatisfies = curryN(3, function (predicate, lens, data) {
|
|
29
29
|
return pipe(view(lens), predicate, isTrue)(data);
|
|
30
30
|
});
|
package/es/lensTraverse.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { traverse, curry, pipe, prop, curryN } from 'ramda';
|
|
2
2
|
import Identity from './fantasy-land/Identity';
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* Creates a [Traversable](https://github.com/fantasyland/fantasy-land#traversable) lens
|
|
5
6
|
* from an [Applicative](https://github.com/fantasyland/fantasy-land#applicative)-returning function.
|
|
@@ -33,7 +34,6 @@ import Identity from './fantasy-land/Identity';
|
|
|
33
34
|
*
|
|
34
35
|
* R.set(maybeLens, Maybe.Just(1), [Maybe.just(2), Maybe.Just(3)]); // => Maybe.Just([1, 1])
|
|
35
36
|
*/
|
|
36
|
-
|
|
37
37
|
var lensTraverse = curryN(1, function (of) {
|
|
38
38
|
return curry(function (toFunctorFn, target) {
|
|
39
39
|
return Identity.of(traverse(of, pipe(toFunctorFn, prop('value')), target));
|
package/es/liftF.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { curryN } from 'ramda';
|
|
2
2
|
import liftFN from './liftFN';
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* "lifts" a function to be the specified arity, so that it may "map over" objects that satisfy
|
|
5
6
|
* the fantasy land Apply spec of algebraic structures.
|
|
@@ -30,7 +31,6 @@ import liftFN from './liftFN';
|
|
|
30
31
|
* madd3(Maybe.Some(10), Maybe.Some(15), Maybe.Some(17)); //=> Maybe.Some(42)
|
|
31
32
|
* madd3(Maybe.Some(10), Maybe.Nothing(), Maybe.Some(17)); //=> Maybe.Nothing()
|
|
32
33
|
*/
|
|
33
|
-
|
|
34
34
|
var liftF = curryN(1, function (fn) {
|
|
35
35
|
return liftFN(fn.length, fn);
|
|
36
36
|
});
|
package/es/liftFN.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { curry, head, slice, reduce, curryN, map } from 'ramda';
|
|
2
2
|
import ap from './internal/ap';
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* "lifts" a function to be the specified arity, so that it may "map over" objects that satisfy
|
|
5
6
|
* the fantasy land Apply spec of algebraic structures.
|
|
@@ -31,14 +32,12 @@ import ap from './internal/ap';
|
|
|
31
32
|
* madd3(Maybe.Some(10), Maybe.Some(15), Maybe.Some(17)); //=> Maybe.Some(42)
|
|
32
33
|
* madd3(Maybe.Some(10), Maybe.Nothing(), Maybe.Some(17)); //=> Maybe.Nothing()
|
|
33
34
|
*/
|
|
34
|
-
|
|
35
35
|
var liftFN = curry(function (arity, fn) {
|
|
36
36
|
var lifted = curryN(arity, fn);
|
|
37
37
|
return curryN(arity, function () {
|
|
38
38
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
39
39
|
args[_key] = arguments[_key];
|
|
40
40
|
}
|
|
41
|
-
|
|
42
41
|
var accumulator = map(lifted, head(args));
|
|
43
42
|
var apps = slice(1, Infinity, args);
|
|
44
43
|
return reduce(ap, accumulator, apps);
|
package/es/list.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { unapply, identity } from 'ramda';
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* Creates a list from arguments.
|
|
4
5
|
*
|
|
@@ -14,6 +15,5 @@ import { unapply, identity } from 'ramda';
|
|
|
14
15
|
*
|
|
15
16
|
* RA.list('a', 'b', 'c'); //=> ['a', 'b', 'c']
|
|
16
17
|
*/
|
|
17
|
-
|
|
18
18
|
var list = unapply(identity);
|
|
19
19
|
export default list;
|
package/es/mapIndexed.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { addIndex, map } from 'ramda';
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* {@link http://ramdajs.com/docs/#map|R.map} function that more closely resembles Array.prototype.map.
|
|
4
5
|
* It takes two new parameters to its callback function: the current index, and the entire list.
|
|
@@ -21,6 +22,5 @@ import { addIndex, map } from 'ramda';
|
|
|
21
22
|
* RA.mapIndexed((val, idx, list) => idx + '-' + val, ['f', 'o', 'o', 'b', 'a', 'r']);
|
|
22
23
|
* //=> ['0-f', '1-o', '2-o', '3-b', '4-a', '5-r']
|
|
23
24
|
*/
|
|
24
|
-
|
|
25
25
|
var mapIndexed = addIndex(map);
|
|
26
26
|
export default mapIndexed;
|
package/es/mergePath.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { curry, over, lensPath, mergeLeft } from 'ramda';
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* Create a new object with the own properties of the object under the `path`
|
|
4
5
|
* merged with the own properties of the provided `source`.
|
|
@@ -22,7 +23,6 @@ import { curry, over, lensPath, mergeLeft } from 'ramda';
|
|
|
22
23
|
* { outer: { inner: { foo: 2 } } }
|
|
23
24
|
* ); //=> { outer: { inner: { foo: 3, bar: 4 } }
|
|
24
25
|
*/
|
|
25
|
-
|
|
26
26
|
var mergePath = curry(function (path, source, obj) {
|
|
27
27
|
return over(lensPath(path), mergeLeft(source), obj);
|
|
28
28
|
});
|
package/es/mergePaths.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { curryN, pipe, mergeAll } from 'ramda';
|
|
2
2
|
import paths from './paths';
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* Merge objects under corresponding paths.
|
|
5
6
|
*
|
|
@@ -22,6 +23,5 @@ import paths from './paths';
|
|
|
22
23
|
* { ...obj.foo.fooInner, ...obj.bar }; //=> { fooInner2: 1, barInner: 2 }
|
|
23
24
|
* RA.mergePaths([['foo', 'fooInner'], ['bar']], obj); //=> { fooInner2: 1, barInner: 2 }
|
|
24
25
|
*/
|
|
25
|
-
|
|
26
26
|
var mergePaths = curryN(2, pipe(paths, mergeAll));
|
|
27
27
|
export default mergePaths;
|