@quantiya/codevibe-claude-plugin 2.0.26 → 2.0.27
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/.claude-plugin/plugin.json +1 -1
- package/node_modules/@quantiya/codevibe-core/dist/__tests__/terminal-menu.test.d.ts +1 -0
- package/node_modules/@quantiya/codevibe-core/dist/index.d.ts +2 -0
- package/node_modules/@quantiya/codevibe-core/dist/index.js +321 -317
- package/node_modules/@quantiya/codevibe-core/dist/prompt-parser.d.ts +3 -1
- package/node_modules/@quantiya/codevibe-core/dist/terminal-menu.d.ts +22 -0
- package/node_modules/@quantiya/codevibe-core/package.json +1 -1
- package/node_modules/es-toolkit/CHANGELOG.md +38 -3
- package/node_modules/es-toolkit/dist/browser.global.js +4 -4
- package/node_modules/es-toolkit/dist/compat/array/differenceWith.js +2 -1
- package/node_modules/es-toolkit/dist/compat/array/differenceWith.mjs +2 -1
- package/node_modules/es-toolkit/dist/compat/array/findLastIndex.js +5 -3
- package/node_modules/es-toolkit/dist/compat/array/findLastIndex.mjs +5 -3
- package/node_modules/es-toolkit/dist/compat/array/sortedIndexBy.js +1 -1
- package/node_modules/es-toolkit/dist/compat/array/sortedIndexBy.mjs +1 -1
- package/node_modules/es-toolkit/dist/compat/array/without.js +8 -2
- package/node_modules/es-toolkit/dist/compat/array/without.mjs +8 -2
- package/node_modules/es-toolkit/dist/compat/array/xorWith.js +4 -6
- package/node_modules/es-toolkit/dist/compat/array/xorWith.mjs +4 -6
- package/node_modules/es-toolkit/dist/compat/compat.js +1 -1
- package/node_modules/es-toolkit/dist/compat/compat.mjs +1 -1
- package/node_modules/es-toolkit/dist/compat/function/debounce.js +1 -1
- package/node_modules/es-toolkit/dist/compat/function/debounce.mjs +1 -1
- package/node_modules/es-toolkit/dist/compat/index.js +1 -1
- package/node_modules/es-toolkit/dist/compat/index.mjs +1 -1
- package/node_modules/es-toolkit/dist/compat/object/has.js +3 -2
- package/node_modules/es-toolkit/dist/compat/object/has.mjs +3 -2
- package/node_modules/es-toolkit/dist/compat/object/hasIn.js +3 -2
- package/node_modules/es-toolkit/dist/compat/object/hasIn.mjs +3 -2
- package/node_modules/es-toolkit/dist/compat/object/mergeWith.js +1 -1
- package/node_modules/es-toolkit/dist/compat/object/mergeWith.mjs +1 -1
- package/node_modules/es-toolkit/dist/compat/object/omitBy.js +1 -1
- package/node_modules/es-toolkit/dist/compat/object/omitBy.mjs +1 -1
- package/node_modules/es-toolkit/dist/compat/object/pickBy.js +1 -1
- package/node_modules/es-toolkit/dist/compat/object/pickBy.mjs +1 -1
- package/node_modules/es-toolkit/dist/compat/util/toString.js +3 -1
- package/node_modules/es-toolkit/dist/compat/util/toString.mjs +3 -1
- package/node_modules/es-toolkit/dist/fp/flowAsync.d.mts +213 -0
- package/node_modules/es-toolkit/dist/fp/flowAsync.d.ts +213 -0
- package/node_modules/es-toolkit/dist/fp/flowAsync.js +37 -0
- package/node_modules/es-toolkit/dist/fp/flowAsync.mjs +37 -0
- package/node_modules/es-toolkit/dist/fp/index.d.mts +2 -1
- package/node_modules/es-toolkit/dist/fp/index.d.ts +2 -1
- package/node_modules/es-toolkit/dist/fp/index.js +2 -0
- package/node_modules/es-toolkit/dist/fp/index.mjs +2 -1
- package/node_modules/es-toolkit/dist/fp/iterator/cartesianProduct.d.mts +23 -0
- package/node_modules/es-toolkit/dist/fp/iterator/cartesianProduct.d.ts +23 -0
- package/node_modules/es-toolkit/dist/fp/iterator/cartesianProduct.js +28 -0
- package/node_modules/es-toolkit/dist/fp/iterator/cartesianProduct.mjs +28 -0
- package/node_modules/es-toolkit/dist/fp/iterator/chunk.d.mts +19 -0
- package/node_modules/es-toolkit/dist/fp/iterator/chunk.d.ts +19 -0
- package/node_modules/es-toolkit/dist/fp/iterator/chunk.js +24 -0
- package/node_modules/es-toolkit/dist/fp/iterator/chunk.mjs +24 -0
- package/node_modules/es-toolkit/dist/fp/iterator/count.d.mts +20 -0
- package/node_modules/es-toolkit/dist/fp/iterator/count.d.ts +20 -0
- package/node_modules/es-toolkit/dist/fp/iterator/count.js +25 -0
- package/node_modules/es-toolkit/dist/fp/iterator/count.mjs +25 -0
- package/node_modules/es-toolkit/dist/fp/iterator/drop.d.mts +20 -0
- package/node_modules/es-toolkit/dist/fp/iterator/drop.d.ts +20 -0
- package/node_modules/es-toolkit/dist/fp/iterator/drop.js +24 -0
- package/node_modules/es-toolkit/dist/fp/iterator/drop.mjs +24 -0
- package/node_modules/es-toolkit/dist/fp/iterator/dropWhile.d.mts +18 -0
- package/node_modules/es-toolkit/dist/fp/iterator/dropWhile.d.ts +18 -0
- package/node_modules/es-toolkit/dist/fp/iterator/dropWhile.js +23 -0
- package/node_modules/es-toolkit/dist/fp/iterator/dropWhile.mjs +23 -0
- package/node_modules/es-toolkit/dist/fp/iterator/every.d.mts +20 -0
- package/node_modules/es-toolkit/dist/fp/iterator/every.d.ts +20 -0
- package/node_modules/es-toolkit/dist/fp/iterator/every.js +24 -0
- package/node_modules/es-toolkit/dist/fp/iterator/every.mjs +24 -0
- package/node_modules/es-toolkit/dist/fp/iterator/filter.d.mts +37 -0
- package/node_modules/es-toolkit/dist/fp/iterator/filter.d.ts +37 -0
- package/node_modules/es-toolkit/dist/fp/iterator/filter.js +8 -0
- package/node_modules/es-toolkit/dist/fp/iterator/filter.mjs +8 -0
- package/node_modules/es-toolkit/dist/fp/iterator/find.d.mts +20 -0
- package/node_modules/es-toolkit/dist/fp/iterator/find.d.ts +20 -0
- package/node_modules/es-toolkit/dist/fp/iterator/find.js +24 -0
- package/node_modules/es-toolkit/dist/fp/iterator/find.mjs +24 -0
- package/node_modules/es-toolkit/dist/fp/iterator/flatMap.d.mts +20 -0
- package/node_modules/es-toolkit/dist/fp/iterator/flatMap.d.ts +20 -0
- package/node_modules/es-toolkit/dist/fp/iterator/flatMap.js +24 -0
- package/node_modules/es-toolkit/dist/fp/iterator/flatMap.mjs +24 -0
- package/node_modules/es-toolkit/dist/fp/iterator/forEach.d.mts +22 -0
- package/node_modules/es-toolkit/dist/fp/iterator/forEach.d.ts +22 -0
- package/node_modules/es-toolkit/dist/fp/iterator/forEach.js +26 -0
- package/node_modules/es-toolkit/dist/fp/iterator/forEach.mjs +26 -0
- package/node_modules/es-toolkit/dist/fp/iterator/head.d.mts +19 -0
- package/node_modules/es-toolkit/dist/fp/iterator/head.d.ts +19 -0
- package/node_modules/es-toolkit/dist/fp/iterator/head.js +24 -0
- package/node_modules/es-toolkit/dist/fp/iterator/head.mjs +24 -0
- package/node_modules/es-toolkit/dist/fp/iterator/index.d.mts +22 -0
- package/node_modules/es-toolkit/dist/fp/iterator/index.d.ts +22 -0
- package/node_modules/es-toolkit/dist/fp/iterator/index.js +43 -0
- package/node_modules/es-toolkit/dist/fp/iterator/index.mjs +22 -0
- package/node_modules/es-toolkit/dist/fp/iterator/map.d.mts +20 -0
- package/node_modules/es-toolkit/dist/fp/iterator/map.d.ts +20 -0
- package/node_modules/es-toolkit/dist/fp/iterator/map.js +24 -0
- package/node_modules/es-toolkit/dist/fp/iterator/map.mjs +24 -0
- package/node_modules/es-toolkit/dist/fp/iterator/partition.d.mts +22 -0
- package/node_modules/es-toolkit/dist/fp/iterator/partition.d.ts +22 -0
- package/node_modules/es-toolkit/dist/fp/iterator/partition.js +27 -0
- package/node_modules/es-toolkit/dist/fp/iterator/partition.mjs +27 -0
- package/node_modules/es-toolkit/dist/fp/iterator/reduce.d.mts +24 -0
- package/node_modules/es-toolkit/dist/fp/iterator/reduce.d.ts +24 -0
- package/node_modules/es-toolkit/dist/fp/iterator/reduce.js +28 -0
- package/node_modules/es-toolkit/dist/fp/iterator/reduce.mjs +28 -0
- package/node_modules/es-toolkit/dist/fp/iterator/scan.d.mts +21 -0
- package/node_modules/es-toolkit/dist/fp/iterator/scan.d.ts +21 -0
- package/node_modules/es-toolkit/dist/fp/iterator/scan.js +26 -0
- package/node_modules/es-toolkit/dist/fp/iterator/scan.mjs +26 -0
- package/node_modules/es-toolkit/dist/fp/iterator/some.d.mts +20 -0
- package/node_modules/es-toolkit/dist/fp/iterator/some.d.ts +20 -0
- package/node_modules/es-toolkit/dist/fp/iterator/some.js +24 -0
- package/node_modules/es-toolkit/dist/fp/iterator/some.mjs +24 -0
- package/node_modules/es-toolkit/dist/fp/iterator/take.d.mts +21 -0
- package/node_modules/es-toolkit/dist/fp/iterator/take.d.ts +21 -0
- package/node_modules/es-toolkit/dist/fp/iterator/take.js +25 -0
- package/node_modules/es-toolkit/dist/fp/iterator/take.mjs +25 -0
- package/node_modules/es-toolkit/dist/fp/iterator/takeWhile.d.mts +19 -0
- package/node_modules/es-toolkit/dist/fp/iterator/takeWhile.d.ts +19 -0
- package/node_modules/es-toolkit/dist/fp/iterator/takeWhile.js +24 -0
- package/node_modules/es-toolkit/dist/fp/iterator/takeWhile.mjs +24 -0
- package/node_modules/es-toolkit/dist/fp/iterator/toArray.d.mts +21 -0
- package/node_modules/es-toolkit/dist/fp/iterator/toArray.d.ts +21 -0
- package/node_modules/es-toolkit/dist/fp/iterator/toArray.js +25 -0
- package/node_modules/es-toolkit/dist/fp/iterator/toArray.mjs +25 -0
- package/node_modules/es-toolkit/dist/fp/iterator/uniqBy.d.mts +20 -0
- package/node_modules/es-toolkit/dist/fp/iterator/uniqBy.d.ts +20 -0
- package/node_modules/es-toolkit/dist/fp/iterator/uniqBy.js +25 -0
- package/node_modules/es-toolkit/dist/fp/iterator/uniqBy.mjs +25 -0
- package/node_modules/es-toolkit/dist/fp/iterator/zip.d.mts +20 -0
- package/node_modules/es-toolkit/dist/fp/iterator/zip.d.ts +20 -0
- package/node_modules/es-toolkit/dist/fp/iterator/zip.js +25 -0
- package/node_modules/es-toolkit/dist/fp/iterator/zip.mjs +25 -0
- package/node_modules/es-toolkit/dist/index.d.mts +3 -1
- package/node_modules/es-toolkit/dist/index.d.ts +3 -1
- package/node_modules/es-toolkit/dist/index.js +4 -0
- package/node_modules/es-toolkit/dist/index.mjs +3 -1
- package/node_modules/es-toolkit/dist/iterator/_internal/iterator.js +74 -0
- package/node_modules/es-toolkit/dist/iterator/_internal/iterator.mjs +74 -0
- package/node_modules/es-toolkit/dist/iterator/cartesianProduct.d.mts +33 -0
- package/node_modules/es-toolkit/dist/iterator/cartesianProduct.d.ts +33 -0
- package/node_modules/es-toolkit/dist/iterator/cartesianProduct.js +95 -0
- package/node_modules/es-toolkit/dist/iterator/cartesianProduct.mjs +95 -0
- package/node_modules/es-toolkit/dist/iterator/chunk.d.mts +21 -0
- package/node_modules/es-toolkit/dist/iterator/chunk.d.ts +21 -0
- package/node_modules/es-toolkit/dist/iterator/chunk.js +40 -0
- package/node_modules/es-toolkit/dist/iterator/chunk.mjs +40 -0
- package/node_modules/es-toolkit/dist/iterator/count.d.mts +18 -0
- package/node_modules/es-toolkit/dist/iterator/count.d.ts +18 -0
- package/node_modules/es-toolkit/dist/iterator/count.js +26 -0
- package/node_modules/es-toolkit/dist/iterator/count.mjs +26 -0
- package/node_modules/es-toolkit/dist/iterator/dropWhile.d.mts +20 -0
- package/node_modules/es-toolkit/dist/iterator/dropWhile.d.ts +20 -0
- package/node_modules/es-toolkit/dist/iterator/dropWhile.js +52 -0
- package/node_modules/es-toolkit/dist/iterator/dropWhile.mjs +52 -0
- package/node_modules/es-toolkit/dist/iterator/head.d.mts +21 -0
- package/node_modules/es-toolkit/dist/iterator/head.d.ts +21 -0
- package/node_modules/es-toolkit/dist/iterator/head.js +26 -0
- package/node_modules/es-toolkit/dist/iterator/head.mjs +26 -0
- package/node_modules/es-toolkit/dist/iterator/index.d.mts +13 -0
- package/node_modules/es-toolkit/dist/iterator/index.d.ts +13 -0
- package/node_modules/es-toolkit/dist/iterator/index.js +25 -0
- package/node_modules/es-toolkit/dist/iterator/index.mjs +13 -0
- package/node_modules/es-toolkit/dist/iterator/iterate.d.mts +20 -0
- package/node_modules/es-toolkit/dist/iterator/iterate.d.ts +20 -0
- package/node_modules/es-toolkit/dist/iterator/iterate.js +32 -0
- package/node_modules/es-toolkit/dist/iterator/iterate.mjs +32 -0
- package/node_modules/es-toolkit/dist/iterator/partition.d.mts +18 -0
- package/node_modules/es-toolkit/dist/iterator/partition.d.ts +18 -0
- package/node_modules/es-toolkit/dist/iterator/partition.js +36 -0
- package/node_modules/es-toolkit/dist/iterator/partition.mjs +36 -0
- package/node_modules/es-toolkit/dist/iterator/range.d.mts +42 -0
- package/node_modules/es-toolkit/dist/iterator/range.d.ts +42 -0
- package/node_modules/es-toolkit/dist/iterator/range.js +25 -0
- package/node_modules/es-toolkit/dist/iterator/range.mjs +25 -0
- package/node_modules/es-toolkit/dist/iterator/scan.d.mts +23 -0
- package/node_modules/es-toolkit/dist/iterator/scan.d.ts +23 -0
- package/node_modules/es-toolkit/dist/iterator/scan.js +47 -0
- package/node_modules/es-toolkit/dist/iterator/scan.mjs +47 -0
- package/node_modules/es-toolkit/dist/iterator/takeWhile.d.mts +20 -0
- package/node_modules/es-toolkit/dist/iterator/takeWhile.d.ts +20 -0
- package/node_modules/es-toolkit/dist/iterator/takeWhile.js +34 -0
- package/node_modules/es-toolkit/dist/iterator/takeWhile.mjs +34 -0
- package/node_modules/es-toolkit/dist/iterator/uniqBy.d.mts +22 -0
- package/node_modules/es-toolkit/dist/iterator/uniqBy.d.ts +22 -0
- package/node_modules/es-toolkit/dist/iterator/uniqBy.js +43 -0
- package/node_modules/es-toolkit/dist/iterator/uniqBy.mjs +43 -0
- package/node_modules/es-toolkit/dist/iterator/zip.d.mts +23 -0
- package/node_modules/es-toolkit/dist/iterator/zip.d.ts +23 -0
- package/node_modules/es-toolkit/dist/iterator/zip.js +45 -0
- package/node_modules/es-toolkit/dist/iterator/zip.mjs +45 -0
- package/node_modules/es-toolkit/dist/object/merge.d.mts +3 -1
- package/node_modules/es-toolkit/dist/object/merge.d.ts +3 -1
- package/node_modules/es-toolkit/dist/object/merge.js +0 -40
- package/node_modules/es-toolkit/dist/object/merge.mjs +0 -40
- package/node_modules/es-toolkit/dist/object/omitBy.d.mts +4 -2
- package/node_modules/es-toolkit/dist/object/omitBy.d.ts +4 -2
- package/node_modules/es-toolkit/dist/object/omitBy.js +4 -3
- package/node_modules/es-toolkit/dist/object/omitBy.mjs +4 -3
- package/node_modules/es-toolkit/dist/object/pickBy.d.mts +4 -2
- package/node_modules/es-toolkit/dist/object/pickBy.d.ts +4 -2
- package/node_modules/es-toolkit/dist/object/pickBy.js +4 -3
- package/node_modules/es-toolkit/dist/object/pickBy.mjs +4 -3
- package/node_modules/es-toolkit/dist/types/EmptyObject.d.mts +21 -0
- package/node_modules/es-toolkit/dist/types/EmptyObject.d.ts +21 -0
- package/node_modules/es-toolkit/dist/types/IsEqual.d.mts +18 -0
- package/node_modules/es-toolkit/dist/types/IsEqual.d.ts +18 -0
- package/node_modules/es-toolkit/dist/types/JSONValue.d.mts +24 -0
- package/node_modules/es-toolkit/dist/types/JSONValue.d.ts +24 -0
- package/node_modules/es-toolkit/dist/types/Merge.d.mts +37 -0
- package/node_modules/es-toolkit/dist/types/Merge.d.ts +37 -0
- package/node_modules/es-toolkit/dist/types/ObjectKeys.d.mts +19 -0
- package/node_modules/es-toolkit/dist/types/ObjectKeys.d.ts +19 -0
- package/node_modules/es-toolkit/dist/types/Primitive.d.mts +14 -0
- package/node_modules/es-toolkit/dist/types/Primitive.d.ts +14 -0
- package/node_modules/es-toolkit/dist/types/SetOptional.d.mts +20 -0
- package/node_modules/es-toolkit/dist/types/SetOptional.d.ts +20 -0
- package/node_modules/es-toolkit/dist/types/SetRequired.d.mts +20 -0
- package/node_modules/es-toolkit/dist/types/SetRequired.d.ts +20 -0
- package/node_modules/es-toolkit/dist/types/UnknownRecord.d.mts +24 -0
- package/node_modules/es-toolkit/dist/types/UnknownRecord.d.ts +24 -0
- package/node_modules/es-toolkit/dist/types/index.d.mts +11 -2
- package/node_modules/es-toolkit/dist/types/index.d.ts +11 -2
- package/node_modules/es-toolkit/dist/util/attempt.d.mts +1 -1
- package/node_modules/es-toolkit/dist/util/attempt.d.ts +1 -1
- package/node_modules/es-toolkit/dist/util/attemptAsync.d.mts +1 -1
- package/node_modules/es-toolkit/dist/util/attemptAsync.d.ts +1 -1
- package/node_modules/es-toolkit/dist/util/defer.d.mts +27 -0
- package/node_modules/es-toolkit/dist/util/defer.d.ts +27 -0
- package/node_modules/es-toolkit/dist/util/defer.js +31 -0
- package/node_modules/es-toolkit/dist/util/defer.mjs +31 -0
- package/node_modules/es-toolkit/dist/util/deferAsync.d.mts +30 -0
- package/node_modules/es-toolkit/dist/util/deferAsync.d.ts +30 -0
- package/node_modules/es-toolkit/dist/util/deferAsync.js +34 -0
- package/node_modules/es-toolkit/dist/util/deferAsync.mjs +34 -0
- package/node_modules/es-toolkit/dist/util/index.d.mts +3 -1
- package/node_modules/es-toolkit/dist/util/index.d.ts +3 -1
- package/node_modules/es-toolkit/dist/util/index.js +4 -0
- package/node_modules/es-toolkit/dist/util/index.mjs +3 -1
- package/node_modules/es-toolkit/fp/iterator.d.ts +1 -0
- package/node_modules/es-toolkit/fp/iterator.js +1 -0
- package/node_modules/es-toolkit/iterator.d.ts +1 -0
- package/node_modules/es-toolkit/iterator.js +1 -0
- package/node_modules/es-toolkit/package.json +44 -1
- package/node_modules/node-abi/abi_registry.json +7 -0
- package/node_modules/node-abi/package.json +1 -1
- package/node_modules/qs/.github/THREAT_MODEL.md +3 -3
- package/node_modules/qs/CHANGELOG.md +15 -0
- package/node_modules/qs/README.md +19 -1
- package/node_modules/qs/dist/qs.js +21 -21
- package/node_modules/qs/eslint.config.mjs +1 -1
- package/node_modules/qs/lib/parse.js +3 -4
- package/node_modules/qs/lib/stringify.js +23 -8
- package/node_modules/qs/lib/utils.js +10 -3
- package/node_modules/qs/package.json +4 -4
- package/node_modules/qs/test/parse.js +192 -3
- package/node_modules/qs/test/stringify.js +317 -0
- package/node_modules/qs/test/utils.js +12 -0
- package/node_modules/type-fest/index.d.ts +6 -7
- package/node_modules/type-fest/package.json +1 -1
- package/node_modules/type-fest/readme.md +6 -5
- package/node_modules/type-fest/source/delimiter-case.d.ts +1 -1
- package/node_modules/type-fest/source/get.d.ts +1 -1
- package/node_modules/type-fest/source/internal/object.d.ts +30 -1
- package/node_modules/type-fest/source/is-boolean-literal.d.ts +39 -0
- package/node_modules/type-fest/source/is-literal.d.ts +43 -269
- package/node_modules/type-fest/source/is-numeric-literal.d.ts +50 -0
- package/node_modules/type-fest/source/is-string-literal.d.ts +72 -0
- package/node_modules/type-fest/source/is-symbol-literal.d.ts +39 -0
- package/node_modules/type-fest/source/jsonify.d.ts +1 -5
- package/node_modules/type-fest/source/remove-prefix.d.ts +1 -1
- package/node_modules/type-fest/source/remove-suffix.d.ts +1 -1
- package/node_modules/type-fest/source/rename-keys.d.ts +163 -0
- package/node_modules/type-fest/source/shared-union-fields-deep.d.ts +4 -3
- package/node_modules/type-fest/source/split.d.ts +1 -1
- package/node_modules/type-fest/source/string-repeat.d.ts +1 -1
- package/node_modules/type-fest/source/string-to-array.d.ts +1 -1
- package/node_modules/type-fest/source/tsconfig-json.d.ts +1 -1
- package/node_modules/type-fest/source/typed-array.d.ts +1 -0
- package/node_modules/type-fest/source/writable.d.ts +2 -2
- package/package.json +2 -2
- /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/LICENSE.md +0 -0
- /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/README.md +0 -0
- /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/common.gypi +0 -0
- /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/except.gypi +0 -0
- /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/index.js +0 -0
- /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/napi-inl.deprecated.h +0 -0
- /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/napi-inl.h +0 -0
- /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/napi.h +0 -0
- /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/node_api.gyp +0 -0
- /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/noexcept.gypi +0 -0
- /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/nothing.c +0 -0
- /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/package-support.json +0 -0
- /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/package.json +0 -0
- /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/tools/README.md +0 -0
- /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/tools/check-napi.js +0 -0
- /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/tools/clang-format.js +0 -0
- /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/tools/conversion.js +0 -0
- /package/node_modules/{node-addon-api → keytar/node_modules/node-addon-api}/tools/eslint-format.js +0 -0
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
//#region src/fp/flowAsync.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Creates a reusable async function from a single function.
|
|
4
|
+
*
|
|
5
|
+
* @param fn1 - The first function, which may take any number of arguments.
|
|
6
|
+
* @returns An async function with the same parameters as `fn1` that resolves to its awaited result.
|
|
7
|
+
*/
|
|
8
|
+
declare function flowAsync<A extends any[], R1>(fn1: (...args: A) => R1): (...args: A) => Promise<Awaited<R1>>;
|
|
9
|
+
/**
|
|
10
|
+
* Composes `fn1` and `fn2` left-to-right into a single reusable async function, awaiting each result.
|
|
11
|
+
*
|
|
12
|
+
* @param fn1 - The first function, which may take any number of arguments.
|
|
13
|
+
* @param fn2 - Applied to the awaited result of `fn1`.
|
|
14
|
+
* @returns An async function with the same parameters as `fn1` that resolves to the awaited result of `fn2`.
|
|
15
|
+
*/
|
|
16
|
+
declare function flowAsync<A extends any[], R1, R2>(fn1: (...args: A) => R1, fn2: (input: Awaited<R1>) => R2): (...args: A) => Promise<Awaited<R2>>;
|
|
17
|
+
/**
|
|
18
|
+
* Composes `fn1` through `fn3` left-to-right into a single reusable async function, awaiting each result.
|
|
19
|
+
*
|
|
20
|
+
* @param fn1 - The first function, which may take any number of arguments.
|
|
21
|
+
* @param fn2 - Applied to the awaited result of `fn1`.
|
|
22
|
+
* @param fn3 - Applied to the awaited result of `fn2`.
|
|
23
|
+
* @returns An async function with the same parameters as `fn1` that resolves to the awaited result of `fn3`.
|
|
24
|
+
*/
|
|
25
|
+
declare function flowAsync<A extends any[], R1, R2, R3>(fn1: (...args: A) => R1, fn2: (input: Awaited<R1>) => R2, fn3: (input: Awaited<R2>) => R3): (...args: A) => Promise<Awaited<R3>>;
|
|
26
|
+
/**
|
|
27
|
+
* Composes `fn1` through `fn4` left-to-right into a single reusable async function, awaiting each result.
|
|
28
|
+
*
|
|
29
|
+
* @param fn1 - The first function, which may take any number of arguments.
|
|
30
|
+
* @param fn2 - Applied to the awaited result of `fn1`.
|
|
31
|
+
* @param fn3 - Applied to the awaited result of `fn2`.
|
|
32
|
+
* @param fn4 - Applied to the awaited result of `fn3`.
|
|
33
|
+
* @returns An async function with the same parameters as `fn1` that resolves to the awaited result of `fn4`.
|
|
34
|
+
*/
|
|
35
|
+
declare function flowAsync<A extends any[], R1, R2, R3, R4>(fn1: (...args: A) => R1, fn2: (input: Awaited<R1>) => R2, fn3: (input: Awaited<R2>) => R3, fn4: (input: Awaited<R3>) => R4): (...args: A) => Promise<Awaited<R4>>;
|
|
36
|
+
/**
|
|
37
|
+
* Composes `fn1` through `fn5` left-to-right into a single reusable async function, awaiting each result.
|
|
38
|
+
*
|
|
39
|
+
* @param fn1 - The first function, which may take any number of arguments.
|
|
40
|
+
* @param fn2 - Applied to the awaited result of `fn1`.
|
|
41
|
+
* @param fn3 - Applied to the awaited result of `fn2`.
|
|
42
|
+
* @param fn4 - Applied to the awaited result of `fn3`.
|
|
43
|
+
* @param fn5 - Applied to the awaited result of `fn4`.
|
|
44
|
+
* @returns An async function with the same parameters as `fn1` that resolves to the awaited result of `fn5`.
|
|
45
|
+
*/
|
|
46
|
+
declare function flowAsync<A extends any[], R1, R2, R3, R4, R5>(fn1: (...args: A) => R1, fn2: (input: Awaited<R1>) => R2, fn3: (input: Awaited<R2>) => R3, fn4: (input: Awaited<R3>) => R4, fn5: (input: Awaited<R4>) => R5): (...args: A) => Promise<Awaited<R5>>;
|
|
47
|
+
/**
|
|
48
|
+
* Composes `fn1` through `fn6` left-to-right into a single reusable async function, awaiting each result.
|
|
49
|
+
*
|
|
50
|
+
* @param fn1 - The first function, which may take any number of arguments.
|
|
51
|
+
* @param fn2 - Applied to the awaited result of `fn1`.
|
|
52
|
+
* @param fn3 - Applied to the awaited result of `fn2`.
|
|
53
|
+
* @param fn4 - Applied to the awaited result of `fn3`.
|
|
54
|
+
* @param fn5 - Applied to the awaited result of `fn4`.
|
|
55
|
+
* @param fn6 - Applied to the awaited result of `fn5`.
|
|
56
|
+
* @returns An async function with the same parameters as `fn1` that resolves to the awaited result of `fn6`.
|
|
57
|
+
*/
|
|
58
|
+
declare function flowAsync<A extends any[], R1, R2, R3, R4, R5, R6>(fn1: (...args: A) => R1, fn2: (input: Awaited<R1>) => R2, fn3: (input: Awaited<R2>) => R3, fn4: (input: Awaited<R3>) => R4, fn5: (input: Awaited<R4>) => R5, fn6: (input: Awaited<R5>) => R6): (...args: A) => Promise<Awaited<R6>>;
|
|
59
|
+
/**
|
|
60
|
+
* Composes `fn1` through `fn7` left-to-right into a single reusable async function, awaiting each result.
|
|
61
|
+
*
|
|
62
|
+
* @param fn1 - The first function, which may take any number of arguments.
|
|
63
|
+
* @param fn2 - Applied to the awaited result of `fn1`.
|
|
64
|
+
* @param fn3 - Applied to the awaited result of `fn2`.
|
|
65
|
+
* @param fn4 - Applied to the awaited result of `fn3`.
|
|
66
|
+
* @param fn5 - Applied to the awaited result of `fn4`.
|
|
67
|
+
* @param fn6 - Applied to the awaited result of `fn5`.
|
|
68
|
+
* @param fn7 - Applied to the awaited result of `fn6`.
|
|
69
|
+
* @returns An async function with the same parameters as `fn1` that resolves to the awaited result of `fn7`.
|
|
70
|
+
*/
|
|
71
|
+
declare function flowAsync<A extends any[], R1, R2, R3, R4, R5, R6, R7>(fn1: (...args: A) => R1, fn2: (input: Awaited<R1>) => R2, fn3: (input: Awaited<R2>) => R3, fn4: (input: Awaited<R3>) => R4, fn5: (input: Awaited<R4>) => R5, fn6: (input: Awaited<R5>) => R6, fn7: (input: Awaited<R6>) => R7): (...args: A) => Promise<Awaited<R7>>;
|
|
72
|
+
/**
|
|
73
|
+
* Composes `fn1` through `fn8` left-to-right into a single reusable async function, awaiting each result.
|
|
74
|
+
*
|
|
75
|
+
* @param fn1 - The first function, which may take any number of arguments.
|
|
76
|
+
* @param fn2 - Applied to the awaited result of `fn1`.
|
|
77
|
+
* @param fn3 - Applied to the awaited result of `fn2`.
|
|
78
|
+
* @param fn4 - Applied to the awaited result of `fn3`.
|
|
79
|
+
* @param fn5 - Applied to the awaited result of `fn4`.
|
|
80
|
+
* @param fn6 - Applied to the awaited result of `fn5`.
|
|
81
|
+
* @param fn7 - Applied to the awaited result of `fn6`.
|
|
82
|
+
* @param fn8 - Applied to the awaited result of `fn7`.
|
|
83
|
+
* @returns An async function with the same parameters as `fn1` that resolves to the awaited result of `fn8`.
|
|
84
|
+
*/
|
|
85
|
+
declare function flowAsync<A extends any[], R1, R2, R3, R4, R5, R6, R7, R8>(fn1: (...args: A) => R1, fn2: (input: Awaited<R1>) => R2, fn3: (input: Awaited<R2>) => R3, fn4: (input: Awaited<R3>) => R4, fn5: (input: Awaited<R4>) => R5, fn6: (input: Awaited<R5>) => R6, fn7: (input: Awaited<R6>) => R7, fn8: (input: Awaited<R7>) => R8): (...args: A) => Promise<Awaited<R8>>;
|
|
86
|
+
/**
|
|
87
|
+
* Composes `fn1` through `fn9` left-to-right into a single reusable async function, awaiting each result.
|
|
88
|
+
*
|
|
89
|
+
* @param fn1 - The first function, which may take any number of arguments.
|
|
90
|
+
* @param fn2 - Applied to the awaited result of `fn1`.
|
|
91
|
+
* @param fn3 - Applied to the awaited result of `fn2`.
|
|
92
|
+
* @param fn4 - Applied to the awaited result of `fn3`.
|
|
93
|
+
* @param fn5 - Applied to the awaited result of `fn4`.
|
|
94
|
+
* @param fn6 - Applied to the awaited result of `fn5`.
|
|
95
|
+
* @param fn7 - Applied to the awaited result of `fn6`.
|
|
96
|
+
* @param fn8 - Applied to the awaited result of `fn7`.
|
|
97
|
+
* @param fn9 - Applied to the awaited result of `fn8`.
|
|
98
|
+
* @returns An async function with the same parameters as `fn1` that resolves to the awaited result of `fn9`.
|
|
99
|
+
*/
|
|
100
|
+
declare function flowAsync<A extends any[], R1, R2, R3, R4, R5, R6, R7, R8, R9>(fn1: (...args: A) => R1, fn2: (input: Awaited<R1>) => R2, fn3: (input: Awaited<R2>) => R3, fn4: (input: Awaited<R3>) => R4, fn5: (input: Awaited<R4>) => R5, fn6: (input: Awaited<R5>) => R6, fn7: (input: Awaited<R6>) => R7, fn8: (input: Awaited<R7>) => R8, fn9: (input: Awaited<R8>) => R9): (...args: A) => Promise<Awaited<R9>>;
|
|
101
|
+
/**
|
|
102
|
+
* Composes `fn1` through `fn10` left-to-right into a single reusable async function, awaiting each result.
|
|
103
|
+
*
|
|
104
|
+
* @param fn1 - The first function, which may take any number of arguments.
|
|
105
|
+
* @param fn2 - Applied to the awaited result of `fn1`.
|
|
106
|
+
* @param fn3 - Applied to the awaited result of `fn2`.
|
|
107
|
+
* @param fn4 - Applied to the awaited result of `fn3`.
|
|
108
|
+
* @param fn5 - Applied to the awaited result of `fn4`.
|
|
109
|
+
* @param fn6 - Applied to the awaited result of `fn5`.
|
|
110
|
+
* @param fn7 - Applied to the awaited result of `fn6`.
|
|
111
|
+
* @param fn8 - Applied to the awaited result of `fn7`.
|
|
112
|
+
* @param fn9 - Applied to the awaited result of `fn8`.
|
|
113
|
+
* @param fn10 - Applied to the awaited result of `fn9`.
|
|
114
|
+
* @returns An async function with the same parameters as `fn1` that resolves to the awaited result of `fn10`.
|
|
115
|
+
*/
|
|
116
|
+
declare function flowAsync<A extends any[], R1, R2, R3, R4, R5, R6, R7, R8, R9, R10>(fn1: (...args: A) => R1, fn2: (input: Awaited<R1>) => R2, fn3: (input: Awaited<R2>) => R3, fn4: (input: Awaited<R3>) => R4, fn5: (input: Awaited<R4>) => R5, fn6: (input: Awaited<R5>) => R6, fn7: (input: Awaited<R6>) => R7, fn8: (input: Awaited<R7>) => R8, fn9: (input: Awaited<R8>) => R9, fn10: (input: Awaited<R9>) => R10): (...args: A) => Promise<Awaited<R10>>;
|
|
117
|
+
/**
|
|
118
|
+
* Composes `fn1` through `fn11` left-to-right into a single reusable async function, awaiting each result.
|
|
119
|
+
*
|
|
120
|
+
* @param fn1 - The first function, which may take any number of arguments.
|
|
121
|
+
* @param fn2 - Applied to the awaited result of `fn1`.
|
|
122
|
+
* @param fn3 - Applied to the awaited result of `fn2`.
|
|
123
|
+
* @param fn4 - Applied to the awaited result of `fn3`.
|
|
124
|
+
* @param fn5 - Applied to the awaited result of `fn4`.
|
|
125
|
+
* @param fn6 - Applied to the awaited result of `fn5`.
|
|
126
|
+
* @param fn7 - Applied to the awaited result of `fn6`.
|
|
127
|
+
* @param fn8 - Applied to the awaited result of `fn7`.
|
|
128
|
+
* @param fn9 - Applied to the awaited result of `fn8`.
|
|
129
|
+
* @param fn10 - Applied to the awaited result of `fn9`.
|
|
130
|
+
* @param fn11 - Applied to the awaited result of `fn10`.
|
|
131
|
+
* @returns An async function with the same parameters as `fn1` that resolves to the awaited result of `fn11`.
|
|
132
|
+
*/
|
|
133
|
+
declare function flowAsync<A extends any[], R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11>(fn1: (...args: A) => R1, fn2: (input: Awaited<R1>) => R2, fn3: (input: Awaited<R2>) => R3, fn4: (input: Awaited<R3>) => R4, fn5: (input: Awaited<R4>) => R5, fn6: (input: Awaited<R5>) => R6, fn7: (input: Awaited<R6>) => R7, fn8: (input: Awaited<R7>) => R8, fn9: (input: Awaited<R8>) => R9, fn10: (input: Awaited<R9>) => R10, fn11: (input: Awaited<R10>) => R11): (...args: A) => Promise<Awaited<R11>>;
|
|
134
|
+
/**
|
|
135
|
+
* Composes `fn1` through `fn12` left-to-right into a single reusable async function, awaiting each result.
|
|
136
|
+
*
|
|
137
|
+
* @param fn1 - The first function, which may take any number of arguments.
|
|
138
|
+
* @param fn2 - Applied to the awaited result of `fn1`.
|
|
139
|
+
* @param fn3 - Applied to the awaited result of `fn2`.
|
|
140
|
+
* @param fn4 - Applied to the awaited result of `fn3`.
|
|
141
|
+
* @param fn5 - Applied to the awaited result of `fn4`.
|
|
142
|
+
* @param fn6 - Applied to the awaited result of `fn5`.
|
|
143
|
+
* @param fn7 - Applied to the awaited result of `fn6`.
|
|
144
|
+
* @param fn8 - Applied to the awaited result of `fn7`.
|
|
145
|
+
* @param fn9 - Applied to the awaited result of `fn8`.
|
|
146
|
+
* @param fn10 - Applied to the awaited result of `fn9`.
|
|
147
|
+
* @param fn11 - Applied to the awaited result of `fn10`.
|
|
148
|
+
* @param fn12 - Applied to the awaited result of `fn11`.
|
|
149
|
+
* @returns An async function with the same parameters as `fn1` that resolves to the awaited result of `fn12`.
|
|
150
|
+
*/
|
|
151
|
+
declare function flowAsync<A extends any[], R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12>(fn1: (...args: A) => R1, fn2: (input: Awaited<R1>) => R2, fn3: (input: Awaited<R2>) => R3, fn4: (input: Awaited<R3>) => R4, fn5: (input: Awaited<R4>) => R5, fn6: (input: Awaited<R5>) => R6, fn7: (input: Awaited<R6>) => R7, fn8: (input: Awaited<R7>) => R8, fn9: (input: Awaited<R8>) => R9, fn10: (input: Awaited<R9>) => R10, fn11: (input: Awaited<R10>) => R11, fn12: (input: Awaited<R11>) => R12): (...args: A) => Promise<Awaited<R12>>;
|
|
152
|
+
/**
|
|
153
|
+
* Composes `fn1` through `fn13` left-to-right into a single reusable async function, awaiting each result.
|
|
154
|
+
*
|
|
155
|
+
* @param fn1 - The first function, which may take any number of arguments.
|
|
156
|
+
* @param fn2 - Applied to the awaited result of `fn1`.
|
|
157
|
+
* @param fn3 - Applied to the awaited result of `fn2`.
|
|
158
|
+
* @param fn4 - Applied to the awaited result of `fn3`.
|
|
159
|
+
* @param fn5 - Applied to the awaited result of `fn4`.
|
|
160
|
+
* @param fn6 - Applied to the awaited result of `fn5`.
|
|
161
|
+
* @param fn7 - Applied to the awaited result of `fn6`.
|
|
162
|
+
* @param fn8 - Applied to the awaited result of `fn7`.
|
|
163
|
+
* @param fn9 - Applied to the awaited result of `fn8`.
|
|
164
|
+
* @param fn10 - Applied to the awaited result of `fn9`.
|
|
165
|
+
* @param fn11 - Applied to the awaited result of `fn10`.
|
|
166
|
+
* @param fn12 - Applied to the awaited result of `fn11`.
|
|
167
|
+
* @param fn13 - Applied to the awaited result of `fn12`.
|
|
168
|
+
* @returns An async function with the same parameters as `fn1` that resolves to the awaited result of `fn13`.
|
|
169
|
+
*/
|
|
170
|
+
declare function flowAsync<A extends any[], R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13>(fn1: (...args: A) => R1, fn2: (input: Awaited<R1>) => R2, fn3: (input: Awaited<R2>) => R3, fn4: (input: Awaited<R3>) => R4, fn5: (input: Awaited<R4>) => R5, fn6: (input: Awaited<R5>) => R6, fn7: (input: Awaited<R6>) => R7, fn8: (input: Awaited<R7>) => R8, fn9: (input: Awaited<R8>) => R9, fn10: (input: Awaited<R9>) => R10, fn11: (input: Awaited<R10>) => R11, fn12: (input: Awaited<R11>) => R12, fn13: (input: Awaited<R12>) => R13): (...args: A) => Promise<Awaited<R13>>;
|
|
171
|
+
/**
|
|
172
|
+
* Composes `fn1` through `fn14` left-to-right into a single reusable async function, awaiting each result.
|
|
173
|
+
*
|
|
174
|
+
* @param fn1 - The first function, which may take any number of arguments.
|
|
175
|
+
* @param fn2 - Applied to the awaited result of `fn1`.
|
|
176
|
+
* @param fn3 - Applied to the awaited result of `fn2`.
|
|
177
|
+
* @param fn4 - Applied to the awaited result of `fn3`.
|
|
178
|
+
* @param fn5 - Applied to the awaited result of `fn4`.
|
|
179
|
+
* @param fn6 - Applied to the awaited result of `fn5`.
|
|
180
|
+
* @param fn7 - Applied to the awaited result of `fn6`.
|
|
181
|
+
* @param fn8 - Applied to the awaited result of `fn7`.
|
|
182
|
+
* @param fn9 - Applied to the awaited result of `fn8`.
|
|
183
|
+
* @param fn10 - Applied to the awaited result of `fn9`.
|
|
184
|
+
* @param fn11 - Applied to the awaited result of `fn10`.
|
|
185
|
+
* @param fn12 - Applied to the awaited result of `fn11`.
|
|
186
|
+
* @param fn13 - Applied to the awaited result of `fn12`.
|
|
187
|
+
* @param fn14 - Applied to the awaited result of `fn13`.
|
|
188
|
+
* @returns An async function with the same parameters as `fn1` that resolves to the awaited result of `fn14`.
|
|
189
|
+
*/
|
|
190
|
+
declare function flowAsync<A extends any[], R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14>(fn1: (...args: A) => R1, fn2: (input: Awaited<R1>) => R2, fn3: (input: Awaited<R2>) => R3, fn4: (input: Awaited<R3>) => R4, fn5: (input: Awaited<R4>) => R5, fn6: (input: Awaited<R5>) => R6, fn7: (input: Awaited<R6>) => R7, fn8: (input: Awaited<R7>) => R8, fn9: (input: Awaited<R8>) => R9, fn10: (input: Awaited<R9>) => R10, fn11: (input: Awaited<R10>) => R11, fn12: (input: Awaited<R11>) => R12, fn13: (input: Awaited<R12>) => R13, fn14: (input: Awaited<R13>) => R14): (...args: A) => Promise<Awaited<R14>>;
|
|
191
|
+
/**
|
|
192
|
+
* Composes `fn1` through `fn15` left-to-right into a single reusable async function, awaiting each result.
|
|
193
|
+
*
|
|
194
|
+
* @param fn1 - The first function, which may take any number of arguments.
|
|
195
|
+
* @param fn2 - Applied to the awaited result of `fn1`.
|
|
196
|
+
* @param fn3 - Applied to the awaited result of `fn2`.
|
|
197
|
+
* @param fn4 - Applied to the awaited result of `fn3`.
|
|
198
|
+
* @param fn5 - Applied to the awaited result of `fn4`.
|
|
199
|
+
* @param fn6 - Applied to the awaited result of `fn5`.
|
|
200
|
+
* @param fn7 - Applied to the awaited result of `fn6`.
|
|
201
|
+
* @param fn8 - Applied to the awaited result of `fn7`.
|
|
202
|
+
* @param fn9 - Applied to the awaited result of `fn8`.
|
|
203
|
+
* @param fn10 - Applied to the awaited result of `fn9`.
|
|
204
|
+
* @param fn11 - Applied to the awaited result of `fn10`.
|
|
205
|
+
* @param fn12 - Applied to the awaited result of `fn11`.
|
|
206
|
+
* @param fn13 - Applied to the awaited result of `fn12`.
|
|
207
|
+
* @param fn14 - Applied to the awaited result of `fn13`.
|
|
208
|
+
* @param fn15 - Applied to the awaited result of `fn14`.
|
|
209
|
+
* @returns An async function with the same parameters as `fn1` that resolves to the awaited result of `fn15`.
|
|
210
|
+
*/
|
|
211
|
+
declare function flowAsync<A extends any[], R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15>(fn1: (...args: A) => R1, fn2: (input: Awaited<R1>) => R2, fn3: (input: Awaited<R2>) => R3, fn4: (input: Awaited<R3>) => R4, fn5: (input: Awaited<R4>) => R5, fn6: (input: Awaited<R5>) => R6, fn7: (input: Awaited<R6>) => R7, fn8: (input: Awaited<R7>) => R8, fn9: (input: Awaited<R8>) => R9, fn10: (input: Awaited<R9>) => R10, fn11: (input: Awaited<R10>) => R11, fn12: (input: Awaited<R11>) => R12, fn13: (input: Awaited<R12>) => R13, fn14: (input: Awaited<R13>) => R14, fn15: (input: Awaited<R14>) => R15): (...args: A) => Promise<Awaited<R15>>;
|
|
212
|
+
//#endregion
|
|
213
|
+
export { flowAsync };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
//#region src/fp/flowAsync.ts
|
|
2
|
+
/**
|
|
3
|
+
* Performs left-to-right async function composition, returning a **reusable
|
|
4
|
+
* async function** instead of running immediately. The first function may take
|
|
5
|
+
* any number of arguments; every later function is unary and receives the
|
|
6
|
+
* awaited result of the previous one.
|
|
7
|
+
*
|
|
8
|
+
* `flowAsync` is the promise-aware sibling of {@link flow}: where `flow` passes
|
|
9
|
+
* each raw return value straight to the next function (so a returned `Promise`
|
|
10
|
+
* arrives unresolved), `flowAsync` awaits every step, letting synchronous and
|
|
11
|
+
* asynchronous functions mix freely in one chain. The composed function always
|
|
12
|
+
* returns a `Promise`.
|
|
13
|
+
*
|
|
14
|
+
* @param functions - The functions to compose. The first may be variadic; the
|
|
15
|
+
* rest are unary, each receiving the awaited output of the previous function.
|
|
16
|
+
* @returns An async function that, when called, applies every function
|
|
17
|
+
* left-to-right, awaiting each result.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* import { flowAsync } from 'es-toolkit/fp';
|
|
21
|
+
*
|
|
22
|
+
* const fetchUser = async (id: number) => ({ id, name: 'Alice' });
|
|
23
|
+
* const getName = (user: { name: string }) => user.name;
|
|
24
|
+
*
|
|
25
|
+
* const getUserName = flowAsync(fetchUser, getName);
|
|
26
|
+
* await getUserName(1); // => 'Alice'
|
|
27
|
+
*/
|
|
28
|
+
function flowAsync(...functions) {
|
|
29
|
+
return async function(...args) {
|
|
30
|
+
if (functions.length === 0) return args[0];
|
|
31
|
+
let result = await functions[0].apply(this, args);
|
|
32
|
+
for (let i = 1; i < functions.length; i++) result = await functions[i].call(this, result);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
exports.flowAsync = flowAsync;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
//#region src/fp/flowAsync.ts
|
|
2
|
+
/**
|
|
3
|
+
* Performs left-to-right async function composition, returning a **reusable
|
|
4
|
+
* async function** instead of running immediately. The first function may take
|
|
5
|
+
* any number of arguments; every later function is unary and receives the
|
|
6
|
+
* awaited result of the previous one.
|
|
7
|
+
*
|
|
8
|
+
* `flowAsync` is the promise-aware sibling of {@link flow}: where `flow` passes
|
|
9
|
+
* each raw return value straight to the next function (so a returned `Promise`
|
|
10
|
+
* arrives unresolved), `flowAsync` awaits every step, letting synchronous and
|
|
11
|
+
* asynchronous functions mix freely in one chain. The composed function always
|
|
12
|
+
* returns a `Promise`.
|
|
13
|
+
*
|
|
14
|
+
* @param functions - The functions to compose. The first may be variadic; the
|
|
15
|
+
* rest are unary, each receiving the awaited output of the previous function.
|
|
16
|
+
* @returns An async function that, when called, applies every function
|
|
17
|
+
* left-to-right, awaiting each result.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* import { flowAsync } from 'es-toolkit/fp';
|
|
21
|
+
*
|
|
22
|
+
* const fetchUser = async (id: number) => ({ id, name: 'Alice' });
|
|
23
|
+
* const getName = (user: { name: string }) => user.name;
|
|
24
|
+
*
|
|
25
|
+
* const getUserName = flowAsync(fetchUser, getName);
|
|
26
|
+
* await getUserName(1); // => 'Alice'
|
|
27
|
+
*/
|
|
28
|
+
function flowAsync(...functions) {
|
|
29
|
+
return async function(...args) {
|
|
30
|
+
if (functions.length === 0) return args[0];
|
|
31
|
+
let result = await functions[0].apply(this, args);
|
|
32
|
+
for (let i = 1; i < functions.length; i++) result = await functions[i].call(this, result);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
export { flowAsync };
|
|
@@ -68,9 +68,10 @@ import { zip } from "./array/zip.mjs";
|
|
|
68
68
|
import { zipObject } from "./array/zipObject.mjs";
|
|
69
69
|
import { zipWith } from "./array/zipWith.mjs";
|
|
70
70
|
import { flow } from "./flow.mjs";
|
|
71
|
+
import { flowAsync } from "./flowAsync.mjs";
|
|
71
72
|
import { add } from "./math/add.mjs";
|
|
72
73
|
import { multiply } from "./math/multiply.mjs";
|
|
73
74
|
import { omit } from "./object/omit.mjs";
|
|
74
75
|
import { pick } from "./object/pick.mjs";
|
|
75
76
|
import { pipe } from "./pipe.mjs";
|
|
76
|
-
export { WindowedOptions, add, at, cartesianProduct, chunk, chunkBy, combinations, compact, countBy, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, filter, find, findIndex, findLast, findLastIndex, flatMap, flatMapDeep, flatten, flattenDeep, flow, forEach, groupBy, head, initial, intersection, intersectionBy, intersectionWith, isSubset, isSubsetWith, join, keyBy, last, length, map, maxBy, minBy, multiply, omit, orderBy, partition, pick, pipe, reverse, sample, sampleSize, shuffle, sortBy, tail, take, takeRight, takeRightWhile, takeWhile, toFilled, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, windowed, without, xor, xorBy, xorWith, zip, zipObject, zipWith };
|
|
77
|
+
export { WindowedOptions, add, at, cartesianProduct, chunk, chunkBy, combinations, compact, countBy, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, filter, find, findIndex, findLast, findLastIndex, flatMap, flatMapDeep, flatten, flattenDeep, flow, flowAsync, forEach, groupBy, head, initial, intersection, intersectionBy, intersectionWith, isSubset, isSubsetWith, join, keyBy, last, length, map, maxBy, minBy, multiply, omit, orderBy, partition, pick, pipe, reverse, sample, sampleSize, shuffle, sortBy, tail, take, takeRight, takeRightWhile, takeWhile, toFilled, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, windowed, without, xor, xorBy, xorWith, zip, zipObject, zipWith };
|
|
@@ -68,9 +68,10 @@ import { zip } from "./array/zip.js";
|
|
|
68
68
|
import { zipObject } from "./array/zipObject.js";
|
|
69
69
|
import { zipWith } from "./array/zipWith.js";
|
|
70
70
|
import { flow } from "./flow.js";
|
|
71
|
+
import { flowAsync } from "./flowAsync.js";
|
|
71
72
|
import { add } from "./math/add.js";
|
|
72
73
|
import { multiply } from "./math/multiply.js";
|
|
73
74
|
import { omit } from "./object/omit.js";
|
|
74
75
|
import { pick } from "./object/pick.js";
|
|
75
76
|
import { pipe } from "./pipe.js";
|
|
76
|
-
export { WindowedOptions, add, at, cartesianProduct, chunk, chunkBy, combinations, compact, countBy, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, filter, find, findIndex, findLast, findLastIndex, flatMap, flatMapDeep, flatten, flattenDeep, flow, forEach, groupBy, head, initial, intersection, intersectionBy, intersectionWith, isSubset, isSubsetWith, join, keyBy, last, length, map, maxBy, minBy, multiply, omit, orderBy, partition, pick, pipe, reverse, sample, sampleSize, shuffle, sortBy, tail, take, takeRight, takeRightWhile, takeWhile, toFilled, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, windowed, without, xor, xorBy, xorWith, zip, zipObject, zipWith };
|
|
77
|
+
export { WindowedOptions, add, at, cartesianProduct, chunk, chunkBy, combinations, compact, countBy, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, filter, find, findIndex, findLast, findLastIndex, flatMap, flatMapDeep, flatten, flattenDeep, flow, flowAsync, forEach, groupBy, head, initial, intersection, intersectionBy, intersectionWith, isSubset, isSubsetWith, join, keyBy, last, length, map, maxBy, minBy, multiply, omit, orderBy, partition, pick, pipe, reverse, sample, sampleSize, shuffle, sortBy, tail, take, takeRight, takeRightWhile, takeWhile, toFilled, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, windowed, without, xor, xorBy, xorWith, zip, zipObject, zipWith };
|
|
@@ -70,6 +70,7 @@ const require_zipWith = require("./array/zipWith.js");
|
|
|
70
70
|
require("./array/index.js");
|
|
71
71
|
const require_pipe = require("./pipe.js");
|
|
72
72
|
const require_flow = require("./flow.js");
|
|
73
|
+
const require_flowAsync = require("./flowAsync.js");
|
|
73
74
|
const require_add = require("./math/add.js");
|
|
74
75
|
const require_multiply = require("./math/multiply.js");
|
|
75
76
|
require("./math/index.js");
|
|
@@ -101,6 +102,7 @@ exports.flatMapDeep = require_flatMapDeep.flatMapDeep;
|
|
|
101
102
|
exports.flatten = require_flatten.flatten;
|
|
102
103
|
exports.flattenDeep = require_flattenDeep.flattenDeep;
|
|
103
104
|
exports.flow = require_flow.flow;
|
|
105
|
+
exports.flowAsync = require_flowAsync.flowAsync;
|
|
104
106
|
exports.forEach = require_forEach.forEach;
|
|
105
107
|
exports.groupBy = require_groupBy.groupBy;
|
|
106
108
|
exports.head = require_head.head;
|
|
@@ -69,10 +69,11 @@ import { zipWith } from "./array/zipWith.mjs";
|
|
|
69
69
|
import "./array/index.mjs";
|
|
70
70
|
import { pipe } from "./pipe.mjs";
|
|
71
71
|
import { flow } from "./flow.mjs";
|
|
72
|
+
import { flowAsync } from "./flowAsync.mjs";
|
|
72
73
|
import { add } from "./math/add.mjs";
|
|
73
74
|
import { multiply } from "./math/multiply.mjs";
|
|
74
75
|
import "./math/index.mjs";
|
|
75
76
|
import { omit } from "./object/omit.mjs";
|
|
76
77
|
import { pick } from "./object/pick.mjs";
|
|
77
78
|
import "./object/index.mjs";
|
|
78
|
-
export { add, at, cartesianProduct, chunk, chunkBy, combinations, compact, countBy, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, filter, find, findIndex, findLast, findLastIndex, flatMap, flatMapDeep, flatten, flattenDeep, flow, forEach, groupBy, head, initial, intersection, intersectionBy, intersectionWith, isSubset, isSubsetWith, join, keyBy, last, length, map, maxBy, minBy, multiply, omit, orderBy, partition, pick, pipe, reverse, sample, sampleSize, shuffle, sortBy, tail, take, takeRight, takeRightWhile, takeWhile, toFilled, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, windowed, without, xor, xorBy, xorWith, zip, zipObject, zipWith };
|
|
79
|
+
export { add, at, cartesianProduct, chunk, chunkBy, combinations, compact, countBy, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, filter, find, findIndex, findLast, findLastIndex, flatMap, flatMapDeep, flatten, flattenDeep, flow, flowAsync, forEach, groupBy, head, initial, intersection, intersectionBy, intersectionWith, isSubset, isSubsetWith, join, keyBy, last, length, map, maxBy, minBy, multiply, omit, orderBy, partition, pick, pipe, reverse, sample, sampleSize, shuffle, sortBy, tail, take, takeRight, takeRightWhile, takeWhile, toFilled, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, windowed, without, xor, xorBy, xorWith, zip, zipObject, zipWith };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region src/fp/iterator/cartesianProduct.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Creates a function that lazily takes the Cartesian product of the piped
|
|
4
|
+
* iterator and `other`, for use with {@link pipe}. Every element of the piped
|
|
5
|
+
* iterator is paired with every element of `other`, with `other` advancing
|
|
6
|
+
* fastest. `other` is buffered into an array when iteration starts, while the
|
|
7
|
+
* piped iterator is consumed lazily, so it may be infinite.
|
|
8
|
+
*
|
|
9
|
+
* @template T - The type of elements produced by the piped iterator.
|
|
10
|
+
* @template U - The type of elements produced by `other`.
|
|
11
|
+
* @param other - The iterator to take the product with.
|
|
12
|
+
* @returns A function mapping an `Iterator<T>` to a lazy `IteratorObject<[T, U]>`.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* import { pipe } from 'es-toolkit/fp';
|
|
16
|
+
* import { cartesianProduct, toArray } from 'es-toolkit/fp/iterator';
|
|
17
|
+
*
|
|
18
|
+
* pipe([1, 2].values(), cartesianProduct(['a', 'b'].values()), toArray());
|
|
19
|
+
* // => [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']]
|
|
20
|
+
*/
|
|
21
|
+
declare function cartesianProduct<T, U>(other: Iterator<U>): (source: Iterator<T>) => IteratorObject<[T, U], undefined>;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { cartesianProduct };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region src/fp/iterator/cartesianProduct.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Creates a function that lazily takes the Cartesian product of the piped
|
|
4
|
+
* iterator and `other`, for use with {@link pipe}. Every element of the piped
|
|
5
|
+
* iterator is paired with every element of `other`, with `other` advancing
|
|
6
|
+
* fastest. `other` is buffered into an array when iteration starts, while the
|
|
7
|
+
* piped iterator is consumed lazily, so it may be infinite.
|
|
8
|
+
*
|
|
9
|
+
* @template T - The type of elements produced by the piped iterator.
|
|
10
|
+
* @template U - The type of elements produced by `other`.
|
|
11
|
+
* @param other - The iterator to take the product with.
|
|
12
|
+
* @returns A function mapping an `Iterator<T>` to a lazy `IteratorObject<[T, U]>`.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* import { pipe } from 'es-toolkit/fp';
|
|
16
|
+
* import { cartesianProduct, toArray } from 'es-toolkit/fp/iterator';
|
|
17
|
+
*
|
|
18
|
+
* pipe([1, 2].values(), cartesianProduct(['a', 'b'].values()), toArray());
|
|
19
|
+
* // => [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']]
|
|
20
|
+
*/
|
|
21
|
+
declare function cartesianProduct<T, U>(other: Iterator<U>): (source: Iterator<T>) => IteratorObject<[T, U], undefined>;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { cartesianProduct };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const require_cartesianProduct = require("../../iterator/cartesianProduct.js");
|
|
2
|
+
//#region src/fp/iterator/cartesianProduct.ts
|
|
3
|
+
/**
|
|
4
|
+
* Creates a function that lazily takes the Cartesian product of the piped
|
|
5
|
+
* iterator and `other`, for use with {@link pipe}. Every element of the piped
|
|
6
|
+
* iterator is paired with every element of `other`, with `other` advancing
|
|
7
|
+
* fastest. `other` is buffered into an array when iteration starts, while the
|
|
8
|
+
* piped iterator is consumed lazily, so it may be infinite.
|
|
9
|
+
*
|
|
10
|
+
* @template T - The type of elements produced by the piped iterator.
|
|
11
|
+
* @template U - The type of elements produced by `other`.
|
|
12
|
+
* @param other - The iterator to take the product with.
|
|
13
|
+
* @returns A function mapping an `Iterator<T>` to a lazy `IteratorObject<[T, U]>`.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* import { pipe } from 'es-toolkit/fp';
|
|
17
|
+
* import { cartesianProduct, toArray } from 'es-toolkit/fp/iterator';
|
|
18
|
+
*
|
|
19
|
+
* pipe([1, 2].values(), cartesianProduct(['a', 'b'].values()), toArray());
|
|
20
|
+
* // => [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']]
|
|
21
|
+
*/
|
|
22
|
+
function cartesianProduct(other) {
|
|
23
|
+
return function cartesianProductInIterator(source) {
|
|
24
|
+
return require_cartesianProduct.cartesianProduct(source, other);
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
exports.cartesianProduct = cartesianProduct;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { cartesianProduct as cartesianProduct$1 } from "../../iterator/cartesianProduct.mjs";
|
|
2
|
+
//#region src/fp/iterator/cartesianProduct.ts
|
|
3
|
+
/**
|
|
4
|
+
* Creates a function that lazily takes the Cartesian product of the piped
|
|
5
|
+
* iterator and `other`, for use with {@link pipe}. Every element of the piped
|
|
6
|
+
* iterator is paired with every element of `other`, with `other` advancing
|
|
7
|
+
* fastest. `other` is buffered into an array when iteration starts, while the
|
|
8
|
+
* piped iterator is consumed lazily, so it may be infinite.
|
|
9
|
+
*
|
|
10
|
+
* @template T - The type of elements produced by the piped iterator.
|
|
11
|
+
* @template U - The type of elements produced by `other`.
|
|
12
|
+
* @param other - The iterator to take the product with.
|
|
13
|
+
* @returns A function mapping an `Iterator<T>` to a lazy `IteratorObject<[T, U]>`.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* import { pipe } from 'es-toolkit/fp';
|
|
17
|
+
* import { cartesianProduct, toArray } from 'es-toolkit/fp/iterator';
|
|
18
|
+
*
|
|
19
|
+
* pipe([1, 2].values(), cartesianProduct(['a', 'b'].values()), toArray());
|
|
20
|
+
* // => [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']]
|
|
21
|
+
*/
|
|
22
|
+
function cartesianProduct(other) {
|
|
23
|
+
return function cartesianProductInIterator(source) {
|
|
24
|
+
return cartesianProduct$1(source, other);
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
export { cartesianProduct };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/fp/iterator/chunk.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Creates a function that lazily groups the elements of an iterator into arrays
|
|
4
|
+
* of length `size`, for use with {@link pipe}. The final chunk may be shorter.
|
|
5
|
+
*
|
|
6
|
+
* @template T - The type of elements produced by the source iterator.
|
|
7
|
+
* @param size - The length of each chunk; must be an integer greater than zero.
|
|
8
|
+
* @returns A function mapping an `Iterator<T>` to a lazy `IteratorObject<T[]>`.
|
|
9
|
+
* @throws {Error} Throws an error if `size` is not an integer greater than zero.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* import { pipe } from 'es-toolkit/fp';
|
|
13
|
+
* import { chunk, toArray } from 'es-toolkit/fp/iterator';
|
|
14
|
+
*
|
|
15
|
+
* pipe([1, 2, 3, 4, 5].values(), chunk(2), toArray()); // => [[1, 2], [3, 4], [5]]
|
|
16
|
+
*/
|
|
17
|
+
declare function chunk<T>(size: number): (source: Iterator<T>) => IteratorObject<T[], undefined>;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { chunk };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/fp/iterator/chunk.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Creates a function that lazily groups the elements of an iterator into arrays
|
|
4
|
+
* of length `size`, for use with {@link pipe}. The final chunk may be shorter.
|
|
5
|
+
*
|
|
6
|
+
* @template T - The type of elements produced by the source iterator.
|
|
7
|
+
* @param size - The length of each chunk; must be an integer greater than zero.
|
|
8
|
+
* @returns A function mapping an `Iterator<T>` to a lazy `IteratorObject<T[]>`.
|
|
9
|
+
* @throws {Error} Throws an error if `size` is not an integer greater than zero.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* import { pipe } from 'es-toolkit/fp';
|
|
13
|
+
* import { chunk, toArray } from 'es-toolkit/fp/iterator';
|
|
14
|
+
*
|
|
15
|
+
* pipe([1, 2, 3, 4, 5].values(), chunk(2), toArray()); // => [[1, 2], [3, 4], [5]]
|
|
16
|
+
*/
|
|
17
|
+
declare function chunk<T>(size: number): (source: Iterator<T>) => IteratorObject<T[], undefined>;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { chunk };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const require_chunk = require("../../iterator/chunk.js");
|
|
2
|
+
//#region src/fp/iterator/chunk.ts
|
|
3
|
+
/**
|
|
4
|
+
* Creates a function that lazily groups the elements of an iterator into arrays
|
|
5
|
+
* of length `size`, for use with {@link pipe}. The final chunk may be shorter.
|
|
6
|
+
*
|
|
7
|
+
* @template T - The type of elements produced by the source iterator.
|
|
8
|
+
* @param size - The length of each chunk; must be an integer greater than zero.
|
|
9
|
+
* @returns A function mapping an `Iterator<T>` to a lazy `IteratorObject<T[]>`.
|
|
10
|
+
* @throws {Error} Throws an error if `size` is not an integer greater than zero.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* import { pipe } from 'es-toolkit/fp';
|
|
14
|
+
* import { chunk, toArray } from 'es-toolkit/fp/iterator';
|
|
15
|
+
*
|
|
16
|
+
* pipe([1, 2, 3, 4, 5].values(), chunk(2), toArray()); // => [[1, 2], [3, 4], [5]]
|
|
17
|
+
*/
|
|
18
|
+
function chunk(size) {
|
|
19
|
+
return function chunkInIterator(source) {
|
|
20
|
+
return require_chunk.chunk(source, size);
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
exports.chunk = chunk;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { chunk as chunk$1 } from "../../iterator/chunk.mjs";
|
|
2
|
+
//#region src/fp/iterator/chunk.ts
|
|
3
|
+
/**
|
|
4
|
+
* Creates a function that lazily groups the elements of an iterator into arrays
|
|
5
|
+
* of length `size`, for use with {@link pipe}. The final chunk may be shorter.
|
|
6
|
+
*
|
|
7
|
+
* @template T - The type of elements produced by the source iterator.
|
|
8
|
+
* @param size - The length of each chunk; must be an integer greater than zero.
|
|
9
|
+
* @returns A function mapping an `Iterator<T>` to a lazy `IteratorObject<T[]>`.
|
|
10
|
+
* @throws {Error} Throws an error if `size` is not an integer greater than zero.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* import { pipe } from 'es-toolkit/fp';
|
|
14
|
+
* import { chunk, toArray } from 'es-toolkit/fp/iterator';
|
|
15
|
+
*
|
|
16
|
+
* pipe([1, 2, 3, 4, 5].values(), chunk(2), toArray()); // => [[1, 2], [3, 4], [5]]
|
|
17
|
+
*/
|
|
18
|
+
function chunk(size) {
|
|
19
|
+
return function chunkInIterator(source) {
|
|
20
|
+
return chunk$1(source, size);
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { chunk };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region src/fp/iterator/count.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Creates a function that consumes an iterator and returns the number of
|
|
4
|
+
* elements it produces, for use as the terminal step of a {@link pipe}.
|
|
5
|
+
*
|
|
6
|
+
* This is a terminal operation: it pulls every element, so it must not be used
|
|
7
|
+
* on an infinite iterator.
|
|
8
|
+
*
|
|
9
|
+
* @template T - The type of elements produced by the source iterator.
|
|
10
|
+
* @returns A function mapping an `Iterator<T>` to its element count.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* import { pipe } from 'es-toolkit/fp';
|
|
14
|
+
* import { filter, count } from 'es-toolkit/fp/iterator';
|
|
15
|
+
*
|
|
16
|
+
* pipe([1, 2, 3, 4].values(), filter(x => x % 2 === 0), count()); // => 2
|
|
17
|
+
*/
|
|
18
|
+
declare function count<T>(): (source: Iterator<T>) => number;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { count };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region src/fp/iterator/count.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Creates a function that consumes an iterator and returns the number of
|
|
4
|
+
* elements it produces, for use as the terminal step of a {@link pipe}.
|
|
5
|
+
*
|
|
6
|
+
* This is a terminal operation: it pulls every element, so it must not be used
|
|
7
|
+
* on an infinite iterator.
|
|
8
|
+
*
|
|
9
|
+
* @template T - The type of elements produced by the source iterator.
|
|
10
|
+
* @returns A function mapping an `Iterator<T>` to its element count.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* import { pipe } from 'es-toolkit/fp';
|
|
14
|
+
* import { filter, count } from 'es-toolkit/fp/iterator';
|
|
15
|
+
*
|
|
16
|
+
* pipe([1, 2, 3, 4].values(), filter(x => x % 2 === 0), count()); // => 2
|
|
17
|
+
*/
|
|
18
|
+
declare function count<T>(): (source: Iterator<T>) => number;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { count };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const require_count = require("../../iterator/count.js");
|
|
2
|
+
//#region src/fp/iterator/count.ts
|
|
3
|
+
/**
|
|
4
|
+
* Creates a function that consumes an iterator and returns the number of
|
|
5
|
+
* elements it produces, for use as the terminal step of a {@link pipe}.
|
|
6
|
+
*
|
|
7
|
+
* This is a terminal operation: it pulls every element, so it must not be used
|
|
8
|
+
* on an infinite iterator.
|
|
9
|
+
*
|
|
10
|
+
* @template T - The type of elements produced by the source iterator.
|
|
11
|
+
* @returns A function mapping an `Iterator<T>` to its element count.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* import { pipe } from 'es-toolkit/fp';
|
|
15
|
+
* import { filter, count } from 'es-toolkit/fp/iterator';
|
|
16
|
+
*
|
|
17
|
+
* pipe([1, 2, 3, 4].values(), filter(x => x % 2 === 0), count()); // => 2
|
|
18
|
+
*/
|
|
19
|
+
function count() {
|
|
20
|
+
return function countInIterator(source) {
|
|
21
|
+
return require_count.count(source);
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
exports.count = count;
|