@duplojs/utils 0.3.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/array/at/default.cjs +12 -0
- package/dist/array/at/default.d.ts +5 -0
- package/dist/array/at/default.mjs +10 -0
- package/dist/array/at/first.cjs +7 -0
- package/dist/array/at/first.d.ts +2 -0
- package/dist/array/at/first.mjs +5 -0
- package/dist/array/at/index.d.ts +3 -0
- package/dist/array/at/last.cjs +7 -0
- package/dist/array/at/last.d.ts +1 -0
- package/dist/array/at/last.mjs +5 -0
- package/dist/array/concat.cjs +12 -0
- package/dist/array/concat.d.ts +2 -0
- package/dist/array/concat.mjs +10 -0
- package/dist/array/copyWithin.cjs +12 -0
- package/dist/array/copyWithin.d.ts +2 -0
- package/dist/array/copyWithin.mjs +10 -0
- package/dist/array/every.cjs +12 -0
- package/dist/array/every.d.ts +6 -0
- package/dist/array/every.mjs +10 -0
- package/dist/array/fill/all.cjs +12 -0
- package/dist/array/fill/all.d.ts +2 -0
- package/dist/array/fill/all.mjs +10 -0
- package/dist/array/fill/default.cjs +12 -0
- package/dist/array/fill/default.d.ts +2 -0
- package/dist/array/fill/default.mjs +10 -0
- package/dist/array/fill/index.d.ts +2 -0
- package/dist/array/filter.cjs +12 -0
- package/dist/array/filter.d.ts +8 -0
- package/dist/array/filter.mjs +10 -0
- package/dist/array/find.cjs +12 -0
- package/dist/array/find.d.ts +8 -0
- package/dist/array/find.mjs +10 -0
- package/dist/array/findAndReplace.cjs +19 -0
- package/dist/array/findAndReplace.d.ts +7 -0
- package/dist/array/findAndReplace.mjs +17 -0
- package/dist/array/findAndSplice/delete.cjs +19 -0
- package/dist/array/findAndSplice/delete.d.ts +6 -0
- package/dist/array/findAndSplice/delete.mjs +17 -0
- package/dist/array/findAndSplice/index.d.ts +3 -0
- package/dist/array/findAndSplice/insert.cjs +19 -0
- package/dist/array/findAndSplice/insert.d.ts +6 -0
- package/dist/array/findAndSplice/insert.mjs +17 -0
- package/dist/array/findAndSplice/replace.cjs +19 -0
- package/dist/array/findAndSplice/replace.d.ts +6 -0
- package/dist/array/findAndSplice/replace.mjs +17 -0
- package/dist/array/findIndex.cjs +17 -0
- package/dist/array/findIndex.d.ts +6 -0
- package/dist/array/findIndex.mjs +15 -0
- package/dist/array/findLast.cjs +18 -0
- package/dist/array/findLast.d.ts +8 -0
- package/dist/array/findLast.mjs +16 -0
- package/dist/array/findLastIndex.cjs +18 -0
- package/dist/array/findLastIndex.d.ts +6 -0
- package/dist/array/findLastIndex.mjs +16 -0
- package/dist/array/flat.cjs +19 -0
- package/dist/array/flat.d.ts +4 -0
- package/dist/array/flat.mjs +17 -0
- package/dist/array/flatMap.cjs +12 -0
- package/dist/array/flatMap.d.ts +6 -0
- package/dist/array/flatMap.mjs +10 -0
- package/dist/array/from.cjs +16 -0
- package/dist/array/from.d.ts +1 -0
- package/dist/array/from.mjs +14 -0
- package/dist/array/group.cjs +37 -0
- package/dist/array/group.d.ts +16 -0
- package/dist/array/group.mjs +34 -0
- package/dist/array/includes.cjs +12 -0
- package/dist/array/includes.d.ts +2 -0
- package/dist/array/includes.mjs +10 -0
- package/dist/array/index.cjs +102 -0
- package/dist/array/index.d.ts +40 -0
- package/dist/array/index.mjs +48 -0
- package/dist/array/indexOf.cjs +23 -0
- package/dist/array/indexOf.d.ts +2 -0
- package/dist/array/indexOf.mjs +21 -0
- package/dist/array/is.cjs +7 -0
- package/dist/array/is.d.ts +1 -0
- package/dist/array/is.mjs +5 -0
- package/dist/array/join.cjs +12 -0
- package/dist/array/join.d.ts +8 -0
- package/dist/array/join.mjs +10 -0
- package/dist/array/lastIndexOf.cjs +23 -0
- package/dist/array/lastIndexOf.d.ts +2 -0
- package/dist/array/lastIndexOf.mjs +21 -0
- package/dist/array/map.cjs +12 -0
- package/dist/array/map.d.ts +6 -0
- package/dist/array/map.mjs +10 -0
- package/dist/array/maxElements.cjs +12 -0
- package/dist/array/maxElements.d.ts +2 -0
- package/dist/array/maxElements.mjs +10 -0
- package/dist/array/maxOf.cjs +17 -0
- package/dist/array/maxOf.d.ts +1 -0
- package/dist/array/maxOf.mjs +15 -0
- package/dist/array/minElements.cjs +12 -0
- package/dist/array/minElements.d.ts +3 -0
- package/dist/array/minElements.mjs +10 -0
- package/dist/array/minOf.cjs +17 -0
- package/dist/array/minOf.d.ts +1 -0
- package/dist/array/minOf.mjs +15 -0
- package/dist/array/pop.cjs +7 -0
- package/dist/array/pop.d.ts +3 -0
- package/dist/array/pop.mjs +5 -0
- package/dist/array/push.cjs +12 -0
- package/dist/array/push.d.ts +2 -0
- package/dist/array/push.mjs +10 -0
- package/dist/array/reduce.cjs +41 -0
- package/dist/array/reduce.d.ts +30 -0
- package/dist/array/reduce.mjs +39 -0
- package/dist/array/reduceRight.cjs +41 -0
- package/dist/array/reduceRight.d.ts +30 -0
- package/dist/array/reduceRight.mjs +39 -0
- package/dist/array/reverse.cjs +7 -0
- package/dist/array/reverse.d.ts +3 -0
- package/dist/array/reverse.mjs +5 -0
- package/dist/array/set.cjs +14 -0
- package/dist/array/set.d.ts +2 -0
- package/dist/array/set.mjs +12 -0
- package/dist/array/shift.cjs +7 -0
- package/dist/array/shift.d.ts +3 -0
- package/dist/array/shift.mjs +5 -0
- package/dist/array/slice.cjs +12 -0
- package/dist/array/slice.d.ts +2 -0
- package/dist/array/slice.mjs +10 -0
- package/dist/array/some.cjs +12 -0
- package/dist/array/some.d.ts +6 -0
- package/dist/array/some.mjs +10 -0
- package/dist/array/sort/default.cjs +12 -0
- package/dist/array/sort/default.d.ts +2 -0
- package/dist/array/sort/default.mjs +10 -0
- package/dist/array/sort/index.d.ts +3 -0
- package/dist/array/sort/number.cjs +14 -0
- package/dist/array/sort/number.d.ts +4 -0
- package/dist/array/sort/number.mjs +12 -0
- package/dist/array/sort/string.cjs +24 -0
- package/dist/array/sort/string.d.ts +4 -0
- package/dist/array/sort/string.mjs +22 -0
- package/dist/array/splice/delete.cjs +14 -0
- package/dist/array/splice/delete.d.ts +2 -0
- package/dist/array/splice/delete.mjs +12 -0
- package/dist/array/splice/index.d.ts +3 -0
- package/dist/array/splice/insert.cjs +14 -0
- package/dist/array/splice/insert.d.ts +2 -0
- package/dist/array/splice/insert.mjs +12 -0
- package/dist/array/splice/replace.cjs +14 -0
- package/dist/array/splice/replace.d.ts +2 -0
- package/dist/array/splice/replace.mjs +12 -0
- package/dist/array/sum.cjs +11 -0
- package/dist/array/sum.d.ts +1 -0
- package/dist/array/sum.mjs +9 -0
- package/dist/array/types/atTuple.d.ts +1 -0
- package/dist/array/types/excludeTuple.d.ts +29 -0
- package/dist/array/types/extractTuple.d.ts +38 -0
- package/dist/array/types/index.d.ts +7 -0
- package/dist/array/types/mergeUnionTuple.d.ts +7 -0
- package/dist/array/types/popTuple.d.ts +2 -0
- package/dist/array/types/reverseTuple.d.ts +2 -0
- package/dist/array/types/shiftTuple.d.ts +2 -0
- package/dist/array/types/tupleHasSpread.d.ts +2 -0
- package/dist/array/unshift.cjs +12 -0
- package/dist/array/unshift.d.ts +2 -0
- package/dist/array/unshift.mjs +10 -0
- package/dist/common/addWrappedProperties.cjs +13 -0
- package/dist/common/addWrappedProperties.d.ts +4 -0
- package/dist/common/addWrappedProperties.mjs +11 -0
- package/dist/common/asyncInnerPipe.cjs +14 -0
- package/dist/common/asyncInnerPipe.d.ts +15 -0
- package/dist/common/asyncInnerPipe.mjs +12 -0
- package/dist/common/asyncLoop.cjs +19 -0
- package/dist/common/asyncLoop.d.ts +10 -0
- package/dist/common/asyncLoop.mjs +17 -0
- package/dist/common/asyncPipe.cjs +11 -0
- package/dist/common/asyncPipe.d.ts +16 -0
- package/dist/common/asyncPipe.mjs +9 -0
- package/dist/common/asyncRetry.cjs +25 -0
- package/dist/common/asyncRetry.d.ts +8 -0
- package/dist/common/asyncRetry.mjs +22 -0
- package/dist/common/clone.cjs +24 -0
- package/dist/{clone.d.ts → common/clone.d.ts} +1 -1
- package/dist/common/clone.mjs +22 -0
- package/dist/common/enum.cjs +11 -0
- package/dist/common/enum.d.ts +9 -0
- package/dist/common/enum.mjs +9 -0
- package/dist/common/escapeRegExp.cjs +7 -0
- package/dist/common/escapeRegExp.mjs +5 -0
- package/dist/common/externalPromise.cjs +17 -0
- package/dist/common/externalPromise.d.ts +5 -0
- package/dist/common/externalPromise.mjs +15 -0
- package/dist/common/forward.cjs +7 -0
- package/dist/common/forward.d.ts +1 -0
- package/dist/common/forward.mjs +5 -0
- package/dist/common/index.d.ts +27 -0
- package/dist/common/innerPipe.cjs +13 -0
- package/dist/common/innerPipe.d.ts +12 -0
- package/dist/common/innerPipe.mjs +11 -0
- package/dist/common/interpolation.cjs +9 -0
- package/dist/{interpolation.d.ts → common/interpolation.d.ts} +3 -3
- package/dist/common/interpolation.mjs +7 -0
- package/dist/common/kind.cjs +29 -0
- package/dist/common/kind.d.ts +26 -0
- package/dist/common/kind.mjs +26 -0
- package/dist/common/loop.cjs +19 -0
- package/dist/common/loop.d.ts +15 -0
- package/dist/common/loop.mjs +17 -0
- package/dist/common/pipe.cjs +11 -0
- package/dist/common/pipe.d.ts +12 -0
- package/dist/common/pipe.mjs +9 -0
- package/dist/common/promiseObject.cjs +12 -0
- package/dist/common/promiseObject.d.ts +7 -0
- package/dist/common/promiseObject.mjs +10 -0
- package/dist/common/simpleClone.cjs +25 -0
- package/dist/common/simpleClone.d.ts +1 -0
- package/dist/common/simpleClone.mjs +23 -0
- package/dist/common/sleep.cjs +7 -0
- package/dist/common/sleep.d.ts +1 -0
- package/dist/common/sleep.mjs +5 -0
- package/dist/common/stringToBytes.cjs +43 -0
- package/dist/{stringToBytes.d.ts → common/stringToBytes.d.ts} +3 -0
- package/dist/common/stringToBytes.mjs +40 -0
- package/dist/common/stringToMillisecond.cjs +48 -0
- package/dist/common/stringToMillisecond.d.ts +18 -0
- package/dist/common/stringToMillisecond.mjs +45 -0
- package/dist/common/toJson.cjs +34 -0
- package/dist/common/toJson.d.ts +11 -0
- package/dist/common/toJson.mjs +32 -0
- package/dist/common/toString.cjs +7 -0
- package/dist/common/toString.d.ts +1 -0
- package/dist/common/toString.mjs +5 -0
- package/dist/common/toTransform.cjs +34 -0
- package/dist/common/toTransform.d.ts +11 -0
- package/dist/common/toTransform.mjs +32 -0
- package/dist/common/toWrappedValue.cjs +11 -0
- package/dist/common/toWrappedValue.d.ts +4 -0
- package/dist/common/toWrappedValue.mjs +9 -0
- package/dist/common/types/IsExtends.d.ts +1 -0
- package/dist/common/types/adaptor.d.ts +1 -0
- package/dist/common/types/addOne.d.ts +23 -0
- package/dist/common/types/and.d.ts +2 -0
- package/dist/common/types/anyFunction.d.ts +1 -0
- package/dist/common/types/anyObject.d.ts +4 -0
- package/dist/common/types/anyTuple.d.ts +1 -0
- package/dist/common/types/anyValue.d.ts +2 -0
- package/dist/common/types/breakGenericLink.d.ts +1 -0
- package/dist/common/types/createTupleFromLength.d.ts +6 -0
- package/dist/common/types/deepPartial.d.ts +3 -0
- package/dist/common/types/deepRemoveReadonly.d.ts +3 -0
- package/dist/common/types/escapeAny.d.ts +1 -0
- package/dist/common/types/escapeVoid.d.ts +1 -0
- package/dist/common/types/expectType.d.ts +6 -0
- package/dist/common/types/fixDeepFunctionInfer.d.ts +2 -0
- package/dist/common/types/forcePredicate.d.ts +3 -0
- package/dist/common/types/index.d.ts +37 -0
- package/dist/common/types/isStringLIteral.d.ts +2 -0
- package/dist/common/types/isUnion.d.ts +2 -0
- package/dist/common/types/lastUnionElement.d.ts +2 -0
- package/dist/common/types/maybeArray.d.ts +1 -0
- package/dist/common/types/maybePromise.d.ts +1 -0
- package/dist/common/types/maybeWrapped.d.ts +2 -0
- package/dist/common/types/neverCoalescing.d.ts +2 -0
- package/dist/common/types/not.d.ts +1 -0
- package/dist/common/types/objectEntry.d.ts +2 -0
- package/dist/common/types/objectKey.d.ts +1 -0
- package/dist/common/types/or.d.ts +2 -0
- package/dist/common/types/removeDuplicateInUnion.d.ts +4 -0
- package/dist/common/types/removeReadonly.d.ts +3 -0
- package/dist/common/types/simplifyTopLevel.d.ts +3 -0
- package/dist/common/types/simplifyType.d.ts +3 -0
- package/dist/common/types/simplifyTypeForce.d.ts +3 -0
- package/dist/common/types/toLargeEnsemble.d.ts +6 -0
- package/dist/common/types/unionContain.d.ts +2 -0
- package/dist/common/types/unionToIntersection.d.ts +1 -0
- package/dist/common/types/unionToTuple.d.ts +5 -0
- package/dist/common/unwrap.cjs +11 -0
- package/dist/common/unwrap.d.ts +4 -0
- package/dist/common/unwrap.mjs +9 -0
- package/dist/common/when.d.ts +5 -0
- package/dist/common/whenNot.d.ts +5 -0
- package/dist/common/wrapValue.cjs +15 -0
- package/dist/common/wrapValue.d.ts +9 -0
- package/dist/common/wrapValue.mjs +11 -0
- package/dist/either/base.cjs +7 -0
- package/dist/either/base.d.ts +1 -0
- package/dist/either/base.mjs +5 -0
- package/dist/either/bool/base.cjs +7 -0
- package/dist/either/bool/base.d.ts +1 -0
- package/dist/either/bool/base.mjs +5 -0
- package/dist/either/bool/create.cjs +16 -0
- package/dist/either/bool/create.d.ts +4 -0
- package/dist/either/bool/create.mjs +14 -0
- package/dist/either/bool/falsy.cjs +44 -0
- package/dist/either/bool/falsy.d.ts +16 -0
- package/dist/either/bool/falsy.mjs +39 -0
- package/dist/either/bool/index.d.ts +4 -0
- package/dist/either/bool/truthy.cjs +44 -0
- package/dist/either/bool/truthy.d.ts +15 -0
- package/dist/either/bool/truthy.mjs +39 -0
- package/dist/either/future/MaybeFutureEither.d.ts +2 -0
- package/dist/either/future/base.cjs +7 -0
- package/dist/either/future/base.d.ts +1 -0
- package/dist/either/future/base.mjs +5 -0
- package/dist/either/future/create.cjs +49 -0
- package/dist/either/future/create.d.ts +25 -0
- package/dist/either/future/create.mjs +46 -0
- package/dist/either/future/error.cjs +13 -0
- package/dist/either/future/error.d.ts +6 -0
- package/dist/either/future/error.mjs +10 -0
- package/dist/either/future/index.d.ts +4 -0
- package/dist/either/future/success.cjs +13 -0
- package/dist/either/future/success.d.ts +6 -0
- package/dist/either/future/success.mjs +10 -0
- package/dist/either/hasInformation.cjs +10 -0
- package/dist/either/hasInformation.d.ts +7 -0
- package/dist/either/hasInformation.mjs +8 -0
- package/dist/either/index.cjs +108 -0
- package/dist/either/index.d.ts +10 -0
- package/dist/either/index.mjs +35 -0
- package/dist/either/left/create.cjs +13 -0
- package/dist/either/left/create.d.ts +6 -0
- package/dist/either/left/create.mjs +10 -0
- package/dist/either/left/error.cjs +12 -0
- package/dist/either/left/error.d.ts +5 -0
- package/dist/either/left/error.mjs +9 -0
- package/dist/either/left/fail.cjs +12 -0
- package/dist/either/left/fail.d.ts +5 -0
- package/dist/either/left/fail.mjs +9 -0
- package/dist/either/left/index.d.ts +5 -0
- package/dist/either/left/is.cjs +13 -0
- package/dist/either/left/is.d.ts +2 -0
- package/dist/either/left/is.mjs +11 -0
- package/dist/either/left/when.cjs +18 -0
- package/dist/either/left/when.d.ts +4 -0
- package/dist/either/left/when.mjs +16 -0
- package/dist/either/nullable/base.cjs +7 -0
- package/dist/either/nullable/base.d.ts +1 -0
- package/dist/either/nullable/base.mjs +5 -0
- package/dist/either/nullable/create.cjs +12 -0
- package/dist/either/nullable/create.d.ts +3 -0
- package/dist/either/nullable/create.mjs +10 -0
- package/dist/either/nullable/empty.cjs +44 -0
- package/dist/either/nullable/empty.d.ts +15 -0
- package/dist/either/nullable/empty.mjs +39 -0
- package/dist/either/nullable/filled.cjs +44 -0
- package/dist/either/nullable/filled.d.ts +15 -0
- package/dist/either/nullable/filled.mjs +39 -0
- package/dist/either/nullable/index.d.ts +4 -0
- package/dist/either/nullish/base.cjs +7 -0
- package/dist/either/nullish/base.d.ts +1 -0
- package/dist/either/nullish/base.mjs +5 -0
- package/dist/either/nullish/create.cjs +12 -0
- package/dist/either/nullish/create.d.ts +3 -0
- package/dist/either/nullish/create.mjs +10 -0
- package/dist/either/nullish/empty.cjs +44 -0
- package/dist/either/nullish/empty.d.ts +16 -0
- package/dist/either/nullish/empty.mjs +39 -0
- package/dist/either/nullish/filled.cjs +44 -0
- package/dist/either/nullish/filled.d.ts +15 -0
- package/dist/either/nullish/filled.mjs +39 -0
- package/dist/either/nullish/index.d.ts +4 -0
- package/dist/either/optional/base.cjs +7 -0
- package/dist/either/optional/base.d.ts +1 -0
- package/dist/either/optional/base.mjs +5 -0
- package/dist/either/optional/create.cjs +12 -0
- package/dist/either/optional/create.d.ts +3 -0
- package/dist/either/optional/create.mjs +10 -0
- package/dist/either/optional/empty.cjs +43 -0
- package/dist/either/optional/empty.d.ts +15 -0
- package/dist/either/optional/empty.mjs +38 -0
- package/dist/either/optional/filled.cjs +44 -0
- package/dist/either/optional/filled.d.ts +15 -0
- package/dist/either/optional/filled.mjs +39 -0
- package/dist/either/optional/index.d.ts +4 -0
- package/dist/either/right/asyncPipe.cjs +28 -0
- package/dist/either/right/asyncPipe.d.ts +22 -0
- package/dist/either/right/asyncPipe.mjs +26 -0
- package/dist/either/right/create.cjs +13 -0
- package/dist/either/right/create.d.ts +6 -0
- package/dist/either/right/create.mjs +10 -0
- package/dist/either/right/index.d.ts +7 -0
- package/dist/either/right/is.cjs +13 -0
- package/dist/either/right/is.d.ts +2 -0
- package/dist/either/right/is.mjs +11 -0
- package/dist/either/right/ok.cjs +12 -0
- package/dist/either/right/ok.d.ts +5 -0
- package/dist/either/right/ok.mjs +9 -0
- package/dist/either/right/pipe.cjs +22 -0
- package/dist/either/right/pipe.d.ts +19 -0
- package/dist/either/right/pipe.mjs +20 -0
- package/dist/either/right/success.cjs +12 -0
- package/dist/either/right/success.d.ts +5 -0
- package/dist/either/right/success.mjs +9 -0
- package/dist/either/right/when.cjs +18 -0
- package/dist/either/right/when.d.ts +4 -0
- package/dist/either/right/when.mjs +16 -0
- package/dist/either/whenHasInformation.cjs +24 -0
- package/dist/either/whenHasInformation.d.ts +8 -0
- package/dist/either/whenHasInformation.mjs +22 -0
- package/dist/generator/asyncFilter.cjs +20 -0
- package/dist/generator/asyncFilter.d.ts +8 -0
- package/dist/generator/asyncFilter.mjs +18 -0
- package/dist/generator/asyncLoop.cjs +26 -0
- package/dist/generator/asyncLoop.d.ts +10 -0
- package/dist/generator/asyncLoop.mjs +24 -0
- package/dist/generator/asyncMap.cjs +18 -0
- package/dist/generator/asyncMap.d.ts +6 -0
- package/dist/generator/asyncMap.mjs +16 -0
- package/dist/generator/asyncReduce.cjs +44 -0
- package/dist/generator/asyncReduce.d.ts +30 -0
- package/dist/generator/asyncReduce.mjs +42 -0
- package/dist/generator/execute.cjs +17 -0
- package/dist/generator/execute.d.ts +2 -0
- package/dist/generator/execute.mjs +15 -0
- package/dist/generator/filter.cjs +20 -0
- package/dist/generator/filter.d.ts +8 -0
- package/dist/generator/filter.mjs +18 -0
- package/dist/generator/index.cjs +23 -0
- package/dist/generator/index.d.ts +9 -0
- package/dist/generator/index.mjs +9 -0
- package/dist/generator/loop.cjs +26 -0
- package/dist/generator/loop.d.ts +15 -0
- package/dist/generator/loop.mjs +24 -0
- package/dist/generator/map.cjs +18 -0
- package/dist/generator/map.d.ts +6 -0
- package/dist/generator/map.mjs +16 -0
- package/dist/generator/reduce.cjs +42 -0
- package/dist/generator/reduce.d.ts +30 -0
- package/dist/generator/reduce.mjs +40 -0
- package/dist/index.cjs +79 -133
- package/dist/index.d.ts +15 -25
- package/dist/index.mjs +47 -124
- package/dist/number/abs.cjs +7 -0
- package/dist/number/abs.d.ts +1 -0
- package/dist/number/abs.mjs +5 -0
- package/dist/number/acos.cjs +7 -0
- package/dist/number/acos.d.ts +1 -0
- package/dist/number/acos.mjs +5 -0
- package/dist/number/add.cjs +12 -0
- package/dist/number/add.d.ts +2 -0
- package/dist/number/add.mjs +10 -0
- package/dist/number/asin.cjs +7 -0
- package/dist/number/asin.d.ts +1 -0
- package/dist/number/asin.mjs +5 -0
- package/dist/number/atan.cjs +7 -0
- package/dist/number/atan.d.ts +1 -0
- package/dist/number/atan.mjs +5 -0
- package/dist/number/atan2.cjs +12 -0
- package/dist/number/atan2.d.ts +2 -0
- package/dist/number/atan2.mjs +10 -0
- package/dist/number/ceil.cjs +7 -0
- package/dist/number/ceil.d.ts +1 -0
- package/dist/number/ceil.mjs +5 -0
- package/dist/number/clamp.cjs +14 -0
- package/dist/number/clamp.d.ts +2 -0
- package/dist/number/clamp.mjs +12 -0
- package/dist/number/cos.cjs +7 -0
- package/dist/number/cos.d.ts +1 -0
- package/dist/number/cos.mjs +5 -0
- package/dist/number/divide.cjs +12 -0
- package/dist/number/divide.d.ts +2 -0
- package/dist/number/divide.mjs +10 -0
- package/dist/number/floor.cjs +7 -0
- package/dist/number/floor.d.ts +1 -0
- package/dist/number/floor.mjs +5 -0
- package/dist/number/index.cjs +49 -0
- package/dist/number/index.d.ts +22 -0
- package/dist/number/index.mjs +22 -0
- package/dist/number/max.cjs +12 -0
- package/dist/number/max.d.ts +2 -0
- package/dist/number/max.mjs +10 -0
- package/dist/number/min.cjs +12 -0
- package/dist/number/min.d.ts +2 -0
- package/dist/number/min.mjs +10 -0
- package/dist/number/modulo.cjs +12 -0
- package/dist/number/modulo.d.ts +2 -0
- package/dist/number/modulo.mjs +10 -0
- package/dist/number/multiply.cjs +12 -0
- package/dist/number/multiply.d.ts +2 -0
- package/dist/number/multiply.mjs +10 -0
- package/dist/number/negate.cjs +7 -0
- package/dist/number/negate.d.ts +1 -0
- package/dist/number/negate.mjs +5 -0
- package/dist/number/power.cjs +12 -0
- package/dist/number/power.d.ts +2 -0
- package/dist/number/power.mjs +10 -0
- package/dist/number/round.cjs +7 -0
- package/dist/number/round.d.ts +1 -0
- package/dist/number/round.mjs +5 -0
- package/dist/number/sin.cjs +7 -0
- package/dist/number/sin.d.ts +1 -0
- package/dist/number/sin.mjs +5 -0
- package/dist/number/subtract.cjs +12 -0
- package/dist/number/subtract.d.ts +2 -0
- package/dist/number/subtract.mjs +10 -0
- package/dist/number/tan.cjs +7 -0
- package/dist/number/tan.d.ts +1 -0
- package/dist/number/tan.mjs +5 -0
- package/dist/number/trunc.cjs +7 -0
- package/dist/number/trunc.d.ts +1 -0
- package/dist/number/trunc.mjs +5 -0
- package/dist/object/assign.cjs +15 -0
- package/dist/object/assign.d.ts +4 -0
- package/dist/object/assign.mjs +13 -0
- package/dist/object/entries.cjs +10 -0
- package/dist/object/entries.d.ts +7 -0
- package/dist/object/entries.mjs +8 -0
- package/dist/object/fromEntries.cjs +7 -0
- package/dist/object/fromEntries.d.ts +6 -0
- package/dist/object/fromEntries.mjs +5 -0
- package/dist/object/getProperty.cjs +12 -0
- package/dist/object/getProperty.d.ts +8 -0
- package/dist/object/getProperty.mjs +10 -0
- package/dist/object/hasKeys.cjs +18 -0
- package/dist/object/hasKeys.d.ts +3 -0
- package/dist/object/hasKeys.mjs +16 -0
- package/dist/object/index.cjs +31 -0
- package/dist/object/index.d.ts +14 -0
- package/dist/object/index.mjs +13 -0
- package/dist/object/keys.cjs +7 -0
- package/dist/object/keys.d.ts +1 -0
- package/dist/object/keys.mjs +5 -0
- package/dist/object/omit.cjs +24 -0
- package/dist/object/omit.d.ts +8 -0
- package/dist/object/omit.mjs +22 -0
- package/dist/object/override.cjs +18 -0
- package/dist/object/override.d.ts +2 -0
- package/dist/object/override.mjs +16 -0
- package/dist/object/pick.cjs +24 -0
- package/dist/object/pick.d.ts +7 -0
- package/dist/object/pick.mjs +22 -0
- package/dist/object/to.cjs +16 -0
- package/dist/object/to.d.ts +10 -0
- package/dist/object/to.mjs +14 -0
- package/dist/object/transformProperties.cjs +18 -0
- package/dist/object/transformProperties.d.ts +10 -0
- package/dist/object/transformProperties.mjs +16 -0
- package/dist/object/transformProperty.cjs +15 -0
- package/dist/object/transformProperty.d.ts +7 -0
- package/dist/object/transformProperty.mjs +13 -0
- package/dist/object/types/UnionObjectToIntersection.d.ts +2 -0
- package/dist/object/types/assignObjects.d.ts +2 -0
- package/dist/object/types/flatObject.d.ts +25 -0
- package/dist/object/types/getPropsWithValue.d.ts +4 -0
- package/dist/object/types/index.d.ts +6 -0
- package/dist/object/types/partialKeys.d.ts +2 -0
- package/dist/object/types/requiredKeys.d.ts +2 -0
- package/dist/object/values.cjs +7 -0
- package/dist/object/values.d.ts +4 -0
- package/dist/object/values.mjs +5 -0
- package/dist/pattern/exhaustive.cjs +9 -0
- package/dist/pattern/exhaustive.d.ts +3 -0
- package/dist/pattern/exhaustive.mjs +7 -0
- package/dist/pattern/index.cjs +22 -0
- package/dist/pattern/index.d.ts +8 -0
- package/dist/pattern/index.mjs +8 -0
- package/dist/pattern/isMatch.cjs +44 -0
- package/dist/pattern/isMatch.d.ts +2 -0
- package/dist/pattern/isMatch.mjs +42 -0
- package/dist/pattern/match.cjs +18 -0
- package/dist/pattern/match.d.ts +6 -0
- package/dist/pattern/match.mjs +16 -0
- package/dist/pattern/matchPrimitive.cjs +17 -0
- package/dist/pattern/matchPrimitive.d.ts +3 -0
- package/dist/pattern/matchPrimitive.mjs +15 -0
- package/dist/pattern/otherwise.cjs +17 -0
- package/dist/pattern/otherwise.d.ts +4 -0
- package/dist/pattern/otherwise.mjs +15 -0
- package/dist/pattern/result.cjs +13 -0
- package/dist/pattern/result.d.ts +7 -0
- package/dist/pattern/result.mjs +10 -0
- package/dist/pattern/types/complexMatchedValue/array.d.ts +40 -0
- package/dist/pattern/types/complexMatchedValue/index.d.ts +6 -0
- package/dist/pattern/types/complexMatchedValue/maybeAll.d.ts +3 -0
- package/dist/pattern/types/complexMatchedValue/object.d.ts +11 -0
- package/dist/pattern/types/complexMatchedValue/primitive.d.ts +9 -0
- package/dist/pattern/types/complexUnMatchedValue/array.d.ts +27 -0
- package/dist/pattern/types/complexUnMatchedValue/getIncompleteUnion.d.ts +66 -0
- package/dist/pattern/types/complexUnMatchedValue/index.d.ts +9 -0
- package/dist/pattern/types/complexUnMatchedValue/maybeAll.d.ts +3 -0
- package/dist/pattern/types/complexUnMatchedValue/object.d.ts +17 -0
- package/dist/pattern/types/complexUnMatchedValue/primitive.d.ts +8 -0
- package/dist/pattern/types/complexUnMatchedValue/unionObject.d.ts +3 -0
- package/dist/pattern/types/index.d.ts +3 -0
- package/dist/pattern/types/pattern.cjs +5 -0
- package/dist/pattern/types/pattern.d.ts +37 -0
- package/dist/pattern/types/pattern.mjs +3 -0
- package/dist/pattern/union.cjs +20 -0
- package/dist/pattern/union.d.ts +6 -0
- package/dist/pattern/union.mjs +18 -0
- package/dist/string/at/default.cjs +12 -0
- package/dist/string/at/default.d.ts +2 -0
- package/dist/string/at/default.mjs +10 -0
- package/dist/string/at/first.cjs +7 -0
- package/dist/string/at/first.d.ts +2 -0
- package/dist/string/at/first.mjs +5 -0
- package/dist/string/at/index.d.ts +3 -0
- package/dist/string/at/last.cjs +9 -0
- package/dist/string/at/last.d.ts +2 -0
- package/dist/string/at/last.mjs +7 -0
- package/dist/string/capitalize.cjs +7 -0
- package/dist/string/capitalize.d.ts +1 -0
- package/dist/string/capitalize.mjs +5 -0
- package/dist/string/charAt.cjs +12 -0
- package/dist/string/charAt.d.ts +2 -0
- package/dist/string/charAt.mjs +10 -0
- package/dist/string/concat.cjs +12 -0
- package/dist/string/concat.d.ts +2 -0
- package/dist/string/concat.mjs +10 -0
- package/dist/string/endsWith.cjs +12 -0
- package/dist/string/endsWith.d.ts +2 -0
- package/dist/string/endsWith.mjs +10 -0
- package/dist/string/includes.cjs +12 -0
- package/dist/string/includes.d.ts +2 -0
- package/dist/string/includes.mjs +10 -0
- package/dist/string/index.cjs +67 -0
- package/dist/string/index.d.ts +28 -0
- package/dist/string/index.mjs +31 -0
- package/dist/string/indexOf.cjs +13 -0
- package/dist/string/indexOf.d.ts +2 -0
- package/dist/string/indexOf.mjs +11 -0
- package/dist/string/isKeyof.cjs +12 -0
- package/dist/string/isKeyof.d.ts +3 -0
- package/dist/string/isKeyof.mjs +10 -0
- package/dist/string/lastIndexOf.cjs +13 -0
- package/dist/string/lastIndexOf.d.ts +2 -0
- package/dist/string/lastIndexOf.mjs +11 -0
- package/dist/string/match.cjs +13 -0
- package/dist/string/match.d.ts +2 -0
- package/dist/string/match.mjs +11 -0
- package/dist/string/matchAll.cjs +12 -0
- package/dist/string/matchAll.d.ts +2 -0
- package/dist/string/matchAll.mjs +10 -0
- package/dist/string/normalize.cjs +12 -0
- package/dist/string/normalize.d.ts +3 -0
- package/dist/string/normalize.mjs +10 -0
- package/dist/string/padEnd.cjs +12 -0
- package/dist/string/padEnd.d.ts +2 -0
- package/dist/string/padEnd.mjs +10 -0
- package/dist/string/padStart.cjs +12 -0
- package/dist/string/padStart.d.ts +2 -0
- package/dist/string/padStart.mjs +10 -0
- package/dist/string/repeat.cjs +15 -0
- package/dist/string/repeat.d.ts +2 -0
- package/dist/string/repeat.mjs +13 -0
- package/dist/string/replace.cjs +12 -0
- package/dist/string/replace.d.ts +2 -0
- package/dist/string/replace.mjs +10 -0
- package/dist/string/replaceAll.cjs +12 -0
- package/dist/string/replaceAll.d.ts +2 -0
- package/dist/string/replaceAll.mjs +10 -0
- package/dist/string/search.cjs +13 -0
- package/dist/string/search.d.ts +2 -0
- package/dist/string/search.mjs +11 -0
- package/dist/string/slice.cjs +12 -0
- package/dist/string/slice.d.ts +2 -0
- package/dist/string/slice.mjs +10 -0
- package/dist/string/split.cjs +16 -0
- package/dist/string/split.d.ts +9 -0
- package/dist/string/split.mjs +14 -0
- package/dist/string/startsWith.cjs +12 -0
- package/dist/string/startsWith.d.ts +2 -0
- package/dist/string/startsWith.mjs +10 -0
- package/dist/string/substring.cjs +12 -0
- package/dist/string/substring.d.ts +2 -0
- package/dist/string/substring.mjs +10 -0
- package/dist/string/test.cjs +12 -0
- package/dist/string/test.d.ts +2 -0
- package/dist/string/test.mjs +10 -0
- package/dist/string/toLowerCase.cjs +7 -0
- package/dist/string/toLowerCase.d.ts +1 -0
- package/dist/string/toLowerCase.mjs +5 -0
- package/dist/string/toUpperCase.cjs +7 -0
- package/dist/string/toUpperCase.d.ts +1 -0
- package/dist/string/toUpperCase.mjs +5 -0
- package/dist/string/trim/default.cjs +7 -0
- package/dist/string/trim/default.d.ts +1 -0
- package/dist/string/trim/default.mjs +5 -0
- package/dist/string/trim/end.cjs +7 -0
- package/dist/string/trim/end.d.ts +1 -0
- package/dist/string/trim/end.mjs +5 -0
- package/dist/string/trim/index.d.ts +3 -0
- package/dist/string/trim/start.cjs +7 -0
- package/dist/string/trim/start.d.ts +1 -0
- package/dist/string/trim/start.mjs +5 -0
- package/dist/string/types/NormalizeForm.d.ts +1 -0
- package/dist/string/types/endsWith.d.ts +1 -0
- package/dist/string/types/first.d.ts +2 -0
- package/dist/string/types/includes.d.ts +1 -0
- package/dist/string/types/index.d.ts +5 -0
- package/dist/string/types/last.d.ts +2 -0
- package/dist/string/types/split.d.ts +9 -0
- package/dist/string/types/startsWith.d.ts +1 -0
- package/dist/string/uncapitalize.cjs +7 -0
- package/dist/string/uncapitalize.d.ts +1 -0
- package/dist/string/uncapitalize.mjs +5 -0
- package/package.json +20 -27
- package/dist/addThis.d.ts +0 -2
- package/dist/entryUseMapper.d.ts +0 -6
- package/dist/expectType.d.ts +0 -6
- package/dist/getLastOfUnion.d.ts +0 -2
- package/dist/getPropsWithTrueValue.d.ts +0 -3
- package/dist/getTypedEntries.d.ts +0 -6
- package/dist/getTypedKeys.d.ts +0 -1
- package/dist/hasKey.d.ts +0 -2
- package/dist/incremente.d.ts +0 -33
- package/dist/mergeObjects.d.ts +0 -4
- package/dist/overrideInterface.d.ts +0 -1
- package/dist/partialKeys.d.ts +0 -2
- package/dist/requiredKeys.d.ts +0 -2
- package/dist/simpleClone.d.ts +0 -1
- package/dist/simplifyType.d.ts +0 -9
- package/dist/sleep.d.ts +0 -1
- package/dist/types.d.ts +0 -4
- package/dist/unPartial.d.ts +0 -10
- package/dist/unionToIntersection.d.ts +0 -1
- package/dist/unionToTuple.d.ts +0 -4
- package/dist/uniqueGeneric.d.ts +0 -5
- /package/dist/{escapeRegExp.d.ts → common/escapeRegExp.d.ts} +0 -0
- /package/dist/{isEqual.d.ts → common/types/isEqual.d.ts} +0 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function spliceDelete(...args) {
|
|
4
|
+
if (args.length === 2) {
|
|
5
|
+
const [indexTo, deleteCount] = args;
|
|
6
|
+
return (array) => spliceDelete(array, indexTo, deleteCount);
|
|
7
|
+
}
|
|
8
|
+
const [array, indexTo, deleteCount] = args;
|
|
9
|
+
const copy = [...array];
|
|
10
|
+
copy.splice(indexTo, deleteCount);
|
|
11
|
+
return copy;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
exports.spliceDelete = spliceDelete;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare function spliceDelete<GenericElement extends unknown>(indexTo: number, deleteCount: number): (array: readonly GenericElement[]) => GenericElement[];
|
|
2
|
+
export declare function spliceDelete<GenericElement extends unknown>(array: readonly GenericElement[], indexTo: number, deleteCount: number): GenericElement[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
function spliceDelete(...args) {
|
|
2
|
+
if (args.length === 2) {
|
|
3
|
+
const [indexTo, deleteCount] = args;
|
|
4
|
+
return (array) => spliceDelete(array, indexTo, deleteCount);
|
|
5
|
+
}
|
|
6
|
+
const [array, indexTo, deleteCount] = args;
|
|
7
|
+
const copy = [...array];
|
|
8
|
+
copy.splice(indexTo, deleteCount);
|
|
9
|
+
return copy;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { spliceDelete };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function spliceInsert(...args) {
|
|
4
|
+
if (args.length === 2) {
|
|
5
|
+
const [indexFrom, elements] = args;
|
|
6
|
+
return (array) => spliceInsert(array, indexFrom, elements);
|
|
7
|
+
}
|
|
8
|
+
const [array, indexFrom, elements] = args;
|
|
9
|
+
const copy = [...array];
|
|
10
|
+
copy.splice(indexFrom, 0, ...elements);
|
|
11
|
+
return copy;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
exports.spliceInsert = spliceInsert;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare function spliceInsert<GenericElement extends unknown>(indexFrom: number, elements: GenericElement[]): (array: readonly GenericElement[]) => GenericElement[];
|
|
2
|
+
export declare function spliceInsert<GenericElement extends unknown>(array: readonly GenericElement[], indexFrom: number, elements: GenericElement[]): GenericElement[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
function spliceInsert(...args) {
|
|
2
|
+
if (args.length === 2) {
|
|
3
|
+
const [indexFrom, elements] = args;
|
|
4
|
+
return (array) => spliceInsert(array, indexFrom, elements);
|
|
5
|
+
}
|
|
6
|
+
const [array, indexFrom, elements] = args;
|
|
7
|
+
const copy = [...array];
|
|
8
|
+
copy.splice(indexFrom, 0, ...elements);
|
|
9
|
+
return copy;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { spliceInsert };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function spliceReplace(...args) {
|
|
4
|
+
if (args.length === 2) {
|
|
5
|
+
const [indexFrom, elements] = args;
|
|
6
|
+
return (array) => spliceReplace(array, indexFrom, elements);
|
|
7
|
+
}
|
|
8
|
+
const [array, indexFrom, elements] = args;
|
|
9
|
+
const copy = [...array];
|
|
10
|
+
copy.splice(indexFrom, elements.length, ...elements);
|
|
11
|
+
return copy;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
exports.spliceReplace = spliceReplace;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare function spliceReplace<GenericElement extends unknown>(indexFrom: number, elements: GenericElement[]): (array: readonly GenericElement[]) => GenericElement[];
|
|
2
|
+
export declare function spliceReplace<GenericElement extends unknown>(array: readonly GenericElement[], indexFrom: number, elements: GenericElement[]): GenericElement[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
function spliceReplace(...args) {
|
|
2
|
+
if (args.length === 2) {
|
|
3
|
+
const [indexFrom, elements] = args;
|
|
4
|
+
return (array) => spliceReplace(array, indexFrom, elements);
|
|
5
|
+
}
|
|
6
|
+
const [array, indexFrom, elements] = args;
|
|
7
|
+
const copy = [...array];
|
|
8
|
+
copy.splice(indexFrom, elements.length, ...elements);
|
|
9
|
+
return copy;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { spliceReplace };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function sum<GenericArray extends readonly number[]>(array: GenericArray): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type AtTuple<GenericTuple extends readonly unknown[], GenericIndex extends number> = GenericIndex extends keyof GenericTuple ? GenericTuple[GenericIndex] : undefined;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type LastUnionElement, type AnyTuple, type IsEqual, type IsUnion, type Or } from "../../common";
|
|
2
|
+
export type ExcludeTuple<GenericValue extends unknown, GenericArray extends readonly any[]> = Or<[
|
|
3
|
+
IsEqual<GenericValue, never>,
|
|
4
|
+
IsEqual<GenericArray, never>
|
|
5
|
+
]> extends true ? GenericValue : IsUnion<GenericArray> extends true ? LastUnionElement<GenericArray> extends infer InferredArray extends readonly any[] ? ExcludeTuple<GenericValue, InferredArray> extends infer InferredResult ? IsEqual<InferredResult, never> extends true ? never : ExcludeTuple<InferredResult, Exclude<GenericArray, InferredArray>> : never : never : GenericValue extends readonly any[] ? (([
|
|
6
|
+
Extract<GenericValue, readonly any[]>,
|
|
7
|
+
Exclude<Extract<GenericArray, readonly any[]>, AnyTuple>
|
|
8
|
+
] extends [
|
|
9
|
+
infer InferredValue extends readonly any[],
|
|
10
|
+
infer InferredArray extends readonly any[]
|
|
11
|
+
] ? Or<[
|
|
12
|
+
IsEqual<InferredValue, never>,
|
|
13
|
+
IsEqual<InferredArray, never>
|
|
14
|
+
]> extends true ? never : InferredValue[number] extends InferredArray[number] ? never : InferredValue : never) | ([
|
|
15
|
+
Extract<GenericValue, AnyTuple>,
|
|
16
|
+
Extract<GenericArray, AnyTuple>
|
|
17
|
+
] extends [
|
|
18
|
+
infer InferredValue extends readonly any[],
|
|
19
|
+
infer InferredArray extends readonly any[]
|
|
20
|
+
] ? Or<[
|
|
21
|
+
IsEqual<InferredValue, never>,
|
|
22
|
+
IsEqual<InferredArray, never>
|
|
23
|
+
]> extends true ? never : [
|
|
24
|
+
InferredValue,
|
|
25
|
+
InferredArray
|
|
26
|
+
] extends [
|
|
27
|
+
readonly [infer InferredValueFirst, ...infer InferredValueRest],
|
|
28
|
+
readonly [infer InferredArrayFirst, ...infer InferredArrayRest]
|
|
29
|
+
] ? InferredValueFirst extends InferredArrayFirst ? InferredArrayRest extends readonly [] ? never : InferredValueRest extends readonly [] ? InferredValue : ExcludeTuple<InferredValueRest, InferredArrayRest> extends infer InferredRestResult ? IsEqual<InferredRestResult, never> extends true ? never : InferredValue : never : InferredValue : never : never)) : GenericValue;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type IsUnion, type Or, type AnyTuple, type IsEqual } from "../../common";
|
|
2
|
+
export type ExtractTuple<GenericValue extends unknown, GenericArray extends readonly any[]> = GenericValue extends readonly any[] ? Or<[
|
|
3
|
+
IsEqual<GenericValue, never>,
|
|
4
|
+
IsEqual<GenericArray, never>
|
|
5
|
+
]> extends true ? never : IsUnion<GenericArray> extends true ? GenericArray extends any ? ExtractTuple<GenericValue, GenericArray> : never : (([
|
|
6
|
+
Extract<GenericValue, readonly any[]>,
|
|
7
|
+
Exclude<Extract<GenericArray, readonly any[]>, AnyTuple>
|
|
8
|
+
] extends [
|
|
9
|
+
infer InferredValue extends readonly any[],
|
|
10
|
+
infer InferredArray extends readonly any[]
|
|
11
|
+
] ? Or<[
|
|
12
|
+
IsEqual<InferredValue, never>,
|
|
13
|
+
IsEqual<InferredArray, never>
|
|
14
|
+
]> extends true ? never : InferredValue[number] extends InferredArray[number] ? InferredValue : never : never) | ([
|
|
15
|
+
Extract<GenericValue, AnyTuple>,
|
|
16
|
+
Extract<GenericArray, AnyTuple>
|
|
17
|
+
] extends [
|
|
18
|
+
infer InferredValue extends readonly any[],
|
|
19
|
+
infer InferredArray extends readonly any[]
|
|
20
|
+
] ? Or<[
|
|
21
|
+
IsEqual<InferredValue, never>,
|
|
22
|
+
IsEqual<InferredArray, never>
|
|
23
|
+
]> extends true ? never : [
|
|
24
|
+
InferredValue,
|
|
25
|
+
InferredArray
|
|
26
|
+
] extends [
|
|
27
|
+
readonly [infer InferredValueFirst, ...infer InferredValueRest],
|
|
28
|
+
readonly [infer InferredArrayFirst, ...infer InferredArrayRest]
|
|
29
|
+
] ? InferredValueFirst extends InferredArrayFirst ? InferredArrayRest extends readonly [] ? InferredValue : ExtractTuple<InferredValueRest, InferredArrayRest> extends infer InferredRestResult ? IsEqual<InferredRestResult, never> extends true ? never : InferredValue : never : never : never : never) | ([
|
|
30
|
+
Extract<GenericValue, readonly any[]>,
|
|
31
|
+
Extract<GenericArray, readonly []>
|
|
32
|
+
] extends [
|
|
33
|
+
infer InferredValue extends readonly any[],
|
|
34
|
+
infer InferredArray extends readonly any[]
|
|
35
|
+
] ? Or<[
|
|
36
|
+
IsEqual<InferredValue, never>,
|
|
37
|
+
IsEqual<InferredArray, never>
|
|
38
|
+
]> extends true ? never : InferredValue : never)) : never;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type IsUnion, type AnyTuple, type IsEqual } from "../../common";
|
|
2
|
+
type CreateTupleFromArray<GenericInput extends readonly any[]> = GenericInput extends AnyTuple ? GenericInput : [GenericInput[number], ...GenericInput];
|
|
3
|
+
export type MergeUnionTuple<GenericTuple extends AnyTuple> = IsUnion<GenericTuple> extends true ? [
|
|
4
|
+
GenericTuple[0],
|
|
5
|
+
...(Extract<GenericTuple, any> extends [any, ...infer InferredRest] ? IsEqual<Extract<InferredRest, AnyTuple | []>, never> extends true ? InferredRest[number][] : (Exclude<InferredRest, readonly []> extends infer InferredValue extends readonly any[] ? IsEqual<InferredValue, never> extends true ? [] : Extract<MergeUnionTuple<CreateTupleFromArray<InferredValue>>, any> : never) : [])
|
|
6
|
+
] : GenericTuple;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare function unshift<GenericElement extends unknown>(element: NoInfer<GenericElement>): (array: readonly GenericElement[]) => GenericElement[];
|
|
2
|
+
export declare function unshift<GenericElement extends unknown>(array: readonly GenericElement[], element: NoInfer<GenericElement>, ...elements: NoInfer<GenericElement>[]): GenericElement[];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type GetWrappedProperties<GenericWrappedValue extends object = object, GenericProperties extends object = object> = (params: {
|
|
2
|
+
wrappedValue: GenericWrappedValue;
|
|
3
|
+
}) => GenericProperties;
|
|
4
|
+
export declare function addWrappedProperties<GenericWrappedValue extends object, GenericGetWrappedProperties extends GetWrappedProperties<GenericWrappedValue>>(wrappedValue: GenericWrappedValue, getProperties: GenericGetWrappedProperties): GenericWrappedValue & ReturnType<GenericGetWrappedProperties>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/* eslint-disable @typescript-eslint/max-params */
|
|
4
|
+
function asyncInnerPipe(...pipes) {
|
|
5
|
+
return async (input) => {
|
|
6
|
+
let acc = input;
|
|
7
|
+
for (const pipe of pipes) {
|
|
8
|
+
acc = await pipe(acc);
|
|
9
|
+
}
|
|
10
|
+
return acc;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
exports.asyncInnerPipe = asyncInnerPipe;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type MaybeFutureEither } from "../either/future/MaybeFutureEither";
|
|
2
|
+
import { type MaybePromise, type EscapeVoid, type BreakGenericLink } from "./types";
|
|
3
|
+
import { type AnyValue } from "./types/anyValue";
|
|
4
|
+
type MaybePromiseLike<GenericValue extends unknown> = MaybePromise<GenericValue> | MaybeFutureEither<GenericValue>;
|
|
5
|
+
export declare function asyncInnerPipe<GenericInput extends AnyValue, GenericOutputPipe1 extends AnyValue | EscapeVoid>(pipe1: (input: BreakGenericLink<GenericInput>) => MaybePromiseLike<GenericOutputPipe1>): (input: MaybePromiseLike<GenericInput>) => Promise<Awaited<GenericOutputPipe1>>;
|
|
6
|
+
export declare function asyncInnerPipe<GenericInput extends AnyValue, GenericOutputPipe1 extends AnyValue | EscapeVoid, GenericOutputPipe2 extends AnyValue | EscapeVoid>(pipe1: (input: BreakGenericLink<GenericInput>) => MaybePromiseLike<GenericOutputPipe1>, pipe2: (input: BreakGenericLink<GenericOutputPipe1>) => MaybePromiseLike<GenericOutputPipe2>): (input: MaybePromiseLike<GenericInput>) => Promise<Awaited<GenericOutputPipe2>>;
|
|
7
|
+
export declare function asyncInnerPipe<GenericInput extends AnyValue, GenericOutputPipe1 extends AnyValue | EscapeVoid, GenericOutputPipe2 extends AnyValue | EscapeVoid, GenericOutputPipe3 extends AnyValue | EscapeVoid>(pipe1: (input: BreakGenericLink<GenericInput>) => MaybePromiseLike<GenericOutputPipe1>, pipe2: (input: BreakGenericLink<GenericOutputPipe1>) => MaybePromiseLike<GenericOutputPipe2>, pipe3: (input: BreakGenericLink<GenericOutputPipe2>) => MaybePromiseLike<GenericOutputPipe3>): (input: MaybePromiseLike<GenericInput>) => Promise<Awaited<GenericOutputPipe3>>;
|
|
8
|
+
export declare function asyncInnerPipe<GenericInput extends AnyValue, GenericOutputPipe1 extends AnyValue | EscapeVoid, GenericOutputPipe2 extends AnyValue | EscapeVoid, GenericOutputPipe3 extends AnyValue | EscapeVoid, GenericOutputPipe4 extends AnyValue | EscapeVoid>(pipe1: (input: BreakGenericLink<GenericInput>) => MaybePromiseLike<GenericOutputPipe1>, pipe2: (input: BreakGenericLink<GenericOutputPipe1>) => MaybePromiseLike<GenericOutputPipe2>, pipe3: (input: BreakGenericLink<GenericOutputPipe2>) => MaybePromiseLike<GenericOutputPipe3>, pipe4: (input: BreakGenericLink<GenericOutputPipe3>) => MaybePromiseLike<GenericOutputPipe4>): (input: MaybePromiseLike<GenericInput>) => Promise<Awaited<GenericOutputPipe4>>;
|
|
9
|
+
export declare function asyncInnerPipe<GenericInput extends AnyValue, GenericOutputPipe1 extends AnyValue | EscapeVoid, GenericOutputPipe2 extends AnyValue | EscapeVoid, GenericOutputPipe3 extends AnyValue | EscapeVoid, GenericOutputPipe4 extends AnyValue | EscapeVoid, GenericOutputPipe5 extends AnyValue | EscapeVoid>(pipe1: (input: BreakGenericLink<GenericInput>) => MaybePromiseLike<GenericOutputPipe1>, pipe2: (input: BreakGenericLink<GenericOutputPipe1>) => MaybePromiseLike<GenericOutputPipe2>, pipe3: (input: BreakGenericLink<GenericOutputPipe2>) => MaybePromiseLike<GenericOutputPipe3>, pipe4: (input: BreakGenericLink<GenericOutputPipe3>) => MaybePromiseLike<GenericOutputPipe4>, pipe5: (input: BreakGenericLink<GenericOutputPipe4>) => MaybePromiseLike<GenericOutputPipe5>): (input: MaybePromiseLike<GenericInput>) => Promise<Awaited<GenericOutputPipe5>>;
|
|
10
|
+
export declare function asyncInnerPipe<GenericInput extends AnyValue, GenericOutputPipe1 extends AnyValue | EscapeVoid, GenericOutputPipe2 extends AnyValue | EscapeVoid, GenericOutputPipe3 extends AnyValue | EscapeVoid, GenericOutputPipe4 extends AnyValue | EscapeVoid, GenericOutputPipe5 extends AnyValue | EscapeVoid, GenericOutputPipe6 extends AnyValue | EscapeVoid>(pipe1: (input: BreakGenericLink<GenericInput>) => MaybePromiseLike<GenericOutputPipe1>, pipe2: (input: BreakGenericLink<GenericOutputPipe1>) => MaybePromiseLike<GenericOutputPipe2>, pipe3: (input: BreakGenericLink<GenericOutputPipe2>) => MaybePromiseLike<GenericOutputPipe3>, pipe4: (input: BreakGenericLink<GenericOutputPipe3>) => MaybePromiseLike<GenericOutputPipe4>, pipe5: (input: BreakGenericLink<GenericOutputPipe4>) => MaybePromiseLike<GenericOutputPipe5>, pipe6: (input: BreakGenericLink<GenericOutputPipe5>) => MaybePromiseLike<GenericOutputPipe6>): (input: MaybePromiseLike<GenericInput>) => Promise<Awaited<GenericOutputPipe6>>;
|
|
11
|
+
export declare function asyncInnerPipe<GenericInput extends AnyValue, GenericOutputPipe1 extends AnyValue | EscapeVoid, GenericOutputPipe2 extends AnyValue | EscapeVoid, GenericOutputPipe3 extends AnyValue | EscapeVoid, GenericOutputPipe4 extends AnyValue | EscapeVoid, GenericOutputPipe5 extends AnyValue | EscapeVoid, GenericOutputPipe6 extends AnyValue | EscapeVoid, GenericOutputPipe7 extends AnyValue | EscapeVoid>(pipe1: (input: BreakGenericLink<GenericInput>) => MaybePromiseLike<GenericOutputPipe1>, pipe2: (input: BreakGenericLink<GenericOutputPipe1>) => MaybePromiseLike<GenericOutputPipe2>, pipe3: (input: BreakGenericLink<GenericOutputPipe2>) => MaybePromiseLike<GenericOutputPipe3>, pipe4: (input: BreakGenericLink<GenericOutputPipe3>) => MaybePromiseLike<GenericOutputPipe4>, pipe5: (input: BreakGenericLink<GenericOutputPipe4>) => MaybePromiseLike<GenericOutputPipe5>, pipe6: (input: BreakGenericLink<GenericOutputPipe5>) => MaybePromiseLike<GenericOutputPipe6>, pipe7: (input: BreakGenericLink<GenericOutputPipe6>) => MaybePromiseLike<GenericOutputPipe7>): (input: MaybePromiseLike<GenericInput>) => Promise<Awaited<GenericOutputPipe7>>;
|
|
12
|
+
export declare function asyncInnerPipe<GenericInput extends AnyValue, GenericOutputPipe1 extends AnyValue | EscapeVoid, GenericOutputPipe2 extends AnyValue | EscapeVoid, GenericOutputPipe3 extends AnyValue | EscapeVoid, GenericOutputPipe4 extends AnyValue | EscapeVoid, GenericOutputPipe5 extends AnyValue | EscapeVoid, GenericOutputPipe6 extends AnyValue | EscapeVoid, GenericOutputPipe7 extends AnyValue | EscapeVoid, GenericOutputPipe8 extends AnyValue | EscapeVoid>(pipe1: (input: BreakGenericLink<GenericInput>) => MaybePromiseLike<GenericOutputPipe1>, pipe2: (input: BreakGenericLink<GenericOutputPipe1>) => MaybePromiseLike<GenericOutputPipe2>, pipe3: (input: BreakGenericLink<GenericOutputPipe2>) => MaybePromiseLike<GenericOutputPipe3>, pipe4: (input: BreakGenericLink<GenericOutputPipe3>) => MaybePromiseLike<GenericOutputPipe4>, pipe5: (input: BreakGenericLink<GenericOutputPipe4>) => MaybePromiseLike<GenericOutputPipe5>, pipe6: (input: BreakGenericLink<GenericOutputPipe5>) => MaybePromiseLike<GenericOutputPipe6>, pipe7: (input: BreakGenericLink<GenericOutputPipe6>) => MaybePromiseLike<GenericOutputPipe7>, pipe8: (input: BreakGenericLink<GenericOutputPipe7>) => MaybePromiseLike<GenericOutputPipe8>): (input: MaybePromiseLike<GenericInput>) => Promise<Awaited<GenericOutputPipe8>>;
|
|
13
|
+
export declare function asyncInnerPipe<GenericInput extends AnyValue, GenericOutputPipe1 extends AnyValue | EscapeVoid, GenericOutputPipe2 extends AnyValue | EscapeVoid, GenericOutputPipe3 extends AnyValue | EscapeVoid, GenericOutputPipe4 extends AnyValue | EscapeVoid, GenericOutputPipe5 extends AnyValue | EscapeVoid, GenericOutputPipe6 extends AnyValue | EscapeVoid, GenericOutputPipe7 extends AnyValue | EscapeVoid, GenericOutputPipe8 extends AnyValue | EscapeVoid, GenericOutputPipe9 extends AnyValue | EscapeVoid>(pipe1: (input: BreakGenericLink<GenericInput>) => MaybePromiseLike<GenericOutputPipe1>, pipe2: (input: BreakGenericLink<GenericOutputPipe1>) => MaybePromiseLike<GenericOutputPipe2>, pipe3: (input: BreakGenericLink<GenericOutputPipe2>) => MaybePromiseLike<GenericOutputPipe3>, pipe4: (input: BreakGenericLink<GenericOutputPipe3>) => MaybePromiseLike<GenericOutputPipe4>, pipe5: (input: BreakGenericLink<GenericOutputPipe4>) => MaybePromiseLike<GenericOutputPipe5>, pipe6: (input: BreakGenericLink<GenericOutputPipe5>) => MaybePromiseLike<GenericOutputPipe6>, pipe7: (input: BreakGenericLink<GenericOutputPipe6>) => MaybePromiseLike<GenericOutputPipe7>, pipe8: (input: BreakGenericLink<GenericOutputPipe7>) => MaybePromiseLike<GenericOutputPipe8>, pipe9: (input: BreakGenericLink<GenericOutputPipe8>) => MaybePromiseLike<GenericOutputPipe9>): (input: MaybePromiseLike<GenericInput>) => Promise<Awaited<GenericOutputPipe9>>;
|
|
14
|
+
export declare function asyncInnerPipe<GenericInput extends AnyValue, GenericOutputPipe1 extends AnyValue | EscapeVoid, GenericOutputPipe2 extends AnyValue | EscapeVoid, GenericOutputPipe3 extends AnyValue | EscapeVoid, GenericOutputPipe4 extends AnyValue | EscapeVoid, GenericOutputPipe5 extends AnyValue | EscapeVoid, GenericOutputPipe6 extends AnyValue | EscapeVoid, GenericOutputPipe7 extends AnyValue | EscapeVoid, GenericOutputPipe8 extends AnyValue | EscapeVoid, GenericOutputPipe9 extends AnyValue | EscapeVoid, GenericOutputPipe10 extends AnyValue | EscapeVoid>(pipe1: (input: BreakGenericLink<GenericInput>) => MaybePromiseLike<GenericOutputPipe1>, pipe2: (input: BreakGenericLink<GenericOutputPipe1>) => MaybePromiseLike<GenericOutputPipe2>, pipe3: (input: BreakGenericLink<GenericOutputPipe2>) => MaybePromiseLike<GenericOutputPipe3>, pipe4: (input: BreakGenericLink<GenericOutputPipe3>) => MaybePromiseLike<GenericOutputPipe4>, pipe5: (input: BreakGenericLink<GenericOutputPipe4>) => MaybePromiseLike<GenericOutputPipe5>, pipe6: (input: BreakGenericLink<GenericOutputPipe5>) => MaybePromiseLike<GenericOutputPipe6>, pipe7: (input: BreakGenericLink<GenericOutputPipe6>) => MaybePromiseLike<GenericOutputPipe7>, pipe8: (input: BreakGenericLink<GenericOutputPipe7>) => MaybePromiseLike<GenericOutputPipe8>, pipe9: (input: BreakGenericLink<GenericOutputPipe8>) => MaybePromiseLike<GenericOutputPipe9>, pipe10: (input: BreakGenericLink<GenericOutputPipe9>) => MaybePromiseLike<GenericOutputPipe10>): (input: MaybePromiseLike<GenericInput>) => Promise<Awaited<GenericOutputPipe10>>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
async function asyncLoop(loop) {
|
|
4
|
+
let previousOutput = undefined;
|
|
5
|
+
for (let count = 0; true; count++) {
|
|
6
|
+
const result = await loop({
|
|
7
|
+
previousOutput,
|
|
8
|
+
count,
|
|
9
|
+
next: (data) => ({ "-nextData": data }),
|
|
10
|
+
exit: (data) => ({ "-exitData": data }),
|
|
11
|
+
});
|
|
12
|
+
if ("-exitData" in result) {
|
|
13
|
+
return result["-exitData"];
|
|
14
|
+
}
|
|
15
|
+
previousOutput = result["-nextData"];
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
exports.asyncLoop = asyncLoop;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type LoopParams } from "./loop";
|
|
2
|
+
import { type AnyValue } from "./types/anyValue";
|
|
3
|
+
interface LoopOutputExistResult<GenericOutput extends any> {
|
|
4
|
+
"-exitData": GenericOutput;
|
|
5
|
+
}
|
|
6
|
+
interface LoopOutputNextResult<GenericOutput extends any> {
|
|
7
|
+
"-nextData": GenericOutput;
|
|
8
|
+
}
|
|
9
|
+
export declare function asyncLoop<GenericRawExitOutput extends AnyValue = undefined, GenericRawNextOutput extends AnyValue = undefined>(loop: (params: LoopParams<GenericRawNextOutput>) => Promise<LoopOutputNextResult<GenericRawNextOutput | undefined> | LoopOutputExistResult<GenericRawExitOutput>>): Promise<GenericRawExitOutput>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
async function asyncLoop(loop) {
|
|
2
|
+
let previousOutput = undefined;
|
|
3
|
+
for (let count = 0; true; count++) {
|
|
4
|
+
const result = await loop({
|
|
5
|
+
previousOutput,
|
|
6
|
+
count,
|
|
7
|
+
next: (data) => ({ "-nextData": data }),
|
|
8
|
+
exit: (data) => ({ "-exitData": data }),
|
|
9
|
+
});
|
|
10
|
+
if ("-exitData" in result) {
|
|
11
|
+
return result["-exitData"];
|
|
12
|
+
}
|
|
13
|
+
previousOutput = result["-nextData"];
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { asyncLoop };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type MaybeFutureEither } from "../either/future/MaybeFutureEither";
|
|
2
|
+
import { type BreakGenericLink, type EscapeVoid } from "./types";
|
|
3
|
+
import { type AnyValue } from "./types/anyValue";
|
|
4
|
+
import { type MaybePromise } from "./types/maybePromise";
|
|
5
|
+
type MaybePromiseLike<GenericValue extends unknown> = MaybePromise<GenericValue> | MaybeFutureEither<GenericValue>;
|
|
6
|
+
export declare function asyncPipe<GenericInput extends MaybePromiseLike<AnyValue>, GenericOutputPipe1 extends MaybePromiseLike<AnyValue | EscapeVoid>>(input: GenericInput, pipe1: (input: Awaited<BreakGenericLink<GenericInput>>) => GenericOutputPipe1): Promise<Awaited<GenericOutputPipe1>>;
|
|
7
|
+
export declare function asyncPipe<GenericInput extends MaybePromiseLike<AnyValue>, GenericOutputPipe1 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe2 extends MaybePromiseLike<AnyValue | EscapeVoid>>(input: GenericInput, pipe1: (input: Awaited<BreakGenericLink<GenericInput>>) => GenericOutputPipe1, pipe2: (input: Awaited<BreakGenericLink<GenericOutputPipe1>>) => GenericOutputPipe2): Promise<Awaited<GenericOutputPipe2>>;
|
|
8
|
+
export declare function asyncPipe<GenericInput extends MaybePromiseLike<AnyValue>, GenericOutputPipe1 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe2 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe3 extends MaybePromiseLike<AnyValue | EscapeVoid>>(input: GenericInput, pipe1: (input: Awaited<BreakGenericLink<GenericInput>>) => GenericOutputPipe1, pipe2: (input: Awaited<BreakGenericLink<GenericOutputPipe1>>) => GenericOutputPipe2, pipe3: (input: Awaited<BreakGenericLink<GenericOutputPipe2>>) => GenericOutputPipe3): Promise<Awaited<GenericOutputPipe3>>;
|
|
9
|
+
export declare function asyncPipe<GenericInput extends MaybePromiseLike<AnyValue>, GenericOutputPipe1 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe2 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe3 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe4 extends MaybePromiseLike<AnyValue | EscapeVoid>>(input: GenericInput, pipe1: (input: Awaited<BreakGenericLink<GenericInput>>) => GenericOutputPipe1, pipe2: (input: Awaited<BreakGenericLink<GenericOutputPipe1>>) => GenericOutputPipe2, pipe3: (input: Awaited<BreakGenericLink<GenericOutputPipe2>>) => GenericOutputPipe3, pipe4: (input: Awaited<BreakGenericLink<GenericOutputPipe3>>) => GenericOutputPipe4): Promise<Awaited<GenericOutputPipe4>>;
|
|
10
|
+
export declare function asyncPipe<GenericInput extends MaybePromiseLike<AnyValue>, GenericOutputPipe1 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe2 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe3 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe4 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe5 extends MaybePromiseLike<AnyValue | EscapeVoid>>(input: GenericInput, pipe1: (input: Awaited<BreakGenericLink<GenericInput>>) => GenericOutputPipe1, pipe2: (input: Awaited<BreakGenericLink<GenericOutputPipe1>>) => GenericOutputPipe2, pipe3: (input: Awaited<BreakGenericLink<GenericOutputPipe2>>) => GenericOutputPipe3, pipe4: (input: Awaited<BreakGenericLink<GenericOutputPipe3>>) => GenericOutputPipe4, pipe5: (input: Awaited<BreakGenericLink<GenericOutputPipe4>>) => GenericOutputPipe5): Promise<Awaited<GenericOutputPipe5>>;
|
|
11
|
+
export declare function asyncPipe<GenericInput extends MaybePromiseLike<AnyValue>, GenericOutputPipe1 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe2 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe3 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe4 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe5 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe6 extends MaybePromiseLike<AnyValue | EscapeVoid>>(input: GenericInput, pipe1: (input: Awaited<BreakGenericLink<GenericInput>>) => GenericOutputPipe1, pipe2: (input: Awaited<BreakGenericLink<GenericOutputPipe1>>) => GenericOutputPipe2, pipe3: (input: Awaited<BreakGenericLink<GenericOutputPipe2>>) => GenericOutputPipe3, pipe4: (input: Awaited<BreakGenericLink<GenericOutputPipe3>>) => GenericOutputPipe4, pipe5: (input: Awaited<BreakGenericLink<GenericOutputPipe4>>) => GenericOutputPipe5, pipe6: (input: Awaited<BreakGenericLink<GenericOutputPipe5>>) => GenericOutputPipe6): Promise<Awaited<GenericOutputPipe6>>;
|
|
12
|
+
export declare function asyncPipe<GenericInput extends MaybePromiseLike<AnyValue>, GenericOutputPipe1 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe2 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe3 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe4 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe5 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe6 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe7 extends MaybePromiseLike<AnyValue | EscapeVoid>>(input: GenericInput, pipe1: (input: Awaited<BreakGenericLink<GenericInput>>) => GenericOutputPipe1, pipe2: (input: Awaited<BreakGenericLink<GenericOutputPipe1>>) => GenericOutputPipe2, pipe3: (input: Awaited<BreakGenericLink<GenericOutputPipe2>>) => GenericOutputPipe3, pipe4: (input: Awaited<BreakGenericLink<GenericOutputPipe3>>) => GenericOutputPipe4, pipe5: (input: Awaited<BreakGenericLink<GenericOutputPipe4>>) => GenericOutputPipe5, pipe6: (input: Awaited<BreakGenericLink<GenericOutputPipe5>>) => GenericOutputPipe6, pipe7: (input: Awaited<BreakGenericLink<GenericOutputPipe6>>) => GenericOutputPipe7): Promise<Awaited<GenericOutputPipe7>>;
|
|
13
|
+
export declare function asyncPipe<GenericInput extends MaybePromiseLike<AnyValue>, GenericOutputPipe1 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe2 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe3 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe4 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe5 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe6 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe7 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe8 extends MaybePromiseLike<AnyValue | EscapeVoid>>(input: GenericInput, pipe1: (input: Awaited<BreakGenericLink<GenericInput>>) => GenericOutputPipe1, pipe2: (input: Awaited<BreakGenericLink<GenericOutputPipe1>>) => GenericOutputPipe2, pipe3: (input: Awaited<BreakGenericLink<GenericOutputPipe2>>) => GenericOutputPipe3, pipe4: (input: Awaited<BreakGenericLink<GenericOutputPipe3>>) => GenericOutputPipe4, pipe5: (input: Awaited<BreakGenericLink<GenericOutputPipe4>>) => GenericOutputPipe5, pipe6: (input: Awaited<BreakGenericLink<GenericOutputPipe5>>) => GenericOutputPipe6, pipe7: (input: Awaited<BreakGenericLink<GenericOutputPipe6>>) => GenericOutputPipe7, pipe8: (input: Awaited<BreakGenericLink<GenericOutputPipe7>>) => GenericOutputPipe8): Promise<Awaited<GenericOutputPipe8>>;
|
|
14
|
+
export declare function asyncPipe<GenericInput extends MaybePromiseLike<AnyValue>, GenericOutputPipe1 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe2 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe3 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe4 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe5 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe6 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe7 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe8 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe9 extends MaybePromiseLike<AnyValue | EscapeVoid>>(input: GenericInput, pipe1: (input: Awaited<BreakGenericLink<GenericInput>>) => GenericOutputPipe1, pipe2: (input: Awaited<BreakGenericLink<GenericOutputPipe1>>) => GenericOutputPipe2, pipe3: (input: Awaited<BreakGenericLink<GenericOutputPipe2>>) => GenericOutputPipe3, pipe4: (input: Awaited<BreakGenericLink<GenericOutputPipe3>>) => GenericOutputPipe4, pipe5: (input: Awaited<BreakGenericLink<GenericOutputPipe4>>) => GenericOutputPipe5, pipe6: (input: Awaited<BreakGenericLink<GenericOutputPipe5>>) => GenericOutputPipe6, pipe7: (input: Awaited<BreakGenericLink<GenericOutputPipe6>>) => GenericOutputPipe7, pipe8: (input: Awaited<BreakGenericLink<GenericOutputPipe7>>) => GenericOutputPipe8, pipe9: (input: Awaited<BreakGenericLink<GenericOutputPipe8>>) => GenericOutputPipe9): Promise<Awaited<GenericOutputPipe9>>;
|
|
15
|
+
export declare function asyncPipe<GenericInput extends MaybePromiseLike<AnyValue>, GenericOutputPipe1 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe2 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe3 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe4 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe5 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe6 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe7 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe8 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe9 extends MaybePromiseLike<AnyValue | EscapeVoid>, GenericOutputPipe10 extends MaybePromiseLike<AnyValue | EscapeVoid>>(input: GenericInput, pipe1: (input: Awaited<BreakGenericLink<GenericInput>>) => GenericOutputPipe1, pipe2: (input: Awaited<BreakGenericLink<GenericOutputPipe1>>) => GenericOutputPipe2, pipe3: (input: Awaited<BreakGenericLink<GenericOutputPipe2>>) => GenericOutputPipe3, pipe4: (input: Awaited<BreakGenericLink<GenericOutputPipe3>>) => GenericOutputPipe4, pipe5: (input: Awaited<BreakGenericLink<GenericOutputPipe4>>) => GenericOutputPipe5, pipe6: (input: Awaited<BreakGenericLink<GenericOutputPipe5>>) => GenericOutputPipe6, pipe7: (input: Awaited<BreakGenericLink<GenericOutputPipe6>>) => GenericOutputPipe7, pipe8: (input: Awaited<BreakGenericLink<GenericOutputPipe7>>) => GenericOutputPipe8, pipe9: (input: Awaited<BreakGenericLink<GenericOutputPipe8>>) => GenericOutputPipe9, pipe10: (input: Awaited<BreakGenericLink<GenericOutputPipe9>>) => GenericOutputPipe10): Promise<Awaited<GenericOutputPipe10>>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var sleep = require('./sleep.cjs');
|
|
4
|
+
|
|
5
|
+
async function useAsyncRetry(retryFunction, shouldRetry, options) {
|
|
6
|
+
for (let currentTry = 1; true; currentTry++) {
|
|
7
|
+
const result = await retryFunction();
|
|
8
|
+
if (currentTry >= options.maxRetry
|
|
9
|
+
|| !shouldRetry(result)) {
|
|
10
|
+
return result;
|
|
11
|
+
}
|
|
12
|
+
if (options.log) {
|
|
13
|
+
console.log(`useAsyncRetry: attempt ${currentTry} failed, starting new attempt.`);
|
|
14
|
+
}
|
|
15
|
+
if (options.timeToSleep) {
|
|
16
|
+
await sleep.sleep(options.timeToSleep);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function createAsyncRetry(retryFunction, checkFunction, options) {
|
|
21
|
+
return ((...args) => useAsyncRetry(() => retryFunction(...args), checkFunction, options));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
exports.createAsyncRetry = createAsyncRetry;
|
|
25
|
+
exports.useAsyncRetry = useAsyncRetry;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface CreateAsyncRetryOptions {
|
|
2
|
+
maxRetry: number;
|
|
3
|
+
timeToSleep?: number;
|
|
4
|
+
log?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function useAsyncRetry<GenericOutput extends unknown>(retryFunction: () => Promise<GenericOutput>, shouldRetry: (result: GenericOutput) => boolean, options: CreateAsyncRetryOptions): Promise<GenericOutput>;
|
|
7
|
+
export declare function createAsyncRetry<GenericAnyFunction extends ((...args: any[]) => Promise<any>)>(retryFunction: GenericAnyFunction, checkFunction: (result: Awaited<ReturnType<GenericAnyFunction>>) => boolean, options: CreateAsyncRetryOptions): GenericAnyFunction;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { sleep } from './sleep.mjs';
|
|
2
|
+
|
|
3
|
+
async function useAsyncRetry(retryFunction, shouldRetry, options) {
|
|
4
|
+
for (let currentTry = 1; true; currentTry++) {
|
|
5
|
+
const result = await retryFunction();
|
|
6
|
+
if (currentTry >= options.maxRetry
|
|
7
|
+
|| !shouldRetry(result)) {
|
|
8
|
+
return result;
|
|
9
|
+
}
|
|
10
|
+
if (options.log) {
|
|
11
|
+
console.log(`useAsyncRetry: attempt ${currentTry} failed, starting new attempt.`);
|
|
12
|
+
}
|
|
13
|
+
if (options.timeToSleep) {
|
|
14
|
+
await sleep(options.timeToSleep);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function createAsyncRetry(retryFunction, checkFunction, options) {
|
|
19
|
+
return ((...args) => useAsyncRetry(() => retryFunction(...args), checkFunction, options));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { createAsyncRetry, useAsyncRetry };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var entries = require('../object/entries.cjs');
|
|
4
|
+
|
|
5
|
+
function clone(unknownValue) {
|
|
6
|
+
if (!unknownValue) {
|
|
7
|
+
return unknownValue;
|
|
8
|
+
}
|
|
9
|
+
else if (typeof unknownValue !== "object") {
|
|
10
|
+
return unknownValue;
|
|
11
|
+
}
|
|
12
|
+
else if (unknownValue instanceof Array) {
|
|
13
|
+
return unknownValue.map(clone);
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
return entries.entries(unknownValue)
|
|
17
|
+
.reduce((pv, [key, value]) => {
|
|
18
|
+
pv[key] = clone(value);
|
|
19
|
+
return pv;
|
|
20
|
+
}, {});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
exports.clone = clone;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type SimplifyTypeForce } from "
|
|
1
|
+
import { type SimplifyTypeForce } from "../common/types/simplifyTypeForce";
|
|
2
2
|
export declare function clone<T extends unknown = unknown>(unknownValue: T): SimplifyTypeForce<T>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { entries } from '../object/entries.mjs';
|
|
2
|
+
|
|
3
|
+
function clone(unknownValue) {
|
|
4
|
+
if (!unknownValue) {
|
|
5
|
+
return unknownValue;
|
|
6
|
+
}
|
|
7
|
+
else if (typeof unknownValue !== "object") {
|
|
8
|
+
return unknownValue;
|
|
9
|
+
}
|
|
10
|
+
else if (unknownValue instanceof Array) {
|
|
11
|
+
return unknownValue.map(clone);
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
return entries(unknownValue)
|
|
15
|
+
.reduce((pv, [key, value]) => {
|
|
16
|
+
pv[key] = clone(value);
|
|
17
|
+
return pv;
|
|
18
|
+
}, {});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { clone };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type SimplifyTopLevel } from "./types/simplifyTopLevel";
|
|
2
|
+
export type Enum<GenericValues extends [string, ...string[]] = [string, ...string[]]> = SimplifyTopLevel<{
|
|
3
|
+
[Prop in GenericValues[number]]: Prop;
|
|
4
|
+
} & {
|
|
5
|
+
toTuple(): GenericValues;
|
|
6
|
+
has(value: string): value is GenericValues[number];
|
|
7
|
+
}>;
|
|
8
|
+
export declare function createEnum<GenericValue extends string, GenericValues extends [GenericValue, ...GenericValue[]]>(values: GenericValues): Enum<GenericValues>;
|
|
9
|
+
export type GetEnumValue<GenericEnum extends Enum<any>> = ReturnType<GenericEnum["toTuple"]>[number];
|