rubico 2.1.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/_internal/genericTransform.js +30 -28
- 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 +57 -46
- package/dist/rubico.es.min.js +2 -2
- package/dist/rubico.global.js +57 -46
- package/dist/rubico.global.min.js +2 -2
- package/dist/rubico.js +57 -46
- package/dist/rubico.min.js +2 -2
- package/dist/rubico.mjs +57 -46
- 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 +32 -2
- package/dist/tap.es.min.js +2 -2
- package/dist/tap.js +32 -2
- package/dist/tap.min.js +2 -2
- package/dist/tap.mjs +32 -2
- 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 +26 -24
- package/dist/transform.es.min.js +2 -2
- package/dist/transform.js +26 -24
- package/dist/transform.min.js +2 -2
- package/dist/transform.mjs +26 -24
- 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 +32 -2
- package/dist/x/trace.es.min.js +2 -2
- package/dist/x/trace.js +32 -2
- package/dist/x/trace.min.js +2 -2
- package/dist/x/trace.mjs +32 -2
- 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 +57 -46
- package/index.js +57 -46
- package/package.json +43 -2
- package/tap.js +15 -4
- package/.eslintignore +0 -5
- package/.eslintrc.js +0 -330
- package/.github/workflows/nodejs.yml +0 -27
- package/.vscode/launch.json +0 -25
- package/AggregateReducer.test.js +0 -82
- package/CHANGELOG.md +0 -310
- package/CNAME +0 -1
- package/CODE_OF_CONDUCT.md +0 -128
- package/CONTRIBUTING.md +0 -4
- package/Transducer.test.js +0 -154
- package/_config.yml +0 -1
- package/_internal/improvedGenericTransform.js +0 -93
- package/archive/FlatMappingIterator-2020-09-28.js +0 -68
- package/archive/_Promise-2023-05-29.js +0 -93
- package/archive/arrayMap2-2023-05-29.js +0 -73
- package/archive/benchmarks-v1.9.7/all.js +0 -34
- package/archive/benchmarks-v1.9.7/and.js +0 -24
- package/archive/benchmarks-v1.9.7/any.js +0 -32
- package/archive/benchmarks-v1.9.7/assign.js +0 -174
- package/archive/benchmarks-v1.9.7/curry.js +0 -55
- package/archive/benchmarks-v1.9.7/eq.js +0 -25
- package/archive/benchmarks-v1.9.7/filter.js +0 -1322
- package/archive/benchmarks-v1.9.7/flatMap.js +0 -48
- package/archive/benchmarks-v1.9.7/forEach.js +0 -33
- package/archive/benchmarks-v1.9.7/fork.js +0 -123
- package/archive/benchmarks-v1.9.7/get.js +0 -44
- package/archive/benchmarks-v1.9.7/gt.js +0 -25
- package/archive/benchmarks-v1.9.7/gte.js +0 -25
- package/archive/benchmarks-v1.9.7/integration.js +0 -88
- package/archive/benchmarks-v1.9.7/lt.js +0 -25
- package/archive/benchmarks-v1.9.7/lte.js +0 -25
- package/archive/benchmarks-v1.9.7/map.js +0 -892
- package/archive/benchmarks-v1.9.7/misc.js +0 -470
- package/archive/benchmarks-v1.9.7/omit.js +0 -28
- package/archive/benchmarks-v1.9.7/or.js +0 -51
- package/archive/benchmarks-v1.9.7/pick.js +0 -24
- package/archive/benchmarks-v1.9.7/pipe.js +0 -152
- package/archive/benchmarks-v1.9.7/reduce.js +0 -739
- package/archive/benchmarks-v1.9.7/switchCase.js +0 -256
- package/archive/benchmarks-v1.9.7/tap.js +0 -90
- package/archive/benchmarks-v1.9.7/transform.js +0 -218
- package/archive/benchmarks-v1.9.7/tryCatch.js +0 -108
- package/archive/curry.js +0 -13
- package/archive/examples-v1.6.11/browserModule.html +0 -31
- package/archive/examples-v1.6.11/browserScript.html +0 -32
- package/archive/examples-v1.6.11/coolTransformToConsole.js +0 -1
- package/archive/examples-v1.6.11/denoLargeGasMap.js +0 -85
- package/archive/examples-v1.6.11/denoServer.js +0 -9
- package/archive/examples-v1.6.11/denoServerWithMiddleware.js +0 -55
- package/archive/examples-v1.6.11/logTodosRange.js +0 -21
- package/archive/examples-v1.6.11/makeARequest.html +0 -46
- package/archive/examples-v1.6.11/nodeComplexTransformation.js +0 -106
- package/archive/examples-v1.6.11/nodeConditionallyExtractIDs.js +0 -50
- package/archive/examples-v1.6.11/nodeFloatingPoint.js +0 -55
- package/archive/examples-v1.6.11/nodeGetAllJiraBoards.js +0 -45
- package/archive/examples-v1.6.11/nodeGetSocketIOClientsTotalCount.js +0 -34
- package/archive/examples-v1.6.11/nodeKafkaConsumer.js +0 -63
- package/archive/examples-v1.6.11/nodeMakeMultipleRequests.js +0 -55
- package/archive/examples-v1.6.11/nodeOnRecordAddTask.js +0 -34
- package/archive/examples-v1.6.11/nodePostRequestWithAuth.js +0 -36
- package/archive/examples-v1.6.11/nodeSpeedbackMatchmakingAlgorithm.js +0 -96
- package/archive/examples-v1.6.11/nodeTireData.js +0 -36
- package/archive/examples-v1.6.11/nodeTripleMap.js +0 -85
- package/archive/examples-v1.6.11/squaredOdds.ts +0 -16
- package/archive/examples-v1.6.11/transducerMaxBuyer.js +0 -67
- package/archive/examples-v1.6.11/transformLogTodosRange.js +0 -31
- package/archive/examples-v1.6.11/transformStreamRandomInts.js +0 -19
- package/archive/genericReduceConcurrent.js +0 -277
- package/archive/index.v0.2.9.js +0 -1685
- package/archive/objectValuesGenerator.js +0 -13
- package/archive/test.v0.2.9.js +0 -2334
- package/bench +0 -65
- package/benchmark-output/v1.9.7 +0 -268
- package/benchmarks/all.async.js +0 -43
- package/benchmarks/all.js +0 -43
- package/benchmarks/always.js +0 -15
- package/benchmarks/and.async.js +0 -25
- package/benchmarks/and.js +0 -25
- package/benchmarks/assign.async.js +0 -27
- package/benchmarks/assign.js +0 -27
- package/benchmarks/curry.js +0 -35
- package/benchmarks/eq.async.js +0 -23
- package/benchmarks/eq.js +0 -23
- package/benchmarks/every.async.js +0 -19
- package/benchmarks/every.js +0 -19
- package/benchmarks/filter.async.js +0 -32
- package/benchmarks/filter.js +0 -38
- package/benchmarks/flatMap.async.js +0 -26
- package/benchmarks/flatMap.js +0 -38
- package/benchmarks/get.async.js +0 -19
- package/benchmarks/get.js +0 -39
- package/benchmarks/gt.async.js +0 -23
- package/benchmarks/gt.js +0 -23
- package/benchmarks/gte.async.js +0 -23
- package/benchmarks/gte.js +0 -23
- package/benchmarks/lt.async.js +0 -23
- package/benchmarks/lt.js +0 -23
- package/benchmarks/lte.async.js +0 -23
- package/benchmarks/lte.js +0 -23
- package/benchmarks/map.async.js +0 -43
- package/benchmarks/map.js +0 -40
- package/benchmarks/misc/Promise.js +0 -26
- package/benchmarks/misc/isPromise.js +0 -30
- package/benchmarks/misc/promiseAll.js +0 -36
- package/benchmarks/not.js +0 -23
- package/benchmarks/omit.js +0 -38
- package/benchmarks/or.async.js +0 -25
- package/benchmarks/or.js +0 -25
- package/benchmarks/pick.js +0 -38
- package/benchmarks/pipe.async.js +0 -47
- package/benchmarks/pipe.js +0 -47
- package/benchmarks/reduce.async.js +0 -32
- package/benchmarks/reduce.js +0 -38
- package/benchmarks/set.async.js +0 -19
- package/benchmarks/set.js +0 -41
- package/benchmarks/some.async.js +0 -19
- package/benchmarks/some.js +0 -19
- package/benchmarks/switchCase.async.js +0 -27
- package/benchmarks/switchCase.js +0 -55
- package/benchmarks/tap.js +0 -15
- package/benchmarks/thunkify.js +0 -15
- package/benchmarks/transform.async.js +0 -27
- package/benchmarks/transform.js +0 -40
- package/benchmarks/tryCatch.async.js +0 -25
- package/benchmarks/tryCatch.js +0 -32
- package/build +0 -472
- package/dist-test.js +0 -37
- package/examples/type-to-search-wiki/README.md +0 -19
- package/examples/type-to-search-wiki/package.json +0 -13
- package/examples/type-to-search-wiki/src/app.js +0 -46
- package/examples/type-to-search-wiki/src/index.html +0 -18
- package/import-test.html +0 -73
- package/memory-usage/reduce.js +0 -40
- package/monad/AsyncPool.js +0 -0
- package/monad/BrokenPromise.js +0 -63
- package/monad/BrokenPromise.test.js +0 -22
- package/monad/Cancellable.js +0 -84
- package/monad/Cancellable.memoryUsage.js +0 -60
- package/monad/Cancellable.test.js +0 -20
- package/monad/Function.js +0 -0
- package/monad/Instance.benchmark.js +0 -378
- package/monad/Instance.js +0 -351
- package/monad/Instance.test.js +0 -445
- package/monad/Mux.benchmark.js +0 -29
- package/monad/Mux.js +0 -589
- package/monad/Mux.test.js +0 -512
- package/monad/PossiblePromise.benchmark.js +0 -87
- package/monad/PossiblePromise.js +0 -144
- package/monad/PossiblePromise.test.js +0 -89
- package/monad/README.md +0 -75
- package/monad/Reducer.js +0 -0
- package/monad/Sequence.benchmark.js +0 -42
- package/monad/Sequence.js +0 -36
- package/monad/SpecScript.js +0 -0
- package/monad/Stack.js +0 -0
- package/monad/Struct.benchmark.js +0 -154
- package/monad/Struct.js +0 -249
- package/monad/Struct.test.js +0 -237
- package/rubico.js +0 -66
- package/test.js +0 -4242
- package/tmp.js +0 -1
package/CHANGELOG.md
DELETED
|
@@ -1,310 +0,0 @@
|
|
|
1
|
-
## v2.0.0
|
|
2
|
-
* Refactor all transducer functionality into Transducer.js from `pipe`, `map`, `filter`, and `flatMap`
|
|
3
|
-
* Remove GeneratorFunction and AsyncGeneratorFunction functionality in `map`, `filter`, `flatMap`, and `reduce`
|
|
4
|
-
* Refactor reducer chaining functionality into AggregateReducer.js from `reduce`
|
|
5
|
-
* Remove Duplex stream handling from `flatMap`
|
|
6
|
-
* Remove binary handling from `flatMap`
|
|
7
|
-
* Promises as arguments for all core functions
|
|
8
|
-
* Eager API for all core functions
|
|
9
|
-
* Automate benchmarks
|
|
10
|
-
* Remove the .sync property functions
|
|
11
|
-
* Remove the .withIndex property functions
|
|
12
|
-
* Deprecate map.own
|
|
13
|
-
* `fork` renamed to `all`
|
|
14
|
-
* `all` renamed to `every`
|
|
15
|
-
* `any` renamed to `some`
|
|
16
|
-
* new `dist-test` only validates syntax with `require`
|
|
17
|
-
* migrate `forEach` into core API.
|
|
18
|
-
* refactor transducer functionality from `forEach` into `Transducer.forEach`
|
|
19
|
-
* async performance improvements
|
|
20
|
-
* `_internal/arrayExtend` stops treating strings like arrays so `transform` creates arrays of strings as expected
|
|
21
|
-
|
|
22
|
-
## v1.9.3
|
|
23
|
-
* property value passed to set may be a resolver - [#224](https://github.com/a-synchronous/rubico/pull/224)
|
|
24
|
-
* rubico/x/isIn - counterpart to includes - [#228](https://github.com/a-synchronous/rubico/pull/228) - [lulldev](https://github.com/lulldev)
|
|
25
|
-
* rubico/x/maxBy - finds the item that is the max by a property denoted by path - [#229](https://github.com/a-synchronous/rubico/pull/229)
|
|
26
|
-
* eager map - [#225](https://github.com/a-synchronous/rubico/pull/225)
|
|
27
|
-
* eager filter - [#226](https://github.com/a-synchronous/rubico/pull/226)
|
|
28
|
-
* eager reduce - [#227](https://github.com/a-synchronous/rubico/pull/227)
|
|
29
|
-
|
|
30
|
-
## v1.9.2
|
|
31
|
-
* eager tryCatch - [#222](https://github.com/a-synchronous/rubico/pull/218)
|
|
32
|
-
|
|
33
|
-
## v1.9.1
|
|
34
|
-
* more performant uniq - [#218](https://github.com/a-synchronous/rubico/pull/218) - [jasir](https://github.com/jasir)
|
|
35
|
-
* and and or handle nonfunction values - [#221](https://github.com/a-synchronous/rubico/pull/221)
|
|
36
|
-
|
|
37
|
-
## v1.9.0
|
|
38
|
-
* switchCase handles non-function values - [#220](https://github.com/a-synchronous/rubico/pull/220)
|
|
39
|
-
|
|
40
|
-
## v1.8.15
|
|
41
|
-
* eager pipe - [#219](https://github.com/a-synchronous/rubico/pull/219)
|
|
42
|
-
|
|
43
|
-
## v1.8.12
|
|
44
|
-
* new example [type-to-search-wiki](https://github.com/a-synchronous/rubico/tree/master/examples/type-to-search-wiki) - [#210](https://github.com/a-synchronous/rubico/pull/210) - [lulldev](https://github.com/lulldev)
|
|
45
|
-
* require('rubico/global') imports the core rubico methods globally
|
|
46
|
-
|
|
47
|
-
## v1.8.11
|
|
48
|
-
* eq, gt, gte, lt, lte should return a boolean when both arguments are values (not functions) - [#203](https://github.com/a-synchronous/rubico/pull/203) - [lulldev](https://github.com/lulldev)
|
|
49
|
-
* not behaves like ! when passed a value (not function) - [#204](https://github.com/a-synchronous/rubico/pull/211)
|
|
50
|
-
|
|
51
|
-
## v1.8.10
|
|
52
|
-
* Mux.race - yield value after adding promise versus yielding before
|
|
53
|
-
* isDeepEqual takes functions as arguments, returning a partially applied function
|
|
54
|
-
* rubico/x/filterOut - the inverse of filter
|
|
55
|
-
|
|
56
|
-
## v1.8.9
|
|
57
|
-
* FlatMappingAsyncIterator account for indefinite buffer loading promises
|
|
58
|
-
|
|
59
|
-
## v1.8.8
|
|
60
|
-
* FlatMappingAsyncIterator don't await if async iterator is done already
|
|
61
|
-
|
|
62
|
-
## v1.8.7
|
|
63
|
-
* FlatMappingAsyncIterator use Promise.race over promiseAnyRejectOnce
|
|
64
|
-
|
|
65
|
-
## v1.8.6
|
|
66
|
-
* fix bug where FlatMappingAsyncIterator wasn't fully consuming the input async iterator
|
|
67
|
-
|
|
68
|
-
## v1.8.5
|
|
69
|
-
* fix bug where map and filter weren't recognizing async iterator and iterator objects
|
|
70
|
-
|
|
71
|
-
## v1.8.3
|
|
72
|
-
* distribute rest of the functions with .mjs extension as ESM
|
|
73
|
-
|
|
74
|
-
## v1.8.2
|
|
75
|
-
* distribute rubico.mjs and rubico.min.mjs as ESM
|
|
76
|
-
|
|
77
|
-
## v1.8.1
|
|
78
|
-
* map supplies key and reference to original value for sets
|
|
79
|
-
* filter supplies key and reference to original value for sets
|
|
80
|
-
|
|
81
|
-
## v1.8.0
|
|
82
|
-
* map supplies index/key and reference to original value for arrays, objects, and maps
|
|
83
|
-
* filter supplies index/key and reference to original value for arrays, objects, and maps
|
|
84
|
-
* reduce supplies index/key and reference to original value for arrays, objects, and maps
|
|
85
|
-
* reduce object performance improvements
|
|
86
|
-
|
|
87
|
-
## v1.7.3
|
|
88
|
-
* x/append - [#190](https://github.com/a-synchronous/rubico/pull/190/files) - [FredericHeem](https://github.com/FredericHeem)
|
|
89
|
-
* x/prepend - [#190](https://github.com/a-synchronous/rubico/pull/190/files) - [FredericHeem](https://github.com/FredericHeem)
|
|
90
|
-
* x/unless - [#190](https://github.com/a-synchronous/rubico/pull/190/files) - [FredericHeem](https://github.com/FredericHeem)
|
|
91
|
-
|
|
92
|
-
## v1.7.2
|
|
93
|
-
* fix syntax error on nullish defaultItem in defaultsDeep - [#189](https://github.com/a-synchronous/rubico/pull/189/files) - [FredericHeem](https://github.com/FredericHeem)
|
|
94
|
-
|
|
95
|
-
## v1.7.1
|
|
96
|
-
* x/when [#188](https://github.com/a-synchronous/rubico/pull/188) - [FredericHeem](https://github.com/FredericHeem)
|
|
97
|
-
|
|
98
|
-
## v1.7.0
|
|
99
|
-
* set and pick nested properties [#187](https://github.com/a-synchronous/rubico/pull/187) - [FredericHeem](https://github.com/FredericHeem)
|
|
100
|
-
|
|
101
|
-
## v1.6.30
|
|
102
|
-
* defaultsDeep handle undefined [#186](https://github.com/a-synchronous/rubico/pull/186) - [FredericHeem](https://github.com/FredericHeem)
|
|
103
|
-
|
|
104
|
-
## v1.6.29
|
|
105
|
-
* fix syntax issue with map filter iterators and async iterators
|
|
106
|
-
|
|
107
|
-
## v1.6.28
|
|
108
|
-
* stop supporting node 10
|
|
109
|
-
|
|
110
|
-
## v1.6.22
|
|
111
|
-
* x/callProp
|
|
112
|
-
|
|
113
|
-
## v1.6.17
|
|
114
|
-
* x/has
|
|
115
|
-
* x/includes
|
|
116
|
-
|
|
117
|
-
## v1.6.16
|
|
118
|
-
* fix omit throwing on nullish
|
|
119
|
-
|
|
120
|
-
## v1.6.15
|
|
121
|
-
* omit supports nested fields [#181](https://github.com/a-synchronous/rubico/pull/181)
|
|
122
|
-
|
|
123
|
-
## v1.6.13
|
|
124
|
-
* map.entries
|
|
125
|
-
* License (MIT) and Chat (Gitter) readme badges
|
|
126
|
-
* fix x/trace altering output
|
|
127
|
-
* patch transform - strings and binary correspond 1 character = 1 byte
|
|
128
|
-
* patch internal/binaryExtend - construct Buffers as per Node.js warning
|
|
129
|
-
|
|
130
|
-
## v1.6.11
|
|
131
|
-
* fix: tap.if handles promises in its executor
|
|
132
|
-
|
|
133
|
-
## v1.6.10
|
|
134
|
-
* and defers to `.and` if method is present
|
|
135
|
-
* or defers to `.or` if method is present
|
|
136
|
-
* not defers to `.not` if method is present
|
|
137
|
-
* eq defers to `.eq` if method is present
|
|
138
|
-
* gt defers to `.gt` if method is present
|
|
139
|
-
* lt defers to `.lt` if method is present
|
|
140
|
-
* gte defers to `.gte` if method is present
|
|
141
|
-
* lte defers to `.lte` if method is present
|
|
142
|
-
* eq compares by SameValueZero
|
|
143
|
-
* isDeepEqual compares by SameValueZero
|
|
144
|
-
* isObject checks for language type Object
|
|
145
|
-
|
|
146
|
-
## v1.6.9 - latest
|
|
147
|
-
* x/groupBy
|
|
148
|
-
* x/values
|
|
149
|
-
|
|
150
|
-
## v1.6.8
|
|
151
|
-
* fix: assign creates a new object on Promise
|
|
152
|
-
|
|
153
|
-
## v1.6.6
|
|
154
|
-
* new distribution setup
|
|
155
|
-
* x/differenceWith
|
|
156
|
-
|
|
157
|
-
## v1.6.0
|
|
158
|
-
* curry
|
|
159
|
-
* __
|
|
160
|
-
* thunkify
|
|
161
|
-
* always
|
|
162
|
-
* project structure reorganization around `_internal/`
|
|
163
|
-
* new generated documentation format
|
|
164
|
-
* x/size rewrite + refresh benchmarks
|
|
165
|
-
* x/find works on all foldables
|
|
166
|
-
* x/forEach rewrite + benchmarks
|
|
167
|
-
* x/defaultsDeep rewrite + refresh benchmarks
|
|
168
|
-
* x/flatten rewrite + refresh benchmarks
|
|
169
|
-
* x/isDeepEqual rewrite + refresh benchmarks
|
|
170
|
-
* x/unionWith rewrite + refresh benchmarks
|
|
171
|
-
* better pipe performance
|
|
172
|
-
* fix: x/isDeepEqual was throwing for nullish
|
|
173
|
-
* **map.own** - [LMulvey](https://github.com/LMulvey)
|
|
174
|
-
|
|
175
|
-
## v1.5.19 - latest
|
|
176
|
-
* pipe.sync
|
|
177
|
-
|
|
178
|
-
## v1.5.18
|
|
179
|
-
* fix: Set and Map mapping
|
|
180
|
-
|
|
181
|
-
## v1.5.17
|
|
182
|
-
* fix: string mapping
|
|
183
|
-
|
|
184
|
-
## v1.5.16
|
|
185
|
-
* tap.if
|
|
186
|
-
|
|
187
|
-
## v1.5.15
|
|
188
|
-
* get rewrite + benchmarks
|
|
189
|
-
* pick rewrite + benchmarks
|
|
190
|
-
* omit rewrite + benchmarks
|
|
191
|
-
* not rewrite + benchmarks
|
|
192
|
-
* any rewrite + benchmarks
|
|
193
|
-
* all rewrite + benchmarks
|
|
194
|
-
* and rewrite + benchmarks
|
|
195
|
-
* or rewrite + benchmarks
|
|
196
|
-
* eq rewrite + benchmarks
|
|
197
|
-
* gt rewrite + benchmarks
|
|
198
|
-
* lt rewrite + benchmarks
|
|
199
|
-
* gte rewrite + benchmarks
|
|
200
|
-
* lte rewrite + benchmarks
|
|
201
|
-
|
|
202
|
-
## v1.5.14
|
|
203
|
-
* fix: flatMap async muxing
|
|
204
|
-
|
|
205
|
-
## v1.5.13
|
|
206
|
-
* flatMap rewrite + benchmarks
|
|
207
|
-
* improved tryCatch performance
|
|
208
|
-
* improved switchCase performance
|
|
209
|
-
|
|
210
|
-
## v1.5.12
|
|
211
|
-
* transform rewrite + benchmarks
|
|
212
|
-
|
|
213
|
-
## v1.5.11
|
|
214
|
-
* x/heapUsedInLoop - max and avg heap used in loop
|
|
215
|
-
* monad/Cancellable - make a function return cancellable Promises
|
|
216
|
-
* deprecated x/tracef
|
|
217
|
-
* x/trace(reducer) - lazy trace, good for adding custom formatting
|
|
218
|
-
* reduce rewrite + benchmarks
|
|
219
|
-
* tap accepts multiple arguments + more benchmarks
|
|
220
|
-
|
|
221
|
-
## v1.5.10
|
|
222
|
-
* filter.withIndex rewrite + benchmarks
|
|
223
|
-
* monad/BrokenPromise - a Promise that never comes back
|
|
224
|
-
* isEmpty stops throwing TypeErrors
|
|
225
|
-
|
|
226
|
-
## v1.5.9
|
|
227
|
-
* filter rewrite + benchmarks
|
|
228
|
-
* map.series rewrite + benchmarks
|
|
229
|
-
* map.pool rewrite + benchmarks
|
|
230
|
-
* map.withIndex rewrite + benchmarks
|
|
231
|
-
|
|
232
|
-
## v1.5.8
|
|
233
|
-
* fix a failing test; node10 AsyncIterator constructors were Objects
|
|
234
|
-
|
|
235
|
-
## v1.5.7
|
|
236
|
-
* map rewrite + benchmarks
|
|
237
|
-
|
|
238
|
-
## v1.5.6
|
|
239
|
-
* fork rewrite + benchmarks
|
|
240
|
-
* fork.series rewrite + benchmarks
|
|
241
|
-
* assign rewrite + benchmarks
|
|
242
|
-
* tap rewrite + benchmarks
|
|
243
|
-
* tryCatch rewrite + benchmarks
|
|
244
|
-
* switchCase rewrite + benchmarks
|
|
245
|
-
* switchCase supports even numbers of functions
|
|
246
|
-
|
|
247
|
-
## v1.5.5
|
|
248
|
-
* pipe rewrite + benchmarks
|
|
249
|
-
|
|
250
|
-
## v1.5.3
|
|
251
|
-
* x/uniq - export in x/index
|
|
252
|
-
|
|
253
|
-
## v1.5.2
|
|
254
|
-
* x/unionWith performance revamp + benchmarks
|
|
255
|
-
* x/uniq - Get unique values of a collection - [FredericHeem](https://github.com/FredericHeem)
|
|
256
|
-
|
|
257
|
-
## v1.5.0
|
|
258
|
-
* monad/PossiblePromise - Possibly a promise
|
|
259
|
-
* monad/Instance - Type checking
|
|
260
|
-
* monad/Struct - Finite data structure
|
|
261
|
-
* monad/Mux - Multiplexing for Sequences of Sequences
|
|
262
|
-
* x/size - Get the size of a collection
|
|
263
|
-
* x/isFunction - Tell if Function
|
|
264
|
-
* x/timeInLoop.async - Like timeInLoop, but await all calls
|
|
265
|
-
* x/find performance revamp + benchmarks
|
|
266
|
-
* x/defaultsDeep performance revamp + benchmarks
|
|
267
|
-
* x/flatten performance revamp + benchmarks
|
|
268
|
-
* x/isDeepEqual performance revamp + benchmarks
|
|
269
|
-
* x/isEmpty performance revamp + benchmarks
|
|
270
|
-
* x/isEqual performance revamp + benchmarks
|
|
271
|
-
* x/isObject performance revamp + benchmarks
|
|
272
|
-
* x/isString performance revamp + benchmarks
|
|
273
|
-
* x/first performance revamp + benchmarks
|
|
274
|
-
* x/last performance revamp + benchmarks
|
|
275
|
-
* improve PossiblePromise.args stack trace
|
|
276
|
-
* fine tune PossiblePromise performance
|
|
277
|
-
* fine tune core performance
|
|
278
|
-
|
|
279
|
-
## v1.3.2
|
|
280
|
-
* x/defaultsDeep - enforce Array or Object inputs
|
|
281
|
-
|
|
282
|
-
## v1.3.0
|
|
283
|
-
* large rubico core refactor (~75% done) to PossiblePromise
|
|
284
|
-
* large rubico core documentation initiative (~75% done)
|
|
285
|
-
* rubico/x/index.js for comfier times with rubico/x
|
|
286
|
-
* benchmark groundwork (and, or, and switchCase)
|
|
287
|
-
* x/timeInLoop - measures time a function takes in a loop
|
|
288
|
-
* flatMap includes unflattenable elements instead of throwing
|
|
289
|
-
|
|
290
|
-
## v1.2.5
|
|
291
|
-
* tap no longer transduces; use map(tap) or x/forEach instead if you want to use tap in a transducer
|
|
292
|
-
|
|
293
|
-
## v1.2.2
|
|
294
|
-
* x/isEmpty - check if a collection is empty
|
|
295
|
-
* x/first - get first item from a collection
|
|
296
|
-
* x/last - get last item from a collection
|
|
297
|
-
|
|
298
|
-
## v1.2.0
|
|
299
|
-
* flatMap; map + flatten
|
|
300
|
-
* transform(f, init), reduce(f, init); init can be a function
|
|
301
|
-
* x/defaultsDeep - deeply assign defaults
|
|
302
|
-
* x/isDeepEqual - left deeply equals right? eager version of eq.deep
|
|
303
|
-
* x/find - get the first item in a collection that passes the test
|
|
304
|
-
* x/forEach - execute a function for each item of a collection, returning input
|
|
305
|
-
* x/is - directly checks the constructor
|
|
306
|
-
* x/isEqual - left strictly equals right? eager version of eq
|
|
307
|
-
* x/isObject - is object?
|
|
308
|
-
* x/isString - is string?
|
|
309
|
-
* x/pluck - create a new collection by getting a path from every item of an old collection
|
|
310
|
-
* x/unionWith - create a flattened unique array with uniques given by a binary predicate
|
package/CNAME
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
rubico.land
|
package/CODE_OF_CONDUCT.md
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
# Contributor Covenant Code of Conduct
|
|
2
|
-
|
|
3
|
-
## Our Pledge
|
|
4
|
-
|
|
5
|
-
We as members, contributors, and leaders pledge to make participation in our
|
|
6
|
-
community a harassment-free experience for everyone, regardless of age, body
|
|
7
|
-
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
8
|
-
identity and expression, level of experience, education, socio-economic status,
|
|
9
|
-
nationality, personal appearance, race, religion, or sexual identity
|
|
10
|
-
and orientation.
|
|
11
|
-
|
|
12
|
-
We pledge to act and interact in ways that contribute to an open, welcoming,
|
|
13
|
-
diverse, inclusive, and healthy community.
|
|
14
|
-
|
|
15
|
-
## Our Standards
|
|
16
|
-
|
|
17
|
-
Examples of behavior that contributes to a positive environment for our
|
|
18
|
-
community include:
|
|
19
|
-
|
|
20
|
-
* Demonstrating empathy and kindness toward other people
|
|
21
|
-
* Being respectful of differing opinions, viewpoints, and experiences
|
|
22
|
-
* Giving and gracefully accepting constructive feedback
|
|
23
|
-
* Accepting responsibility and apologizing to those affected by our mistakes,
|
|
24
|
-
and learning from the experience
|
|
25
|
-
* Focusing on what is best not just for us as individuals, but for the
|
|
26
|
-
overall community
|
|
27
|
-
|
|
28
|
-
Examples of unacceptable behavior include:
|
|
29
|
-
|
|
30
|
-
* The use of sexualized language or imagery, and sexual attention or
|
|
31
|
-
advances of any kind
|
|
32
|
-
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
33
|
-
* Public or private harassment
|
|
34
|
-
* Publishing others' private information, such as a physical or email
|
|
35
|
-
address, without their explicit permission
|
|
36
|
-
* Other conduct which could reasonably be considered inappropriate in a
|
|
37
|
-
professional setting
|
|
38
|
-
|
|
39
|
-
## Enforcement Responsibilities
|
|
40
|
-
|
|
41
|
-
Community leaders are responsible for clarifying and enforcing our standards of
|
|
42
|
-
acceptable behavior and will take appropriate and fair corrective action in
|
|
43
|
-
response to any behavior that they deem inappropriate, threatening, offensive,
|
|
44
|
-
or harmful.
|
|
45
|
-
|
|
46
|
-
Community leaders have the right and responsibility to remove, edit, or reject
|
|
47
|
-
comments, commits, code, wiki edits, issues, and other contributions that are
|
|
48
|
-
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
|
49
|
-
decisions when appropriate.
|
|
50
|
-
|
|
51
|
-
## Scope
|
|
52
|
-
|
|
53
|
-
This Code of Conduct applies within all community spaces, and also applies when
|
|
54
|
-
an individual is officially representing the community in public spaces.
|
|
55
|
-
Examples of representing our community include using an official e-mail address,
|
|
56
|
-
posting via an official social media account, or acting as an appointed
|
|
57
|
-
representative at an online or offline event.
|
|
58
|
-
|
|
59
|
-
## Enforcement
|
|
60
|
-
|
|
61
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
62
|
-
reported to the community leaders responsible for enforcement at
|
|
63
|
-
richytong@gmail.com.
|
|
64
|
-
All complaints will be reviewed and investigated promptly and fairly.
|
|
65
|
-
|
|
66
|
-
All community leaders are obligated to respect the privacy and security of the
|
|
67
|
-
reporter of any incident.
|
|
68
|
-
|
|
69
|
-
## Enforcement Guidelines
|
|
70
|
-
|
|
71
|
-
Community leaders will follow these Community Impact Guidelines in determining
|
|
72
|
-
the consequences for any action they deem in violation of this Code of Conduct:
|
|
73
|
-
|
|
74
|
-
### 1. Correction
|
|
75
|
-
|
|
76
|
-
**Community Impact**: Use of inappropriate language or other behavior deemed
|
|
77
|
-
unprofessional or unwelcome in the community.
|
|
78
|
-
|
|
79
|
-
**Consequence**: A private, written warning from community leaders, providing
|
|
80
|
-
clarity around the nature of the violation and an explanation of why the
|
|
81
|
-
behavior was inappropriate. A public apology may be requested.
|
|
82
|
-
|
|
83
|
-
### 2. Warning
|
|
84
|
-
|
|
85
|
-
**Community Impact**: A violation through a single incident or series
|
|
86
|
-
of actions.
|
|
87
|
-
|
|
88
|
-
**Consequence**: A warning with consequences for continued behavior. No
|
|
89
|
-
interaction with the people involved, including unsolicited interaction with
|
|
90
|
-
those enforcing the Code of Conduct, for a specified period of time. This
|
|
91
|
-
includes avoiding interactions in community spaces as well as external channels
|
|
92
|
-
like social media. Violating these terms may lead to a temporary or
|
|
93
|
-
permanent ban.
|
|
94
|
-
|
|
95
|
-
### 3. Temporary Ban
|
|
96
|
-
|
|
97
|
-
**Community Impact**: A serious violation of community standards, including
|
|
98
|
-
sustained inappropriate behavior.
|
|
99
|
-
|
|
100
|
-
**Consequence**: A temporary ban from any sort of interaction or public
|
|
101
|
-
communication with the community for a specified period of time. No public or
|
|
102
|
-
private interaction with the people involved, including unsolicited interaction
|
|
103
|
-
with those enforcing the Code of Conduct, is allowed during this period.
|
|
104
|
-
Violating these terms may lead to a permanent ban.
|
|
105
|
-
|
|
106
|
-
### 4. Permanent Ban
|
|
107
|
-
|
|
108
|
-
**Community Impact**: Demonstrating a pattern of violation of community
|
|
109
|
-
standards, including sustained inappropriate behavior, harassment of an
|
|
110
|
-
individual, or aggression toward or disparagement of classes of individuals.
|
|
111
|
-
|
|
112
|
-
**Consequence**: A permanent ban from any sort of public interaction within
|
|
113
|
-
the community.
|
|
114
|
-
|
|
115
|
-
## Attribution
|
|
116
|
-
|
|
117
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|
118
|
-
version 2.0, available at
|
|
119
|
-
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
|
120
|
-
|
|
121
|
-
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
|
122
|
-
enforcement ladder](https://github.com/mozilla/diversity).
|
|
123
|
-
|
|
124
|
-
[homepage]: https://www.contributor-covenant.org
|
|
125
|
-
|
|
126
|
-
For answers to common questions about this code of conduct, see the FAQ at
|
|
127
|
-
https://www.contributor-covenant.org/faq. Translations are available at
|
|
128
|
-
https://www.contributor-covenant.org/translations.
|
package/CONTRIBUTING.md
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
# Contributing
|
|
2
|
-
Your feedback and contributions are welcome. If you have a suggestion, please raise an issue. Prior to that, please search through the issues first in case your suggestion has been made already. If you decide to work on an issue, or feel like taking initiative and contributing anything at all, feel free to create a pull request and I will get back to you shortly.
|
|
3
|
-
|
|
4
|
-
Pull requests should provide some basic context and link the relevant issue. Here is an [example pull request](https://github.com/a-synchronous/rubico/pull/12). If you are interested in contributing, the [help wanted](https://github.com/a-synchronous/rubico/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) tag is a good place to start.
|
package/Transducer.test.js
DELETED
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
require('./global')
|
|
2
|
-
const Transducer = require('./Transducer')
|
|
3
|
-
const assert = require('assert')
|
|
4
|
-
|
|
5
|
-
describe('Transducer', () => {
|
|
6
|
-
const ade = assert.deepEqual
|
|
7
|
-
const ase = assert.strictEqual
|
|
8
|
-
const aok = assert.ok
|
|
9
|
-
|
|
10
|
-
const concat = (y, xi) => y.concat(xi)
|
|
11
|
-
const add = (y, xi) => y + xi
|
|
12
|
-
const isOdd = number => number % 2 == 1
|
|
13
|
-
|
|
14
|
-
it('reduce with sync transduced reducers', async () => {
|
|
15
|
-
const squareOdds = compose([
|
|
16
|
-
Transducer.filter(isOdd),
|
|
17
|
-
Transducer.map(x => x ** 2),
|
|
18
|
-
])
|
|
19
|
-
ade(
|
|
20
|
-
reduce(squareOdds(concat), [])([1, 2, 3, 4, 5]),
|
|
21
|
-
[1, 9, 25],
|
|
22
|
-
)
|
|
23
|
-
ade(
|
|
24
|
-
reduce(squareOdds((y, xi) => y.add(xi)), new Set())([1, 2, 3, 4, 5]),
|
|
25
|
-
new Set([1, 9, 25]),
|
|
26
|
-
)
|
|
27
|
-
const appendAlphas = compose([
|
|
28
|
-
Transducer.map(x => `${x}a`),
|
|
29
|
-
Transducer.map(x => `${x}b`),
|
|
30
|
-
Transducer.map(x => `${x}c`),
|
|
31
|
-
])
|
|
32
|
-
ase(
|
|
33
|
-
reduce(appendAlphas(add), '')('123'),
|
|
34
|
-
'1abc2abc3abc',
|
|
35
|
-
)
|
|
36
|
-
ade(
|
|
37
|
-
reduce(appendAlphas(concat), [])('123'),
|
|
38
|
-
['1abc', '2abc', '3abc'],
|
|
39
|
-
)
|
|
40
|
-
})
|
|
41
|
-
|
|
42
|
-
it('reduce with an async transduced reducer', async () => {
|
|
43
|
-
const hosWithHey = compose([
|
|
44
|
-
Transducer.filter(async x => x === 'ho'),
|
|
45
|
-
Transducer.map(x => Promise.resolve(`${x}hey`)),
|
|
46
|
-
])
|
|
47
|
-
const hihos = { a: 'hi', b: 'ho', c: 'hi', d: 'ho', e: 'hi', f: 'ho' }
|
|
48
|
-
aok(reduce(hosWithHey(add), '')(hihos) instanceof Promise),
|
|
49
|
-
aok(reduce(hosWithHey(concat), [])(hihos) instanceof Promise),
|
|
50
|
-
ase(
|
|
51
|
-
await reduce(hosWithHey(add), '')(hihos),
|
|
52
|
-
'hoheyhoheyhohey',
|
|
53
|
-
)
|
|
54
|
-
ade(
|
|
55
|
-
await reduce(hosWithHey(concat), [])(hihos),
|
|
56
|
-
['hohey', 'hohey', 'hohey'],
|
|
57
|
-
)
|
|
58
|
-
})
|
|
59
|
-
|
|
60
|
-
it('transform with error handling on a transducer composition', async () => {
|
|
61
|
-
const caughtErrors = []
|
|
62
|
-
const numbers = [1, 2, 3, 4, 5]
|
|
63
|
-
const result = await transform(numbers, Transducer.tryCatch(compose([
|
|
64
|
-
Transducer.filter(number => number % 2 == 1),
|
|
65
|
-
Transducer.map(number => number ** 2),
|
|
66
|
-
Transducer.map(number => {
|
|
67
|
-
throw new Error(number)
|
|
68
|
-
}),
|
|
69
|
-
Transducer.map(number => number * 10), // should never reach here
|
|
70
|
-
]), (error, item) => {
|
|
71
|
-
caughtErrors.push(error)
|
|
72
|
-
return item
|
|
73
|
-
}), [])
|
|
74
|
-
assert.equal(caughtErrors.length, 3)
|
|
75
|
-
assert.deepEqual(result, [1, 3, 5])
|
|
76
|
-
assert.deepEqual(caughtErrors.map(get('message')), ['1', '9', '25'])
|
|
77
|
-
})
|
|
78
|
-
|
|
79
|
-
it('transform with error handling on a transducer in a composition', async () => {
|
|
80
|
-
const caughtErrors = []
|
|
81
|
-
const numbers = [1, 2, 3, 4, 5]
|
|
82
|
-
const result = await transform(numbers, compose([
|
|
83
|
-
Transducer.filter(number => number % 2 == 1),
|
|
84
|
-
Transducer.map(number => number ** 2),
|
|
85
|
-
Transducer.tryCatch(
|
|
86
|
-
Transducer.map(number => {
|
|
87
|
-
throw new Error(number)
|
|
88
|
-
}),
|
|
89
|
-
(error, item) => {
|
|
90
|
-
caughtErrors.push(error)
|
|
91
|
-
return item
|
|
92
|
-
},
|
|
93
|
-
),
|
|
94
|
-
Transducer.map(number => number * 10), // should reach here with error handler
|
|
95
|
-
]), [])
|
|
96
|
-
assert.equal(caughtErrors.length, 3)
|
|
97
|
-
assert.deepEqual(result, [10, 90, 250])
|
|
98
|
-
assert.deepEqual(caughtErrors.map(get('message')), ['1', '9', '25'])
|
|
99
|
-
})
|
|
100
|
-
|
|
101
|
-
it('flatMapping transducer', async () => {
|
|
102
|
-
const createOddMultiplesSync = compose([
|
|
103
|
-
Transducer.filter(isOdd),
|
|
104
|
-
Transducer.flatMap(number => [number * 2, number * 3]),
|
|
105
|
-
])
|
|
106
|
-
|
|
107
|
-
ase(
|
|
108
|
-
reduce([1, 2, 3], createOddMultiplesSync(add), 0),
|
|
109
|
-
2 + 3 + 6 + 9,
|
|
110
|
-
)
|
|
111
|
-
ade(
|
|
112
|
-
reduce([1, 2, 3], createOddMultiplesSync(concat), []),
|
|
113
|
-
[2, 3, 6, 9],
|
|
114
|
-
)
|
|
115
|
-
|
|
116
|
-
const createOddMultiplesAsync = compose([
|
|
117
|
-
Transducer.filter(isOdd),
|
|
118
|
-
Transducer.flatMap(async number => [number * 2, number * 3]),
|
|
119
|
-
])
|
|
120
|
-
|
|
121
|
-
const p1 = reduce([1, 2, 3], createOddMultiplesAsync(add), 0)
|
|
122
|
-
aok(p1 instanceof Promise)
|
|
123
|
-
const p2 = reduce([1, 2, 3], createOddMultiplesAsync(concat), [])
|
|
124
|
-
aok(p2 instanceof Promise)
|
|
125
|
-
await p1.then(result => {
|
|
126
|
-
ase(result, 2 + 3 + 6 + 9)
|
|
127
|
-
})
|
|
128
|
-
await p2.then(result => {
|
|
129
|
-
ade(result, [2, 3, 6, 9])
|
|
130
|
-
})
|
|
131
|
-
})
|
|
132
|
-
|
|
133
|
-
it('forEach transducer', async () => {
|
|
134
|
-
let sum1 = 0
|
|
135
|
-
reduce([1, 2, 3, 4, 5], Transducer.forEach(number => {
|
|
136
|
-
sum1 += number
|
|
137
|
-
})(() => {}), null)
|
|
138
|
-
assert.equal(sum1, 15)
|
|
139
|
-
|
|
140
|
-
let sum2 = 0
|
|
141
|
-
await reduce([1, 2, 3, 4, 5], Transducer.forEach(async number => {
|
|
142
|
-
sum2 += number
|
|
143
|
-
})(() => {}), null)
|
|
144
|
-
assert.equal(sum2, 15)
|
|
145
|
-
})
|
|
146
|
-
|
|
147
|
-
it('passthrough transducer', async () => {
|
|
148
|
-
assert.deepEqual(
|
|
149
|
-
transform({ a: 1, b: 2, c: 3 }, Transducer.passthrough, []),
|
|
150
|
-
[1, 2, 3],
|
|
151
|
-
)
|
|
152
|
-
})
|
|
153
|
-
|
|
154
|
-
})
|
package/_config.yml
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
theme: jekyll-theme-cayman
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
const isPromise = require('./isPromise')
|
|
2
|
-
const isArray = require('./isArray')
|
|
3
|
-
const isBinary = require('./isBinary')
|
|
4
|
-
const callPropUnary = require('./callPropUnary')
|
|
5
|
-
const __ = require('./placeholder')
|
|
6
|
-
const curry2 = require('./curry2')
|
|
7
|
-
const curry3 = require('./curry3')
|
|
8
|
-
const always = require('./always')
|
|
9
|
-
const noop = require('./noop')
|
|
10
|
-
const add = require('./add')
|
|
11
|
-
const genericReduce = require('./genericReduce')
|
|
12
|
-
const objectAssign = require('./objectAssign')
|
|
13
|
-
const arrayExtend = require('./arrayExtend')
|
|
14
|
-
const binaryExtend = require('./binaryExtend')
|
|
15
|
-
const streamExtend = require('./streamExtend')
|
|
16
|
-
const setExtend = require('./setExtend')
|
|
17
|
-
const callConcat = require('./callConcat')
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @name identityTransform
|
|
21
|
-
*
|
|
22
|
-
* @synopsis
|
|
23
|
-
* ```coffeescript [specscript]
|
|
24
|
-
* Reducer = (any, any)=>Promise|any
|
|
25
|
-
*
|
|
26
|
-
* identityTransform<
|
|
27
|
-
* collection any,
|
|
28
|
-
* transducer Reducer=>Reducer,
|
|
29
|
-
* accum undefined|null,
|
|
30
|
-
* >(args, transducer, accum) -> Promise|accum
|
|
31
|
-
* ```
|
|
32
|
-
*
|
|
33
|
-
* @description
|
|
34
|
-
* Reduce a value, always returning the initial accum
|
|
35
|
-
*/
|
|
36
|
-
const identityTransform = function (collection, transducer, accum) {
|
|
37
|
-
const nil = genericReduce(collection, transducer(noop), null)
|
|
38
|
-
return isPromise(nil) ? nil.then(always(accum)) : accum
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* @name genericTransform
|
|
43
|
-
*
|
|
44
|
-
* @synopsis
|
|
45
|
-
* ```coffeescript [specscript]
|
|
46
|
-
* Reducer = (any, any)=>Promise|any
|
|
47
|
-
* Semigroup = Array|string|Set|TypedArray
|
|
48
|
-
* |{ concat: function }|{ write: function }|Object
|
|
49
|
-
*
|
|
50
|
-
* genericTransform<
|
|
51
|
-
* collection any,
|
|
52
|
-
* transducer Reducer=>Reducer,
|
|
53
|
-
* accum Semigroup|any,
|
|
54
|
-
* >(collection, transducer, accum) -> accum
|
|
55
|
-
* ```
|
|
56
|
-
*/
|
|
57
|
-
const genericTransform = function (collection, transducer, accum) {
|
|
58
|
-
if (isArray(accum)) {
|
|
59
|
-
return genericReduce(collection, transducer(arrayExtend), accum)
|
|
60
|
-
}
|
|
61
|
-
if (isBinary(accum)) {
|
|
62
|
-
const intermediateArray = genericReduce(collection, transducer(arrayExtend), [])
|
|
63
|
-
return isPromise(intermediateArray)
|
|
64
|
-
? intermediateArray.then(curry2(binaryExtend, accum, __))
|
|
65
|
-
: binaryExtend(accum, intermediateArray)
|
|
66
|
-
}
|
|
67
|
-
if (accum == null) {
|
|
68
|
-
return identityTransform(collection, transducer, accum)
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
const constructor = accum.constructor
|
|
72
|
-
if (typeof accum == 'string' || constructor == String) {
|
|
73
|
-
const result = genericReduce(collection, transducer(arrayExtend), [accum])
|
|
74
|
-
return isPromise(result)
|
|
75
|
-
? result.then(curry3(callPropUnary, __, 'join', ''))
|
|
76
|
-
: result.join('')
|
|
77
|
-
}
|
|
78
|
-
if (typeof accum.concat == 'function') {
|
|
79
|
-
return genericReduce(collection, transducer(callConcat), accum)
|
|
80
|
-
}
|
|
81
|
-
if (typeof accum.write == 'function') {
|
|
82
|
-
return genericReduce(collection, transducer(streamExtend), accum)
|
|
83
|
-
}
|
|
84
|
-
if (constructor == Set) {
|
|
85
|
-
return genericReduce(collection, transducer(setExtend), accum)
|
|
86
|
-
}
|
|
87
|
-
if (constructor == Object) {
|
|
88
|
-
return genericReduce(collection, transducer(objectAssign), accum)
|
|
89
|
-
}
|
|
90
|
-
return identityTransform(collection, transducer, accum)
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
module.exports = genericTransform
|