ramda-adjunct 5.0.0 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/README.md +1 -1
- package/dist/RA.node.js +10444 -452
- package/dist/RA.node.min.js +1 -1
- package/dist/RA.web.js +10444 -452
- package/dist/RA.web.min.js +1 -1
- package/dist/RA.web.standalone.js +18665 -447
- package/dist/RA.web.standalone.min.js +1 -1
- package/dist/package.json +1 -0
- package/es/copyKeys.js +1 -1
- package/es/dispatch.js +5 -5
- package/es/fantasy-land/Identity.js +3 -3
- package/es/fantasy-land/traits.js +1 -1
- package/es/flattenDepth.js +5 -5
- package/es/internal/ponyfills/Array.from.js +5 -5
- package/es/internal/ponyfills/Promise.allSettled.js +5 -5
- package/es/internal/ponyfills/Promise.any.js +15 -15
- package/es/lastP.js +5 -5
- package/es/reduceP.js +4 -4
- package/es/reduceRightP.js +4 -4
- package/es/renameKey.js +1 -1
- package/es/sortByProps.js +5 -5
- package/lib/allEqual.js +1 -1
- package/lib/allIdentical.js +1 -1
- package/lib/allSettledP.js +1 -1
- package/lib/allUnique.js +1 -1
- package/lib/anyP.js +1 -1
- package/lib/argsPass.js +1 -1
- package/lib/async.js +1 -1
- package/lib/cata.js +1 -1
- package/lib/compact.js +1 -1
- package/lib/concatAll.js +1 -1
- package/lib/copyKeys.js +2 -2
- package/lib/curryRight.js +1 -1
- package/lib/delayP.js +1 -1
- package/lib/dispatch.js +6 -6
- package/lib/ensureArray.js +1 -1
- package/lib/escapeRegExp.js +1 -1
- package/lib/fantasy-land/Identity.js +3 -3
- package/lib/fantasy-land/traits.js +2 -2
- package/lib/flattenDepth.js +6 -6
- package/lib/flattenProp.js +1 -1
- package/lib/fnull.js +1 -1
- package/lib/index.js +1 -1
- package/lib/internal/ap.js +1 -1
- package/lib/internal/isCoercible.js +1 -1
- package/lib/internal/makeFlat.js +1 -1
- package/lib/internal/ponyfills/Array.from.js +6 -6
- package/lib/internal/ponyfills/Math.trunc.js +1 -1
- package/lib/internal/ponyfills/Number.isFinite.js +1 -1
- package/lib/internal/ponyfills/Number.isInteger.js +1 -1
- package/lib/internal/ponyfills/Number.isNaN.js +1 -1
- package/lib/internal/ponyfills/Number.isSafeInteger.js +1 -1
- package/lib/internal/ponyfills/Promise.allSettled.js +6 -6
- package/lib/internal/ponyfills/Promise.any.js +16 -16
- package/lib/internal/ponyfills/String.padEnd.js +1 -1
- package/lib/internal/ponyfills/String.padStart.js +1 -1
- package/lib/internal/ponyfills/String.repeat.js +1 -1
- package/lib/internal/ponyfills/String.replaceAll.js +1 -1
- package/lib/invoke.js +1 -1
- package/lib/invokeArgs.js +1 -1
- package/lib/isArray.js +1 -1
- package/lib/isArrayLike.js +1 -1
- package/lib/isBlank.js +1 -1
- package/lib/isEmptyArray.js +1 -1
- package/lib/isEven.js +1 -1
- package/lib/isFalsy.js +1 -1
- package/lib/isFinite.js +1 -1
- package/lib/isFloat.js +1 -1
- package/lib/isFunction.js +1 -1
- package/lib/isIndexed.js +1 -1
- package/lib/isInteger.js +1 -1
- package/lib/isInteger32.js +1 -1
- package/lib/isIterable.js +1 -1
- package/lib/isNaN.js +1 -1
- package/lib/isNaturalNumber.js +1 -1
- package/lib/isNegative.js +1 -1
- package/lib/isNonEmptyArray.js +1 -1
- package/lib/isNonEmptyString.js +1 -1
- package/lib/isNonNegative.js +1 -1
- package/lib/isNonPositive.js +1 -1
- package/lib/isNotArray.js +1 -1
- package/lib/isNotArrayLike.js +1 -1
- package/lib/isNotAsyncFunction.js +1 -1
- package/lib/isNotBoolean.js +1 -1
- package/lib/isNotDate.js +1 -1
- package/lib/isNotFinite.js +1 -1
- package/lib/isNotFloat.js +1 -1
- package/lib/isNotFunction.js +1 -1
- package/lib/isNotGeneratorFunction.js +1 -1
- package/lib/isNotInteger.js +1 -1
- package/lib/isNotMap.js +1 -1
- package/lib/isNotNaN.js +1 -1
- package/lib/isNotNilOrEmpty.js +1 -1
- package/lib/isNotNull.js +1 -1
- package/lib/isNotNumber.js +1 -1
- package/lib/isNotObj.js +1 -1
- package/lib/isNotObjLike.js +1 -1
- package/lib/isNotPair.js +1 -1
- package/lib/isNotPlainObj.js +1 -1
- package/lib/isNotPrimitive.js +1 -1
- package/lib/isNotRegExp.js +1 -1
- package/lib/isNotSet.js +1 -1
- package/lib/isNotString.js +1 -1
- package/lib/isNotUndefined.js +1 -1
- package/lib/isNotValidDate.js +1 -1
- package/lib/isNotValidNumber.js +1 -1
- package/lib/isObj.js +1 -1
- package/lib/isObjLike.js +1 -1
- package/lib/isOdd.js +1 -1
- package/lib/isPair.js +1 -1
- package/lib/isPlainObj.js +1 -1
- package/lib/isPositive.js +1 -1
- package/lib/isPrimitive.js +1 -1
- package/lib/isPromise.js +1 -1
- package/lib/isPrototypeOf.js +1 -1
- package/lib/isSafeInteger.js +1 -1
- package/lib/isSentinelValue.js +1 -1
- package/lib/isSparseArray.js +1 -1
- package/lib/isThenable.js +1 -1
- package/lib/isUinteger32.js +1 -1
- package/lib/isUndefined.js +1 -1
- package/lib/isValidDate.js +1 -1
- package/lib/isValidNumber.js +1 -1
- package/lib/lastP.js +6 -6
- package/lib/lengthEq.js +1 -1
- package/lib/lengthGt.js +1 -1
- package/lib/lengthGte.js +1 -1
- package/lib/lengthLt.js +1 -1
- package/lib/lengthLte.js +1 -1
- package/lib/lengthNotEq.js +1 -1
- package/lib/lensNotEq.js +1 -1
- package/lib/lensNotSatisfy.js +1 -1
- package/lib/lensSatisfies.js +1 -1
- package/lib/lensTraverse.js +1 -1
- package/lib/liftF.js +1 -1
- package/lib/liftFN.js +1 -1
- package/lib/mergePaths.js +1 -1
- package/lib/mergeProp.js +1 -1
- package/lib/noneP.js +1 -1
- package/lib/noop.js +1 -1
- package/lib/notAllUnique.js +1 -1
- package/lib/padCharsEnd.js +1 -1
- package/lib/padCharsStart.js +1 -1
- package/lib/padEnd.js +1 -1
- package/lib/padStart.js +1 -1
- package/lib/rangeStep.js +1 -1
- package/lib/reduceP.js +5 -5
- package/lib/reduceRightP.js +5 -5
- package/lib/renameKey.js +2 -2
- package/lib/renameKeyWith.js +1 -1
- package/lib/renameKeys.js +1 -1
- package/lib/repeatStr.js +1 -1
- package/lib/replaceAll.js +1 -1
- package/lib/sign.js +1 -1
- package/lib/sortByProp.js +1 -1
- package/lib/sortByProps.js +5 -5
- package/lib/spreadProp.js +1 -1
- package/lib/toArray.js +1 -1
- package/lib/toNumber.js +1 -1
- package/lib/trimCharsEnd.js +1 -1
- package/lib/trimCharsStart.js +1 -1
- package/lib/trimEnd.js +1 -1
- package/lib/trimStart.js +1 -1
- package/lib/trunc.js +1 -1
- package/lib/unzipObjWith.js +1 -1
- package/package.json +22 -19
- package/babel.config.cjs +0 -56
- package/src/Y.js +0 -32
- package/src/allEqual.js +0 -28
- package/src/allEqualTo.js +0 -25
- package/src/allIdentical.js +0 -26
- package/src/allIdenticalTo.js +0 -25
- package/src/allP.js +0 -27
- package/src/allSettledP.js +0 -34
- package/src/allUnique.js +0 -25
- package/src/anyP.js +0 -33
- package/src/appendFlipped.js +0 -24
- package/src/argsPass.js +0 -40
- package/src/async.js +0 -60
- package/src/cata.js +0 -86
- package/src/catchP.js +0 -25
- package/src/ceil.js +0 -28
- package/src/compact.js +0 -23
- package/src/concatAll.js +0 -35
- package/src/concatRight.js +0 -30
- package/src/copyKeys.js +0 -31
- package/src/curryRight.js +0 -26
- package/src/curryRightN.js +0 -29
- package/src/defaultWhen.js +0 -26
- package/src/delayP.js +0 -45
- package/src/dispatch.js +0 -74
- package/src/divideNum.js +0 -20
- package/src/dropArgs.js +0 -23
- package/src/ensureArray.js +0 -24
- package/src/escapeRegExp.js +0 -22
- package/src/fantasy-land/Identity.js +0 -270
- package/src/fantasy-land/mapping.js +0 -20
- package/src/fantasy-land/traits.js +0 -57
- package/src/fantasy-land/util.js +0 -23
- package/src/filterIndexed.js +0 -28
- package/src/findOr.js +0 -30
- package/src/flattenDepth.js +0 -39
- package/src/flattenPath.js +0 -28
- package/src/flattenProp.js +0 -28
- package/src/floor.js +0 -27
- package/src/fnull.js +0 -38
- package/src/inRange.js +0 -34
- package/src/included.js +0 -28
- package/src/index.js +0 -241
- package/src/internal/ap.js +0 -30
- package/src/internal/compareLength.js +0 -7
- package/src/internal/isCoercible.js +0 -12
- package/src/internal/isOfTypeObject.js +0 -3
- package/src/internal/makeFlat.js +0 -42
- package/src/internal/ponyfills/Array.from.js +0 -34
- package/src/internal/ponyfills/Math.sign.js +0 -3
- package/src/internal/ponyfills/Math.trunc.js +0 -14
- package/src/internal/ponyfills/Number.MAX_SAFE_INTEGER.js +0 -3
- package/src/internal/ponyfills/Number.MIN_SAFE_INTEGER.js +0 -3
- package/src/internal/ponyfills/Number.isFinite.js +0 -8
- package/src/internal/ponyfills/Number.isInteger.js +0 -10
- package/src/internal/ponyfills/Number.isNaN.js +0 -8
- package/src/internal/ponyfills/Number.isSafeInteger.js +0 -11
- package/src/internal/ponyfills/Promise.allSettled.js +0 -18
- package/src/internal/ponyfills/Promise.any.js +0 -29
- package/src/internal/ponyfills/String.padEnd.js +0 -25
- package/src/internal/ponyfills/String.padStart.js +0 -27
- package/src/internal/ponyfills/String.repeat.js +0 -49
- package/src/internal/ponyfills/String.replaceAll.js +0 -44
- package/src/internal/ponyfills/String.trimEnd.js +0 -5
- package/src/internal/ponyfills/String.trimStart.js +0 -5
- package/src/invoke.js +0 -22
- package/src/invokeArgs.js +0 -36
- package/src/isArray.js +0 -27
- package/src/isArrayLike.js +0 -79
- package/src/isAsyncFunction.js +0 -23
- package/src/isBigInt.js +0 -24
- package/src/isBlank.js +0 -33
- package/src/isBoolean.js +0 -22
- package/src/isDate.js +0 -21
- package/src/isEmptyArray.js +0 -28
- package/src/isEmptyString.js +0 -28
- package/src/isError.js +0 -21
- package/src/isEven.js +0 -31
- package/src/isFalse.js +0 -31
- package/src/isFalsy.js +0 -28
- package/src/isFinite.js +0 -37
- package/src/isFloat.js +0 -36
- package/src/isFunction.js +0 -32
- package/src/isGeneratorFunction.js +0 -26
- package/src/isIndexed.js +0 -24
- package/src/isInteger.js +0 -40
- package/src/isInteger32.js +0 -28
- package/src/isIterable.js +0 -37
- package/src/isMap.js +0 -25
- package/src/isNaN.js +0 -45
- package/src/isNaturalNumber.js +0 -28
- package/src/isNegative.js +0 -27
- package/src/isNegativeZero.js +0 -23
- package/src/isNilOrEmpty.js +0 -26
- package/src/isNonEmptyArray.js +0 -28
- package/src/isNonEmptyString.js +0 -31
- package/src/isNonNegative.js +0 -30
- package/src/isNonPositive.js +0 -30
- package/src/isNotArray.js +0 -24
- package/src/isNotArrayLike.js +0 -26
- package/src/isNotAsyncFunction.js +0 -27
- package/src/isNotBoolean.js +0 -24
- package/src/isNotDate.js +0 -23
- package/src/isNotFinite.js +0 -31
- package/src/isNotFloat.js +0 -35
- package/src/isNotFunction.js +0 -29
- package/src/isNotGeneratorFunction.js +0 -27
- package/src/isNotInteger.js +0 -36
- package/src/isNotMap.js +0 -27
- package/src/isNotNaN.js +0 -37
- package/src/isNotNil.js +0 -23
- package/src/isNotNilOrEmpty.js +0 -28
- package/src/isNotNull.js +0 -24
- package/src/isNotNumber.js +0 -25
- package/src/isNotObj.js +0 -29
- package/src/isNotObjLike.js +0 -29
- package/src/isNotPair.js +0 -27
- package/src/isNotPlainObj.js +0 -35
- package/src/isNotPrimitive.js +0 -26
- package/src/isNotRegExp.js +0 -24
- package/src/isNotSet.js +0 -26
- package/src/isNotString.js +0 -23
- package/src/isNotUndefined.js +0 -24
- package/src/isNotValidDate.js +0 -24
- package/src/isNotValidNumber.js +0 -27
- package/src/isNull.js +0 -22
- package/src/isNumber.js +0 -24
- package/src/isObj.js +0 -31
- package/src/isObjLike.js +0 -30
- package/src/isOdd.js +0 -29
- package/src/isPair.js +0 -27
- package/src/isPlainObj.js +0 -65
- package/src/isPositive.js +0 -26
- package/src/isPositiveZero.js +0 -23
- package/src/isPrimitive.js +0 -46
- package/src/isPromise.js +0 -32
- package/src/isPrototypeOf.js +0 -36
- package/src/isRegExp.js +0 -22
- package/src/isSafeInteger.js +0 -40
- package/src/isSentinelValue.js +0 -26
- package/src/isSet.js +0 -24
- package/src/isSparseArray.js +0 -43
- package/src/isString.js +0 -21
- package/src/isSymbol.js +0 -29
- package/src/isThenable.js +0 -28
- package/src/isTrue.js +0 -27
- package/src/isTruthy.js +0 -28
- package/src/isUinteger32.js +0 -29
- package/src/isUndefined.js +0 -24
- package/src/isValidDate.js +0 -29
- package/src/isValidNumber.js +0 -28
- package/src/lastP.js +0 -54
- package/src/lengthEq.js +0 -24
- package/src/lengthGt.js +0 -24
- package/src/lengthGte.js +0 -26
- package/src/lengthLt.js +0 -24
- package/src/lengthLte.js +0 -25
- package/src/lengthNotEq.js +0 -24
- package/src/lensEq.js +0 -28
- package/src/lensIso.js +0 -51
- package/src/lensNotEq.js +0 -28
- package/src/lensNotSatisfy.js +0 -30
- package/src/lensSatisfies.js +0 -33
- package/src/lensTraverse.js +0 -56
- package/src/liftF.js +0 -37
- package/src/liftFN.js +0 -45
- package/src/list.js +0 -20
- package/src/mapIndexed.js +0 -27
- package/src/mergePath.js +0 -30
- package/src/mergePaths.js +0 -29
- package/src/mergeProp.js +0 -30
- package/src/mergeProps.js +0 -27
- package/src/move.js +0 -26
- package/src/nand.js +0 -27
- package/src/neither.js +0 -38
- package/src/noneP.js +0 -35
- package/src/nonePass.js +0 -32
- package/src/noop.js +0 -21
- package/src/nor.js +0 -28
- package/src/notAllPass.js +0 -32
- package/src/notAllUnique.js +0 -25
- package/src/notBoth.js +0 -38
- package/src/notEqual.js +0 -31
- package/src/omitBy.js +0 -25
- package/src/omitIndexes.js +0 -27
- package/src/overlaps.js +0 -30
- package/src/padCharsEnd.js +0 -37
- package/src/padCharsStart.js +0 -35
- package/src/padEnd.js +0 -25
- package/src/padStart.js +0 -23
- package/src/pathNotEq.js +0 -31
- package/src/pathOrLazy.js +0 -30
- package/src/paths.js +0 -26
- package/src/pickIndexes.js +0 -30
- package/src/propNotEq.js +0 -30
- package/src/rangeStep.js +0 -37
- package/src/reduceIndexed.js +0 -31
- package/src/reduceP.js +0 -96
- package/src/reduceRightP.js +0 -101
- package/src/rejectP.js +0 -24
- package/src/renameKey.js +0 -33
- package/src/renameKeyWith.js +0 -30
- package/src/renameKeys.js +0 -40
- package/src/renameKeysWith.js +0 -27
- package/src/repeatStr.js +0 -30
- package/src/replaceAll.js +0 -35
- package/src/resolveP.js +0 -28
- package/src/round.js +0 -26
- package/src/seq.js +0 -38
- package/src/sign.js +0 -33
- package/src/skipTake.js +0 -33
- package/src/sliceFrom.js +0 -23
- package/src/sliceTo.js +0 -23
- package/src/sortByPaths.js +0 -55
- package/src/sortByProp.js +0 -45
- package/src/sortByProps.js +0 -31
- package/src/spreadPath.js +0 -26
- package/src/spreadProp.js +0 -25
- package/src/stubArray.js +0 -18
- package/src/stubNull.js +0 -19
- package/src/stubObj.js +0 -19
- package/src/stubString.js +0 -19
- package/src/stubUndefined.js +0 -19
- package/src/subtractNum.js +0 -20
- package/src/thenCatchP.js +0 -27
- package/src/toArray.js +0 -32
- package/src/toInteger32.js +0 -22
- package/src/toNumber.js +0 -24
- package/src/toUinteger32.js +0 -26
- package/src/trimCharsEnd.js +0 -25
- package/src/trimCharsStart.js +0 -25
- package/src/trimEnd.js +0 -30
- package/src/trimStart.js +0 -29
- package/src/trunc.js +0 -33
- package/src/unzipObjWith.js +0 -40
- package/src/viewOr.js +0 -32
- package/src/weave.js +0 -35
- package/src/weaveLazy.js +0 -37
- package/src/zipObjWith.js +0 -27
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { equals, pathSatisfies } from 'ramda';
|
|
2
|
-
|
|
3
|
-
import isString from '../isString.js';
|
|
4
|
-
import isNumber from '../isNumber.js';
|
|
5
|
-
import isFunction from '../isFunction.js';
|
|
6
|
-
import { isSameType } from './util.js';
|
|
7
|
-
import * as fl from './mapping.js';
|
|
8
|
-
|
|
9
|
-
export const functorTrait = {
|
|
10
|
-
[fl.map](fn) {
|
|
11
|
-
return this.constructor[fl.of](fn(this.value));
|
|
12
|
-
},
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export const applyTrait = {
|
|
16
|
-
[fl.ap](applyWithFn) {
|
|
17
|
-
return applyWithFn.map((fn) => fn(this.value));
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export const setoidTrait = {
|
|
22
|
-
[fl.equals](setoid) {
|
|
23
|
-
return isSameType(this, setoid) && equals(this.value, setoid.value);
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export const semigroupTrait = {
|
|
28
|
-
[fl.concat](semigroup) {
|
|
29
|
-
let concatenatedValue = this.value;
|
|
30
|
-
|
|
31
|
-
if (isString(this.value) || isNumber(this.value)) {
|
|
32
|
-
concatenatedValue = this.value + semigroup.value;
|
|
33
|
-
} else if (pathSatisfies(isFunction, ['value', fl.concat], this)) {
|
|
34
|
-
concatenatedValue = this.value[fl.concat](semigroup.value);
|
|
35
|
-
} else if (pathSatisfies(isFunction, ['value', 'concat'], this)) {
|
|
36
|
-
concatenatedValue = this.value.concat(semigroup.value);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return this.constructor[fl.of](concatenatedValue);
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export const chainTrait = {
|
|
44
|
-
[fl.chain](fn) {
|
|
45
|
-
const newChain = fn(this.value);
|
|
46
|
-
|
|
47
|
-
return isSameType(this, newChain) ? newChain : this;
|
|
48
|
-
},
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export const ordTrait = {
|
|
52
|
-
[fl.lte](ord) {
|
|
53
|
-
return (
|
|
54
|
-
isSameType(this, ord) && (this.value < ord.value || this[fl.equals](ord))
|
|
55
|
-
);
|
|
56
|
-
},
|
|
57
|
-
};
|
package/src/fantasy-land/util.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useWith,
|
|
3
|
-
curry,
|
|
4
|
-
curryN,
|
|
5
|
-
equals,
|
|
6
|
-
path,
|
|
7
|
-
either,
|
|
8
|
-
complement,
|
|
9
|
-
} from 'ramda';
|
|
10
|
-
|
|
11
|
-
// type :: Monad a => a -> String
|
|
12
|
-
export const type = either(path(['@@type']), path(['constructor', '@@type']));
|
|
13
|
-
|
|
14
|
-
// typeEquals :: Monad a => String -> a -> Boolean
|
|
15
|
-
export const typeEquals = curry(
|
|
16
|
-
(typeIdent, monad) => type(monad) === typeIdent
|
|
17
|
-
);
|
|
18
|
-
|
|
19
|
-
// isSameType :: (Monad a, Monad b) => a -> b -> Boolean
|
|
20
|
-
export const isSameType = curryN(2, useWith(equals, [type, type]));
|
|
21
|
-
|
|
22
|
-
// isNotSameType :: (Monad a, Monad b) => a -> b -> Boolean
|
|
23
|
-
export const isNotSameType = complement(isSameType);
|
package/src/filterIndexed.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { addIndex, filter } from 'ramda';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* {@link http://ramdajs.com/docs/#filter|R.filter} function that more closely resembles `Array.prototype.filter`.
|
|
5
|
-
* It takes two new parameters to its callback function: the current index, and the entire list.
|
|
6
|
-
*
|
|
7
|
-
* `filterIndexed` implementation is simple: `
|
|
8
|
-
* const filterIndexed = R.addIndex(R.filter);
|
|
9
|
-
* `
|
|
10
|
-
*
|
|
11
|
-
* @func filterIndexed
|
|
12
|
-
* @memberOf RA
|
|
13
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/2.31.0|v2.31.0}
|
|
14
|
-
* @category List
|
|
15
|
-
* @typedef Idx = Number
|
|
16
|
-
* @sig Filterable f => ((a, Idx, f a) -> Boolean) -> f a -> f a
|
|
17
|
-
* @param {Function} pred The predicate function
|
|
18
|
-
* @param {Array} list The collection to filter
|
|
19
|
-
* @return {Array} Filterable
|
|
20
|
-
* @see {@link http://ramdajs.com/docs/#addIndex|R.addIndex}, {@link http://ramdajs.com/docs/#filter|R.filter}
|
|
21
|
-
* @example
|
|
22
|
-
*
|
|
23
|
-
* const isValueGtIndex = (val, idx) => val > idx;
|
|
24
|
-
* RA.filterIndexed(isValueGtIndex, [5, 4, 3, 2, 1, 0]); //=> [5, 4, 3]
|
|
25
|
-
*/
|
|
26
|
-
const filterIndexed = addIndex(filter);
|
|
27
|
-
|
|
28
|
-
export default filterIndexed;
|
package/src/findOr.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { pipe, curry, find, defaultTo } from 'ramda';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Returns the first element of the list which matches the predicate.
|
|
5
|
-
* Returns default value if no element matches or matched element is `null`, `undefined` or `NaN`.
|
|
6
|
-
* Dispatches to the find method of the second argument, if present.
|
|
7
|
-
* Acts as a transducer if a transformer is given in list position.
|
|
8
|
-
*
|
|
9
|
-
* @func findOr
|
|
10
|
-
* @memberOf RA
|
|
11
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/2.32.0|v2.32.0}
|
|
12
|
-
* @category List
|
|
13
|
-
* @sig a -> (b -> Boolean) -> [b] -> b | a
|
|
14
|
-
* @param {*} defaultValue The default value
|
|
15
|
-
* @param {Function} fn The predicate function used to determine if the element is the desired one.
|
|
16
|
-
* @param {Array} list The array to consider.
|
|
17
|
-
* @return {*} The element found, or the default value.
|
|
18
|
-
* @see {@link http://ramdajs.com/docs/#defaultTo|R.defaultTo}, {@link http://ramdajs.com/docs/#find|R.find}
|
|
19
|
-
* @example
|
|
20
|
-
*
|
|
21
|
-
* RA.findOr(1, isUndefined, [1, 2, undefined]); // => 1
|
|
22
|
-
* RA.findOr(1, val => val === 2, [1, 2, undefined]); // => 2
|
|
23
|
-
* RA.findOr(1, val => val === 3, [1, 2, undefined]); // => 1
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
const findOr = curry((defaultVal, fn, list) =>
|
|
27
|
-
pipe(find(fn), defaultTo(defaultVal))(list)
|
|
28
|
-
);
|
|
29
|
-
|
|
30
|
-
export default findOr;
|
package/src/flattenDepth.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { curry } from 'ramda';
|
|
2
|
-
|
|
3
|
-
import _makeFlat from './internal/makeFlat.js';
|
|
4
|
-
|
|
5
|
-
const flatten1 = _makeFlat(false);
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Flattens the list to the specified depth.
|
|
9
|
-
*
|
|
10
|
-
* @func flattenDepth
|
|
11
|
-
* @memberOf RA
|
|
12
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/2.19.0|v2.19.0}
|
|
13
|
-
* @category List
|
|
14
|
-
* @sig Number -> [a] -> [b]
|
|
15
|
-
* @param {!number} depth The maximum recursion depth
|
|
16
|
-
* @param {!Array} list The array to flatten
|
|
17
|
-
* @return {!Array} Returns the new flattened array
|
|
18
|
-
* @see {@link http://ramdajs.com/docs/#flatten|R.flatten}, {@link http://ramdajs.com/docs/#unnest|R.unnest}
|
|
19
|
-
* @example
|
|
20
|
-
*
|
|
21
|
-
* RA.flattenDepth(
|
|
22
|
-
* 2,
|
|
23
|
-
* [1, [2], [3, [4, 5], 6, [[[7], 8]]], 9, 10]
|
|
24
|
-
* ); //=> [1, 2, 3, 4, 5, 6, [[7], 8], 9, 10];
|
|
25
|
-
*/
|
|
26
|
-
const flattenDepth = curry((depth, list) => {
|
|
27
|
-
let currentDept = depth;
|
|
28
|
-
let flatList = [...list];
|
|
29
|
-
|
|
30
|
-
while (currentDept > 0) {
|
|
31
|
-
flatList = flatten1(flatList);
|
|
32
|
-
|
|
33
|
-
currentDept -= 1;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return flatList;
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
export default flattenDepth;
|
package/src/flattenPath.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { pathOr, curry, mergeRight } from 'ramda';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Flattens a property path so that its fields are spread out into the provided object.
|
|
5
|
-
* It's like {@link RA.spreadPath|spreadPath}, but preserves object under the property path.
|
|
6
|
-
*
|
|
7
|
-
* @func flattenPath
|
|
8
|
-
* @memberOf RA
|
|
9
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/1.19.0|v1.19.0}
|
|
10
|
-
* @category Object
|
|
11
|
-
* @typedef Idx = String | Int
|
|
12
|
-
* @sig [Idx] -> {k: v} -> {k: v}
|
|
13
|
-
* @param {!Array.<string|number>} path The property path to flatten
|
|
14
|
-
* @param {!Object} obj The provided object
|
|
15
|
-
* @return {!Object} The flattened object
|
|
16
|
-
* @see {@link RA.flattenProp|flattenProp}, {@link RA.spreadPath|spreadPath}
|
|
17
|
-
* @example
|
|
18
|
-
*
|
|
19
|
-
* RA.flattenPath(
|
|
20
|
-
* ['b1', 'b2'],
|
|
21
|
-
* { a: 1, b1: { b2: { c: 3, d: 4 } } }
|
|
22
|
-
* ); // => { a: 1, c: 3, d: 4, b1: { b2: { c: 3, d: 4 } } };
|
|
23
|
-
*/
|
|
24
|
-
const flattenPath = curry((path, obj) =>
|
|
25
|
-
mergeRight(obj, pathOr({}, path, obj))
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
export default flattenPath;
|
package/src/flattenProp.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { of, curry } from 'ramda';
|
|
2
|
-
|
|
3
|
-
import flattenPath from './flattenPath.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Flattens a property so that its fields are spread out into the provided object.
|
|
7
|
-
* It's like {@link RA.spreadProp|spreadProp}, but preserves object under the property path.
|
|
8
|
-
*
|
|
9
|
-
* @func flattenProp
|
|
10
|
-
* @memberOf RA
|
|
11
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/1.19.0|v1.19.0}
|
|
12
|
-
* @category Object
|
|
13
|
-
* @typedef Idx = String | Int
|
|
14
|
-
* @sig [Idx] -> {k: v} -> {k: v}
|
|
15
|
-
* @param {!string|number} prop The property to flatten
|
|
16
|
-
* @param {!Object} obj The provided object
|
|
17
|
-
* @return {!Object} The flattened object
|
|
18
|
-
* @see {@link RA.flattenPath|flattenPath}, {@link RA.spreadProp|spreadProp}
|
|
19
|
-
* @example
|
|
20
|
-
*
|
|
21
|
-
* RA.flattenProp(
|
|
22
|
-
* 'b',
|
|
23
|
-
* { a: 1, b: { c: 3, d: 4 } }
|
|
24
|
-
* ); // => { a: 1, c: 3, d: 4, b: { c: 3, d: 4 } };
|
|
25
|
-
*/
|
|
26
|
-
const flattenProp = curry((prop, obj) => flattenPath(of(Array, prop), obj));
|
|
27
|
-
|
|
28
|
-
export default flattenProp;
|
package/src/floor.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { bind, curryN } from 'ramda';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Returns the largest integer less than or equal to a given number.
|
|
5
|
-
*
|
|
6
|
-
* Note: floor(null) returns integer 0 and do not give a NaN error.
|
|
7
|
-
*
|
|
8
|
-
* @func floor
|
|
9
|
-
* @memberOf RA
|
|
10
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/2.15.0|v2.15.0}
|
|
11
|
-
* @category Math
|
|
12
|
-
* @sig Number -> Number
|
|
13
|
-
* @param {number} number The number to floor
|
|
14
|
-
* @return {number} A number representing the largest integer less than or equal to the specified number
|
|
15
|
-
* @example
|
|
16
|
-
*
|
|
17
|
-
* RA.floor(45.95); //=> 45
|
|
18
|
-
* RA.floor(45.05); //=> 45
|
|
19
|
-
* RA.floor(4); //=> 4
|
|
20
|
-
* RA.floor(-45.05); //=> -46
|
|
21
|
-
* RA.floor(-45.95); //=> -46
|
|
22
|
-
* RA.floor(null); //=> 0
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
const floor = curryN(1, bind(Math.floor, Math));
|
|
26
|
-
|
|
27
|
-
export default floor;
|
package/src/fnull.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { isNil, curryN, curry, apply } from 'ramda';
|
|
2
|
-
|
|
3
|
-
import defaultWhen from './defaultWhen.js';
|
|
4
|
-
import mapIndexed from './mapIndexed.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Returns a function which is called with the given arguments. If any of the given arguments are null or undefined,
|
|
8
|
-
* the corresponding default value for that argument is used instead.
|
|
9
|
-
*
|
|
10
|
-
* @func fnull
|
|
11
|
-
* @memberOf RA
|
|
12
|
-
* @category Function
|
|
13
|
-
* @sig (a ... -> b) -> [c] -> a ... | c -> b
|
|
14
|
-
* @param {Function} function to be executed
|
|
15
|
-
* @param {Array} defaults default arguments
|
|
16
|
-
* @return {Function} will apply provided arguments or default ones
|
|
17
|
-
* @example
|
|
18
|
-
*
|
|
19
|
-
* const addDefaults = RA.fnull((a, b) => a + b, [4, 5])
|
|
20
|
-
*
|
|
21
|
-
* addDefaults(1, 2); // => 3
|
|
22
|
-
* addDefaults(null, 2); // => 6
|
|
23
|
-
* addDefaults(2, null); // => 7
|
|
24
|
-
* addDefaults(undefined, undefined); // => 9
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
const fnull = curry((fn, defaults) =>
|
|
28
|
-
curryN(fn.length, (...args) => {
|
|
29
|
-
const argsWithDefaults = mapIndexed(
|
|
30
|
-
(val, idx) => defaultWhen(isNil, defaults[idx], val),
|
|
31
|
-
args
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
return apply(fn, argsWithDefaults);
|
|
35
|
-
})
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
export default fnull;
|
package/src/inRange.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { ifElse, curry, useWith, both, gte, lte, gt } from 'ramda';
|
|
2
|
-
|
|
3
|
-
const inRangeImp = ifElse(
|
|
4
|
-
gte,
|
|
5
|
-
() => {
|
|
6
|
-
throw new Error(
|
|
7
|
-
'low must not be greater than high in inRange(low, high, value)'
|
|
8
|
-
);
|
|
9
|
-
},
|
|
10
|
-
useWith(both, [lte, gt])
|
|
11
|
-
);
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Checks if `value` is between `low` and up to but not including `high`.
|
|
15
|
-
*
|
|
16
|
-
* @func inRange
|
|
17
|
-
* @memberOf RA
|
|
18
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/2.7.0|v2.7.0}
|
|
19
|
-
* @category Relation
|
|
20
|
-
* @sig Number -> Number -> Number -> Boolean
|
|
21
|
-
* @param {number} low Start of the range
|
|
22
|
-
* @param {number} high The end of the range
|
|
23
|
-
* @param {number} value The value to test
|
|
24
|
-
* @return {boolean}
|
|
25
|
-
* @throws {Error} When `low` is greater than or equal to `high`
|
|
26
|
-
* @example
|
|
27
|
-
*
|
|
28
|
-
* RA.inRange(0, 5, 3); //=> true
|
|
29
|
-
* RA.inRange(0, 5, 0); //=> true
|
|
30
|
-
* RA.inRange(0, 5, 4); //=> true
|
|
31
|
-
* RA.inRange(0, 5, 5); //=> false
|
|
32
|
-
* RA.inRange(0, 5, -1); //=> false
|
|
33
|
-
*/
|
|
34
|
-
export default curry((low, high, value) => inRangeImp(low, high)(value));
|
package/src/included.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { flip, includes } from 'ramda';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Returns true if the specified value is equal, in R.equals terms,
|
|
5
|
-
* to at least one element of the given list or false otherwise.
|
|
6
|
-
* Given list can be a string.
|
|
7
|
-
*
|
|
8
|
-
* Like {@link http://ramdajs.com/docs/#includes|R.includes} but with argument order reversed.
|
|
9
|
-
*
|
|
10
|
-
* @func included
|
|
11
|
-
* @memberOf RA
|
|
12
|
-
* @since {@link https://char0n.github.io/ramda-adjunct/3.0.0|v3.0.0}
|
|
13
|
-
* @category List
|
|
14
|
-
* @sig [a] -> a -> Boolean
|
|
15
|
-
* @param {Array|String} list The list to consider
|
|
16
|
-
* @param {*} a The item to compare against
|
|
17
|
-
* @return {boolean} Returns Boolean `true` if an equivalent item is in the list or `false` otherwise
|
|
18
|
-
* @see {@link http://ramdajs.com/docs/#includes|R.includes}
|
|
19
|
-
* @example
|
|
20
|
-
*
|
|
21
|
-
* RA.included([1, 2, 3], 3); //=> true
|
|
22
|
-
* RA.included([1, 2, 3], 4); //=> false
|
|
23
|
-
* RA.included([{ name: 'Fred' }], { name: 'Fred' }); //=> true
|
|
24
|
-
* RA.included([[42]], [42]); //=> true
|
|
25
|
-
*/
|
|
26
|
-
const included = flip(includes);
|
|
27
|
-
|
|
28
|
-
export default included;
|
package/src/index.js
DELETED
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @namespace RA
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
// Type
|
|
6
|
-
export { default as isNotUndefined } from './isNotUndefined.js';
|
|
7
|
-
export { default as isUndefined } from './isUndefined.js';
|
|
8
|
-
export { default as isNull } from './isNull.js';
|
|
9
|
-
export { default as isNotNull } from './isNotNull.js';
|
|
10
|
-
export { default as isNotNil } from './isNotNil.js';
|
|
11
|
-
export { default as isArray } from './isArray.js';
|
|
12
|
-
export { default as isIterable } from './isIterable.js';
|
|
13
|
-
export { default as isEmptyArray } from './isEmptyArray.js';
|
|
14
|
-
export { default as isNotArray } from './isNotArray.js';
|
|
15
|
-
export { default as isNonEmptyArray } from './isNonEmptyArray.js';
|
|
16
|
-
export { default as isBoolean } from './isBoolean.js';
|
|
17
|
-
export { default as isNotBoolean } from './isNotBoolean.js';
|
|
18
|
-
export { default as isNilOrEmpty } from './isNilOrEmpty.js';
|
|
19
|
-
export { default as isString } from './isString.js';
|
|
20
|
-
export { default as isEmptyString } from './isEmptyString.js';
|
|
21
|
-
export { default as isNotString } from './isNotString.js';
|
|
22
|
-
export { default as isNonEmptyString } from './isNonEmptyString.js';
|
|
23
|
-
export { default as isArrayLike } from './isArrayLike.js';
|
|
24
|
-
export { default as isNotArrayLike } from './isNotArrayLike.js';
|
|
25
|
-
export { default as isGeneratorFunction } from './isGeneratorFunction.js';
|
|
26
|
-
export { default as isNotGeneratorFunction } from './isNotGeneratorFunction.js';
|
|
27
|
-
export { default as isAsyncFunction } from './isAsyncFunction.js';
|
|
28
|
-
export { default as isNotAsyncFunction } from './isNotAsyncFunction.js';
|
|
29
|
-
export { default as isFunction } from './isFunction.js';
|
|
30
|
-
export { default as isNotFunction } from './isNotFunction.js';
|
|
31
|
-
export { default as isObj } from './isObj.js';
|
|
32
|
-
export { default as isObject } from './isObj.js'; // alias of isObj
|
|
33
|
-
export { default as isNotObj } from './isNotObj.js';
|
|
34
|
-
export { default as isNotObject } from './isNotObj.js'; // alias of isNotObj
|
|
35
|
-
export { default as isObjLike } from './isObjLike.js';
|
|
36
|
-
export { default as isObjectLike } from './isObjLike.js'; // alias of isObjLike
|
|
37
|
-
export { default as isNotObjLike } from './isNotObjLike.js';
|
|
38
|
-
export { default as isNotObjectLike } from './isNotObjLike.js'; // alias of isNotObjLike
|
|
39
|
-
export { default as isPlainObj } from './isPlainObj.js';
|
|
40
|
-
export { default as isPlainObject } from './isPlainObj.js';
|
|
41
|
-
export { default as isNotPlainObj } from './isNotPlainObj.js';
|
|
42
|
-
export { default as isNotPlainObject } from './isNotPlainObj.js'; // alias of isNotPlainObj
|
|
43
|
-
export { default as isDate } from './isDate.js';
|
|
44
|
-
export { default as isNotDate } from './isNotDate.js';
|
|
45
|
-
export { default as isValidDate } from './isValidDate.js';
|
|
46
|
-
export { default as isNotValidDate } from './isNotValidDate.js';
|
|
47
|
-
export { default as isInvalidDate } from './isNotValidDate.js'; // alias of isNotValidDate
|
|
48
|
-
export { default as isNumber } from './isNumber.js';
|
|
49
|
-
export { default as isNotNumber } from './isNotNumber.js';
|
|
50
|
-
export { default as isPositive } from './isPositive.js';
|
|
51
|
-
export { default as isNegative } from './isNegative.js';
|
|
52
|
-
export { default as isPositiveZero } from './isPositiveZero.js';
|
|
53
|
-
export { default as isNegativeZero } from './isNegativeZero.js';
|
|
54
|
-
export { default as isNotNilOrEmpty } from './isNotNilOrEmpty.js';
|
|
55
|
-
export { default as isNonPositive } from './isNonPositive.js';
|
|
56
|
-
export { default as isNonNegative } from './isNonNegative.js';
|
|
57
|
-
export { default as isMap } from './isMap.js';
|
|
58
|
-
export { default as isNotMap } from './isNotMap.js';
|
|
59
|
-
export { default as isNaN } from './isNaN.js';
|
|
60
|
-
export { default as isNotNaN } from './isNotNaN.js';
|
|
61
|
-
export { default as isFinite } from './isFinite.js';
|
|
62
|
-
export { default as isNotFinite } from './isNotFinite.js';
|
|
63
|
-
export { default as isInteger } from './isInteger.js';
|
|
64
|
-
export { default as isInteger32 } from './isInteger32.js';
|
|
65
|
-
export { default as isInt32 } from './isInteger32.js'; // alias of isInteger32
|
|
66
|
-
export { default as isUinteger32 } from './isUinteger32.js';
|
|
67
|
-
export { default as isUint32 } from './isUinteger32.js'; // alias of isUinteger32
|
|
68
|
-
export { default as isNotInteger } from './isNotInteger.js';
|
|
69
|
-
export { default as isBigInt } from './isBigInt.js';
|
|
70
|
-
export { default as isFloat } from './isFloat.js';
|
|
71
|
-
export { default as isNotFloat } from './isNotFloat.js';
|
|
72
|
-
export { default as isValidNumber } from './isValidNumber.js';
|
|
73
|
-
export { default as isNotValidNumber } from './isNotValidNumber.js';
|
|
74
|
-
export { default as isOdd } from './isOdd.js';
|
|
75
|
-
export { default as isEven } from './isEven.js';
|
|
76
|
-
export { default as isPair } from './isPair.js';
|
|
77
|
-
export { default as isNotPair } from './isNotPair.js';
|
|
78
|
-
export { default as isThenable } from './isThenable.js';
|
|
79
|
-
export { default as isPromise } from './isPromise.js';
|
|
80
|
-
export { default as isTrue } from './isTrue.js';
|
|
81
|
-
export { default as isFalse } from './isFalse.js';
|
|
82
|
-
export { default as isTruthy } from './isTruthy.js';
|
|
83
|
-
export { default as isFalsy } from './isFalsy.js';
|
|
84
|
-
export { default as isRegExp } from './isRegExp.js';
|
|
85
|
-
export { default as isNotRegExp } from './isNotRegExp.js';
|
|
86
|
-
export { default as isSet } from './isSet.js';
|
|
87
|
-
export { default as isNotSet } from './isNotSet.js';
|
|
88
|
-
export { default as isSparseArray } from './isSparseArray.js';
|
|
89
|
-
export { default as isSymbol } from './isSymbol.js';
|
|
90
|
-
export { default as isSafeInteger } from './isSafeInteger.js';
|
|
91
|
-
export { default as isIndexed } from './isIndexed.js';
|
|
92
|
-
export { default as isError } from './isError.js';
|
|
93
|
-
export { default as isNaturalNumber } from './isNaturalNumber.js';
|
|
94
|
-
export { default as isPrimitive } from './isPrimitive.js';
|
|
95
|
-
export { default as isNotPrimitive } from './isNotPrimitive.js';
|
|
96
|
-
export { default as isSentinelValue } from './isSentinelValue.js';
|
|
97
|
-
export { default as isBlank } from './isBlank.js';
|
|
98
|
-
// Function
|
|
99
|
-
export { default as stubUndefined } from './stubUndefined.js';
|
|
100
|
-
export { default as stubNull } from './stubNull.js';
|
|
101
|
-
export { default as stubObj } from './stubObj.js';
|
|
102
|
-
export { default as stubObject } from './stubObj.js';
|
|
103
|
-
export { default as stubString } from './stubString.js';
|
|
104
|
-
export { default as stubArray } from './stubArray.js';
|
|
105
|
-
export { default as noop } from './noop.js';
|
|
106
|
-
export { default as liftFN } from './liftFN.js';
|
|
107
|
-
export { default as liftF } from './liftF.js';
|
|
108
|
-
export { default as cata } from './cata.js';
|
|
109
|
-
export { default as weave } from './weave.js';
|
|
110
|
-
export { default as weaveLazy } from './weaveLazy.js';
|
|
111
|
-
export { default as curryRightN } from './curryRightN.js';
|
|
112
|
-
export { default as curryRight } from './curryRight.js';
|
|
113
|
-
export { default as allP } from './allP.js';
|
|
114
|
-
export { default as catchP } from './catchP.js';
|
|
115
|
-
export { default as noneP } from './noneP.js';
|
|
116
|
-
export { default as resolveP } from './resolveP.js';
|
|
117
|
-
export { default as rejectP } from './rejectP.js';
|
|
118
|
-
export { default as delayP } from './delayP.js';
|
|
119
|
-
export { default as thenCatchP } from './thenCatchP.js';
|
|
120
|
-
export { default as allSettledP } from './allSettledP.js';
|
|
121
|
-
export { default as Y } from './Y.js';
|
|
122
|
-
export { default as seq } from './seq.js';
|
|
123
|
-
export { default as sequencing } from './seq.js';
|
|
124
|
-
export { default as dispatch } from './dispatch.js';
|
|
125
|
-
export { default as async } from './async.js';
|
|
126
|
-
export { default as anyP } from './anyP.js';
|
|
127
|
-
export { default as firstP } from './anyP.js'; // alias of anyP
|
|
128
|
-
export { default as lastP } from './lastP.js';
|
|
129
|
-
export { default as fnull } from './fnull.js';
|
|
130
|
-
// List
|
|
131
|
-
export { default as mapIndexed } from './mapIndexed.js';
|
|
132
|
-
export { default as reduceIndexed } from './reduceIndexed.js';
|
|
133
|
-
export { default as filterIndexed } from './filterIndexed.js';
|
|
134
|
-
export { default as pickIndexes } from './pickIndexes.js';
|
|
135
|
-
export { default as list } from './list.js';
|
|
136
|
-
export { default as ensureArray } from './ensureArray.js';
|
|
137
|
-
export { default as concatAll } from './concatAll.js';
|
|
138
|
-
export { default as concatRight } from './concatRight.js';
|
|
139
|
-
export { default as reduceP } from './reduceP.js';
|
|
140
|
-
export { default as reduceRightP } from './reduceRightP.js';
|
|
141
|
-
export { default as sliceFrom } from './sliceFrom.js';
|
|
142
|
-
export { default as sliceTo } from './sliceTo.js';
|
|
143
|
-
export { default as omitIndexes } from './omitIndexes.js';
|
|
144
|
-
export { default as compact } from './compact.js';
|
|
145
|
-
export { default as appendFlipped } from './appendFlipped.js';
|
|
146
|
-
export { default as included } from './included.js';
|
|
147
|
-
export { default as move } from './move.js';
|
|
148
|
-
export { default as lengthGt } from './lengthGt.js';
|
|
149
|
-
export { default as lengthLt } from './lengthLt.js';
|
|
150
|
-
export { default as lengthGte } from './lengthGte.js';
|
|
151
|
-
export { default as lengthLte } from './lengthLte.js';
|
|
152
|
-
export { default as lengthEq } from './lengthEq.js';
|
|
153
|
-
export { default as lengthNotEq } from './lengthNotEq.js';
|
|
154
|
-
export { default as allEqual } from './allEqual.js';
|
|
155
|
-
export { default as repeatStr } from './repeatStr.js';
|
|
156
|
-
export { default as allIdentical } from './allIdentical.js';
|
|
157
|
-
export { default as allIdenticalTo } from './allIdenticalTo.js';
|
|
158
|
-
export { default as allEqualTo } from './allEqualTo.js';
|
|
159
|
-
export { default as flattenDepth } from './flattenDepth.js';
|
|
160
|
-
export { default as toArray } from './toArray.js';
|
|
161
|
-
export { default as allUnique } from './allUnique.js';
|
|
162
|
-
export { default as notAllUnique } from './notAllUnique.js';
|
|
163
|
-
export { default as sortByProps } from './sortByProps.js';
|
|
164
|
-
export { default as sortByProp } from './sortByProp.js';
|
|
165
|
-
export { default as sortByPaths } from './sortByPaths.js';
|
|
166
|
-
export { default as skipTake } from './skipTake.js';
|
|
167
|
-
export { default as rangeStep } from './rangeStep.js';
|
|
168
|
-
export { default as findOr } from './findOr.js';
|
|
169
|
-
// Object
|
|
170
|
-
export { default as invoke } from './invoke.js';
|
|
171
|
-
export { default as invokeArgs } from './invokeArgs.js';
|
|
172
|
-
export { default as paths } from './paths.js';
|
|
173
|
-
export { default as renameKey } from './renameKey.js';
|
|
174
|
-
export { default as renameKeys } from './renameKeys.js';
|
|
175
|
-
export { default as renameKeysWith } from './renameKeysWith.js';
|
|
176
|
-
export { default as renameKeyWith } from './renameKeyWith.js';
|
|
177
|
-
export { default as copyKeys } from './copyKeys.js';
|
|
178
|
-
export { default as mergeProps } from './mergeProps.js';
|
|
179
|
-
export { default as mergePaths } from './mergePaths.js';
|
|
180
|
-
export { default as mergeProp } from './mergeProp.js';
|
|
181
|
-
export { default as mergePath } from './mergePath.js';
|
|
182
|
-
export { default as omitBy } from './omitBy.js';
|
|
183
|
-
export { default as pathOrLazy } from './pathOrLazy.js';
|
|
184
|
-
export { default as viewOr } from './viewOr.js';
|
|
185
|
-
export { default as spreadProp } from './spreadProp.js';
|
|
186
|
-
export { default as spreadPath } from './spreadPath.js';
|
|
187
|
-
export { default as flattenProp } from './flattenProp.js';
|
|
188
|
-
export { default as flattenPath } from './flattenPath.js';
|
|
189
|
-
export { default as unzipObjWith } from './unzipObjWith.js';
|
|
190
|
-
export { default as zipObjWith } from './zipObjWith.js';
|
|
191
|
-
export { default as isPrototypeOf } from './isPrototypeOf.js';
|
|
192
|
-
// Relation
|
|
193
|
-
export { default as lensEq } from './lensEq.js';
|
|
194
|
-
export { default as lensNotEq } from './lensNotEq.js';
|
|
195
|
-
export { default as lensSatisfies } from './lensSatisfies.js';
|
|
196
|
-
export { default as lensNotSatisfy } from './lensNotSatisfy.js';
|
|
197
|
-
export { default as lensTraverse } from './lensTraverse.js';
|
|
198
|
-
export { default as lensIso } from './lensIso.js';
|
|
199
|
-
export { default as propNotEq } from './propNotEq.js';
|
|
200
|
-
export { default as pathNotEq } from './pathNotEq.js';
|
|
201
|
-
export { default as inRange } from './inRange.js';
|
|
202
|
-
export { default as notEqual } from './notEqual.js';
|
|
203
|
-
export { default as overlaps } from './overlaps.js';
|
|
204
|
-
// Logic
|
|
205
|
-
export { default as defaultWhen } from './defaultWhen.js';
|
|
206
|
-
export { default as notBoth } from './notBoth.js';
|
|
207
|
-
export { default as nand } from './nand.js';
|
|
208
|
-
export { default as neither } from './neither.js';
|
|
209
|
-
export { default as nor } from './nor.js';
|
|
210
|
-
export { default as notAllPass } from './notAllPass.js';
|
|
211
|
-
export { default as nonePass } from './nonePass.js';
|
|
212
|
-
export { default as argsPass } from './argsPass.js';
|
|
213
|
-
export { default as dropArgs } from './dropArgs.js';
|
|
214
|
-
// Math
|
|
215
|
-
export { default as round } from './round.js';
|
|
216
|
-
export { default as ceil } from './ceil.js';
|
|
217
|
-
export { default as divideNum } from './divideNum.js';
|
|
218
|
-
export { default as floor } from './floor.js';
|
|
219
|
-
export { default as trunc } from './trunc.js';
|
|
220
|
-
export { default as sign } from './sign.js';
|
|
221
|
-
export { default as subtractNum } from './subtractNum.js';
|
|
222
|
-
export { default as toInteger32 } from './toInteger32.js';
|
|
223
|
-
export { default as toInt32 } from './toInteger32.js'; // alias of toInteger32
|
|
224
|
-
export { default as toUinteger32 } from './toUinteger32.js';
|
|
225
|
-
export { default as toUint32 } from './toUinteger32.js'; // alias of to toUinteger32
|
|
226
|
-
export { default as toNumber } from './toNumber.js';
|
|
227
|
-
// String
|
|
228
|
-
export { default as replaceAll } from './replaceAll.js';
|
|
229
|
-
export { default as escapeRegExp } from './escapeRegExp.js';
|
|
230
|
-
export { default as trimStart } from './trimStart.js';
|
|
231
|
-
export { default as trimLeft } from './trimStart.js'; // alias of trimStart
|
|
232
|
-
export { default as trimEnd } from './trimEnd.js';
|
|
233
|
-
export { default as trimRight } from './trimEnd.js'; // alias of trimEnd
|
|
234
|
-
export { default as trimCharsEnd } from './trimCharsEnd.js';
|
|
235
|
-
export { default as trimCharsStart } from './trimCharsStart.js';
|
|
236
|
-
export { default as padCharsStart } from './padCharsStart.js';
|
|
237
|
-
export { default as padCharsEnd } from './padCharsEnd.js';
|
|
238
|
-
export { default as padEnd } from './padEnd.js';
|
|
239
|
-
export { default as padStart } from './padStart.js';
|
|
240
|
-
// Types
|
|
241
|
-
export { default as Identity } from './fantasy-land/Identity.js';
|
package/src/internal/ap.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { ap as apR, curryN, pathSatisfies, both, either } from 'ramda';
|
|
2
|
-
|
|
3
|
-
import isFunction from '../isFunction.js';
|
|
4
|
-
import * as fl from '../fantasy-land/mapping.js';
|
|
5
|
-
|
|
6
|
-
const isFunctor = either(
|
|
7
|
-
pathSatisfies(isFunction, ['map']),
|
|
8
|
-
pathSatisfies(isFunction, [fl.map])
|
|
9
|
-
);
|
|
10
|
-
const isApply = both(
|
|
11
|
-
isFunctor,
|
|
12
|
-
either(pathSatisfies(isFunction, ['ap']), pathSatisfies(isFunction, [fl.ap]))
|
|
13
|
-
);
|
|
14
|
-
|
|
15
|
-
const ap = curryN(2, (applyF, applyX) => {
|
|
16
|
-
// return original ramda `ap` if not Apply spec
|
|
17
|
-
if (!isApply(applyF) || !isApply(applyX)) {
|
|
18
|
-
return apR(applyF, applyX);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
try {
|
|
22
|
-
// new version of `ap` starting from ramda version > 0.23.0
|
|
23
|
-
return applyF.ap(applyX);
|
|
24
|
-
} catch (e) {
|
|
25
|
-
// old version of `ap` till ramda version <= 0.23.0
|
|
26
|
-
return applyX.ap(applyF);
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
export default ap;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { both, hasIn } from 'ramda';
|
|
2
|
-
|
|
3
|
-
import isObj from '../isObj.js';
|
|
4
|
-
import isSymbol from '../isSymbol.js';
|
|
5
|
-
import neither from '../neither.js';
|
|
6
|
-
|
|
7
|
-
const isCoercible = neither(
|
|
8
|
-
isSymbol,
|
|
9
|
-
both(isObj, neither(hasIn('toString'), hasIn('valueOf')))
|
|
10
|
-
);
|
|
11
|
-
|
|
12
|
-
export default isCoercible;
|