rubico 2.7.4 → 2.7.6
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/LICENSE +1 -1
- package/README.md +16 -16
- package/dist/Transducer.es.js +1 -1
- package/dist/Transducer.es.min.js +1 -1
- package/dist/Transducer.js +1 -1
- package/dist/Transducer.min.js +1 -1
- package/dist/Transducer.mjs +1 -1
- package/dist/__.es.js +1 -1
- package/dist/__.es.min.js +1 -1
- package/dist/__.js +1 -1
- package/dist/__.min.js +1 -1
- package/dist/__.mjs +1 -1
- package/dist/all.es.js +1 -1
- package/dist/all.es.min.js +1 -1
- package/dist/all.js +1 -1
- package/dist/all.min.js +1 -1
- package/dist/all.mjs +1 -1
- package/dist/always.es.js +1 -1
- package/dist/always.es.min.js +1 -1
- package/dist/always.js +1 -1
- package/dist/always.min.js +1 -1
- package/dist/always.mjs +1 -1
- package/dist/and.es.js +1 -1
- package/dist/and.es.min.js +1 -1
- package/dist/and.js +1 -1
- package/dist/and.min.js +1 -1
- package/dist/and.mjs +1 -1
- package/dist/assign.es.js +1 -1
- package/dist/assign.es.min.js +1 -1
- package/dist/assign.js +1 -1
- package/dist/assign.min.js +1 -1
- package/dist/assign.mjs +1 -1
- package/dist/compose.es.js +1 -1
- package/dist/compose.es.min.js +1 -1
- package/dist/compose.js +1 -1
- package/dist/compose.min.js +1 -1
- package/dist/compose.mjs +1 -1
- package/dist/curry.es.js +1 -1
- package/dist/curry.es.min.js +1 -1
- package/dist/curry.js +1 -1
- package/dist/curry.min.js +1 -1
- package/dist/curry.mjs +1 -1
- package/dist/eq.es.js +1 -1
- package/dist/eq.es.min.js +1 -1
- package/dist/eq.js +1 -1
- package/dist/eq.min.js +1 -1
- package/dist/eq.mjs +1 -1
- package/dist/every.es.js +1 -1
- package/dist/every.es.min.js +1 -1
- package/dist/every.js +1 -1
- package/dist/every.min.js +1 -1
- package/dist/every.mjs +1 -1
- package/dist/filter.es.js +1 -1
- package/dist/filter.es.min.js +1 -1
- package/dist/filter.js +1 -1
- package/dist/filter.min.js +1 -1
- package/dist/filter.mjs +1 -1
- package/dist/flatMap.es.js +1 -1
- package/dist/flatMap.es.min.js +1 -1
- package/dist/flatMap.js +1 -1
- package/dist/flatMap.min.js +1 -1
- package/dist/flatMap.mjs +1 -1
- package/dist/forEach.es.js +1 -1
- package/dist/forEach.es.min.js +1 -1
- package/dist/forEach.js +1 -1
- package/dist/forEach.min.js +1 -1
- package/dist/forEach.mjs +1 -1
- package/dist/get.es.js +1 -1
- package/dist/get.es.min.js +1 -1
- package/dist/get.js +1 -1
- package/dist/get.min.js +1 -1
- package/dist/get.mjs +1 -1
- package/dist/gt.es.js +1 -1
- package/dist/gt.es.min.js +1 -1
- package/dist/gt.js +1 -1
- package/dist/gt.min.js +1 -1
- package/dist/gt.mjs +1 -1
- package/dist/gte.es.js +1 -1
- package/dist/gte.es.min.js +1 -1
- package/dist/gte.js +1 -1
- package/dist/gte.min.js +1 -1
- package/dist/gte.mjs +1 -1
- package/dist/lt.es.js +1 -1
- package/dist/lt.es.min.js +1 -1
- package/dist/lt.js +1 -1
- package/dist/lt.min.js +1 -1
- package/dist/lt.mjs +1 -1
- package/dist/lte.es.js +1 -1
- package/dist/lte.es.min.js +1 -1
- package/dist/lte.js +1 -1
- package/dist/lte.min.js +1 -1
- package/dist/lte.mjs +1 -1
- package/dist/map.es.js +1 -1
- package/dist/map.es.min.js +1 -1
- package/dist/map.js +1 -1
- package/dist/map.min.js +1 -1
- package/dist/map.mjs +1 -1
- package/dist/not.es.js +1 -1
- package/dist/not.es.min.js +1 -1
- package/dist/not.js +1 -1
- package/dist/not.min.js +1 -1
- package/dist/not.mjs +1 -1
- package/dist/omit.es.js +1 -1
- package/dist/omit.es.min.js +1 -1
- package/dist/omit.js +1 -1
- package/dist/omit.min.js +1 -1
- package/dist/omit.mjs +1 -1
- package/dist/or.es.js +1 -1
- package/dist/or.es.min.js +1 -1
- package/dist/or.js +1 -1
- package/dist/or.min.js +1 -1
- package/dist/or.mjs +1 -1
- package/dist/pick.es.js +1 -1
- package/dist/pick.es.min.js +1 -1
- package/dist/pick.js +1 -1
- package/dist/pick.min.js +1 -1
- package/dist/pick.mjs +1 -1
- package/dist/pipe.es.js +1 -1
- package/dist/pipe.es.min.js +1 -1
- package/dist/pipe.js +1 -1
- package/dist/pipe.min.js +1 -1
- package/dist/pipe.mjs +1 -1
- package/dist/reduce.es.js +1 -1
- package/dist/reduce.es.min.js +1 -1
- package/dist/reduce.js +1 -1
- package/dist/reduce.min.js +1 -1
- package/dist/reduce.mjs +1 -1
- package/dist/rubico.es.js +1 -1
- package/dist/rubico.es.min.js +1 -1
- package/dist/rubico.global.js +1 -1
- package/dist/rubico.global.min.js +1 -1
- package/dist/rubico.js +1 -1
- package/dist/rubico.min.js +1 -1
- package/dist/rubico.mjs +1 -1
- package/dist/set.es.js +1 -1
- package/dist/set.es.min.js +1 -1
- package/dist/set.js +1 -1
- package/dist/set.min.js +1 -1
- package/dist/set.mjs +1 -1
- package/dist/some.es.js +1 -1
- package/dist/some.es.min.js +1 -1
- package/dist/some.js +1 -1
- package/dist/some.min.js +1 -1
- package/dist/some.mjs +1 -1
- package/dist/switchCase.es.js +1 -1
- package/dist/switchCase.es.min.js +1 -1
- package/dist/switchCase.js +1 -1
- package/dist/switchCase.min.js +1 -1
- package/dist/switchCase.mjs +1 -1
- package/dist/tap.es.js +1 -1
- package/dist/tap.es.min.js +1 -1
- package/dist/tap.js +1 -1
- package/dist/tap.min.js +1 -1
- package/dist/tap.mjs +1 -1
- package/dist/thunkify.es.js +1 -1
- package/dist/thunkify.es.min.js +1 -1
- package/dist/thunkify.js +1 -1
- package/dist/thunkify.min.js +1 -1
- package/dist/thunkify.mjs +1 -1
- package/dist/transform.es.js +1 -1
- package/dist/transform.es.min.js +1 -1
- package/dist/transform.js +1 -1
- package/dist/transform.min.js +1 -1
- package/dist/transform.mjs +1 -1
- package/dist/tryCatch.es.js +1 -1
- package/dist/tryCatch.es.min.js +1 -1
- package/dist/tryCatch.js +1 -1
- package/dist/tryCatch.min.js +1 -1
- package/dist/tryCatch.mjs +1 -1
- package/dist/x/append.es.js +1 -1
- package/dist/x/append.es.min.js +1 -1
- package/dist/x/append.js +1 -1
- package/dist/x/append.min.js +1 -1
- package/dist/x/append.mjs +1 -1
- package/dist/x/callProp.es.js +1 -1
- package/dist/x/callProp.es.min.js +1 -1
- package/dist/x/callProp.js +1 -1
- package/dist/x/callProp.min.js +1 -1
- package/dist/x/callProp.mjs +1 -1
- package/dist/x/defaultsDeep.es.js +1 -1
- package/dist/x/defaultsDeep.es.min.js +1 -1
- package/dist/x/defaultsDeep.js +1 -1
- package/dist/x/defaultsDeep.min.js +1 -1
- package/dist/x/defaultsDeep.mjs +1 -1
- package/dist/x/differenceWith.es.js +1 -1
- package/dist/x/differenceWith.es.min.js +1 -1
- package/dist/x/differenceWith.js +1 -1
- package/dist/x/differenceWith.min.js +1 -1
- package/dist/x/differenceWith.mjs +1 -1
- package/dist/x/filterOut.es.js +1 -1
- package/dist/x/filterOut.es.min.js +1 -1
- package/dist/x/filterOut.js +1 -1
- package/dist/x/filterOut.min.js +1 -1
- package/dist/x/filterOut.mjs +1 -1
- package/dist/x/find.es.js +1 -1
- package/dist/x/find.es.min.js +1 -1
- package/dist/x/find.js +1 -1
- package/dist/x/find.min.js +1 -1
- package/dist/x/find.mjs +1 -1
- package/dist/x/findIndex.es.js +1 -1
- package/dist/x/findIndex.es.min.js +1 -1
- package/dist/x/findIndex.js +1 -1
- package/dist/x/findIndex.min.js +1 -1
- package/dist/x/findIndex.mjs +1 -1
- package/dist/x/first.es.js +1 -1
- package/dist/x/first.es.min.js +1 -1
- package/dist/x/first.js +1 -1
- package/dist/x/first.min.js +1 -1
- package/dist/x/first.mjs +1 -1
- package/dist/x/flatten.es.js +1 -1
- package/dist/x/flatten.es.min.js +1 -1
- package/dist/x/flatten.js +1 -1
- package/dist/x/flatten.min.js +1 -1
- package/dist/x/flatten.mjs +1 -1
- package/dist/x/groupBy.es.js +1 -1
- package/dist/x/groupBy.es.min.js +1 -1
- package/dist/x/groupBy.js +1 -1
- package/dist/x/groupBy.min.js +1 -1
- package/dist/x/groupBy.mjs +1 -1
- package/dist/x/has.es.js +1 -1
- package/dist/x/has.es.min.js +1 -1
- package/dist/x/has.js +1 -1
- package/dist/x/has.min.js +1 -1
- package/dist/x/has.mjs +1 -1
- package/dist/x/identity.es.js +1 -1
- package/dist/x/identity.es.min.js +1 -1
- package/dist/x/identity.js +1 -1
- package/dist/x/identity.min.js +1 -1
- package/dist/x/identity.mjs +1 -1
- package/dist/x/includes.es.js +1 -1
- package/dist/x/includes.es.min.js +1 -1
- package/dist/x/includes.js +1 -1
- package/dist/x/includes.min.js +1 -1
- package/dist/x/includes.mjs +1 -1
- package/dist/x/isDeepEqual.es.js +1 -1
- package/dist/x/isDeepEqual.es.min.js +1 -1
- package/dist/x/isDeepEqual.js +1 -1
- package/dist/x/isDeepEqual.min.js +1 -1
- package/dist/x/isDeepEqual.mjs +1 -1
- package/dist/x/isEmpty.es.js +1 -1
- package/dist/x/isEmpty.es.min.js +1 -1
- package/dist/x/isEmpty.js +1 -1
- package/dist/x/isEmpty.min.js +1 -1
- package/dist/x/isEmpty.mjs +1 -1
- package/dist/x/isEqual.es.js +1 -1
- package/dist/x/isEqual.es.min.js +1 -1
- package/dist/x/isEqual.js +1 -1
- package/dist/x/isEqual.min.js +1 -1
- package/dist/x/isEqual.mjs +1 -1
- package/dist/x/isFunction.es.js +1 -1
- package/dist/x/isFunction.es.min.js +1 -1
- package/dist/x/isFunction.js +1 -1
- package/dist/x/isFunction.min.js +1 -1
- package/dist/x/isFunction.mjs +1 -1
- package/dist/x/isIn.es.js +1 -1
- package/dist/x/isIn.es.min.js +1 -1
- package/dist/x/isIn.js +1 -1
- package/dist/x/isIn.min.js +1 -1
- package/dist/x/isIn.mjs +1 -1
- package/dist/x/isObject.es.js +1 -1
- package/dist/x/isObject.es.min.js +1 -1
- package/dist/x/isObject.js +1 -1
- package/dist/x/isObject.min.js +1 -1
- package/dist/x/isObject.mjs +1 -1
- package/dist/x/isString.es.js +1 -1
- package/dist/x/isString.es.min.js +1 -1
- package/dist/x/isString.js +1 -1
- package/dist/x/isString.min.js +1 -1
- package/dist/x/isString.mjs +1 -1
- package/dist/x/keys.es.js +1 -1
- package/dist/x/keys.es.min.js +1 -1
- package/dist/x/keys.js +1 -1
- package/dist/x/keys.min.js +1 -1
- package/dist/x/keys.mjs +1 -1
- package/dist/x/last.es.js +1 -1
- package/dist/x/last.es.min.js +1 -1
- package/dist/x/last.js +1 -1
- package/dist/x/last.min.js +1 -1
- package/dist/x/last.mjs +1 -1
- package/dist/x/maxBy.es.js +1 -1
- package/dist/x/maxBy.es.min.js +1 -1
- package/dist/x/maxBy.js +1 -1
- package/dist/x/maxBy.min.js +1 -1
- package/dist/x/maxBy.mjs +1 -1
- package/dist/x/noop.es.js +1 -1
- package/dist/x/noop.es.min.js +1 -1
- package/dist/x/noop.js +1 -1
- package/dist/x/noop.min.js +1 -1
- package/dist/x/noop.mjs +1 -1
- package/dist/x/pluck.es.js +1 -1
- package/dist/x/pluck.es.min.js +1 -1
- package/dist/x/pluck.js +1 -1
- package/dist/x/pluck.min.js +1 -1
- package/dist/x/pluck.mjs +1 -1
- package/dist/x/prepend.es.js +1 -1
- package/dist/x/prepend.es.min.js +1 -1
- package/dist/x/prepend.js +1 -1
- package/dist/x/prepend.min.js +1 -1
- package/dist/x/prepend.mjs +1 -1
- package/dist/x/size.es.js +1 -1
- package/dist/x/size.es.min.js +1 -1
- package/dist/x/size.js +1 -1
- package/dist/x/size.min.js +1 -1
- package/dist/x/size.mjs +1 -1
- package/dist/x/trace.es.js +1 -1
- package/dist/x/trace.es.min.js +1 -1
- package/dist/x/trace.js +1 -1
- package/dist/x/trace.min.js +1 -1
- package/dist/x/trace.mjs +1 -1
- package/dist/x/unionWith.es.js +1 -1
- package/dist/x/unionWith.es.min.js +1 -1
- package/dist/x/unionWith.js +1 -1
- package/dist/x/unionWith.min.js +1 -1
- package/dist/x/unionWith.mjs +1 -1
- package/dist/x/uniq.es.js +1 -1
- package/dist/x/uniq.es.min.js +1 -1
- package/dist/x/uniq.js +1 -1
- package/dist/x/uniq.min.js +1 -1
- package/dist/x/uniq.mjs +1 -1
- package/dist/x/unless.es.js +1 -1
- package/dist/x/unless.es.min.js +1 -1
- package/dist/x/unless.js +1 -1
- package/dist/x/unless.min.js +1 -1
- package/dist/x/unless.mjs +1 -1
- package/dist/x/values.es.js +1 -1
- package/dist/x/values.es.min.js +1 -1
- package/dist/x/values.js +1 -1
- package/dist/x/values.min.js +1 -1
- package/dist/x/values.mjs +1 -1
- package/dist/x/when.es.js +1 -1
- package/dist/x/when.es.min.js +1 -1
- package/dist/x/when.js +1 -1
- package/dist/x/when.min.js +1 -1
- package/dist/x/when.mjs +1 -1
- package/es.js +1 -1
- package/global.js +1 -0
- package/index.js +1 -1
- package/package.json +2 -38
- package/AggregateReducer.d.ts +0 -10
- package/Transducer.d.ts +0 -231
- package/__.d.ts +0 -2
- package/_internal/ComparisonOperator.d.ts +0 -2
- package/_internal/EmptyMap.d.ts +0 -2
- package/_internal/FilteringAsyncIterator.d.ts +0 -29
- package/_internal/FilteringIterator.d.ts +0 -25
- package/_internal/FlatMappingAsyncIterator.d.ts +0 -34
- package/_internal/FlatMappingIterator.d.ts +0 -15
- package/_internal/MappingAsyncIterator.d.ts +0 -21
- package/_internal/MappingIterator.d.ts +0 -29
- package/_internal/NextIteration.d.ts +0 -14
- package/_internal/SelfReferencingPromise.d.ts +0 -10
- package/_internal/add.d.ts +0 -11
- package/_internal/always.d.ts +0 -13
- package/_internal/areAllValuesNonfunctions.d.ts +0 -10
- package/_internal/areAnyValuesPromises.d.ts +0 -10
- package/_internal/arrayConditional.d.ts +0 -20
- package/_internal/arrayEvery.d.ts +0 -10
- package/_internal/arrayExtend.d.ts +0 -13
- package/_internal/arrayExtendMap.d.ts +0 -20
- package/_internal/arrayFilter.d.ts +0 -16
- package/_internal/arrayFilterByConditions.d.ts +0 -20
- package/_internal/arrayFind.d.ts +0 -15
- package/_internal/arrayFlatMap.d.ts +0 -20
- package/_internal/arrayFlatten.d.ts +0 -20
- package/_internal/arrayForEach.d.ts +0 -19
- package/_internal/arrayJoin.d.ts +0 -13
- package/_internal/arrayMap.d.ts +0 -16
- package/_internal/arrayMapPool.d.ts +0 -19
- package/_internal/arrayMapSeries.d.ts +0 -17
- package/_internal/arrayPush.d.ts +0 -11
- package/_internal/arrayReduce.d.ts +0 -14
- package/_internal/arraySome.d.ts +0 -13
- package/_internal/asyncIteratorEvery.d.ts +0 -16
- package/_internal/asyncIteratorFind.d.ts +0 -12
- package/_internal/asyncIteratorForEach.d.ts +0 -17
- package/_internal/asyncIteratorReduce.d.ts +0 -14
- package/_internal/asyncIteratorSome.d.ts +0 -16
- package/_internal/binaryExtend.d.ts +0 -16
- package/_internal/bufferAlloc.d.ts +0 -8
- package/_internal/callConcat.d.ts +0 -8
- package/_internal/callPropBinary.d.ts +0 -18
- package/_internal/callPropUnary.d.ts +0 -17
- package/_internal/catcherApply.d.ts +0 -17
- package/_internal/copyDeep.d.ts +0 -13
- package/_internal/curry2.d.ts +0 -21
- package/_internal/curry3.d.ts +0 -22
- package/_internal/curry4.d.ts +0 -23
- package/_internal/curry5.d.ts +0 -24
- package/_internal/curryArgs2.d.ts +0 -21
- package/_internal/curryArgs3.d.ts +0 -22
- package/_internal/curryArgs4.d.ts +0 -23
- package/_internal/curryArity.d.ts +0 -20
- package/_internal/deleteByPath.d.ts +0 -13
- package/_internal/equals.d.ts +0 -10
- package/_internal/funcApply.d.ts +0 -16
- package/_internal/funcConcat.d.ts +0 -17
- package/_internal/funcConcatSync.d.ts +0 -17
- package/_internal/functionArrayAll.d.ts +0 -10
- package/_internal/functionArrayAllSeries.d.ts +0 -10
- package/_internal/functionObjectAll.d.ts +0 -13
- package/_internal/genericReduce.d.ts +0 -26
- package/_internal/genericTransform.d.ts +0 -18
- package/_internal/getArg1.d.ts +0 -8
- package/_internal/getByPath.d.ts +0 -13
- package/_internal/globalThisHasBuffer.d.ts +0 -11
- package/_internal/greaterThan.d.ts +0 -10
- package/_internal/greaterThanOrEqual.d.ts +0 -10
- package/_internal/identity.d.ts +0 -11
- package/_internal/isArray.d.ts +0 -11
- package/_internal/isAsyncGeneratorFunction.d.ts +0 -11
- package/_internal/isBinary.d.ts +0 -11
- package/_internal/isGeneratorFunction.d.ts +0 -11
- package/_internal/isNodeReadStream.d.ts +0 -11
- package/_internal/isObject.d.ts +0 -11
- package/_internal/isPromise.d.ts +0 -11
- package/_internal/iteratorEvery.d.ts +0 -12
- package/_internal/iteratorFind.d.ts +0 -12
- package/_internal/iteratorForEach.d.ts +0 -19
- package/_internal/iteratorReduce.d.ts +0 -18
- package/_internal/iteratorSome.d.ts +0 -13
- package/_internal/leftResolverRightResolverCompare.d.ts +0 -2
- package/_internal/leftResolverRightValueCompare.d.ts +0 -2
- package/_internal/leftValueRightResolverCompare.d.ts +0 -2
- package/_internal/lessThan.d.ts +0 -10
- package/_internal/lessThanOrEqual.d.ts +0 -10
- package/_internal/mapFilter.d.ts +0 -21
- package/_internal/mapFrom.d.ts +0 -13
- package/_internal/mapMap.d.ts +0 -16
- package/_internal/mapMapEntries.d.ts +0 -13
- package/_internal/mapReduce.d.ts +0 -14
- package/_internal/mapSet.d.ts +0 -10
- package/_internal/memoizeCappedUnary.d.ts +0 -18
- package/_internal/nonfunctionsConditional.d.ts +0 -10
- package/_internal/noop.d.ts +0 -11
- package/_internal/objectAssign.d.ts +0 -15
- package/_internal/objectFilter.d.ts +0 -13
- package/_internal/objectFlatMap.d.ts +0 -26
- package/_internal/objectFlatten.d.ts +0 -21
- package/_internal/objectForEach.d.ts +0 -17
- package/_internal/objectKeys.d.ts +0 -11
- package/_internal/objectKeysLength.d.ts +0 -10
- package/_internal/objectMap.d.ts +0 -17
- package/_internal/objectMapEntries.d.ts +0 -13
- package/_internal/objectReduce.d.ts +0 -14
- package/_internal/objectSet.d.ts +0 -14
- package/_internal/objectSetIf.d.ts +0 -15
- package/_internal/objectToString.d.ts +0 -11
- package/_internal/objectValues.d.ts +0 -11
- package/_internal/placeholder.d.ts +0 -2
- package/_internal/promiseAll.d.ts +0 -11
- package/_internal/promiseObjectAll.d.ts +0 -13
- package/_internal/promiseRace.d.ts +0 -11
- package/_internal/propertyPathToArray.d.ts +0 -10
- package/_internal/reducerAllSync.d.ts +0 -10
- package/_internal/reducerAnySync.d.ts +0 -10
- package/_internal/reducerConcat.d.ts +0 -15
- package/_internal/reducerEvery.d.ts +0 -12
- package/_internal/reducerFilter.d.ts +0 -19
- package/_internal/reducerFlatMap.d.ts +0 -20
- package/_internal/reducerForEach.d.ts +0 -18
- package/_internal/reducerMap.d.ts +0 -19
- package/_internal/reducerSome.d.ts +0 -16
- package/_internal/reducerTryCatch.d.ts +0 -15
- package/_internal/sameValueZero.d.ts +0 -13
- package/_internal/setByPath.d.ts +0 -14
- package/_internal/setExtend.d.ts +0 -12
- package/_internal/setFilter.d.ts +0 -16
- package/_internal/setFlatMap.d.ts +0 -21
- package/_internal/setFlatten.d.ts +0 -19
- package/_internal/setMap.d.ts +0 -17
- package/_internal/sha256.d.ts +0 -2
- package/_internal/sleep.d.ts +0 -10
- package/_internal/spread2.d.ts +0 -14
- package/_internal/streamExtend.d.ts +0 -17
- package/_internal/stringFilter.d.ts +0 -17
- package/_internal/stringFlatMap.d.ts +0 -22
- package/_internal/stringMap.d.ts +0 -19
- package/_internal/symbolAsyncIterator.d.ts +0 -11
- package/_internal/symbolIterator.d.ts +0 -11
- package/_internal/tapSync.d.ts +0 -16
- package/_internal/thunkConditional.d.ts +0 -17
- package/_internal/thunkify1.d.ts +0 -16
- package/_internal/thunkify2.d.ts +0 -17
- package/_internal/thunkify3.d.ts +0 -18
- package/_internal/thunkify4.d.ts +0 -19
- package/_internal/thunkify5.d.ts +0 -20
- package/_internal/thunkifyArgs.d.ts +0 -13
- package/_internal/timeInLoop.d.ts +0 -25
- package/_internal/timeInLoopAsync.d.ts +0 -23
- package/all.d.ts +0 -100
- package/always.d.ts +0 -2
- package/and.d.ts +0 -45
- package/assign.d.ts +0 -46
- package/compose.d.ts +0 -25
- package/curry.d.ts +0 -70
- package/eq.d.ts +0 -51
- package/es.d.ts +0 -80
- package/every.d.ts +0 -52
- package/filter.d.ts +0 -148
- package/flatMap.d.ts +0 -109
- package/forEach.d.ts +0 -35
- package/get.d.ts +0 -70
- package/global.d.ts +0 -1
- package/gt.d.ts +0 -49
- package/gte.d.ts +0 -51
- package/index.d.ts +0 -1
- package/lt.d.ts +0 -49
- package/lte.d.ts +0 -49
- package/map.d.ts +0 -246
- package/not.d.ts +0 -34
- package/omit.d.ts +0 -50
- package/or.d.ts +0 -43
- package/pick.d.ts +0 -43
- package/pipe.d.ts +0 -49
- package/reduce.d.ts +0 -166
- package/set.d.ts +0 -61
- package/some.d.ts +0 -65
- package/switchCase.d.ts +0 -76
- package/tap.d.ts +0 -53
- package/thunkify.d.ts +0 -21
- package/transform.d.ts +0 -131
- package/tryCatch.d.ts +0 -47
package/reduce.d.ts
DELETED
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
export = reduce;
|
|
2
|
-
/**
|
|
3
|
-
* @name reduce
|
|
4
|
-
*
|
|
5
|
-
* @synopsis
|
|
6
|
-
* ```coffeescript [specscript]
|
|
7
|
-
* type Foldable = Array|Object|Map|Iterator|AsyncIterator
|
|
8
|
-
*
|
|
9
|
-
* type Reducer = (
|
|
10
|
-
* accumulator any,
|
|
11
|
-
* value any,
|
|
12
|
-
* indexOrKey? number|string,
|
|
13
|
-
* collection? Foldable,
|
|
14
|
-
* )=>(nextAccumulator Promise|any)
|
|
15
|
-
*
|
|
16
|
-
* type Resolver = (collection Foldable)=>Promise|any
|
|
17
|
-
*
|
|
18
|
-
* reduce(
|
|
19
|
-
* collection Foldable,
|
|
20
|
-
* reducer Reducer,
|
|
21
|
-
* initialValue? Resolver|any
|
|
22
|
-
* ) -> result Promise|any
|
|
23
|
-
*
|
|
24
|
-
* reduce(
|
|
25
|
-
* reducer Reducer,
|
|
26
|
-
* initialValue? Resolver|any
|
|
27
|
-
* )(collection Foldable) -> result Promise|any
|
|
28
|
-
* ```
|
|
29
|
-
*
|
|
30
|
-
* @description
|
|
31
|
-
* Transforms a collection based on a reducer function and optional initial value. In a reducing operation, the result is defined in the beginning as either the initial value if supplied or the first element of the collection. The reducing operation then iterates through the remaining elements in the collection, executing the reducer at each iteration to return the result to be used in the next iteration. The final result is the result of the execution of the reducer at the last element of the iteration. `reduce` accepts the following collections:
|
|
32
|
-
*
|
|
33
|
-
* * `Array`
|
|
34
|
-
* * `Object`
|
|
35
|
-
* * `Set`
|
|
36
|
-
* * `Map`
|
|
37
|
-
* * `Iterator`/`Generator`
|
|
38
|
-
* * `AsyncIterator`/`AsyncGenerator`
|
|
39
|
-
*
|
|
40
|
-
* For arrays (type `Array`), `reduce` executes the reducer function for each element of the array in order, returning a new result at each execution to be used in the next execution. On each iteration, the reducer is passed the accumulator, the element of the iteration, the index of the element in the array, and a reference to the original array.
|
|
41
|
-
*
|
|
42
|
-
* ```javascript [playground]
|
|
43
|
-
* const max = (a, b) => a > b ? a : b
|
|
44
|
-
*
|
|
45
|
-
* console.log(
|
|
46
|
-
* reduce([1, 3, 5, 4, 2], max)
|
|
47
|
-
* ) // 5
|
|
48
|
-
*
|
|
49
|
-
* console.log(
|
|
50
|
-
* reduce(max)([1, 3, 5, 4, 2])
|
|
51
|
-
* ) // 5
|
|
52
|
-
* ```
|
|
53
|
-
*
|
|
54
|
-
* If an optional initial value is provided, the result starts as the provided initial value rather than the first element of the collection.
|
|
55
|
-
*
|
|
56
|
-
* ```javascript [playground]
|
|
57
|
-
* const add = (a, b) => a + b
|
|
58
|
-
*
|
|
59
|
-
* console.log(reduce([1, 2, 3, 4, 5], add, 0)) // 15
|
|
60
|
-
* console.log(reduce(add, 0)([1, 2, 3, 4, 5])) // 15
|
|
61
|
-
* ```
|
|
62
|
-
*
|
|
63
|
-
* If the initialization parameter is a function, it is treated as a resolver and called with the arguments to resolve the initial value.
|
|
64
|
-
*
|
|
65
|
-
* ```javascript [playground]
|
|
66
|
-
* const concatSquares = (array, value) => array.concat(value ** 2)
|
|
67
|
-
*
|
|
68
|
-
* const contrivedInitializer = array => [`initial length ${array.length}`]
|
|
69
|
-
*
|
|
70
|
-
* const array = [1, 2, 3, 4, 5]
|
|
71
|
-
*
|
|
72
|
-
* console.log(reduce(concatSquares, contrivedInitializer)(array))
|
|
73
|
-
* // ['initial length 5', 1, 4, 9, 16, 25]
|
|
74
|
-
* console.log(reduce(array, concatSquares, contrivedInitializer))
|
|
75
|
-
* // ['initial length 5', 1, 4, 9, 16, 25]
|
|
76
|
-
* ```
|
|
77
|
-
*
|
|
78
|
-
* For objects (type `Object`), `reduce` executes the reducer function for each value of the object. On each iteration, the reducer is passed the accumulator, the object value, the key of the object value, and a reference to the original object.
|
|
79
|
-
*
|
|
80
|
-
* ```javascript [playground]
|
|
81
|
-
* const add = (a, b) => a + b
|
|
82
|
-
*
|
|
83
|
-
* const obj = { a: 1, b: 2, c: 3, d: 4, e: 5 }
|
|
84
|
-
*
|
|
85
|
-
* console.log(
|
|
86
|
-
* reduce(obj, add)
|
|
87
|
-
* ) // 15
|
|
88
|
-
*
|
|
89
|
-
* console.log(
|
|
90
|
-
* reduce(add)(obj)
|
|
91
|
-
* ) // 15
|
|
92
|
-
* ```
|
|
93
|
-
*
|
|
94
|
-
* For sets (type `Set`), `reduce` executes the reducer function for each element of the set. On each iteration, the reducer is passed the accumulator and element of the set.
|
|
95
|
-
*
|
|
96
|
-
* ```javascript [playground]
|
|
97
|
-
* const add = (a, b) => a + b
|
|
98
|
-
*
|
|
99
|
-
* const set = new Set([1, 2, 3, 4, 5])
|
|
100
|
-
*
|
|
101
|
-
* console.log(
|
|
102
|
-
* reduce(set, add)
|
|
103
|
-
* ) // 15
|
|
104
|
-
*
|
|
105
|
-
* console.log(
|
|
106
|
-
* reduce(add)(set)
|
|
107
|
-
* ) // 15
|
|
108
|
-
* ```
|
|
109
|
-
*
|
|
110
|
-
* For maps (type `Map`), `reduce` executes the reducer function for each value of each entry of the map. On each iteration, the reducer is passed the accumulator, the map element, the key of the map element, and a reference to the original map.
|
|
111
|
-
*
|
|
112
|
-
* ```javascript [playground]
|
|
113
|
-
* const add = (a, b) => a + b
|
|
114
|
-
*
|
|
115
|
-
* const m = new Map([['a', 1], ['b', 2], ['c', 3], ['d', 4], ['e', 5]])
|
|
116
|
-
*
|
|
117
|
-
* console.log(
|
|
118
|
-
* reduce(m, add)
|
|
119
|
-
* ) // 15
|
|
120
|
-
*
|
|
121
|
-
* console.log(
|
|
122
|
-
* reduce(add)(m)
|
|
123
|
-
* ) // 15
|
|
124
|
-
* ```
|
|
125
|
-
*
|
|
126
|
-
* For iterators (type `Iterator`) and generators (type `Generator`), `reduce` executes the reducer function for each value of the iterator/generator. On each iteration, the reducer is passed the accumulator and the element of the iteration. The iterator/generator is consumed in the process.
|
|
127
|
-
*
|
|
128
|
-
* ```javascript [playground]
|
|
129
|
-
* const add = (a, b) => a + b
|
|
130
|
-
*
|
|
131
|
-
* const generate12345 = function* () {
|
|
132
|
-
* yield 1; yield 2; yield 3; yield 4; yield 5
|
|
133
|
-
* }
|
|
134
|
-
*
|
|
135
|
-
* console.log(
|
|
136
|
-
* reduce(generate12345(), add)
|
|
137
|
-
* ) // 15
|
|
138
|
-
*
|
|
139
|
-
* console.log(
|
|
140
|
-
* reduce(add)(generate12345())
|
|
141
|
-
* ) // 15
|
|
142
|
-
* ```
|
|
143
|
-
*
|
|
144
|
-
* For asyncIterators (type `AsyncIterator`) and asyncGenerators (type `AsyncGenerator`), `reduce` executes the reducer function for each value of the asyncIterator/asyncGenerator. On each iteration, the reducer is passed the accumulator and the element of the async iteration. The asyncIterator/asyncGenerator is consumed in the process.
|
|
145
|
-
*
|
|
146
|
-
* ```javascript [playground]
|
|
147
|
-
* const asyncAdd = async (a, b) => a + b
|
|
148
|
-
*
|
|
149
|
-
* const asyncGenerate12345 = async function* () {
|
|
150
|
-
* yield 1; yield 2; yield 3; yield 4; yield 5
|
|
151
|
-
* }
|
|
152
|
-
*
|
|
153
|
-
* reduce(asyncGenerate12345(), asyncAdd).then(console.log) // 15
|
|
154
|
-
*
|
|
155
|
-
* reduce(asyncAdd)(asyncGenerate12345()).then(console.log) // 15
|
|
156
|
-
* ```
|
|
157
|
-
*
|
|
158
|
-
* @execution series
|
|
159
|
-
*
|
|
160
|
-
* @transducing
|
|
161
|
-
*
|
|
162
|
-
* @TODO readerReduce
|
|
163
|
-
*
|
|
164
|
-
* @TODO reduce.concurrent
|
|
165
|
-
*/
|
|
166
|
-
declare function reduce(...args: any[]): any;
|
package/set.d.ts
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
export = set;
|
|
2
|
-
/**
|
|
3
|
-
* @name set
|
|
4
|
-
*
|
|
5
|
-
* @synopsis
|
|
6
|
-
* ```coffeescript [specscript]
|
|
7
|
-
* set(
|
|
8
|
-
* object Promise|Object,
|
|
9
|
-
* path string|Array<string|number>,
|
|
10
|
-
* value function|any,
|
|
11
|
-
* ) -> result Promise|Object
|
|
12
|
-
*
|
|
13
|
-
* set(
|
|
14
|
-
* path string|Array<string|number>,
|
|
15
|
-
* value function|any,
|
|
16
|
-
* )(object Object) -> result Promise|Object
|
|
17
|
-
* ```
|
|
18
|
-
*
|
|
19
|
-
* @description
|
|
20
|
-
* Sets a property on a new object shallow cloned from the argument object given a path denoted by a string, number, or an array of string or numbers.
|
|
21
|
-
*
|
|
22
|
-
* `set` supports three types of path patterns for nested property access.
|
|
23
|
-
*
|
|
24
|
-
* * dot delimited - `'a.b.c'`
|
|
25
|
-
* * bracket notation - `'a[0].value'`
|
|
26
|
-
* * an array of keys or indices - `['a', 0, 'value']`
|
|
27
|
-
*
|
|
28
|
-
* ```javascript [playground]
|
|
29
|
-
* console.log(set({ b: 2 }, 'a', 1)) // { a: 1, b: 2 }
|
|
30
|
-
*
|
|
31
|
-
* const nestedAC2 = { a: { c: 2 } }
|
|
32
|
-
*
|
|
33
|
-
* console.log(set(nestedAC2, 'a.b', 1)) // { a : { b: 1, c: 2 }}
|
|
34
|
-
*
|
|
35
|
-
* const nestedA0BC3 = { a: [{ b: { c: 3 } }] }
|
|
36
|
-
*
|
|
37
|
-
* console.log(set(nestedA0BC3, 'a[0].b.c', 4)) // { a: [{ b: { c: 4 } }] }
|
|
38
|
-
* ```
|
|
39
|
-
*
|
|
40
|
-
* The property value may be a function, in which case it is treated as a resolver and provided the argument object to resolve the value to set.
|
|
41
|
-
*
|
|
42
|
-
* ```javascript [playground]
|
|
43
|
-
* const myObj = { a: 1 }
|
|
44
|
-
*
|
|
45
|
-
* const myNewObj = set('b', obj => obj.a + 2)(myObj)
|
|
46
|
-
*
|
|
47
|
-
* console.log(myNewObj) // { a: 1, b: 3 }
|
|
48
|
-
* ```
|
|
49
|
-
*
|
|
50
|
-
* `set` supports a lazy API for composability.
|
|
51
|
-
*
|
|
52
|
-
* ```javascript [playground]
|
|
53
|
-
* pipe({ a: 1 }, [
|
|
54
|
-
* set('b', 2),
|
|
55
|
-
* console.log, // { a: 1, b: 2 }
|
|
56
|
-
* ])
|
|
57
|
-
* ```
|
|
58
|
-
*
|
|
59
|
-
* @since 1.7.0
|
|
60
|
-
*/
|
|
61
|
-
declare function set(arg0: any, arg1: any, arg2: any): any;
|
package/some.d.ts
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
export = some;
|
|
2
|
-
/**
|
|
3
|
-
* @name some
|
|
4
|
-
*
|
|
5
|
-
* @synopsis
|
|
6
|
-
* ```coffeescript [specscript]
|
|
7
|
-
* type Foldable = Array|Iterable|AsyncIterable|{ reduce: function }|Object
|
|
8
|
-
*
|
|
9
|
-
* some(collection Foldable, predicate function) -> Promise|boolean
|
|
10
|
-
*
|
|
11
|
-
* some(predicate function)(collection Foldable) -> Promise|boolean
|
|
12
|
-
* ```
|
|
13
|
-
*
|
|
14
|
-
* @description
|
|
15
|
-
* Test a predicate concurrently across all elements of a collection, returning true if any executions return truthy.
|
|
16
|
-
*
|
|
17
|
-
* ```javascript [playground]
|
|
18
|
-
* const isOdd = number => number % 2 == 1
|
|
19
|
-
*
|
|
20
|
-
* console.log(
|
|
21
|
-
* some([1, 2, 3, 4, 5], isOdd),
|
|
22
|
-
* ) // true
|
|
23
|
-
* ```
|
|
24
|
-
*
|
|
25
|
-
* The collection can be any iterable, async iterable, or object values iterable collection. Below is an example of `some` accepting an async generator as the collection.
|
|
26
|
-
*
|
|
27
|
-
* ```javascript [playground]
|
|
28
|
-
* const toTodosUrl = id => 'https://jsonplaceholder.typicode.com/todos/' + id
|
|
29
|
-
*
|
|
30
|
-
* const fetchedToJson = fetched => fetched.json()
|
|
31
|
-
*
|
|
32
|
-
* const fetchTodo = pipe([
|
|
33
|
-
* toTodosUrl,
|
|
34
|
-
* fetch,
|
|
35
|
-
* fetchedToJson,
|
|
36
|
-
* ])
|
|
37
|
-
*
|
|
38
|
-
* const todoIDsGenerator = async function* () {
|
|
39
|
-
* yield 1; yield 2; yield 3; yield 4; yield 5
|
|
40
|
-
* }
|
|
41
|
-
*
|
|
42
|
-
* const promise = some(todoIDsGenerator(), async id => {
|
|
43
|
-
* const todo = await fetchTodo(id)
|
|
44
|
-
* return todo.title.startsWith('fugiat')
|
|
45
|
-
* })
|
|
46
|
-
*
|
|
47
|
-
* promise.then(console.log) // true
|
|
48
|
-
* ```
|
|
49
|
-
*
|
|
50
|
-
* `some` supports a lazy API for composability.
|
|
51
|
-
*
|
|
52
|
-
* ```javascript [playground]
|
|
53
|
-
* pipe([1, 2, 3], [
|
|
54
|
-
* some(number => number < 5),
|
|
55
|
-
* console.log, // true
|
|
56
|
-
* ])
|
|
57
|
-
* ```
|
|
58
|
-
*
|
|
59
|
-
* @execution concurrent
|
|
60
|
-
*
|
|
61
|
-
* @muxing
|
|
62
|
-
*
|
|
63
|
-
* @related or
|
|
64
|
-
*/
|
|
65
|
-
declare function some(...args: any[]): any;
|
package/switchCase.d.ts
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
export = switchCase;
|
|
2
|
-
/**
|
|
3
|
-
* @name switchCase
|
|
4
|
-
*
|
|
5
|
-
* @synopsis
|
|
6
|
-
* ```coffeescript [specscript]
|
|
7
|
-
* switchCase(conditionalValues Array<boolean|any>) -> Promise|any
|
|
8
|
-
*
|
|
9
|
-
* switchCase(
|
|
10
|
-
* ...args,
|
|
11
|
-
* conditionalFuncsOrValues Array<function|boolean|any>
|
|
12
|
-
* ) -> Promise|any
|
|
13
|
-
*
|
|
14
|
-
* switchCase(
|
|
15
|
-
* conditionalFuncsOrValues Array<function|boolean|any>
|
|
16
|
-
* )(...args) -> Promise|any
|
|
17
|
-
* ```
|
|
18
|
-
*
|
|
19
|
-
* @description
|
|
20
|
-
* Functional equivalent to the [Conditional (ternary) operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator). Accepts an array of conditional functions that specifies cases as pairings of `predicate` and `resolver` functions with the exception of the last, default resolver. All functions are provided with the same arguments and executed in series. The result of a `switchCase` operation is either the result of the execution the last default resolver, or the result of the execution of the first resolver where the associated predicate tested true.
|
|
21
|
-
*
|
|
22
|
-
* ```javascript [playground]
|
|
23
|
-
* const fruitIsYellow = fruit => fruit.color == 'yellow'
|
|
24
|
-
*
|
|
25
|
-
* console.log(
|
|
26
|
-
* switchCase({ name: 'plantain', color: 'yellow' }, [
|
|
27
|
-
* fruitIsYellow,
|
|
28
|
-
* fruit => fruit.name + ' is possibly a banana',
|
|
29
|
-
* fruit => fruit.name + ' is probably not a banana',
|
|
30
|
-
* ])
|
|
31
|
-
* ) // plantain is possibly a banana
|
|
32
|
-
* ```
|
|
33
|
-
*
|
|
34
|
-
* For composability `switchCase` supports a lazy API.
|
|
35
|
-
*
|
|
36
|
-
* ```javascript [playground]
|
|
37
|
-
* const fruitIsYellow = fruit => fruit.color == 'yellow'
|
|
38
|
-
*
|
|
39
|
-
* const fruitsGuesser = switchCase([
|
|
40
|
-
* fruitIsYellow,
|
|
41
|
-
* fruit => fruit.name + ' is possibly a banana',
|
|
42
|
-
* fruit => fruit.name + ' is probably not a banana',
|
|
43
|
-
* ])
|
|
44
|
-
*
|
|
45
|
-
* console.log(fruitsGuesser({ name: 'plantain', color: 'yellow' }))
|
|
46
|
-
* // plantain is possibly a banana
|
|
47
|
-
*
|
|
48
|
-
* console.log(fruitsGuesser({ name: 'apple', color: 'red' }))
|
|
49
|
-
* // apple is probably not a banana
|
|
50
|
-
* ```
|
|
51
|
-
*
|
|
52
|
-
* Any function can be replaced with a nonfunction (object or primitive) value to be used directly in the operation.
|
|
53
|
-
*
|
|
54
|
-
* ```javascript [playground]
|
|
55
|
-
* switchCase([
|
|
56
|
-
* async function asyncIdentity(value) {
|
|
57
|
-
* return value
|
|
58
|
-
* },
|
|
59
|
-
* 'something',
|
|
60
|
-
* 'default',
|
|
61
|
-
* ])(false).then(console.log) // default
|
|
62
|
-
* ```
|
|
63
|
-
*
|
|
64
|
-
* If every element in the conditional array is a nonfunction value, `switchCase` executes eagerly.
|
|
65
|
-
*
|
|
66
|
-
* ```javascript [playground]
|
|
67
|
-
* const age = 26
|
|
68
|
-
*
|
|
69
|
-
* const myDrink = switchCase([age >= 21, 'Beer', 'Juice'])
|
|
70
|
-
*
|
|
71
|
-
* console.log(myDrink) // Beer
|
|
72
|
-
* ```
|
|
73
|
-
*
|
|
74
|
-
* @execution series
|
|
75
|
-
*/
|
|
76
|
-
declare function switchCase(...args: any[]): any;
|
package/tap.d.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
export = tap;
|
|
2
|
-
/**
|
|
3
|
-
* @name tap
|
|
4
|
-
*
|
|
5
|
-
* @synopsis
|
|
6
|
-
* ```coffeescript [specscript]
|
|
7
|
-
* tap(...args, func function) -> Promise|args[0]
|
|
8
|
-
* tap(func function)(...args) -> Promise|args[0]
|
|
9
|
-
* ```
|
|
10
|
-
*
|
|
11
|
-
* @description
|
|
12
|
-
* Call a function with any number of arguments, returning the first argument. Promises created by the tapper are resolved before returning the value.
|
|
13
|
-
*
|
|
14
|
-
* ```javascript [playground]
|
|
15
|
-
* const pipeline = pipe([
|
|
16
|
-
* tap(value => console.log(value)),
|
|
17
|
-
* tap(value => console.log(value + 'bar')),
|
|
18
|
-
* tap(value => console.log(value + 'barbaz')),
|
|
19
|
-
* ])
|
|
20
|
-
*
|
|
21
|
-
* pipeline('foo') // 'foo'
|
|
22
|
-
* // 'foobar'
|
|
23
|
-
* // 'foobarbaz'
|
|
24
|
-
* ```
|
|
25
|
-
*/
|
|
26
|
-
declare function tap(...args: any[]): any;
|
|
27
|
-
declare namespace tap {
|
|
28
|
-
/**
|
|
29
|
-
* @name tap.if
|
|
30
|
-
*
|
|
31
|
-
* @synopsis
|
|
32
|
-
* ```coffeescript [specscript]
|
|
33
|
-
* tap.if(predicate function, func function)(...args) -> Promise|args[0]
|
|
34
|
-
* ```
|
|
35
|
-
*
|
|
36
|
-
* @description
|
|
37
|
-
* A version of `tap` that accepts a predicate function (a function that returns a boolean value) before the function to execute. Only executes the function if the predicate function tests true for the same arguments provided to the execution function.
|
|
38
|
-
*
|
|
39
|
-
* ```javascript [playground]
|
|
40
|
-
* const isOdd = number => number % 2 == 1
|
|
41
|
-
*
|
|
42
|
-
* const logIfOdd = tap.if(
|
|
43
|
-
* isOdd,
|
|
44
|
-
* number => console.log(number, 'is an odd number')
|
|
45
|
-
* )
|
|
46
|
-
*
|
|
47
|
-
* logIfOdd(2)
|
|
48
|
-
* logIfOdd(3) // 3 is an odd number
|
|
49
|
-
* ```
|
|
50
|
-
*/
|
|
51
|
-
function _if(predicate: any, func: any): (...args: any[]) => any;
|
|
52
|
-
export { _if as if };
|
|
53
|
-
}
|
package/thunkify.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export = thunkify;
|
|
2
|
-
/**
|
|
3
|
-
* @name thunkify
|
|
4
|
-
*
|
|
5
|
-
* @synopsis
|
|
6
|
-
* ```coffeescript [specscript]
|
|
7
|
-
* thunkify(func function, ...args) -> thunk ()=>func(...args)
|
|
8
|
-
* ```
|
|
9
|
-
*
|
|
10
|
-
* @description
|
|
11
|
-
* Create a thunk function from another function and any number of arguments. The thunk function takes no arguments, and when called, executes the other function with the provided arguments. The other function is said to be "thunkified".
|
|
12
|
-
*
|
|
13
|
-
* ```javascript [playground]
|
|
14
|
-
* const add = (a, b) => a + b
|
|
15
|
-
*
|
|
16
|
-
* const thunkAdd12 = thunkify(add, 1, 2)
|
|
17
|
-
*
|
|
18
|
-
* console.log(thunkAdd12()) // 3
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
declare function thunkify(func: any, ...args: any[]): () => any;
|
package/transform.d.ts
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
export = transform;
|
|
2
|
-
/**
|
|
3
|
-
* @name transform
|
|
4
|
-
*
|
|
5
|
-
* @synopsis
|
|
6
|
-
* ```coffeescript [specscript]
|
|
7
|
-
* type Foldable = Iterable|AsyncIterable|Object<value any>
|
|
8
|
-
*
|
|
9
|
-
* type Reducer = (
|
|
10
|
-
* accumulator any,
|
|
11
|
-
* value any,
|
|
12
|
-
* indexOrKey? number|string,
|
|
13
|
-
* collection? Foldable,
|
|
14
|
-
* )=>(nextAccumulator Promise|any)
|
|
15
|
-
*
|
|
16
|
-
* type Transducer = Reducer=>Reducer
|
|
17
|
-
*
|
|
18
|
-
* type Transformable =
|
|
19
|
-
* Array|String|Set|TypedArray|{ concat: function }|{ write: function }|Object
|
|
20
|
-
*
|
|
21
|
-
* type TransformableResolver = (collection Foldable)=>Promise|Transformable
|
|
22
|
-
*
|
|
23
|
-
* transform(
|
|
24
|
-
* collection Foldable,
|
|
25
|
-
* transducer Transducer,
|
|
26
|
-
* initialValue? Transformable|TransformableResolver,
|
|
27
|
-
* ) -> result Promise|Transformable
|
|
28
|
-
*
|
|
29
|
-
* transform(
|
|
30
|
-
* transducer Transducer,
|
|
31
|
-
* initialValue? Transformable|TransformableResolver,
|
|
32
|
-
* )(collection Foldable) -> result Promise|Transformable
|
|
33
|
-
* ```
|
|
34
|
-
*
|
|
35
|
-
* @description
|
|
36
|
-
* Transforms a transformable collection into any other transformable collection. The type of transformation depends on the collection provided by the initial value. If the initial is a function it is used as a resolver for the provided collection. `transform` accepts transformable collections, or collections that support a concatenation operation:
|
|
37
|
-
*
|
|
38
|
-
* * `Array`; concatenation defined by `result.concat(values)`
|
|
39
|
-
* * `string`; concatenation defined by `result + values`
|
|
40
|
-
* * `Set`; concatenation defined by `result.add(...values)`
|
|
41
|
-
* * `TypedArray`; concatenation defined by `result.set(prevResult); result.set(values, offset)`
|
|
42
|
-
* * `{ concat: function }`; concatenation defined by `result.concat(values)`
|
|
43
|
-
* * `{ write: function }`; concatenation defined by `result.write(element)`
|
|
44
|
-
* * `Object`; concatenation defined by `({ ...result, ...values })`
|
|
45
|
-
*
|
|
46
|
-
* `transform` can transform any of the above collections into any of the other above collections.
|
|
47
|
-
*
|
|
48
|
-
* ```javascript [playground]
|
|
49
|
-
* const square = number => number ** 2
|
|
50
|
-
*
|
|
51
|
-
* const isOdd = number => number % 2 == 1
|
|
52
|
-
*
|
|
53
|
-
* const squaredOdds = compose([
|
|
54
|
-
* Transducer.filter(isOdd),
|
|
55
|
-
* Transducer.map(square),
|
|
56
|
-
* ])
|
|
57
|
-
*
|
|
58
|
-
* // transform arrays into arrays
|
|
59
|
-
* console.log(
|
|
60
|
-
* transform(squaredOdds, [])([1, 2, 3, 4, 5])
|
|
61
|
-
* ) // [1, 9, 25]
|
|
62
|
-
*
|
|
63
|
-
* // transform arrays into strings
|
|
64
|
-
* console.log(
|
|
65
|
-
* transform(squaredOdds, '')([1, 2, 3, 4, 5])
|
|
66
|
-
* ) // '1925'
|
|
67
|
-
*
|
|
68
|
-
* // transform arrays into sets
|
|
69
|
-
* console.log(
|
|
70
|
-
* transform(squaredOdds, new Set())([1, 2, 3, 4, 5])
|
|
71
|
-
* ) // Set (3) { 1, 9, 25 }
|
|
72
|
-
*
|
|
73
|
-
* // transform arrays into typed arrays
|
|
74
|
-
* console.log(
|
|
75
|
-
* transform(squaredOdds, new Uint8Array())([1, 2, 3, 4, 5]),
|
|
76
|
-
* ) // Uint8Array(3) [ 1, 9, 25 ]
|
|
77
|
-
* ```
|
|
78
|
-
*
|
|
79
|
-
* `transform` arrays into objects that implement `.concat`.
|
|
80
|
-
*
|
|
81
|
-
* ```javascript [playground]
|
|
82
|
-
* const square = number => number ** 2
|
|
83
|
-
*
|
|
84
|
-
* const Stdout = {
|
|
85
|
-
* concat(...args) {
|
|
86
|
-
* console.log(...args)
|
|
87
|
-
* return this
|
|
88
|
-
* },
|
|
89
|
-
* }
|
|
90
|
-
*
|
|
91
|
-
* transform(Transducer.map(square), Stdout)([1, 2, 3, 4, 5])
|
|
92
|
-
* // 1
|
|
93
|
-
* // 4
|
|
94
|
-
* // 9
|
|
95
|
-
* // 16
|
|
96
|
-
* // 25
|
|
97
|
-
* ```
|
|
98
|
-
*
|
|
99
|
-
* `transform` an async generator into `process.stdout`, a Node.js writable stream that implements `.write`.
|
|
100
|
-
*
|
|
101
|
-
* ```javascript [node]
|
|
102
|
-
* // this example is duplicated in rubico/examples/transformStreamRandomInts.js
|
|
103
|
-
*
|
|
104
|
-
* const { pipe, map, transform } = require('rubico')
|
|
105
|
-
*
|
|
106
|
-
* const square = number => number ** 2
|
|
107
|
-
*
|
|
108
|
-
* const toString = value => value.toString()
|
|
109
|
-
*
|
|
110
|
-
* const randomInt = () => Math.ceil(Math.random() * 100)
|
|
111
|
-
*
|
|
112
|
-
* const streamRandomInts = async function* () {
|
|
113
|
-
* while (true) {
|
|
114
|
-
* yield randomInt()
|
|
115
|
-
* }
|
|
116
|
-
* }
|
|
117
|
-
*
|
|
118
|
-
* transform(
|
|
119
|
-
* streamRandomInts(),
|
|
120
|
-
* Transducer.map(pipe([square, toString])),
|
|
121
|
-
* process.stdout,
|
|
122
|
-
* ) // 9216576529289484980147613249169774446246768649...
|
|
123
|
-
* ```
|
|
124
|
-
*
|
|
125
|
-
* @execution series
|
|
126
|
-
*
|
|
127
|
-
* @transducing
|
|
128
|
-
*
|
|
129
|
-
* TODO explore Semigroup = Iterator|AsyncIterator
|
|
130
|
-
*/
|
|
131
|
-
declare function transform(...args: any[]): any;
|
package/tryCatch.d.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
export = tryCatch;
|
|
2
|
-
/**
|
|
3
|
-
* @name tryCatch
|
|
4
|
-
*
|
|
5
|
-
* @synopsis
|
|
6
|
-
* ```coffeescript [specscript]
|
|
7
|
-
* tryCatch(tryer function, catcher function)(...args) -> Promise|any
|
|
8
|
-
*
|
|
9
|
-
* tryCatch(...args, tryer function, catcher function) -> Promise|any
|
|
10
|
-
* ```
|
|
11
|
-
*
|
|
12
|
-
* @description
|
|
13
|
-
* Handles errors with a `tryer` and a `catcher` function. Calls the `tryer` function with the provided arguments and catches any errors thrown by the `tryer` function with the `catcher` function. If the `tryer` function is asynchronous and returns a rejected promise, the `catcher` function will execute with the value of the rejected promise. The `catcher` function is called with the error and all arguments supplied to the `tryer` function.
|
|
14
|
-
*
|
|
15
|
-
* ```javascript [playground]
|
|
16
|
-
* const throwsIfOdd = number => {
|
|
17
|
-
* if (number % 2 == 1) {
|
|
18
|
-
* throw new Error(`${number} is odd`)
|
|
19
|
-
* }
|
|
20
|
-
* console.log('did not throw for', number)
|
|
21
|
-
* }
|
|
22
|
-
*
|
|
23
|
-
* const errorHandler = tryCatch(throwsIfOdd, (error, number) => {
|
|
24
|
-
* console.log('caught error from number', number)
|
|
25
|
-
* console.log(error)
|
|
26
|
-
* })
|
|
27
|
-
*
|
|
28
|
-
* errorHandler(2) // did not throw for 2
|
|
29
|
-
* errorHandler(3) // caught error from number 3
|
|
30
|
-
* // Error: 3 is odd
|
|
31
|
-
*
|
|
32
|
-
* ```
|
|
33
|
-
*
|
|
34
|
-
* `tryCatch` behaves eagerly (executes immediately with a single call and not with multiple calls like a higher order function) when passed any amount of nonfunction (primitive or object) arguments before the `tryer` and `catcher` functions.
|
|
35
|
-
*
|
|
36
|
-
* ```javascript [playground]
|
|
37
|
-
* const add = (a, b) => a + b
|
|
38
|
-
*
|
|
39
|
-
* tryCatch(1, 2, 3, function throwSum(...numbers) {
|
|
40
|
-
* const sum = numbers.reduce(add)
|
|
41
|
-
* throw new Error(`the sum is ${sum}`)
|
|
42
|
-
* }, function logErrorMessage(error) {
|
|
43
|
-
* console.error(error.message) // the sum is 6
|
|
44
|
-
* })
|
|
45
|
-
* ```
|
|
46
|
-
*/
|
|
47
|
-
declare function tryCatch(...args: any[]): any;
|