rubico 2.7.2 → 2.7.4
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/README.md +14 -17
- package/Transducer.d.ts +10 -10
- package/Transducer.js +65 -69
- package/__.js +1 -1
- package/_internal/FlatMappingIterator.js +1 -1
- package/_internal/MappingIterator.d.ts +1 -1
- package/_internal/MappingIterator.js +1 -1
- package/_internal/arrayFilter.js +6 -6
- package/_internal/arrayFilterIndexes.js +7 -7
- package/_internal/arrayFilterWithIndex.js +6 -6
- package/_internal/arrayFind.js +7 -7
- package/_internal/arrayFlatten.js +25 -25
- package/_internal/arrayForEach.d.ts +1 -1
- package/_internal/arrayForEach.js +1 -1
- package/_internal/arrayForEachSeries.js +1 -1
- package/_internal/arrayMap.d.ts +2 -2
- package/_internal/arrayMap.js +5 -5
- package/_internal/arrayMapPool.d.ts +1 -1
- package/_internal/arrayMapPool.js +10 -10
- package/_internal/arrayMapRate.js +4 -4
- package/_internal/arrayMapSeries.d.ts +1 -1
- package/_internal/arrayMapSeries.js +8 -8
- package/_internal/arrayMapWithIndex.js +4 -4
- package/_internal/arrayReduce.js +1 -1
- package/_internal/asyncGeneratorFunctionForEach.js +3 -3
- package/_internal/asyncGeneratorFunctionMap.js +3 -3
- package/_internal/asyncIteratorFind.js +3 -3
- package/_internal/asyncIteratorForEach.d.ts +1 -1
- package/_internal/asyncIteratorForEach.js +3 -3
- package/_internal/asyncIteratorForEachSeries.js +3 -3
- package/_internal/asyncIteratorToArray.js +2 -2
- package/_internal/copyDeep.js +12 -12
- package/_internal/funcAll.js +3 -3
- package/_internal/funcAllSeries.js +6 -6
- package/_internal/funcObjectAll.js +4 -4
- package/_internal/functionArrayAll.js +3 -3
- package/_internal/functionArrayAllSeries.js +6 -6
- package/_internal/functionObjectAll.js +4 -4
- package/_internal/generatorFunctionForEach.js +3 -3
- package/_internal/generatorFunctionMap.js +3 -3
- package/_internal/generatorFunctionReduce.js +1 -1
- package/_internal/iteratorEvery.js +2 -2
- package/_internal/iteratorFind.js +7 -7
- package/_internal/iteratorForEach.d.ts +1 -1
- package/_internal/iteratorForEach.js +3 -3
- package/_internal/iteratorForEachSeries.js +1 -1
- package/_internal/iteratorReduce.d.ts +1 -1
- package/_internal/iteratorReduce.js +2 -2
- package/_internal/iteratorSome.js +2 -2
- package/_internal/mapFilter.js +4 -4
- package/_internal/mapMap.d.ts +1 -1
- package/_internal/mapMap.js +6 -6
- package/_internal/mapMapPool.js +10 -10
- package/_internal/mapMapSeries.js +10 -10
- package/_internal/objectFilter.js +6 -6
- package/_internal/objectFlatMap.d.ts +1 -1
- package/_internal/objectFlatMap.js +1 -1
- package/_internal/objectFlatten.js +14 -14
- package/_internal/objectMap.js +3 -3
- package/_internal/objectMapOwn.js +3 -3
- package/_internal/objectMapPool.js +10 -10
- package/_internal/objectMapSeries.js +9 -9
- package/_internal/objectReduce.d.ts +1 -1
- package/_internal/objectReduce.js +2 -2
- package/_internal/reducerAllSync.d.ts +2 -2
- package/_internal/reducerAllSync.js +2 -2
- package/_internal/reducerAnySync.d.ts +1 -1
- package/_internal/reducerAnySync.js +2 -2
- package/_internal/reducerConcat.d.ts +1 -1
- package/_internal/reducerConcat.js +4 -4
- package/_internal/reducerConcatSync.js +2 -2
- package/_internal/reducerEvery.d.ts +2 -2
- package/_internal/reducerEvery.js +4 -4
- package/_internal/reducerFilter.d.ts +2 -2
- package/_internal/reducerFilter.js +5 -5
- package/_internal/reducerFlatten.js +3 -3
- package/_internal/reducerForEach.d.ts +2 -2
- package/_internal/reducerForEach.js +5 -5
- package/_internal/reducerMap.d.ts +1 -1
- package/_internal/reducerMap.js +5 -5
- package/_internal/reducerSome.d.ts +2 -2
- package/_internal/reducerSome.js +4 -4
- package/_internal/reducerTryCatch.d.ts +2 -2
- package/_internal/reducerTryCatch.js +8 -8
- package/_internal/setFilter.d.ts +1 -1
- package/_internal/setFilter.js +5 -5
- package/_internal/setFlatten.js +24 -24
- package/_internal/setMap.d.ts +1 -1
- package/_internal/setMap.js +6 -6
- package/_internal/setMapPool.js +9 -9
- package/_internal/setMapSeries.js +10 -10
- package/_internal/streamFlatExtend.js +25 -25
- package/_internal/streamFlatMap.js +2 -2
- package/all.js +29 -30
- package/and.js +27 -13
- package/assign.js +15 -23
- package/compose.js +7 -5
- package/curry.js +5 -12
- package/dist/Transducer.es.js +24 -24
- package/dist/Transducer.es.min.js +1 -1
- package/dist/Transducer.js +24 -24
- package/dist/Transducer.min.js +1 -1
- package/dist/Transducer.mjs +24 -24
- 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 +14 -14
- package/dist/all.es.min.js +1 -1
- package/dist/all.js +14 -14
- package/dist/all.min.js +1 -1
- package/dist/all.mjs +14 -14
- 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 +5 -5
- package/dist/assign.es.min.js +1 -1
- package/dist/assign.js +5 -5
- package/dist/assign.min.js +1 -1
- package/dist/assign.mjs +5 -5
- 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 +7 -7
- package/dist/every.es.min.js +1 -1
- package/dist/every.js +7 -7
- package/dist/every.min.js +1 -1
- package/dist/every.mjs +7 -7
- package/dist/filter.es.js +21 -21
- package/dist/filter.es.min.js +1 -1
- package/dist/filter.js +21 -21
- package/dist/filter.min.js +1 -1
- package/dist/filter.mjs +21 -21
- package/dist/flatMap.es.js +82 -82
- package/dist/flatMap.es.min.js +1 -1
- package/dist/flatMap.js +82 -82
- package/dist/flatMap.min.js +1 -1
- package/dist/flatMap.mjs +82 -82
- package/dist/forEach.es.js +7 -7
- package/dist/forEach.es.min.js +1 -1
- package/dist/forEach.js +7 -7
- package/dist/forEach.min.js +1 -1
- package/dist/forEach.mjs +7 -7
- 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 +83 -83
- package/dist/map.es.min.js +1 -1
- package/dist/map.js +83 -83
- package/dist/map.min.js +1 -1
- package/dist/map.mjs +83 -83
- package/dist/not.es.js +4 -2
- package/dist/not.es.min.js +2 -2
- package/dist/not.js +4 -2
- package/dist/not.min.js +2 -2
- package/dist/not.mjs +4 -2
- package/dist/omit.es.js +13 -13
- package/dist/omit.es.min.js +1 -1
- package/dist/omit.js +13 -13
- package/dist/omit.min.js +1 -1
- package/dist/omit.mjs +13 -13
- 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 +5 -5
- package/dist/reduce.es.min.js +1 -1
- package/dist/reduce.js +5 -5
- package/dist/reduce.min.js +1 -1
- package/dist/reduce.mjs +5 -5
- package/dist/rubico.es.js +218 -216
- package/dist/rubico.es.min.js +2 -2
- package/dist/rubico.global.js +218 -216
- package/dist/rubico.global.min.js +2 -2
- package/dist/rubico.js +218 -216
- package/dist/rubico.min.js +2 -2
- package/dist/rubico.mjs +218 -216
- 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 +8 -8
- package/dist/some.es.min.js +1 -1
- package/dist/some.js +8 -8
- package/dist/some.min.js +1 -1
- package/dist/some.mjs +8 -8
- 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 +5 -5
- package/dist/transform.es.min.js +1 -1
- package/dist/transform.js +5 -5
- package/dist/transform.min.js +1 -1
- package/dist/transform.mjs +5 -5
- 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 +8 -8
- package/dist/x/append.es.min.js +1 -1
- package/dist/x/append.js +8 -8
- package/dist/x/append.min.js +1 -1
- package/dist/x/append.mjs +8 -8
- 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 +69 -37
- package/dist/x/defaultsDeep.es.min.js +2 -2
- package/dist/x/defaultsDeep.js +69 -37
- package/dist/x/defaultsDeep.min.js +2 -2
- package/dist/x/defaultsDeep.mjs +69 -37
- package/dist/x/differenceWith.es.js +14 -14
- package/dist/x/differenceWith.es.min.js +1 -1
- package/dist/x/differenceWith.js +14 -14
- package/dist/x/differenceWith.min.js +1 -1
- package/dist/x/differenceWith.mjs +14 -14
- package/dist/x/filterOut.es.js +24 -22
- package/dist/x/filterOut.es.min.js +2 -2
- package/dist/x/filterOut.js +24 -22
- package/dist/x/filterOut.min.js +2 -2
- package/dist/x/filterOut.mjs +24 -22
- package/dist/x/find.es.js +18 -18
- package/dist/x/find.es.min.js +1 -1
- package/dist/x/find.js +18 -18
- package/dist/x/find.min.js +1 -1
- package/dist/x/find.mjs +18 -18
- 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 +82 -82
- package/dist/x/flatten.es.min.js +1 -1
- package/dist/x/flatten.js +82 -82
- package/dist/x/flatten.min.js +1 -1
- package/dist/x/flatten.mjs +82 -82
- package/dist/x/groupBy.es.js +17 -17
- package/dist/x/groupBy.es.min.js +1 -1
- package/dist/x/groupBy.js +17 -17
- package/dist/x/groupBy.min.js +1 -1
- package/dist/x/groupBy.mjs +17 -17
- 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 +6 -6
- package/dist/x/maxBy.es.min.js +1 -1
- package/dist/x/maxBy.js +6 -6
- package/dist/x/maxBy.min.js +1 -1
- package/dist/x/maxBy.mjs +6 -6
- 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 +83 -83
- package/dist/x/pluck.es.min.js +1 -1
- package/dist/x/pluck.js +83 -83
- package/dist/x/pluck.min.js +1 -1
- package/dist/x/pluck.mjs +83 -83
- package/dist/x/prepend.es.js +8 -8
- package/dist/x/prepend.es.min.js +1 -1
- package/dist/x/prepend.js +8 -8
- package/dist/x/prepend.min.js +1 -1
- package/dist/x/prepend.mjs +8 -8
- 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 +39 -39
- package/dist/x/unionWith.es.min.js +1 -1
- package/dist/x/unionWith.js +39 -39
- package/dist/x/unionWith.min.js +1 -1
- package/dist/x/unionWith.mjs +39 -39
- 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/eq.js +32 -10
- package/es.js +218 -216
- package/every.d.ts +1 -1
- package/every.js +5 -3
- package/filter.d.ts +3 -3
- package/filter.js +15 -15
- package/flatMap.d.ts +9 -9
- package/flatMap.js +13 -11
- package/forEach.d.ts +1 -1
- package/forEach.js +19 -15
- package/gt.js +30 -13
- package/gte.js +31 -12
- package/index.js +218 -216
- package/lt.js +28 -9
- package/lte.js +34 -15
- package/map.d.ts +3 -3
- package/map.js +32 -32
- package/monad/Mux.benchmark.js +1 -1
- package/monad/Mux.js +6 -6
- package/monad/Struct.js +2 -2
- package/not.js +23 -8
- package/omit.js +2 -3
- package/or.js +30 -14
- package/package.json +1 -1
- package/pick.js +2 -3
- package/pipe.js +7 -15
- package/reduce.d.ts +7 -7
- package/reduce.js +19 -24
- package/some.d.ts +1 -1
- package/some.js +5 -3
- package/switchCase.d.ts +1 -1
- package/switchCase.js +13 -12
- package/tap.js +20 -4
- package/thunkify.js +2 -0
- package/transform.d.ts +1 -1
- package/transform.js +9 -23
- package/tryCatch.js +41 -8
- package/x/README.md +8 -8
- package/x/append.d.ts +2 -2
- package/x/append.js +8 -8
- package/x/defaultsDeep.js +94 -57
- package/x/defaultsDeep.test.js +24 -1
- package/x/differenceWith.js +13 -13
- package/x/find.d.ts +1 -1
- package/x/find.js +1 -1
- package/x/find.test.js +2 -2
- package/x/findIndex.test.js +1 -1
- package/x/first.d.ts +1 -1
- package/x/first.js +1 -1
- package/x/first.test.js +1 -1
- package/x/groupBy.d.ts +1 -1
- package/x/groupBy.js +13 -13
- package/x/last.d.ts +1 -1
- package/x/last.js +1 -1
- package/x/last.test.js +1 -1
- package/x/maxBy.d.ts +7 -7
- package/x/maxBy.js +13 -13
- package/x/maxBy.test.js +5 -5
- package/x/pluck.test.js +1 -1
- package/x/prepend.d.ts +2 -2
- package/x/prepend.js +8 -8
- package/x/size.d.ts +1 -1
- package/x/size.js +1 -1
- package/x/unionWith.js +11 -11
- package/x/unionWith.test.js +5 -5
package/lt.js
CHANGED
|
@@ -6,20 +6,27 @@ const lessThan = require('./_internal/lessThan')
|
|
|
6
6
|
*
|
|
7
7
|
* @synopsis
|
|
8
8
|
* ```coffeescript [specscript]
|
|
9
|
-
*
|
|
9
|
+
* args Array<any>
|
|
10
|
+
* argsOrPromises Array<Promise|any>
|
|
10
11
|
*
|
|
11
|
-
*
|
|
12
|
-
* lt(...args, leftValue Promise|any, right function) -> Promise|boolean
|
|
12
|
+
* type SyncOrAsyncResolver = (...args)=>Promise|any
|
|
13
13
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
14
|
+
* leftValue Promise|any
|
|
15
|
+
* rightValue Promise|any
|
|
16
|
+
* leftResolver SyncOrAsyncResolver
|
|
17
|
+
* rightResolver SyncOrAsyncResolver
|
|
16
18
|
*
|
|
17
|
-
* lt(
|
|
18
|
-
* lt(...
|
|
19
|
+
* lt(leftValue, rightValue) -> Promise|boolean
|
|
20
|
+
* lt(...argsOrPromises, leftResolver, rightValue) -> Promise|boolean
|
|
21
|
+
* lt(...argsOrPromises, leftValue, rightResolver) -> Promise|boolean
|
|
22
|
+
* lt(...argsOrPromises, leftResolver, rightResolver) -> Promise|boolean
|
|
23
|
+
* lt(leftResolver, rightValue)(...args) -> Promise|boolean
|
|
24
|
+
* lt(leftValue, rightResolver)(...args) -> Promise|boolean
|
|
25
|
+
* lt(leftResolver, rightResolver)(...args) -> Promise|boolean
|
|
19
26
|
* ```
|
|
20
27
|
*
|
|
21
28
|
* @description
|
|
22
|
-
*
|
|
29
|
+
* Functional equivalent of the [Less than (<)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Less_than) operator. Tests if a value is less than (`<`) another value.
|
|
23
30
|
*
|
|
24
31
|
* ```javascript [playground]
|
|
25
32
|
* console.log(lt(1, 3)) // true
|
|
@@ -27,7 +34,7 @@ const lessThan = require('./_internal/lessThan')
|
|
|
27
34
|
* console.log(lt(4, 3)) // false
|
|
28
35
|
* ```
|
|
29
36
|
*
|
|
30
|
-
* If either of the two values are resolver functions, `lt` returns a function that resolves the
|
|
37
|
+
* If either of the two values are resolver functions, `lt` returns a function that resolves the value(s) to compare.
|
|
31
38
|
*
|
|
32
39
|
* ```javascript [playground]
|
|
33
40
|
* const identity = value => value
|
|
@@ -39,6 +46,18 @@ const lessThan = require('./_internal/lessThan')
|
|
|
39
46
|
* console.log(isLessThan3(5)) // false
|
|
40
47
|
* ```
|
|
41
48
|
*
|
|
49
|
+
* If either of the resolver functions is asynchronous, `lt` returns an asynchronous function.
|
|
50
|
+
*
|
|
51
|
+
* ```javascript [playground]
|
|
52
|
+
* const asyncIdentity = async value => value
|
|
53
|
+
*
|
|
54
|
+
* const asyncIsLessThan3 = lt(asyncIdentity, 3)
|
|
55
|
+
*
|
|
56
|
+
* asyncIsLessThan3(1).then(console.log) // true
|
|
57
|
+
* asyncIsLessThan3(3).then(console.log) // false
|
|
58
|
+
* asyncIsLessThan3(5).then(console.log) // false
|
|
59
|
+
* ```
|
|
60
|
+
*
|
|
42
61
|
* `lt` supports a lazy API for composability.
|
|
43
62
|
*
|
|
44
63
|
* ```javascript [playground]
|
package/lte.js
CHANGED
|
@@ -6,20 +6,27 @@ const lessThanOrEqual = require('./_internal/lessThanOrEqual')
|
|
|
6
6
|
*
|
|
7
7
|
* @synopsis
|
|
8
8
|
* ```coffeescript [specscript]
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
9
|
+
* args Array<any>
|
|
10
|
+
* argsOrPromises Array<Promise|any>
|
|
11
|
+
*
|
|
12
|
+
* type SyncOrAsyncResolver = (...args)=>Promise|any
|
|
13
|
+
*
|
|
14
|
+
* leftValue Promise|any
|
|
15
|
+
* rightValue Promise|any
|
|
16
|
+
* leftResolver SyncOrAsyncResolver
|
|
17
|
+
* rightResolver SyncOrAsyncResolver
|
|
18
|
+
*
|
|
19
|
+
* lte(leftValue, rightValue) -> Promise|boolean
|
|
20
|
+
* lte(...argsOrPromises, leftResolver, rightValue) -> Promise|boolean
|
|
21
|
+
* lte(...argsOrPromises, leftValue, rightResolver) -> Promise|boolean
|
|
22
|
+
* lte(...argsOrPromises, leftResolver, rightResolver) -> Promise|boolean
|
|
23
|
+
* lte(leftResolver, rightValue)(...args) -> Promise|boolean
|
|
24
|
+
* lte(leftValue, rightResolver)(...args) -> Promise|boolean
|
|
25
|
+
* lte(leftResolver, rightResolver)(...args) -> Promise|boolean
|
|
19
26
|
* ```
|
|
20
27
|
*
|
|
21
28
|
* @description
|
|
22
|
-
*
|
|
29
|
+
* Functional equivalent of the [Less than or equal (>=)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Less_than_or_equal) operator. Tests if a value is less than or equal (`<=`) to another value.
|
|
23
30
|
*
|
|
24
31
|
* ```javascript [playground]
|
|
25
32
|
* console.log(lte(1, 3)) // true
|
|
@@ -27,16 +34,28 @@ const lessThanOrEqual = require('./_internal/lessThanOrEqual')
|
|
|
27
34
|
* console.log(lte(4, 3)) // false
|
|
28
35
|
* ```
|
|
29
36
|
*
|
|
30
|
-
* If either of the two values are resolver functions, `lte` returns a function that resolves the
|
|
37
|
+
* If either of the two values are resolver functions, `lte` returns a function that resolves the value(s) to compare.
|
|
31
38
|
*
|
|
32
39
|
* ```javascript [playground]
|
|
33
40
|
* const identity = value => value
|
|
34
41
|
*
|
|
35
42
|
* const isLessThanOrEqualTo3 = lte(identity, 3)
|
|
36
43
|
*
|
|
37
|
-
* console.log(isLessThanOrEqualTo3(1)
|
|
38
|
-
* console.log(isLessThanOrEqualTo3(3)
|
|
39
|
-
* console.log(isLessThanOrEqualTo3(5)
|
|
44
|
+
* console.log(isLessThanOrEqualTo3(1)) // true
|
|
45
|
+
* console.log(isLessThanOrEqualTo3(3)) // true
|
|
46
|
+
* console.log(isLessThanOrEqualTo3(5)) // false
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* If either of the two resolver functions is asynchronous, `lte` returns an asynchronous function.
|
|
50
|
+
*
|
|
51
|
+
* ```javascript [playground]
|
|
52
|
+
* const asyncIdentity = async value => value
|
|
53
|
+
*
|
|
54
|
+
* const asyncIsLessThanOrEqualTo3 = lte(asyncIdentity, 3)
|
|
55
|
+
*
|
|
56
|
+
* asyncIsLessThanOrEqualTo3(1).then(console.log) // true
|
|
57
|
+
* asyncIsLessThanOrEqualTo3(3).then(console.log) // true
|
|
58
|
+
* asyncIsLessThanOrEqualTo3(5).then(console.log) // false
|
|
40
59
|
* ```
|
|
41
60
|
*
|
|
42
61
|
* `lte` supports a lazy API for composability.
|
package/map.d.ts
CHANGED
|
@@ -10,14 +10,14 @@ export = map;
|
|
|
10
10
|
* value any,
|
|
11
11
|
* indexOrKey number|string,
|
|
12
12
|
* collection Mappable
|
|
13
|
-
* )=>(
|
|
13
|
+
* )=>(mappedElement Promise|any)
|
|
14
14
|
*
|
|
15
15
|
* map(value Mappable, mapper Mapper) -> result Promise|Mappable
|
|
16
16
|
* map(mapper Mapper)(value Mappable) -> result Promise|Mappable
|
|
17
17
|
* ```
|
|
18
18
|
*
|
|
19
19
|
* @description
|
|
20
|
-
* Applies a synchronous or asynchronous mapper function concurrently to each
|
|
20
|
+
* Applies a synchronous or asynchronous mapper function concurrently to each element of a collection, returning the results in a new collection of the same type. If order is implied by the collection, it is maintained in the result. `map` accepts the following collections:
|
|
21
21
|
*
|
|
22
22
|
* * `Array`
|
|
23
23
|
* * `Object`
|
|
@@ -26,7 +26,7 @@ export = map;
|
|
|
26
26
|
* * `Iterator`/`Generator`
|
|
27
27
|
* * `AsyncIterator`/`AsyncGenerator`
|
|
28
28
|
*
|
|
29
|
-
* With arrays (type `Array`), `map` applies the mapper function to each
|
|
29
|
+
* With arrays (type `Array`), `map` applies the mapper function to each element of the array, returning the transformed results in a new array ordered the same as the original array.
|
|
30
30
|
*
|
|
31
31
|
* ```javascript [playground]
|
|
32
32
|
* const square = number => number ** 2
|
package/map.js
CHANGED
|
@@ -95,18 +95,18 @@ const _map = function (value, f) {
|
|
|
95
95
|
* ```coffeescript [specscript]
|
|
96
96
|
* type Functor = Array|Set|Map|Generator|AsyncGenerator|{ map: function }|Object
|
|
97
97
|
*
|
|
98
|
-
* type
|
|
99
|
-
*
|
|
98
|
+
* type SyncOrAsyncMapper = (
|
|
99
|
+
* element any,
|
|
100
100
|
* indexOrKey number|string|any,
|
|
101
|
-
*
|
|
102
|
-
* )=>(
|
|
101
|
+
* functor Functor
|
|
102
|
+
* )=>(resultElement Promise|any)
|
|
103
103
|
*
|
|
104
|
-
* map(
|
|
105
|
-
* map(mapper
|
|
104
|
+
* map(functor Promise|Functor, mapper SyncOrAsyncMapper) -> result Promise|Functor
|
|
105
|
+
* map(mapper SyncOrAsyncMapper)(functor Functor) -> result Promise|Functor
|
|
106
106
|
* ```
|
|
107
107
|
*
|
|
108
108
|
* @description
|
|
109
|
-
* Applies a mapper function to each
|
|
109
|
+
* Applies a mapper function to each element of a functor, returning a functor of the same type with the mapped elements. The order of the elements is maintained.
|
|
110
110
|
*
|
|
111
111
|
* The following data types are considered to be functors:
|
|
112
112
|
* * `array`
|
|
@@ -117,12 +117,12 @@ const _map = function (value, f) {
|
|
|
117
117
|
* * `object with .map method`
|
|
118
118
|
* * `object`
|
|
119
119
|
*
|
|
120
|
-
* The mapper function defines a mapping between a given
|
|
120
|
+
* The mapper function defines a mapping between a given element in the functor to a resulting element in the returned functor.
|
|
121
121
|
*
|
|
122
122
|
* ```javascript
|
|
123
|
-
* const mapper = function (
|
|
124
|
-
* //
|
|
125
|
-
* return
|
|
123
|
+
* const mapper = function (element) {
|
|
124
|
+
* // resultElement is the result of a mapping from element
|
|
125
|
+
* return resultElement
|
|
126
126
|
* }
|
|
127
127
|
* ```
|
|
128
128
|
*
|
|
@@ -130,34 +130,34 @@ const _map = function (value, f) {
|
|
|
130
130
|
*
|
|
131
131
|
* If the functor is an array:
|
|
132
132
|
* ```coffeescript [specscript]
|
|
133
|
-
* mapper(
|
|
133
|
+
* mapper(element any, index number, ftor Array) -> resultElement Promise|any
|
|
134
134
|
* ```
|
|
135
135
|
*
|
|
136
136
|
* If the functor is a set:
|
|
137
137
|
* ```coffeescript [specscript]
|
|
138
|
-
* mapper(
|
|
138
|
+
* mapper(element any, element any, ftor Set) -> resultElement Promise|any
|
|
139
139
|
* ```
|
|
140
140
|
*
|
|
141
141
|
* If the functor is a map:
|
|
142
142
|
* ```coffeescript [specscript]
|
|
143
|
-
* mapper(
|
|
143
|
+
* mapper(element any, key any, ftor Map) -> resultElement Promise|any
|
|
144
144
|
* ```
|
|
145
145
|
*
|
|
146
146
|
* If the functor is a generator:
|
|
147
147
|
* ```coffeescript [specscript]
|
|
148
|
-
* mapper(
|
|
148
|
+
* mapper(element any) -> resultElement Promise|any
|
|
149
149
|
* ```
|
|
150
150
|
*
|
|
151
151
|
* If the functor is an async generator:
|
|
152
152
|
* ```coffeescript [specscript]
|
|
153
|
-
* mapper(
|
|
153
|
+
* mapper(element any) -> resultElement Promise|any
|
|
154
154
|
* ```
|
|
155
155
|
*
|
|
156
156
|
* If the functor is an object with a `.map` method, the mapper function signature is defined externally.
|
|
157
157
|
*
|
|
158
158
|
* If the functor is a plain object:
|
|
159
159
|
* ```coffeescript [specscript]
|
|
160
|
-
* mapper(
|
|
160
|
+
* mapper(element any, key string, ftor Object) -> resultElement Promise|any
|
|
161
161
|
* ```
|
|
162
162
|
*
|
|
163
163
|
* `map` works for arrays.
|
|
@@ -204,7 +204,7 @@ const _map = function (value, f) {
|
|
|
204
204
|
* console.log(result) // Map { 'a' => 1, 'b' => 4, 'c' => 9, 'd' => 16, 'e' => 25 }
|
|
205
205
|
* ```
|
|
206
206
|
*
|
|
207
|
-
* `map` applies the mapper function lazily to each value of a generator, creating a new generator with mapped
|
|
207
|
+
* `map` applies the mapper function lazily to each value of a generator, creating a new generator with mapped elements.
|
|
208
208
|
*
|
|
209
209
|
* ```javascript [playground]
|
|
210
210
|
* const capitalize = string => string.toUpperCase()
|
|
@@ -221,7 +221,7 @@ const _map = function (value, f) {
|
|
|
221
221
|
* console.log([...ABCGenerator]) // ['A', 'B', 'C']
|
|
222
222
|
* ```
|
|
223
223
|
*
|
|
224
|
-
* `map` applies the mapper function lazily to each value of an async generator, creating a new async generator with mapped
|
|
224
|
+
* `map` applies the mapper function lazily to each value of an async generator, creating a new async generator with mapped elements.
|
|
225
225
|
*
|
|
226
226
|
* ```javascript [playground]
|
|
227
227
|
* const capitalize = string => string.toUpperCase()
|
|
@@ -306,7 +306,7 @@ const _mapEntries = (value, f) => {
|
|
|
306
306
|
*
|
|
307
307
|
* type EntryMapper = (
|
|
308
308
|
* entry [key string|any, value any],
|
|
309
|
-
* )=>(resultEntry Promise|[resultKey string|any,
|
|
309
|
+
* )=>(resultEntry Promise|[resultKey string|any, resultElement any])
|
|
310
310
|
*
|
|
311
311
|
* map.entries(
|
|
312
312
|
* value Promise|FunctorWithEntries,
|
|
@@ -398,13 +398,13 @@ map.entries = function mapEntries(arg0, arg1) {
|
|
|
398
398
|
* ```coffeescript [specscript]
|
|
399
399
|
* type Functor = Array|Object|Set|Map
|
|
400
400
|
*
|
|
401
|
-
* type
|
|
401
|
+
* type SyncOrAsyncMapper = (
|
|
402
402
|
* value any,
|
|
403
403
|
* indexOrKey number|string|any,
|
|
404
404
|
* f Functor
|
|
405
|
-
* )=>(
|
|
405
|
+
* )=>(mappedElement Promise|any)
|
|
406
406
|
*
|
|
407
|
-
* _mapSeries(f Functor, f
|
|
407
|
+
* _mapSeries(f Functor, f SyncOrAsyncMapper) -> result Promise|Functor
|
|
408
408
|
* ```
|
|
409
409
|
*/
|
|
410
410
|
const _mapSeries = function (collection, f) {
|
|
@@ -437,18 +437,18 @@ const _mapSeries = function (collection, f) {
|
|
|
437
437
|
* ```coffeescript [specscript]
|
|
438
438
|
* type MapSeriesFunctor = Array|Object|Set|Map
|
|
439
439
|
*
|
|
440
|
-
* type
|
|
440
|
+
* type SyncOrAsyncMapper = (
|
|
441
441
|
* value any,
|
|
442
442
|
* indexOrKey number|string|any,
|
|
443
443
|
* ftor MapSeriesFunctor,
|
|
444
|
-
* )=>(
|
|
444
|
+
* )=>(mappedElement Promise|any)
|
|
445
445
|
*
|
|
446
446
|
* map.series(
|
|
447
447
|
* ftor Promise|MapSeriesFunctor,
|
|
448
|
-
* mapper
|
|
448
|
+
* mapper SyncOrAsyncMapper
|
|
449
449
|
* ) -> result MapSeriesFunctor
|
|
450
450
|
*
|
|
451
|
-
* map.series(mapper
|
|
451
|
+
* map.series(mapper SyncOrAsyncMapper)(ftor MapSeriesFunctor)
|
|
452
452
|
* -> result MapSeriesFunctor
|
|
453
453
|
* ```
|
|
454
454
|
*
|
|
@@ -537,21 +537,21 @@ const _mapPool = function (f, concurrency, mapper) {
|
|
|
537
537
|
* ```coffeescript [specscript]
|
|
538
538
|
* type MapPoolFunctor = Array|Object|Set|Map
|
|
539
539
|
*
|
|
540
|
-
* type
|
|
541
|
-
*
|
|
540
|
+
* type SyncOrAsyncMapper = (
|
|
541
|
+
* element any,
|
|
542
542
|
* indexOrKey number|string|any,
|
|
543
543
|
* ftor Functor
|
|
544
|
-
* )=>(
|
|
544
|
+
* )=>(resultElement Promise|any)
|
|
545
545
|
*
|
|
546
546
|
* map.pool(
|
|
547
547
|
* ftor MapPoolFunctor,
|
|
548
548
|
* concurrency number,
|
|
549
|
-
* mapper
|
|
549
|
+
* mapper SyncOrAsyncMapper
|
|
550
550
|
* ) -> result Promise|Array
|
|
551
551
|
*
|
|
552
552
|
* map.pool(
|
|
553
553
|
* concurrency number,
|
|
554
|
-
* mapper
|
|
554
|
+
* mapper SyncOrAsyncMapper
|
|
555
555
|
* )(ftor MapPoolFunctor) -> result Promise|Array
|
|
556
556
|
* ```
|
|
557
557
|
*
|
package/monad/Mux.benchmark.js
CHANGED
package/monad/Mux.js
CHANGED
|
@@ -240,13 +240,13 @@ const muxZipAsync = async function*(x) {
|
|
|
240
240
|
* Create rows from disparate Sequences
|
|
241
241
|
*
|
|
242
242
|
* @description
|
|
243
|
-
* Mux.zip takes a Sequence of
|
|
243
|
+
* Mux.zip takes a Sequence of elements or Sequences of elements and outputs either an Iterator or an AsyncIterator that yields an Array of elements of each supplied Sequence for a given iteration. If any Sequence supplied to Mux.zip is AsyncIterable or an AsyncGeneratorFunction, Mux.zip outputs an AsyncIterator. The Iterator or AsyncIterator will iterate as long as the longest iterator of the supplied Sequences; shorter iterators will yield undefined until the longest iterator is consumed.
|
|
244
244
|
*
|
|
245
245
|
* @example
|
|
246
246
|
* const iterator = Mux.zip([[1, 2, 3], ['a', 'b', 'c']])
|
|
247
247
|
*
|
|
248
|
-
* for (const
|
|
249
|
-
* console.log(
|
|
248
|
+
* for (const element of iterator) {
|
|
249
|
+
* console.log(element) // [1, 'a']
|
|
250
250
|
* // [2, 'b']
|
|
251
251
|
* // [3, 'c']
|
|
252
252
|
* }
|
|
@@ -307,7 +307,7 @@ const muxConcatAsync = async function*(x) {
|
|
|
307
307
|
* Concatenate Sequences into one
|
|
308
308
|
*
|
|
309
309
|
* @description
|
|
310
|
-
* Mux.concat takes a Sequence of
|
|
310
|
+
* Mux.concat takes a Sequence of elements or Sequences of elements and outputs either an Iterator or an AsyncIterator that yields each element individually. The first of these elements is the first element of the first Sequence, the next is the second element of the first Sequence, and so on until all Sequences have been iterated in order. Non-Sequence Elements in the top-level Sequence are yielded as they are.
|
|
311
311
|
*
|
|
312
312
|
* @example
|
|
313
313
|
* const iter = Mux.concat([
|
|
@@ -396,7 +396,7 @@ const muxSwitchAsync = async function*(x) {
|
|
|
396
396
|
* Interleave Sequences into one
|
|
397
397
|
*
|
|
398
398
|
* @description
|
|
399
|
-
* Mux.switch takes a Sequence of
|
|
399
|
+
* Mux.switch takes a Sequence of elements or Sequences of elements and outputs either an Iterator or an AsyncIterator that yields each element individually. The first of these elements is the first element of the first Sequence, the next is the first element of the second Sequence, and so on until all Sequences have yielded their first element. Then, the first Sequence yields its second element, the second Sequence yields its second element, and so on until all Sequences have finished iterating. Non-Sequence Elements in the top-level Sequence are yielded as they are. When a shorter Sequence finishes iterating, the remaining Sequences will switch yielding amongst themselves.
|
|
400
400
|
*
|
|
401
401
|
* @example
|
|
402
402
|
* const iter = Mux.switch([
|
|
@@ -457,7 +457,7 @@ const muxRaceAsync = async function*(x) {
|
|
|
457
457
|
* Asynchronously Race Sequences into one
|
|
458
458
|
*
|
|
459
459
|
* @description
|
|
460
|
-
* Mux.race takes a Sequence of
|
|
460
|
+
* Mux.race takes a Sequence of elements or Sequences of elements and outputs either an Iterator or an AsyncIterator that yields each element individually. The first of these elements are the synchronous elements of the top level Sequence, followed by the asynchronous elements of any asynchronous sub Sequences. If any sub Sequences are asynchronous, the order of these asynchronous elements in the final returned AsyncIterator is determined by the serial asynchronous resolution of the individual asynchronous sub Sequences. If all Sequences are synchronous, Mux.race behaves just as Mux.concat.
|
|
461
461
|
*
|
|
462
462
|
* @example
|
|
463
463
|
* const f = async function*() { await delay(5); yield 10; yield 20 }
|
package/monad/Struct.js
CHANGED
|
@@ -106,7 +106,7 @@ Struct.values = x => isObject(x) ? objectValuesGenerator(x) : x.values()
|
|
|
106
106
|
* <A any, B any>Struct.get(x Map<A, B>, index A) -> B|undefined
|
|
107
107
|
*
|
|
108
108
|
* @catchphrase
|
|
109
|
-
* Get an
|
|
109
|
+
* Get an element by index
|
|
110
110
|
*/
|
|
111
111
|
Struct.get = (x, index) => {
|
|
112
112
|
if (typeof x.get == 'function') return x.get(index)
|
|
@@ -179,7 +179,7 @@ Struct.size.objectKeys = x => {
|
|
|
179
179
|
*/
|
|
180
180
|
const copySet = x => {
|
|
181
181
|
const y = new Set()
|
|
182
|
-
for (const
|
|
182
|
+
for (const element of x) y.add(element)
|
|
183
183
|
return y
|
|
184
184
|
}
|
|
185
185
|
|
package/not.js
CHANGED
|
@@ -19,15 +19,20 @@ const _not = function (args, predicate) {
|
|
|
19
19
|
*
|
|
20
20
|
* @synopsis
|
|
21
21
|
* ```coffeescript [specscript]
|
|
22
|
-
*
|
|
22
|
+
* args Array<any>
|
|
23
|
+
* argsOrPromises Array<Promise|any>
|
|
23
24
|
*
|
|
24
|
-
*
|
|
25
|
+
* type SyncOrAsyncPredicate = (...args)=>Promise|boolean
|
|
25
26
|
*
|
|
26
|
-
*
|
|
27
|
+
* predicate SyncOrAsyncPredicate
|
|
28
|
+
*
|
|
29
|
+
* not(value Promise|boolean|any) -> negated Promise|boolean
|
|
30
|
+
* not(...argsOrPromises, predicate) -> negated Promise|boolean
|
|
31
|
+
* not(predicate)(...args) -> negated Promise|boolean
|
|
27
32
|
* ```
|
|
28
33
|
*
|
|
29
34
|
* @description
|
|
30
|
-
*
|
|
35
|
+
* Function equivalent to the [Logical NOT (`!`)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_NOT) operator. Negates a value.
|
|
31
36
|
*
|
|
32
37
|
* ```javascript [playground]
|
|
33
38
|
* const myObj = { a: 1 }
|
|
@@ -41,9 +46,17 @@ const _not = function (args, predicate) {
|
|
|
41
46
|
* ```javascript [playground]
|
|
42
47
|
* const isOdd = number => number % 2 == 1
|
|
43
48
|
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* ) // false
|
|
49
|
+
* const isNotOdd = not(isOdd)
|
|
50
|
+
*
|
|
51
|
+
* console.log(isNotOdd(3)) // false
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* `not` negates the resolved value of a promise.
|
|
55
|
+
*
|
|
56
|
+
* ```javascript [playground]
|
|
57
|
+
* const promise = Promise.resolve(false)
|
|
58
|
+
*
|
|
59
|
+
* not(promise).then(console.log) // true
|
|
47
60
|
* ```
|
|
48
61
|
*
|
|
49
62
|
* Any promises passed in argument position are resolved for their values before further execution. This only applies to the eager version of the API.
|
|
@@ -73,7 +86,9 @@ const not = function (...args) {
|
|
|
73
86
|
}
|
|
74
87
|
return _not(args, predicateOrValue)
|
|
75
88
|
}
|
|
76
|
-
return
|
|
89
|
+
return isPromise(predicateOrValue)
|
|
90
|
+
? predicateOrValue.then(negate)
|
|
91
|
+
: !predicateOrValue
|
|
77
92
|
}
|
|
78
93
|
|
|
79
94
|
module.exports = not
|
package/omit.js
CHANGED
|
@@ -20,9 +20,8 @@ const _omit = function (source, paths) {
|
|
|
20
20
|
*
|
|
21
21
|
* @synopsis
|
|
22
22
|
* ```coffeescript [specscript]
|
|
23
|
-
* omit(paths Array<string>)
|
|
24
|
-
*
|
|
25
|
-
* omit(source Object, paths Array<string>) -> omitted Object
|
|
23
|
+
* omit(source Promise|Object, paths Array<string>) -> result Object
|
|
24
|
+
* omit(paths Array<string>)(source Object) -> result Object
|
|
26
25
|
* ```
|
|
27
26
|
*
|
|
28
27
|
* @description
|
package/or.js
CHANGED
|
@@ -97,36 +97,52 @@ const areAnyPredicatesTruthy = function (args, predicates) {
|
|
|
97
97
|
*
|
|
98
98
|
* @synopsis
|
|
99
99
|
* ```coffeescript [specscript]
|
|
100
|
-
*
|
|
100
|
+
* args Array<any>
|
|
101
|
+
* argsOrPromises Array<Promise|any>
|
|
101
102
|
*
|
|
102
|
-
*
|
|
103
|
+
* type SyncOrAsyncPredicate = (...args)=>Promise|boolean|any
|
|
103
104
|
*
|
|
104
|
-
*
|
|
105
|
+
* predicatesOrValues Array<SyncOrAsyncPredicate|boolean|any>
|
|
106
|
+
*
|
|
107
|
+
* or(values Array<boolean|any>) -> result boolean
|
|
108
|
+
* or(...argsOrPromises, predicatesOrValues) -> Promise|boolean
|
|
109
|
+
* or(predicatesOrValues)(...args) -> Promise|boolean
|
|
105
110
|
* ```
|
|
106
111
|
*
|
|
107
112
|
* @description
|
|
108
|
-
*
|
|
113
|
+
* Function equivalent to the [Logical OR](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_OR) operator. Tests arrays of predicate functions, promises, values, or a mix thereof.
|
|
114
|
+
*
|
|
115
|
+
* If provided an array of boolean values, `or` returns true if any boolean values are truthy.
|
|
109
116
|
*
|
|
110
117
|
* ```javascript [playground]
|
|
111
118
|
* const oneIsLessThanZero = 1 < 0
|
|
112
119
|
* const oneIsGreaterThanTwo = 1 > 2
|
|
113
120
|
* const threeIsNotEqualToThree = 3 !== 3
|
|
114
121
|
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
122
|
+
* const condition = or([
|
|
123
|
+
* oneIsLessThanZero,
|
|
124
|
+
* oneIsGreaterThanTwo,
|
|
125
|
+
* threeIsNotEqualToThree
|
|
126
|
+
* ])
|
|
127
|
+
* console.log(condition) // false
|
|
118
128
|
* ```
|
|
119
129
|
*
|
|
120
|
-
* If any
|
|
130
|
+
* If any predicate functions are provided in the array, `or` returns an aggregate predicate function that returns true for a given set of arguments if any provided predicate functions test true. If any provided predicate functions are asynchronous, the aggregate predicate function becomes asynchronous.
|
|
121
131
|
*
|
|
122
132
|
* ```javascript [playground]
|
|
123
133
|
* const isOdd = number => number % 2 == 1
|
|
124
|
-
*
|
|
125
|
-
* const
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
134
|
+
* const isNegative = number => number < 0
|
|
135
|
+
* const asyncIsGreaterThan3 = async number => number > 3
|
|
136
|
+
*
|
|
137
|
+
* const aggregatePredicate = or([
|
|
138
|
+
* false,
|
|
139
|
+
* isOdd,
|
|
140
|
+
* isNegative,
|
|
141
|
+
* asyncIsGreaterThan3,
|
|
142
|
+
* ])
|
|
143
|
+
*
|
|
144
|
+
* const condition = await aggregatePredicate(2)
|
|
145
|
+
* console.log(condition) // false
|
|
130
146
|
* ```
|
|
131
147
|
*
|
|
132
148
|
* Any promises passed in argument position are resolved for their values before further execution. This only applies to the eager version of the API.
|
package/package.json
CHANGED
package/pick.js
CHANGED
|
@@ -27,9 +27,8 @@ const _pick = function (source, keys) {
|
|
|
27
27
|
*
|
|
28
28
|
* @synopsis
|
|
29
29
|
* ```coffeescript [specscript]
|
|
30
|
-
* pick(
|
|
31
|
-
*
|
|
32
|
-
* pick(keys Array<string>)(object Object) -> result Object
|
|
30
|
+
* pick(source Promise|Object, keys Array<string>) -> result Object
|
|
31
|
+
* pick(keys Array<string>)(source Object) -> result Object
|
|
33
32
|
* ```
|
|
34
33
|
*
|
|
35
34
|
* @description
|
package/pipe.js
CHANGED
|
@@ -10,19 +10,21 @@ const __ = require('./_internal/placeholder')
|
|
|
10
10
|
*
|
|
11
11
|
* @synopsis
|
|
12
12
|
* ```coffeescript [specscript]
|
|
13
|
-
* funcs Array<function>
|
|
14
13
|
* args Array<any>
|
|
15
|
-
*
|
|
14
|
+
* argsOrPromises Array<Promise|any>
|
|
16
15
|
*
|
|
17
|
-
*
|
|
16
|
+
* type SyncOrAsyncFunction = (...args)=>Promise|any
|
|
17
|
+
* type UnarySyncOrAsyncFunction = any=>Promise|any
|
|
18
18
|
*
|
|
19
|
-
*
|
|
19
|
+
* funcs [SyncOrAsyncFunction, ...Array<UnarySyncOrAsyncFunction>]
|
|
20
20
|
*
|
|
21
|
+
* pipe(funcs)(...args) -> result Promise|any
|
|
22
|
+
* pipe(...argsOrPromises, funcs) -> result Promise|any
|
|
21
23
|
* pipe(...funcs)(...args) -> result Promise|any
|
|
22
24
|
* ```
|
|
23
25
|
*
|
|
24
26
|
* @description
|
|
25
|
-
* Creates a function pipeline from multiple functions. Each function in the pipeline is evaluated in series, passing its return value as an argument to the next function. The result of a pipeline execution is the return value of the last function in the pipeline. If any function in the pipeline is asynchronous, the result of the pipeline execution is a Promise.
|
|
27
|
+
* Creates a function pipeline from multiple functions. Each function in the pipeline is evaluated in series, passing its return value as an argument to the next function. The result of a pipeline execution is the return value of the last function in the pipeline. All arguments provided to the pipeline are provided to the first function in the pipeline. If any function in the pipeline is asynchronous, the result of the pipeline execution is a Promise.
|
|
26
28
|
*
|
|
27
29
|
* ```javascript [playground]
|
|
28
30
|
* const syncAdd123 = pipe([
|
|
@@ -53,16 +55,6 @@ const __ = require('./_internal/placeholder')
|
|
|
53
55
|
* console.log(appendBC('a')) // 'abc'
|
|
54
56
|
* ```
|
|
55
57
|
*
|
|
56
|
-
* When passed any amount of arguments before the array of functions, `pipe` executes eagerly; the array of functions is immediately invoked with the supplied arguments.
|
|
57
|
-
*
|
|
58
|
-
* ```javascript [playground]
|
|
59
|
-
* pipe(1, 2, 3, [
|
|
60
|
-
* Array.of,
|
|
61
|
-
* map(number => number * 3),
|
|
62
|
-
* console.log, // [3, 6, 9]
|
|
63
|
-
* ])
|
|
64
|
-
* ```
|
|
65
|
-
*
|
|
66
58
|
* Any promises passed in argument position are resolved for their values before further execution. This only applies to the eager version of the API.
|
|
67
59
|
*
|
|
68
60
|
* ```javascript [playground]
|