├── .eslintrc.cjs ├── .github └── workflows │ └── test.yml ├── .gitignore ├── .npmrc ├── .prettierrc ├── .tool-versions ├── LICENSE ├── README.md ├── deno.lock ├── dist ├── delay.d.mts ├── delay.mjs └── extras │ ├── extras.d.mts │ ├── extras.mjs │ ├── prelude.d.mts │ └── prelude.mjs ├── gleam.toml ├── manifest.toml ├── package-lock.json ├── package.json ├── scripts ├── build_js.sh ├── comment.py ├── publish.sh ├── pull_prelude.sh ├── test.sh └── update.sh ├── specs └── test_dist.spec.js ├── src ├── delay.gleam └── ffi.mjs ├── test ├── delay_test.gleam ├── side_effects │ └── .gitkeep └── test.mjs ├── tsconfig.json └── yarn.lock /.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "env": { 3 | "browser": true, 4 | "es2021": true, 5 | "node": true 6 | }, 7 | "extends": [ 8 | "eslint:recommended", 9 | ], 10 | "overrides": [ 11 | { 12 | "env": { 13 | "node": true 14 | }, 15 | "files": [ 16 | ".eslintrc.{js,cjs}" 17 | ], 18 | "parserOptions": { 19 | "sourceType": "script" 20 | } 21 | } 22 | ], 23 | "parserOptions": { 24 | "ecmaVersion": "latest", 25 | "sourceType": "module" 26 | }, 27 | "plugins": [ 28 | "unused-imports" 29 | ], 30 | "rules": { 31 | "no-empty": "off", 32 | "no-constant-condition": "off", 33 | "no-unused-vars": "off", 34 | "unused-imports/no-unused-imports": "error", 35 | "unused-imports/no-unused-vars": [ 36 | "warn", 37 | { 38 | "vars": "all", 39 | "varsIgnorePattern": "^_", 40 | "args": "after-used", 41 | "argsIgnorePattern": "^_" 42 | } 43 | ] 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: ci 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | 9 | env: 10 | otp: "27.0" 11 | gleam: "1.8.0" 12 | rebar: "3" 13 | 14 | jobs: 15 | build: 16 | runs-on: ubuntu-latest 17 | steps: 18 | - uses: actions/checkout@v4 19 | - uses: erlef/setup-beam@v1 20 | with: 21 | otp-version: ${{ env.otp }} 22 | gleam-version: ${{ env.gleam }} 23 | rebar3-version: ${{ env.rebar }} 24 | - run: gleam format --check src test 25 | - run: gleam build 26 | 27 | erlang: 28 | runs-on: ubuntu-latest 29 | steps: 30 | - uses: actions/checkout@v4 31 | - uses: erlef/setup-beam@v1 32 | with: 33 | otp-version: ${{ env.otp }} 34 | gleam-version: ${{ env.gleam }} 35 | rebar3-version: ${{ env.rebar }} 36 | - run: gleam test --target erlang 37 | 38 | node: 39 | runs-on: ubuntu-latest 40 | strategy: 41 | matrix: 42 | node-version: [22.x, 23.x] 43 | steps: 44 | - uses: actions/checkout@v4 45 | - uses: erlef/setup-beam@v1 46 | with: 47 | otp-version: ${{ env.otp }} 48 | gleam-version: ${{ env.gleam }} 49 | rebar3-version: ${{ env.rebar }} 50 | - name: Use Node.js ${{ matrix.node-version }} 51 | uses: actions/setup-node@v4 52 | with: 53 | node-version: ${{ matrix.node-version }} 54 | cache: "npm" 55 | - run: yarn 56 | - run: yarn build 57 | - run: gleam test --target javascript --runtime nodejs 58 | - run: node --test ./specs/test_dist.spec.js 59 | 60 | bun: 61 | runs-on: ubuntu-latest 62 | steps: 63 | - uses: actions/checkout@v4 64 | - uses: erlef/setup-beam@v1 65 | with: 66 | otp-version: ${{ env.otp }} 67 | gleam-version: ${{ env.gleam }} 68 | rebar3-version: ${{ env.rebar }} 69 | - uses: oven-sh/setup-bun@v1 70 | - run: bun install 71 | - uses: actions/setup-node@v4 72 | with: 73 | node-version: 22.x 74 | - run: yarn build 75 | - run: gleam test --target javascript --runtime bun 76 | - run: bun test ./specs/test_dist.spec.js 77 | 78 | deno: 79 | runs-on: ubuntu-latest 80 | steps: 81 | - uses: actions/checkout@v4 82 | - uses: erlef/setup-beam@v1 83 | with: 84 | otp-version: ${{ env.otp }} 85 | gleam-version: ${{ env.gleam }} 86 | rebar3-version: ${{ env.rebar }} 87 | - uses: denoland/setup-deno@v1 88 | with: 89 | deno-version: v2.x # Run with latest stable Deno. 90 | - uses: actions/setup-node@v4 91 | with: 92 | node-version: 20.x 93 | - run: yarn build 94 | - run: gleam test --target javascript --runtime deno 95 | - run: deno test ./specs/test_dist.spec.js -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # The directory Mix will write compiled artifacts to. 2 | /_build/ 3 | 4 | # If you run "mix test --cover", coverage assets end up here. 5 | /cover/ 6 | 7 | # The directory Mix downloads your dependencies sources to. 8 | /deps/ 9 | 10 | # Where third-party dependencies like ExDoc output generated docs. 11 | /doc/ 12 | 13 | # Ignore .fetch files in case you like to edit your project deps locally. 14 | /.fetch 15 | 16 | # If the VM crashes, it generates a dump, let's ignore it too. 17 | erl_crash.dump 18 | 19 | # Also ignore archive artifacts (built via "mix archive.build"). 20 | *.ez 21 | 22 | # Ignore package tarball (built via "mix hex.build"). 23 | delay-*.tar 24 | 25 | # Temporary files, for example, from tests. 26 | /tmp/ 27 | 28 | /gen/ 29 | 30 | /js/ 31 | build/ 32 | test/side_effects/*.test 33 | key._ 34 | .vscode/ 35 | .go-over/ 36 | node_modules 37 | *.tmp -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | @jsr:registry=https://npm.jsr.io 2 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 120, 3 | "tabWidth": 2, 4 | "useTabs": false, 5 | "semi": false, 6 | "singleQuote": false, 7 | "trailingComma": "none", 8 | "bracketSpacing": true, 9 | "arrowParens": "avoid" 10 | } 11 | -------------------------------------------------------------------------------- /.tool-versions: -------------------------------------------------------------------------------- 1 | gleam 1.8.0 2 | erlang 27.2.1 3 | nodejs 22.13.1 4 | deno 2.1.9 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Benjamin Wireman 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. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Delay ⌚ 2 | 3 | A dead simple data-structure for delaying side effects ⌚! Written in the excellent [gleam ✨](https://gleam.run/) language. Supporting both Erlang & Javascript targets 4 | 5 | [![test](https://github.com/bwireman/delay/actions/workflows/test.yml/badge.svg)](https://github.com/bwireman/delay/actions/workflows/test.yml) 6 | [![commits](https://img.shields.io/github/last-commit/bwireman/delay)](https://github.com/bwireman/delay/commit/main) 7 | [![mit](https://img.shields.io/github/license/bwireman/delay?color=brightgreen)](https://github.com/bwireman/delay/blob/main/LICENSE) 8 | [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen)](http://makeapullrequest.com) 9 | [![1.1.0](https://img.shields.io/hexpm/v/delay?color=brightgreen&style=flat)](https://hexdocs.pm/delay/index.html) 10 | [![gleam erlang](https://img.shields.io/badge/erlang%20%E2%98%8E%EF%B8%8F-red?style=flat&label=gleam%20%E2%9C%A8)](https://gleam.run) 11 | [![hex.pm downloads](https://img.shields.io/hexpm/dt/delay?label=hex.pm%20downloads)](https://hex.pm/packages/delay/) 12 | [![gleam js](https://img.shields.io/badge/%20gleam%20%E2%9C%A8-js%20%F0%9F%8C%B8-yellow)](https://gleam.run/news/v0.16-gleam-compiles-to-javascript/) 13 | [![npm](https://img.shields.io/npm/dt/delay-gleam?label=npm%20downloads)](https://www.npmjs.com/package/delay-gleam) 14 | 15 | 16 | ## Basic Usage 17 | 18 | ```gleam 19 | import gleam/io 20 | import delay 21 | 22 | let d = delay.delay_effect(fn() { 23 | io.println("Hello") 24 | Ok(1) 25 | }) |> delay.map(fn(x) { 26 | io.println("World") 27 | Ok(x + 1) 28 | }) 29 | 30 | let res = delay.run(d) 31 | // Hello 32 | // World 33 | // res = Ok(2) 34 | ``` 35 | 36 | ## More info 37 | 38 | The result of `delay_effect` is really just a first class function with a nice API wrapper. It isn't executed until put through one of `run/1`, `drain/1`, `fallthrough/1` or one of the other functions in order to execute a delayed effect. And can be called as many times as you want. 39 | 40 | ```gleam 41 | import gleam/io 42 | import delay 43 | 44 | let d = delay.delay_effect(fn() { 45 | io.println("Hello") 46 | Error("bummer") 47 | }) |> delay.map(fn(x) { 48 | io.println("World") 49 | Ok(x + 1) 50 | }) 51 | 52 | let res = delay.run(d) 53 | // Hello 54 | // res = Error("bummer") 55 | ``` 56 | 57 | If one of the functions in the chain fails, the rest will short circuit and the error will be returned. 58 | 59 | Effects can be retried as well via `retry/3` 60 | 61 | ```gleam 62 | // using the same effect `d` from above 63 | 64 | let res = delay.retry(d, 3, 200) 65 | |> delay.run() 66 | // Hello 67 | // Hello 68 | // Hello 69 | // Hello 70 | // res = Error("bummer") 71 | ``` 72 | 73 | ## Usage within Javascript 🌸 directly 74 | If you want to use this library from javascript alone, but aren't ready to embrace gleam, you can install it from [npm](https://www.npmjs.com/package/delay-gleam)! 75 | Docs can be found [here](https://hexdocs.pm/delay/index.html) 76 | 77 | ```sh 78 | npm i delay-gleam 79 | ``` 80 | 81 | ```javascript 82 | import { delay_effect, map, run } from "delay-gleam" 83 | import { ok, error, get } from "delay-gleam/extras" 84 | 85 | d = delay_effect(() => error(console.log("123"))) 86 | d = map(d, (_) => ok(console.log("456"))) 87 | get(run(d)) 88 | // 123 89 | ``` 90 | 91 | ### Extras 92 | Helper functions for using this library directly in javascript can be found [here](/dist/extras/extras.mjs) 93 | 94 | 95 | ## FAQ 96 | 97 | Doesn't the concept of a delayed side effect kind of lose value in the world of actor model concurrency and zero shared memory?! 98 | 99 | > A little 100 | 101 | Then why did you write this? 102 | 103 | > For fun 104 | 105 | Is gleam ✨ actually excellent? 106 | 107 | > So far 108 | -------------------------------------------------------------------------------- /deno.lock: -------------------------------------------------------------------------------- 1 | { 2 | "version": "3", 3 | "packages": { 4 | "specifiers": { 5 | "npm:@jsr/cross__test": "npm:@jsr/cross__test@0.0.9", 6 | "npm:@jsr/std__assert": "npm:@jsr/std__assert@1.0.6", 7 | "npm:dets@^0.14.2": "npm:dets@0.14.2_typescript@5.6.3", 8 | "npm:esbuild@^0.20.1": "npm:esbuild@0.20.2", 9 | "npm:eslint-plugin-unused-imports@^3.1.0": "npm:eslint-plugin-unused-imports@3.2.0_eslint@8.57.0", 10 | "npm:eslint@^8.57.0": "npm:eslint@8.57.0", 11 | "npm:prettier@3.2.5": "npm:prettier@3.2.5", 12 | "npm:sync-fetch@^0.5.2": "npm:sync-fetch@0.5.2", 13 | "npm:typescript@^5.3.3": "npm:typescript@5.6.3", 14 | "npm:yaml@^2.4.4": "npm:yaml@2.5.0" 15 | }, 16 | "npm": { 17 | "@esbuild/aix-ppc64@0.20.2": { 18 | "integrity": "sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==", 19 | "dependencies": {} 20 | }, 21 | "@esbuild/android-arm64@0.20.2": { 22 | "integrity": "sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==", 23 | "dependencies": {} 24 | }, 25 | "@esbuild/android-arm@0.20.2": { 26 | "integrity": "sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==", 27 | "dependencies": {} 28 | }, 29 | "@esbuild/android-x64@0.20.2": { 30 | "integrity": "sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==", 31 | "dependencies": {} 32 | }, 33 | "@esbuild/darwin-arm64@0.20.2": { 34 | "integrity": "sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==", 35 | "dependencies": {} 36 | }, 37 | "@esbuild/darwin-x64@0.20.2": { 38 | "integrity": "sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==", 39 | "dependencies": {} 40 | }, 41 | "@esbuild/freebsd-arm64@0.20.2": { 42 | "integrity": "sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==", 43 | "dependencies": {} 44 | }, 45 | "@esbuild/freebsd-x64@0.20.2": { 46 | "integrity": "sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==", 47 | "dependencies": {} 48 | }, 49 | "@esbuild/linux-arm64@0.20.2": { 50 | "integrity": "sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==", 51 | "dependencies": {} 52 | }, 53 | "@esbuild/linux-arm@0.20.2": { 54 | "integrity": "sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==", 55 | "dependencies": {} 56 | }, 57 | "@esbuild/linux-ia32@0.20.2": { 58 | "integrity": "sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==", 59 | "dependencies": {} 60 | }, 61 | "@esbuild/linux-loong64@0.20.2": { 62 | "integrity": "sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==", 63 | "dependencies": {} 64 | }, 65 | "@esbuild/linux-mips64el@0.20.2": { 66 | "integrity": "sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==", 67 | "dependencies": {} 68 | }, 69 | "@esbuild/linux-ppc64@0.20.2": { 70 | "integrity": "sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==", 71 | "dependencies": {} 72 | }, 73 | "@esbuild/linux-riscv64@0.20.2": { 74 | "integrity": "sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==", 75 | "dependencies": {} 76 | }, 77 | "@esbuild/linux-s390x@0.20.2": { 78 | "integrity": "sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==", 79 | "dependencies": {} 80 | }, 81 | "@esbuild/linux-x64@0.20.2": { 82 | "integrity": "sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==", 83 | "dependencies": {} 84 | }, 85 | "@esbuild/netbsd-x64@0.20.2": { 86 | "integrity": "sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==", 87 | "dependencies": {} 88 | }, 89 | "@esbuild/openbsd-x64@0.20.2": { 90 | "integrity": "sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==", 91 | "dependencies": {} 92 | }, 93 | "@esbuild/sunos-x64@0.20.2": { 94 | "integrity": "sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==", 95 | "dependencies": {} 96 | }, 97 | "@esbuild/win32-arm64@0.20.2": { 98 | "integrity": "sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==", 99 | "dependencies": {} 100 | }, 101 | "@esbuild/win32-ia32@0.20.2": { 102 | "integrity": "sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==", 103 | "dependencies": {} 104 | }, 105 | "@esbuild/win32-x64@0.20.2": { 106 | "integrity": "sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==", 107 | "dependencies": {} 108 | }, 109 | "@eslint-community/eslint-utils@4.4.0_eslint@8.57.0": { 110 | "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", 111 | "dependencies": { 112 | "eslint": "eslint@8.57.0", 113 | "eslint-visitor-keys": "eslint-visitor-keys@3.4.3" 114 | } 115 | }, 116 | "@eslint-community/regexpp@4.11.0": { 117 | "integrity": "sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==", 118 | "dependencies": {} 119 | }, 120 | "@eslint/eslintrc@2.1.4": { 121 | "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", 122 | "dependencies": { 123 | "ajv": "ajv@6.12.6", 124 | "debug": "debug@4.3.6", 125 | "espree": "espree@9.6.1_acorn@8.12.1", 126 | "globals": "globals@13.24.0", 127 | "ignore": "ignore@5.3.2", 128 | "import-fresh": "import-fresh@3.3.0", 129 | "js-yaml": "js-yaml@4.1.0", 130 | "minimatch": "minimatch@3.1.2", 131 | "strip-json-comments": "strip-json-comments@3.1.1" 132 | } 133 | }, 134 | "@eslint/js@8.57.0": { 135 | "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", 136 | "dependencies": {} 137 | }, 138 | "@humanwhocodes/config-array@0.11.14": { 139 | "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", 140 | "dependencies": { 141 | "@humanwhocodes/object-schema": "@humanwhocodes/object-schema@2.0.3", 142 | "debug": "debug@4.3.6", 143 | "minimatch": "minimatch@3.1.2" 144 | } 145 | }, 146 | "@humanwhocodes/module-importer@1.0.1": { 147 | "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", 148 | "dependencies": {} 149 | }, 150 | "@humanwhocodes/object-schema@2.0.3": { 151 | "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", 152 | "dependencies": {} 153 | }, 154 | "@jsr/cross__runtime@1.1.0": { 155 | "integrity": "sha512-GGvdy7fGJP4owjp6uQDFbfawuQJrwNJzb2gfotW9wfxtXDfyL5ukPXnHWQwsMF0rUpb5luhuG5r9/h8teYH7lw==", 156 | "dependencies": {} 157 | }, 158 | "@jsr/cross__test@0.0.9": { 159 | "integrity": "sha512-zwDSXQHw8n6k/gBj1Q67Td34Lb1PfkzLTggXnNZzcRO9SxcdAlzyOKFCF62kTFM7ZjVPqYvqu2gHzMLtj6cayw==", 160 | "dependencies": { 161 | "@jsr/cross__runtime": "@jsr/cross__runtime@1.1.0" 162 | } 163 | }, 164 | "@jsr/std__assert@1.0.6": { 165 | "integrity": "sha512-lWRoX42lexkqLDxxVA6VG+zk++yiOI9udIqigeSpQu0N5ri6l665gkNLbisIAEDkiUg86FTRPb5sLdtUUNfkmg==", 166 | "dependencies": { 167 | "@jsr/std__internal": "@jsr/std__internal@1.0.4" 168 | } 169 | }, 170 | "@jsr/std__internal@1.0.4": { 171 | "integrity": "sha512-oPUgFN5+ogDYCFjCSQqqN1sH27VB544HsJKwuwuGkSkeawwNj8CQc7Z7znwYFm3Zoy3FhW+eXErSXgg42UytKw==", 172 | "dependencies": {} 173 | }, 174 | "@nodelib/fs.scandir@2.1.5": { 175 | "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", 176 | "dependencies": { 177 | "@nodelib/fs.stat": "@nodelib/fs.stat@2.0.5", 178 | "run-parallel": "run-parallel@1.2.0" 179 | } 180 | }, 181 | "@nodelib/fs.stat@2.0.5": { 182 | "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", 183 | "dependencies": {} 184 | }, 185 | "@nodelib/fs.walk@1.2.8": { 186 | "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", 187 | "dependencies": { 188 | "@nodelib/fs.scandir": "@nodelib/fs.scandir@2.1.5", 189 | "fastq": "fastq@1.17.1" 190 | } 191 | }, 192 | "@ungap/structured-clone@1.2.0": { 193 | "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", 194 | "dependencies": {} 195 | }, 196 | "acorn-jsx@5.3.2_acorn@8.12.1": { 197 | "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", 198 | "dependencies": { 199 | "acorn": "acorn@8.12.1" 200 | } 201 | }, 202 | "acorn@8.12.1": { 203 | "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", 204 | "dependencies": {} 205 | }, 206 | "ajv@6.12.6": { 207 | "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", 208 | "dependencies": { 209 | "fast-deep-equal": "fast-deep-equal@3.1.3", 210 | "fast-json-stable-stringify": "fast-json-stable-stringify@2.1.0", 211 | "json-schema-traverse": "json-schema-traverse@0.4.1", 212 | "uri-js": "uri-js@4.4.1" 213 | } 214 | }, 215 | "ansi-regex@5.0.1": { 216 | "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", 217 | "dependencies": {} 218 | }, 219 | "ansi-styles@4.3.0": { 220 | "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", 221 | "dependencies": { 222 | "color-convert": "color-convert@2.0.1" 223 | } 224 | }, 225 | "argparse@2.0.1": { 226 | "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", 227 | "dependencies": {} 228 | }, 229 | "balanced-match@1.0.2": { 230 | "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", 231 | "dependencies": {} 232 | }, 233 | "brace-expansion@1.1.11": { 234 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 235 | "dependencies": { 236 | "balanced-match": "balanced-match@1.0.2", 237 | "concat-map": "concat-map@0.0.1" 238 | } 239 | }, 240 | "callsites@3.1.0": { 241 | "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", 242 | "dependencies": {} 243 | }, 244 | "chalk@4.1.2": { 245 | "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", 246 | "dependencies": { 247 | "ansi-styles": "ansi-styles@4.3.0", 248 | "supports-color": "supports-color@7.2.0" 249 | } 250 | }, 251 | "color-convert@2.0.1": { 252 | "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", 253 | "dependencies": { 254 | "color-name": "color-name@1.1.4" 255 | } 256 | }, 257 | "color-name@1.1.4": { 258 | "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", 259 | "dependencies": {} 260 | }, 261 | "concat-map@0.0.1": { 262 | "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", 263 | "dependencies": {} 264 | }, 265 | "cross-spawn@7.0.3": { 266 | "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", 267 | "dependencies": { 268 | "path-key": "path-key@3.1.1", 269 | "shebang-command": "shebang-command@2.0.0", 270 | "which": "which@2.0.2" 271 | } 272 | }, 273 | "debug@4.3.6": { 274 | "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", 275 | "dependencies": { 276 | "ms": "ms@2.1.2" 277 | } 278 | }, 279 | "deep-is@0.1.4": { 280 | "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", 281 | "dependencies": {} 282 | }, 283 | "dets@0.14.2_typescript@5.6.3": { 284 | "integrity": "sha512-jatRCsNHdeB3OebBudsOWRlp7Ka4/Kbi9PUQllnplXH7rWXl1Qe/G7F2Y5dqz2PYimNCH64lzLMuCLDsnnyEhA==", 285 | "dependencies": { 286 | "typescript": "typescript@5.6.3" 287 | } 288 | }, 289 | "doctrine@3.0.0": { 290 | "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", 291 | "dependencies": { 292 | "esutils": "esutils@2.0.3" 293 | } 294 | }, 295 | "esbuild@0.20.2": { 296 | "integrity": "sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==", 297 | "dependencies": { 298 | "@esbuild/aix-ppc64": "@esbuild/aix-ppc64@0.20.2", 299 | "@esbuild/android-arm": "@esbuild/android-arm@0.20.2", 300 | "@esbuild/android-arm64": "@esbuild/android-arm64@0.20.2", 301 | "@esbuild/android-x64": "@esbuild/android-x64@0.20.2", 302 | "@esbuild/darwin-arm64": "@esbuild/darwin-arm64@0.20.2", 303 | "@esbuild/darwin-x64": "@esbuild/darwin-x64@0.20.2", 304 | "@esbuild/freebsd-arm64": "@esbuild/freebsd-arm64@0.20.2", 305 | "@esbuild/freebsd-x64": "@esbuild/freebsd-x64@0.20.2", 306 | "@esbuild/linux-arm": "@esbuild/linux-arm@0.20.2", 307 | "@esbuild/linux-arm64": "@esbuild/linux-arm64@0.20.2", 308 | "@esbuild/linux-ia32": "@esbuild/linux-ia32@0.20.2", 309 | "@esbuild/linux-loong64": "@esbuild/linux-loong64@0.20.2", 310 | "@esbuild/linux-mips64el": "@esbuild/linux-mips64el@0.20.2", 311 | "@esbuild/linux-ppc64": "@esbuild/linux-ppc64@0.20.2", 312 | "@esbuild/linux-riscv64": "@esbuild/linux-riscv64@0.20.2", 313 | "@esbuild/linux-s390x": "@esbuild/linux-s390x@0.20.2", 314 | "@esbuild/linux-x64": "@esbuild/linux-x64@0.20.2", 315 | "@esbuild/netbsd-x64": "@esbuild/netbsd-x64@0.20.2", 316 | "@esbuild/openbsd-x64": "@esbuild/openbsd-x64@0.20.2", 317 | "@esbuild/sunos-x64": "@esbuild/sunos-x64@0.20.2", 318 | "@esbuild/win32-arm64": "@esbuild/win32-arm64@0.20.2", 319 | "@esbuild/win32-ia32": "@esbuild/win32-ia32@0.20.2", 320 | "@esbuild/win32-x64": "@esbuild/win32-x64@0.20.2" 321 | } 322 | }, 323 | "escape-string-regexp@4.0.0": { 324 | "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", 325 | "dependencies": {} 326 | }, 327 | "eslint-plugin-unused-imports@3.2.0_eslint@8.57.0": { 328 | "integrity": "sha512-6uXyn6xdINEpxE1MtDjxQsyXB37lfyO2yKGVVgtD7WEWQGORSOZjgrD6hBhvGv4/SO+TOlS+UnC6JppRqbuwGQ==", 329 | "dependencies": { 330 | "eslint": "eslint@8.57.0", 331 | "eslint-rule-composer": "eslint-rule-composer@0.3.0" 332 | } 333 | }, 334 | "eslint-rule-composer@0.3.0": { 335 | "integrity": "sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg==", 336 | "dependencies": {} 337 | }, 338 | "eslint-scope@7.2.2": { 339 | "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", 340 | "dependencies": { 341 | "esrecurse": "esrecurse@4.3.0", 342 | "estraverse": "estraverse@5.3.0" 343 | } 344 | }, 345 | "eslint-visitor-keys@3.4.3": { 346 | "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", 347 | "dependencies": {} 348 | }, 349 | "eslint@8.57.0": { 350 | "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", 351 | "dependencies": { 352 | "@eslint-community/eslint-utils": "@eslint-community/eslint-utils@4.4.0_eslint@8.57.0", 353 | "@eslint-community/regexpp": "@eslint-community/regexpp@4.11.0", 354 | "@eslint/eslintrc": "@eslint/eslintrc@2.1.4", 355 | "@eslint/js": "@eslint/js@8.57.0", 356 | "@humanwhocodes/config-array": "@humanwhocodes/config-array@0.11.14", 357 | "@humanwhocodes/module-importer": "@humanwhocodes/module-importer@1.0.1", 358 | "@nodelib/fs.walk": "@nodelib/fs.walk@1.2.8", 359 | "@ungap/structured-clone": "@ungap/structured-clone@1.2.0", 360 | "ajv": "ajv@6.12.6", 361 | "chalk": "chalk@4.1.2", 362 | "cross-spawn": "cross-spawn@7.0.3", 363 | "debug": "debug@4.3.6", 364 | "doctrine": "doctrine@3.0.0", 365 | "escape-string-regexp": "escape-string-regexp@4.0.0", 366 | "eslint-scope": "eslint-scope@7.2.2", 367 | "eslint-visitor-keys": "eslint-visitor-keys@3.4.3", 368 | "espree": "espree@9.6.1_acorn@8.12.1", 369 | "esquery": "esquery@1.6.0", 370 | "esutils": "esutils@2.0.3", 371 | "fast-deep-equal": "fast-deep-equal@3.1.3", 372 | "file-entry-cache": "file-entry-cache@6.0.1", 373 | "find-up": "find-up@5.0.0", 374 | "glob-parent": "glob-parent@6.0.2", 375 | "globals": "globals@13.24.0", 376 | "graphemer": "graphemer@1.4.0", 377 | "ignore": "ignore@5.3.2", 378 | "imurmurhash": "imurmurhash@0.1.4", 379 | "is-glob": "is-glob@4.0.3", 380 | "is-path-inside": "is-path-inside@3.0.3", 381 | "js-yaml": "js-yaml@4.1.0", 382 | "json-stable-stringify-without-jsonify": "json-stable-stringify-without-jsonify@1.0.1", 383 | "levn": "levn@0.4.1", 384 | "lodash.merge": "lodash.merge@4.6.2", 385 | "minimatch": "minimatch@3.1.2", 386 | "natural-compare": "natural-compare@1.4.0", 387 | "optionator": "optionator@0.9.4", 388 | "strip-ansi": "strip-ansi@6.0.1", 389 | "text-table": "text-table@0.2.0" 390 | } 391 | }, 392 | "espree@9.6.1_acorn@8.12.1": { 393 | "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", 394 | "dependencies": { 395 | "acorn": "acorn@8.12.1", 396 | "acorn-jsx": "acorn-jsx@5.3.2_acorn@8.12.1", 397 | "eslint-visitor-keys": "eslint-visitor-keys@3.4.3" 398 | } 399 | }, 400 | "esquery@1.6.0": { 401 | "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", 402 | "dependencies": { 403 | "estraverse": "estraverse@5.3.0" 404 | } 405 | }, 406 | "esrecurse@4.3.0": { 407 | "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", 408 | "dependencies": { 409 | "estraverse": "estraverse@5.3.0" 410 | } 411 | }, 412 | "estraverse@5.3.0": { 413 | "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", 414 | "dependencies": {} 415 | }, 416 | "esutils@2.0.3": { 417 | "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", 418 | "dependencies": {} 419 | }, 420 | "fast-deep-equal@3.1.3": { 421 | "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", 422 | "dependencies": {} 423 | }, 424 | "fast-json-stable-stringify@2.1.0": { 425 | "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", 426 | "dependencies": {} 427 | }, 428 | "fast-levenshtein@2.0.6": { 429 | "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", 430 | "dependencies": {} 431 | }, 432 | "fastq@1.17.1": { 433 | "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", 434 | "dependencies": { 435 | "reusify": "reusify@1.0.4" 436 | } 437 | }, 438 | "file-entry-cache@6.0.1": { 439 | "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", 440 | "dependencies": { 441 | "flat-cache": "flat-cache@3.2.0" 442 | } 443 | }, 444 | "find-up@5.0.0": { 445 | "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", 446 | "dependencies": { 447 | "locate-path": "locate-path@6.0.0", 448 | "path-exists": "path-exists@4.0.0" 449 | } 450 | }, 451 | "flat-cache@3.2.0": { 452 | "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", 453 | "dependencies": { 454 | "flatted": "flatted@3.3.1", 455 | "keyv": "keyv@4.5.4", 456 | "rimraf": "rimraf@3.0.2" 457 | } 458 | }, 459 | "flatted@3.3.1": { 460 | "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", 461 | "dependencies": {} 462 | }, 463 | "fs.realpath@1.0.0": { 464 | "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", 465 | "dependencies": {} 466 | }, 467 | "glob-parent@6.0.2": { 468 | "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", 469 | "dependencies": { 470 | "is-glob": "is-glob@4.0.3" 471 | } 472 | }, 473 | "glob@7.2.3": { 474 | "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", 475 | "dependencies": { 476 | "fs.realpath": "fs.realpath@1.0.0", 477 | "inflight": "inflight@1.0.6", 478 | "inherits": "inherits@2.0.4", 479 | "minimatch": "minimatch@3.1.2", 480 | "once": "once@1.4.0", 481 | "path-is-absolute": "path-is-absolute@1.0.1" 482 | } 483 | }, 484 | "globals@13.24.0": { 485 | "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", 486 | "dependencies": { 487 | "type-fest": "type-fest@0.20.2" 488 | } 489 | }, 490 | "graphemer@1.4.0": { 491 | "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", 492 | "dependencies": {} 493 | }, 494 | "has-flag@4.0.0": { 495 | "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", 496 | "dependencies": {} 497 | }, 498 | "ignore@5.3.2": { 499 | "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", 500 | "dependencies": {} 501 | }, 502 | "import-fresh@3.3.0": { 503 | "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", 504 | "dependencies": { 505 | "parent-module": "parent-module@1.0.1", 506 | "resolve-from": "resolve-from@4.0.0" 507 | } 508 | }, 509 | "imurmurhash@0.1.4": { 510 | "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", 511 | "dependencies": {} 512 | }, 513 | "inflight@1.0.6": { 514 | "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", 515 | "dependencies": { 516 | "once": "once@1.4.0", 517 | "wrappy": "wrappy@1.0.2" 518 | } 519 | }, 520 | "inherits@2.0.4": { 521 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", 522 | "dependencies": {} 523 | }, 524 | "is-extglob@2.1.1": { 525 | "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", 526 | "dependencies": {} 527 | }, 528 | "is-glob@4.0.3": { 529 | "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", 530 | "dependencies": { 531 | "is-extglob": "is-extglob@2.1.1" 532 | } 533 | }, 534 | "is-path-inside@3.0.3": { 535 | "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", 536 | "dependencies": {} 537 | }, 538 | "isexe@2.0.0": { 539 | "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", 540 | "dependencies": {} 541 | }, 542 | "js-yaml@4.1.0": { 543 | "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", 544 | "dependencies": { 545 | "argparse": "argparse@2.0.1" 546 | } 547 | }, 548 | "json-buffer@3.0.1": { 549 | "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", 550 | "dependencies": {} 551 | }, 552 | "json-schema-traverse@0.4.1": { 553 | "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", 554 | "dependencies": {} 555 | }, 556 | "json-stable-stringify-without-jsonify@1.0.1": { 557 | "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", 558 | "dependencies": {} 559 | }, 560 | "keyv@4.5.4": { 561 | "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", 562 | "dependencies": { 563 | "json-buffer": "json-buffer@3.0.1" 564 | } 565 | }, 566 | "levn@0.4.1": { 567 | "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", 568 | "dependencies": { 569 | "prelude-ls": "prelude-ls@1.2.1", 570 | "type-check": "type-check@0.4.0" 571 | } 572 | }, 573 | "locate-path@6.0.0": { 574 | "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", 575 | "dependencies": { 576 | "p-locate": "p-locate@5.0.0" 577 | } 578 | }, 579 | "lodash.merge@4.6.2": { 580 | "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", 581 | "dependencies": {} 582 | }, 583 | "minimatch@3.1.2": { 584 | "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", 585 | "dependencies": { 586 | "brace-expansion": "brace-expansion@1.1.11" 587 | } 588 | }, 589 | "ms@2.1.2": { 590 | "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", 591 | "dependencies": {} 592 | }, 593 | "natural-compare@1.4.0": { 594 | "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", 595 | "dependencies": {} 596 | }, 597 | "node-fetch@2.7.0": { 598 | "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", 599 | "dependencies": { 600 | "whatwg-url": "whatwg-url@5.0.0" 601 | } 602 | }, 603 | "once@1.4.0": { 604 | "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", 605 | "dependencies": { 606 | "wrappy": "wrappy@1.0.2" 607 | } 608 | }, 609 | "optionator@0.9.4": { 610 | "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", 611 | "dependencies": { 612 | "deep-is": "deep-is@0.1.4", 613 | "fast-levenshtein": "fast-levenshtein@2.0.6", 614 | "levn": "levn@0.4.1", 615 | "prelude-ls": "prelude-ls@1.2.1", 616 | "type-check": "type-check@0.4.0", 617 | "word-wrap": "word-wrap@1.2.5" 618 | } 619 | }, 620 | "p-limit@3.1.0": { 621 | "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", 622 | "dependencies": { 623 | "yocto-queue": "yocto-queue@0.1.0" 624 | } 625 | }, 626 | "p-locate@5.0.0": { 627 | "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", 628 | "dependencies": { 629 | "p-limit": "p-limit@3.1.0" 630 | } 631 | }, 632 | "parent-module@1.0.1": { 633 | "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", 634 | "dependencies": { 635 | "callsites": "callsites@3.1.0" 636 | } 637 | }, 638 | "path-exists@4.0.0": { 639 | "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", 640 | "dependencies": {} 641 | }, 642 | "path-is-absolute@1.0.1": { 643 | "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", 644 | "dependencies": {} 645 | }, 646 | "path-key@3.1.1": { 647 | "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", 648 | "dependencies": {} 649 | }, 650 | "prelude-ls@1.2.1": { 651 | "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", 652 | "dependencies": {} 653 | }, 654 | "prettier@3.2.5": { 655 | "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", 656 | "dependencies": {} 657 | }, 658 | "punycode@2.3.1": { 659 | "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", 660 | "dependencies": {} 661 | }, 662 | "queue-microtask@1.2.3": { 663 | "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", 664 | "dependencies": {} 665 | }, 666 | "resolve-from@4.0.0": { 667 | "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", 668 | "dependencies": {} 669 | }, 670 | "reusify@1.0.4": { 671 | "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", 672 | "dependencies": {} 673 | }, 674 | "rimraf@3.0.2": { 675 | "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", 676 | "dependencies": { 677 | "glob": "glob@7.2.3" 678 | } 679 | }, 680 | "run-parallel@1.2.0": { 681 | "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", 682 | "dependencies": { 683 | "queue-microtask": "queue-microtask@1.2.3" 684 | } 685 | }, 686 | "shebang-command@2.0.0": { 687 | "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", 688 | "dependencies": { 689 | "shebang-regex": "shebang-regex@3.0.0" 690 | } 691 | }, 692 | "shebang-regex@3.0.0": { 693 | "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", 694 | "dependencies": {} 695 | }, 696 | "strip-ansi@6.0.1": { 697 | "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", 698 | "dependencies": { 699 | "ansi-regex": "ansi-regex@5.0.1" 700 | } 701 | }, 702 | "strip-json-comments@3.1.1": { 703 | "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", 704 | "dependencies": {} 705 | }, 706 | "supports-color@7.2.0": { 707 | "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", 708 | "dependencies": { 709 | "has-flag": "has-flag@4.0.0" 710 | } 711 | }, 712 | "sync-fetch@0.5.2": { 713 | "integrity": "sha512-6gBqqkHrYvkH65WI2bzrDwrIKmt3U10s4Exnz3dYuE5Ah62FIfNv/F63inrNhu2Nyh3GH5f42GKU3RrSJoaUyQ==", 714 | "dependencies": { 715 | "node-fetch": "node-fetch@2.7.0" 716 | } 717 | }, 718 | "text-table@0.2.0": { 719 | "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", 720 | "dependencies": {} 721 | }, 722 | "tr46@0.0.3": { 723 | "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", 724 | "dependencies": {} 725 | }, 726 | "type-check@0.4.0": { 727 | "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", 728 | "dependencies": { 729 | "prelude-ls": "prelude-ls@1.2.1" 730 | } 731 | }, 732 | "type-fest@0.20.2": { 733 | "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", 734 | "dependencies": {} 735 | }, 736 | "typescript@5.6.3": { 737 | "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", 738 | "dependencies": {} 739 | }, 740 | "uri-js@4.4.1": { 741 | "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", 742 | "dependencies": { 743 | "punycode": "punycode@2.3.1" 744 | } 745 | }, 746 | "webidl-conversions@3.0.1": { 747 | "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", 748 | "dependencies": {} 749 | }, 750 | "whatwg-url@5.0.0": { 751 | "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", 752 | "dependencies": { 753 | "tr46": "tr46@0.0.3", 754 | "webidl-conversions": "webidl-conversions@3.0.1" 755 | } 756 | }, 757 | "which@2.0.2": { 758 | "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", 759 | "dependencies": { 760 | "isexe": "isexe@2.0.0" 761 | } 762 | }, 763 | "word-wrap@1.2.5": { 764 | "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", 765 | "dependencies": {} 766 | }, 767 | "wrappy@1.0.2": { 768 | "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", 769 | "dependencies": {} 770 | }, 771 | "yaml@2.5.0": { 772 | "integrity": "sha512-2wWLbGbYDiSqqIKoPjar3MPgB94ErzCtrNE1FdqGuaO0pi2JGjmE8aW8TDZwzU7vuxcGRdL/4gPQwQ7hD5AMSw==", 773 | "dependencies": {} 774 | }, 775 | "yocto-queue@0.1.0": { 776 | "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", 777 | "dependencies": {} 778 | } 779 | } 780 | }, 781 | "remote": {}, 782 | "workspace": { 783 | "packageJson": { 784 | "dependencies": [ 785 | "npm:@jsr/cross__test", 786 | "npm:@jsr/std__assert", 787 | "npm:dets@^0.14.2", 788 | "npm:esbuild@^0.20.1", 789 | "npm:eslint-plugin-unused-imports@^3.1.0", 790 | "npm:eslint@^8.57.0", 791 | "npm:prettier@3.2.5", 792 | "npm:sync-fetch@^0.5.2", 793 | "npm:typescript@^5.3.3", 794 | "npm:yaml@^2.4.4" 795 | ] 796 | } 797 | } 798 | } 799 | -------------------------------------------------------------------------------- /dist/delay.d.mts: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Type representing a delayed effect to be lazily evaluated 4 | */ 5 | export type Delay$ = Continue | Stop 6 | 7 | 8 | /** 9 | * Stores an effect to be run later, short circuiting on errors 10 | */ 11 | export function delay_effect(func: () => Result): Delay$ 12 | 13 | 14 | /** 15 | * Chains an operation onto an existing delay. The result of the current delay will be lazily passed to `func` 16 | * `func` will not be called if the delay has already returned an error 17 | */ 18 | export function map(delayed: Delay$, func: (x0: JAQ) => Result): Delay$ 19 | 20 | 21 | /** 22 | * flatten a nested Delay 23 | */ 24 | export function flatten(delayed: Delay$, JBJ>): Delay$ 25 | 26 | 27 | /** 28 | * Map and then flatten `delayed` 29 | */ 30 | export function flat_map( 31 | delayed: Delay$, 32 | func: (x0: JBQ) => Result, JBR> 33 | ): Delay$ 34 | 35 | 36 | /** 37 | * Run a delayed effect and get the result 38 | * short-circuiting if any in delay in the chain returns an Error 39 | */ 40 | export function run(delayed: Delay$): Result 41 | 42 | 43 | /** 44 | * returns a delay, that joins two delays. If `left` fails `right` will not be run, if either fails the result will be an Error 45 | */ 46 | export function join( 47 | left: Delay$, 48 | right: Delay$ 49 | ): Delay$<[JCB, JCF], [Option$, Option$]> 50 | 51 | 52 | /** 53 | * Returns a new Delay that will be re-attempted `retries` times with `delay` ms in-between 54 | * Note: JS uses busy waiting 55 | */ 56 | export function retry(delayed: Delay$, retries: number, delay: number): Delay$ 57 | 58 | 59 | /** 60 | * Returns a new Delay that will be re-attempted `retries` times with `delay` ms in-between 61 | * Note: JS uses busy waiting 62 | */ 63 | export function retry_with_backoff(delayed: Delay$, retries: number): Delay$ 64 | 65 | 66 | /** 67 | * Run a delayed effect and throw away the result 68 | * short-circuiting if any in the chain returns an Error 69 | */ 70 | export function drain(delayed: Delay$): undefined 71 | 72 | 73 | /** 74 | * Run every effect in sequence and get their results 75 | */ 76 | export function every(effects: List>): List> 77 | 78 | 79 | /** 80 | * Repeat a Delay and return the results in a list 81 | */ 82 | export function repeat(delayed: Delay$, repetition: number): List> 83 | 84 | 85 | /** 86 | * Run all effects in sequence and return True if all succeed 87 | * NOTE: this will _always_ run _every_ effect 88 | */ 89 | export function all(effects: List>): boolean 90 | 91 | 92 | /** 93 | * Run all effects in sequence and return True if any succeeds 94 | * NOTE: this is different than `fallthrough/1` because it will _always_ run _every_ effect 95 | */ 96 | export function any(effects: List>): boolean 97 | 98 | 99 | /** 100 | * Attempt multiple Delays until one returns an Ok 101 | * unlike `any/1` this will short circuit on the first Ok 102 | */ 103 | export function fallthrough(effects: List>): Result 104 | 105 | export class Continue extends CustomType { 106 | constructor(effect: () => Result) 107 | effect(): Result 108 | } 109 | 110 | export class Stop extends CustomType { 111 | constructor(err: JAJ) 112 | err: JAJ 113 | } 114 | 115 | export class Result extends CustomType { 116 | static isResult(data: unknown): boolean 117 | isOk(): boolean 118 | } 119 | 120 | export type Option$ = Some | None 121 | 122 | export class List implements any { 123 | head: T 124 | tail: List 125 | static fromArray(array: Array): List 126 | toArray(): Array 127 | atLeastLength(desired: number): boolean 128 | hasLength(desired: number): boolean 129 | countLength(): number 130 | [Symbol.iterator](): Iterator 131 | } 132 | 133 | export class CustomType { 134 | withFields(fields: { 135 | [P in K]: this[P] 136 | }): this 137 | } 138 | 139 | export class Some extends CustomType { 140 | constructor(argument$0: GA) 141 | 0: GA 142 | } 143 | 144 | export class None extends CustomType {} 145 | -------------------------------------------------------------------------------- /dist/delay.mjs: -------------------------------------------------------------------------------- 1 | //Code for `delay-gleam` Generated using Gleam & Esbuild 2 | //https://www.npmjs.com/package/delay-gleam 3 | //https://github.com/bwireman/delay 4 | var __defProp = Object.defineProperty 5 | var __name = (target, value) => __defProp(target, "name", { value, configurable: true }) 6 | 7 | import { Ok as Ok8, Error as Error10, toList as toList8, prepend as listPrepend7 } from "./extras/prelude.mjs" 8 | 9 | import { CustomType as $CustomType } from "./extras/prelude.mjs" 10 | var Some = class extends $CustomType { 11 | static { 12 | __name(this, "Some") 13 | } 14 | constructor(x0) { 15 | super() 16 | this[0] = x0 17 | } 18 | } 19 | var None = class extends $CustomType { 20 | static { 21 | __name(this, "None") 22 | } 23 | } 24 | 25 | import { Error as Error6 } from "./extras/prelude.mjs" 26 | function is_ok(result) { 27 | if (!result.isOk()) { 28 | return false 29 | } else { 30 | return true 31 | } 32 | } 33 | __name(is_ok, "is_ok") 34 | function try$(result, fun) { 35 | if (result.isOk()) { 36 | let x = result[0] 37 | return fun(x) 38 | } else { 39 | let e = result[0] 40 | return new Error6(e) 41 | } 42 | } 43 | __name(try$, "try$") 44 | function lazy_or(first, second) { 45 | if (first.isOk()) { 46 | return first 47 | } else { 48 | return second() 49 | } 50 | } 51 | __name(lazy_or, "lazy_or") 52 | function all(results) { 53 | return try_map(results, x => { 54 | return x 55 | }) 56 | } 57 | __name(all, "all") 58 | 59 | var unicode_whitespaces = [ 60 | " ", 61 | // Space 62 | " ", 63 | // Horizontal tab 64 | "\n", 65 | // Line feed 66 | "\v", 67 | // Vertical tab 68 | "\f", 69 | // Form feed 70 | "\r", 71 | // Carriage return 72 | "\x85", 73 | // Next line 74 | "\u2028", 75 | // Line separator 76 | "\u2029" 77 | // Paragraph separator 78 | ].join("") 79 | 80 | function length_loop(loop$list, loop$count) { 81 | while (true) { 82 | let list = loop$list 83 | let count = loop$count 84 | if (list.atLeastLength(1)) { 85 | let list$1 = list.tail 86 | loop$list = list$1 87 | loop$count = count + 1 88 | } else { 89 | return count 90 | } 91 | } 92 | } 93 | __name(length_loop, "length_loop") 94 | function length2(list) { 95 | return length_loop(list, 0) 96 | } 97 | __name(length2, "length") 98 | function reverse_and_prepend(loop$prefix, loop$suffix) { 99 | while (true) { 100 | let prefix = loop$prefix 101 | let suffix = loop$suffix 102 | if (prefix.hasLength(0)) { 103 | return suffix 104 | } else { 105 | let first$1 = prefix.head 106 | let rest$1 = prefix.tail 107 | loop$prefix = rest$1 108 | loop$suffix = listPrepend7(first$1, suffix) 109 | } 110 | } 111 | } 112 | __name(reverse_and_prepend, "reverse_and_prepend") 113 | function reverse(list) { 114 | return reverse_and_prepend(list, toList8([])) 115 | } 116 | __name(reverse, "reverse") 117 | function filter_loop(loop$list, loop$fun, loop$acc) { 118 | while (true) { 119 | let list = loop$list 120 | let fun = loop$fun 121 | let acc = loop$acc 122 | if (list.hasLength(0)) { 123 | return reverse(acc) 124 | } else { 125 | let first$1 = list.head 126 | let rest$1 = list.tail 127 | let new_acc = (() => { 128 | let $ = fun(first$1) 129 | if ($) { 130 | return listPrepend7(first$1, acc) 131 | } else { 132 | return acc 133 | } 134 | })() 135 | loop$list = rest$1 136 | loop$fun = fun 137 | loop$acc = new_acc 138 | } 139 | } 140 | } 141 | __name(filter_loop, "filter_loop") 142 | function filter(list, predicate) { 143 | return filter_loop(list, predicate, toList8([])) 144 | } 145 | __name(filter, "filter") 146 | function try_map_loop(loop$list, loop$fun, loop$acc) { 147 | while (true) { 148 | let list = loop$list 149 | let fun = loop$fun 150 | let acc = loop$acc 151 | if (list.hasLength(0)) { 152 | return new Ok8(reverse(acc)) 153 | } else { 154 | let first$1 = list.head 155 | let rest$1 = list.tail 156 | let $ = fun(first$1) 157 | if ($.isOk()) { 158 | let first$2 = $[0] 159 | loop$list = rest$1 160 | loop$fun = fun 161 | loop$acc = listPrepend7(first$2, acc) 162 | } else { 163 | let error = $[0] 164 | return new Error10(error) 165 | } 166 | } 167 | } 168 | } 169 | __name(try_map_loop, "try_map_loop") 170 | function try_map(list, fun) { 171 | return try_map_loop(list, fun, toList8([])) 172 | } 173 | __name(try_map, "try_map") 174 | function repeat_loop(loop$item, loop$times, loop$acc) { 175 | while (true) { 176 | let item = loop$item 177 | let times = loop$times 178 | let acc = loop$acc 179 | let $ = times <= 0 180 | if ($) { 181 | return acc 182 | } else { 183 | loop$item = item 184 | loop$times = times - 1 185 | loop$acc = listPrepend7(item, acc) 186 | } 187 | } 188 | } 189 | __name(repeat_loop, "repeat_loop") 190 | function repeat2(a, times) { 191 | return repeat_loop(a, times, toList8([])) 192 | } 193 | __name(repeat2, "repeat") 194 | 195 | // build/dev/javascript/delay/ffi.mjs 196 | function busy_wait(delay) { 197 | const fin = Date.now() + delay 198 | while (Date.now() < fin) {} 199 | } 200 | __name(busy_wait, "busy_wait") 201 | 202 | // build/dev/javascript/delay/delay.mjs 203 | import { 204 | Ok as Ok9, 205 | Error as Error11, 206 | toList as toList9, 207 | prepend as listPrepend8, 208 | CustomType as $CustomType7, 209 | makeError as makeError2 210 | } from "./extras/prelude.mjs" 211 | var Continue = class extends $CustomType7 { 212 | static { 213 | __name(this, "Continue") 214 | } 215 | constructor(effect) { 216 | super() 217 | this.effect = effect 218 | } 219 | } 220 | var Stop = class extends $CustomType7 { 221 | static { 222 | __name(this, "Stop") 223 | } 224 | constructor(err) { 225 | super() 226 | this.err = err 227 | } 228 | } 229 | 230 | /** 231 | * Stores an effect to be run later, short circuiting on errors 232 | */ 233 | function delay_effect(func) { 234 | return new Continue(func) 235 | } 236 | __name(delay_effect, "delay_effect") 237 | function chain(delayed_func, func) { 238 | return () => { 239 | return try$(delayed_func(), func) 240 | } 241 | } 242 | __name(chain, "chain") 243 | 244 | /** 245 | * Chains an operation onto an existing delay. The result of the current delay will be lazily passed to `func` 246 | * `func` will not be called if the delay has already returned an error 247 | */ 248 | function map3(delayed, func) { 249 | if (delayed instanceof Continue) { 250 | let delayed_func = delayed.effect 251 | let _pipe = chain(delayed_func, func) 252 | return delay_effect(_pipe) 253 | } else { 254 | let err = delayed.err 255 | return new Stop(err) 256 | } 257 | } 258 | __name(map3, "map") 259 | 260 | /** 261 | * flatten a nested Delay 262 | */ 263 | function flatten2(delayed) { 264 | let _pipe = (() => { 265 | if (delayed instanceof Continue) { 266 | let delayed_func = delayed.effect 267 | return () => { 268 | let inner = (() => { 269 | let $ = delayed_func() 270 | if ($.isOk()) { 271 | let inner_delay = $[0] 272 | return inner_delay 273 | } else { 274 | let err = $[0] 275 | return new Stop(err) 276 | } 277 | })() 278 | if (inner instanceof Continue) { 279 | let inner_func = inner.effect 280 | return inner_func() 281 | } else { 282 | let err = inner.err 283 | return new Error11(err) 284 | } 285 | } 286 | } else { 287 | let err = delayed.err 288 | return () => { 289 | return new Error11(err) 290 | } 291 | } 292 | })() 293 | return delay_effect(_pipe) 294 | } 295 | __name(flatten2, "flatten") 296 | 297 | /** 298 | * Map and then flatten `delayed` 299 | */ 300 | function flat_map(delayed, func) { 301 | let _pipe = delayed 302 | let _pipe$1 = map3(_pipe, func) 303 | return flatten2(_pipe$1) 304 | } 305 | __name(flat_map, "flat_map") 306 | 307 | /** 308 | * Run a delayed effect and get the result 309 | * short-circuiting if any in delay in the chain returns an Error 310 | */ 311 | function run(delayed) { 312 | if (delayed instanceof Continue) { 313 | let func = delayed.effect 314 | return func() 315 | } else { 316 | let err = delayed.err 317 | return new Error11(err) 318 | } 319 | } 320 | __name(run, "run") 321 | 322 | /** 323 | * returns a delay, that joins two delays. If `left` fails `right` will not be run, if either fails the result will be an Error 324 | */ 325 | function join2(left, right) { 326 | let _pipe = /* @__PURE__ */ __name(() => { 327 | let $ = run(left) 328 | if (!$.isOk()) { 329 | let err = $[0] 330 | return new Error11([new Some(err), new None()]) 331 | } else { 332 | let left_val = $[0] 333 | let $1 = run(right) 334 | if ($1.isOk()) { 335 | let right_val = $1[0] 336 | return new Ok9([left_val, right_val]) 337 | } else { 338 | let err = $1[0] 339 | return new Error11([new None(), new Some(err)]) 340 | } 341 | } 342 | }, "_pipe") 343 | return delay_effect(_pipe) 344 | } 345 | __name(join2, "join") 346 | function do_retry(delayed, retries, delay, backoff) { 347 | let delay$1 = (() => { 348 | if (backoff) { 349 | return delay + 1e3 350 | } else { 351 | return delay 352 | } 353 | })() 354 | if (retries <= 1) { 355 | return run(delayed) 356 | } else { 357 | return lazy_or(run(delayed), () => { 358 | busy_wait(delay$1) 359 | return do_retry(delayed, retries - 1, delay$1, backoff) 360 | }) 361 | } 362 | } 363 | __name(do_retry, "do_retry") 364 | 365 | /** 366 | * Returns a new Delay that will be re-attempted `retries` times with `delay` ms in-between 367 | * Note: JS uses busy waiting 368 | */ 369 | function retry(delayed, retries, delay) { 370 | return delay_effect(() => { 371 | return do_retry(delayed, retries, delay, false) 372 | }) 373 | } 374 | __name(retry, "retry") 375 | 376 | /** 377 | * Returns a new Delay that will be re-attempted `retries` times with `delay` ms in-between 378 | * Note: JS uses busy waiting 379 | */ 380 | function retry_with_backoff(delayed, retries) { 381 | return delay_effect(() => { 382 | return do_retry(delayed, retries, 0, true) 383 | }) 384 | } 385 | __name(retry_with_backoff, "retry_with_backoff") 386 | 387 | /** 388 | * Run a delayed effect and throw away the result 389 | * short-circuiting if any in the chain returns an Error 390 | */ 391 | function drain(delayed) { 392 | let $ = run(delayed) 393 | return void 0 394 | } 395 | __name(drain, "drain") 396 | function do_every(loop$effects, loop$results) { 397 | while (true) { 398 | let effects = loop$effects 399 | let results = loop$results 400 | if (effects.hasLength(1)) { 401 | let last = effects.head 402 | return listPrepend8(run(last), results) 403 | } else if (effects.atLeastLength(1)) { 404 | let head = effects.head 405 | let rest = effects.tail 406 | loop$effects = rest 407 | loop$results = listPrepend8(run(head), results) 408 | } else { 409 | throw makeError2("panic", "delay", 196, "do_every", "Empty list", {}) 410 | } 411 | } 412 | } 413 | __name(do_every, "do_every") 414 | 415 | /** 416 | * Run every effect in sequence and get their results 417 | */ 418 | function every(effects) { 419 | return do_every(effects, toList9([])) 420 | } 421 | __name(every, "every") 422 | 423 | /** 424 | * Repeat a Delay and return the results in a list 425 | */ 426 | function repeat3(delayed, repetition) { 427 | let _pipe = delayed 428 | let _pipe$1 = repeat2(_pipe, repetition) 429 | return every(_pipe$1) 430 | } 431 | __name(repeat3, "repeat") 432 | 433 | /** 434 | * Run all effects in sequence and return True if all succeed 435 | * NOTE: this will _always_ run _every_ effect 436 | */ 437 | function all2(effects) { 438 | let _pipe = effects 439 | let _pipe$1 = every(_pipe) 440 | let _pipe$2 = all(_pipe$1) 441 | return is_ok(_pipe$2) 442 | } 443 | __name(all2, "all") 444 | 445 | /** 446 | * Run all effects in sequence and return True if any succeeds 447 | * NOTE: this is different than `fallthrough/1` because it will _always_ run _every_ effect 448 | */ 449 | function any(effects) { 450 | return ( 451 | (() => { 452 | let _pipe = effects 453 | let _pipe$1 = every(_pipe) 454 | let _pipe$2 = filter(_pipe$1, is_ok) 455 | return length2(_pipe$2) 456 | })() > 0 457 | ) 458 | } 459 | __name(any, "any") 460 | function do_fallthrough(effects) { 461 | if (effects.hasLength(1)) { 462 | let last = effects.head 463 | return run(last) 464 | } else if (effects.atLeastLength(1)) { 465 | let head = effects.head 466 | let rest = effects.tail 467 | return lazy_or(run(head), () => { 468 | return fallthrough(rest) 469 | }) 470 | } else { 471 | throw makeError2("panic", "delay", 211, "do_fallthrough", "Empty list", {}) 472 | } 473 | } 474 | __name(do_fallthrough, "do_fallthrough") 475 | 476 | /** 477 | * Attempt multiple Delays until one returns an Ok 478 | * unlike `any/1` this will short circuit on the first Ok 479 | */ 480 | function fallthrough(effects) { 481 | return do_fallthrough(effects) 482 | } 483 | __name(fallthrough, "fallthrough") 484 | export { 485 | all2 as all, 486 | any, 487 | delay_effect, 488 | drain, 489 | every, 490 | fallthrough, 491 | flat_map, 492 | flatten2 as flatten, 493 | join2 as join, 494 | map3 as map, 495 | repeat3 as repeat, 496 | retry, 497 | retry_with_backoff, 498 | run 499 | } 500 | -------------------------------------------------------------------------------- /dist/extras/extras.d.mts: -------------------------------------------------------------------------------- 1 | import type { Ok, Error } from "./prelude.d.mts" 2 | 3 | /** 4 | * wraps the value in an Ok, indicating the the function succeeded 5 | * @param {any} v 6 | * @returns Ok 7 | */ 8 | export function ok(v: A): Ok 9 | 10 | /** 11 | * wraps the value in an Error, indicating the the function failed 12 | * @param {any} v 13 | * @returns Error 14 | */ 15 | export function error(v: A): Error 16 | 17 | /** 18 | * Extracts the value from a result 19 | * @param {Result} result 20 | * @returns any 21 | */ 22 | export function get(result: Result): A | B 23 | 24 | /** 25 | * Returns true when result is an instance of Ok 26 | * @param {Result} result 27 | * @returns boolean 28 | */ 29 | export function isOk(result: Result): boolean 30 | 31 | /** 32 | * Converts an array to a list for use with delay 33 | * @param array 34 | * @returns List 35 | */ 36 | export function toList(array: Array): List 37 | -------------------------------------------------------------------------------- /dist/extras/extras.mjs: -------------------------------------------------------------------------------- 1 | import { Ok, Error, toList } from "./prelude.mjs" 2 | 3 | /** 4 | * wraps the value in an Ok, indicating the the function succeeded 5 | * @param {any} v 6 | * @returns Ok 7 | */ 8 | function ok(v) { 9 | return new Ok(v) 10 | } 11 | 12 | /** 13 | * wraps the value in an Error, indicating the the function failed 14 | * @param {any} v 15 | * @returns Error 16 | */ 17 | function error(v) { 18 | return new Error(v) 19 | } 20 | 21 | /** 22 | * Extracts the value from a result 23 | * @param {Result} result 24 | * @returns any 25 | */ 26 | function get(result) { 27 | return result[0] 28 | } 29 | 30 | /** 31 | * Returns true when result is an instance of Ok 32 | * @param {Result} result 33 | * @returns boolean 34 | */ 35 | function isOk(result) { 36 | return result instanceof Ok 37 | } 38 | 39 | export { ok, error, get, isOk, toList } 40 | -------------------------------------------------------------------------------- /dist/extras/prelude.d.mts: -------------------------------------------------------------------------------- 1 | // --- 2 | // Apache License 3 | // Version 2.0, January 2004 4 | // http://www.apache.org/licenses/ 5 | // 6 | // TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | // 8 | // 1. Definitions. 9 | // 10 | // "License" shall mean the terms and conditions for use, reproduction, 11 | // and distribution as defined by Sections 1 through 9 of this document. 12 | // 13 | // "Licensor" shall mean the copyright owner or entity authorized by 14 | // the copyright owner that is granting the License. 15 | // 16 | // "Legal Entity" shall mean the union of the acting entity and all 17 | // other entities that control, are controlled by, or are under common 18 | // control with that entity. For the purposes of this definition, 19 | // "control" means (i) the power, direct or indirect, to cause the 20 | // direction or management of such entity, whether by contract or 21 | // otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | // outstanding shares, or (iii) beneficial ownership of such entity. 23 | // 24 | // "You" (or "Your") shall mean an individual or Legal Entity 25 | // exercising permissions granted by this License. 26 | // 27 | // "Source" form shall mean the preferred form for making modifications, 28 | // including but not limited to software source code, documentation 29 | // source, and configuration files. 30 | // 31 | // "Object" form shall mean any form resulting from mechanical 32 | // transformation or translation of a Source form, including but 33 | // not limited to compiled object code, generated documentation, 34 | // and conversions to other media types. 35 | // 36 | // "Work" shall mean the work of authorship, whether in Source or 37 | // Object form, made available under the License, as indicated by a 38 | // copyright notice that is included in or attached to the work 39 | // (an example is provided in the Appendix below). 40 | // 41 | // "Derivative Works" shall mean any work, whether in Source or Object 42 | // form, that is based on (or derived from) the Work and for which the 43 | // editorial revisions, annotations, elaborations, or other modifications 44 | // represent, as a whole, an original work of authorship. For the purposes 45 | // of this License, Derivative Works shall not include works that remain 46 | // separable from, or merely link (or bind by name) to the interfaces of, 47 | // the Work and Derivative Works thereof. 48 | // 49 | // "Contribution" shall mean any work of authorship, including 50 | // the original version of the Work and any modifications or additions 51 | // to that Work or Derivative Works thereof, that is intentionally 52 | // submitted to Licensor for inclusion in the Work by the copyright owner 53 | // or by an individual or Legal Entity authorized to submit on behalf of 54 | // the copyright owner. For the purposes of this definition, "submitted" 55 | // means any form of electronic, verbal, or written communication sent 56 | // to the Licensor or its representatives, including but not limited to 57 | // communication on electronic mailing lists, source code control systems, 58 | // and issue tracking systems that are managed by, or on behalf of, the 59 | // Licensor for the purpose of discussing and improving the Work, but 60 | // excluding communication that is conspicuously marked or otherwise 61 | // designated in writing by the copyright owner as "Not a Contribution." 62 | // 63 | // "Contributor" shall mean Licensor and any individual or Legal Entity 64 | // on behalf of whom a Contribution has been received by Licensor and 65 | // subsequently incorporated within the Work. 66 | // 67 | // 2. Grant of Copyright License. Subject to the terms and conditions of 68 | // this License, each Contributor hereby grants to You a perpetual, 69 | // worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | // copyright license to reproduce, prepare Derivative Works of, 71 | // publicly display, publicly perform, sublicense, and distribute the 72 | // Work and such Derivative Works in Source or Object form. 73 | // 74 | // 3. Grant of Patent License. Subject to the terms and conditions of 75 | // this License, each Contributor hereby grants to You a perpetual, 76 | // worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | // (except as stated in this section) patent license to make, have made, 78 | // use, offer to sell, sell, import, and otherwise transfer the Work, 79 | // where such license applies only to those patent claims licensable 80 | // by such Contributor that are necessarily infringed by their 81 | // Contribution(s) alone or by combination of their Contribution(s) 82 | // with the Work to which such Contribution(s) was submitted. If You 83 | // institute patent litigation against any entity (including a 84 | // cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | // or a Contribution incorporated within the Work constitutes direct 86 | // or contributory patent infringement, then any patent licenses 87 | // granted to You under this License for that Work shall terminate 88 | // as of the date such litigation is filed. 89 | // 90 | // 4. Redistribution. You may reproduce and distribute copies of the 91 | // Work or Derivative Works thereof in any medium, with or without 92 | // modifications, and in Source or Object form, provided that You 93 | // meet the following conditions: 94 | // 95 | // (a) You must give any other recipients of the Work or 96 | // Derivative Works a copy of this License; and 97 | // 98 | // (b) You must cause any modified files to carry prominent notices 99 | // stating that You changed the files; and 100 | // 101 | // (c) You must retain, in the Source form of any Derivative Works 102 | // that You distribute, all copyright, patent, trademark, and 103 | // attribution notices from the Source form of the Work, 104 | // excluding those notices that do not pertain to any part of 105 | // the Derivative Works; and 106 | // 107 | // (d) If the Work includes a "NOTICE" text file as part of its 108 | // distribution, then any Derivative Works that You distribute must 109 | // include a readable copy of the attribution notices contained 110 | // within such NOTICE file, excluding those notices that do not 111 | // pertain to any part of the Derivative Works, in at least one 112 | // of the following places: within a NOTICE text file distributed 113 | // as part of the Derivative Works; within the Source form or 114 | // documentation, if provided along with the Derivative Works; or, 115 | // within a display generated by the Derivative Works, if and 116 | // wherever such third-party notices normally appear. The contents 117 | // of the NOTICE file are for informational purposes only and 118 | // do not modify the License. You may add Your own attribution 119 | // notices within Derivative Works that You distribute, alongside 120 | // or as an addendum to the NOTICE text from the Work, provided 121 | // that such additional attribution notices cannot be construed 122 | // as modifying the License. 123 | // 124 | // You may add Your own copyright statement to Your modifications and 125 | // may provide additional or different license terms and conditions 126 | // for use, reproduction, or distribution of Your modifications, or 127 | // for any such Derivative Works as a whole, provided Your use, 128 | // reproduction, and distribution of the Work otherwise complies with 129 | // the conditions stated in this License. 130 | // 131 | // 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | // any Contribution intentionally submitted for inclusion in the Work 133 | // by You to the Licensor shall be under the terms and conditions of 134 | // this License, without any additional terms or conditions. 135 | // Notwithstanding the above, nothing herein shall supersede or modify 136 | // the terms of any separate license agreement you may have executed 137 | // with Licensor regarding such Contributions. 138 | // 139 | // 6. Trademarks. This License does not grant permission to use the trade 140 | // names, trademarks, service marks, or product names of the Licensor, 141 | // except as required for reasonable and customary use in describing the 142 | // origin of the Work and reproducing the content of the NOTICE file. 143 | // 144 | // 7. Disclaimer of Warranty. Unless required by applicable law or 145 | // agreed to in writing, Licensor provides the Work (and each 146 | // Contributor provides its Contributions) on an "AS IS" BASIS, 147 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | // implied, including, without limitation, any warranties or conditions 149 | // of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | // PARTICULAR PURPOSE. You are solely responsible for determining the 151 | // appropriateness of using or redistributing the Work and assume any 152 | // risks associated with Your exercise of permissions under this License. 153 | // 154 | // 8. Limitation of Liability. In no event and under no legal theory, 155 | // whether in tort (including negligence), contract, or otherwise, 156 | // unless required by applicable law (such as deliberate and grossly 157 | // negligent acts) or agreed to in writing, shall any Contributor be 158 | // liable to You for damages, including any direct, indirect, special, 159 | // incidental, or consequential damages of any character arising as a 160 | // result of this License or out of the use or inability to use the 161 | // Work (including but not limited to damages for loss of goodwill, 162 | // work stoppage, computer failure or malfunction, or any and all 163 | // other commercial damages or losses), even if such Contributor 164 | // has been advised of the possibility of such damages. 165 | // 166 | // 9. Accepting Warranty or Additional Liability. While redistributing 167 | // the Work or Derivative Works thereof, You may choose to offer, 168 | // and charge a fee for, acceptance of support, warranty, indemnity, 169 | // or other liability obligations and/or rights consistent with this 170 | // License. However, in accepting such obligations, You may act only 171 | // on Your own behalf and on Your sole responsibility, not on behalf 172 | // of any other Contributor, and only if You agree to indemnify, 173 | // defend, and hold each Contributor harmless for any liability 174 | // incurred by, or claims asserted against, such Contributor by reason 175 | // of your accepting any such warranty or additional liability. 176 | // 177 | // END OF TERMS AND CONDITIONS 178 | // 179 | // APPENDIX: How to apply the Apache License to your work. 180 | // 181 | // To apply the Apache License to your work, attach the following 182 | // boilerplate notice, with the fields enclosed by brackets "[]" 183 | // replaced with your own identifying information. (Don't include 184 | // the brackets!) The text should be enclosed in the appropriate 185 | // comment syntax for the file format. We also recommend that a 186 | // file or class name and description of purpose be included on the 187 | // same "printed page" as the copyright notice for easier 188 | // identification within third-party archives. 189 | // 190 | // Copyright 2016 - present Louis Pilfold 191 | // 192 | // Licensed under the Apache License, Version 2.0 (the "License"); 193 | // you may not use this file except in compliance with the License. 194 | // You may obtain a copy of the License at 195 | // 196 | // http://www.apache.org/licenses/LICENSE-2.0 197 | // 198 | // Unless required by applicable law or agreed to in writing, software 199 | // distributed under the License is distributed on an "AS IS" BASIS, 200 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | // See the License for the specific language governing permissions and 202 | // limitations under the License. 203 | export class CustomType { 204 | withFields(fields: { [P in K]: this[P] }): this 205 | } 206 | 207 | export class List implements Iterable { 208 | head?: T 209 | tail?: List 210 | static fromArray(array: Array): List 211 | toArray(): Array 212 | atLeastLength(desired: number): boolean 213 | hasLength(desired: number): boolean 214 | countLength(): number 215 | 216 | [Symbol.iterator](): Iterator 217 | } 218 | 219 | export function prepend(element: T, tail: List): List 220 | export function toList(array: Array): List 221 | 222 | export class Empty extends List {} 223 | 224 | export class NonEmpty extends List {} 225 | 226 | export class BitArray { 227 | buffer: Uint8Array 228 | constructor(buffer: Uint8Array) 229 | get length(): number 230 | byteAt(index: number): number 231 | floatFromSlice(index: number, end: number, isBigEndian: boolean): number 232 | intFromSlice(start: number, end: number, isBigEndian: boolean, isSigned: boolean): number 233 | binaryFromSlice(start: number, end: number): BitArray 234 | sliceAfter(index: number): BitArray 235 | } 236 | 237 | export class UtfCodepoint { 238 | value: string 239 | } 240 | 241 | export function toBitArray(segments: Array): BitArray 242 | 243 | export function sizedInt(int: number, size: number, isBigEndian: boolean): Uint8Array 244 | 245 | export function byteArrayToInt( 246 | byteArray: Uint8Array, 247 | start: number, 248 | end: number, 249 | isBigEndian: boolean, 250 | isSigned: boolean 251 | ): number 252 | 253 | export function byteArrayToFloat(byteArray: Uint8Array, start: number, end: number, isBigEndian: boolean): number 254 | 255 | export function stringBits(string: string): Uint8Array 256 | 257 | export function codepointBits(codepoint: UtfCodepoint): Uint8Array 258 | 259 | export function sizedFloat(float: number, size: number, isBigEndian: boolean): Uint8Array 260 | 261 | export class Result extends CustomType { 262 | static isResult(data: unknown): boolean 263 | isOk(): boolean 264 | } 265 | 266 | export class Ok extends Result { 267 | 0: T 268 | constructor(value: T) 269 | } 270 | 271 | export class Error extends Result { 272 | 0: E 273 | constructor(value: E) 274 | } 275 | 276 | export function isEqual(a: any, b: any): boolean 277 | 278 | export function remainderInt(a: number, b: number): number 279 | 280 | export function divideInt(a: number, b: number): number 281 | 282 | export function divideFloat(a: number, b: number): number 283 | -------------------------------------------------------------------------------- /dist/extras/prelude.mjs: -------------------------------------------------------------------------------- 1 | // copy of https://github.com/gleam-lang/gleam/blob/v1.8.0/compiler-core/templates/prelude.mjs 2 | // --- 3 | // Apache License 4 | // Version 2.0, January 2004 5 | // http://www.apache.org/licenses/ 6 | // 7 | // TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 8 | // 9 | // 1. Definitions. 10 | // 11 | // "License" shall mean the terms and conditions for use, reproduction, 12 | // and distribution as defined by Sections 1 through 9 of this document. 13 | // 14 | // "Licensor" shall mean the copyright owner or entity authorized by 15 | // the copyright owner that is granting the License. 16 | // 17 | // "Legal Entity" shall mean the union of the acting entity and all 18 | // other entities that control, are controlled by, or are under common 19 | // control with that entity. For the purposes of this definition, 20 | // "control" means (i) the power, direct or indirect, to cause the 21 | // direction or management of such entity, whether by contract or 22 | // otherwise, or (ii) ownership of fifty percent (50%) or more of the 23 | // outstanding shares, or (iii) beneficial ownership of such entity. 24 | // 25 | // "You" (or "Your") shall mean an individual or Legal Entity 26 | // exercising permissions granted by this License. 27 | // 28 | // "Source" form shall mean the preferred form for making modifications, 29 | // including but not limited to software source code, documentation 30 | // source, and configuration files. 31 | // 32 | // "Object" form shall mean any form resulting from mechanical 33 | // transformation or translation of a Source form, including but 34 | // not limited to compiled object code, generated documentation, 35 | // and conversions to other media types. 36 | // 37 | // "Work" shall mean the work of authorship, whether in Source or 38 | // Object form, made available under the License, as indicated by a 39 | // copyright notice that is included in or attached to the work 40 | // (an example is provided in the Appendix below). 41 | // 42 | // "Derivative Works" shall mean any work, whether in Source or Object 43 | // form, that is based on (or derived from) the Work and for which the 44 | // editorial revisions, annotations, elaborations, or other modifications 45 | // represent, as a whole, an original work of authorship. For the purposes 46 | // of this License, Derivative Works shall not include works that remain 47 | // separable from, or merely link (or bind by name) to the interfaces of, 48 | // the Work and Derivative Works thereof. 49 | // 50 | // "Contribution" shall mean any work of authorship, including 51 | // the original version of the Work and any modifications or additions 52 | // to that Work or Derivative Works thereof, that is intentionally 53 | // submitted to Licensor for inclusion in the Work by the copyright owner 54 | // or by an individual or Legal Entity authorized to submit on behalf of 55 | // the copyright owner. For the purposes of this definition, "submitted" 56 | // means any form of electronic, verbal, or written communication sent 57 | // to the Licensor or its representatives, including but not limited to 58 | // communication on electronic mailing lists, source code control systems, 59 | // and issue tracking systems that are managed by, or on behalf of, the 60 | // Licensor for the purpose of discussing and improving the Work, but 61 | // excluding communication that is conspicuously marked or otherwise 62 | // designated in writing by the copyright owner as "Not a Contribution." 63 | // 64 | // "Contributor" shall mean Licensor and any individual or Legal Entity 65 | // on behalf of whom a Contribution has been received by Licensor and 66 | // subsequently incorporated within the Work. 67 | // 68 | // 2. Grant of Copyright License. Subject to the terms and conditions of 69 | // this License, each Contributor hereby grants to You a perpetual, 70 | // worldwide, non-exclusive, no-charge, royalty-free, irrevocable 71 | // copyright license to reproduce, prepare Derivative Works of, 72 | // publicly display, publicly perform, sublicense, and distribute the 73 | // Work and such Derivative Works in Source or Object form. 74 | // 75 | // 3. Grant of Patent License. Subject to the terms and conditions of 76 | // this License, each Contributor hereby grants to You a perpetual, 77 | // worldwide, non-exclusive, no-charge, royalty-free, irrevocable 78 | // (except as stated in this section) patent license to make, have made, 79 | // use, offer to sell, sell, import, and otherwise transfer the Work, 80 | // where such license applies only to those patent claims licensable 81 | // by such Contributor that are necessarily infringed by their 82 | // Contribution(s) alone or by combination of their Contribution(s) 83 | // with the Work to which such Contribution(s) was submitted. If You 84 | // institute patent litigation against any entity (including a 85 | // cross-claim or counterclaim in a lawsuit) alleging that the Work 86 | // or a Contribution incorporated within the Work constitutes direct 87 | // or contributory patent infringement, then any patent licenses 88 | // granted to You under this License for that Work shall terminate 89 | // as of the date such litigation is filed. 90 | // 91 | // 4. Redistribution. You may reproduce and distribute copies of the 92 | // Work or Derivative Works thereof in any medium, with or without 93 | // modifications, and in Source or Object form, provided that You 94 | // meet the following conditions: 95 | // 96 | // (a) You must give any other recipients of the Work or 97 | // Derivative Works a copy of this License; and 98 | // 99 | // (b) You must cause any modified files to carry prominent notices 100 | // stating that You changed the files; and 101 | // 102 | // (c) You must retain, in the Source form of any Derivative Works 103 | // that You distribute, all copyright, patent, trademark, and 104 | // attribution notices from the Source form of the Work, 105 | // excluding those notices that do not pertain to any part of 106 | // the Derivative Works; and 107 | // 108 | // (d) If the Work includes a "NOTICE" text file as part of its 109 | // distribution, then any Derivative Works that You distribute must 110 | // include a readable copy of the attribution notices contained 111 | // within such NOTICE file, excluding those notices that do not 112 | // pertain to any part of the Derivative Works, in at least one 113 | // of the following places: within a NOTICE text file distributed 114 | // as part of the Derivative Works; within the Source form or 115 | // documentation, if provided along with the Derivative Works; or, 116 | // within a display generated by the Derivative Works, if and 117 | // wherever such third-party notices normally appear. The contents 118 | // of the NOTICE file are for informational purposes only and 119 | // do not modify the License. You may add Your own attribution 120 | // notices within Derivative Works that You distribute, alongside 121 | // or as an addendum to the NOTICE text from the Work, provided 122 | // that such additional attribution notices cannot be construed 123 | // as modifying the License. 124 | // 125 | // You may add Your own copyright statement to Your modifications and 126 | // may provide additional or different license terms and conditions 127 | // for use, reproduction, or distribution of Your modifications, or 128 | // for any such Derivative Works as a whole, provided Your use, 129 | // reproduction, and distribution of the Work otherwise complies with 130 | // the conditions stated in this License. 131 | // 132 | // 5. Submission of Contributions. Unless You explicitly state otherwise, 133 | // any Contribution intentionally submitted for inclusion in the Work 134 | // by You to the Licensor shall be under the terms and conditions of 135 | // this License, without any additional terms or conditions. 136 | // Notwithstanding the above, nothing herein shall supersede or modify 137 | // the terms of any separate license agreement you may have executed 138 | // with Licensor regarding such Contributions. 139 | // 140 | // 6. Trademarks. This License does not grant permission to use the trade 141 | // names, trademarks, service marks, or product names of the Licensor, 142 | // except as required for reasonable and customary use in describing the 143 | // origin of the Work and reproducing the content of the NOTICE file. 144 | // 145 | // 7. Disclaimer of Warranty. Unless required by applicable law or 146 | // agreed to in writing, Licensor provides the Work (and each 147 | // Contributor provides its Contributions) on an "AS IS" BASIS, 148 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 149 | // implied, including, without limitation, any warranties or conditions 150 | // of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 151 | // PARTICULAR PURPOSE. You are solely responsible for determining the 152 | // appropriateness of using or redistributing the Work and assume any 153 | // risks associated with Your exercise of permissions under this License. 154 | // 155 | // 8. Limitation of Liability. In no event and under no legal theory, 156 | // whether in tort (including negligence), contract, or otherwise, 157 | // unless required by applicable law (such as deliberate and grossly 158 | // negligent acts) or agreed to in writing, shall any Contributor be 159 | // liable to You for damages, including any direct, indirect, special, 160 | // incidental, or consequential damages of any character arising as a 161 | // result of this License or out of the use or inability to use the 162 | // Work (including but not limited to damages for loss of goodwill, 163 | // work stoppage, computer failure or malfunction, or any and all 164 | // other commercial damages or losses), even if such Contributor 165 | // has been advised of the possibility of such damages. 166 | // 167 | // 9. Accepting Warranty or Additional Liability. While redistributing 168 | // the Work or Derivative Works thereof, You may choose to offer, 169 | // and charge a fee for, acceptance of support, warranty, indemnity, 170 | // or other liability obligations and/or rights consistent with this 171 | // License. However, in accepting such obligations, You may act only 172 | // on Your own behalf and on Your sole responsibility, not on behalf 173 | // of any other Contributor, and only if You agree to indemnify, 174 | // defend, and hold each Contributor harmless for any liability 175 | // incurred by, or claims asserted against, such Contributor by reason 176 | // of your accepting any such warranty or additional liability. 177 | // 178 | // END OF TERMS AND CONDITIONS 179 | // 180 | // APPENDIX: How to apply the Apache License to your work. 181 | // 182 | // To apply the Apache License to your work, attach the following 183 | // boilerplate notice, with the fields enclosed by brackets "[]" 184 | // replaced with your own identifying information. (Don't include 185 | // the brackets!) The text should be enclosed in the appropriate 186 | // comment syntax for the file format. We also recommend that a 187 | // file or class name and description of purpose be included on the 188 | // same "printed page" as the copyright notice for easier 189 | // identification within third-party archives. 190 | // 191 | // Copyright 2016 - present Louis Pilfold 192 | // 193 | // Licensed under the Apache License, Version 2.0 (the "License"); 194 | // you may not use this file except in compliance with the License. 195 | // You may obtain a copy of the License at 196 | // 197 | // http://www.apache.org/licenses/LICENSE-2.0 198 | // 199 | // Unless required by applicable law or agreed to in writing, software 200 | // distributed under the License is distributed on an "AS IS" BASIS, 201 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 202 | // See the License for the specific language governing permissions and 203 | // limitations under the License. 204 | // Values marked with @internal are not part of the public API and may change 205 | // without notice. 206 | 207 | export class CustomType { 208 | withFields(fields) { 209 | let properties = Object.keys(this).map(label => (label in fields ? fields[label] : this[label])) 210 | return new this.constructor(...properties) 211 | } 212 | } 213 | 214 | export class List { 215 | static fromArray(array, tail) { 216 | let t = tail || new Empty() 217 | for (let i = array.length - 1; i >= 0; --i) { 218 | t = new NonEmpty(array[i], t) 219 | } 220 | return t 221 | } 222 | 223 | [Symbol.iterator]() { 224 | return new ListIterator(this) 225 | } 226 | 227 | toArray() { 228 | return [...this] 229 | } 230 | 231 | // @internal 232 | atLeastLength(desired) { 233 | for (let _ of this) { 234 | if (desired <= 0) return true 235 | desired-- 236 | } 237 | return desired <= 0 238 | } 239 | 240 | // @internal 241 | hasLength(desired) { 242 | for (let _ of this) { 243 | if (desired <= 0) return false 244 | desired-- 245 | } 246 | return desired === 0 247 | } 248 | 249 | // @internal 250 | countLength() { 251 | let length = 0 252 | for (let _ of this) length++ 253 | return length 254 | } 255 | } 256 | 257 | // @internal 258 | export function prepend(element, tail) { 259 | return new NonEmpty(element, tail) 260 | } 261 | 262 | export function toList(elements, tail) { 263 | return List.fromArray(elements, tail) 264 | } 265 | 266 | // @internal 267 | class ListIterator { 268 | #current 269 | 270 | constructor(current) { 271 | this.#current = current 272 | } 273 | 274 | next() { 275 | if (this.#current instanceof Empty) { 276 | return { done: true } 277 | } else { 278 | let { head, tail } = this.#current 279 | this.#current = tail 280 | return { value: head, done: false } 281 | } 282 | } 283 | } 284 | 285 | export class Empty extends List {} 286 | 287 | export class NonEmpty extends List { 288 | constructor(head, tail) { 289 | super() 290 | this.head = head 291 | this.tail = tail 292 | } 293 | } 294 | 295 | export class BitArray { 296 | constructor(buffer) { 297 | if (!(buffer instanceof Uint8Array)) { 298 | throw "BitArray can only be constructed from a Uint8Array" 299 | } 300 | this.buffer = buffer 301 | } 302 | 303 | // @internal 304 | get length() { 305 | return this.buffer.length 306 | } 307 | 308 | // @internal 309 | byteAt(index) { 310 | return this.buffer[index] 311 | } 312 | 313 | // @internal 314 | floatFromSlice(start, end, isBigEndian) { 315 | return byteArrayToFloat(this.buffer, start, end, isBigEndian) 316 | } 317 | 318 | // @internal 319 | intFromSlice(start, end, isBigEndian, isSigned) { 320 | return byteArrayToInt(this.buffer, start, end, isBigEndian, isSigned) 321 | } 322 | 323 | // @internal 324 | binaryFromSlice(start, end) { 325 | const buffer = new Uint8Array(this.buffer.buffer, this.buffer.byteOffset + start, end - start) 326 | return new BitArray(buffer) 327 | } 328 | 329 | // @internal 330 | sliceAfter(index) { 331 | const buffer = new Uint8Array(this.buffer.buffer, this.buffer.byteOffset + index, this.buffer.byteLength - index) 332 | return new BitArray(buffer) 333 | } 334 | } 335 | 336 | export class UtfCodepoint { 337 | constructor(value) { 338 | this.value = value 339 | } 340 | } 341 | 342 | // @internal 343 | export function toBitArray(segments) { 344 | if (segments.length === 0) { 345 | return new BitArray(new Uint8Array()) 346 | } 347 | 348 | if (segments.length === 1) { 349 | // When there is a single Uint8Array segment, pass it directly to the bit 350 | // array constructor to avoid a copy 351 | if (segments[0] instanceof Uint8Array) { 352 | return new BitArray(segments[0]) 353 | } 354 | 355 | return new BitArray(new Uint8Array(segments)) 356 | } 357 | 358 | // Count the total number of bytes, and check if there are any Uint8Array 359 | // segments 360 | let bytes = 0 361 | let hasUint8ArraySegment = false 362 | for (const segment of segments) { 363 | if (segment instanceof Uint8Array) { 364 | bytes += segment.byteLength 365 | hasUint8ArraySegment = true 366 | } else { 367 | bytes++ 368 | } 369 | } 370 | 371 | // If there aren't any Uint8Array segments then pass the segments array 372 | // directly to the Uint8Array constructor 373 | if (!hasUint8ArraySegment) { 374 | return new BitArray(new Uint8Array(segments)) 375 | } 376 | 377 | // Copy the segments into a Uint8Array 378 | let u8Array = new Uint8Array(bytes) 379 | let cursor = 0 380 | for (let segment of segments) { 381 | if (segment instanceof Uint8Array) { 382 | u8Array.set(segment, cursor) 383 | cursor += segment.byteLength 384 | } else { 385 | u8Array[cursor] = segment 386 | cursor++ 387 | } 388 | } 389 | 390 | return new BitArray(u8Array) 391 | } 392 | 393 | // @internal 394 | // Derived from this answer https://stackoverflow.com/questions/8482309/converting-javascript-integer-to-byte-array-and-back 395 | export function sizedInt(value, size, isBigEndian) { 396 | if (size <= 0) { 397 | return new Uint8Array() 398 | } 399 | if (size % 8 != 0) { 400 | const msg = `Bit arrays must be byte aligned on JavaScript, got size of ${size} bits` 401 | throw new globalThis.Error(msg) 402 | } 403 | 404 | const byteArray = new Uint8Array(size / 8) 405 | 406 | let byteModulus = 256 407 | 408 | // Convert negative number to two's complement representation 409 | if (value < 0) { 410 | let valueModulus 411 | 412 | // For output sizes larger than 48 bits BigInt is needed in order to 413 | // maintain accuracy 414 | if (size <= 48) { 415 | valueModulus = 2 ** size 416 | } else { 417 | valueModulus = 1n << BigInt(size) 418 | 419 | value = BigInt(value) 420 | byteModulus = BigInt(byteModulus) 421 | } 422 | 423 | value %= valueModulus 424 | value = valueModulus + value 425 | } 426 | 427 | // The following loops work with both Number and BigInt types 428 | if (isBigEndian) { 429 | for (let i = byteArray.length - 1; i >= 0; i--) { 430 | const byte = value % byteModulus 431 | byteArray[i] = Number(byte) 432 | value = (value - byte) / byteModulus 433 | } 434 | } else { 435 | for (let i = 0; i < byteArray.length; i++) { 436 | const byte = value % byteModulus 437 | byteArray[i] = Number(byte) 438 | value = (value - byte) / byteModulus 439 | } 440 | } 441 | 442 | return byteArray 443 | } 444 | 445 | // @internal 446 | export function byteArrayToInt(byteArray, start, end, isBigEndian, isSigned) { 447 | const byteSize = end - start 448 | 449 | // Ints wider than 48 bits are read using a BigInt, but narrower ones can 450 | // be read with a JS number which is faster 451 | if (byteSize <= 6) { 452 | let value = 0 453 | 454 | // Read bytes as an unsigned integer value 455 | if (isBigEndian) { 456 | for (let i = start; i < end; i++) { 457 | value = value * 256 + byteArray[i] 458 | } 459 | } else { 460 | for (let i = end - 1; i >= start; i--) { 461 | value = value * 256 + byteArray[i] 462 | } 463 | } 464 | 465 | // For signed integers, check if the high bit is set and if so then 466 | // reinterpret as two's complement 467 | if (isSigned) { 468 | const highBit = 2 ** (byteSize * 8 - 1) 469 | if (value >= highBit) { 470 | value -= highBit * 2 471 | } 472 | } 473 | 474 | return value 475 | } else { 476 | let value = 0n 477 | 478 | // Read bytes as an unsigned integer value 479 | if (isBigEndian) { 480 | for (let i = start; i < end; i++) { 481 | value = (value << 8n) + BigInt(byteArray[i]) 482 | } 483 | } else { 484 | for (let i = end - 1; i >= start; i--) { 485 | value = (value << 8n) + BigInt(byteArray[i]) 486 | } 487 | } 488 | 489 | // For signed integers, check if the high bit is set and if so then 490 | // reinterpret as two's complement 491 | if (isSigned) { 492 | const highBit = 1n << BigInt(byteSize * 8 - 1) 493 | if (value >= highBit) { 494 | value -= highBit * 2n 495 | } 496 | } 497 | 498 | // Convert the result into a JS number. This may cause quantizing/error on 499 | // values outside JavaScript's safe integer range. 500 | return Number(value) 501 | } 502 | } 503 | 504 | // @internal 505 | export function byteArrayToFloat(byteArray, start, end, isBigEndian) { 506 | const view = new DataView(byteArray.buffer) 507 | 508 | const byteSize = end - start 509 | 510 | if (byteSize === 8) { 511 | return view.getFloat64(start, !isBigEndian) 512 | } else if (byteSize === 4) { 513 | return view.getFloat32(start, !isBigEndian) 514 | } else { 515 | const msg = `Sized floats must be 32-bit or 64-bit on JavaScript, got size of ${byteSize * 8} bits` 516 | throw new globalThis.Error(msg) 517 | } 518 | } 519 | 520 | // @internal 521 | export function stringBits(string) { 522 | return new TextEncoder().encode(string) 523 | } 524 | 525 | // @internal 526 | export function codepointBits(codepoint) { 527 | return stringBits(String.fromCodePoint(codepoint.value)) 528 | } 529 | 530 | // @internal 531 | export function sizedFloat(float, size, isBigEndian) { 532 | if (size !== 32 && size !== 64) { 533 | const msg = `Sized floats must be 32-bit or 64-bit on JavaScript, got size of ${size} bits` 534 | throw new globalThis.Error(msg) 535 | } 536 | 537 | const byteArray = new Uint8Array(size / 8) 538 | 539 | const view = new DataView(byteArray.buffer) 540 | 541 | if (size == 64) { 542 | view.setFloat64(0, float, !isBigEndian) 543 | } else if (size === 32) { 544 | view.setFloat32(0, float, !isBigEndian) 545 | } 546 | 547 | return byteArray 548 | } 549 | 550 | export class Result extends CustomType { 551 | // @internal 552 | static isResult(data) { 553 | return data instanceof Result 554 | } 555 | } 556 | 557 | export class Ok extends Result { 558 | constructor(value) { 559 | super() 560 | this[0] = value 561 | } 562 | 563 | // @internal 564 | isOk() { 565 | return true 566 | } 567 | } 568 | 569 | export class Error extends Result { 570 | constructor(detail) { 571 | super() 572 | this[0] = detail 573 | } 574 | 575 | // @internal 576 | isOk() { 577 | return false 578 | } 579 | } 580 | 581 | export function isEqual(x, y) { 582 | let values = [x, y] 583 | 584 | while (values.length) { 585 | let a = values.pop() 586 | let b = values.pop() 587 | if (a === b) continue 588 | 589 | if (!isObject(a) || !isObject(b)) return false 590 | let unequal = 591 | !structurallyCompatibleObjects(a, b) || 592 | unequalDates(a, b) || 593 | unequalBuffers(a, b) || 594 | unequalArrays(a, b) || 595 | unequalMaps(a, b) || 596 | unequalSets(a, b) || 597 | unequalRegExps(a, b) 598 | if (unequal) return false 599 | 600 | const proto = Object.getPrototypeOf(a) 601 | if (proto !== null && typeof proto.equals === "function") { 602 | try { 603 | if (a.equals(b)) continue 604 | else return false 605 | } catch {} 606 | } 607 | 608 | let [keys, get] = getters(a) 609 | for (let k of keys(a)) { 610 | values.push(get(a, k), get(b, k)) 611 | } 612 | } 613 | 614 | return true 615 | } 616 | 617 | function getters(object) { 618 | if (object instanceof Map) { 619 | return [x => x.keys(), (x, y) => x.get(y)] 620 | } else { 621 | let extra = object instanceof globalThis.Error ? ["message"] : [] 622 | return [x => [...extra, ...Object.keys(x)], (x, y) => x[y]] 623 | } 624 | } 625 | 626 | function unequalDates(a, b) { 627 | return a instanceof Date && (a > b || a < b) 628 | } 629 | 630 | function unequalBuffers(a, b) { 631 | return ( 632 | a.buffer instanceof ArrayBuffer && 633 | a.BYTES_PER_ELEMENT && 634 | !(a.byteLength === b.byteLength && a.every((n, i) => n === b[i])) 635 | ) 636 | } 637 | 638 | function unequalArrays(a, b) { 639 | return Array.isArray(a) && a.length !== b.length 640 | } 641 | 642 | function unequalMaps(a, b) { 643 | return a instanceof Map && a.size !== b.size 644 | } 645 | 646 | function unequalSets(a, b) { 647 | return a instanceof Set && (a.size != b.size || [...a].some(e => !b.has(e))) 648 | } 649 | 650 | function unequalRegExps(a, b) { 651 | return a instanceof RegExp && (a.source !== b.source || a.flags !== b.flags) 652 | } 653 | 654 | function isObject(a) { 655 | return typeof a === "object" && a !== null 656 | } 657 | 658 | function structurallyCompatibleObjects(a, b) { 659 | if (typeof a !== "object" && typeof b !== "object" && (!a || !b)) return false 660 | 661 | let nonstructural = [Promise, WeakSet, WeakMap, Function] 662 | if (nonstructural.some(c => a instanceof c)) return false 663 | 664 | return a.constructor === b.constructor 665 | } 666 | 667 | // @internal 668 | export function remainderInt(a, b) { 669 | if (b === 0) { 670 | return 0 671 | } else { 672 | return a % b 673 | } 674 | } 675 | 676 | // @internal 677 | export function divideInt(a, b) { 678 | return Math.trunc(divideFloat(a, b)) 679 | } 680 | 681 | // @internal 682 | export function divideFloat(a, b) { 683 | if (b === 0) { 684 | return 0 685 | } else { 686 | return a / b 687 | } 688 | } 689 | 690 | // @internal 691 | export function makeError(variant, module, line, fn, message, extra) { 692 | let error = new globalThis.Error(message) 693 | error.gleam_error = variant 694 | error.module = module 695 | error.line = line 696 | error.function = fn 697 | // TODO: Remove this with Gleam v2.0.0 698 | error.fn = fn 699 | for (let k in extra) error[k] = extra[k] 700 | return error 701 | } 702 | -------------------------------------------------------------------------------- /gleam.toml: -------------------------------------------------------------------------------- 1 | name = "delay" 2 | version = "1.2.0" 3 | 4 | description = "A dead simple data-structure for delaying side effects" 5 | licences = ["MIT"] 6 | repository = { type = "github", user = "bwireman", repo = "delay" } 7 | links = [ 8 | { title = "npm", href = "https://www.npmjs.com/package/delay-gleam" }, 9 | ] 10 | 11 | [dependencies] 12 | gleam_stdlib = ">= 0.34.0 and < 2.0.0" 13 | 14 | [dev-dependencies] 15 | gleeunit = "~> 1.2.0" 16 | simplifile = ">= 2.0.0 and < 3.0.0" 17 | cactus = ">= 1.0.0 and < 2.0.0" 18 | 19 | [javascript] 20 | typescript_declarations = true 21 | 22 | [javascript.deno] 23 | allow_all = true 24 | 25 | [cactus.pre-commit] 26 | actions = [ 27 | { command = "format", kind = "sub_command", args = ["--check"] }, 28 | { command = "./scripts/build_js.sh", kind = "binary" }, 29 | { command = "./scripts/test.sh", kind = "binary" }, 30 | ] 31 | 32 | -------------------------------------------------------------------------------- /manifest.toml: -------------------------------------------------------------------------------- 1 | # This file was generated by Gleam 2 | # You typically do not need to edit this file 3 | 4 | packages = [ 5 | { name = "cactus", version = "1.3.3", build_tools = ["gleam"], requirements = ["filepath", "gleam_stdlib", "gleither", "gxyz", "platform", "shellout", "simplifile", "tom"], otp_app = "cactus", source = "hex", outer_checksum = "3F50624B76847F6A4609B676AB096238A28D88989256F9DD52B0E1A99B4E3A0F" }, 6 | { name = "filepath", version = "1.1.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "filepath", source = "hex", outer_checksum = "67A6D15FB39EEB69DD31F8C145BB5A421790581BD6AA14B33D64D5A55DBD6587" }, 7 | { name = "gleam_stdlib", version = "0.54.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "723BA61A2BAE8D67406E59DD88CEA1B3C3F266FC8D70F64BE9FEC81B4505B927" }, 8 | { name = "gleave", version = "1.0.0", build_tools = ["gleam"], requirements = [], otp_app = "gleave", source = "hex", outer_checksum = "EBEB0DF9C764A6CB22623FF6F03A0BC978D75225303F3BBDEEB705A2DD700D0D" }, 9 | { name = "gleeunit", version = "1.2.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "F7A7228925D3EE7D0813C922E062BFD6D7E9310F0BEE585D3A42F3307E3CFD13" }, 10 | { name = "gleither", version = "2.1.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleither", source = "hex", outer_checksum = "86606790899097D8588C0F70C654D9626C634AF14E18F618F4C351FEC6FDA773" }, 11 | { name = "gxyz", version = "0.4.0", build_tools = ["gleam"], requirements = ["gleam_stdlib", "gleave"], otp_app = "gxyz", source = "hex", outer_checksum = "115416738A588B8E095A44AB72A31248D3388C7E748D762F94186C1143DD3D4F" }, 12 | { name = "platform", version = "1.0.0", build_tools = ["gleam"], requirements = [], otp_app = "platform", source = "hex", outer_checksum = "8339420A95AD89AAC0F82F4C3DB8DD401041742D6C3F46132A8739F6AEB75391" }, 13 | { name = "shellout", version = "1.6.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "shellout", source = "hex", outer_checksum = "E2FCD18957F0E9F67E1F497FC9FF57393392F8A9BAEAEA4779541DE7A68DD7E0" }, 14 | { name = "simplifile", version = "2.2.0", build_tools = ["gleam"], requirements = ["filepath", "gleam_stdlib"], otp_app = "simplifile", source = "hex", outer_checksum = "0DFABEF7DC7A9E2FF4BB27B108034E60C81BEBFCB7AB816B9E7E18ED4503ACD8" }, 15 | { name = "tom", version = "1.1.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "tom", source = "hex", outer_checksum = "0910EE688A713994515ACAF1F486A4F05752E585B9E3209D8F35A85B234C2719" }, 16 | ] 17 | 18 | [requirements] 19 | cactus = { version = ">= 1.0.0 and < 2.0.0" } 20 | gleam_stdlib = { version = ">= 0.34.0 and < 2.0.0" } 21 | gleeunit = { version = "~> 1.2.0" } 22 | simplifile = { version = ">= 2.0.0 and < 3.0.0" } 23 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "delay-gleam", 3 | "version": "1.2.0", 4 | "description": "A dead simple data-structure for delaying side effects ⌚!", 5 | "main": "dist/delay.mjs", 6 | "type": "module", 7 | "types": "dist/delay.d.mts", 8 | "repository": { 9 | "type": "git", 10 | "url": "https://github.com/bwireman/delay" 11 | }, 12 | "homepage": "https://github.com/bwireman/delay#usage-within-javascript--directly", 13 | "author": { 14 | "name": "Ben Wireman", 15 | "url": "http://benwireman.com/" 16 | }, 17 | "bugs": { 18 | "url": "https://github.com/bwireman/delay/issues" 19 | }, 20 | "files": [ 21 | "dist/", 22 | "README.md", 23 | "LICENSE" 24 | ], 25 | "exports": { 26 | ".": "./dist/delay.mjs", 27 | "./extras": "./dist/extras/extras.mjs" 28 | }, 29 | "license": "MIT", 30 | "private": false, 31 | "scripts": { 32 | "build": "./scripts/build_js.sh", 33 | "prepublishOnly": "./scripts/build_js.sh", 34 | "test": "./scripts/test.sh" 35 | }, 36 | "devDependencies": { 37 | "@cross/test": "npm:@jsr/cross__test", 38 | "@std/assert": "npm:@jsr/std__assert", 39 | "dets": "^0.14.2", 40 | "esbuild": "^0.20.1", 41 | "eslint": "^8.57.0", 42 | "eslint-plugin-unused-imports": "^3.1.0", 43 | "prettier": "3.2.5", 44 | "sync-fetch": "^0.5.2", 45 | "typescript": "^5.3.3", 46 | "yaml": "^2.4.4" 47 | }, 48 | "keywords": [ 49 | "gleam", 50 | "monad", 51 | "effect", 52 | "side-effect", 53 | "sideeffect", 54 | "browser", 55 | "nodejs", 56 | "typescript", 57 | "functor", 58 | "delayed" 59 | ] 60 | } 61 | -------------------------------------------------------------------------------- /scripts/build_js.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | cd "$(dirname $0)/.." 5 | 6 | ./scripts/update.sh 7 | 8 | gleam clean 9 | rm -rf dist/delay.mjs 10 | rm -rf dist/delay.d.js 11 | rm -rf dist/extras/LICENCE.comments.txt_ 12 | rm -rf dist/extras/LICENCE.txt_ 13 | gleam build --target javascript 14 | # format input for comments.py 15 | cat src/delay.gleam | grep pub -B 3 | grep -v "\}" | grep -v import | sed -E 's/\(.*//g' >comments.tmp 16 | 17 | ./node_modules/.bin/esbuild \ 18 | build/dev/javascript/delay/delay.mjs \ 19 | --bundle \ 20 | --external:*/prelude.mjs \ 21 | --external:*/gleam.mjs \ 22 | --keep-names \ 23 | --outfile=dist/delay.mjs \ 24 | --format=esm \ 25 | --platform=neutral \ 26 | --banner:js='//Code for `delay-gleam` Generated using Gleam & Esbuild 27 | //https://www.npmjs.com/package/delay-gleam 28 | //https://github.com/bwireman/delay' 29 | 30 | mv dist/delay.mjs dist/delay.mjs.tmp 31 | cat dist/delay.mjs.tmp | 32 | sed 's/var tempDataView.*//g' | 33 | sed 's/var SHIFT.*//g' | 34 | sed 's/var BUCKET_SIZE.*//g' | 35 | sed 's/var MASK.*//g' | 36 | sed 's/var MAX_INDEX_NODE.*//g' | 37 | sed 's/var unequalDictSymbol.*//g' | 38 | sed 's/var trim_start_regex.*//g' | 39 | sed 's/var trim_end_regex.*//g' | 40 | sed 's/var MIN_ARRAY_NODE.*//g' | 41 | sed 's/var right_trim_regex.*//g' | 42 | sed 's/var left_trim_regex.*//g' | 43 | grep -v "gleam/.*mjs" | 44 | grep -v "gleam_stdlib/.*mjs" | 45 | sed 's/\.\.\/gleam.mjs/.\/extras\/prelude.mjs/g' | 46 | sed 's/\.\/gleam.mjs/.\/extras\/prelude.mjs/g' >dist/delay.mjs 47 | 48 | rm dist/delay.mjs.tmp 49 | 50 | # comment ./dist/delay.mjs 51 | ./scripts/comment.py dist/delay.mjs 'build/dev/javascript/delay/delay.mjs' 52 | 53 | ./node_modules/.bin/dets \ 54 | --files build/dev/javascript/delay/delay.mjs \ 55 | --types build/dev/javascript/delay/delay.d.mts \ 56 | --out dist/delay.d.mts.tmp 57 | 58 | # fixup issue in dets around iterator symbol and numbered properties 59 | # & remove dets module declaration 60 | cat dist/delay.d.mts.tmp | 61 | tail -n +2 | 62 | head -n -1 | 63 | sed 's/\"\[Symbol.iterator\]\"/\[Symbol.iterator\]/g' | 64 | sed 's/\"\([[:digit:]]\+\)\"/\1/g' >dist/delay.d.mts 65 | 66 | 67 | ./node_modules/.bin/eslint ./dist/delay.mjs --fix 68 | ./node_modules/.bin/eslint ./dist/extras/extras.mjs --fix 69 | ./node_modules/.bin/prettier ./dist --write 70 | ./node_modules/.bin/prettier ./dist/extras/extras.mjs --write 71 | 72 | # comment ./dist/delay.d.mts 73 | ./scripts/comment.py dist/delay.d.mts 74 | 75 | rm dist/*.tmp 76 | rm *.tmp 77 | -------------------------------------------------------------------------------- /scripts/comment.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import sys 3 | 4 | def clean_declaration(dec, export=True): 5 | func_replacement = "function" 6 | type_replacement = "type" 7 | if export: 8 | func_replacement = f"export {func_replacement}" 9 | type_replacement = f"export {type_replacement}" 10 | 11 | return dec.replace("pub fn", func_replacement).replace("pub opaque type", type_replacement) 12 | 13 | 14 | def gen_comments(export=True): 15 | comments = dict() 16 | with open('./comments.tmp') as f: 17 | # cleanup and split lines 18 | comments_and_declaration = filter(bool, f.read().split('--')) 19 | comments_and_declaration = map(lambda v: v.split('\n'), comments_and_declaration) 20 | comments_and_declaration = filter(bool, comments_and_declaration) 21 | for line in comments_and_declaration: 22 | # cleanup + group comments and declarations 23 | lines = map(lambda v: v.strip(), line) 24 | lines = filter(bool, lines) 25 | lines = list(lines) 26 | if len(lines) <= 1: 27 | continue 28 | 29 | declaration = clean_declaration(lines[-1], export=export) 30 | full_comment = "\n".join(lines[:-1]).replace("///", "*") 31 | comments[declaration] = f""" 32 | /** 33 | {full_comment} 34 | */""" 35 | 36 | return comments 37 | 38 | 39 | def write_comments(file_path, lines, start_line=None): 40 | out = "" 41 | found_start_line = start_line is None 42 | 43 | with open(file_path) as f: 44 | for line in f.readlines(): 45 | if start_line is not None and not found_start_line and start_line in line: 46 | found_start_line = True 47 | 48 | if found_start_line: 49 | for declaration, comment in lines.items(): 50 | if line.startswith(declaration): 51 | out += f"{comment}\n" 52 | break 53 | 54 | out += line 55 | 56 | with open(file_path, "w") as f: 57 | f.write(out) 58 | 59 | 60 | if __name__ == "__main__": 61 | path = sys.argv[1] 62 | export = path.endswith(".mts") 63 | start_line = None 64 | if len(sys.argv) > 2: 65 | start_line = sys.argv[2] 66 | 67 | comments = gen_comments(export=export) 68 | write_comments(path, comments, start_line=start_line) 69 | -------------------------------------------------------------------------------- /scripts/publish.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | cd "$(dirname $0)/.." 5 | 6 | if [ -z "$1" ]; then 7 | echo "Must set version for release" 8 | echo "Usage:" "$0" "" 9 | exit 1 10 | fi 11 | VER="v$1" 12 | 13 | BRANCH="$(git rev-parse --abbrev-ref HEAD)" 14 | if [ "$BRANCH" != "main" ]; then 15 | echo "Branch must be 'main'" 16 | exit 1 17 | fi 18 | 19 | if [ ! -z "$(git status --porcelain)" ]; then 20 | echo "Working dir mush be clean" 21 | exit 1 22 | fi 23 | 24 | function publish { 25 | gleam clean 26 | ./scripts/update.sh 27 | gleam build --target erlang 28 | ./scripts/build_js.sh 29 | ./scripts/test.sh 30 | echo "Tagging" "$VER" 31 | git tag "$VER" 32 | git push origin "$VER" 33 | echo "Publishing to Hex" "$VER" 34 | HEX_API_KEY=$(cat key._) gleam publish 35 | yarn publish 36 | echo "🚀" 37 | } 38 | 39 | echo "Version set to:" "$VER" 40 | while true; do 41 | read -p "Do you wish to publish? [Yn] " yn 42 | case $yn in 43 | [Yy]* ) publish; break;; 44 | [Nn]* ) echo "canceling..." ; exit;; 45 | * ) publish; break;; 46 | esac 47 | done 48 | -------------------------------------------------------------------------------- /scripts/pull_prelude.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -ex 3 | 4 | cd "$(dirname $0)/.." 5 | 6 | if [ -z "$1" ]; then 7 | echo "Must set gleam tag" 8 | echo "Usage:" "$0" "" 9 | exit 1 10 | fi 11 | VER="v$1" 12 | 13 | http --print=b "https://raw.githubusercontent.com/gleam-lang/gleam/${VER}/LICENCE" > dist/extras/LICENCE.txt_ 14 | sed -e 's/^/\/\//' dist/extras/LICENCE.txt_ > dist/extras/LICENCE.comments.txt_ 15 | rm -rf dist/extras/LICENCE.txt_ 16 | 17 | echo "// copy of https://github.com/gleam-lang/gleam/blob/${VER}/compiler-core/templates/prelude.d.mts" > dist/extras/prelude.d.mts 18 | echo "// ---" > dist/extras/prelude.d.mts 19 | 20 | cat dist/extras/LICENCE.comments.txt_ >> dist/extras/prelude.d.mts 21 | gleam export typescript-prelude >> dist/extras/prelude.d.mts 22 | 23 | echo "// copy of https://github.com/gleam-lang/gleam/blob/${VER}/compiler-core/templates/prelude.mjs" > dist/extras/prelude.mjs 24 | echo "// ---" >> dist/extras/prelude.mjs 25 | 26 | cat dist/extras/LICENCE.comments.txt_ >> dist/extras/prelude.mjs 27 | gleam export javascript-prelude >> dist/extras/prelude.mjs 28 | 29 | rm -rf dist/extras/LICENCE.comments.txt_ -------------------------------------------------------------------------------- /scripts/test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | cd "$(dirname $0)/.." 5 | 6 | GREEN='\033[0;32m' 7 | NC='\033[0m' 8 | 9 | gleam format src test 10 | gleam build --target erlang 11 | ./scripts/build_js.sh 12 | 13 | echo -e "${GREEN}==> erlang${NC}" 14 | gleam test --target erlang 15 | 16 | echo -e "${GREEN}==> nodejs${NC}" 17 | gleam test --target javascript --runtime nodejs 18 | node --test ./specs/test_dist.spec.js 19 | 20 | echo -e "${GREEN}==> bun${NC}" 21 | gleam test --target javascript --runtime bun 22 | bun test ./specs/test_dist.spec.js 23 | 24 | echo -e "${GREEN}==> deno${NC}" 25 | gleam test --target javascript --runtime deno 26 | deno test ./specs/test_dist.spec.js 27 | -------------------------------------------------------------------------------- /scripts/update.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | cd "$(dirname $0)/.." 5 | 6 | gleam update 7 | npm upgrade 8 | npm audit -------------------------------------------------------------------------------- /specs/test_dist.spec.js: -------------------------------------------------------------------------------- 1 | // smoke tests to establish that the NPM code can be used 2 | // & works as expected 3 | import { delay_effect, map, join, run, repeat, fallthrough, every, any, all, retry } from "../dist/delay.mjs" 4 | import { get, ok, error, isOk, toList } from "../dist/extras/extras.mjs" 5 | import { test } from "@cross/test" 6 | import { assertEquals, assertLess } from "@std/assert" 7 | 8 | test("delay_effect", () => { 9 | let fin = 0 10 | const d = delay_effect(() => { 11 | fin += 1 12 | return ok(fin) 13 | }) 14 | 15 | assertEquals(fin, 0) 16 | 17 | let res = get(run(d)) 18 | assertEquals(res, fin) 19 | assertEquals(fin, 1) 20 | 21 | res = get(run(d)) 22 | assertEquals(res, fin) 23 | assertEquals(fin, 2) 24 | 25 | res = get(run(d)) 26 | assertEquals(res, fin) 27 | assertEquals(fin, 3) 28 | }) 29 | 30 | test("map", () => { 31 | let d1 = delay_effect(() => ok("HELLO")) 32 | d1 = map(d1, v => ok(v + "WORLD")) 33 | d1 = map(d1, v => ok(v + "!")) 34 | 35 | const res1 = get(run(d1)) 36 | assertEquals(res1, "HELLOWORLD!") 37 | 38 | let d2 = delay_effect(() => ok("HELLO")) 39 | d2 = map(d2, v => ok(v + "WORLD")) 40 | d2 = map(d2, _ => error("shit!")) 41 | 42 | const res2 = get(run(d2)) 43 | assertEquals(res2, "shit!") 44 | }) 45 | 46 | test("join", () => { 47 | let d1 = delay_effect(() => ok(1)) 48 | let d2 = delay_effect(() => ok(2)) 49 | 50 | assertEquals(get(run(join(d1, d2))), [1, 2]) 51 | }) 52 | 53 | test("repeat", () => { 54 | let fin = 0 55 | const d = delay_effect(() => { 56 | fin += 1 57 | return ok(fin) 58 | }) 59 | 60 | assertEquals(fin, 0) 61 | 62 | const res = repeat(d, 3) 63 | .toArray() 64 | .map(x => get(x)) 65 | 66 | assertEquals(res, [3, 2, 1]) 67 | assertEquals(fin, 3) 68 | }) 69 | 70 | test("every, any & all", () => { 71 | let fin = 0 72 | const d = delay_effect(() => { 73 | if (fin > 1) { 74 | return ok("ok!") 75 | } 76 | 77 | fin += 1 78 | return error("err!") 79 | }) 80 | 81 | const res = every(toList([d, d, d])).toArray() 82 | 83 | assertEquals(isOk(res[0]), true) 84 | assertEquals(isOk(res[1]), false) 85 | assertEquals(isOk(res[2]), false) 86 | 87 | fin = 0 88 | assertEquals(any(toList([d, d, d])), true) 89 | 90 | fin = 0 91 | assertEquals(all(toList([d, d, d])), false) 92 | }) 93 | 94 | test("fallthrough", () => { 95 | let fin = 0 96 | const d = delay_effect(() => { 97 | if (fin > 1) { 98 | return ok("ok!") 99 | } 100 | 101 | fin += 1 102 | return error("err!") 103 | }) 104 | 105 | assertEquals(isOk(fallthrough(toList([d]))), false) 106 | fin = 0 107 | 108 | assertEquals(isOk(fallthrough(toList([d, d]))), false) 109 | fin = 0 110 | 111 | assertEquals(isOk(fallthrough(toList([d, d, d]))), true) 112 | assertEquals(isOk(fallthrough(toList([d, d, d, d]))), true) 113 | 114 | assertEquals(fin, 2) 115 | }) 116 | 117 | test("retry", () => { 118 | let ts = [] 119 | const d = delay_effect(() => { 120 | ts.push(Date.now()) 121 | return error(ts.length) 122 | }) 123 | 124 | assertEquals(ts, []) 125 | const res = get(run(retry(d, 3, 250))) 126 | assertEquals(ts.length, 3) 127 | assertEquals(res, 3) 128 | 129 | for(let i = 1; i < ts.length; i++) { 130 | assertLess(Number(ts[i-1]), Number(ts[i])) 131 | } 132 | }) 133 | -------------------------------------------------------------------------------- /src/delay.gleam: -------------------------------------------------------------------------------- 1 | import gleam/list 2 | import gleam/option 3 | import gleam/result 4 | 5 | /// Type representing a delayed effect to be lazily evaluated 6 | pub opaque type Delay(val, error) { 7 | Continue(effect: fn() -> Result(val, error)) 8 | Stop(err: error) 9 | } 10 | 11 | /// Stores an effect to be run later, short circuiting on errors 12 | pub fn delay_effect(func: fn() -> Result(val, error)) -> Delay(val, error) { 13 | Continue(effect: func) 14 | } 15 | 16 | /// Chains an operation onto an existing delay. The result of the current delay will be lazily passed to `func` 17 | /// `func` will not be called if the delay has already returned an error 18 | pub fn map( 19 | delayed: Delay(val, error), 20 | func: fn(val) -> Result(f_res, error), 21 | ) -> Delay(f_res, error) { 22 | case delayed { 23 | Continue(effect: delayed_func) -> 24 | chain(delayed_func, func) 25 | |> delay_effect 26 | 27 | Stop(err) -> Stop(err) 28 | } 29 | } 30 | 31 | fn chain( 32 | delayed_func: fn() -> Result(val, error), 33 | func: fn(val) -> Result(f_res, error), 34 | ) -> fn() -> Result(f_res, error) { 35 | fn() { result.try(delayed_func(), func) } 36 | } 37 | 38 | /// flatten a nested Delay 39 | pub fn flatten( 40 | delayed: Delay(Delay(inner_res, error), error), 41 | ) -> Delay(inner_res, error) { 42 | case delayed { 43 | // depending on the state of delayed we either need a fn that returns the stop error 44 | // or a function that returns inner_res 45 | Continue(effect: delayed_func) -> fn() { 46 | // run delayed_f and get or build a delay 47 | let inner = case delayed_func() { 48 | Ok(inner_delay) -> inner_delay 49 | Error(err) -> Stop(err) 50 | } 51 | // get the inner fn's result 52 | case inner { 53 | Continue(effect: inner_func) -> inner_func() 54 | Stop(err) -> Error(err) 55 | } 56 | } 57 | 58 | // just chain a result fn to delay 59 | Stop(err) -> fn() { Error(err) } 60 | } 61 | |> delay_effect 62 | } 63 | 64 | /// Map and then flatten `delayed` 65 | pub fn flat_map( 66 | delayed: Delay(val, error), 67 | func: fn(val) -> Result(Delay(f_res, error), error), 68 | ) -> Delay(f_res, error) { 69 | delayed 70 | |> map(func) 71 | |> flatten 72 | } 73 | 74 | /// returns a delay, that joins two delays. If `left` fails `right` will not be run, if either fails the result will be an Error 75 | pub fn join( 76 | left: Delay(left_val, left_error), 77 | right: Delay(right_val, right_error), 78 | ) -> Delay( 79 | #(left_val, right_val), 80 | #(option.Option(left_error), option.Option(right_error)), 81 | ) { 82 | fn() { 83 | case run(left) { 84 | Error(err) -> Error(#(option.Some(err), option.None)) 85 | Ok(left_val) -> 86 | case run(right) { 87 | Ok(right_val) -> Ok(#(left_val, right_val)) 88 | Error(err) -> Error(#(option.None, option.Some(err))) 89 | } 90 | } 91 | } 92 | |> delay_effect 93 | } 94 | 95 | /// Returns a new Delay that will be re-attempted `retries` times with `delay` ms in-between 96 | /// Note: JS uses busy waiting 97 | pub fn retry( 98 | delayed: Delay(val, error), 99 | retries: Int, 100 | delay: Int, 101 | ) -> Delay(val, error) { 102 | delay_effect(fn() { do_retry(delayed, retries, delay, False) }) 103 | } 104 | 105 | /// Returns a Delay that will be re-attempted `retries` times with an increasing backoff delay 106 | /// Note: JS uses busy waiting 107 | pub fn retry_with_backoff( 108 | delayed: Delay(val, error), 109 | retries: Int, 110 | ) -> Delay(val, error) { 111 | delay_effect(fn() { do_retry(delayed, retries, 0, True) }) 112 | } 113 | 114 | @external(erlang, "timer", "sleep") 115 | @external(javascript, "./ffi.mjs", "busy_wait") 116 | fn sleep(_: Int) -> Nil 117 | 118 | fn do_retry( 119 | delayed: Delay(val, error), 120 | retries: Int, 121 | delay: Int, 122 | backoff: Bool, 123 | ) -> Result(val, error) { 124 | let delay = case backoff { 125 | True -> delay + 1000 126 | False -> delay 127 | } 128 | 129 | case retries { 130 | _ if retries <= 1 -> run(delayed) 131 | _ -> 132 | result.lazy_or(run(delayed), fn() { 133 | sleep(delay) 134 | do_retry(delayed, retries - 1, delay, backoff) 135 | }) 136 | } 137 | } 138 | 139 | /// Run a delayed effect and get the result 140 | /// short-circuiting if any in delay in the chain returns an Error 141 | pub fn run(delayed: Delay(val, error)) -> Result(val, error) { 142 | case delayed { 143 | Continue(effect: func) -> func() 144 | Stop(err) -> Error(err) 145 | } 146 | } 147 | 148 | /// Run a delayed effect and throw away the result 149 | /// short-circuiting if any in the chain returns an Error 150 | pub fn drain(delayed: Delay(val, error)) -> Nil { 151 | let _ = run(delayed) 152 | Nil 153 | } 154 | 155 | /// Repeat a Delay and return the results in a list 156 | pub fn repeat( 157 | delayed: Delay(val, error), 158 | repetition: Int, 159 | ) -> List(Result(val, error)) { 160 | delayed 161 | |> list.repeat(repetition) 162 | |> every 163 | } 164 | 165 | /// Run every effect in sequence and get their results 166 | pub fn every(effects: List(Delay(val, err))) -> List(Result(val, err)) { 167 | do_every(effects, []) 168 | } 169 | 170 | /// Run all effects in sequence and return True if all succeed 171 | /// NOTE: this will _always_ run _every_ effect 172 | pub fn all(effects: List(Delay(val, err))) -> Bool { 173 | effects 174 | |> every() 175 | |> result.all() 176 | |> result.is_ok() 177 | } 178 | 179 | /// Run all effects in sequence and return True if any succeeds 180 | /// NOTE: this is different than `fallthrough/1` because it will _always_ run _every_ effect 181 | pub fn any(effects: List(Delay(val, err))) -> Bool { 182 | effects 183 | |> every() 184 | |> list.filter(result.is_ok) 185 | |> list.length() 186 | > 0 187 | } 188 | 189 | fn do_every( 190 | effects: List(Delay(val, err)), 191 | results: List(Result(val, err)), 192 | ) -> List(Result(val, err)) { 193 | case effects { 194 | [last] -> [run(last), ..results] 195 | [head, ..rest] -> do_every(rest, [run(head), ..results]) 196 | [] -> panic as "Empty list" 197 | } 198 | } 199 | 200 | /// Attempt multiple Delays until one returns an Ok 201 | /// unlike `any/1` this will short circuit on the first Ok 202 | pub fn fallthrough(effects: List(Delay(val, err))) -> Result(val, err) { 203 | do_fallthrough(effects) 204 | } 205 | 206 | // exists to keep the exposed fallthrough functions parameter names the same in JS 207 | fn do_fallthrough(effects: List(Delay(val, err))) -> Result(val, err) { 208 | case effects { 209 | [last] -> run(last) 210 | [head, ..rest] -> result.lazy_or(run(head), fn() { fallthrough(rest) }) 211 | [] -> panic as "Empty list" 212 | } 213 | } 214 | -------------------------------------------------------------------------------- /src/ffi.mjs: -------------------------------------------------------------------------------- 1 | export function busy_wait(delay) { 2 | const fin = Date.now() + delay; 3 | 4 | while (Date.now() < fin) { 5 | // busy wait 6 | } 7 | } 8 | 9 | -------------------------------------------------------------------------------- /test/delay_test.gleam: -------------------------------------------------------------------------------- 1 | import delay 2 | import gleam/int 3 | import gleam/io 4 | import gleam/list 5 | import gleam/option 6 | import gleam/string 7 | import gleeunit 8 | import gleeunit/should 9 | import simplifile 10 | 11 | const drain_filename = "test/side_effects/drain.test" 12 | 13 | const fallthrough_a_filename = "test/side_effects/fallthrough_a.test" 14 | 15 | const fallthrough_b_filename = "test/side_effects/fallthrough_b.test" 16 | 17 | const fallthrough_c_filename = "test/side_effects/fallthrough_c.test" 18 | 19 | const retry_filename = "test/side_effects/retry.test" 20 | 21 | const retry_with_backoff_filename = "test/side_effects/retry_with_backof.test" 22 | 23 | const join_filename = "test/side_effects/join_filename.test" 24 | 25 | const repeat_filename = "test/side_effects/repeat.test" 26 | 27 | const every_a_filename = "test/side_effects/every_a.test" 28 | 29 | const every_b_filename = "test/side_effects/every_b.test" 30 | 31 | fn init_ok(v) { 32 | fn() { Ok(v) } 33 | } 34 | 35 | fn do_ok(v) { 36 | fn(_) { Ok(v) } 37 | } 38 | 39 | fn init_error(v) { 40 | fn() { Error(v) } 41 | } 42 | 43 | fn do_error(v) { 44 | fn(_) { Error(v) } 45 | } 46 | 47 | fn do_panic(_) { 48 | panic as "Shouldn't be called" 49 | } 50 | 51 | @external(erlang, "erlang", "system_time") 52 | @external(javascript, "./test.mjs", "system_time") 53 | fn system_time() -> Int 54 | 55 | pub fn main() { 56 | let assert Ok(Nil) = 57 | simplifile.delete_all([ 58 | drain_filename, 59 | fallthrough_a_filename, 60 | fallthrough_b_filename, 61 | fallthrough_c_filename, 62 | retry_filename, 63 | repeat_filename, 64 | retry_with_backoff_filename, 65 | every_a_filename, 66 | every_b_filename, 67 | ]) 68 | 69 | gleeunit.main() 70 | } 71 | 72 | pub fn build_delay_test() { 73 | delay.delay_effect(init_ok(1)) 74 | |> delay.run() 75 | |> should.be_ok() 76 | 77 | delay.delay_effect(init_error(1)) 78 | |> delay.run() 79 | |> should.be_error() 80 | } 81 | 82 | pub fn map_test() { 83 | delay.delay_effect(init_ok("Hello")) 84 | |> delay.map(fn(x) { Ok(x <> " World!") }) 85 | |> delay.run() 86 | |> should.be_ok 87 | |> should.equal("Hello World!") 88 | 89 | delay.delay_effect(init_ok(1)) 90 | |> delay.map(fn(x) { Ok(x + 1) }) 91 | |> delay.map(fn(x) { Ok(x * 2) }) 92 | |> delay.run() 93 | |> should.be_ok 94 | |> should.equal(4) 95 | } 96 | 97 | pub fn join_test() { 98 | let l = delay.delay_effect(init_ok(1)) 99 | let error = delay.delay_effect(init_error(1)) 100 | let r = delay.delay_effect(init_ok(2)) 101 | 102 | delay.join(l, r) 103 | |> delay.run() 104 | |> should.be_ok() 105 | |> should.equal(#(1, 2)) 106 | 107 | delay.join(error, r) 108 | |> delay.run() 109 | |> should.be_error() 110 | |> should.equal(#(option.Some(1), option.None)) 111 | 112 | delay.join(l, error) 113 | |> delay.run() 114 | |> should.be_error() 115 | |> should.equal(#(option.None, option.Some(1))) 116 | 117 | delay.join(error, error) 118 | |> delay.run() 119 | |> should.be_error() 120 | |> should.equal(#(option.Some(1), option.None)) 121 | 122 | let d = delay.delay_effect(fn() { simplifile.create_file(join_filename) }) 123 | 124 | delay.join(error, d) 125 | |> delay.run() 126 | |> should.be_error() 127 | |> should.equal(#(option.Some(1), option.None)) 128 | 129 | let assert Error(simplifile.Enoent) = 130 | simplifile.read(join_filename) 131 | |> io.debug 132 | } 133 | 134 | pub fn flat_map_test() { 135 | delay.delay_effect(init_ok("Hello")) 136 | |> delay.flat_map(fn(x) { Ok(delay.delay_effect(init_ok(x <> " Again!"))) }) 137 | |> delay.run() 138 | |> should.be_ok 139 | |> should.equal("Hello Again!") 140 | 141 | delay.delay_effect(init_ok("Hello")) 142 | |> delay.flat_map(do_ok(delay.delay_effect(init_error("shit!")))) 143 | |> delay.run() 144 | |> should.be_error 145 | |> should.equal("shit!") 146 | 147 | delay.delay_effect(fn() { Ok("Hello") }) 148 | |> delay.flat_map(do_error(delay.delay_effect(init_ok("Nice!")))) 149 | |> delay.run() 150 | |> should.be_error 151 | } 152 | 153 | pub fn short_circuit_on_errors_test() { 154 | delay.delay_effect(init_error("ERR")) 155 | |> delay.map(do_panic) 156 | |> delay.run() 157 | |> should.be_error 158 | |> should.equal("ERR") 159 | } 160 | 161 | pub fn drain_test() { 162 | let d = 163 | delay.delay_effect(fn() { simplifile.create_file(drain_filename) }) 164 | |> delay.map(fn(_) { simplifile.append("123", to: drain_filename) }) 165 | 166 | should.be_error(simplifile.read(drain_filename)) 167 | 168 | delay.drain(d) 169 | 170 | simplifile.read(drain_filename) 171 | |> should.be_ok() 172 | |> should.equal("123") 173 | } 174 | 175 | pub fn retry_test() { 176 | let write_fail = 177 | delay.delay_effect(fn() { simplifile.create_file(retry_filename) }) 178 | |> delay.map(fn(_) { simplifile.append("✨", to: retry_filename) }) 179 | |> delay.map(do_error(simplifile.Unknown(""))) 180 | 181 | delay.retry(write_fail, 3, 0) 182 | |> delay.run() 183 | |> should.be_error() 184 | // Eexist because subsequent will fail on create 185 | |> should.equal(simplifile.Eexist) 186 | 187 | // only one because subsequent will fail on create 188 | let assert Ok("✨") = simplifile.read(retry_filename) 189 | } 190 | 191 | pub fn retry_with_backoff_test() { 192 | let assert Ok(Nil) = simplifile.create_file(retry_with_backoff_filename) 193 | 194 | let write_fail = 195 | delay.delay_effect(fn() { 196 | simplifile.append( 197 | int.to_string(system_time()) <> ":", 198 | to: retry_with_backoff_filename, 199 | ) 200 | }) 201 | |> delay.map(do_error(simplifile.Unknown(""))) 202 | 203 | delay.retry_with_backoff(write_fail, 3) 204 | |> delay.run() 205 | |> should.be_error() 206 | |> should.equal(simplifile.Unknown("")) 207 | 208 | let assert [x, y, z] = 209 | simplifile.read(retry_with_backoff_filename) 210 | |> should.be_ok() 211 | |> string.split(on: ":") 212 | |> list.filter(fn(x) { !string.is_empty(x) }) 213 | |> list.map(fn(v) { int.base_parse(v, 10) }) 214 | |> list.map(should.be_ok) 215 | 216 | should.be_true(x < y) 217 | should.be_true(y < z) 218 | } 219 | 220 | pub fn repeat_test() { 221 | delay.delay_effect(fn() { simplifile.create_file(repeat_filename) }) 222 | |> delay.repeat(3) 223 | |> should.equal([Error(simplifile.Eexist), Error(simplifile.Eexist), Ok(Nil)]) 224 | } 225 | 226 | pub fn fallthrough_test() { 227 | let p = 228 | delay.delay_effect(init_ok(1)) 229 | |> delay.map(do_panic) 230 | 231 | delay.fallthrough([ 232 | delay.delay_effect(fn() { simplifile.create_file(fallthrough_a_filename) }) 233 | |> delay.map(do_error(simplifile.Unknown(""))), 234 | delay.delay_effect(fn() { simplifile.create_file(fallthrough_b_filename) }), 235 | delay.delay_effect(fn() { simplifile.create_file(fallthrough_c_filename) }), 236 | p, 237 | ]) 238 | |> should.be_ok() 239 | |> should.equal(Nil) 240 | 241 | let assert Ok(_) = simplifile.read(fallthrough_a_filename) 242 | let assert Ok(_) = simplifile.read(fallthrough_b_filename) 243 | let assert Error(simplifile.Enoent) = simplifile.read(fallthrough_c_filename) 244 | } 245 | 246 | pub fn every_test() { 247 | let a = delay.delay_effect(init_ok("Nice")) 248 | 249 | delay.every([a, a, a]) 250 | |> list.map(should.be_ok) 251 | 252 | let b = delay.delay_effect(init_error("shit...")) 253 | delay.every([b, b, b]) 254 | |> list.map(should.be_error) 255 | } 256 | 257 | pub fn every_attempts_all_effects_test() { 258 | let da = delay.delay_effect(fn() { simplifile.create_file(every_a_filename) }) 259 | let db = delay.delay_effect(fn() { simplifile.create_file(every_b_filename) }) 260 | let assert [Error(_), Error(_), Ok(_), Ok(_)] = delay.every([da, db, da, db]) 261 | } 262 | 263 | pub fn all_test() { 264 | let a = delay.delay_effect(init_ok("Nice")) 265 | delay.all([a, a, a]) 266 | |> should.be_true() 267 | 268 | let b = delay.delay_effect(init_error("shit...")) 269 | delay.all([b, b, b]) 270 | |> should.be_false() 271 | 272 | delay.all([a, b, a]) 273 | |> should.be_false() 274 | } 275 | 276 | pub fn any_test() { 277 | let a = delay.delay_effect(init_ok("Nice")) 278 | delay.any([a, a, a]) 279 | |> should.be_true() 280 | 281 | let b = delay.delay_effect(init_error("shit...")) 282 | delay.any([b, b, b]) 283 | |> should.be_false() 284 | 285 | delay.any([a, b, a]) 286 | |> should.be_true() 287 | } 288 | -------------------------------------------------------------------------------- /test/side_effects/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bwireman/delay/7d690f1e36b3741336ebd7cac7fa468be69c0483/test/side_effects/.gitkeep -------------------------------------------------------------------------------- /test/test.mjs: -------------------------------------------------------------------------------- 1 | export function system_time() { 2 | return Date.now(); 3 | } 4 | 5 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Visit https://aka.ms/tsconfig to read more about this file */ 4 | 5 | /* Projects */ 6 | // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ 7 | // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ 8 | // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ 9 | // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ 10 | // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ 11 | // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ 12 | 13 | /* Language and Environment */ 14 | "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ 15 | // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ 16 | // "jsx": "preserve", /* Specify what JSX code is generated. */ 17 | // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ 18 | // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ 19 | // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ 20 | // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ 21 | // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ 22 | // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ 23 | // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ 24 | // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ 25 | // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ 26 | 27 | /* Modules */ 28 | "module": "commonjs", /* Specify what module code is generated. */ 29 | // "rootDir": "./", /* Specify the root folder within your source files. */ 30 | // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ 31 | // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ 32 | // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ 33 | // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ 34 | // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ 35 | // "types": [], /* Specify type package names to be included without being referenced in a source file. */ 36 | // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ 37 | // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ 38 | // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */ 39 | // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ 40 | // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ 41 | // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ 42 | // "resolveJsonModule": true, /* Enable importing .json files. */ 43 | // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ 44 | // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ 45 | 46 | /* JavaScript Support */ 47 | "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ 48 | // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ 49 | // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ 50 | 51 | /* Emit */ 52 | // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ 53 | // "declarationMap": true, /* Create sourcemaps for d.ts files. */ 54 | // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ 55 | // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ 56 | // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ 57 | // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ 58 | // "outDir": "./", /* Specify an output folder for all emitted files. */ 59 | // "removeComments": true, /* Disable emitting comments. */ 60 | // "noEmit": true, /* Disable emitting files from a compilation. */ 61 | // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ 62 | // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ 63 | // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ 64 | // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ 65 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ 66 | // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ 67 | // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ 68 | // "newLine": "crlf", /* Set the newline character for emitting files. */ 69 | // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ 70 | // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ 71 | // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ 72 | // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ 73 | // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ 74 | // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ 75 | 76 | /* Interop Constraints */ 77 | // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ 78 | // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ 79 | // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ 80 | "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ 81 | // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ 82 | "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ 83 | 84 | /* Type Checking */ 85 | "strict": true, /* Enable all strict type-checking options. */ 86 | // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ 87 | // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ 88 | // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ 89 | // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ 90 | // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ 91 | // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ 92 | // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ 93 | // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ 94 | // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ 95 | // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ 96 | // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ 97 | // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ 98 | // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ 99 | // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ 100 | // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ 101 | // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ 102 | // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ 103 | // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ 104 | 105 | /* Completeness */ 106 | // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ 107 | "skipLibCheck": true /* Skip type checking all .d.ts files. */ 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | "@cross/test@npm:@jsr/cross__test": 6 | version "0.0.10" 7 | resolved "https://npm.jsr.io/~/11/@jsr/cross__test/0.0.10.tgz" 8 | integrity sha512-FjyJN1OxI6lPZGOYK3/iGuDzljPYUZN2Cm2eHaAHIvGPEYYBYLH4VI5ww0LDjM9GdXymitPh6PLhP8dwbNJGFw== 9 | dependencies: 10 | "@jsr/cross__runtime" "^1.0.0" 11 | 12 | "@esbuild/linux-x64@0.20.2": 13 | version "0.20.2" 14 | resolved "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.2.tgz" 15 | integrity sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw== 16 | 17 | "@eslint-community/eslint-utils@^4.2.0": 18 | version "4.4.1" 19 | resolved "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz" 20 | integrity sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA== 21 | dependencies: 22 | eslint-visitor-keys "^3.4.3" 23 | 24 | "@eslint-community/regexpp@^4.6.1": 25 | version "4.12.1" 26 | resolved "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz" 27 | integrity sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ== 28 | 29 | "@eslint/eslintrc@^2.1.4": 30 | version "2.1.4" 31 | resolved "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz" 32 | integrity sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ== 33 | dependencies: 34 | ajv "^6.12.4" 35 | debug "^4.3.2" 36 | espree "^9.6.0" 37 | globals "^13.19.0" 38 | ignore "^5.2.0" 39 | import-fresh "^3.2.1" 40 | js-yaml "^4.1.0" 41 | minimatch "^3.1.2" 42 | strip-json-comments "^3.1.1" 43 | 44 | "@eslint/js@8.57.1": 45 | version "8.57.1" 46 | resolved "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz" 47 | integrity sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q== 48 | 49 | "@humanwhocodes/config-array@^0.13.0": 50 | version "0.13.0" 51 | resolved "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz" 52 | integrity sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw== 53 | dependencies: 54 | "@humanwhocodes/object-schema" "^2.0.3" 55 | debug "^4.3.1" 56 | minimatch "^3.0.5" 57 | 58 | "@humanwhocodes/module-importer@^1.0.1": 59 | version "1.0.1" 60 | resolved "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz" 61 | integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== 62 | 63 | "@humanwhocodes/object-schema@^2.0.3": 64 | version "2.0.3" 65 | resolved "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz" 66 | integrity sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA== 67 | 68 | "@jsr/cross__runtime@^1.0.0": 69 | version "1.1.0" 70 | resolved "https://npm.jsr.io/~/11/@jsr/cross__runtime/1.1.0.tgz" 71 | integrity sha512-GGvdy7fGJP4owjp6uQDFbfawuQJrwNJzb2gfotW9wfxtXDfyL5ukPXnHWQwsMF0rUpb5luhuG5r9/h8teYH7lw== 72 | 73 | "@jsr/std__internal@^1.0.5": 74 | version "1.0.5" 75 | resolved "https://npm.jsr.io/~/11/@jsr/std__internal/1.0.5.tgz" 76 | integrity sha512-W2aN7UypJJ6EkfyXt5hBeIijBb8CmZk0jdjCzhOROr0SrXsXZ/V/9Qu1N0NxumFauPDAJz9NcP1mmZ9ZVSXwpQ== 77 | 78 | "@nodelib/fs.scandir@2.1.5": 79 | version "2.1.5" 80 | resolved "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz" 81 | integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== 82 | dependencies: 83 | "@nodelib/fs.stat" "2.0.5" 84 | run-parallel "^1.1.9" 85 | 86 | "@nodelib/fs.stat@2.0.5": 87 | version "2.0.5" 88 | resolved "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz" 89 | integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== 90 | 91 | "@nodelib/fs.walk@^1.2.8": 92 | version "1.2.8" 93 | resolved "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz" 94 | integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== 95 | dependencies: 96 | "@nodelib/fs.scandir" "2.1.5" 97 | fastq "^1.6.0" 98 | 99 | "@std/assert@npm:@jsr/std__assert": 100 | version "1.0.11" 101 | resolved "https://npm.jsr.io/~/11/@jsr/std__assert/1.0.11.tgz" 102 | integrity sha512-sNXyi9EQA4f/9F3gI1t+Dz+LnvPwCC3JDUqn9YfWl7IK7RRipiHOkDpV8Vq3LL/ZDZF8Tcr36zVhuEOrRs8i+g== 103 | dependencies: 104 | "@jsr/std__internal" "^1.0.5" 105 | 106 | "@ungap/structured-clone@^1.2.0": 107 | version "1.3.0" 108 | resolved "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz" 109 | integrity sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g== 110 | 111 | acorn-jsx@^5.3.2: 112 | version "5.3.2" 113 | resolved "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz" 114 | integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== 115 | 116 | "acorn@^6.0.0 || ^7.0.0 || ^8.0.0", acorn@^8.9.0: 117 | version "8.14.0" 118 | resolved "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz" 119 | integrity sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA== 120 | 121 | ajv@^6.12.4: 122 | version "6.12.6" 123 | resolved "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz" 124 | integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== 125 | dependencies: 126 | fast-deep-equal "^3.1.1" 127 | fast-json-stable-stringify "^2.0.0" 128 | json-schema-traverse "^0.4.1" 129 | uri-js "^4.2.2" 130 | 131 | ansi-regex@^5.0.1: 132 | version "5.0.1" 133 | resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz" 134 | integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== 135 | 136 | ansi-styles@^4.1.0: 137 | version "4.3.0" 138 | resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz" 139 | integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== 140 | dependencies: 141 | color-convert "^2.0.1" 142 | 143 | argparse@^2.0.1: 144 | version "2.0.1" 145 | resolved "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz" 146 | integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== 147 | 148 | balanced-match@^1.0.0: 149 | version "1.0.2" 150 | resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz" 151 | integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== 152 | 153 | brace-expansion@^1.1.7: 154 | version "1.1.11" 155 | resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz" 156 | integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== 157 | dependencies: 158 | balanced-match "^1.0.0" 159 | concat-map "0.0.1" 160 | 161 | callsites@^3.0.0: 162 | version "3.1.0" 163 | resolved "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz" 164 | integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== 165 | 166 | chalk@^4.0.0: 167 | version "4.1.2" 168 | resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz" 169 | integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== 170 | dependencies: 171 | ansi-styles "^4.1.0" 172 | supports-color "^7.1.0" 173 | 174 | color-convert@^2.0.1: 175 | version "2.0.1" 176 | resolved "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz" 177 | integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== 178 | dependencies: 179 | color-name "~1.1.4" 180 | 181 | color-name@~1.1.4: 182 | version "1.1.4" 183 | resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz" 184 | integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== 185 | 186 | concat-map@0.0.1: 187 | version "0.0.1" 188 | resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" 189 | integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== 190 | 191 | cross-spawn@^7.0.2: 192 | version "7.0.6" 193 | resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz" 194 | integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA== 195 | dependencies: 196 | path-key "^3.1.0" 197 | shebang-command "^2.0.0" 198 | which "^2.0.1" 199 | 200 | debug@^4.3.1, debug@^4.3.2: 201 | version "4.4.0" 202 | resolved "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz" 203 | integrity sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA== 204 | dependencies: 205 | ms "^2.1.3" 206 | 207 | deep-is@^0.1.3: 208 | version "0.1.4" 209 | resolved "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz" 210 | integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== 211 | 212 | dets@^0.14.2: 213 | version "0.14.2" 214 | resolved "https://registry.npmjs.org/dets/-/dets-0.14.2.tgz" 215 | integrity sha512-jatRCsNHdeB3OebBudsOWRlp7Ka4/Kbi9PUQllnplXH7rWXl1Qe/G7F2Y5dqz2PYimNCH64lzLMuCLDsnnyEhA== 216 | 217 | doctrine@^3.0.0: 218 | version "3.0.0" 219 | resolved "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz" 220 | integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== 221 | dependencies: 222 | esutils "^2.0.2" 223 | 224 | esbuild@^0.20.1: 225 | version "0.20.2" 226 | resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.20.2.tgz" 227 | integrity sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g== 228 | optionalDependencies: 229 | "@esbuild/aix-ppc64" "0.20.2" 230 | "@esbuild/android-arm" "0.20.2" 231 | "@esbuild/android-arm64" "0.20.2" 232 | "@esbuild/android-x64" "0.20.2" 233 | "@esbuild/darwin-arm64" "0.20.2" 234 | "@esbuild/darwin-x64" "0.20.2" 235 | "@esbuild/freebsd-arm64" "0.20.2" 236 | "@esbuild/freebsd-x64" "0.20.2" 237 | "@esbuild/linux-arm" "0.20.2" 238 | "@esbuild/linux-arm64" "0.20.2" 239 | "@esbuild/linux-ia32" "0.20.2" 240 | "@esbuild/linux-loong64" "0.20.2" 241 | "@esbuild/linux-mips64el" "0.20.2" 242 | "@esbuild/linux-ppc64" "0.20.2" 243 | "@esbuild/linux-riscv64" "0.20.2" 244 | "@esbuild/linux-s390x" "0.20.2" 245 | "@esbuild/linux-x64" "0.20.2" 246 | "@esbuild/netbsd-x64" "0.20.2" 247 | "@esbuild/openbsd-x64" "0.20.2" 248 | "@esbuild/sunos-x64" "0.20.2" 249 | "@esbuild/win32-arm64" "0.20.2" 250 | "@esbuild/win32-ia32" "0.20.2" 251 | "@esbuild/win32-x64" "0.20.2" 252 | 253 | escape-string-regexp@^4.0.0: 254 | version "4.0.0" 255 | resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz" 256 | integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== 257 | 258 | eslint-plugin-unused-imports@^3.1.0: 259 | version "3.2.0" 260 | resolved "https://registry.npmjs.org/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-3.2.0.tgz" 261 | integrity sha512-6uXyn6xdINEpxE1MtDjxQsyXB37lfyO2yKGVVgtD7WEWQGORSOZjgrD6hBhvGv4/SO+TOlS+UnC6JppRqbuwGQ== 262 | dependencies: 263 | eslint-rule-composer "^0.3.0" 264 | 265 | eslint-rule-composer@^0.3.0: 266 | version "0.3.0" 267 | resolved "https://registry.npmjs.org/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz" 268 | integrity sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg== 269 | 270 | eslint-scope@^7.2.2: 271 | version "7.2.2" 272 | resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz" 273 | integrity sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg== 274 | dependencies: 275 | esrecurse "^4.3.0" 276 | estraverse "^5.2.0" 277 | 278 | eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4.3: 279 | version "3.4.3" 280 | resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz" 281 | integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== 282 | 283 | "eslint@^6.0.0 || ^7.0.0 || >=8.0.0", eslint@^8.57.0, eslint@8: 284 | version "8.57.1" 285 | resolved "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz" 286 | integrity sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA== 287 | dependencies: 288 | "@eslint-community/eslint-utils" "^4.2.0" 289 | "@eslint-community/regexpp" "^4.6.1" 290 | "@eslint/eslintrc" "^2.1.4" 291 | "@eslint/js" "8.57.1" 292 | "@humanwhocodes/config-array" "^0.13.0" 293 | "@humanwhocodes/module-importer" "^1.0.1" 294 | "@nodelib/fs.walk" "^1.2.8" 295 | "@ungap/structured-clone" "^1.2.0" 296 | ajv "^6.12.4" 297 | chalk "^4.0.0" 298 | cross-spawn "^7.0.2" 299 | debug "^4.3.2" 300 | doctrine "^3.0.0" 301 | escape-string-regexp "^4.0.0" 302 | eslint-scope "^7.2.2" 303 | eslint-visitor-keys "^3.4.3" 304 | espree "^9.6.1" 305 | esquery "^1.4.2" 306 | esutils "^2.0.2" 307 | fast-deep-equal "^3.1.3" 308 | file-entry-cache "^6.0.1" 309 | find-up "^5.0.0" 310 | glob-parent "^6.0.2" 311 | globals "^13.19.0" 312 | graphemer "^1.4.0" 313 | ignore "^5.2.0" 314 | imurmurhash "^0.1.4" 315 | is-glob "^4.0.0" 316 | is-path-inside "^3.0.3" 317 | js-yaml "^4.1.0" 318 | json-stable-stringify-without-jsonify "^1.0.1" 319 | levn "^0.4.1" 320 | lodash.merge "^4.6.2" 321 | minimatch "^3.1.2" 322 | natural-compare "^1.4.0" 323 | optionator "^0.9.3" 324 | strip-ansi "^6.0.1" 325 | text-table "^0.2.0" 326 | 327 | espree@^9.6.0, espree@^9.6.1: 328 | version "9.6.1" 329 | resolved "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz" 330 | integrity sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ== 331 | dependencies: 332 | acorn "^8.9.0" 333 | acorn-jsx "^5.3.2" 334 | eslint-visitor-keys "^3.4.1" 335 | 336 | esquery@^1.4.2: 337 | version "1.6.0" 338 | resolved "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz" 339 | integrity sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg== 340 | dependencies: 341 | estraverse "^5.1.0" 342 | 343 | esrecurse@^4.3.0: 344 | version "4.3.0" 345 | resolved "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz" 346 | integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== 347 | dependencies: 348 | estraverse "^5.2.0" 349 | 350 | estraverse@^5.1.0, estraverse@^5.2.0: 351 | version "5.3.0" 352 | resolved "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz" 353 | integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== 354 | 355 | esutils@^2.0.2: 356 | version "2.0.3" 357 | resolved "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz" 358 | integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== 359 | 360 | fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: 361 | version "3.1.3" 362 | resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz" 363 | integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== 364 | 365 | fast-json-stable-stringify@^2.0.0: 366 | version "2.1.0" 367 | resolved "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz" 368 | integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== 369 | 370 | fast-levenshtein@^2.0.6: 371 | version "2.0.6" 372 | resolved "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz" 373 | integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== 374 | 375 | fastq@^1.6.0: 376 | version "1.19.0" 377 | resolved "https://registry.npmjs.org/fastq/-/fastq-1.19.0.tgz" 378 | integrity sha512-7SFSRCNjBQIZH/xZR3iy5iQYR8aGBE0h3VG6/cwlbrpdciNYBMotQav8c1XI3HjHH+NikUpP53nPdlZSdWmFzA== 379 | dependencies: 380 | reusify "^1.0.4" 381 | 382 | file-entry-cache@^6.0.1: 383 | version "6.0.1" 384 | resolved "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz" 385 | integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== 386 | dependencies: 387 | flat-cache "^3.0.4" 388 | 389 | find-up@^5.0.0: 390 | version "5.0.0" 391 | resolved "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz" 392 | integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== 393 | dependencies: 394 | locate-path "^6.0.0" 395 | path-exists "^4.0.0" 396 | 397 | flat-cache@^3.0.4: 398 | version "3.2.0" 399 | resolved "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz" 400 | integrity sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw== 401 | dependencies: 402 | flatted "^3.2.9" 403 | keyv "^4.5.3" 404 | rimraf "^3.0.2" 405 | 406 | flatted@^3.2.9: 407 | version "3.3.2" 408 | resolved "https://registry.npmjs.org/flatted/-/flatted-3.3.2.tgz" 409 | integrity sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA== 410 | 411 | fs.realpath@^1.0.0: 412 | version "1.0.0" 413 | resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" 414 | integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== 415 | 416 | glob-parent@^6.0.2: 417 | version "6.0.2" 418 | resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz" 419 | integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== 420 | dependencies: 421 | is-glob "^4.0.3" 422 | 423 | glob@^7.1.3: 424 | version "7.2.3" 425 | resolved "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz" 426 | integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== 427 | dependencies: 428 | fs.realpath "^1.0.0" 429 | inflight "^1.0.4" 430 | inherits "2" 431 | minimatch "^3.1.1" 432 | once "^1.3.0" 433 | path-is-absolute "^1.0.0" 434 | 435 | globals@^13.19.0: 436 | version "13.24.0" 437 | resolved "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz" 438 | integrity sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ== 439 | dependencies: 440 | type-fest "^0.20.2" 441 | 442 | graphemer@^1.4.0: 443 | version "1.4.0" 444 | resolved "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz" 445 | integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== 446 | 447 | has-flag@^4.0.0: 448 | version "4.0.0" 449 | resolved "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz" 450 | integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== 451 | 452 | ignore@^5.2.0: 453 | version "5.3.2" 454 | resolved "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz" 455 | integrity sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g== 456 | 457 | import-fresh@^3.2.1: 458 | version "3.3.1" 459 | resolved "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz" 460 | integrity sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ== 461 | dependencies: 462 | parent-module "^1.0.0" 463 | resolve-from "^4.0.0" 464 | 465 | imurmurhash@^0.1.4: 466 | version "0.1.4" 467 | resolved "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz" 468 | integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== 469 | 470 | inflight@^1.0.4: 471 | version "1.0.6" 472 | resolved "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz" 473 | integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== 474 | dependencies: 475 | once "^1.3.0" 476 | wrappy "1" 477 | 478 | inherits@2: 479 | version "2.0.4" 480 | resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" 481 | integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== 482 | 483 | is-extglob@^2.1.1: 484 | version "2.1.1" 485 | resolved "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz" 486 | integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== 487 | 488 | is-glob@^4.0.0, is-glob@^4.0.3: 489 | version "4.0.3" 490 | resolved "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz" 491 | integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== 492 | dependencies: 493 | is-extglob "^2.1.1" 494 | 495 | is-path-inside@^3.0.3: 496 | version "3.0.3" 497 | resolved "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz" 498 | integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== 499 | 500 | isexe@^2.0.0: 501 | version "2.0.0" 502 | resolved "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz" 503 | integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== 504 | 505 | js-yaml@^4.1.0: 506 | version "4.1.0" 507 | resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz" 508 | integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== 509 | dependencies: 510 | argparse "^2.0.1" 511 | 512 | json-buffer@3.0.1: 513 | version "3.0.1" 514 | resolved "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz" 515 | integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== 516 | 517 | json-schema-traverse@^0.4.1: 518 | version "0.4.1" 519 | resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz" 520 | integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== 521 | 522 | json-stable-stringify-without-jsonify@^1.0.1: 523 | version "1.0.1" 524 | resolved "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz" 525 | integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== 526 | 527 | keyv@^4.5.3: 528 | version "4.5.4" 529 | resolved "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz" 530 | integrity sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw== 531 | dependencies: 532 | json-buffer "3.0.1" 533 | 534 | levn@^0.4.1: 535 | version "0.4.1" 536 | resolved "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz" 537 | integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ== 538 | dependencies: 539 | prelude-ls "^1.2.1" 540 | type-check "~0.4.0" 541 | 542 | locate-path@^6.0.0: 543 | version "6.0.0" 544 | resolved "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz" 545 | integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== 546 | dependencies: 547 | p-locate "^5.0.0" 548 | 549 | lodash.merge@^4.6.2: 550 | version "4.6.2" 551 | resolved "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz" 552 | integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== 553 | 554 | minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: 555 | version "3.1.2" 556 | resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz" 557 | integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== 558 | dependencies: 559 | brace-expansion "^1.1.7" 560 | 561 | ms@^2.1.3: 562 | version "2.1.3" 563 | resolved "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz" 564 | integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== 565 | 566 | natural-compare@^1.4.0: 567 | version "1.4.0" 568 | resolved "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz" 569 | integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== 570 | 571 | node-fetch@^2.6.1: 572 | version "2.7.0" 573 | resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz" 574 | integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== 575 | dependencies: 576 | whatwg-url "^5.0.0" 577 | 578 | once@^1.3.0: 579 | version "1.4.0" 580 | resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz" 581 | integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== 582 | dependencies: 583 | wrappy "1" 584 | 585 | optionator@^0.9.3: 586 | version "0.9.4" 587 | resolved "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz" 588 | integrity sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g== 589 | dependencies: 590 | deep-is "^0.1.3" 591 | fast-levenshtein "^2.0.6" 592 | levn "^0.4.1" 593 | prelude-ls "^1.2.1" 594 | type-check "^0.4.0" 595 | word-wrap "^1.2.5" 596 | 597 | p-limit@^3.0.2: 598 | version "3.1.0" 599 | resolved "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz" 600 | integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== 601 | dependencies: 602 | yocto-queue "^0.1.0" 603 | 604 | p-locate@^5.0.0: 605 | version "5.0.0" 606 | resolved "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz" 607 | integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== 608 | dependencies: 609 | p-limit "^3.0.2" 610 | 611 | parent-module@^1.0.0: 612 | version "1.0.1" 613 | resolved "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz" 614 | integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== 615 | dependencies: 616 | callsites "^3.0.0" 617 | 618 | path-exists@^4.0.0: 619 | version "4.0.0" 620 | resolved "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz" 621 | integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== 622 | 623 | path-is-absolute@^1.0.0: 624 | version "1.0.1" 625 | resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" 626 | integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== 627 | 628 | path-key@^3.1.0: 629 | version "3.1.1" 630 | resolved "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz" 631 | integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== 632 | 633 | prelude-ls@^1.2.1: 634 | version "1.2.1" 635 | resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz" 636 | integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== 637 | 638 | prettier@3.2.5: 639 | version "3.2.5" 640 | resolved "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz" 641 | integrity sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A== 642 | 643 | punycode@^2.1.0: 644 | version "2.3.1" 645 | resolved "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz" 646 | integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== 647 | 648 | queue-microtask@^1.2.2: 649 | version "1.2.3" 650 | resolved "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz" 651 | integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== 652 | 653 | resolve-from@^4.0.0: 654 | version "4.0.0" 655 | resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz" 656 | integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== 657 | 658 | reusify@^1.0.4: 659 | version "1.0.4" 660 | resolved "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz" 661 | integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== 662 | 663 | rimraf@^3.0.2: 664 | version "3.0.2" 665 | resolved "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz" 666 | integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== 667 | dependencies: 668 | glob "^7.1.3" 669 | 670 | run-parallel@^1.1.9: 671 | version "1.2.0" 672 | resolved "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz" 673 | integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== 674 | dependencies: 675 | queue-microtask "^1.2.2" 676 | 677 | shebang-command@^2.0.0: 678 | version "2.0.0" 679 | resolved "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz" 680 | integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== 681 | dependencies: 682 | shebang-regex "^3.0.0" 683 | 684 | shebang-regex@^3.0.0: 685 | version "3.0.0" 686 | resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz" 687 | integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== 688 | 689 | strip-ansi@^6.0.1: 690 | version "6.0.1" 691 | resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" 692 | integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== 693 | dependencies: 694 | ansi-regex "^5.0.1" 695 | 696 | strip-json-comments@^3.1.1: 697 | version "3.1.1" 698 | resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz" 699 | integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== 700 | 701 | supports-color@^7.1.0: 702 | version "7.2.0" 703 | resolved "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz" 704 | integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== 705 | dependencies: 706 | has-flag "^4.0.0" 707 | 708 | sync-fetch@^0.5.2: 709 | version "0.5.2" 710 | resolved "https://registry.npmjs.org/sync-fetch/-/sync-fetch-0.5.2.tgz" 711 | integrity sha512-6gBqqkHrYvkH65WI2bzrDwrIKmt3U10s4Exnz3dYuE5Ah62FIfNv/F63inrNhu2Nyh3GH5f42GKU3RrSJoaUyQ== 712 | dependencies: 713 | node-fetch "^2.6.1" 714 | 715 | text-table@^0.2.0: 716 | version "0.2.0" 717 | resolved "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz" 718 | integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== 719 | 720 | tr46@~0.0.3: 721 | version "0.0.3" 722 | resolved "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz" 723 | integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== 724 | 725 | type-check@^0.4.0, type-check@~0.4.0: 726 | version "0.4.0" 727 | resolved "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz" 728 | integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew== 729 | dependencies: 730 | prelude-ls "^1.2.1" 731 | 732 | type-fest@^0.20.2: 733 | version "0.20.2" 734 | resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz" 735 | integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== 736 | 737 | typescript@^5.3.3, "typescript@4.x || 5.x": 738 | version "5.7.3" 739 | resolved "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz" 740 | integrity sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw== 741 | 742 | uri-js@^4.2.2: 743 | version "4.4.1" 744 | resolved "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz" 745 | integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== 746 | dependencies: 747 | punycode "^2.1.0" 748 | 749 | webidl-conversions@^3.0.0: 750 | version "3.0.1" 751 | resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz" 752 | integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== 753 | 754 | whatwg-url@^5.0.0: 755 | version "5.0.0" 756 | resolved "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz" 757 | integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== 758 | dependencies: 759 | tr46 "~0.0.3" 760 | webidl-conversions "^3.0.0" 761 | 762 | which@^2.0.1: 763 | version "2.0.2" 764 | resolved "https://registry.npmjs.org/which/-/which-2.0.2.tgz" 765 | integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== 766 | dependencies: 767 | isexe "^2.0.0" 768 | 769 | word-wrap@^1.2.5: 770 | version "1.2.5" 771 | resolved "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz" 772 | integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA== 773 | 774 | wrappy@1: 775 | version "1.0.2" 776 | resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" 777 | integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== 778 | 779 | yaml@^2.4.4: 780 | version "2.7.0" 781 | resolved "https://registry.npmjs.org/yaml/-/yaml-2.7.0.tgz" 782 | integrity sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA== 783 | 784 | yocto-queue@^0.1.0: 785 | version "0.1.0" 786 | resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz" 787 | integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== 788 | --------------------------------------------------------------------------------