rubico 2.7.3 → 2.7.5
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 +27 -30
- 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 +3 -3
- package/and.js +5 -2
- package/assign.js +2 -2
- package/compose.js +6 -2
- 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 +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 +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 +215 -215
- package/dist/rubico.es.min.js +1 -1
- package/dist/rubico.global.js +215 -215
- package/dist/rubico.global.min.js +1 -1
- package/dist/rubico.js +215 -215
- package/dist/rubico.min.js +1 -1
- package/dist/rubico.mjs +215 -215
- 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 +21 -21
- package/dist/x/filterOut.es.min.js +1 -1
- package/dist/x/filterOut.js +21 -21
- package/dist/x/filterOut.min.js +1 -1
- package/dist/x/filterOut.mjs +21 -21
- 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 +215 -215
- package/every.d.ts +1 -1
- package/every.js +6 -3
- package/filter.d.ts +3 -3
- package/filter.js +14 -14
- package/flatMap.d.ts +9 -9
- package/flatMap.js +9 -9
- package/forEach.d.ts +1 -1
- package/forEach.js +19 -15
- package/global.js +1 -0
- package/gt.js +30 -13
- package/gte.js +31 -12
- package/index.js +215 -215
- package/lt.js +28 -9
- package/lte.js +34 -15
- package/map.d.ts +3 -3
- package/map.js +31 -31
- package/monad/Mux.benchmark.js +1 -1
- package/monad/Mux.js +6 -6
- package/monad/Struct.js +2 -2
- package/not.js +15 -7
- package/or.js +5 -2
- package/package.json +1 -1
- package/pipe.js +7 -13
- package/reduce.d.ts +7 -7
- package/reduce.js +16 -16
- package/some.d.ts +1 -1
- package/some.js +6 -3
- package/switchCase.d.ts +1 -1
- package/switchCase.js +7 -4
- package/tap.js +14 -4
- package/thunkify.js +2 -0
- package/transform.d.ts +1 -1
- package/transform.js +6 -15
- package/tryCatch.js +8 -2
- 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/global.d.ts +0 -1
package/every.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export = every;
|
|
|
12
12
|
* ```
|
|
13
13
|
*
|
|
14
14
|
* @description
|
|
15
|
-
* Test a predicate concurrently across all
|
|
15
|
+
* Test a predicate concurrently across all elements of a collection, returning true if all predications are truthy.
|
|
16
16
|
*
|
|
17
17
|
* ```javascript [playground]
|
|
18
18
|
* const isOdd = number => number % 2 == 1
|
package/every.js
CHANGED
|
@@ -42,13 +42,16 @@ const _every = function (collection, predicate) {
|
|
|
42
42
|
* @synopsis
|
|
43
43
|
* ```coffeescript [specscript]
|
|
44
44
|
* type Foldable = Array|Set|Map|Generator|AsyncGenerator|{ reduce: function }|Object
|
|
45
|
+
* type UnarySyncOrAsyncPredicate = any=>Promise|boolean
|
|
45
46
|
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
47
|
+
* predicate UnarySyncOrAsyncPredicate
|
|
48
|
+
*
|
|
49
|
+
* every(foldable Foldable, predicate) -> result Promise|boolean
|
|
50
|
+
* every(predicate)(foldable Foldable) -> result Promise|boolean
|
|
48
51
|
* ```
|
|
49
52
|
*
|
|
50
53
|
* @description
|
|
51
|
-
* Test a predicate concurrently across all
|
|
54
|
+
* Test a predicate concurrently across all elements of a foldable, returning true if all executions return true.
|
|
52
55
|
*
|
|
53
56
|
* ```javascript [playground]
|
|
54
57
|
* const isOdd = number => number % 2 == 1
|
package/filter.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export = filter;
|
|
|
17
17
|
* ```
|
|
18
18
|
*
|
|
19
19
|
* @description
|
|
20
|
-
* Filter out
|
|
20
|
+
* Filter out elements from a collection based on the results of their concurrent executions with a synchronous or asynchronous predicate function. `filter` accepts the following collections:
|
|
21
21
|
*
|
|
22
22
|
* * `Array`
|
|
23
23
|
* * `Object`
|
|
@@ -26,7 +26,7 @@ export = filter;
|
|
|
26
26
|
* * `Iterator`/`Generator`
|
|
27
27
|
* * `AsyncIterator`/`AsyncGenerator`
|
|
28
28
|
*
|
|
29
|
-
* For arrays (type `Array`), `filter` applies the predicate function to each
|
|
29
|
+
* For arrays (type `Array`), `filter` applies the predicate function to each element of the array, returning a new array containing only the elements that tested truthy by the predicate. The order of the elements is preserved. On each iteration, the predicate is passed the element, the index of the element, and a reference to the array.
|
|
30
30
|
*
|
|
31
31
|
* ```javascript [playground]
|
|
32
32
|
* const isOdd = number => number % 2 == 1
|
|
@@ -48,7 +48,7 @@ export = filter;
|
|
|
48
48
|
* console.log(filter(obj, isOdd)) // { a: 1, c: 3, e: 5 }
|
|
49
49
|
* ```
|
|
50
50
|
*
|
|
51
|
-
* For sets (type `Set`), `filter` applies the predicate function to each
|
|
51
|
+
* For sets (type `Set`), `filter` applies the predicate function to each element in the set, returning a new set containing only the elements that tested truthy by the predicate. On each iteration, the predicate is passed the element, the same element as the key argument, and a reference to the set.
|
|
52
52
|
*
|
|
53
53
|
* ```javascript [playground]
|
|
54
54
|
* const isOdd = number => number % 2 == 1
|
package/filter.js
CHANGED
|
@@ -92,18 +92,18 @@ const _filter = function (value, predicate) {
|
|
|
92
92
|
* ```coffeescript [specscript]
|
|
93
93
|
* type Filterable = Array|Set|Map|Generator|AsyncGenerator|{ filter: function }|Object
|
|
94
94
|
*
|
|
95
|
-
* type
|
|
95
|
+
* type SyncOrAsyncPredicate = (
|
|
96
96
|
* value any,
|
|
97
97
|
* indexOrKey number|string|any,
|
|
98
98
|
* filterable Filterable,
|
|
99
|
-
* )=>boolean
|
|
99
|
+
* )=>(condition Promise|boolean)
|
|
100
100
|
*
|
|
101
|
-
* filter(filterable Promise|Filterable, predicate
|
|
102
|
-
* filter(predicate
|
|
101
|
+
* filter(filterable Promise|Filterable, predicate SyncOrAsyncPredicate) -> result Promise|Filterable
|
|
102
|
+
* filter(predicate SyncOrAsyncPredicate)(filterable Filterable) -> result Promise|Filterable
|
|
103
103
|
* ```
|
|
104
104
|
*
|
|
105
105
|
* @description
|
|
106
|
-
* Filters out
|
|
106
|
+
* Filters out elements from a filterable. Returns a filterable of the same type. The order of the elements in the filterable is preserved.
|
|
107
107
|
*
|
|
108
108
|
* The following data types are considered to be filterables:
|
|
109
109
|
* * `array`
|
|
@@ -114,11 +114,11 @@ const _filter = function (value, predicate) {
|
|
|
114
114
|
* * `object with .filter method`
|
|
115
115
|
* * `object`
|
|
116
116
|
*
|
|
117
|
-
* The filtering operation is defined by a given predicate function. The predicate function dictates whether a given
|
|
117
|
+
* The filtering operation is defined by a given predicate function. The predicate function dictates whether a given element from the filterable should be included in the returned filterable.
|
|
118
118
|
*
|
|
119
119
|
* ```javascript
|
|
120
|
-
* const predicate = function (
|
|
121
|
-
* // condition is the boolean result of the predicate test on
|
|
120
|
+
* const predicate = function (element) {
|
|
121
|
+
* // condition is the boolean result of the predicate test on element
|
|
122
122
|
* return condition
|
|
123
123
|
* }
|
|
124
124
|
* ```
|
|
@@ -127,34 +127,34 @@ const _filter = function (value, predicate) {
|
|
|
127
127
|
*
|
|
128
128
|
* If the filterable is an array:
|
|
129
129
|
* ```coffeescript [specscript]
|
|
130
|
-
* predicate(
|
|
130
|
+
* predicate(element any, index number, filt Array) -> condition Promise|boolean|any
|
|
131
131
|
* ```
|
|
132
132
|
*
|
|
133
133
|
* If the filterable is a set:
|
|
134
134
|
* ```coffeescript [specscript]
|
|
135
|
-
* predicate(
|
|
135
|
+
* predicate(element any, element any, filt Set) -> condition Promise|boolean|any
|
|
136
136
|
* ```
|
|
137
137
|
*
|
|
138
138
|
* If the filterable is a map:
|
|
139
139
|
* ```coffeescript [specscript]
|
|
140
|
-
* predicate(
|
|
140
|
+
* predicate(element any, key any, filt Map) -> condition Promise|boolean|any
|
|
141
141
|
* ```
|
|
142
142
|
*
|
|
143
143
|
* If the filterable is a generator:
|
|
144
144
|
* ```coffeescript [specscript]
|
|
145
|
-
* predicate(
|
|
145
|
+
* predicate(element any) -> condition Promise|boolean|any
|
|
146
146
|
* ```
|
|
147
147
|
*
|
|
148
148
|
* If the filterable is an async generator:
|
|
149
149
|
* ```coffeescript [specscript]
|
|
150
|
-
* predicate(
|
|
150
|
+
* predicate(element any) -> condition Promise|boolean|any
|
|
151
151
|
* ```
|
|
152
152
|
*
|
|
153
153
|
* If the filterable is an object with a `.filter` method, the predicate function signature is defined externally.
|
|
154
154
|
*
|
|
155
155
|
* If the filterable is a plain object:
|
|
156
156
|
* ```coffeescript [specscript]
|
|
157
|
-
* predicate(
|
|
157
|
+
* predicate(element any, key string, filt Object) -> condition Promise|boolean|any
|
|
158
158
|
* ```
|
|
159
159
|
*
|
|
160
160
|
* `filter` works for arrays.
|
package/flatMap.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export = flatMap;
|
|
|
9
9
|
* type Iterable = Iterable|AsyncIterable|Object<value any>
|
|
10
10
|
*
|
|
11
11
|
* type FlatMapper = (
|
|
12
|
-
*
|
|
12
|
+
* element any,
|
|
13
13
|
* indexOrKey string,
|
|
14
14
|
* collection FlatMappable
|
|
15
15
|
* )=>Promise|FlatMappable
|
|
@@ -19,10 +19,10 @@ export = flatMap;
|
|
|
19
19
|
* ```
|
|
20
20
|
*
|
|
21
21
|
* @description
|
|
22
|
-
* Applies a flatMapper function concurrently to each
|
|
22
|
+
* Applies a flatMapper function concurrently to each element of a collection, creating a new collection of the same type. A flatMapping operation iterates through each element of a collection and applies the flatMapper function to each element, flattening the result of the execution into the result collection. The result of an individual execution can be any iterable, async iterable, or object values iterable collection. The flatMapper function may be asynchronous.
|
|
23
23
|
*
|
|
24
|
-
* * `Iterable` - the execution result is iterated and each
|
|
25
|
-
* * `AsyncIterable` - the execution result is asynchronously iterated and each
|
|
24
|
+
* * `Iterable` - the execution result is iterated and each element is added to the result collection
|
|
25
|
+
* * `AsyncIterable` - the execution result is asynchronously iterated and each element is added to the result collection
|
|
26
26
|
* * `Object` - the execution result values are added to the result collection
|
|
27
27
|
*
|
|
28
28
|
* The following example demonstrates various execution results being flattened into the same array.
|
|
@@ -41,7 +41,7 @@ export = flatMap;
|
|
|
41
41
|
* // [1, 1, 2, 3, 3, 5, 5, 8, 7, 7]
|
|
42
42
|
* ```
|
|
43
43
|
*
|
|
44
|
-
* A flatMapping operation concatenates onto the resulting collection synchronous values and muxes any asynchronous values. Muxing, or asynchronously "mixing", is the process of combining multiple asynchronous sources into one source, with order determined by the asynchronous resolution of the individual
|
|
44
|
+
* A flatMapping operation concatenates onto the resulting collection synchronous values and muxes any asynchronous values. Muxing, or asynchronously "mixing", is the process of combining multiple asynchronous sources into one source, with order determined by the asynchronous resolution of the individual elements.
|
|
45
45
|
*
|
|
46
46
|
* ```javascript [playground]
|
|
47
47
|
* const sleep = ms => new Promise(resolve => setTimeout(resolve, ms))
|
|
@@ -67,7 +67,7 @@ export = flatMap;
|
|
|
67
67
|
* // ['foo', 'bar', 'baz', 'foo', 'bar', 'baz', 'foo', 'bar', 'baz']
|
|
68
68
|
* ```
|
|
69
69
|
*
|
|
70
|
-
* For arrays (type `Array`), `flatMap` applies the flatMapper function to each
|
|
70
|
+
* For arrays (type `Array`), `flatMap` applies the flatMapper function to each element, pushing (`.push`) the elements of each execution into a new array.
|
|
71
71
|
*
|
|
72
72
|
* ```javascript [playground]
|
|
73
73
|
* const duplicate = value => [value, value]
|
|
@@ -77,7 +77,7 @@ export = flatMap;
|
|
|
77
77
|
* ) // [1, 1, 2, 2, 3, 3, 4, 4, 5, 5]
|
|
78
78
|
* ```
|
|
79
79
|
*
|
|
80
|
-
* For strings (type `String`), `flatMap` applies the flatMapper function to each character, adding (`+`) the
|
|
80
|
+
* For strings (type `String`), `flatMap` applies the flatMapper function to each character, adding (`+`) the elements of each execution into a new string
|
|
81
81
|
*
|
|
82
82
|
* ```javascript [playground]
|
|
83
83
|
* const duplicate = value => [value, value]
|
|
@@ -87,7 +87,7 @@ export = flatMap;
|
|
|
87
87
|
* ) // 1122334455
|
|
88
88
|
* ```
|
|
89
89
|
*
|
|
90
|
-
* For sets (type `Set`), `flatMap` applies the flatMapper function to each
|
|
90
|
+
* For sets (type `Set`), `flatMap` applies the flatMapper function to each element, adding (`.add`) the elements of each execution into a new set
|
|
91
91
|
*
|
|
92
92
|
* ```javascript [playground]
|
|
93
93
|
* const pairPlus100 = value => [value, value + 100]
|
|
@@ -104,6 +104,6 @@ export = flatMap;
|
|
|
104
104
|
* @archive
|
|
105
105
|
* * For typed arrays (type [`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#typedarray_objects)) and Node.js buffers (type [`Buffer`](https://nodejs.org/api/buffer.html)), `flatMap` applies a flatMapper function to each value of the typed array/buffer, joining the result of each execution with `.set` into the resulting typed array
|
|
106
106
|
*
|
|
107
|
-
* * For Node.js duplex streams (type [Stream](https://nodejs.org/api/stream.html#class-streamduplex)), `flatMap` applies a flatMapper function to each
|
|
107
|
+
* * For Node.js duplex streams (type [Stream](https://nodejs.org/api/stream.html#class-streamduplex)), `flatMap` applies a flatMapper function to each element of the stream, writing (`.write`) each element of each execution into the duplex stream
|
|
108
108
|
*/
|
|
109
109
|
declare function flatMap(...args: any[]): any;
|
package/flatMap.js
CHANGED
|
@@ -20,7 +20,7 @@ const __ = require('./_internal/placeholder')
|
|
|
20
20
|
*
|
|
21
21
|
* _flatMap(
|
|
22
22
|
* m Monad,
|
|
23
|
-
* flatMapper (
|
|
23
|
+
* flatMapper (element any)=>Promise|Iterable,
|
|
24
24
|
* ) -> result Promise|Monad
|
|
25
25
|
* ```
|
|
26
26
|
*/
|
|
@@ -66,22 +66,22 @@ const _flatMap = function (value, flatMapper) {
|
|
|
66
66
|
* ```coffeescript [specscript]
|
|
67
67
|
* type Monad = Array|String|Set|Generator|AsyncGenerator|{ flatMap: string }|{ chain: string }|Object
|
|
68
68
|
*
|
|
69
|
-
* type
|
|
70
|
-
*
|
|
69
|
+
* type SyncOrAsyncFlatMapper = (
|
|
70
|
+
* element any,
|
|
71
71
|
* indexOrKey number|string|any,
|
|
72
72
|
* monad Monad
|
|
73
73
|
* )=>Promise|Monad|any
|
|
74
74
|
*
|
|
75
|
-
* flatMapper
|
|
75
|
+
* flatMapper SyncOrAsyncFlatMapper
|
|
76
76
|
*
|
|
77
77
|
* flatMap(monad Promise|Monad, flatMapper) -> result Promise|Monad
|
|
78
78
|
* flatMap(flatMapper)(monad Monad) -> result Promise|Monad
|
|
79
79
|
* ```
|
|
80
80
|
*
|
|
81
81
|
* @description
|
|
82
|
-
* Applies a flatMapper function to each
|
|
82
|
+
* Applies a flatMapper function to each element of a monad, returning a monad of the same type.
|
|
83
83
|
*
|
|
84
|
-
* A flatMapping operation iterates through each
|
|
84
|
+
* A flatMapping operation iterates through each element of a monad and applies the flatMapper function to each element, flattening the result of the execution into the returned monad.
|
|
85
85
|
*
|
|
86
86
|
* If the flatMapper is asynchronous, it is executed concurrently. The execution result may be asynchronously iterable, in which case it is muxed into the returned monad.
|
|
87
87
|
*
|
|
@@ -111,7 +111,7 @@ const _flatMap = function (value, flatMapper) {
|
|
|
111
111
|
* // [1, 1, 2, 3, 3, 5, 5, 8, 7, 7]
|
|
112
112
|
* ```
|
|
113
113
|
*
|
|
114
|
-
* Values from async generators are muxed. Muxing, or asynchronously "mixing", is the process of combining multiple asynchronous sources into one source, with order determined by the asynchronous resolution of the individual
|
|
114
|
+
* Values from async generators are muxed. Muxing, or asynchronously "mixing", is the process of combining multiple asynchronous sources into one source, with order determined by the asynchronous resolution of the individual elements.
|
|
115
115
|
*
|
|
116
116
|
* ```javascript [playground]
|
|
117
117
|
* const sleep = ms => new Promise(resolve => setTimeout(resolve, ms))
|
|
@@ -137,7 +137,7 @@ const _flatMap = function (value, flatMapper) {
|
|
|
137
137
|
* // ['foo', 'bar', 'baz', 'foo', 'bar', 'baz', 'foo', 'bar', 'baz']
|
|
138
138
|
* ```
|
|
139
139
|
*
|
|
140
|
-
* `flatMap` applies the flatMapper function to each
|
|
140
|
+
* `flatMap` applies the flatMapper function to each element of an array, flattening the results into a new array.
|
|
141
141
|
*
|
|
142
142
|
* ```javascript [playground]
|
|
143
143
|
* const duplicate = value => [value, value]
|
|
@@ -179,7 +179,7 @@ const _flatMap = function (value, flatMapper) {
|
|
|
179
179
|
* @archive
|
|
180
180
|
* * For typed arrays (type [`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#typedarray_objects)) and Node.js buffers (type [`Buffer`](https://nodejs.org/api/buffer.html)), `flatMap` applies a flatMapper function to each value of the typed array/buffer, joining the result of each execution with `.set` into the resulting typed array
|
|
181
181
|
*
|
|
182
|
-
* * For Node.js duplex streams (type [Stream](https://nodejs.org/api/stream.html#class-streamduplex)), `flatMap` applies a flatMapper function to each
|
|
182
|
+
* * For Node.js duplex streams (type [Stream](https://nodejs.org/api/stream.html#class-streamduplex)), `flatMap` applies a flatMapper function to each element of the stream, writing (`.write`) each element of each execution into the duplex stream
|
|
183
183
|
*/
|
|
184
184
|
const flatMap = (arg0, arg1) => {
|
|
185
185
|
if (typeof arg0 == 'function') {
|
package/forEach.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export = forEach;
|
|
|
12
12
|
* ```
|
|
13
13
|
*
|
|
14
14
|
* @description
|
|
15
|
-
* Execute a callback for each
|
|
15
|
+
* Execute a callback for each element of a collection, returning a Promise if the execution is asynchronous.
|
|
16
16
|
*
|
|
17
17
|
* ```javascript [playground]
|
|
18
18
|
* forEach([1, 2, 3, 4, 5l], console.log) // 1 2 3 4 5
|
package/forEach.js
CHANGED
|
@@ -47,19 +47,21 @@ const _forEach = function (collection, callback) {
|
|
|
47
47
|
* ```coffeescript [specscript]
|
|
48
48
|
* type Iterable = Array|Set|Map|Generator|AsyncGenerator|{ forEach: function }|Object
|
|
49
49
|
*
|
|
50
|
-
* type
|
|
51
|
-
*
|
|
50
|
+
* type SyncOrAsyncCallback = (
|
|
51
|
+
* element any,
|
|
52
52
|
* indexOrKey number|string|any,
|
|
53
53
|
* iter Iterable
|
|
54
54
|
* )=>Promise|undefined
|
|
55
55
|
*
|
|
56
|
-
*
|
|
56
|
+
* iterable Iterable
|
|
57
|
+
* cb SyncOrAsyncCallback
|
|
57
58
|
*
|
|
58
|
-
* forEach(cb
|
|
59
|
+
* forEach(iterable, cb) -> unmodifiedIterable Promise|Iterable
|
|
60
|
+
* forEach(cb)(iterable) -> unmodifiedIterable Promise|Iterable
|
|
59
61
|
* ```
|
|
60
62
|
*
|
|
61
63
|
* @description
|
|
62
|
-
* Execute a callback function for each
|
|
64
|
+
* Execute a callback function for each element of an iterable, returning the original iterable unmodified.
|
|
63
65
|
*
|
|
64
66
|
* The following data types are considered to be iterables:
|
|
65
67
|
* * `array`
|
|
@@ -74,34 +76,34 @@ const _forEach = function (collection, callback) {
|
|
|
74
76
|
*
|
|
75
77
|
* If the iterable is an array:
|
|
76
78
|
* ```coffeescript [specscript]
|
|
77
|
-
* callback(
|
|
79
|
+
* callback(element any, index number, iter Array) -> Promise|undefined
|
|
78
80
|
* ```
|
|
79
81
|
*
|
|
80
82
|
* If the iterable is a set:
|
|
81
83
|
* ```coffeescript [specscript]
|
|
82
|
-
* callback(
|
|
84
|
+
* callback(element any, key any, iter Set) -> Promise|undefined
|
|
83
85
|
* ```
|
|
84
86
|
*
|
|
85
87
|
* If the iterable is a map:
|
|
86
88
|
* ```coffeescript [specscript]
|
|
87
|
-
* callback(
|
|
89
|
+
* callback(element any, key any, filt Map) -> Promise|undefined
|
|
88
90
|
* ```
|
|
89
91
|
*
|
|
90
92
|
* If the iterable is a generator:
|
|
91
93
|
* ```coffeescript [specscript]
|
|
92
|
-
* callback(
|
|
94
|
+
* callback(element any) -> Promise|undefined
|
|
93
95
|
* ```
|
|
94
96
|
*
|
|
95
97
|
* If the iterable is an async generator:
|
|
96
98
|
* ```coffeescript [specscript]
|
|
97
|
-
* callback(
|
|
99
|
+
* callback(element any) -> Promise|undefined
|
|
98
100
|
* ```
|
|
99
101
|
*
|
|
100
102
|
* If the iterable is an object with a `.forEach` method, the callback function signature is defined externally.
|
|
101
103
|
*
|
|
102
104
|
* If the iterable is a plain object:
|
|
103
105
|
* ```coffeescript [specscript]
|
|
104
|
-
* callback(
|
|
106
|
+
* callback(element any, key string, iter Object) -> Promise|undefined
|
|
105
107
|
* ```
|
|
106
108
|
*
|
|
107
109
|
* If the callback function is asynchronous, it is executed concurrently.
|
|
@@ -200,15 +202,17 @@ const _forEachSeries = function (collection, callback) {
|
|
|
200
202
|
* ```coffeescript [specscript]
|
|
201
203
|
* type Iterable = Array|Set|Map|Generator|AsyncGenerator|{ forEach: function }|Object
|
|
202
204
|
*
|
|
203
|
-
* type
|
|
204
|
-
*
|
|
205
|
+
* type SyncOrAsyncCallback = (
|
|
206
|
+
* element any,
|
|
205
207
|
* indexOrKey number|string|any,
|
|
206
208
|
* iter Iterable
|
|
207
209
|
* )=>Promise|undefined
|
|
208
210
|
*
|
|
209
|
-
*
|
|
211
|
+
* iterable Iterable
|
|
212
|
+
* cb SyncOrAsyncCallback
|
|
210
213
|
*
|
|
211
|
-
* forEach(cb
|
|
214
|
+
* forEach(iterable, cb) -> unmodifiedIterable Promise|Iterable
|
|
215
|
+
* forEach(cb)(iterable) -> unmodifiedIterable Promise|Iterable
|
|
212
216
|
* ```
|
|
213
217
|
*
|
|
214
218
|
* @description
|
package/global.js
CHANGED
package/gt.js
CHANGED
|
@@ -6,20 +6,27 @@ const greaterThan = require('./_internal/greaterThan')
|
|
|
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
|
+
* gt(leftValue, rightValue) -> Promise|boolean
|
|
20
|
+
* gt(...argsOrPromises, leftResolver, rightValue) -> Promise|boolean
|
|
21
|
+
* gt(...argsOrPromises, leftValue, rightResolver) -> Promise|boolean
|
|
22
|
+
* gt(...argsOrPromises, leftResolver, rightResolver) -> Promise|boolean
|
|
23
|
+
* gt(leftResolver, rightValue)(...args) -> Promise|boolean
|
|
24
|
+
* gt(leftValue, rightResolver)(...args) -> Promise|boolean
|
|
25
|
+
* gt(leftResolver, rightResolver)(...args) -> Promise|boolean
|
|
19
26
|
* ```
|
|
20
27
|
*
|
|
21
28
|
* @description
|
|
22
|
-
*
|
|
29
|
+
* Functional equivalent of the [Greater than (>)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Greater_than) operator. Tests if a value is greater than (`>`) another value.
|
|
23
30
|
*
|
|
24
31
|
* ```javascript [playground]
|
|
25
32
|
* const age = 40
|
|
@@ -29,16 +36,26 @@ const greaterThan = require('./_internal/greaterThan')
|
|
|
29
36
|
* console.log(isAgeGreaterThan21) // true
|
|
30
37
|
* ```
|
|
31
38
|
*
|
|
32
|
-
* If either of the two values are resolver functions, `gt` returns a function that resolves the
|
|
39
|
+
* If either of the two values are resolver functions, `gt` returns a function that resolves the value(s) to compare.
|
|
33
40
|
*
|
|
34
41
|
* ```javascript [playground]
|
|
35
|
-
* const isOfLegalAge = gt(
|
|
42
|
+
* const isOfLegalAge = gt(get('age'), 21)
|
|
36
43
|
*
|
|
37
44
|
* const juvenile = { age: 16 }
|
|
38
45
|
*
|
|
39
46
|
* console.log(isOfLegalAge(juvenile)) // false
|
|
40
47
|
* ```
|
|
41
48
|
*
|
|
49
|
+
* If either of the resolver functions is asynchronous, `gt` returns an asynchronous function.
|
|
50
|
+
*
|
|
51
|
+
* ```javascript [playground]
|
|
52
|
+
* const asyncIsOfLegalAge = gt(async person => person.age, 21)
|
|
53
|
+
*
|
|
54
|
+
* const juvenile = { age: 16 }
|
|
55
|
+
*
|
|
56
|
+
* asyncIsOfLegalAge(juvenile).then(console.log) // false
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
42
59
|
* `gt` supports a lazy API for composability.
|
|
43
60
|
*
|
|
44
61
|
* ```javascript [playground]
|
package/gte.js
CHANGED
|
@@ -6,20 +6,27 @@ const greaterThanOrEqual = require('./_internal/greaterThanOrEqual')
|
|
|
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
|
+
* gte(leftValue, rightValue) -> Promise|boolean
|
|
20
|
+
* gte(...argsOrPromises, leftResolver, rightValue) -> Promise|boolean
|
|
21
|
+
* gte(...argsOrPromises, leftValue, rightResolver) -> Promise|boolean
|
|
22
|
+
* gte(...argsOrPromises, leftResolver, rightResolver) -> Promise|boolean
|
|
23
|
+
* gte(leftResolver, rightValue)(...args) -> Promise|boolean
|
|
24
|
+
* gte(leftValue, rightResolver)(...args) -> Promise|boolean
|
|
25
|
+
* gte(leftResolver, rightResolver)(...args) -> Promise|boolean
|
|
19
26
|
* ```
|
|
20
27
|
*
|
|
21
28
|
* @description
|
|
22
|
-
*
|
|
29
|
+
* Functional equivalent of the [Greater than or equal (>=)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Greater_than_or_equal) operator. Tests if a value is greater than or equal (`>=`) to another value.
|
|
23
30
|
*
|
|
24
31
|
* ```javascript [playground]
|
|
25
32
|
* const age = 20
|
|
@@ -29,7 +36,7 @@ const greaterThanOrEqual = require('./_internal/greaterThanOrEqual')
|
|
|
29
36
|
* console.log(isAdultAge) // true
|
|
30
37
|
* ```
|
|
31
38
|
*
|
|
32
|
-
* If either of the two values are resolver functions, `gte` returns a function that resolves the
|
|
39
|
+
* If either of the two values are resolver functions, `gte` returns a function that resolves the value(s) to compare.
|
|
33
40
|
*
|
|
34
41
|
* ```javascript [playground]
|
|
35
42
|
* const identity = value => value
|
|
@@ -41,6 +48,18 @@ const greaterThanOrEqual = require('./_internal/greaterThanOrEqual')
|
|
|
41
48
|
* console.log(isAtLeast100(101)) // true
|
|
42
49
|
* ```
|
|
43
50
|
*
|
|
51
|
+
* If either of the two resolver functions is asynchronous, `gte` returns an asynchronous function.
|
|
52
|
+
*
|
|
53
|
+
* ```javascript [playground]
|
|
54
|
+
* const asyncIdentity = async value => value
|
|
55
|
+
*
|
|
56
|
+
* const asyncIsAtLeast100 = gte(asyncIdentity, 100)
|
|
57
|
+
*
|
|
58
|
+
* asyncIsAtLeast100(99).then(console.log) // false
|
|
59
|
+
* asyncIsAtLeast100(100).then(console.log) // true
|
|
60
|
+
* asyncIsAtLeast100(101).then(console.log) // true
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
44
63
|
* `gte` supports a lazy API for composability.
|
|
45
64
|
*
|
|
46
65
|
* ```javascript [playground]
|