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
|
@@ -1,12 +1,13 @@
|
|
|
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); }
|
|
1
2
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
2
|
-
|
|
3
|
-
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); } }
|
|
4
|
-
|
|
3
|
+
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); } }
|
|
5
4
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
6
|
-
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
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); }
|
|
7
7
|
import { empty as emptyR } from 'ramda';
|
|
8
8
|
import * as fl from './mapping';
|
|
9
9
|
import { applyTrait, functorTrait, setoidTrait, semigroupTrait, chainTrait, ordTrait } from './traits';
|
|
10
|
+
|
|
10
11
|
/**
|
|
11
12
|
* The simplest {@link https://github.com/fantasyland/fantasy-land|fantasy-land}
|
|
12
13
|
* compatible monad which attaches no information to values.
|
|
@@ -30,7 +31,6 @@ import { applyTrait, functorTrait, setoidTrait, semigroupTrait, chainTrait, ordT
|
|
|
30
31
|
* {@link https://github.com/fantasyland/fantasy-land#contravariant|Contravariant}
|
|
31
32
|
* @since {@link https://char0n.github.io/ramda-adjunct/1.8.0|v1.8.0}
|
|
32
33
|
*/
|
|
33
|
-
|
|
34
34
|
var Identity = /*#__PURE__*/function (_fl$of, _fl$ap, _fl$map, _fl$equals, _fl$concat, _fl$chain, _fl$lte, _fl$empty, _fl$contramap) {
|
|
35
35
|
/**
|
|
36
36
|
* Private constructor. Use {@link RA.Identity.of|Identity.of} instead.
|
|
@@ -40,9 +40,9 @@ var Identity = /*#__PURE__*/function (_fl$of, _fl$ap, _fl$map, _fl$equals, _fl$c
|
|
|
40
40
|
*/
|
|
41
41
|
function Identity(value) {
|
|
42
42
|
_classCallCheck(this, Identity);
|
|
43
|
-
|
|
44
43
|
this.value = value;
|
|
45
44
|
}
|
|
45
|
+
|
|
46
46
|
/**
|
|
47
47
|
* Catamorphism for a value.
|
|
48
48
|
* @returns {*}
|
|
@@ -51,13 +51,12 @@ var Identity = /*#__PURE__*/function (_fl$of, _fl$ap, _fl$map, _fl$equals, _fl$c
|
|
|
51
51
|
* const a = Identity.of(1);
|
|
52
52
|
* a.get(); //=> 1
|
|
53
53
|
*/
|
|
54
|
-
|
|
55
|
-
|
|
56
54
|
_createClass(Identity, [{
|
|
57
55
|
key: "get",
|
|
58
56
|
value: function get() {
|
|
59
57
|
return this.value;
|
|
60
58
|
}
|
|
59
|
+
|
|
61
60
|
/**
|
|
62
61
|
* Fantasy land {@link https://github.com/fantasyland/fantasy-land#apply|Apply} specification.
|
|
63
62
|
*
|
|
@@ -71,7 +70,6 @@ var Identity = /*#__PURE__*/function (_fl$of, _fl$ap, _fl$map, _fl$equals, _fl$c
|
|
|
71
70
|
*
|
|
72
71
|
* a.ap(b); //=> Identity(2)
|
|
73
72
|
*/
|
|
74
|
-
|
|
75
73
|
}, {
|
|
76
74
|
key: _fl$ap,
|
|
77
75
|
value: function value(applyWithFn) {
|
|
@@ -82,6 +80,7 @@ var Identity = /*#__PURE__*/function (_fl$of, _fl$ap, _fl$map, _fl$equals, _fl$c
|
|
|
82
80
|
value: function ap(applyWithFn) {
|
|
83
81
|
return this[fl.ap](applyWithFn);
|
|
84
82
|
}
|
|
83
|
+
|
|
85
84
|
/**
|
|
86
85
|
* Fantasy land {@link https://github.com/fantasyland/fantasy-land#functor|Functor} specification.
|
|
87
86
|
*
|
|
@@ -93,7 +92,6 @@ var Identity = /*#__PURE__*/function (_fl$of, _fl$ap, _fl$map, _fl$equals, _fl$c
|
|
|
93
92
|
* const a = Identity.of(1);
|
|
94
93
|
* a.map(a => a + 1); //=> Identity(2)
|
|
95
94
|
*/
|
|
96
|
-
|
|
97
95
|
}, {
|
|
98
96
|
key: _fl$map,
|
|
99
97
|
value: function value(fn) {
|
|
@@ -104,6 +102,7 @@ var Identity = /*#__PURE__*/function (_fl$of, _fl$ap, _fl$map, _fl$equals, _fl$c
|
|
|
104
102
|
value: function map(fn) {
|
|
105
103
|
return this[fl.map](fn);
|
|
106
104
|
}
|
|
105
|
+
|
|
107
106
|
/**
|
|
108
107
|
* Fantasy land {@link https://github.com/fantasyland/fantasy-land#setoid|Setoid} specification.
|
|
109
108
|
*
|
|
@@ -119,7 +118,6 @@ var Identity = /*#__PURE__*/function (_fl$of, _fl$ap, _fl$map, _fl$equals, _fl$c
|
|
|
119
118
|
* a.equals(b); //=> true
|
|
120
119
|
* a.equals(c); //=> false
|
|
121
120
|
*/
|
|
122
|
-
|
|
123
121
|
}, {
|
|
124
122
|
key: _fl$equals,
|
|
125
123
|
value: function value(setoid) {
|
|
@@ -130,6 +128,7 @@ var Identity = /*#__PURE__*/function (_fl$of, _fl$ap, _fl$map, _fl$equals, _fl$c
|
|
|
130
128
|
value: function equals(setoid) {
|
|
131
129
|
return this[fl.equals](setoid);
|
|
132
130
|
}
|
|
131
|
+
|
|
133
132
|
/**
|
|
134
133
|
* Fantasy land {@link https://github.com/fantasyland/fantasy-land#semigroup|Semigroup} specification.
|
|
135
134
|
*
|
|
@@ -150,7 +149,6 @@ var Identity = /*#__PURE__*/function (_fl$of, _fl$ap, _fl$map, _fl$equals, _fl$c
|
|
|
150
149
|
* const f = Identity.of(['f']);
|
|
151
150
|
* e.concat(f); //=> ['e', 'f']
|
|
152
151
|
*/
|
|
153
|
-
|
|
154
152
|
}, {
|
|
155
153
|
key: _fl$concat,
|
|
156
154
|
value: function value(semigroup) {
|
|
@@ -161,6 +159,7 @@ var Identity = /*#__PURE__*/function (_fl$of, _fl$ap, _fl$map, _fl$equals, _fl$c
|
|
|
161
159
|
value: function concat(semigroup) {
|
|
162
160
|
return this[fl.concat](semigroup);
|
|
163
161
|
}
|
|
162
|
+
|
|
164
163
|
/**
|
|
165
164
|
* Fantasy land {@link https://github.com/fantasyland/fantasy-land#chain|Chain} specification.
|
|
166
165
|
*
|
|
@@ -174,7 +173,6 @@ var Identity = /*#__PURE__*/function (_fl$of, _fl$ap, _fl$map, _fl$equals, _fl$c
|
|
|
174
173
|
*
|
|
175
174
|
* a.chain(fn).chain(fn); //=> Identity(3)
|
|
176
175
|
*/
|
|
177
|
-
|
|
178
176
|
}, {
|
|
179
177
|
key: _fl$chain,
|
|
180
178
|
value: function value(fn) {
|
|
@@ -185,6 +183,7 @@ var Identity = /*#__PURE__*/function (_fl$of, _fl$ap, _fl$map, _fl$equals, _fl$c
|
|
|
185
183
|
value: function chain(fn) {
|
|
186
184
|
return this[fl.chain](fn);
|
|
187
185
|
}
|
|
186
|
+
|
|
188
187
|
/**
|
|
189
188
|
* Fantasy land {@link https://github.com/fantasyland/fantasy-land#ord|Ord} specification.
|
|
190
189
|
*
|
|
@@ -201,7 +200,6 @@ var Identity = /*#__PURE__*/function (_fl$of, _fl$ap, _fl$map, _fl$equals, _fl$c
|
|
|
201
200
|
* a.lte(c); //=> true
|
|
202
201
|
* c.lte(a); //=> false
|
|
203
202
|
*/
|
|
204
|
-
|
|
205
203
|
}, {
|
|
206
204
|
key: _fl$lte,
|
|
207
205
|
value: function value(ord) {
|
|
@@ -212,6 +210,7 @@ var Identity = /*#__PURE__*/function (_fl$of, _fl$ap, _fl$map, _fl$equals, _fl$c
|
|
|
212
210
|
value: function lte(ord) {
|
|
213
211
|
return this[fl.lte](ord);
|
|
214
212
|
}
|
|
213
|
+
|
|
215
214
|
/**
|
|
216
215
|
* Fantasy land {@link https://github.com/fantasyland/fantasy-land#monoid|Monoid*} specification.
|
|
217
216
|
* Partial implementation of Monoid specification. `empty` method on instance only, returning
|
|
@@ -228,7 +227,6 @@ var Identity = /*#__PURE__*/function (_fl$of, _fl$ap, _fl$map, _fl$equals, _fl$c
|
|
|
228
227
|
* a.concat(i); //=> Identity('string');
|
|
229
228
|
* i.concat(a); //=> Identity('string');
|
|
230
229
|
*/
|
|
231
|
-
|
|
232
230
|
}, {
|
|
233
231
|
key: _fl$empty,
|
|
234
232
|
value: function value() {
|
|
@@ -239,6 +237,7 @@ var Identity = /*#__PURE__*/function (_fl$of, _fl$ap, _fl$map, _fl$equals, _fl$c
|
|
|
239
237
|
value: function empty() {
|
|
240
238
|
return this[fl.empty]();
|
|
241
239
|
}
|
|
240
|
+
|
|
242
241
|
/**
|
|
243
242
|
* Fantasy land {@link https://github.com/fantasyland/fantasy-land#contravariant|Contravariant} specification.
|
|
244
243
|
*
|
|
@@ -255,12 +254,10 @@ var Identity = /*#__PURE__*/function (_fl$of, _fl$ap, _fl$map, _fl$equals, _fl$c
|
|
|
255
254
|
* Identity.of(identity).contramap(divide2).contramap(add1).get()(3); //=> 2
|
|
256
255
|
* Identity.of(identity).contramap(a => divide2(add1(a))).get()(3); //=> 2
|
|
257
256
|
*/
|
|
258
|
-
|
|
259
257
|
}, {
|
|
260
258
|
key: _fl$contramap,
|
|
261
259
|
value: function value(fn) {
|
|
262
260
|
var _this = this;
|
|
263
|
-
|
|
264
261
|
return this.constructor.of(function (value) {
|
|
265
262
|
return _this.value(fn(value));
|
|
266
263
|
});
|
|
@@ -292,18 +289,16 @@ var Identity = /*#__PURE__*/function (_fl$of, _fl$ap, _fl$map, _fl$equals, _fl$c
|
|
|
292
289
|
value: function of(value) {
|
|
293
290
|
return new Identity(value);
|
|
294
291
|
}
|
|
292
|
+
|
|
295
293
|
/**
|
|
296
294
|
* @static
|
|
297
295
|
*/
|
|
298
|
-
|
|
299
296
|
}, {
|
|
300
297
|
key: '@@type',
|
|
301
298
|
get: function get() {
|
|
302
299
|
return 'RA/Identity';
|
|
303
300
|
}
|
|
304
301
|
}]);
|
|
305
|
-
|
|
306
302
|
return Identity;
|
|
307
303
|
}(fl.of, fl.ap, fl.map, fl.equals, fl.concat, fl.chain, fl.lte, fl.empty, fl.contramap);
|
|
308
|
-
|
|
309
304
|
export default Identity;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
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
|
+
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; }
|
|
3
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
4
|
+
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); }
|
|
3
5
|
import { equals, pathSatisfies } from 'ramda';
|
|
4
6
|
import isString from '../isString';
|
|
5
7
|
import isNumber from '../isNumber';
|
|
@@ -11,7 +13,6 @@ export var functorTrait = _defineProperty({}, fl.map, function (fn) {
|
|
|
11
13
|
});
|
|
12
14
|
export var applyTrait = _defineProperty({}, fl.ap, function (applyWithFn) {
|
|
13
15
|
var _this = this;
|
|
14
|
-
|
|
15
16
|
return applyWithFn.map(function (fn) {
|
|
16
17
|
return fn(_this.value);
|
|
17
18
|
});
|
|
@@ -21,7 +22,6 @@ export var setoidTrait = _defineProperty({}, fl.equals, function (setoid) {
|
|
|
21
22
|
});
|
|
22
23
|
export var semigroupTrait = _defineProperty({}, fl.concat, function (semigroup) {
|
|
23
24
|
var concatenatedValue = this.value;
|
|
24
|
-
|
|
25
25
|
if (isString(this.value) || isNumber(this.value)) {
|
|
26
26
|
concatenatedValue = this.value + semigroup.value;
|
|
27
27
|
} else if (pathSatisfies(isFunction, ['value', fl.concat], this)) {
|
|
@@ -29,7 +29,6 @@ export var semigroupTrait = _defineProperty({}, fl.concat, function (semigroup)
|
|
|
29
29
|
} else if (pathSatisfies(isFunction, ['value', 'concat'], this)) {
|
|
30
30
|
concatenatedValue = this.value.concat(semigroup.value);
|
|
31
31
|
}
|
|
32
|
-
|
|
33
32
|
return this.constructor[fl.of](concatenatedValue);
|
|
34
33
|
});
|
|
35
34
|
export var chainTrait = _defineProperty({}, fl.chain, function (fn) {
|
package/es/fantasy-land/util.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import { useWith, curry, curryN, equals, path, either, complement } from 'ramda';
|
|
1
|
+
import { useWith, curry, curryN, equals, path, either, complement } from 'ramda';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// type :: Monad a => a -> String
|
|
4
|
+
export var type = either(path(['@@type']), path(['constructor', '@@type']));
|
|
4
5
|
|
|
6
|
+
// typeEquals :: Monad a => String -> a -> Boolean
|
|
5
7
|
export var typeEquals = curry(function (typeIdent, monad) {
|
|
6
8
|
return type(monad) === typeIdent;
|
|
7
|
-
});
|
|
9
|
+
});
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
// isSameType :: (Monad a, Monad b) => a -> b -> Boolean
|
|
12
|
+
export var isSameType = curryN(2, useWith(equals, [type, type]));
|
|
10
13
|
|
|
14
|
+
// isNotSameType :: (Monad a, Monad b) => a -> b -> Boolean
|
|
11
15
|
export var isNotSameType = complement(isSameType);
|
package/es/filterIndexed.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { addIndex, filter } from 'ramda';
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* {@link http://ramdajs.com/docs/#filter|R.filter} function that more closely resembles `Array.prototype.filter`.
|
|
4
5
|
* It takes two new parameters to its callback function: the current index, and the entire list.
|
|
@@ -22,6 +23,5 @@ import { addIndex, filter } from 'ramda';
|
|
|
22
23
|
* const isValueGtIndex = (val, idx) => val > idx;
|
|
23
24
|
* RA.filterIndexed(isValueGtIndex, [5, 4, 3, 2, 1, 0]); //=> [5, 4, 3]
|
|
24
25
|
*/
|
|
25
|
-
|
|
26
26
|
var filterIndexed = addIndex(filter);
|
|
27
27
|
export default filterIndexed;
|
package/es/findOr.js
CHANGED
package/es/flattenDepth.js
CHANGED
|
@@ -1,19 +1,13 @@
|
|
|
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 { curry } from 'ramda';
|
|
14
8
|
import _makeFlat from './internal/makeFlat';
|
|
15
|
-
|
|
16
9
|
var flatten1 = _makeFlat(false);
|
|
10
|
+
|
|
17
11
|
/**
|
|
18
12
|
* Flattens the list to the specified depth.
|
|
19
13
|
*
|
|
@@ -33,18 +27,13 @@ var flatten1 = _makeFlat(false);
|
|
|
33
27
|
* [1, [2], [3, [4, 5], 6, [[[7], 8]]], 9, 10]
|
|
34
28
|
* ); //=> [1, 2, 3, 4, 5, 6, [[7], 8], 9, 10];
|
|
35
29
|
*/
|
|
36
|
-
|
|
37
|
-
|
|
38
30
|
var flattenDepth = curry(function (depth, list) {
|
|
39
31
|
var currentDept = depth;
|
|
40
|
-
|
|
41
32
|
var flatList = _toConsumableArray(list);
|
|
42
|
-
|
|
43
33
|
while (currentDept > 0) {
|
|
44
34
|
flatList = flatten1(flatList);
|
|
45
35
|
currentDept -= 1;
|
|
46
36
|
}
|
|
47
|
-
|
|
48
37
|
return flatList;
|
|
49
38
|
});
|
|
50
39
|
export default flattenDepth;
|
package/es/flattenPath.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { pathOr, curry, mergeRight } from 'ramda';
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* Flattens a property path so that its fields are spread out into the provided object.
|
|
4
5
|
* It's like {@link RA.spreadPath|spreadPath}, but preserves object under the property path.
|
|
@@ -20,7 +21,6 @@ import { pathOr, curry, mergeRight } from 'ramda';
|
|
|
20
21
|
* { a: 1, b1: { b2: { c: 3, d: 4 } } }
|
|
21
22
|
* ); // => { a: 1, c: 3, d: 4, b1: { b2: { c: 3, d: 4 } } };
|
|
22
23
|
*/
|
|
23
|
-
|
|
24
24
|
var flattenPath = curry(function (path, obj) {
|
|
25
25
|
return mergeRight(obj, pathOr({}, path, obj));
|
|
26
26
|
});
|
package/es/flattenProp.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { of, curry } from 'ramda';
|
|
2
2
|
import flattenPath from './flattenPath';
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* Flattens a property so that its fields are spread out into the provided object.
|
|
5
6
|
* It's like {@link RA.spreadProp|spreadProp}, but preserves object under the property path.
|
|
@@ -21,7 +22,6 @@ import flattenPath from './flattenPath';
|
|
|
21
22
|
* { a: 1, b: { c: 3, d: 4 } }
|
|
22
23
|
* ); // => { a: 1, c: 3, d: 4, b: { c: 3, d: 4 } };
|
|
23
24
|
*/
|
|
24
|
-
|
|
25
25
|
var flattenProp = curry(function (prop, obj) {
|
|
26
26
|
return flattenPath(of(prop), obj);
|
|
27
27
|
});
|
package/es/floor.js
CHANGED
package/es/fnull.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { isNil, curryN, curry, apply } from 'ramda';
|
|
2
2
|
import defaultWhen from './defaultWhen';
|
|
3
3
|
import mapIndexed from './mapIndexed';
|
|
4
|
+
|
|
4
5
|
/**
|
|
5
6
|
* Returns a function which is called with the given arguments. If any of the given arguments are null or undefined,
|
|
6
7
|
* the corresponding default value for that argument is used instead.
|
|
@@ -27,7 +28,6 @@ var fnull = curry(function (fn, defaults) {
|
|
|
27
28
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
28
29
|
args[_key] = arguments[_key];
|
|
29
30
|
}
|
|
30
|
-
|
|
31
31
|
var argsWithDefaults = mapIndexed(function (val, idx) {
|
|
32
32
|
return defaultWhen(isNil, defaults[idx], val);
|
|
33
33
|
}, args);
|
package/es/inRange.js
CHANGED
|
@@ -2,6 +2,7 @@ import { ifElse, curry, useWith, both, gte, lte, gt } from 'ramda';
|
|
|
2
2
|
var inRangeImp = ifElse(gte, function () {
|
|
3
3
|
throw new Error('low must not be greater than high in inRange(low, high, value)');
|
|
4
4
|
}, useWith(both, [lte, gt]));
|
|
5
|
+
|
|
5
6
|
/**
|
|
6
7
|
* Checks if `value` is between `low` and up to but not including `high`.
|
|
7
8
|
*
|
|
@@ -23,7 +24,6 @@ var inRangeImp = ifElse(gte, function () {
|
|
|
23
24
|
* RA.inRange(0, 5, 5); //=> false
|
|
24
25
|
* RA.inRange(0, 5, -1); //=> false
|
|
25
26
|
*/
|
|
26
|
-
|
|
27
27
|
export default curry(function (low, high, value) {
|
|
28
28
|
return inRangeImp(low, high)(value);
|
|
29
29
|
});
|
package/es/included.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { flip, includes } from 'ramda';
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* Returns true if the specified value is equal, in R.equals terms,
|
|
4
5
|
* to at least one element of the given list or false otherwise.
|
|
@@ -22,6 +23,5 @@ import { flip, includes } from 'ramda';
|
|
|
22
23
|
* RA.included([{ name: 'Fred' }], { name: 'Fred' }); //=> true
|
|
23
24
|
* RA.included([[42]], [42]); //=> true
|
|
24
25
|
*/
|
|
25
|
-
|
|
26
26
|
var included = flip(includes);
|
|
27
27
|
export default included;
|
package/es/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @namespace RA
|
|
3
3
|
*/
|
|
4
|
+
|
|
4
5
|
// Type
|
|
5
6
|
export { default as isNotUndefined } from './isNotUndefined';
|
|
6
7
|
export { default as isUndefined } from './isUndefined';
|
|
@@ -29,27 +30,21 @@ export { default as isFunction } from './isFunction';
|
|
|
29
30
|
export { default as isNotFunction } from './isNotFunction';
|
|
30
31
|
export { default as isObj } from './isObj';
|
|
31
32
|
export { default as isObject } from './isObj'; // alias of isObj
|
|
32
|
-
|
|
33
33
|
export { default as isNotObj } from './isNotObj';
|
|
34
34
|
export { default as isNotObject } from './isNotObj'; // alias of isNotObj
|
|
35
|
-
|
|
36
35
|
export { default as isObjLike } from './isObjLike';
|
|
37
36
|
export { default as isObjectLike } from './isObjLike'; // alias of isObjLike
|
|
38
|
-
|
|
39
37
|
export { default as isNotObjLike } from './isNotObjLike';
|
|
40
38
|
export { default as isNotObjectLike } from './isNotObjLike'; // alias of isNotObjLike
|
|
41
|
-
|
|
42
39
|
export { default as isPlainObj } from './isPlainObj';
|
|
43
40
|
export { default as isPlainObject } from './isPlainObj';
|
|
44
41
|
export { default as isNotPlainObj } from './isNotPlainObj';
|
|
45
42
|
export { default as isNotPlainObject } from './isNotPlainObj'; // alias of isNotPlainObj
|
|
46
|
-
|
|
47
43
|
export { default as isDate } from './isDate';
|
|
48
44
|
export { default as isNotDate } from './isNotDate';
|
|
49
45
|
export { default as isValidDate } from './isValidDate';
|
|
50
46
|
export { default as isNotValidDate } from './isNotValidDate';
|
|
51
47
|
export { default as isInvalidDate } from './isNotValidDate'; // alias of isNotValidDate
|
|
52
|
-
|
|
53
48
|
export { default as isNumber } from './isNumber';
|
|
54
49
|
export { default as isNotNumber } from './isNotNumber';
|
|
55
50
|
export { default as isPositive } from './isPositive';
|
|
@@ -68,10 +63,8 @@ export { default as isNotFinite } from './isNotFinite';
|
|
|
68
63
|
export { default as isInteger } from './isInteger';
|
|
69
64
|
export { default as isInteger32 } from './isInteger32';
|
|
70
65
|
export { default as isInt32 } from './isInteger32'; // alias of isInteger32
|
|
71
|
-
|
|
72
66
|
export { default as isUinteger32 } from './isUinteger32';
|
|
73
67
|
export { default as isUint32 } from './isUinteger32'; // alias of isUinteger32
|
|
74
|
-
|
|
75
68
|
export { default as isNotInteger } from './isNotInteger';
|
|
76
69
|
export { default as isBigInt } from './isBigInt';
|
|
77
70
|
export { default as isFloat } from './isFloat';
|
|
@@ -101,8 +94,8 @@ export { default as isNaturalNumber } from './isNaturalNumber';
|
|
|
101
94
|
export { default as isPrimitive } from './isPrimitive';
|
|
102
95
|
export { default as isNotPrimitive } from './isNotPrimitive';
|
|
103
96
|
export { default as isSentinelValue } from './isSentinelValue';
|
|
104
|
-
export { default as isBlank } from './isBlank';
|
|
105
|
-
|
|
97
|
+
export { default as isBlank } from './isBlank';
|
|
98
|
+
// Function
|
|
106
99
|
export { default as stubUndefined } from './stubUndefined';
|
|
107
100
|
export { default as stubNull } from './stubNull';
|
|
108
101
|
export { default as stubObj } from './stubObj';
|
|
@@ -132,10 +125,9 @@ export { default as dispatch } from './dispatch';
|
|
|
132
125
|
export { default as async } from './async';
|
|
133
126
|
export { default as anyP } from './anyP';
|
|
134
127
|
export { default as firstP } from './anyP'; // alias of anyP
|
|
135
|
-
|
|
136
128
|
export { default as lastP } from './lastP';
|
|
137
|
-
export { default as fnull } from './fnull';
|
|
138
|
-
|
|
129
|
+
export { default as fnull } from './fnull';
|
|
130
|
+
// List
|
|
139
131
|
export { default as mapIndexed } from './mapIndexed';
|
|
140
132
|
export { default as reduceIndexed } from './reduceIndexed';
|
|
141
133
|
export { default as filterIndexed } from './filterIndexed';
|
|
@@ -169,11 +161,12 @@ export { default as toArray } from './toArray';
|
|
|
169
161
|
export { default as allUnique } from './allUnique';
|
|
170
162
|
export { default as notAllUnique } from './notAllUnique';
|
|
171
163
|
export { default as sortByProps } from './sortByProps';
|
|
164
|
+
export { default as sortByProp } from './sortByProp';
|
|
172
165
|
export { default as sortByPaths } from './sortByPaths';
|
|
173
166
|
export { default as skipTake } from './skipTake';
|
|
174
167
|
export { default as rangeStep } from './rangeStep';
|
|
175
|
-
export { default as findOr } from './findOr';
|
|
176
|
-
|
|
168
|
+
export { default as findOr } from './findOr';
|
|
169
|
+
// Object
|
|
177
170
|
export { default as invoke } from './invoke';
|
|
178
171
|
export { default as invokeArgs } from './invokeArgs';
|
|
179
172
|
export { default as paths } from './paths';
|
|
@@ -194,8 +187,8 @@ export { default as flattenProp } from './flattenProp';
|
|
|
194
187
|
export { default as flattenPath } from './flattenPath';
|
|
195
188
|
export { default as unzipObjWith } from './unzipObjWith';
|
|
196
189
|
export { default as zipObjWith } from './zipObjWith';
|
|
197
|
-
export { default as isPrototypeOf } from './isPrototypeOf';
|
|
198
|
-
|
|
190
|
+
export { default as isPrototypeOf } from './isPrototypeOf';
|
|
191
|
+
// Relation
|
|
199
192
|
export { default as lensEq } from './lensEq';
|
|
200
193
|
export { default as lensNotEq } from './lensNotEq';
|
|
201
194
|
export { default as lensSatisfies } from './lensSatisfies';
|
|
@@ -206,8 +199,8 @@ export { default as propNotEq } from './propNotEq';
|
|
|
206
199
|
export { default as pathNotEq } from './pathNotEq';
|
|
207
200
|
export { default as inRange } from './inRange';
|
|
208
201
|
export { default as notEqual } from './notEqual';
|
|
209
|
-
export { default as overlaps } from './overlaps';
|
|
210
|
-
|
|
202
|
+
export { default as overlaps } from './overlaps';
|
|
203
|
+
// Logic
|
|
211
204
|
export { default as isNotEmpty } from './isNotEmpty';
|
|
212
205
|
export { default as defaultWhen } from './defaultWhen';
|
|
213
206
|
export { default as notBoth } from './notBoth';
|
|
@@ -217,8 +210,8 @@ export { default as nor } from './nor';
|
|
|
217
210
|
export { default as notAllPass } from './notAllPass';
|
|
218
211
|
export { default as nonePass } from './nonePass';
|
|
219
212
|
export { default as argsPass } from './argsPass';
|
|
220
|
-
export { default as dropArgs } from './dropArgs';
|
|
221
|
-
|
|
213
|
+
export { default as dropArgs } from './dropArgs';
|
|
214
|
+
// Math
|
|
222
215
|
export { default as round } from './round';
|
|
223
216
|
export { default as ceil } from './ceil';
|
|
224
217
|
export { default as divideNum } from './divideNum';
|
|
@@ -228,25 +221,21 @@ export { default as sign } from './sign';
|
|
|
228
221
|
export { default as subtractNum } from './subtractNum';
|
|
229
222
|
export { default as toInteger32 } from './toInteger32';
|
|
230
223
|
export { default as toInt32 } from './toInteger32'; // alias of toInteger32
|
|
231
|
-
|
|
232
224
|
export { default as toUinteger32 } from './toUinteger32';
|
|
233
225
|
export { default as toUint32 } from './toUinteger32'; // alias of to toUinteger32
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
226
|
+
export { default as toNumber } from './toNumber';
|
|
227
|
+
// String
|
|
237
228
|
export { default as replaceAll } from './replaceAll';
|
|
238
229
|
export { default as escapeRegExp } from './escapeRegExp';
|
|
239
230
|
export { default as trimStart } from './trimStart';
|
|
240
231
|
export { default as trimLeft } from './trimStart'; // alias of trimStart
|
|
241
|
-
|
|
242
232
|
export { default as trimEnd } from './trimEnd';
|
|
243
233
|
export { default as trimRight } from './trimEnd'; // alias of trimEnd
|
|
244
|
-
|
|
245
234
|
export { default as trimCharsEnd } from './trimCharsEnd';
|
|
246
235
|
export { default as trimCharsStart } from './trimCharsStart';
|
|
247
236
|
export { default as padCharsStart } from './padCharsStart';
|
|
248
237
|
export { default as padCharsEnd } from './padCharsEnd';
|
|
249
238
|
export { default as padEnd } from './padEnd';
|
|
250
|
-
export { default as padStart } from './padStart';
|
|
251
|
-
|
|
239
|
+
export { default as padStart } from './padStart';
|
|
240
|
+
// Types
|
|
252
241
|
export { default as Identity } from './fantasy-land/Identity';
|
package/es/internal/ap.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
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
|
var isOfTypeObject = function isOfTypeObject(val) {
|
|
4
3
|
return _typeof(val) === 'object';
|
|
5
4
|
};
|
|
6
|
-
|
|
7
5
|
export default isOfTypeObject;
|
package/es/internal/makeFlat.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import isArrayLike from '../isArrayLike';
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* `makeFlat` is a helper function that returns a one-level or fully recursive
|
|
4
5
|
* function based on the flag passed in.
|
|
@@ -13,7 +14,6 @@ import isArrayLike from '../isArrayLike';
|
|
|
13
14
|
* @sig Bool -> List -> List
|
|
14
15
|
*
|
|
15
16
|
*/
|
|
16
|
-
|
|
17
17
|
var makeFlat = function makeFlat(recursive) {
|
|
18
18
|
return function flatt(list) {
|
|
19
19
|
var value;
|
|
@@ -21,13 +21,11 @@ var makeFlat = function makeFlat(recursive) {
|
|
|
21
21
|
var j;
|
|
22
22
|
var result = [];
|
|
23
23
|
var idx = 0;
|
|
24
|
-
|
|
25
24
|
while (idx < list.length) {
|
|
26
25
|
if (isArrayLike(list[idx])) {
|
|
27
26
|
value = recursive ? flatt(list[idx]) : list[idx];
|
|
28
27
|
j = 0;
|
|
29
28
|
jlen = value.length;
|
|
30
|
-
|
|
31
29
|
while (j < jlen) {
|
|
32
30
|
result[result.length] = value[j];
|
|
33
31
|
j += 1;
|
|
@@ -35,12 +33,9 @@ var makeFlat = function makeFlat(recursive) {
|
|
|
35
33
|
} else {
|
|
36
34
|
result[result.length] = list[idx];
|
|
37
35
|
}
|
|
38
|
-
|
|
39
36
|
idx += 1;
|
|
40
37
|
}
|
|
41
|
-
|
|
42
38
|
return result;
|
|
43
39
|
};
|
|
44
40
|
};
|
|
45
|
-
|
|
46
41
|
export default makeFlat;
|
|
@@ -1,40 +1,28 @@
|
|
|
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 } from 'ramda';
|
|
14
8
|
import isIterable from '../../isIterable';
|
|
15
9
|
import isNotUndefined from '../../isNotUndefined';
|
|
16
10
|
import isNotNil from '../../isNotNil';
|
|
17
11
|
import isNotFunction from '../../isNotFunction';
|
|
18
|
-
|
|
19
12
|
var copyArray = function copyArray(items, mapFn, thisArg) {
|
|
20
13
|
var boundMapFn = isNotUndefined(thisArg) ? bind(mapFn, thisArg) : mapFn;
|
|
21
14
|
return isNotUndefined(mapFn) ? _toConsumableArray(items).map(boundMapFn) : _toConsumableArray(items);
|
|
22
15
|
};
|
|
23
|
-
|
|
24
16
|
var fromArray = function fromArray(items, mapFn, thisArg) {
|
|
25
17
|
if (items == null) {
|
|
26
18
|
throw new TypeError('Array.from requires an array-like object - not null or undefined');
|
|
27
19
|
}
|
|
28
|
-
|
|
29
20
|
if (isNotNil(mapFn) && isNotFunction(mapFn)) {
|
|
30
21
|
throw new TypeError('Array.from: when provided, the second argument must be a function');
|
|
31
22
|
}
|
|
32
|
-
|
|
33
23
|
if (isIterable(items)) {
|
|
34
24
|
return copyArray(items, mapFn, thisArg);
|
|
35
25
|
}
|
|
36
|
-
|
|
37
26
|
return [];
|
|
38
27
|
};
|
|
39
|
-
|
|
40
28
|
export default fromArray;
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import isFinite from '../../isFinite';
|
|
2
|
-
|
|
3
2
|
var truncPonyfill = function truncPonyfill(v) {
|
|
4
3
|
var numV = Number(v);
|
|
5
|
-
|
|
6
4
|
if (!isFinite(numV)) {
|
|
7
5
|
return numV;
|
|
8
|
-
}
|
|
9
|
-
|
|
6
|
+
}
|
|
10
7
|
|
|
8
|
+
// eslint-disable-next-line no-nested-ternary
|
|
11
9
|
return numV - numV % 1 || (numV < 0 ? -0 : numV === 0 ? numV : 0);
|
|
12
10
|
};
|
|
13
|
-
|
|
14
11
|
export default truncPonyfill;
|