flingit 0.0.63 → 0.0.65
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/dist/cli/commands/dev.d.ts.map +1 -1
- package/dist/cli/commands/dev.js +9 -5
- package/dist/cli/commands/dev.js.map +1 -1
- package/dist/cli/commands/workflow.d.ts +51 -0
- package/dist/cli/commands/workflow.d.ts.map +1 -0
- package/dist/cli/commands/workflow.js +479 -0
- package/dist/cli/commands/workflow.js.map +1 -0
- package/dist/cli/deploy/bundler.d.ts.map +1 -1
- package/dist/cli/deploy/bundler.js +17 -1
- package/dist/cli/deploy/bundler.js.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +2 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/runtime/entry.d.ts +7 -0
- package/dist/runtime/entry.d.ts.map +1 -1
- package/dist/runtime/entry.js +71 -2
- package/dist/runtime/entry.js.map +1 -1
- package/dist/types/workflow.d.ts +82 -0
- package/dist/types/workflow.d.ts.map +1 -0
- package/dist/types/workflow.js +8 -0
- package/dist/types/workflow.js.map +1 -0
- package/dist/worker-runtime/d1-event-store.d.ts +22 -0
- package/dist/worker-runtime/d1-event-store.d.ts.map +1 -0
- package/dist/worker-runtime/d1-event-store.js +227 -0
- package/dist/worker-runtime/d1-event-store.js.map +1 -0
- package/dist/worker-runtime/entry-extract.d.ts.map +1 -1
- package/dist/worker-runtime/entry-extract.js +6 -3
- package/dist/worker-runtime/entry-extract.js.map +1 -1
- package/dist/worker-runtime/entry.d.ts.map +1 -1
- package/dist/worker-runtime/entry.js +105 -3
- package/dist/worker-runtime/entry.js.map +1 -1
- package/dist/worker-runtime/index.d.ts +2 -0
- package/dist/worker-runtime/index.d.ts.map +1 -1
- package/dist/worker-runtime/index.js +5 -0
- package/dist/worker-runtime/index.js.map +1 -1
- package/dist/workflow/runtime.d.ts +56 -0
- package/dist/workflow/runtime.d.ts.map +1 -0
- package/dist/workflow/runtime.js +450 -0
- package/dist/workflow/runtime.js.map +1 -0
- package/node_modules/@glideapps/ts-necessities/LICENSE +21 -0
- package/node_modules/@glideapps/ts-necessities/README.md +16 -0
- package/node_modules/@glideapps/ts-necessities/dist/branded-strings.d.ts +39 -0
- package/node_modules/@glideapps/ts-necessities/dist/default-map.d.ts +53 -0
- package/node_modules/@glideapps/ts-necessities/dist/index.d.mts +113 -0
- package/node_modules/@glideapps/ts-necessities/dist/index.d.ts +113 -0
- package/node_modules/@glideapps/ts-necessities/dist/index.js +237 -0
- package/node_modules/@glideapps/ts-necessities/dist/index.mjs +189 -0
- package/node_modules/@glideapps/ts-necessities/package.json +52 -0
- package/node_modules/@rollup/rollup-linux-x64-gnu/README.md +3 -0
- package/node_modules/@rollup/rollup-linux-x64-gnu/package.json +25 -0
- package/node_modules/@rollup/rollup-linux-x64-gnu/rollup.linux-x64-gnu.node +0 -0
- package/node_modules/base64-js/LICENSE +21 -0
- package/node_modules/base64-js/README.md +34 -0
- package/node_modules/base64-js/base64js.min.js +1 -0
- package/node_modules/base64-js/index.d.ts +3 -0
- package/node_modules/base64-js/index.js +150 -0
- package/node_modules/base64-js/package.json +47 -0
- package/node_modules/better-sqlite3/LICENSE +21 -0
- package/node_modules/better-sqlite3/README.md +99 -0
- package/node_modules/better-sqlite3/binding.gyp +38 -0
- package/node_modules/better-sqlite3/deps/common.gypi +68 -0
- package/node_modules/better-sqlite3/deps/copy.js +31 -0
- package/node_modules/better-sqlite3/deps/defines.gypi +41 -0
- package/node_modules/better-sqlite3/deps/download.sh +122 -0
- package/node_modules/better-sqlite3/deps/patches/1208.patch +15 -0
- package/node_modules/better-sqlite3/deps/sqlite3/sqlite3.c +265994 -0
- package/node_modules/better-sqlite3/deps/sqlite3/sqlite3.h +13968 -0
- package/node_modules/better-sqlite3/deps/sqlite3/sqlite3ext.h +730 -0
- package/node_modules/better-sqlite3/deps/sqlite3.gyp +80 -0
- package/node_modules/better-sqlite3/deps/test_extension.c +21 -0
- package/node_modules/better-sqlite3/lib/database.js +90 -0
- package/node_modules/better-sqlite3/lib/index.js +3 -0
- package/node_modules/better-sqlite3/lib/methods/aggregate.js +43 -0
- package/node_modules/better-sqlite3/lib/methods/backup.js +67 -0
- package/node_modules/better-sqlite3/lib/methods/function.js +31 -0
- package/node_modules/better-sqlite3/lib/methods/inspect.js +7 -0
- package/node_modules/better-sqlite3/lib/methods/pragma.js +12 -0
- package/node_modules/better-sqlite3/lib/methods/serialize.js +16 -0
- package/node_modules/better-sqlite3/lib/methods/table.js +189 -0
- package/node_modules/better-sqlite3/lib/methods/transaction.js +78 -0
- package/node_modules/better-sqlite3/lib/methods/wrappers.js +54 -0
- package/node_modules/better-sqlite3/lib/sqlite-error.js +20 -0
- package/node_modules/better-sqlite3/lib/util.js +12 -0
- package/node_modules/better-sqlite3/package.json +59 -0
- package/node_modules/better-sqlite3/src/addon.cpp +47 -0
- package/node_modules/better-sqlite3/src/better_sqlite3.cpp +74 -0
- package/node_modules/better-sqlite3/src/objects/backup.cpp +120 -0
- package/node_modules/better-sqlite3/src/objects/backup.hpp +36 -0
- package/node_modules/better-sqlite3/src/objects/database.cpp +417 -0
- package/node_modules/better-sqlite3/src/objects/database.hpp +103 -0
- package/node_modules/better-sqlite3/src/objects/statement-iterator.cpp +113 -0
- package/node_modules/better-sqlite3/src/objects/statement-iterator.hpp +50 -0
- package/node_modules/better-sqlite3/src/objects/statement.cpp +383 -0
- package/node_modules/better-sqlite3/src/objects/statement.hpp +58 -0
- package/node_modules/better-sqlite3/src/util/bind-map.cpp +73 -0
- package/node_modules/better-sqlite3/src/util/binder.cpp +193 -0
- package/node_modules/better-sqlite3/src/util/constants.cpp +172 -0
- package/node_modules/better-sqlite3/src/util/custom-aggregate.cpp +121 -0
- package/node_modules/better-sqlite3/src/util/custom-function.cpp +59 -0
- package/node_modules/better-sqlite3/src/util/custom-table.cpp +409 -0
- package/node_modules/better-sqlite3/src/util/data-converter.cpp +17 -0
- package/node_modules/better-sqlite3/src/util/data.cpp +194 -0
- package/node_modules/better-sqlite3/src/util/helpers.cpp +109 -0
- package/node_modules/better-sqlite3/src/util/macros.cpp +83 -0
- package/node_modules/better-sqlite3/src/util/query-macros.cpp +71 -0
- package/node_modules/better-sqlite3/src/util/row-builder.cpp +49 -0
- package/node_modules/bindings/LICENSE.md +22 -0
- package/node_modules/bindings/README.md +98 -0
- package/node_modules/bindings/bindings.js +221 -0
- package/node_modules/bindings/package.json +28 -0
- package/node_modules/bl/.travis.yml +17 -0
- package/node_modules/bl/BufferList.js +396 -0
- package/node_modules/bl/LICENSE.md +13 -0
- package/node_modules/bl/README.md +247 -0
- package/node_modules/bl/bl.js +84 -0
- package/node_modules/bl/package.json +37 -0
- package/node_modules/bl/test/convert.js +21 -0
- package/node_modules/bl/test/indexOf.js +492 -0
- package/node_modules/bl/test/isBufferList.js +32 -0
- package/node_modules/bl/test/test.js +869 -0
- package/node_modules/buffer/AUTHORS.md +70 -0
- package/node_modules/buffer/LICENSE +21 -0
- package/node_modules/buffer/README.md +410 -0
- package/node_modules/buffer/index.d.ts +186 -0
- package/node_modules/buffer/index.js +1817 -0
- package/node_modules/buffer/package.json +96 -0
- package/node_modules/chownr/LICENSE +15 -0
- package/node_modules/chownr/README.md +3 -0
- package/node_modules/chownr/chownr.js +167 -0
- package/node_modules/chownr/package.json +29 -0
- package/node_modules/decompress-response/index.d.ts +22 -0
- package/node_modules/decompress-response/index.js +58 -0
- package/node_modules/decompress-response/license +9 -0
- package/node_modules/decompress-response/package.json +56 -0
- package/node_modules/decompress-response/readme.md +48 -0
- package/node_modules/deep-extend/LICENSE +20 -0
- package/node_modules/deep-extend/README.md +91 -0
- package/node_modules/deep-extend/index.js +1 -0
- package/node_modules/deep-extend/lib/deep-extend.js +150 -0
- package/node_modules/deep-extend/package.json +62 -0
- package/node_modules/detect-libc/LICENSE +201 -0
- package/node_modules/detect-libc/README.md +163 -0
- package/node_modules/detect-libc/index.d.ts +14 -0
- package/node_modules/detect-libc/lib/detect-libc.js +313 -0
- package/node_modules/detect-libc/lib/elf.js +39 -0
- package/node_modules/detect-libc/lib/filesystem.js +51 -0
- package/node_modules/detect-libc/lib/process.js +24 -0
- package/node_modules/detect-libc/package.json +44 -0
- package/node_modules/determined/LICENSE +18 -0
- package/node_modules/determined/README.md +317 -0
- package/node_modules/determined/dist/index.cjs +370 -0
- package/node_modules/determined/dist/index.d.cts +110 -0
- package/node_modules/determined/dist/index.d.ts +110 -0
- package/node_modules/determined/dist/index.js +332 -0
- package/node_modules/determined/package.json +45 -0
- package/node_modules/end-of-stream/LICENSE +21 -0
- package/node_modules/end-of-stream/README.md +54 -0
- package/node_modules/end-of-stream/index.js +96 -0
- package/node_modules/end-of-stream/package.json +37 -0
- package/node_modules/expand-template/.travis.yml +6 -0
- package/node_modules/expand-template/LICENSE +21 -0
- package/node_modules/expand-template/README.md +43 -0
- package/node_modules/expand-template/index.js +26 -0
- package/node_modules/expand-template/package.json +29 -0
- package/node_modules/expand-template/test.js +67 -0
- package/node_modules/file-uri-to-path/.npmignore +1 -0
- package/node_modules/file-uri-to-path/.travis.yml +30 -0
- package/node_modules/file-uri-to-path/History.md +21 -0
- package/node_modules/file-uri-to-path/LICENSE +20 -0
- package/node_modules/file-uri-to-path/README.md +74 -0
- package/node_modules/file-uri-to-path/index.d.ts +2 -0
- package/node_modules/file-uri-to-path/index.js +66 -0
- package/node_modules/file-uri-to-path/package.json +32 -0
- package/node_modules/file-uri-to-path/test/test.js +24 -0
- package/node_modules/file-uri-to-path/test/tests.json +13 -0
- package/node_modules/flingflow/.nvmrc +1 -0
- package/node_modules/flingflow/AGENTS.md +5 -0
- package/node_modules/flingflow/README.md +679 -0
- package/node_modules/flingflow/SPEC.md +554 -0
- package/node_modules/flingflow/TESTING.md +506 -0
- package/node_modules/flingflow/dist/backoff.d.ts +9 -0
- package/node_modules/flingflow/dist/backoff.js +14 -0
- package/node_modules/flingflow/dist/backoff.js.map +1 -0
- package/node_modules/flingflow/dist/clock.d.ts +13 -0
- package/node_modules/flingflow/dist/clock.js +21 -0
- package/node_modules/flingflow/dist/clock.js.map +1 -0
- package/node_modules/flingflow/dist/context.d.ts +8 -0
- package/node_modules/flingflow/dist/context.js +45 -0
- package/node_modules/flingflow/dist/context.js.map +1 -0
- package/node_modules/flingflow/dist/engine.d.ts +29 -0
- package/node_modules/flingflow/dist/engine.js +306 -0
- package/node_modules/flingflow/dist/engine.js.map +1 -0
- package/node_modules/flingflow/dist/index.d.ts +18 -0
- package/node_modules/flingflow/dist/index.js +14 -0
- package/node_modules/flingflow/dist/index.js.map +1 -0
- package/node_modules/flingflow/dist/recovery.d.ts +16 -0
- package/node_modules/flingflow/dist/recovery.js +118 -0
- package/node_modules/flingflow/dist/recovery.js.map +1 -0
- package/node_modules/flingflow/dist/registry.d.ts +24 -0
- package/node_modules/flingflow/dist/registry.js +29 -0
- package/node_modules/flingflow/dist/registry.js.map +1 -0
- package/node_modules/flingflow/dist/store-memory.d.ts +29 -0
- package/node_modules/flingflow/dist/store-memory.js +349 -0
- package/node_modules/flingflow/dist/store-memory.js.map +1 -0
- package/node_modules/flingflow/dist/store-sqlite.d.ts +30 -0
- package/node_modules/flingflow/dist/store-sqlite.js +400 -0
- package/node_modules/flingflow/dist/store-sqlite.js.map +1 -0
- package/node_modules/flingflow/dist/store.d.ts +39 -0
- package/node_modules/flingflow/dist/store.js +21 -0
- package/node_modules/flingflow/dist/store.js.map +1 -0
- package/node_modules/flingflow/dist/stress.d.ts +1 -0
- package/node_modules/flingflow/dist/stress.js +377 -0
- package/node_modules/flingflow/dist/stress.js.map +1 -0
- package/node_modules/flingflow/dist/transitions.d.ts +14 -0
- package/node_modules/flingflow/dist/transitions.js +28 -0
- package/node_modules/flingflow/dist/transitions.js.map +1 -0
- package/node_modules/flingflow/dist/types.d.ts +114 -0
- package/node_modules/flingflow/dist/types.js +10 -0
- package/node_modules/flingflow/dist/types.js.map +1 -0
- package/node_modules/flingflow/eslint.config.js +94 -0
- package/node_modules/flingflow/package.json +66 -0
- package/node_modules/flingflow/src/backoff.ts +14 -0
- package/node_modules/flingflow/src/clock.ts +29 -0
- package/node_modules/flingflow/src/context.ts +60 -0
- package/node_modules/flingflow/src/engine.ts +367 -0
- package/node_modules/flingflow/src/index.ts +52 -0
- package/node_modules/flingflow/src/recovery.ts +144 -0
- package/node_modules/flingflow/src/registry.ts +52 -0
- package/node_modules/flingflow/src/store-memory.ts +378 -0
- package/node_modules/flingflow/src/store-sqlite.ts +451 -0
- package/node_modules/flingflow/src/store.ts +55 -0
- package/node_modules/flingflow/src/stress.ts +423 -0
- package/node_modules/flingflow/src/transitions.ts +38 -0
- package/node_modules/flingflow/src/types.ts +84 -0
- package/node_modules/flingflow/test/backoff.test.ts +54 -0
- package/node_modules/flingflow/test/context.test.ts +94 -0
- package/node_modules/flingflow/test/engine.test.ts +362 -0
- package/node_modules/flingflow/test/fixtures.ts +58 -0
- package/node_modules/flingflow/test/recovery.test.ts +176 -0
- package/node_modules/flingflow/test/simulation.test.ts +395 -0
- package/node_modules/flingflow/test/store-conformance.ts +344 -0
- package/node_modules/flingflow/test/store-memory.test.ts +8 -0
- package/node_modules/flingflow/test/store-sqlite.test.ts +8 -0
- package/node_modules/flingflow/tsconfig.json +18 -0
- package/node_modules/flingflow/tsconfig.lint.json +5 -0
- package/node_modules/flingflow/tsconfig.typecheck.json +20 -0
- package/node_modules/flingflow/vitest.config.ts +10 -0
- package/node_modules/fs-constants/LICENSE +21 -0
- package/node_modules/fs-constants/README.md +26 -0
- package/node_modules/fs-constants/browser.js +1 -0
- package/node_modules/fs-constants/index.js +1 -0
- package/node_modules/fs-constants/package.json +19 -0
- package/node_modules/github-from-package/.travis.yml +4 -0
- package/node_modules/github-from-package/LICENSE +18 -0
- package/node_modules/github-from-package/example/package.json +8 -0
- package/node_modules/github-from-package/example/url.js +3 -0
- package/node_modules/github-from-package/index.js +17 -0
- package/node_modules/github-from-package/package.json +30 -0
- package/node_modules/github-from-package/readme.markdown +53 -0
- package/node_modules/github-from-package/test/a.json +8 -0
- package/node_modules/github-from-package/test/b.json +5 -0
- package/node_modules/github-from-package/test/c.json +5 -0
- package/node_modules/github-from-package/test/d.json +7 -0
- package/node_modules/github-from-package/test/e.json +5 -0
- package/node_modules/github-from-package/test/url.js +19 -0
- package/node_modules/ieee754/LICENSE +11 -0
- package/node_modules/ieee754/README.md +51 -0
- package/node_modules/ieee754/index.d.ts +10 -0
- package/node_modules/ieee754/index.js +85 -0
- package/node_modules/ieee754/package.json +52 -0
- package/node_modules/inherits/LICENSE +16 -0
- package/node_modules/inherits/README.md +42 -0
- package/node_modules/inherits/inherits.js +9 -0
- package/node_modules/inherits/inherits_browser.js +27 -0
- package/node_modules/inherits/package.json +29 -0
- package/node_modules/ini/LICENSE +15 -0
- package/node_modules/ini/README.md +102 -0
- package/node_modules/ini/ini.js +206 -0
- package/node_modules/ini/package.json +33 -0
- package/node_modules/mimic-response/index.d.ts +17 -0
- package/node_modules/mimic-response/index.js +77 -0
- package/node_modules/mimic-response/license +9 -0
- package/node_modules/mimic-response/package.json +42 -0
- package/node_modules/mimic-response/readme.md +78 -0
- package/node_modules/minimist/.eslintrc +29 -0
- package/node_modules/minimist/.github/FUNDING.yml +12 -0
- package/node_modules/minimist/.nycrc +14 -0
- package/node_modules/minimist/CHANGELOG.md +298 -0
- package/node_modules/minimist/LICENSE +18 -0
- package/node_modules/minimist/README.md +121 -0
- package/node_modules/minimist/example/parse.js +4 -0
- package/node_modules/minimist/index.js +263 -0
- package/node_modules/minimist/package.json +75 -0
- package/node_modules/minimist/test/all_bool.js +34 -0
- package/node_modules/minimist/test/bool.js +177 -0
- package/node_modules/minimist/test/dash.js +43 -0
- package/node_modules/minimist/test/default_bool.js +37 -0
- package/node_modules/minimist/test/dotted.js +24 -0
- package/node_modules/minimist/test/kv_short.js +32 -0
- package/node_modules/minimist/test/long.js +33 -0
- package/node_modules/minimist/test/num.js +38 -0
- package/node_modules/minimist/test/parse.js +209 -0
- package/node_modules/minimist/test/parse_modified.js +11 -0
- package/node_modules/minimist/test/proto.js +64 -0
- package/node_modules/minimist/test/short.js +69 -0
- package/node_modules/minimist/test/stop_early.js +17 -0
- package/node_modules/minimist/test/unknown.js +104 -0
- package/node_modules/minimist/test/whitespace.js +10 -0
- package/node_modules/mkdirp-classic/LICENSE +21 -0
- package/node_modules/mkdirp-classic/README.md +18 -0
- package/node_modules/mkdirp-classic/index.js +98 -0
- package/node_modules/mkdirp-classic/package.json +18 -0
- package/node_modules/napi-build-utils/.github/workflows/run-npm-tests.yml +31 -0
- package/node_modules/napi-build-utils/LICENSE +21 -0
- package/node_modules/napi-build-utils/README.md +52 -0
- package/node_modules/napi-build-utils/index.js +214 -0
- package/node_modules/napi-build-utils/index.md +0 -0
- package/node_modules/napi-build-utils/package.json +42 -0
- package/node_modules/neverthrow/LICENSE +22 -0
- package/node_modules/neverthrow/README.md +1683 -0
- package/node_modules/neverthrow/dist/index.cjs.js +510 -0
- package/node_modules/neverthrow/dist/index.d.ts +408 -0
- package/node_modules/neverthrow/dist/index.es.js +497 -0
- package/node_modules/neverthrow/package.json +64 -0
- package/node_modules/node-abi/LICENSE +21 -0
- package/node_modules/node-abi/README.md +54 -0
- package/node_modules/node-abi/abi_registry.json +425 -0
- package/node_modules/node-abi/index.js +179 -0
- package/node_modules/node-abi/package.json +45 -0
- package/node_modules/once/LICENSE +15 -0
- package/node_modules/once/README.md +79 -0
- package/node_modules/once/once.js +42 -0
- package/node_modules/once/package.json +33 -0
- package/node_modules/prebuild-install/CHANGELOG.md +131 -0
- package/node_modules/prebuild-install/CONTRIBUTING.md +6 -0
- package/node_modules/prebuild-install/LICENSE +21 -0
- package/node_modules/prebuild-install/README.md +163 -0
- package/node_modules/prebuild-install/asset.js +44 -0
- package/node_modules/prebuild-install/bin.js +78 -0
- package/node_modules/prebuild-install/download.js +142 -0
- package/node_modules/prebuild-install/error.js +14 -0
- package/node_modules/prebuild-install/help.txt +16 -0
- package/node_modules/prebuild-install/index.js +1 -0
- package/node_modules/prebuild-install/log.js +33 -0
- package/node_modules/prebuild-install/package.json +67 -0
- package/node_modules/prebuild-install/proxy.js +35 -0
- package/node_modules/prebuild-install/rc.js +64 -0
- package/node_modules/prebuild-install/util.js +143 -0
- package/node_modules/pump/.github/FUNDING.yml +2 -0
- package/node_modules/pump/.travis.yml +5 -0
- package/node_modules/pump/LICENSE +21 -0
- package/node_modules/pump/README.md +74 -0
- package/node_modules/pump/SECURITY.md +5 -0
- package/node_modules/pump/index.js +86 -0
- package/node_modules/pump/package.json +24 -0
- package/node_modules/pump/test-browser.js +66 -0
- package/node_modules/pump/test-node.js +53 -0
- package/node_modules/rc/LICENSE.APACHE2 +15 -0
- package/node_modules/rc/LICENSE.BSD +26 -0
- package/node_modules/rc/LICENSE.MIT +24 -0
- package/node_modules/rc/README.md +227 -0
- package/node_modules/rc/browser.js +7 -0
- package/node_modules/rc/cli.js +4 -0
- package/node_modules/rc/index.js +53 -0
- package/node_modules/rc/lib/utils.js +104 -0
- package/node_modules/rc/package.json +29 -0
- package/node_modules/rc/test/ini.js +16 -0
- package/node_modules/rc/test/nested-env-vars.js +50 -0
- package/node_modules/rc/test/test.js +59 -0
- package/node_modules/readable-stream/CONTRIBUTING.md +38 -0
- package/node_modules/readable-stream/GOVERNANCE.md +136 -0
- package/node_modules/readable-stream/LICENSE +47 -0
- package/node_modules/readable-stream/README.md +106 -0
- package/node_modules/readable-stream/errors-browser.js +127 -0
- package/node_modules/readable-stream/errors.js +116 -0
- package/node_modules/readable-stream/experimentalWarning.js +17 -0
- package/node_modules/readable-stream/lib/_stream_duplex.js +126 -0
- package/node_modules/readable-stream/lib/_stream_passthrough.js +37 -0
- package/node_modules/readable-stream/lib/_stream_readable.js +1027 -0
- package/node_modules/readable-stream/lib/_stream_transform.js +190 -0
- package/node_modules/readable-stream/lib/_stream_writable.js +641 -0
- package/node_modules/readable-stream/lib/internal/streams/async_iterator.js +180 -0
- package/node_modules/readable-stream/lib/internal/streams/buffer_list.js +183 -0
- package/node_modules/readable-stream/lib/internal/streams/destroy.js +96 -0
- package/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +86 -0
- package/node_modules/readable-stream/lib/internal/streams/from-browser.js +3 -0
- package/node_modules/readable-stream/lib/internal/streams/from.js +52 -0
- package/node_modules/readable-stream/lib/internal/streams/pipeline.js +86 -0
- package/node_modules/readable-stream/lib/internal/streams/state.js +22 -0
- package/node_modules/readable-stream/lib/internal/streams/stream-browser.js +1 -0
- package/node_modules/readable-stream/lib/internal/streams/stream.js +1 -0
- package/node_modules/readable-stream/package.json +68 -0
- package/node_modules/readable-stream/readable-browser.js +9 -0
- package/node_modules/readable-stream/readable.js +16 -0
- package/node_modules/safe-buffer/LICENSE +21 -0
- package/node_modules/safe-buffer/README.md +584 -0
- package/node_modules/safe-buffer/index.d.ts +187 -0
- package/node_modules/safe-buffer/index.js +65 -0
- package/node_modules/safe-buffer/package.json +51 -0
- package/node_modules/semver/LICENSE +15 -0
- package/node_modules/semver/README.md +664 -0
- package/node_modules/semver/bin/semver.js +191 -0
- package/node_modules/semver/classes/comparator.js +143 -0
- package/node_modules/semver/classes/index.js +7 -0
- package/node_modules/semver/classes/range.js +557 -0
- package/node_modules/semver/classes/semver.js +333 -0
- package/node_modules/semver/functions/clean.js +8 -0
- package/node_modules/semver/functions/cmp.js +54 -0
- package/node_modules/semver/functions/coerce.js +62 -0
- package/node_modules/semver/functions/compare-build.js +9 -0
- package/node_modules/semver/functions/compare-loose.js +5 -0
- package/node_modules/semver/functions/compare.js +7 -0
- package/node_modules/semver/functions/diff.js +60 -0
- package/node_modules/semver/functions/eq.js +5 -0
- package/node_modules/semver/functions/gt.js +5 -0
- package/node_modules/semver/functions/gte.js +5 -0
- package/node_modules/semver/functions/inc.js +21 -0
- package/node_modules/semver/functions/lt.js +5 -0
- package/node_modules/semver/functions/lte.js +5 -0
- package/node_modules/semver/functions/major.js +5 -0
- package/node_modules/semver/functions/minor.js +5 -0
- package/node_modules/semver/functions/neq.js +5 -0
- package/node_modules/semver/functions/parse.js +18 -0
- package/node_modules/semver/functions/patch.js +5 -0
- package/node_modules/semver/functions/prerelease.js +8 -0
- package/node_modules/semver/functions/rcompare.js +5 -0
- package/node_modules/semver/functions/rsort.js +5 -0
- package/node_modules/semver/functions/satisfies.js +12 -0
- package/node_modules/semver/functions/sort.js +5 -0
- package/node_modules/semver/functions/valid.js +8 -0
- package/node_modules/semver/index.js +91 -0
- package/node_modules/semver/internal/constants.js +37 -0
- package/node_modules/semver/internal/debug.js +11 -0
- package/node_modules/semver/internal/identifiers.js +29 -0
- package/node_modules/semver/internal/lrucache.js +42 -0
- package/node_modules/semver/internal/parse-options.js +17 -0
- package/node_modules/semver/internal/re.js +223 -0
- package/node_modules/semver/package.json +78 -0
- package/node_modules/semver/preload.js +4 -0
- package/node_modules/semver/range.bnf +16 -0
- package/node_modules/semver/ranges/gtr.js +6 -0
- package/node_modules/semver/ranges/intersects.js +9 -0
- package/node_modules/semver/ranges/ltr.js +6 -0
- package/node_modules/semver/ranges/max-satisfying.js +27 -0
- package/node_modules/semver/ranges/min-satisfying.js +26 -0
- package/node_modules/semver/ranges/min-version.js +63 -0
- package/node_modules/semver/ranges/outside.js +82 -0
- package/node_modules/semver/ranges/simplify.js +49 -0
- package/node_modules/semver/ranges/subset.js +249 -0
- package/node_modules/semver/ranges/to-comparators.js +10 -0
- package/node_modules/semver/ranges/valid.js +13 -0
- package/node_modules/simple-concat/.travis.yml +3 -0
- package/node_modules/simple-concat/LICENSE +20 -0
- package/node_modules/simple-concat/README.md +44 -0
- package/node_modules/simple-concat/index.js +15 -0
- package/node_modules/simple-concat/package.json +47 -0
- package/node_modules/simple-concat/test/basic.js +41 -0
- package/node_modules/simple-get/.github/dependabot.yml +15 -0
- package/node_modules/simple-get/.github/workflows/ci.yml +23 -0
- package/node_modules/simple-get/LICENSE +20 -0
- package/node_modules/simple-get/README.md +333 -0
- package/node_modules/simple-get/index.js +108 -0
- package/node_modules/simple-get/package.json +67 -0
- package/node_modules/string_decoder/LICENSE +48 -0
- package/node_modules/string_decoder/README.md +47 -0
- package/node_modules/string_decoder/lib/string_decoder.js +296 -0
- package/node_modules/string_decoder/package.json +34 -0
- package/node_modules/strip-json-comments/index.js +70 -0
- package/node_modules/strip-json-comments/license +21 -0
- package/node_modules/strip-json-comments/package.json +42 -0
- package/node_modules/strip-json-comments/readme.md +64 -0
- package/node_modules/tar-fs/.travis.yml +6 -0
- package/node_modules/tar-fs/LICENSE +21 -0
- package/node_modules/tar-fs/README.md +165 -0
- package/node_modules/tar-fs/index.js +363 -0
- package/node_modules/tar-fs/package.json +41 -0
- package/node_modules/tar-fs/test/fixtures/a/hello.txt +1 -0
- package/node_modules/tar-fs/test/fixtures/b/a/test.txt +1 -0
- package/node_modules/tar-fs/test/fixtures/d/file1 +0 -0
- package/node_modules/tar-fs/test/fixtures/d/file2 +0 -0
- package/node_modules/tar-fs/test/fixtures/d/sub-dir/file5 +0 -0
- package/node_modules/tar-fs/test/fixtures/d/sub-files/file3 +0 -0
- package/node_modules/tar-fs/test/fixtures/d/sub-files/file4 +0 -0
- package/node_modules/tar-fs/test/fixtures/e/directory/.ignore +0 -0
- package/node_modules/tar-fs/test/fixtures/e/file +0 -0
- package/node_modules/tar-fs/test/fixtures/invalid.tar +0 -0
- package/node_modules/tar-fs/test/index.js +346 -0
- package/node_modules/tar-stream/LICENSE +21 -0
- package/node_modules/tar-stream/README.md +168 -0
- package/node_modules/tar-stream/extract.js +257 -0
- package/node_modules/tar-stream/headers.js +295 -0
- package/node_modules/tar-stream/index.js +2 -0
- package/node_modules/tar-stream/pack.js +255 -0
- package/node_modules/tar-stream/package.json +58 -0
- package/node_modules/tar-stream/sandbox.js +11 -0
- package/node_modules/tunnel-agent/LICENSE +55 -0
- package/node_modules/tunnel-agent/README.md +4 -0
- package/node_modules/tunnel-agent/index.js +244 -0
- package/node_modules/tunnel-agent/package.json +22 -0
- package/node_modules/util-deprecate/History.md +16 -0
- package/node_modules/util-deprecate/LICENSE +24 -0
- package/node_modules/util-deprecate/README.md +53 -0
- package/node_modules/util-deprecate/browser.js +67 -0
- package/node_modules/util-deprecate/node.js +6 -0
- package/node_modules/util-deprecate/package.json +27 -0
- package/node_modules/wrappy/LICENSE +15 -0
- package/node_modules/wrappy/README.md +36 -0
- package/node_modules/wrappy/package.json +29 -0
- package/node_modules/wrappy/wrappy.js +33 -0
- package/package.json +12 -2
- package/templates/default/dot-claude/skills/fling/.hash +1 -1
- package/templates/default/dot-claude/skills/fling/SKILL.md +56 -29
- package/templates/default/dot-claude/skills/fling/references/WORKFLOWS.md +368 -0
|
@@ -0,0 +1,497 @@
|
|
|
1
|
+
const defaultErrorConfig = {
|
|
2
|
+
withStackTrace: false,
|
|
3
|
+
};
|
|
4
|
+
// Custom error object
|
|
5
|
+
// Context / discussion: https://github.com/supermacro/neverthrow/pull/215
|
|
6
|
+
const createNeverThrowError = (message, result, config = defaultErrorConfig) => {
|
|
7
|
+
const data = result.isOk()
|
|
8
|
+
? { type: 'Ok', value: result.value }
|
|
9
|
+
: { type: 'Err', value: result.error };
|
|
10
|
+
const maybeStack = config.withStackTrace ? new Error().stack : undefined;
|
|
11
|
+
return {
|
|
12
|
+
data,
|
|
13
|
+
message,
|
|
14
|
+
stack: maybeStack,
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/******************************************************************************
|
|
19
|
+
Copyright (c) Microsoft Corporation.
|
|
20
|
+
|
|
21
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
22
|
+
purpose with or without fee is hereby granted.
|
|
23
|
+
|
|
24
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
25
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
26
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
27
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
28
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
29
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
30
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
31
|
+
***************************************************************************** */
|
|
32
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
36
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
39
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
40
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
41
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function __values(o) {
|
|
46
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
47
|
+
if (m) return m.call(o);
|
|
48
|
+
if (o && typeof o.length === "number") return {
|
|
49
|
+
next: function () {
|
|
50
|
+
if (o && i >= o.length) o = void 0;
|
|
51
|
+
return { value: o && o[i++], done: !o };
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function __await(v) {
|
|
58
|
+
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
62
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
63
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
64
|
+
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
65
|
+
function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
|
|
66
|
+
function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
|
|
67
|
+
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
|
68
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
69
|
+
function fulfill(value) { resume("next", value); }
|
|
70
|
+
function reject(value) { resume("throw", value); }
|
|
71
|
+
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function __asyncDelegator(o) {
|
|
75
|
+
var i, p;
|
|
76
|
+
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
77
|
+
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function __asyncValues(o) {
|
|
81
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
82
|
+
var m = o[Symbol.asyncIterator], i;
|
|
83
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
84
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
85
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
89
|
+
var e = new Error(message);
|
|
90
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
class ResultAsync {
|
|
94
|
+
constructor(res) {
|
|
95
|
+
this._promise = res;
|
|
96
|
+
}
|
|
97
|
+
static fromSafePromise(promise) {
|
|
98
|
+
const newPromise = promise.then((value) => new Ok(value));
|
|
99
|
+
return new ResultAsync(newPromise);
|
|
100
|
+
}
|
|
101
|
+
static fromPromise(promise, errorFn) {
|
|
102
|
+
const newPromise = promise
|
|
103
|
+
.then((value) => new Ok(value))
|
|
104
|
+
.catch((e) => new Err(errorFn(e)));
|
|
105
|
+
return new ResultAsync(newPromise);
|
|
106
|
+
}
|
|
107
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
108
|
+
static fromThrowable(fn, errorFn) {
|
|
109
|
+
return (...args) => {
|
|
110
|
+
return new ResultAsync((() => __awaiter(this, void 0, void 0, function* () {
|
|
111
|
+
try {
|
|
112
|
+
return new Ok(yield fn(...args));
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
return new Err(errorFn ? errorFn(error) : error);
|
|
116
|
+
}
|
|
117
|
+
}))());
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
static combine(asyncResultList) {
|
|
121
|
+
return combineResultAsyncList(asyncResultList);
|
|
122
|
+
}
|
|
123
|
+
static combineWithAllErrors(asyncResultList) {
|
|
124
|
+
return combineResultAsyncListWithAllErrors(asyncResultList);
|
|
125
|
+
}
|
|
126
|
+
map(f) {
|
|
127
|
+
return new ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
|
|
128
|
+
if (res.isErr()) {
|
|
129
|
+
return new Err(res.error);
|
|
130
|
+
}
|
|
131
|
+
return new Ok(yield f(res.value));
|
|
132
|
+
})));
|
|
133
|
+
}
|
|
134
|
+
andThrough(f) {
|
|
135
|
+
return new ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
|
|
136
|
+
if (res.isErr()) {
|
|
137
|
+
return new Err(res.error);
|
|
138
|
+
}
|
|
139
|
+
const newRes = yield f(res.value);
|
|
140
|
+
if (newRes.isErr()) {
|
|
141
|
+
return new Err(newRes.error);
|
|
142
|
+
}
|
|
143
|
+
return new Ok(res.value);
|
|
144
|
+
})));
|
|
145
|
+
}
|
|
146
|
+
andTee(f) {
|
|
147
|
+
return new ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
|
|
148
|
+
if (res.isErr()) {
|
|
149
|
+
return new Err(res.error);
|
|
150
|
+
}
|
|
151
|
+
try {
|
|
152
|
+
yield f(res.value);
|
|
153
|
+
}
|
|
154
|
+
catch (e) {
|
|
155
|
+
// Tee does not care about the error
|
|
156
|
+
}
|
|
157
|
+
return new Ok(res.value);
|
|
158
|
+
})));
|
|
159
|
+
}
|
|
160
|
+
orTee(f) {
|
|
161
|
+
return new ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
|
|
162
|
+
if (res.isOk()) {
|
|
163
|
+
return new Ok(res.value);
|
|
164
|
+
}
|
|
165
|
+
try {
|
|
166
|
+
yield f(res.error);
|
|
167
|
+
}
|
|
168
|
+
catch (e) {
|
|
169
|
+
// Tee does not care about the error
|
|
170
|
+
}
|
|
171
|
+
return new Err(res.error);
|
|
172
|
+
})));
|
|
173
|
+
}
|
|
174
|
+
mapErr(f) {
|
|
175
|
+
return new ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
|
|
176
|
+
if (res.isOk()) {
|
|
177
|
+
return new Ok(res.value);
|
|
178
|
+
}
|
|
179
|
+
return new Err(yield f(res.error));
|
|
180
|
+
})));
|
|
181
|
+
}
|
|
182
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
183
|
+
andThen(f) {
|
|
184
|
+
return new ResultAsync(this._promise.then((res) => {
|
|
185
|
+
if (res.isErr()) {
|
|
186
|
+
return new Err(res.error);
|
|
187
|
+
}
|
|
188
|
+
const newValue = f(res.value);
|
|
189
|
+
return newValue instanceof ResultAsync ? newValue._promise : newValue;
|
|
190
|
+
}));
|
|
191
|
+
}
|
|
192
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
193
|
+
orElse(f) {
|
|
194
|
+
return new ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
|
|
195
|
+
if (res.isErr()) {
|
|
196
|
+
return f(res.error);
|
|
197
|
+
}
|
|
198
|
+
return new Ok(res.value);
|
|
199
|
+
})));
|
|
200
|
+
}
|
|
201
|
+
match(ok, _err) {
|
|
202
|
+
return this._promise.then((res) => res.match(ok, _err));
|
|
203
|
+
}
|
|
204
|
+
unwrapOr(t) {
|
|
205
|
+
return this._promise.then((res) => res.unwrapOr(t));
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* @deprecated will be removed in 9.0.0.
|
|
209
|
+
*
|
|
210
|
+
* You can use `safeTry` without this method.
|
|
211
|
+
* @example
|
|
212
|
+
* ```typescript
|
|
213
|
+
* safeTry(async function* () {
|
|
214
|
+
* const okValue = yield* yourResult
|
|
215
|
+
* })
|
|
216
|
+
* ```
|
|
217
|
+
* Emulates Rust's `?` operator in `safeTry`'s body. See also `safeTry`.
|
|
218
|
+
*/
|
|
219
|
+
safeUnwrap() {
|
|
220
|
+
return __asyncGenerator(this, arguments, function* safeUnwrap_1() {
|
|
221
|
+
return yield __await(yield __await(yield* __asyncDelegator(__asyncValues(yield __await(this._promise.then((res) => res.safeUnwrap()))))));
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
// Makes ResultAsync implement PromiseLike<Result>
|
|
225
|
+
then(successCallback, failureCallback) {
|
|
226
|
+
return this._promise.then(successCallback, failureCallback);
|
|
227
|
+
}
|
|
228
|
+
[Symbol.asyncIterator]() {
|
|
229
|
+
return __asyncGenerator(this, arguments, function* _a() {
|
|
230
|
+
const result = yield __await(this._promise);
|
|
231
|
+
if (result.isErr()) {
|
|
232
|
+
// @ts-expect-error -- This is structurally equivalent and safe
|
|
233
|
+
yield yield __await(errAsync(result.error));
|
|
234
|
+
}
|
|
235
|
+
// @ts-expect-error -- This is structurally equivalent and safe
|
|
236
|
+
return yield __await(result.value);
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
function okAsync(value) {
|
|
241
|
+
return new ResultAsync(Promise.resolve(new Ok(value)));
|
|
242
|
+
}
|
|
243
|
+
function errAsync(err) {
|
|
244
|
+
return new ResultAsync(Promise.resolve(new Err(err)));
|
|
245
|
+
}
|
|
246
|
+
const fromPromise = ResultAsync.fromPromise;
|
|
247
|
+
const fromSafePromise = ResultAsync.fromSafePromise;
|
|
248
|
+
const fromAsyncThrowable = ResultAsync.fromThrowable;
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Short circuits on the FIRST Err value that we find
|
|
252
|
+
*/
|
|
253
|
+
const combineResultList = (resultList) => {
|
|
254
|
+
let acc = ok([]);
|
|
255
|
+
for (const result of resultList) {
|
|
256
|
+
if (result.isErr()) {
|
|
257
|
+
acc = err(result.error);
|
|
258
|
+
break;
|
|
259
|
+
}
|
|
260
|
+
else {
|
|
261
|
+
acc.map((list) => list.push(result.value));
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
return acc;
|
|
265
|
+
};
|
|
266
|
+
/* This is the typesafe version of Promise.all
|
|
267
|
+
*
|
|
268
|
+
* Takes a list of ResultAsync<T, E> and success if all inner results are Ok values
|
|
269
|
+
* or fails if one (or more) of the inner results are Err values
|
|
270
|
+
*/
|
|
271
|
+
const combineResultAsyncList = (asyncResultList) => ResultAsync.fromSafePromise(Promise.all(asyncResultList)).andThen(combineResultList);
|
|
272
|
+
/**
|
|
273
|
+
* Give a list of all the errors we find
|
|
274
|
+
*/
|
|
275
|
+
const combineResultListWithAllErrors = (resultList) => {
|
|
276
|
+
let acc = ok([]);
|
|
277
|
+
for (const result of resultList) {
|
|
278
|
+
if (result.isErr() && acc.isErr()) {
|
|
279
|
+
acc.error.push(result.error);
|
|
280
|
+
}
|
|
281
|
+
else if (result.isErr() && acc.isOk()) {
|
|
282
|
+
acc = err([result.error]);
|
|
283
|
+
}
|
|
284
|
+
else if (result.isOk() && acc.isOk()) {
|
|
285
|
+
acc.value.push(result.value);
|
|
286
|
+
}
|
|
287
|
+
// do nothing when result.isOk() && acc.isErr()
|
|
288
|
+
}
|
|
289
|
+
return acc;
|
|
290
|
+
};
|
|
291
|
+
const combineResultAsyncListWithAllErrors = (asyncResultList) => ResultAsync.fromSafePromise(Promise.all(asyncResultList)).andThen(combineResultListWithAllErrors);
|
|
292
|
+
|
|
293
|
+
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
294
|
+
var Result;
|
|
295
|
+
(function (Result) {
|
|
296
|
+
/**
|
|
297
|
+
* Wraps a function with a try catch, creating a new function with the same
|
|
298
|
+
* arguments but returning `Ok` if successful, `Err` if the function throws
|
|
299
|
+
*
|
|
300
|
+
* @param fn function to wrap with ok on success or err on failure
|
|
301
|
+
* @param errorFn when an error is thrown, this will wrap the error result if provided
|
|
302
|
+
*/
|
|
303
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
304
|
+
function fromThrowable(fn, errorFn) {
|
|
305
|
+
return (...args) => {
|
|
306
|
+
try {
|
|
307
|
+
const result = fn(...args);
|
|
308
|
+
return ok(result);
|
|
309
|
+
}
|
|
310
|
+
catch (e) {
|
|
311
|
+
return err(errorFn ? errorFn(e) : e);
|
|
312
|
+
}
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
Result.fromThrowable = fromThrowable;
|
|
316
|
+
function combine(resultList) {
|
|
317
|
+
return combineResultList(resultList);
|
|
318
|
+
}
|
|
319
|
+
Result.combine = combine;
|
|
320
|
+
function combineWithAllErrors(resultList) {
|
|
321
|
+
return combineResultListWithAllErrors(resultList);
|
|
322
|
+
}
|
|
323
|
+
Result.combineWithAllErrors = combineWithAllErrors;
|
|
324
|
+
})(Result || (Result = {}));
|
|
325
|
+
function ok(value) {
|
|
326
|
+
return new Ok(value);
|
|
327
|
+
}
|
|
328
|
+
function err(err) {
|
|
329
|
+
return new Err(err);
|
|
330
|
+
}
|
|
331
|
+
function safeTry(body) {
|
|
332
|
+
const n = body().next();
|
|
333
|
+
if (n instanceof Promise) {
|
|
334
|
+
return new ResultAsync(n.then((r) => r.value));
|
|
335
|
+
}
|
|
336
|
+
return n.value;
|
|
337
|
+
}
|
|
338
|
+
class Ok {
|
|
339
|
+
constructor(value) {
|
|
340
|
+
this.value = value;
|
|
341
|
+
}
|
|
342
|
+
isOk() {
|
|
343
|
+
return true;
|
|
344
|
+
}
|
|
345
|
+
isErr() {
|
|
346
|
+
return !this.isOk();
|
|
347
|
+
}
|
|
348
|
+
map(f) {
|
|
349
|
+
return ok(f(this.value));
|
|
350
|
+
}
|
|
351
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
352
|
+
mapErr(_f) {
|
|
353
|
+
return ok(this.value);
|
|
354
|
+
}
|
|
355
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
356
|
+
andThen(f) {
|
|
357
|
+
return f(this.value);
|
|
358
|
+
}
|
|
359
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
360
|
+
andThrough(f) {
|
|
361
|
+
return f(this.value).map((_value) => this.value);
|
|
362
|
+
}
|
|
363
|
+
andTee(f) {
|
|
364
|
+
try {
|
|
365
|
+
f(this.value);
|
|
366
|
+
}
|
|
367
|
+
catch (e) {
|
|
368
|
+
// Tee doesn't care about the error
|
|
369
|
+
}
|
|
370
|
+
return ok(this.value);
|
|
371
|
+
}
|
|
372
|
+
orTee(_f) {
|
|
373
|
+
return ok(this.value);
|
|
374
|
+
}
|
|
375
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
376
|
+
orElse(_f) {
|
|
377
|
+
return ok(this.value);
|
|
378
|
+
}
|
|
379
|
+
asyncAndThen(f) {
|
|
380
|
+
return f(this.value);
|
|
381
|
+
}
|
|
382
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
383
|
+
asyncAndThrough(f) {
|
|
384
|
+
return f(this.value).map(() => this.value);
|
|
385
|
+
}
|
|
386
|
+
asyncMap(f) {
|
|
387
|
+
return ResultAsync.fromSafePromise(f(this.value));
|
|
388
|
+
}
|
|
389
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
390
|
+
unwrapOr(_v) {
|
|
391
|
+
return this.value;
|
|
392
|
+
}
|
|
393
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
394
|
+
match(ok, _err) {
|
|
395
|
+
return ok(this.value);
|
|
396
|
+
}
|
|
397
|
+
safeUnwrap() {
|
|
398
|
+
const value = this.value;
|
|
399
|
+
/* eslint-disable-next-line require-yield */
|
|
400
|
+
return (function* () {
|
|
401
|
+
return value;
|
|
402
|
+
})();
|
|
403
|
+
}
|
|
404
|
+
_unsafeUnwrap(_) {
|
|
405
|
+
return this.value;
|
|
406
|
+
}
|
|
407
|
+
_unsafeUnwrapErr(config) {
|
|
408
|
+
throw createNeverThrowError('Called `_unsafeUnwrapErr` on an Ok', this, config);
|
|
409
|
+
}
|
|
410
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias, require-yield
|
|
411
|
+
*[Symbol.iterator]() {
|
|
412
|
+
return this.value;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
class Err {
|
|
416
|
+
constructor(error) {
|
|
417
|
+
this.error = error;
|
|
418
|
+
}
|
|
419
|
+
isOk() {
|
|
420
|
+
return false;
|
|
421
|
+
}
|
|
422
|
+
isErr() {
|
|
423
|
+
return !this.isOk();
|
|
424
|
+
}
|
|
425
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
426
|
+
map(_f) {
|
|
427
|
+
return err(this.error);
|
|
428
|
+
}
|
|
429
|
+
mapErr(f) {
|
|
430
|
+
return err(f(this.error));
|
|
431
|
+
}
|
|
432
|
+
andThrough(_f) {
|
|
433
|
+
return err(this.error);
|
|
434
|
+
}
|
|
435
|
+
andTee(_f) {
|
|
436
|
+
return err(this.error);
|
|
437
|
+
}
|
|
438
|
+
orTee(f) {
|
|
439
|
+
try {
|
|
440
|
+
f(this.error);
|
|
441
|
+
}
|
|
442
|
+
catch (e) {
|
|
443
|
+
// Tee doesn't care about the error
|
|
444
|
+
}
|
|
445
|
+
return err(this.error);
|
|
446
|
+
}
|
|
447
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
448
|
+
andThen(_f) {
|
|
449
|
+
return err(this.error);
|
|
450
|
+
}
|
|
451
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
452
|
+
orElse(f) {
|
|
453
|
+
return f(this.error);
|
|
454
|
+
}
|
|
455
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
456
|
+
asyncAndThen(_f) {
|
|
457
|
+
return errAsync(this.error);
|
|
458
|
+
}
|
|
459
|
+
asyncAndThrough(_f) {
|
|
460
|
+
return errAsync(this.error);
|
|
461
|
+
}
|
|
462
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
463
|
+
asyncMap(_f) {
|
|
464
|
+
return errAsync(this.error);
|
|
465
|
+
}
|
|
466
|
+
unwrapOr(v) {
|
|
467
|
+
return v;
|
|
468
|
+
}
|
|
469
|
+
match(_ok, err) {
|
|
470
|
+
return err(this.error);
|
|
471
|
+
}
|
|
472
|
+
safeUnwrap() {
|
|
473
|
+
const error = this.error;
|
|
474
|
+
return (function* () {
|
|
475
|
+
yield err(error);
|
|
476
|
+
throw new Error('Do not use this generator out of `safeTry`');
|
|
477
|
+
})();
|
|
478
|
+
}
|
|
479
|
+
_unsafeUnwrap(config) {
|
|
480
|
+
throw createNeverThrowError('Called `_unsafeUnwrap` on an Err', this, config);
|
|
481
|
+
}
|
|
482
|
+
_unsafeUnwrapErr(_) {
|
|
483
|
+
return this.error;
|
|
484
|
+
}
|
|
485
|
+
*[Symbol.iterator]() {
|
|
486
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
487
|
+
const self = this;
|
|
488
|
+
// @ts-expect-error -- This is structurally equivalent and safe
|
|
489
|
+
yield self;
|
|
490
|
+
// @ts-expect-error -- This is structurally equivalent and safe
|
|
491
|
+
return self;
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
const fromThrowable = Result.fromThrowable;
|
|
495
|
+
//#endregion
|
|
496
|
+
|
|
497
|
+
export { Err, Ok, Result, ResultAsync, err, errAsync, fromAsyncThrowable, fromPromise, fromSafePromise, fromThrowable, ok, okAsync, safeTry };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "neverthrow",
|
|
3
|
+
"version": "8.2.0",
|
|
4
|
+
"description": "Stop throwing errors, and instead return Results!",
|
|
5
|
+
"main": "dist/index.cjs.js",
|
|
6
|
+
"module": "dist/index.es.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"local-ci": "npm run typecheck && npm run lint && npm run test && npm run format && npm run build",
|
|
13
|
+
"test": "vitest run && npm run test-types",
|
|
14
|
+
"test-types": "tsc --noEmit -p ./tests/tsconfig.tests.json",
|
|
15
|
+
"lint": "eslint ./src --ext .ts",
|
|
16
|
+
"format": "prettier --write 'src/**/*.ts?(x)' && npm run lint -- --fix",
|
|
17
|
+
"typecheck": "tsc --noEmit",
|
|
18
|
+
"clean": "rm -rf ./dist ./tmp",
|
|
19
|
+
"build": "npm run clean && rollup --config && mv tmp/*.js dist",
|
|
20
|
+
"prepack": "npm run build",
|
|
21
|
+
"release": "changeset publish",
|
|
22
|
+
"version": "changeset version && npm i --lockfile-only"
|
|
23
|
+
},
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "git+https://github.com/supermacro/neverthrow.git"
|
|
27
|
+
},
|
|
28
|
+
"author": "Giorgio Delgado",
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"bugs": {
|
|
31
|
+
"url": "https://github.com/supermacro/neverthrow/issues"
|
|
32
|
+
},
|
|
33
|
+
"homepage": "https://github.com/supermacro/neverthrow#readme",
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@changesets/changelog-github": "^0.5.0",
|
|
36
|
+
"@changesets/cli": "^2.27.7",
|
|
37
|
+
"@types/node": "^18.19.39",
|
|
38
|
+
"@typescript-eslint/eslint-plugin": "4.28.1",
|
|
39
|
+
"@typescript-eslint/parser": "4.28.1",
|
|
40
|
+
"eslint": "7.30.0",
|
|
41
|
+
"eslint-config-prettier": "7.1.0",
|
|
42
|
+
"eslint-plugin-prettier": "3.4.0",
|
|
43
|
+
"prettier": "2.2.1",
|
|
44
|
+
"rollup": "^4.18.0",
|
|
45
|
+
"rollup-plugin-dts": "^6.1.1",
|
|
46
|
+
"rollup-plugin-typescript2": "^0.32.1",
|
|
47
|
+
"testdouble": "3.20.2",
|
|
48
|
+
"ts-toolbelt": "9.6.0",
|
|
49
|
+
"typescript": "4.7.2",
|
|
50
|
+
"vitest": "^2.1.3"
|
|
51
|
+
},
|
|
52
|
+
"keywords": [
|
|
53
|
+
"typescript",
|
|
54
|
+
"functional",
|
|
55
|
+
"fp",
|
|
56
|
+
"error"
|
|
57
|
+
],
|
|
58
|
+
"engines": {
|
|
59
|
+
"node": ">=18"
|
|
60
|
+
},
|
|
61
|
+
"optionalDependencies": {
|
|
62
|
+
"@rollup/rollup-linux-x64-gnu": "^4.24.0"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2016 Lukas Geiger
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Node.js ABI
|
|
2
|
+
|
|
3
|
+
[](https://github.com/electron/node-abi/actions/workflows/test.yml)
|
|
4
|
+
[](https://github.com/electron/node-abi/actions/workflows/update-abi.yml)
|
|
5
|
+
[](https://snyk.io/test/github/electron/node-abi)
|
|
6
|
+
[](https://npmjs.org/package/node-abi)
|
|
7
|
+
|
|
8
|
+
Get the Node ABI (application binary interface) for a given target and runtime, and vice versa.
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
```shell
|
|
13
|
+
npm install node-abi
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
```javascript
|
|
19
|
+
const nodeAbi = require('node-abi')
|
|
20
|
+
|
|
21
|
+
nodeAbi.getAbi('7.2.0', 'node')
|
|
22
|
+
// '51'
|
|
23
|
+
nodeAbi.getAbi('1.4.10', 'electron')
|
|
24
|
+
// '50'
|
|
25
|
+
nodeAbi.getTarget('51', 'node')
|
|
26
|
+
// '7.2.0'
|
|
27
|
+
nodeAbi.getTarget('50', 'electron')
|
|
28
|
+
// '1.4.15'
|
|
29
|
+
|
|
30
|
+
nodeAbi.allTargets
|
|
31
|
+
// [
|
|
32
|
+
// { runtime: 'node', target: '0.10.48', abi: '11', lts: false },
|
|
33
|
+
// { runtime: 'node', target: '0.12.17', abi: '14', lts: false },
|
|
34
|
+
// { runtime: 'node', target: '4.6.1', abi: '46', lts: true },
|
|
35
|
+
// { runtime: 'node', target: '5.12.0', abi: '47', lts: false },
|
|
36
|
+
// { runtime: 'node', target: '6.9.4', abi: '48', lts: true },
|
|
37
|
+
// { runtime: 'node', target: '7.4.0', abi: '51', lts: false },
|
|
38
|
+
// { runtime: 'electron', target: '1.0.2', abi: '47', lts: false },
|
|
39
|
+
// { runtime: 'electron', target: '1.2.8', abi: '48', lts: false },
|
|
40
|
+
// { runtime: 'electron', target: '1.3.13', abi: '49', lts: false },
|
|
41
|
+
// { runtime: 'electron', target: '1.4.15', abi: '50', lts: false }
|
|
42
|
+
// ]
|
|
43
|
+
nodeAbi.deprecatedTargets
|
|
44
|
+
nodeAbi.supportedTargets
|
|
45
|
+
nodeAbi.additionalTargets
|
|
46
|
+
nodeAbi.futureTargets
|
|
47
|
+
// ...
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## References
|
|
51
|
+
|
|
52
|
+
- https://github.com/lgeiger/electron-abi
|
|
53
|
+
- https://nodejs.org/en/download/releases/
|
|
54
|
+
- https://github.com/nodejs/Release
|