ramda-adjunct 5.0.0 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +1 -1
- package/dist/RA.node.js +10440 -452
- package/dist/RA.node.min.js +1 -1
- package/dist/RA.web.js +10440 -452
- package/dist/RA.web.min.js +1 -1
- package/dist/RA.web.standalone.js +18646 -447
- package/dist/RA.web.standalone.min.js +1 -1
- package/dist/package.json +1 -0
- package/es/async.js +4 -4
- 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 +5 -5
- 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 +33 -30
- package/types/index.d.ts +0 -5
- 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
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;
|
package/src/internal/makeFlat.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import isArrayLike from '../isArrayLike.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* `makeFlat` is a helper function that returns a one-level or fully recursive
|
|
5
|
-
* function based on the flag passed in.
|
|
6
|
-
*
|
|
7
|
-
* @func makeFlat
|
|
8
|
-
* @memberOf RA
|
|
9
|
-
*
|
|
10
|
-
* @category List
|
|
11
|
-
* @param {!bool} = should recursively flatten
|
|
12
|
-
* @param {!Array} = the nested list to be flattened
|
|
13
|
-
* @return {!Array} = the flattened list
|
|
14
|
-
* @sig Bool -> List -> List
|
|
15
|
-
*
|
|
16
|
-
*/
|
|
17
|
-
const makeFlat = (recursive) =>
|
|
18
|
-
function flatt(list) {
|
|
19
|
-
let value;
|
|
20
|
-
let jlen;
|
|
21
|
-
let j;
|
|
22
|
-
const result = [];
|
|
23
|
-
let idx = 0;
|
|
24
|
-
|
|
25
|
-
while (idx < list.length) {
|
|
26
|
-
if (isArrayLike(list[idx])) {
|
|
27
|
-
value = recursive ? flatt(list[idx]) : list[idx];
|
|
28
|
-
j = 0;
|
|
29
|
-
jlen = value.length;
|
|
30
|
-
while (j < jlen) {
|
|
31
|
-
result[result.length] = value[j];
|
|
32
|
-
j += 1;
|
|
33
|
-
}
|
|
34
|
-
} else {
|
|
35
|
-
result[result.length] = list[idx];
|
|
36
|
-
}
|
|
37
|
-
idx += 1;
|
|
38
|
-
}
|
|
39
|
-
return result;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export default makeFlat;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { bind } from 'ramda';
|
|
2
|
-
|
|
3
|
-
import isIterable from '../../isIterable.js';
|
|
4
|
-
import isNotUndefined from '../../isNotUndefined.js';
|
|
5
|
-
import isNotNil from '../../isNotNil.js';
|
|
6
|
-
import isNotFunction from '../../isNotFunction.js';
|
|
7
|
-
|
|
8
|
-
const copyArray = (items, mapFn, thisArg) => {
|
|
9
|
-
const boundMapFn = isNotUndefined(thisArg) ? bind(mapFn, thisArg) : mapFn;
|
|
10
|
-
|
|
11
|
-
return isNotUndefined(mapFn) ? [...items].map(boundMapFn) : [...items];
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const fromArray = (items, mapFn, thisArg) => {
|
|
15
|
-
if (items == null) {
|
|
16
|
-
throw new TypeError(
|
|
17
|
-
'Array.from requires an array-like object - not null or undefined'
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
if (isNotNil(mapFn) && isNotFunction(mapFn)) {
|
|
22
|
-
throw new TypeError(
|
|
23
|
-
'Array.from: when provided, the second argument must be a function'
|
|
24
|
-
);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
if (isIterable(items)) {
|
|
28
|
-
return copyArray(items, mapFn, thisArg);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return [];
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export default fromArray;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import isFinite from '../../isFinite.js';
|
|
2
|
-
|
|
3
|
-
const truncPonyfill = (v) => {
|
|
4
|
-
const numV = Number(v);
|
|
5
|
-
|
|
6
|
-
if (!isFinite(numV)) {
|
|
7
|
-
return numV;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
// eslint-disable-next-line no-nested-ternary
|
|
11
|
-
return numV - (numV % 1) || (numV < 0 ? -0 : numV === 0 ? numV : 0);
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export default truncPonyfill;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { both } from 'ramda';
|
|
2
|
-
|
|
3
|
-
import isInteger from '../../isInteger.js';
|
|
4
|
-
import MAX_SAFE_INTEGER from './Number.MAX_SAFE_INTEGER.js';
|
|
5
|
-
|
|
6
|
-
const isSafeIntegerPonyfill = both(
|
|
7
|
-
isInteger,
|
|
8
|
-
(value) => Math.abs(value) <= MAX_SAFE_INTEGER
|
|
9
|
-
);
|
|
10
|
-
|
|
11
|
-
export default isSafeIntegerPonyfill;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { map } from 'ramda';
|
|
2
|
-
|
|
3
|
-
import allP from '../../allP.js';
|
|
4
|
-
import resolveP from '../../resolveP.js';
|
|
5
|
-
|
|
6
|
-
const onFulfill = (value) => ({ status: 'fulfilled', value });
|
|
7
|
-
const onReject = (reason) => ({ status: 'rejected', reason });
|
|
8
|
-
|
|
9
|
-
const allSettledPonyfill = (iterable) => {
|
|
10
|
-
const array = map(
|
|
11
|
-
(p) => resolveP(p).then(onFulfill).catch(onReject),
|
|
12
|
-
[...iterable]
|
|
13
|
-
);
|
|
14
|
-
|
|
15
|
-
return allP(array);
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export default allSettledPonyfill;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { map } from 'ramda';
|
|
2
|
-
|
|
3
|
-
import resolveP from '../../resolveP.js';
|
|
4
|
-
|
|
5
|
-
export class AggregatedError extends Error {
|
|
6
|
-
constructor(errors = [], message = '') {
|
|
7
|
-
super(message);
|
|
8
|
-
|
|
9
|
-
this.errors = errors;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const anyPonyfill = (iterable) => {
|
|
14
|
-
const exceptions = [];
|
|
15
|
-
|
|
16
|
-
return new Promise((resolve, reject) => {
|
|
17
|
-
const onReject = (e) => {
|
|
18
|
-
exceptions.push(e);
|
|
19
|
-
|
|
20
|
-
if (exceptions.length === iterable.length) {
|
|
21
|
-
reject(new AggregatedError(exceptions));
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
map((p) => resolveP(p).then(resolve).catch(onReject), [...iterable]);
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export default anyPonyfill;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import isFunction from '../../isFunction.js';
|
|
2
|
-
import isNotUndefined from '../../isNotUndefined.js';
|
|
3
|
-
import repeat from './String.repeat.js';
|
|
4
|
-
|
|
5
|
-
const padEndPonyfill = (padString, targetLength, value) => {
|
|
6
|
-
// eslint-disable-next-line no-bitwise
|
|
7
|
-
let finalLength = targetLength >> 0;
|
|
8
|
-
let finalPadString = String(isNotUndefined(padString) ? padString : ' ');
|
|
9
|
-
|
|
10
|
-
if (value.length > finalLength) {
|
|
11
|
-
return String(value);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
finalLength -= value.length;
|
|
15
|
-
if (finalLength > finalPadString.length) {
|
|
16
|
-
const remainingLength = finalLength / finalPadString.length;
|
|
17
|
-
finalPadString += isFunction(String.prototype.repeat)
|
|
18
|
-
? finalPadString.repeat(remainingLength)
|
|
19
|
-
: repeat(finalPadString, remainingLength);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
return String(value) + finalPadString.slice(0, finalLength);
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export default padEndPonyfill;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import isFunction from '../../isFunction.js';
|
|
2
|
-
import isNotUndefined from '../../isNotUndefined.js';
|
|
3
|
-
import repeat from './String.repeat.js';
|
|
4
|
-
|
|
5
|
-
const padStartPonyfill = (padString, targetLength, value) => {
|
|
6
|
-
// eslint-disable-next-line no-bitwise
|
|
7
|
-
let finalLength = targetLength >> 0; // truncate if number, or convert non-number to 0;
|
|
8
|
-
let finalPadString = String(isNotUndefined(padString) ? padString : ' ');
|
|
9
|
-
|
|
10
|
-
// return the original string, if targeted length is less than original strings length
|
|
11
|
-
if (value.length >= finalLength) {
|
|
12
|
-
return String(value);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
finalLength -= value.length;
|
|
16
|
-
if (finalLength > finalPadString.length) {
|
|
17
|
-
const lenghtToPad = finalLength / finalPadString.length;
|
|
18
|
-
// append to original to ensure we are longer than needed
|
|
19
|
-
finalPadString += isFunction(String.prototype.repeat)
|
|
20
|
-
? finalPadString.repeat(lenghtToPad)
|
|
21
|
-
: repeat(finalPadString, lenghtToPad);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
return finalPadString.slice(0, finalLength) + String(value);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export default padStartPonyfill;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import isNotFinite from '../../isNotFinite.js';
|
|
2
|
-
import isNegative from '../../isNegative.js';
|
|
3
|
-
|
|
4
|
-
const repeat = (value, count) => {
|
|
5
|
-
let validCount = Number(count);
|
|
6
|
-
|
|
7
|
-
if (validCount !== count) {
|
|
8
|
-
validCount = 0;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
if (isNegative(validCount)) {
|
|
12
|
-
throw new RangeError('repeat count must be non-negative');
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
if (isNotFinite(validCount)) {
|
|
16
|
-
throw new RangeError('repeat count must be less than infinity');
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
validCount = Math.floor(validCount);
|
|
20
|
-
|
|
21
|
-
if (value.length === 0 || validCount === 0) {
|
|
22
|
-
return '';
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// Ensuring validCount is a 31-bit integer allows us to heavily optimize the
|
|
26
|
-
// main part. But anyway, most current (August 2014) browsers can't handle
|
|
27
|
-
// strings 1 << 28 chars or longer, so:
|
|
28
|
-
// eslint-disable-next-line no-bitwise
|
|
29
|
-
if (value.length * validCount >= 1 << 28) {
|
|
30
|
-
throw new RangeError('repeat count must not overflow maximum string size');
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const maxCount = value.length * validCount;
|
|
34
|
-
|
|
35
|
-
validCount = Math.floor(Math.log(validCount) / Math.log(2));
|
|
36
|
-
|
|
37
|
-
let result = value;
|
|
38
|
-
|
|
39
|
-
while (validCount) {
|
|
40
|
-
result += value;
|
|
41
|
-
validCount -= 1;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
result += result.substring(0, maxCount - result.length);
|
|
45
|
-
|
|
46
|
-
return result;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export default repeat;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { replace } from 'ramda';
|
|
2
|
-
|
|
3
|
-
import isRegExp from '../../isRegExp.js';
|
|
4
|
-
import escapeRegExp from '../../escapeRegExp.js';
|
|
5
|
-
|
|
6
|
-
const checkArguments = (searchValue, replaceValue, str) => {
|
|
7
|
-
if (str == null || searchValue == null || replaceValue == null) {
|
|
8
|
-
throw TypeError('Input values must not be `null` or `undefined`');
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
const checkValue = (value, valueName) => {
|
|
13
|
-
if (typeof value !== 'string') {
|
|
14
|
-
if (!(value instanceof String)) {
|
|
15
|
-
throw TypeError(`\`${valueName}\` must be a string`);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const checkSearchValue = (searchValue) => {
|
|
21
|
-
if (
|
|
22
|
-
typeof searchValue !== 'string' &&
|
|
23
|
-
!(searchValue instanceof String) &&
|
|
24
|
-
!(searchValue instanceof RegExp)
|
|
25
|
-
) {
|
|
26
|
-
throw TypeError('`searchValue` must be a string or an regexp');
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
const replaceAll = (searchValue, replaceValue, str) => {
|
|
31
|
-
checkArguments(searchValue, replaceValue, str);
|
|
32
|
-
checkValue(str, 'str');
|
|
33
|
-
checkValue(replaceValue, 'replaceValue');
|
|
34
|
-
checkSearchValue(searchValue);
|
|
35
|
-
|
|
36
|
-
const regexp = new RegExp(
|
|
37
|
-
isRegExp(searchValue) ? searchValue : escapeRegExp(searchValue),
|
|
38
|
-
'g'
|
|
39
|
-
);
|
|
40
|
-
|
|
41
|
-
return replace(regexp, replaceValue, str);
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export default replaceAll;
|