diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 0eb2f96..3ed0881 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -22,6 +22,8 @@ A clear and concise description of what you expected to happen. - Typescript version: ` ` - substitute.js version: ` ` - Node version: ` ` +- Module system (CommonJS, native ESM, bundler): ` ` +- Test runner (ava, jest, mocha, node:test, vitest, ...): ` ` **Additional context** Add any other context about the problem here. diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 5570919..2a17ec2 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -12,3 +12,10 @@ updates: interval: daily time: "04:00" open-pull-requests-limit: 10 + + # The test runners used by compatibility-checks/ (dev tooling only). + - package-ecosystem: npm + directory: "/compatibility-checks" + schedule: + interval: weekly + open-pull-requests-limit: 5 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 50341b8..67c33a1 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -8,37 +8,37 @@ on: schedule: - cron: '0 6 * * 1' +permissions: + contents: read + jobs: analyze: name: Analyze runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write strategy: fail-fast: false matrix: language: ['javascript-typescript'] - # Learn more... - # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection + # https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: - # We must fetch at least the immediate parents so that if this is - # a pull request then we can checkout the head. - fetch-depth: 2 show-progress: false - # If this run was triggered by a pull request event, then checkout - # the head of the pull request instead of the merge commit. - - run: git checkout HEAD^2 - if: ${{ github.event_name == 'pull_request' }} - # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v3 + uses: github/codeql-action/init@v4 with: languages: ${{ matrix.language }} - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 + uses: github/codeql-action/analyze@v4 + with: + category: "/language:${{ matrix.language }}" diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index b566fe3..c95bd2a 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -1,27 +1,171 @@ name: Node CI -on: [push] + +on: + push: + pull_request: + workflow_dispatch: + # The publish workflow runs exactly these checks before it publishes. + workflow_call: + +permissions: + contents: read + +env: + # The oldest Node.js version the package supports. It must equal engines.node in package.json + # (packaging/package.test.js checks that), and the minimum-node job below smoke-tests the packed package on it. + MINIMUM_NODE_VERSION: '10.0.0' + # The oldest Node.js version with native ES module support, for the ESM entry point (dist/index.mjs). + MINIMUM_ESM_NODE_VERSION: '12.17.0' + # F2: Node.js 13.0 and 13.1 read "exports" but not its conditions. They load the package through the array fallback + # in exports["."] (the CommonJS entry); without it, require() fails there. + EXPORTS_FALLBACK_NODE_VERSION: '13.0.0' + # Node.js 13.2 to 13.6 have ES modules but not the "import" condition, so 13.7 is the oldest 13.x release on which + # the ES module entry works. + MINIMUM_ESM_NODE_13_VERSION: '13.7.0' jobs: - build: + test: + name: Test on Node ${{ matrix.node-version }} runs-on: ubuntu-latest strategy: + fail-fast: false matrix: - node-version: [18, 20, 21] + # Every Node.js LTS line that is still supported: https://nodejs.org/en/about/previous-releases + node-version: [22, 24, 26] + steps: + - uses: actions/checkout@v5 + with: + show-progress: false + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v5 + with: + node-version: ${{ matrix.node-version }} + cache: npm + - name: Install dependencies + run: npm ci + - name: Build + run: npm run build + - name: Run the specs and the packaging checks + run: npm test + - name: Run the type tests + run: npm run test:types --if-present + # Type-checks and runs the code examples of README.md and MIGRATION.md against the built package, and checks links. + - name: Check the code examples in the documentation + run: npm run test:docs + + # F4: README, MIGRATION and CHANGELOG promise TypeScript 3.6 or newer. Type-checks the built typings with exactly that + # version (spec-types/min-ts/check.js installs it on the fly with npx), so a .d.ts change that needs newer + # TypeScript fails CI and is never published. + types-min-ts: + name: Typings on the oldest supported TypeScript + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + with: + show-progress: false + - name: Use the development Node.js version + uses: actions/setup-node@v5 + with: + node-version-file: package.json + cache: npm + - name: Install dependencies + run: npm ci + - name: Build and type-check the typings with the oldest supported TypeScript + run: npm run test:types:min-ts + compatibility: + name: Test runner compatibility on Node ${{ matrix.node-version }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + node-version: [22, 24, 26] + steps: + - uses: actions/checkout@v5 + with: + show-progress: false + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v5 + with: + node-version: ${{ matrix.node-version }} + cache: npm + cache-dependency-path: | + package-lock.json + compatibility-checks/package-lock.json + - name: Install dependencies + run: npm ci + - name: Install the compatibility check dependencies + run: npm ci + working-directory: compatibility-checks + # The pretest script packs the repository like npm publish does and installs that tarball, + # so ava, jest, mocha, node:test and vitest run against the package as it would be published. + - name: Run the compatibility checks against the packed package + run: npm test + working-directory: compatibility-checks + + minimum-node: + name: Packed package on the oldest supported Node versions + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - with: - show-progress: false - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - - name: Install dependencies - run: npm ci - - name: Transpile typescript - run: npm run build --if-present - - name: Run tests - run: npm test - env: - CI: true + - uses: actions/checkout@v5 + with: + show-progress: false + - name: Use the development Node.js version + uses: actions/setup-node@v5 + with: + node-version-file: package.json + cache: npm + - name: Install dependencies + run: npm ci + - name: Pack the package like npm publish does + run: | + consumer="$RUNNER_TEMP/consumer" + mkdir -p "$consumer/node_modules/@fluffy-spoon/substitute" + npm pack --pack-destination "$RUNNER_TEMP" + tar -xzf "$RUNNER_TEMP"/fluffy-spoon-substitute-*.tgz -C "$consumer/node_modules/@fluffy-spoon/substitute" --strip-components=1 + cp packaging/smoke/* "$consumer/" + - name: Use Node.js ${{ env.MINIMUM_NODE_VERSION }} + uses: actions/setup-node@v5 + with: + node-version: ${{ env.MINIMUM_NODE_VERSION }} + # G:PK-2: engines.node must be a version the package really runs on. + # R3TD-5: deep-imports.js checks, on every version below, that the deep imports work or fail as + # packaging/smoke/deep-import-support.js (and CONTRIBUTING.md and MIGRATION.md) say. + - name: CommonJS smoke test on Node ${{ env.MINIMUM_NODE_VERSION }} + working-directory: ${{ runner.temp }}/consumer + run: | + node --version + node require.js + node deep-imports.js + - name: Use Node.js ${{ env.MINIMUM_ESM_NODE_VERSION }} + uses: actions/setup-node@v5 + with: + node-version: ${{ env.MINIMUM_ESM_NODE_VERSION }} + - name: CommonJS and ES module smoke test on Node ${{ env.MINIMUM_ESM_NODE_VERSION }} + working-directory: ${{ runner.temp }}/consumer + run: | + node --version + node require.js + node import.mjs + node deep-imports.js + - name: Use Node.js ${{ env.EXPORTS_FALLBACK_NODE_VERSION }} + uses: actions/setup-node@v5 + with: + node-version: ${{ env.EXPORTS_FALLBACK_NODE_VERSION }} + - name: CommonJS smoke test on Node ${{ env.EXPORTS_FALLBACK_NODE_VERSION }} (exports without conditions) + working-directory: ${{ runner.temp }}/consumer + run: | + node --version + node require.js + node deep-imports.js + - name: Use Node.js ${{ env.MINIMUM_ESM_NODE_13_VERSION }} + uses: actions/setup-node@v5 + with: + node-version: ${{ env.MINIMUM_ESM_NODE_13_VERSION }} + - name: CommonJS and ES module smoke test on Node ${{ env.MINIMUM_ESM_NODE_13_VERSION }} + working-directory: ${{ runner.temp }}/consumer + run: | + node --version + node require.js + node import.mjs + node deep-imports.js diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 6198b96..78db841 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -1,66 +1,57 @@ name: Publish +# Publishing a GitHub release publishes the package to npm. See CONTRIBUTING.md ("Releasing"). +# - The release tag must match the version in package.json (v2.0.1 or 2.0.1 for version 2.0.1). +# - A stable version is published with the npm dist-tag `latest`. A prerelease version (2.1.0-beta.1) or a release +# marked as a prerelease on GitHub is published with the dist-tag `beta`. +# +# There is no GitHub Packages job: GitHub Packages only hosts npm packages whose scope is the repository owner +# (@ffmathy), so it cannot host @fluffy-spoon/substitute, and the former job failed on every release. on: release: - types: [created] + # `published` also fires for a release that was saved as a draft first (`created` does not). + types: [published] + +permissions: + contents: read jobs: - build-test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - show-progress: false - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: 'npm' - - run: npm ci --ignore-scripts - - run: npm test + ci: + name: CI + uses: ./.github/workflows/nodejs.yml publish-npm: - needs: build-test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - show-progress: false - - uses: actions/setup-node@v4 - with: - node-version: 18 - registry-url: https://registry.npmjs.org/ - cache: 'npm' - - run: npm ci --ignore-scripts - - run: npm run build - - run: echo "tag=latest" >> $GITHUB_ENV - - name: Sets npm tag - if: contains(github.event.release.tag_name, 'beta') - run: echo "tag=beta" >> $GITHUB_ENV - - run: npm publish --access public --tag ${{ env.tag }} - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} - - publish-github: - needs: build-test + name: Publish to npm + needs: ci runs-on: ubuntu-latest permissions: contents: read - packages: write + # Lets npm publish with provenance (and with trusted publishing, if it is configured on npmjs.com). + id-token: write steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: show-progress: false - - uses: actions/setup-node@v4 + - uses: actions/setup-node@v5 with: - node-version: 18 - registry-url: https://npm.pkg.github.com/ - cache: 'npm' - - run: npm ci --ignore-scripts - - run: npm run build - - run: echo "tag=latest" >> $GITHUB_ENV - - name: Sets npm tag - if: contains(github.event.release.tag_name, 'beta') - run: echo "tag=beta" >> $GITHUB_ENV - - run: npm publish --tag ${{ env.tag }} + node-version-file: package.json + registry-url: https://registry.npmjs.org/ + cache: npm + - name: Install dependencies + run: npm ci --ignore-scripts + - name: Determine the npm dist-tag + id: dist-tag env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + RELEASE_TAG: ${{ github.event.release.tag_name }} + PRERELEASE: ${{ github.event.release.prerelease }} + run: | + version="$(node -p "require('./package.json').version")" + tag="$(node packaging/dist-tag.js "$RELEASE_TAG" "$version" "$PRERELEASE")" + echo "Publishing $version with the dist-tag $tag" + echo "tag=$tag" >> "$GITHUB_OUTPUT" + # npm publish runs the prepack script, which builds dist/ from scratch. + - name: Publish + run: npm publish --provenance --access public --tag "$DIST_TAG" + env: + DIST_TAG: ${{ steps.dist-tag.outputs.tag }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} diff --git a/.gitignore b/.gitignore index ee295b7..ebfef98 100644 --- a/.gitignore +++ b/.gitignore @@ -331,5 +331,6 @@ ASALocalRun/ # Build dist/ +dist-spec/ fluffy-spoon-substitute-*.tgz package/ diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..ab1eb26 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,132 @@ +# Changelog +All notable changes to `@fluffy-spoon/substitute` are documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). Upgrading? Read the [migration guide](MIGRATION.md). + +## [2.0.1] - Unreleased +The first stable release of version 2 (there was no 2.0.0 release). It is published as the npm `latest` version, which was 1.208.0 until now. See the [migration guide](MIGRATION.md) for upgrading from 1.x or from a beta. + +### Added +- Symbols for the library's methods, exported from the package root: `received`, `didNotReceive`, `clearReceivedCalls`, `mimick`, `configure`, `returns`, `throws`, `resolves`, `rejects` and `mimicks`. They always mean the library's method, so they handle members with the same names, and they work when two copies of the package are installed. +- `sub[configure]()`: a view of a substitute in which every call and property read is a setup. Use it to change a call that is already configured, or to configure a mimicked substitute. A setup through a member or call that answers with a substitute goes to that substitute; through one that answers with a real value, it throws a `SubstituteException`. +- `sub[mimick](instance)`: hands everything that is not configured to a real instance. Calls are still recorded, and setups still win. +- `sub[clearReceivedCalls]()`: forgets the received calls of a substitute and its auto-substitutes, and keeps the setups. +- `SubstituteException` is exported from the package root, for `instanceof` checks. +- Auto-substitutes are cached, so nested setups and checks work at runtime: `app.getCalculator().add(1, 2).returns(99)` and `app.logger.received().info('hi')`. +- `Arg.all()` after other arguments matches the rest of the arguments, including none: `log('x', Arg.all())`. In TypeScript, this type-checks after up to 6 other arguments. +- Matchers inside plain objects and arrays, also nested ones: `repository.save({ id: Arg.any(), name: 'bob' }).returns('saved')`. `Arg.all()` as the last item of an array matches the remaining items. The search for them is bounded (arrays and objects with up to 1,024 items or keys, up to 32 levels deep, and up to 32,768 items and keys per argument), so large arguments stay fast, and an array or object with more than 256 items or keys that holds no matcher is searched only the first time it is passed. +- A native ES module entry point and an `exports` map, with typings for the `node16`, `nodenext` and `bundler` module resolutions. The ES module entry point shares one copy of the library with CommonJS. It is checked on every change with Node.js, Rollup with `@rollup/plugin-commonjs`, webpack, esbuild, a Vite SSR build with `ssr.noExternal` and vitest with `server.deps.inline` (also with `deps.interopDefault: false`). Bundles with CommonJS output that keep the package external load the CommonJS entry, so their default import is the exports object, and ts-node's ESM loader type-checks the default import against the CommonJS typings; use the named import `import { Substitute, Arg } from '@fluffy-spoon/substitute'` there (see the README, "Importing"). +- `console.log`, `util.inspect`, `String()` and `JSON.stringify()` show a substitute's setups and received calls, also those of its auto-substitutes, under their paths. An auto-substitute shows its path, such as `@Substitute.logger` or `@Substitute.getUser(1)`, and its own setups and calls. +- `new` on a substitute or on a member of it (`new sdk.Client('https://api')`, also through `Reflect.construct()`) is a call: it is recorded, setups written as calls answer it (`sdk.Client(Arg.any()).returns(client)`), and checks written as calls count it (`sdk.received(1).Client('https://api')`). In TypeScript, these setups and checks compile for constructor types and for members that are classes. +- `Arg.any('bigint')`. +- The public typings carry documentation comments for editors: `Substitute.for`, `SubstituteOf`, `Arg` and its matchers, the setup methods, the checks and the symbols. At `Arg.is.not(...)` and `Arg.any.not(...)`, editors show the documentation of the inverse matcher. +- A [migration guide](MIGRATION.md), this changelog and [contributing guidelines](CONTRIBUTING.md). The README examples are type-checked and run in CI, and the oldest supported TypeScript version is checked there, too. + +### Changed +- When several setups match a call, the most specific one wins: literal arguments, then matchers, then `Arg.all()` alone. Among setups of the same kind, the most recent one wins, and configuring the same call again replaces it. (The README said that the first matching setup wins.) +- A call with an argument matcher (`Arg.any`, `Arg.is`, `Arg.all`, also with `.not`, also inside an object or array) is always a setup or a check. It is never recorded as a received call and never runs an existing setup. +- The reads and calls that lead up to a setup or a check in the same expression, like `app.getCalculator()` in `app.getCalculator().add(1, 2).returns(99)`, are not recorded as received calls. Calls that the code under test made are kept, also when the test then configures or checks the value they returned. That includes calls through a method that the test handed to the code under test (`new UserService(api.getUser)`), which are made, and shown in failure messages, where the code under test invokes them, also with the substitute as `this` (`Reflect.apply(fetch, api, [id])`), and calls from a promise job (`Promise.resolve(id).then(getUser)`). +- Reading a method without calling it is no longer a call; method checks count invocations only. +- `.call()`, `.apply()` and `.bind()` on a substitute value also count as a call of a member called `call`, `apply` or `bind`, and a setup written through them configures that member. Failure messages and `String(sub)` show such a call once, as in `rpc(1) via .call('getUser', 1)`. +- A `mimicks()` function and a mimicked function get the `this` of the call: the substitute for `sub.method(...)`, and the first argument of `.call()` and `.apply()`. +- **JavaScript:** `sub.received(count)` or `sub.didNotReceive()` followed by `.returns()`, `.throws()`, `.resolves()`, `.rejects()` or `.mimicks()` configures a member of your own called `received` or `didNotReceive`. In 2.0.0-beta.4 and 1.x it was a check of a member called `returns` (and so on), so such checks now pass silently. Use the symbols: `sub[received](1).returns(5)`. +- **JavaScript:** `sub.received(count)` or `sub.didNotReceive()` followed directly by a call, like `listener.received(1)('saved')`, checks a call of the substitute itself. +- `received(count)` throws a `SubstituteException` unless the count is a non-negative integer (or left out). In 2.0.0-beta.4 an invalid count threw a plain `Error`, and in 1.x it was reported as a call count mismatch. `received(0)` is the same as `didNotReceive()`. +- `Arg.any('object')` matches objects, arrays and substitutes, but no longer `null`. `Arg.any('function')` matches substitutes, and `Arg.any('array')` uses `Array.isArray`. +- `Arg.is()` throws a `TypeError` right away when it is not given a function. A predicate that throws counts as a non-match, and the failure message says so. +- **JavaScript:** `Arg.any(type)` and `Arg.any.not(type)` throw a `TypeError` right away for a type name that they do not know, such as a typo. In 2.0.0-beta.4, `Arg.any('strnig')` matched nothing and `Arg.any.not('strnig')` matched every value. `mimicks()` with something other than a function throws a `TypeError` at the setup, naming the member, instead of failing later in the code under test. +- An argument that a call leaves out at the end counts as `undefined`, as in 1.x: it matches a literal `undefined` and matchers that accept `undefined` (`Arg.any()`, `Arg.any('undefined')`), and `f(1)` and `f(1, undefined)` are the same call. In 2.0.0-beta.4, an omitted argument matched nothing. So `didNotReceive().f(Arg.any())` now fails after `f()`, and a literal setup that a matcher setup already answers (`multiply(1).returns(1)` after `multiply(1, Arg.any()).returns(10)`) needs the `configure` view. +- An argument object that is changed after it was used in a setup only matches that setup when the same object is passed again; a new object equal to the changed one no longer does. (The library remembers the hash of an object with more than 256 keys, or of a `Map` or `Set` with more than 256 entries, between calls, but that never changes a result: an object that changed after an earlier call still matches a setup made with an equal object.) +- `Symbol.iterator`, `Symbol.asyncIterator`, `Symbol.hasInstance`, `Symbol.isConcatSpreadable`, `Symbol.match`, `Symbol.matchAll`, `Symbol.replace`, `Symbol.search`, `Symbol.split`, `Symbol.species`, `Symbol.toStringTag`, `Symbol.unscopables`, `util.promisify.custom` (also the running Node.js' own symbol, which differs on Node.js 10.0 to 12.16.1 and 13.0 to 13.11), `asymmetricMatch` and `__esModule` read as `undefined` unless they are configured, and these reads are not recorded. So a substitute is no longer iterable: `[...sub]` and `for...of` throw a `TypeError` (2.0.0-beta.4 iterated it as empty), and a substitute that stands in for a whole module is its own default export (it was the auto-substitute `sub.default`). +- A substitute no longer exposes internal fields: `Object.keys(sub)` and `Reflect.ownKeys(sub)` are empty. +- `key in sub` is `true` for a key with a setup, a key of a mimicked instance and a property defined with `Object.defineProperty()`, and `false` otherwise; it records nothing. In 2.0.0-beta.4 it answered for the library's internal function (`true` for `call` and `length`, `false` for configured members). +- Failure messages say what kind of call was expected: method calls, property reads, property assignments, or "property reads or method calls" when that is not known. They show the path of nested substitutes, also for an auto-substitute passed as an argument (`@Substitute.child`), show a call made with `new` as `new Client(...)`, and list at most 50 received calls. When the checked member was never used at all, the message cannot name the expected arguments; once the method has been called, it does. A method that was only read, never called, gets a hint that reading is not calling. Messages contain ANSI colours only when the output is a terminal, and honour `NO_COLOR`, `FORCE_COLOR`, `NODE_DISABLE_COLORS` and `TERM=dumb`. +- Failed checks throw right away. Only a property-style check (`sub.received(2).member` or `sub.didNotReceive().member`, not followed by a call) on a member that was called as a method can be reported later, from a microtask (see the README). Such a report uses the `queueMicrotask` that the library found when it was loaded (`process.nextTick` on Node.js 10). 2.0.0-beta.4 used `process.nextTick`, from which jest cannot attribute an exception to a test; jest now reports the failure of the running test (jest 30 on Node.js 22: of the test file). mocha and ava cannot tie such a failure to a test: mocha stops the run after that test, and ava ends the worker of that test file (see the README, "Assertions that fail later"). +- With "pause on caught exceptions" on, a debugger stops inside the library (twice for each step of a chain such as `app.repo.users.find(1)`) where `Error.prepareStackTrace` is not a function: on Node.js before 20.20 without an installed formatter, and in `vm` contexts such as jest 30's test environment and vitest's `vm` pools (2.0.0-beta.4 did not stop there). Add `**/node_modules/@fluffy-spoon/substitute/**` to the debugger's `skipFiles` (see the README, "Debuggers"). +- TypeScript: on a type with a member called `received`, `didNotReceive`, `returns`, `throws`, `resolves`, `rejects` or `mimicks`, only the symbol forms `sub[received]()` and `sub[didNotReceive]()` are offered. In generic code, the type parameter's constraint decides; an unconstrained `SubstituteOf` offers the string forms. `.returns()` and the other setup methods are offered unless the configured value has its own member with that name. +- TypeScript: a member called `then` is typed `never`, because substitutes are never thenables. +- TypeScript: members typed only `null` or `undefined` keep their plain type and have no setup API (configure them through `sub[configure]()`). +- TypeScript: `Arg.any('function')` is typed as any function or class, so it fits typed callback parameters. `Arg.any('object')` is typed `any`. +- TypeScript: `Arg.any('undefined')` only fits parameters and properties that accept `undefined`. It was typed `never`, which fit every parameter (`calculator.add(Arg.any('undefined'), 2)` compiled). `Arg.any.not('undefined')` fits any parameter. +- The minimum TypeScript version is 3.6 (2.0.0-beta.4 needed 3.8). The package runs on Node.js 10 and newer with CommonJS. As an ES module, it needs Node.js 12.17 or newer on 12.x, 13.7 or newer on 13.x, or 14 or newer. +- Because of the new ES module entry point, CommonJS code that `require()`s the package and is bundled with Rollup's `@rollup/plugin-commonjs` while the package stays external (also in the SSR builds of Vite 7 and older) gets the `Substitute` class from `require()`, unless the plugin's `esmExternals` option covers the package or the package is bundled. See the README, "Importing". +- Releases are published to npm with provenance: stable versions as `latest`, prereleases as `beta`. + +### Fixed +- Configuring a call whose arguments overlap an existing setup ran that setup instead. It failed with `TypeError: ... returns is not a function`, or silently configured the wrong thing. This broke the README's "Match order" and "Partial mocks" examples. +- Checking a configured property ran its setup: it threw the configured error, used up values of a `returns()` sequence, ran `mimicks()` again or left an unhandled rejection. +- Calls through a stored or destructured method reference, or a callback, were recorded only once. +- Merely reading a method (for example to register it as a callback) satisfied `received().method(...)`. +- `.call()`, `.apply()` and `.bind()` on a configured method, on a function substitute, on the result of a call or on a nested member returned a proxy instead of the configured value, so a function substitute called through a helper like `once(fn)`, which calls `fn.apply(this, args)`, did not return its configured value. +- A setup on the substitute leaked into nested members with the same name, and nested checks (`app.logger.received().info('hi')`) passed whatever had been called. +- `sub.didNotReceive().method` without the call parentheses passed silently when the method had been called. It is now reported (see above). +- `Arg.all()` after other arguments ignored those arguments. +- Every call scanned all earlier calls, which made large tests slow. 10,000 calls now take well under a second, also with arguments such as nested objects, objects with cycles, errors, long arrays, `Buffer`s, long strings, or wide objects and `Map`s that many values share or that are passed with every call: 10,000 calls that each pass one table with 10,000 keys take about 0.1 seconds on Node.js 22. +- A failed check overflowed the stack when substitutes referred to each other through their arguments, and threw a `TypeError` with `Error.stackTraceLimit = 0`. The library also works with a read-only, getter-only, frozen (`Object.freeze(Error)`) or deleted `Error.stackTraceLimit`, and leaves the property as it is (in the development builds after 2.0.0-beta.4, the first three made every operation throw a `TypeError`). Where V8 collects no stack frames (a limit that is 0, missing, not a number or an accessor), the library captures none either; with a frozen `Error` it cannot read them. Then position alone decides which calls lead to a setup or a check (see the README). +- An exception thrown by an `Arg.is()` predicate escaped into the code under test. +- `Object.freeze()`, `Object.seal()` and `Object.preventExtensions()` broke a substitute: later reads and setups threw a `TypeError`. `Object.defineProperty()` on a substitute threw a `TypeError`; it now defines a real property, which reads return without recording them. +- Failure messages said "property calls" when the library could not know whether a method or a property was checked. +- A check reported later was lost when a test had installed fake timers that fake `process.nextTick`. Fake timers installed after the library is loaded no longer delay or swallow such a report. +- `[].concat(sub)` dropped the substitute, `value instanceof sub.SomeClass` was always `true`, `'text'.startsWith(sub.prefix)` threw, and `util.promisify(sub.method)` did not call the substitute. +- jest took every substitute for an asymmetric matcher: `expect(fn).toHaveBeenCalledWith(sub)` and `toContainEqual(sub)` passed whatever the values were, and a failing `toEqual(sub)` threw jest's internal "Unexpected return from a matcher function" error. +- TypeScript: optional members; named members next to an index signature; overloads without parameters; methods with more than 5 overloads; `.throws()` on methods returning `never`; `(...args: unknown[])` methods; a private member called `received` turning the substitute type into `never`; types with a very large union of string literals, such as lib.dom's `HTMLInputElement`, failing with "Expression produces a union type that is too complex to represent". +- TypeScript: a substitute of a function type or of an interface with call signatures had no setup or check API for its own calls. `listener('saved').returns('ack')`, `listener.received(1)('saved')`, `listener[received](1)('saved')` and `listener[configure]()('saved').returns('ack')` now compile. +- TypeScript: in generic code over a constrained type parameter (`(sub: SubstituteOf)`, or `Substitute.for()` in a fixture class), call setups (`sub.add(1, 2).returns(3)`) and property checks (`sub.received().total = 1`) did not compile. Setups, checks and the new `configure` view now work through the constraint, also for keys that exist only through the constraint's string index signature (with exceptions, most of them on TypeScript older than 4.8; see the README, "Typing limitations"). +- TypeScript: on a member whose type is a union of function types with different return types (`onResult: ((r: string) => number) | ((r: string) => string)`), and on methods of a union whose return types differ and that return a promise or `this` (`Substitute.for()`), `.returns()` or `.resolves()` took `never`, and calls of a substitute of a union of function types had no setup API. They now take the union of the variants' return types: `pet.load().resolves(1)` and `pet.load().resolves('x')` for `Promise | Promise`. +- TypeScript: on a method that the variants of a union declare with different parameter lists (an extra optional parameter, other parameter types, other overloads), such as `read(path): string` and `read(path, encoding?): Uint8Array` in `Substitute.for()`, `.returns()` was missing or took `never` when the return types differ, and on TypeScript 5.4 and newer it was missing even when they are the same (`fetch(url)` and `fetch(url, options?)`, both returning `Promise`). Such methods now have the setup API, which takes the return types of the variants that the call can reach, depending on the number of arguments it passes (see the README, "Typing limitations", for the exact rule). +- TypeScript: a union whose variants declare a member as only `null` or `undefined`, like `{ data: string[]; error: null } | { data: null; error: Error }`, turned the substitute into `never`. +- TypeScript: on a union whose variants have a string index signature (`{ kind: 'a'; [key: string]: unknown; speak(): 'meow' } | ...`), `.returns()` was missing or took `never`. It now takes the union of the variants' return types, as for other unions. +- Under native ES modules, the default import was the CommonJS module object, so `Substitute.for` was not a function. +- The package could not be loaded on Node.js versions before 14.18. +- A manual `npm publish` after `npm test` could publish a package without its entry point. + +### Removed +- `Substitute.disableFor()`. Call members with conflicting names directly, and use the symbols for the library's methods. +- `sub.clearSubstitute(clearType)` and the `ClearType` export. Use `sub[clearReceivedCalls]()`, or create a new substitute to drop setups. +- The string `sub.mimick(instance)`. Use `sub[mimick](instance)`; `mimick` is now an ordinary member name. +- The deep import paths of 1.x (`dist/src/...`) and of the 2.0.0 betas (`dist/Substitute`, `dist/Arguments`, `dist/SubstituteException`, and internals such as `dist/SubstituteNode`, `dist/Recorder` and `dist/RecordsSet`). Import from the package root. Directory deep imports (`.../dist/api`) no longer resolve on Node.js versions that read `exports`. +- The GitHub Packages publishing job, which could not publish the `@fluffy-spoon` scope. + +## [2.0.0-beta.4] - 2024-03-21 +### Changed +- Failure messages list the received calls with the place each call was made, and mark the ones that matched ([#281](https://github.com/ffMathy/FluffySpoon.JavaScript.Testing.Faking/pull/281)). + +## [2.0.0-beta.3] - 2024-03-08 +### Added +- Members used both as a property and as a method (callable interfaces) can be configured and checked in both ways ([#248](https://github.com/ffMathy/FluffySpoon.JavaScript.Testing.Faking/pull/248)). +- Compatibility checks with the ava, jest, mocha, node:test and vitest test runners. + +### Changed +- Tested on Node.js 18 and the current LTS versions; Node.js 10 was dropped from the test matrix ([#245](https://github.com/ffMathy/FluffySpoon.JavaScript.Testing.Faking/pull/245)). + +## [2.0.0-beta.2] - 2022-10-09 +### Added +- The `ClearType` export, with the values for `clearSubstitute()` (`ClearType.receivedCalls`, ...). + +### Changed +- The core was simplified ([#243](https://github.com/ffMathy/FluffySpoon.JavaScript.Testing.Faking/pull/243)). +- `strict` mode, including `strictNullChecks`, is supported; it no longer needs to be turned off ([#244](https://github.com/ffMathy/FluffySpoon.JavaScript.Testing.Faking/pull/244)). + +### Fixed +- Typings for TypeScript versions before 4.6. + +## [2.0.0-beta.1] - 2022-06-02 +The version 2 rework ([#139](https://github.com/ffMathy/FluffySpoon.JavaScript.Testing.Faking/pull/139)) was merged, with the same features as 2.0.0-beta.0. + +## [2.0.0-beta.0] - 2021-10-24 +### Added +- `sub.clearSubstitute(clearType)` with `ClearType` `'all'`, `'receivedCalls'` or `'substituteValues'` ([#233](https://github.com/ffMathy/FluffySpoon.JavaScript.Testing.Faking/pull/233), [#46](https://github.com/ffMathy/FluffySpoon.JavaScript.Testing.Faking/issues/46)). + +### Changed +- The substitution logic was rewritten ([#139](https://github.com/ffMathy/FluffySpoon.JavaScript.Testing.Faking/pull/139), [#232](https://github.com/ffMathy/FluffySpoon.JavaScript.Testing.Faking/pull/232)). +- After a sequence of values (`returns(1, 2, 3)`), the last value repeats. Version 1 returned `undefined`. + +## 1.x +Version 1 has no changelog. See the [GitHub releases](https://github.com/ffMathy/FluffySpoon.JavaScript.Testing.Faking/releases) and the [1.208.0 README](https://github.com/ffMathy/FluffySpoon.JavaScript.Testing.Faking/tree/v1.208.0#readme). + +[2.0.1]: https://github.com/ffMathy/FluffySpoon.JavaScript.Testing.Faking/compare/v2.0.0-beta.4...v2.0.1 +[2.0.0-beta.4]: https://github.com/ffMathy/FluffySpoon.JavaScript.Testing.Faking/compare/v2.0.0-beta.3...v2.0.0-beta.4 +[2.0.0-beta.3]: https://github.com/ffMathy/FluffySpoon.JavaScript.Testing.Faking/compare/v2.0.0-beta.2...v2.0.0-beta.3 +[2.0.0-beta.2]: https://github.com/ffMathy/FluffySpoon.JavaScript.Testing.Faking/compare/v2.0.0-beta.1...v2.0.0-beta.2 +[2.0.0-beta.1]: https://github.com/ffMathy/FluffySpoon.JavaScript.Testing.Faking/compare/v2.0.0-beta.0...v2.0.0-beta.1 +[2.0.0-beta.0]: https://github.com/ffMathy/FluffySpoon.JavaScript.Testing.Faking/compare/v1.208.0...v2.0.0-beta.0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..c85fd5a --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,257 @@ +# Contributing to @fluffy-spoon/substitute + +Thanks for helping out! This document describes the development workflow: how to build and test the +library, how the packaging checks work, and how a release is published. + +Bug reports and feature requests go to the [issue tracker](https://github.com/ffMathy/FluffySpoon.JavaScript.Testing.Faking/issues). +Please include a small snippet that reproduces the problem, your TypeScript and Node.js versions, your module +system (CommonJS, native ESM or a bundler) and your test runner. + +## Prerequisites + +- Node.js: the version pinned in `package.json` under `volta` (currently 24.x). If you use [Volta](https://volta.sh) + it is picked automatically. Any supported LTS line (22, 24 or 26) works for development. +- npm (comes with Node.js). + +The published package itself supports much older Node.js versions than the development tooling. See +`engines.node` in `package.json`; CI smoke-tests the packed package on exactly that version. + +## Install + +```sh +npm ci +``` + +## Project layout + +| Path | What it is | +| --- | --- | +| `src/` | The library source (TypeScript). `src/index.ts` is the public entry point. | +| `spec/` | The runtime specs, run with [ava](https://github.com/avajs/ava). | +| `spec-types/` | Type-level tests of the public typings (`npm run test:types`), and `spec-types/min-ts/`, which checks the built typings with the oldest supported TypeScript (`npm run test:types:min-ts`). | +| `spec-docs/` | The documentation check (`npm run test:docs`): it type-checks and runs the code examples of the README, MIGRATION and CHANGELOG. See [spec-docs/README.md](spec-docs/README.md). | +| `packaging/` | Packaging checks (run as part of `npm test`), the ES module wrapper generator and the smoke tests. | +| `compatibility-checks/` | A separate npm project that checks the packed package with ava, jest, mocha, node:test and vitest, and bundles it with Rollup, webpack, esbuild and Vite. | +| `dist/` | Build output that gets published (generated, not committed). | +| `dist-spec/` | Compiled specs used by `npm test` (generated, not committed). | + +## Build + +```sh +npm run build +``` + +This compiles `src/` into `dist/` with `tsc` (CommonJS plus `.d.ts` typings) and then runs +`packaging/build-esm.js`, which generates the native ES module entry point next to it: + +- `dist/index.mjs` re-exports every export of `dist/index.js`, plus the default export. It wraps the CommonJS + build instead of being a second copy, so CommonJS and ESM consumers share one module instance. Tools disagree + about what a default import of a CommonJS module that sets `__esModule` is: Node.js, webpack and esbuild give + `module.exports`, while Rollup's commonjs plugin, Vite SSR and vitest with inlined dependencies give + `exports.default`, and vitest with inlined dependencies and `deps.interopDefault: false` gives an object + without the named exports (with a namespace whose `default` is that object). The wrapper therefore imports + both the default and the namespace of `dist/index.js` and uses whichever one holds every named export with the + type it has at build time; it throws at import time if neither does. Its own default export is the named export + `Substitute` (the default export of `dist/index.js`, found at build time), whatever the `default` of the view it + reads from is. A packaging test simulates each of these interop shapes, and the compatibility checks bundle the + package with the real tools. +- `dist/index.d.mts` holds the matching typings for TypeScript's `node16`, `nodenext` and `bundler` resolution. + +The `exports` map in `package.json` sends `import` to the ES module entry and everything else (`require`, older +resolvers) to the CommonJS entry. `exports["."]` is an array: the conditions object comes first, and the plain +CommonJS entry `./dist/index.js` follows as a fallback for Node.js 13.0 and 13.1, which read `exports` but do not +understand conditions (without the fallback, `require` fails there). `main` and `types` are kept for resolvers that +do not read `exports`. + +The package supports Node.js 10 and newer with `require`. The ES module entry needs Node.js 12.17 or newer on 12.x, +or 13.7 or newer (13.2 to 13.6 have ES modules but not the `import` condition, so `import` gets the CommonJS entry +and named imports fail there). + +Deep imports of compiled files (`@fluffy-spoon/substitute/dist/...`) stay available through the `./dist/*` +subpaths, but they are not public API. Both forms, with and without `.js`, work on Node.js versions that ignore +`exports` (older than 12.17) and on versions with subpath patterns and pattern trailers (14.19 or newer on 14.x, +16.9 or newer). Deep imports fail on 12.17 to 12.19, all of 13.x and 14.0 to 14.12; on 12.20 to 12.22, 14.13 to +14.18 and 16.0 to 16.8 (subpath patterns without trailers), only the form without `.js` works. MIGRATION.md says the +same. `packaging/smoke/deep-import-support.js` holds this table, and `packaging/smoke/deep-imports.js` checks it +on the Node.js version it runs on. + +## Test + +```sh +npm test +``` + +`npm test` runs `npm run build:spec`, which compiles the specs together with the sources they import into +`dist-spec/`, and then ava. It never writes into `dist/`, so running the tests (or interrupting them) cannot +leave a broken or missing `dist/` behind for publishing or for `npm link`. + +ava runs two groups of tests: + +- `spec/**/*.spec.ts` and `spec/**/*.test.ts`: the runtime behaviour of the library. +- `packaging/**/*.test.js`: packaging and release checks. They work on a temporary copy of the repository: the + working tree as it is on disk (uncommitted changes included), without `dist/`, `dist-spec/`, `.git`, other + dot-directories and `node_modules/` (the copy links to the repository's `node_modules/`). They put a stale + `dist/` into the copy and pack it exactly like `npm publish` does, which rebuilds `dist/` there through the + `prepack` script. They extract the tarball into a fresh consumer project and check it there: the tarball + contents, `require` and native `import` (including the default import), deep imports, the ES module entry under + each way that tools turn its CommonJS build into an ES module, TypeScript resolution in `node10`, `node16`, + `nodenext` and `bundler` mode, and the consistency of `package.json`, `package-lock.json` and the workflows. + The temporary directories are removed afterwards. + +No test leaves files in the temporary directory (`os.tmpdir()`). A run leaves only Node.js' module compile cache there +(`node-compile-cache/`, written when npm, npx or tsc start Node.js) and one empty directory that ava itself creates. + +To run a single file or test, use ava's options after building the specs, for example: + +```sh +npm run build:spec && npx ava spec/regression/returns.spec.ts --match '*order*' +``` + +### Type tests + +```sh +npm run test:types +``` + +Type-level tests in `spec-types/` check the public typings with the TypeScript compiler of this repository +(`spec-types/` with `strict`, `spec-types/loose/` without). CI runs them with `npm run test:types --if-present`. + +### Oldest supported TypeScript + +```sh +npm run test:types:min-ts +``` + +The README promises TypeScript 3.6 or newer. This builds `dist/` and type-checks `spec-types/min-ts/consumer.ts` +against the built typings (resolved through `package.json` like an installed copy) with TypeScript 3.6, with +`skipLibCheck` off and on. TypeScript 3.6 is installed on the fly with `npx`, so this needs access to the npm +registry. To check other versions after `npm run build`, pass them explicitly: +`node spec-types/min-ts/check.js 3.9 4.0 4.4`. Keep `consumer.ts` to code that TypeScript 3.6 can parse (no +`@ts-expect-error`, for example). If a change makes the typings need a newer TypeScript, that is a breaking change: +raise `MINIMUM_TYPESCRIPT_VERSION` in `spec-types/min-ts/check.js` and the documented minimum together. +Afterwards the same script runs `spec-types/TD-10.T32.jsdoc.js`, which uses the TypeScript of this repository to +check that the public API in the built typings carries documentation comments (editor quick info). It fails when +one of them is missing. + +### Documentation examples + +```sh +npm run test:docs +``` + +This builds `dist/` and checks every code example in `README.md`, `MIGRATION.md` and `CHANGELOG.md`: TypeScript +examples are type-checked against the built package and run, JavaScript examples are run, and their +`// prints ...` and `// throws ...` comments must hold. Relative links and `#anchors` must resolve. It then runs a +self-test against deliberately broken fixtures. A change to the library's behaviour or typings that breaks a +documented example fails this check, so update the example in the same change. How to write checked examples, +and the directives that mark blocks (`compile-only`, `esm`, `skip`, ...), are described in +[spec-docs/README.md](spec-docs/README.md). + +### Compatibility checks + +`compatibility-checks/` is a separate npm project with its own dependencies. It runs against the packed package, +not against `src/`, and checks two things: + +- `test/index.ts`: every supported test runner (ava, jest, mocha, node:test, vitest, and vitest with the package + inlined through `vitest.inline.config.mts`) reports a failing Substitute assertion, including one that is thrown + after the test function has returned. It also runs `test-runners/jest-matchers/` (`npm run validate:jest-matchers`), + which must pass: substitutes used inside jest matchers compare by identity, so a non-matching + `expect(fn).toHaveBeenCalledWith(substitute)` fails and `expect(42).toEqual(substitute)` fails with jest's normal + assertion error. +- `test/bundlers.ts`: `bundlers/entry.mjs` is bundled with Rollup and `@rollup/plugin-commonjs`, webpack, esbuild + (CommonJS and ES module output) and a Vite SSR build with `ssr.noExternal`, and each bundle is run with Node.js. + The default, named and namespace imports must be the real exports. vitest with `server.deps.inline` runs + `test-runners/vitest-inline/exports.test.ts`, which checks the same, once with `vitest.inline.config.mts` and + once with `vitest.inline-no-interop-default.config.mts`, which also sets `deps.interopDefault: false`. + It also bundles `bundlers/require-entry.mjs`, which imports CommonJS code that `require()`s the package + (`bundlers/require-helper.cjs`). With `@rollup/plugin-commonjs` on default options and the package kept external, + that `require()` gets the `Substitute` class instead of the exports object (Vite 7 and older SSR builds do the + same, since they externalize dependencies). README "Importing" and MIGRATION "Imports and packaging" document + this and its workarounds, and the check makes sure each of them gives the exports object: + `commonjs({ esmExternals: true })`, `commonjs({ esmExternals: ['@fluffy-spoon/substitute'] })`, bundling the + package, Vite's `ssr.noExternal: ['@fluffy-spoon/substitute']`, and the default externals of the Vite version + in use (Vite 8 bundles with Rolldown and is not affected). It also checks that the caveat itself still holds, + so the documentation is updated when the tools change. + Finally, it bundles ES module code into CommonJS output with the package kept external: Rollup with + `output.format: 'cjs'`, esbuild with `format: 'cjs'` and `packages: 'external'`, webpack with a `commonjs` + external, and a Vite SSR build with `output.format: 'cjs'`. Such a bundle `require()`s the package at run time, + and its default import follows Node.js's CommonJS interop: it is the exports object, not the `Substitute` class + (with Rollup for every source; with esbuild, webpack and Rolldown, which Vite 8 uses, for `.mjs` sources and + sources in a `"type": "module"` package). README "Importing" and MIGRATION "Imports and packaging" recommend the + named import there. The check bundles `bundlers/named-entry.mjs`, which uses only the named import, with each of + them; bundles `bundlers/entry.mjs` with Rollup's `output.interop: 'auto'`, which makes the default import work; + and checks that the caveat itself still holds for `bundlers/entry.mjs` with each of them. + Bundles that keep the package external are written to `node_modules/.substitute-bundles/` there, where Node.js can + resolve the installed package, and removed afterwards. + +Run them with: + +```sh +cd compatibility-checks +npm ci +npm test +``` + +`npm test` there first runs `npm run install:local`, which packs the repository root like `npm publish` +(building `dist/` on the way) and installs the tarball with `npm install --no-save`, so neither `package.json` +nor `package-lock.json` of the compatibility checks changes. From the repository root, `npm run test:compat` +does the same once the compatibility check dependencies are installed. + +To try a single runner by hand after `npm run install:local`, use `npm run validate:` (`ava`, `jest`, +`mocha`, `nodejs`, `vitest` or `vitest-inline`). Each of them is expected to fail with exactly one failing test. +`npm run validate:jest-matchers` is the exception: it is expected to pass. + +## Continuous integration + +`.github/workflows/nodejs.yml` runs on every push and pull request: + +- **test**: `npm ci`, `npm run build`, `npm test`, `npm run test:types --if-present` and `npm run test:docs` on + every supported Node.js LTS line (22, 24 and 26). +- **types-min-ts**: `npm run test:types:min-ts`, the built typings with the oldest supported TypeScript (3.6) and + the documentation comments of the public API, on the development Node.js version. +- **compatibility**: the compatibility checks against the packed package on the same Node.js versions. +- **minimum-node**: packs the package and smoke-tests it (`packaging/smoke/`) on the oldest supported Node.js + version (`MINIMUM_NODE_VERSION`, which must equal `engines.node`), on the oldest version with native ES + modules (`MINIMUM_ESM_NODE_VERSION`, 12.17.0), on 13.0.0 (`EXPORTS_FALLBACK_NODE_VERSION`, which only loads the + package through the `exports["."]` fallback) and on 13.7.0 (`MINIMUM_ESM_NODE_13_VERSION`, the oldest 13.x with + the `import` condition). On each of them, `deep-imports.js` also checks that deep imports work or fail as + described under [Build](#build). If a change needs a newer Node.js, raise `engines.node` and + `MINIMUM_NODE_VERSION` together; a packaging test checks that they match. + +`.github/workflows/codeql-analysis.yml` runs CodeQL on pushes and pull requests to `master` and weekly. + +## Releasing + +Releases are published to npm by `.github/workflows/npm-publish.yml` when a GitHub release is published. + +1. Bump the version with npm, which updates `package.json` and `package-lock.json` together and creates the + matching git tag: + + ```sh + npm version 2.0.2 # or: npm version patch | minor | major + npm version 2.1.0-beta.1 # a prerelease + ``` + +2. Push the commit and the tag: `git push --follow-tags`. +3. Create a GitHub release for that tag (for example `v2.0.2`) and publish it. A draft does nothing until it is + published. + +The publish workflow then: + +1. runs the complete CI workflow above (tests, type tests, compatibility checks and the oldest Node.js versions); +2. checks that the release tag matches the `package.json` version (`v2.0.2` or `2.0.2` for version 2.0.2) and + stops otherwise; +3. picks the npm dist-tag with `packaging/dist-tag.js`: `latest` for a stable version such as 2.0.1, `beta` for a + prerelease version such as 2.1.0-beta.1 or for a release that is marked as a prerelease on GitHub; +4. runs `npm publish --provenance --access public --tag `. The `prepack` script rebuilds `dist/` from + scratch first. + +Publishing uses the `NPM_PUBLISH_TOKEN` repository secret (a granular npm access token with publish rights for +`@fluffy-spoon/substitute`). The job also has the `id-token: write` permission, so npm attaches a provenance +statement, and npm's trusted publishing works once it is configured for this repository on npmjs.com. + +The package is only published to npm. GitHub Packages is not used: it only accepts npm packages whose scope +is the repository owner (`@ffmathy`), so it cannot host `@fluffy-spoon/substitute`. + +Never publish by hand from a working copy unless you have to. If you do, `npm publish` still runs `prepack`, +so the published `dist/` is always a fresh build. diff --git a/MIGRATION.md b/MIGRATION.md new file mode 100644 index 0000000..83389f5 --- /dev/null +++ b/MIGRATION.md @@ -0,0 +1,516 @@ +# Migration guide +This guide covers upgrading to 2.0.1 from 1.x (1.208.0 and older) and from the 2.0.0 betas (2.0.0-beta.0 to 2.0.0-beta.4). 2.0.1 is the first stable release of version 2; there was no 2.0.0 release. The [README](README.md) describes the 2.x API, and the [changelog](CHANGELOG.md) lists every change. + +Each section says which versions it applies to. Code marked "Before" is for the old version and is not valid 2.x code. + +- [Installing: `latest` is now 2.x](#installing-latest-is-now-2x) +- [Requirements](#requirements) +- [Removed APIs](#removed-apis): [`Substitute.disableFor`](#substitutedisablefor), [`clearSubstitute` and `ClearType`](#clearsubstitute-and-cleartype), [string `mimick(instance)`](#the-string-mimickinstance) +- [Names that conflict with the library: the symbol API](#names-that-conflict-with-the-library-the-symbol-api) +- [Behaviour changes](#behaviour-changes): [sequences](#sequences-repeat-the-last-value), [auto-substitutes](#auto-substitutes-and-nested-checks), [matcher calls](#calls-with-argument-matchers-are-setups), [match order](#match-order), [re-configuring](#re-configuring-a-call), [what counts as a call](#what-counts-as-a-call), [`new`](#new-is-a-call), [checks](#checks-never-run-setups), [`received(count)`](#receivedcount-is-validated), [checks that fail later](#checks-that-fail-later), [matchers](#matchers), [argument comparison](#how-arguments-are-compared), [omitted arguments](#omitted-arguments), [`this` in `mimicks()`](#this-in-mimicks), [protocol members](#protocol-members-read-as-undefined), [freezing and `in`](#freezing-defined-properties-and-in), [messages](#messages), [printing](#printing) +- [Imports and packaging](#imports-and-packaging) +- [TypeScript](#typescript) + +The examples use this interface: + + +```typescript +import { Substitute, Arg } from '@fluffy-spoon/substitute' + +interface Calculator { + add(a: number, b: number): number + subtract(a: number, b: number): number + isEnabled: boolean +} + +const calculator = Substitute.for() +``` + +## Installing: `latest` is now 2.x +*Applies to: everyone.* + +Up to 2.0.1, the npm `latest` tag pointed at 1.208.0, and the betas were published under `beta`. From 2.0.1 on, `latest` is version 2, so a plain `npm install @fluffy-spoon/substitute` (or a `"latest"` / `"*"` version range) now installs 2.x with the breaking changes below. A `^1` range in package.json (like `^1.208.0`) keeps you on 1.x. To stay on version 1 explicitly: + +```sh +npm install @fluffy-spoon/substitute@1 --save-dev +``` + +Prereleases are still published under the `beta` tag. + +## Requirements +*Applies to: everyone.* + +* Node.js 10 or newer for CommonJS (`require`). +* For the native ES module entry point (`import`): Node.js 12.17 or newer on 12.x, 13.7 or newer on 13.x, or 14 or newer. On 13.2 to 13.6, `import` gets the CommonJS entry and named imports fail; use `require` there. +* TypeScript 3.6 or newer. The 1.x README said TypeScript 3.0; 2.0.0-beta.4 needed 3.8. +* `strict` mode, including `strictNullChecks`, is supported. The 1.x README told you to turn `strictNullChecks` off; that is no longer needed. + +## Removed APIs +### `Substitute.disableFor` +*Applies to: 1.x and the betas.* + +`Substitute.disableFor(sub)` returned a view of the substitute in which `received`, `didNotReceive` and `mimick` were not the library's methods. It was used to call a member of your own with one of these names, for example in a test that wants to record such a call before checking it. It is gone, because it is no longer needed: + +* A member of your own called `received` or `didNotReceive` is called as usual: `fake.received(1337)`. +* The library's checks have symbols that never conflict: `fake[received]()`, `fake[didNotReceive]()`. +* `mimick` is never the library's method any more (see below), so a member called `mimick` is an ordinary member. + +Before: + + +```typescript +const fake = Substitute.for() +Substitute.disableFor(fake).received(1337) +fake.received().received(1337) +``` + +After: + +```typescript +import { Substitute, received } from '@fluffy-spoon/substitute' + +class Example { + received(someNumber: number) { + return someNumber + } +} + +const fake = Substitute.for() +fake.received(1337) // the class' own method, like the code under test would call it +fake[received]().received(1337) + +// configuring the member works, too +fake.received(1).returns(2) +console.log(fake.received(1)) // prints 2 +``` + +In TypeScript, `fake.received()` is the class' own method here, so the string check is not offered for this type at all. In JavaScript, the library decides by how the name is used; see [Names that conflict with the library](README.md#names-that-conflict-with-the-library). If the code under test reads a member of what its own `received(...)` returns, configure that call with `.returns(...)`, so it returns your value instead of a substitute. + +### `clearSubstitute` and `ClearType` +*Applies to: the betas.* + +`sub.clearSubstitute(clearType?)` and the `ClearType` export were removed. What replaces them: + +| Before | After | +|---|---| +| `sub.clearSubstitute(ClearType.receivedCalls)` or `sub.clearSubstitute('receivedCalls')` | `sub[clearReceivedCalls]()` | +| `sub.clearSubstitute(ClearType.substituteValues)` or `sub.clearSubstitute('substituteValues')` | create a new substitute | +| `sub.clearSubstitute()` / `sub.clearSubstitute(ClearType.all)` | create a new substitute | + +`[clearReceivedCalls]()` forgets the received calls of the substitute and its auto-substitutes, and keeps every setup. There is no way to remove setups from a substitute: create the substitute in each test (for example in a `beforeEach` hook) instead of clearing a shared one. + +Before: + + +```typescript +import { Substitute, ClearType } from '@fluffy-spoon/substitute' + +calculator.add(1, 2) +calculator.clearSubstitute(ClearType.receivedCalls) +calculator.didNotReceive().add(1, 2) +``` + +After: + + +```typescript +import { clearReceivedCalls } from '@fluffy-spoon/substitute' + +calculator.add(1, 2).returns(3) +calculator.add(1, 2) +calculator[clearReceivedCalls]() +calculator.didNotReceive().add(1, 2) +console.log(calculator.add(1, 2)) // prints 3 +``` + +TypeScript reports the old calls as errors. **In JavaScript they fail silently:** `sub.clearSubstitute()` and `sub.clearReceivedCalls()` are now ordinary member calls that clear nothing, and `ClearType` is `undefined`. Search your tests for `clearSubstitute`, `clearReceivedCalls(` and `ClearType`. + +### The string `mimick(instance)` +*Applies to: 1.x and the betas.* + +`sub.mimick(instance)` was typed, but did nothing in 1.x and threw "Mimick is not implemented yet" in 2.0.0-beta.4. It is replaced by the symbol `sub[mimick](instance)`, which works: everything that is not configured is handed to the instance, and the calls are still recorded. The string `mimick` is now an ordinary member. + +Before: + + +```typescript +calculator.mimick(new RealCalculator()) +``` + +After: + + +```typescript +import { mimick } from '@fluffy-spoon/substitute' + +class RealCalculator implements Calculator { + isEnabled = true + add(a: number, b: number) { return a + b } + subtract(a: number, b: number) { return a - b } +} + +calculator[mimick](new RealCalculator()) +console.log(calculator.add(2, 3)) // prints 5 +calculator.received().add(2, 3) +``` + +To configure members of a mimicked substitute, use [`sub[configure]()`](README.md#re-configuring-a-call-configure). + +## Names that conflict with the library: the symbol API +*Applies to: 1.x and the betas (the symbols are new in 2.0.1).* + +The package exports symbols for its methods: `received`, `didNotReceive`, `clearReceivedCalls`, `mimick`, `configure`, `returns`, `throws`, `resolves`, `rejects` and `mimicks`. They always mean the library's method, so they are the way to handle members with the same names as the library's methods. + +* `clearReceivedCalls`, `mimick` and `configure` exist **only** as symbols. +* In TypeScript, if a type has a member called `received`, `didNotReceive`, `returns`, `throws`, `resolves`, `rejects` or `mimicks`, its substitute offers only `sub[received]()` and `sub[didNotReceive]()`. Code that used the string forms on such a type no longer compiles. +* `.returns()`, `.throws()`, `.mimicks()`, `.resolves()` and `.rejects()` are not offered on a value that has its own member with that name. Use `[returns]` and so on there. +* **In JavaScript, a string check of a member called `returns`, `throws`, `resolves`, `rejects` or `mimicks` is now a setup, and passes silently.** In 1.x and the betas, `sub.received(1).returns(5)` was a check of a member called `returns`. Now `sub.received(1)` followed by `.returns(...)` configures a member of your own called `received` (see [Names that conflict with the library](README.md#in-javascript)). Search your tests for `received(...).returns(`, `.throws(`, `.resolves(`, `.rejects(` and `.mimicks(`, and use the symbol: `sub[received](1).returns(5)`. +* In generic code, the type parameter's constraint decides: an unconstrained `SubstituteOf` offers `sub.received()` and `sub.didNotReceive()`, as in 2.0.0-beta.4, while for `T extends Account`, where `Account` has a member with one of these names, only the symbols are offered. + + +```typescript +import { received, didNotReceive, returns } from '@fluffy-spoon/substitute' + +calculator.add(1, 2)[returns](3) +console.log(calculator.add(1, 2)) // prints 3 +calculator[received](1).add(1, 2) +calculator[didNotReceive]().subtract(Arg.all()) +``` + +`call`, `apply` and `bind` on a substitute value now mean both the function's own method and a member of your own with that name; see [What counts as a call](#what-counts-as-a-call). + +## Behaviour changes +### Sequences repeat the last value +*Applies to: 1.x.* + +`returns(a, b, c)` returns `a`, `b` and `c`, and then keeps returning `c`. In 1.x, the calls after the sequence returned `undefined`. The same applies to `throws`, `resolves`, `rejects` and `mimicks` with several values. + + +```typescript +calculator.add(1, 2).returns(3, 7, 9) +console.log(calculator.add(1, 2)) // prints 3 +console.log(calculator.add(1, 2)) // prints 7 +console.log(calculator.add(1, 2)) // prints 9 +console.log(calculator.add(1, 2)) // prints 9 +``` + +If a test relied on `undefined` after the sequence, add it to the sequence where the type allows it (`returns(3, 7, 9, undefined)`). + +### Auto-substitutes and nested checks +*Applies to: 1.x and the betas.* + +A member or call that is not configured returns an auto-substitute. (The 1.x README said such calls return `undefined`; they returned a proxy in every version.) What is new: + +* The same member, or the same method with equal arguments, always returns the same auto-substitute, so nested setups work: `app.getCalculator().add(1, 2).returns(99)`. +* **Nested checks really check.** In 1.x and the betas, `app.logger.received().info('hi')` passed whatever had been called. Now it fails when `info('hi')` was not called on `app.logger`. Tests that passed only because of this now fail. +* Setups and calls on the substitute never leak into nested members with the same name, or the other way round. + +```js +const { Substitute } = require('@fluffy-spoon/substitute') + +const app = Substitute.for() +app.logger.info('hi') + +app.logger.received().info('hi') +app.logger.received().info('bye') // throws SubstituteException +``` + +In TypeScript, nested auto-substitutes are not typed as substitutes; see the [README](README.md#auto-substitutes-and-nested-members) for the typed alternative. + +### Calls with argument matchers are setups +*Applies to: 1.x and the betas.* + +A call with an `Arg.any()`, `Arg.is()` or `Arg.all()` matcher (or their `.not` forms) is always a setup or a check. It is never recorded as a received call, and it never runs an existing setup. Before, `calculator.add(Arg.all()).returns(10)` after `calculator.add(1, 3).returns(1337)` ran the first setup, and failed with `TypeError: ... returns is not a function`. A bare `calculator.add(Arg.any(), 2)` statement was counted as a call. + + +```typescript +calculator.add(1, 3).returns(1337) +calculator.add(Arg.all()).returns(10) +console.log(calculator.add(1, 3)) // prints 1337 +console.log(calculator.add(5, 2)) // prints 10 + +calculator.subtract(Arg.any(), 2) +calculator.didNotReceive().subtract(Arg.all()) +``` + +This also holds for matchers inside plain objects and arrays, which are new: `repository.save({ id: Arg.any(), name: 'bob' }).returns('saved')` is a setup, and it matches `save({ id: 1, name: 'bob' })`. Before, a matcher inside an object was compared as a value, so such a call was a received call and never matched anything. Matchers inside class instances, `Map`s and `Set`s are still compared as values, and so are matchers beyond the limits that keep large arguments fast (for example in an array or object with more than 1,024 items or keys, more than 32 levels deep, or after the first 32,768 items and keys of an argument), and matchers put into an array or object with more than 256 items or keys after it was first passed. See [Matchers inside objects and arrays](README.md#matchers-inside-objects-and-arrays). + +### Match order +*Applies to: 1.x and the betas.* + +The README used to say that the first matching setup wins. Now the most specific setup wins: literal arguments, then matchers, then `Arg.all()` alone. Among setups of the same kind, the most recent one wins, so configuring the same call again overrides it. See [Match order](README.md#match-order). + + +```typescript +calculator.add(Arg.any(), Arg.any()).returns(1) +calculator.add(Arg.is(a => a > 10), Arg.any()).returns(2) +console.log(calculator.add(20, 0)) // prints 2 +console.log(calculator.add(5, 0)) // prints 1 +``` + +### Re-configuring a call +*Applies to: 1.x and the betas.* + +A call whose literal arguments match an existing setup returns the configured value, so `calculator.add(1, 2).returns(5)` after `calculator.add(1, 2).returns(4)` fails (a number has no `.returns`). If the configured value is a substitute, `.returns(5)` is silently recorded as a call of that substitute's member `returns`, and nothing is configured. Use the new `sub[configure]()` view, in which every call is a setup: + + +```typescript +import { configure } from '@fluffy-spoon/substitute' + +calculator.add(1, 2).returns(4) +calculator[configure]().add(1, 2).returns(5) +console.log(calculator.add(1, 2)) // prints 5 + +calculator.add(Arg.all()).returns(10) +calculator[configure]().add(1, 3).returns(1337) +console.log(calculator.add(1, 3)) // prints 1337 +``` + +### What counts as a call +*Applies to: 1.x and the betas.* + +* Reading a method without calling it is not a call. Before, merely reading a method (for example to register it as an event handler) satisfied `received().method(...)`. +* `.call()`, `.apply()` and `.bind()` on a method, a function substitute, the result of a call or a nested member return the configured value and count as a direct call, and a mimicked function or a `mimicks()` function gets their first argument as `this`. Before, they returned a proxy (in 1.x, `.bind()` on a method already worked). They also count as a call of a member called `call`, `apply` or `bind`, and a setup such as `client.rpc.call('getUser', 1).returns(user)` configures that member. See [`call`, `apply` and `bind`](README.md#call-apply-and-bind). +* Every call through a stored or destructured reference, or a callback, is recorded. In the betas, each such call overwrote the previous one (1.x was not affected). +* The reads and calls that lead up to a setup or a check in the same expression, like `app.getCalculator()` in `app.getCalculator().add(1, 2).returns(99)`, are not recorded. Before, they were received calls, so `app.didNotReceive().getCalculator()` failed after that setup. Calls that the code under test made are kept, also calls through a method that the test handed to it (`new UserService(api.getUser)`, also when the code under test invokes it with the substitute as `this`, as in `Reflect.apply(fetch, api, [id])`) and calls from a promise job (`Promise.resolve(id).then(getUser)`): see [Which calls lead to a setup or a check](README.md#which-calls-lead-to-a-setup-or-a-check) for how the library tells them apart. + + +```typescript +const { add } = calculator +add(1, 1) +add(2, 2) +calculator.received(2).add(Arg.all()) + +const handler = calculator.subtract +calculator.received().subtract(Arg.all()) // throws SubstituteException +``` + +### `new` is a call +*Applies to: 1.x and the betas.* + +`new` on a substitute or on a member of it (`new sdk.Client('https://api')`, also through `Reflect.construct()`) is a call. It is recorded, setups written as calls answer it (`sdk.Client(Arg.any()).returns(client)`), and checks written as calls count it (`sdk.received(1).Client('https://api')`). Without a setup, or with a setup that returns a primitive, `new` returns the auto-substitute of that call. In 1.x, `new` on a substitute threw a `TypeError` (a proxy invariant about `prototype`). In the betas, it returned an object made from the library's internal function, whatever was configured, and only the read of the member was recorded. In TypeScript, setups and checks written as calls compile for constructor types and members, as in `Client('https://api').returns(client)` for `Substitute.for ApiClient>()`; see [Creating a substitute](README.md#creating-a-substitute). + +```js +const { Substitute, Arg } = require('@fluffy-spoon/substitute') + +// the code under test +const connect = sdk => new sdk.Client({ baseUrl: 'https://api' }) + +const sdk = Substitute.for() +const client = { name: 'client' } +sdk.Client(Arg.any()).returns(client) +console.log(connect(sdk) === client) // prints true +sdk.received(1).Client({ baseUrl: 'https://api' }) +``` + +### Checks never run setups +*Applies to: the betas.* + +`received()` and `didNotReceive()` never run setups or mimicked implementations, and are never recorded. In the betas, checking a property ran its setup: it threw the configured error, used up a value of a `returns()` sequence, ran the `mimicks()` function again, or left an unhandled rejection behind. + + +```typescript +calculator.isEnabled.returns(true, false) +console.log(calculator.isEnabled) // prints true +calculator.received(1).isEnabled +console.log(calculator.isEnabled) // prints false +``` + +### `received(count)` is validated +*Applies to: 1.x and the betas.* + +The count must be a non-negative integer, or left out for "1 or more". Anything else throws a `SubstituteException` that says so. Invalid counts failed before, too, but with a different error: a plain `Error` in 2.0.0-beta.4, a call count mismatch in 1.x. `received(0)` is the same as `didNotReceive()`. + + +```typescript +calculator.received(0).add(1, 2) +calculator.received(1.5).add(1, 2) // throws SubstituteException: Expected count has to be a non-negative integer +``` + +### Checks that fail later +*Applies to: 1.x and the betas.* + +`sub.didNotReceive().member` or `sub.received(0).member` without parentheses, on a member that was called as a method, passed silently before. Now its failure is reported later, from a microtask, because the parentheses were probably forgotten: `Expected to receive 0 property reads or method calls matching add, but received 1 method call. add was called 1 time as a method; to assert calls, invoke it: sub.didNotReceive().add(...)`. Add the call: `sub.didNotReceive().add(1, 2)`, or `.add(Arg.all())`. See [Assertions that fail later](README.md#assertions-that-fail-later), which also lists how each test runner reports such a failure. + +Checks that fail later (this one, and a property-style `sub.received(2).member` on a member that was called as a method) are reported with the `queueMicrotask` that the library found when it was loaded (`process.nextTick` on Node.js 10), so fake timers installed later in a test do not hold them back. 2.0.0-beta.4 reported a failing property-style check on `process.nextTick`, and an exception thrown from `process.nextTick` crashes jest instead of failing the test. Now jest reports it as the failure of the running test (jest 30 on Node.js 22: as a failure of the test file). mocha and ava cannot tie such a failure to the test: mocha stops the run after that test, so the tests after it do not run, and ava ends the worker of that test file, so its unfinished tests are not reported. Every runner fails the run, though. + +### Matchers +*Applies to: 1.x and the betas.* + +* `Arg.all()` after other arguments matches the rest of the arguments, and the arguments before it must match. Before, it made the whole call match anything. Arguments after `Arg.all()` throw a `SubstituteException`. +* `Arg.any('object')` no longer matches `null`, and now matches substitutes. `Arg.any('function')` matches substitutes, and `Arg.any('array')` uses `Array.isArray`. +* `Arg.is()` with something other than a function throws a `TypeError` right away. A predicate that throws counts as a non-match instead of crashing the code under test. +* Substitutes passed as arguments are compared by identity, and are never compared or printed member by member. In the betas, a failed check overflowed the stack when substitutes referred to each other through their arguments. +* **JavaScript:** `Arg.any(type)` and `Arg.any.not(type)` throw a `TypeError` right away for a type name that they do not know, such as a typo (`'strnig'`) or another case (`'String'`). Before, `Arg.any('strnig')` silently matched nothing, and `Arg.any.not('strnig')` matched every value. `'bigint'` is a documented type name now (it already matched `bigint` values). +* **JavaScript:** `mimicks()` with something other than a function (or with nothing) throws a `TypeError` at the setup, and the message names the member. Before, the setup was accepted, and the call failed later, in the code under test (`TypeError: substitutionValue is not a function`; in 1.x, `mockValue.apply is not a function`). + +### How arguments are compared +*Applies to: 1.x and the betas.* + +Literal arguments are compared with deep strict equality (`util.isDeepStrictEqual`), as before: own enumerable properties and prototypes. `#private` fields and other internal state are invisible to it, so all instances of a class that keeps its state only in `#private` fields are equal to each other. Use the same instance, or `Arg.is()`, for such classes (see [How arguments are compared](README.md#how-arguments-are-compared)). + +What changed: an argument object that you change after using it in a setup only matches that setup when the same object is passed again. Before, a new object equal to the changed one matched as well. Create the setup with the object as the code under test will pass it, or with a matcher. Objects that change after they were passed in a call that is not a setup are not affected: the library remembers the hash of a large object (with more than 256 keys or entries) from the first time it is passed, but that never changes a result, so such an object still matches a setup made with an equal object, before or after the change (see [How arguments are compared](README.md#how-arguments-are-compared)). + + +```typescript +interface Repository { + save(user: { name: string }): string +} + +const repository = Substitute.for() +const user = { name: 'ann' } +repository.save(user).returns('saved') +user.name = 'bob' + +console.log(repository.save(user)) // prints saved +console.log(repository.save({ name: 'bob' }) === 'saved') // prints false +``` + +### Omitted arguments +*Applies to: the betas. 1.x compared omitted arguments in the same way.* + +An argument that a call leaves out at the end counts as `undefined`: it matches a literal `undefined` and matchers that accept `undefined`, such as `Arg.any()` and `Arg.any('undefined')`, and `f(1)` and `f(1, undefined)` are the same call. In the betas, an omitted argument matched nothing, so `f(1)` and `f(1, undefined)` were different calls. See [How arguments are compared](README.md#how-arguments-are-compared). So: + +* `users.find(Arg.any('undefined')).returns(...)` and `users.find(Arg.any()).returns(...)` now answer `users.find()`, and `received(1).find(Arg.any())` counts it. +* **`didNotReceive().f(Arg.any())` now fails after `f()`**, and `received(count).log(Arg.any(), Arg.all())` counts `log()` as well. +* A matcher setup that accepts `undefined` now answers calls with fewer arguments, and it is more specific than `Arg.all()`: after `add(Arg.any(), Arg.any()).returns('p')` and `add(Arg.all()).returns('w')`, `add(5)` returns `'p'`. +* **A literal setup after a matcher setup that already answers it needs `configure` now:** after `calculator.multiply(1, Arg.any()).returns(10)`, `calculator.multiply(1).returns(1)` throws `TypeError: calculator.multiply(...).returns is not a function`, because `multiply(1)` returns 10. Write `calculator[configure]().multiply(1).returns(1)`, or make the literal setup first. In the same way, `f(undefined).returns(a)` followed by `f().returns(b)` configures one call twice. +* Only the arguments themselves count: inside arrays and objects, deep strict equality still applies, so `[1]` and `[1, undefined]` are different. + +```js +const { Substitute, Arg } = require('@fluffy-spoon/substitute') + +const logger = Substitute.for() +logger.log('started') + +logger.received(1).log('started', undefined) +logger.received(1).log('started', Arg.any()) +logger.didNotReceive().log('started', Arg.any()) // throws SubstituteException +``` + +### `this` in `mimicks()` +*Applies to: 1.x and the betas.* + +A `mimicks()` function is called with the `this` of the call, like a method: the substitute for `sub.method(...)`, the first argument of `.call()` and `.apply()`, and `undefined` for a property read. Before, it was `undefined` (in 2.0.0-beta.4) or the library's own proxy (in 1.x). An implementation that relied on that, or that needs a `this` of its own, should be an arrow function or a bound method. + +### Protocol members read as `undefined` +*Applies to: 1.x and the betas.* + +`Symbol.iterator`, `Symbol.asyncIterator`, `Symbol.hasInstance`, `Symbol.isConcatSpreadable`, `Symbol.match`, `Symbol.matchAll`, `Symbol.replace`, `Symbol.search`, `Symbol.split`, `Symbol.species`, `Symbol.toStringTag`, `Symbol.unscopables`, `util.promisify.custom`, `asymmetricMatch` and `__esModule` read as `undefined` on a substitute unless they are configured, and the reads are not recorded (see [Special members](README.md#special-members)). Before, they returned auto-substitutes. So: + +* `[].concat(sub)` keeps the substitute as one element (it was dropped), `value instanceof sub.SomeClass` is `false` (it was `true`), `'text'.startsWith(sub.prefix)` no longer throws, and `util.promisify(sub.readFile)` calls the substitute, on every supported Node.js version (the running Node.js' own `util.promisify.custom` is handled too; on Node.js 10.0 to 12.16.1 and 13.0 to 13.11 it is not `Symbol.for('nodejs.util.promisify.custom')`). +* A substitute that stands in for a whole module, for example one that a `jest.mock()` factory returns for a CommonJS module, is its own default export: with TypeScript's `esModuleInterop`, Babel or esbuild, `import mailer from './mailer'` gives the substitute itself, so setups made on it answer the code under test. Before, `__esModule` read as an auto-substitute, which counts as `true`, so the default import was the auto-substitute `mailer.default` instead. +* jest no longer takes a substitute for an asymmetric matcher. Before, `expect(fn).toHaveBeenCalledWith(sub)` and `expect(list).toContainEqual(sub)` passed whatever the arguments or items were, and a failing `expect(value).toEqual(sub)` threw jest's internal "Unexpected return from a matcher function" error. Now they compare the substitute by identity, so tests that passed only because of this fail. +* **A substitute is not iterable.** `[...sub]`, `for...of`, `for await...of` and `Promise.all(sub)` on a substitute that is not configured throw a `TypeError`. In the betas they treated it as empty; in 1.x they threw a different `TypeError`. Configure the iterator, or mimick an array: + +```js +const { Substitute, configure, mimick } = require('@fluffy-spoon/substitute') + +const items = Substitute.for() +items[configure]()[Symbol.iterator]().mimicks(() => ['a', 'b'][Symbol.iterator]()) +console.log([...items]) // prints [ 'a', 'b' ] + +const list = Substitute.for() +list[mimick](['a', 'b']) +console.log(list.length) // prints 2 +``` + +### Freezing, defined properties and `in` +*Applies to: 1.x and the betas.* + +* `Object.freeze()`, `Object.seal()` and `Object.preventExtensions()` work on a substitute and on an auto-substitute, and it keeps working afterwards. Before, the reads and setups after them threw a `TypeError` (in the betas, "Cannot add property _child, object is not extensible"; in 1.x, a proxy invariant error). +* `Object.defineProperty(sub, key, descriptor)` defines a real property, which reads return without recording them. Before, it threw a `TypeError`. +* A substitute has no own properties: `Object.keys(sub)` and `Reflect.ownKeys(sub)` are empty. In the betas, `Object.keys(sub)` listed internal fields such as `_key` and `_recorder`, and in 1.x and the betas, `Reflect.ownKeys(sub)` listed `length`, `name` and `prototype` of the library's internal function. +* `key in sub` is `true` for a key with a setup, a key of a mimicked instance and a property defined with `Object.defineProperty()`, and `false` otherwise. Before, it answered for the library's internal function: `true` for `call`, `length` and the other members of functions, and `false` for configured members. Code under test that checks for an optional member with `in` now takes the branch that the test configured. + +See [Freezing, defined properties and `in`](README.md#freezing-defined-properties-and-in). + +### Messages +*Applies to: 1.x and the betas.* + +The wording of `SubstituteException` messages changed, for example "Expected to receive 2 method calls matching add(1, 2), but received 1.", followed by the calls that were received (at most 50). Tests that compare message texts need updating. When the kind of call is not known, messages say "property reads or method calls" instead of "property calls". A check of a member that was never used at all fails when it reads the member, so its message cannot name the expected arguments ("... matching add, but received none."); once the method has been called, the message names them. Messages contain ANSI colours only when the output is a terminal (`NO_COLOR`, `NODE_DISABLE_COLORS`, `TERM=dumb` and `FORCE_COLOR` are honoured). In the betas, messages always contained them; 1.x messages had no colours. + +`SubstituteException` is now exported from the package root: `import { SubstituteException } from '@fluffy-spoon/substitute'`. + +### Printing +*Applies to: 1.x and the betas.* + +`String()`, template strings, `util.inspect()`, `console.log()` and `JSON.stringify()` of an auto-substitute give its path, such as `@Substitute.someProperty` or `@Substitute.getUser(1)`, followed by its received calls and setups, if it has any. Before, they gave a label such as `property: ` or `method: (1)` (in 1.x, `[class SubstituteJS] -> someProperty`). The printout of a substitute now also lists the calls and setups of its auto-substitutes, under their paths. Tests that compare such texts need updating, and so do names derived from them, such as the `jit_@Substitute.__anonymousType` that Angular's TestBed makes for a substitute (it was `jit_property<__anonymousType>: `). See [Printing a substitute](README.md#printing-a-substitute). + +```js +const { Substitute } = require('@fluffy-spoon/substitute') + +const app = Substitute.for() +console.log(`${app.someProperty}`) // prints @Substitute.someProperty +console.log(JSON.stringify({ user: app.getUser(1) })) // prints {"user":"@Substitute.getUser(1)"} +``` + +## Imports and packaging +*Applies to: 1.x and the betas.* + +**The ES module default import works.** Under native ES modules, `import Substitute from '@fluffy-spoon/substitute'` used to give the CommonJS module object, so `Substitute.for` was not a function. It is now the `Substitute` class. Named imports work as before, and ES modules and CommonJS share one copy of the library. + + +```js +import Substitute, { Arg } from '@fluffy-spoon/substitute' + +const calculator = Substitute.for() +calculator.add(Arg.any(), 2).returns(3) +console.log(calculator.add(1, 2)) // prints 3 +``` + +Bundles with CommonJS output that keep the package external are an exception: they `require()` the CommonJS entry, so their default import is the exports object, and `Substitute.for` is not a function. This applies to Rollup with `output.format: 'cjs'` and to the SSR builds of Vite 5 to 7 with CommonJS output, for any source, and to esbuild, webpack, Rolldown and Vite 8 with CommonJS output, for `.mjs` sources and sources in a `"type": "module"` package. Use the named import `import { Substitute, Arg } from '@fluffy-spoon/substitute'` there, which works everywhere. With Rollup, and Vite 5 to 7, `output.interop: 'auto'` also makes the default import work. The second exception is ts-node's ESM loader (`node --loader ts-node/esm`) with `module` and `moduleResolution` set to `node16` or `nodenext`: it type-checks the default import against the CommonJS typings and rejects `Substitute.for()`, so use the named import, tsx, or ts-node's `transpileOnly` there. See [Importing](README.md#importing). + +**Bundled CommonJS `require()` with the package external.** 2.0.0-beta.4 and older had only a CommonJS entry. Now there is also an ES module entry, whose default export is the `Substitute` class. CommonJS code that `require()`s the package, bundled with Rollup's `@rollup/plugin-commonjs` while the package stays external (Vite 7 and older do this in SSR builds, which keep dependencies external by default), now gets that class from `require()`, so `Substitute`, `Arg` and the other named exports are `undefined`. Nothing throws at that point; the first use fails, for example with `TypeError: Cannot read properties of undefined (reading 'for')`. Set `commonjs({ esmExternals: true })` or `commonjs({ esmExternals: ['@fluffy-spoon/substitute'] })`, or bundle the package (in Vite: `ssr: { noExternal: ['@fluffy-spoon/substitute'] }`). Vite 8 and newer, and code that `import`s the package, are not affected by this. See [Importing](README.md#importing). + +**Deep imports moved.** package.json now has an `exports` map. The public entry point is the package root; import everything from there. 1.x had its files under `dist/src/`, the betas directly under `dist/`: + +| Before | After | +|---|---| +| `@fluffy-spoon/substitute/dist/src/Substitute` (1.x), `.../dist/Substitute` (betas): `Substitute`, `SubstituteOf` | `@fluffy-spoon/substitute` | +| `@fluffy-spoon/substitute/dist/src/Arguments` (1.x), `.../dist/Arguments` (betas): `Arg` | `@fluffy-spoon/substitute` | +| `@fluffy-spoon/substitute/dist/src/SubstituteBase` (1.x), `.../dist/SubstituteException` (betas): `SubstituteException` | `import { SubstituteException } from '@fluffy-spoon/substitute'` | +| `@fluffy-spoon/substitute/dist/src/Transformations` (1.x), `.../dist/Transformations` (betas): `ObjectSubstitute`, ... | `SubstituteOf` from `@fluffy-spoon/substitute` | + + +```typescript +import { SubstituteOf, SubstituteException } from '@fluffy-spoon/substitute' + +const asSubstitute: SubstituteOf = calculator +try { + asSubstitute.received().add(1, 2) +} catch (error) { + console.log(error instanceof SubstituteException) // prints true +} +``` + +The other files were internals and are gone without a replacement: in 1.x `dist/src/Context`, `dist/src/Utilities` and `dist/src/states/...`; in the betas `dist/SubstituteNode`, `dist/SubstituteNodeBase`, `dist/Recorder`, `dist/RecordsSet`, `dist/RecordedArguments`, `dist/Types` and `dist/Utilities` (`dist/utilities/...` in 2.0.0-beta.4). Development builds made from the repository after 2.0.0-beta.4 had them under `dist/internals/` (`dist/internals/SubstituteNode`, `dist/internals/Recorder`, `dist/internals/RecordsSet`, ...); those are gone, too. + +The compiled files of 2.0.1 live under `dist/api`, `dist/internals` and `dist/shared`. They are not public API and can change in any release. They can be imported as `@fluffy-spoon/substitute/dist/`, with or without `.js`, on Node.js 14.19 or newer on 14.x, 16.9 or newer on 16.x, any later version, and versions older than 12.17 (which ignore `exports`). On 12.17 to 12.19, 13.x and 14.0 to 14.12, deep imports fail; on 12.20 to 12.22, 14.13 to 14.18 and 16.0 to 16.8, only the form without `.js` works. Directory imports such as `@fluffy-spoon/substitute/dist/api` no longer resolve on Node.js versions that read `exports`. + +**`require` works on every Node.js version from 10 on, and `import` needs 12.17 or newer on 12.x, 13.7 or newer on 13.x, or 14 or newer** (see [Requirements](#requirements)). + +## TypeScript +*Applies to: 1.x and the betas.* + +The typings were reworked. Most code compiles unchanged, but: + +* The [symbol rules](#names-that-conflict-with-the-library-the-symbol-api) above: string checks are not offered on types with conflicting member names, and `mimick(instance)` is symbol only. +* The symbol API is available on every substitute, also on `SubstituteOf` for a generic `T`. In generic code, the string forms `sub.received()` and `sub.didNotReceive()` are offered for a type parameter without a constraint, as in the betas. With a constraint, the constraint decides: if it has a member called `received`, `didNotReceive`, `returns`, `throws`, `resolves`, `rejects` or `mimicks`, only the symbols are offered. Calls and properties that return the type parameter keep `.returns()` and the other setup methods. +* With a constrained type parameter (`function stub(sub: SubstituteOf)`, or a fixture class `Fixture` with `sub = Substitute.for()`), setups, checks and the `configure` view work through the constraint: `sub.total.returns(1)`, `sub.add(1, 2).returns(3)`, `sub.received().total = 1` and `sub[configure]().add(1, 2).returns(3)` compile, and the values are checked against the constraint's member types. With 2.0.0-beta.4, only property setups and checks of calls compiled there. Keys that exist only through the constraint's string index signature (`T extends { [key: string]: number; port: number }`, `sub.timeout.returns(5)`) can be configured, too, with values of the index signature's type. The exceptions (see [Typing limitations](README.md#typing-limitations)): + * On older TypeScript versions only: on 3.6 to 4.7, calls of optional methods (and of members typed `fn | undefined`) have no setup API in such code; on 3.6 to 3.8, members whose type includes `null` or `undefined` have none either, and neither do `maybe?: T` or `orNull: T | null` of any type parameter, constrained or not, in an interface such as `Box`. Configure them through `sub[configure]()`, which works on every version. + * A union constraint whose variants' methods return different types (`T extends Cat | Dog`, with `speak(): 'meow'` and `speak(): 'woof'`): `.returns()` takes `never` there. Cast to the constraint: `(pet as SubstituteOf).speak().returns('meow')`. + * On TypeScript 5.4 and newer, a method that the variants of a union constraint declare with different parameter lists (`T extends LogA | LogB`, with `log(message: string): void` and `log(message: string, level?: number): void`) has no setup API, even when every variant returns the same type. Use the `configure` view (`sub[configure]().log('x').returns()`) or cast to the constraint. Checks work. + * A set of a key that exists only through the index signature cannot be checked (`sub.received().timeout = 5`). Write `(sub.received() as Settings).timeout = 5`. +* A member whose type is a union of function types with different return types (`onResult: ((r: string) => number) | ((r: string) => string)`), and a method whose return type differs between the variants of a union (`Substitute.for()` with `load(): Promise` and `load(): Promise`, or methods that return `this`), have the setup API with the union of the return types: `listeners.onResult('a').returns(1)` and `.returns('x')`, `pet.load().resolves(1)` and `.resolves('x')`, `.mimicks()` and the `configure` view. With 2.0.0-beta.4, `.resolves()` on such methods, and `.returns()` on methods that return `this` and on union-typed callback members, took `never`, and calls of a substitute of a union of function types (`Substitute.for<((e: string) => number) | ((e: string) => string)>()`) had no setup API. +* The same holds for a method that the variants of a union declare with different parameter lists (an extra optional parameter, other parameter types, other overloads): `client.fetch('/a').resolves('ok')` for `fetch(url)` and `fetch(url, options?)` in `Substitute.for()`, and `reader.read('p').returns('text')` and `.returns(new Uint8Array())` for `read(path): string` and `read(path, encoding?): Uint8Array`. `.returns()` takes the return types of the variants that the call can reach, which depends on the number of arguments that the call passes; [Typing limitations](README.md#typing-limitations) has the exact rule, and the cases that need a cast to one variant (such as `Arg.any()` where the variants' parameter types differ). With 2.0.0-beta.4, `.returns()` on such methods was missing or took `never` when the return types differ, and on TypeScript 5.4 and newer it was missing even when they are the same. Unions whose variants have a string index signature (`{ kind: 'a'; [key: string]: unknown; speak(): 'meow' } | ...`) take the union of the return types as well; with 2.0.0-beta.4, `.returns()` was missing there. +* Substitutes of constructor types and members that are classes support the setups and checks written as calls that [`new`](#new-is-a-call) needs: `Client('https://api').returns(client)` and `Client.received(1)('https://api')` for `Substitute.for ApiClient>()`, and `sdk.Client(Arg.any()).returns(client)` and `sdk.received(1).Client('https://api')` for a member `Client: typeof ApiClient`. `new Client('https://api')` keeps the constructor's parameter and instance types. +* `Arg.any('bigint')` is typed `bigint`. +* A member called `then` is typed `never`: substitutes are never thenables. +* Members typed only `null` or `undefined` (`error?: undefined`, `ownerDocument: null`) keep their plain type and no longer have `.returns()` and the other setup methods. Configure them through `sub[configure]()`. In a union, a member that is only `null` or `undefined` in some variants (`{ data: string[]; error: null } | { data: null; error: Error }`, or `{ ok: true; value: string; error?: undefined } | { ok: false; value?: undefined; error: Error }`) has the setup API with the type the variants have in common (`result.data.returns(null)`). With 1.x and the betas, the `: null` form turned the substitute into `never` (on TypeScript 3.9 and newer); the `?: undefined` form compiled with 2.0.0-beta.4. +* Substitutes of function types and of interfaces with call signatures are typed: `Substitute.for<(event: string) => string>()` supports `listener('saved').returns('ack')`, `listener.received(1)('saved')`, `listener[received](1)('saved')` and `listener[configure]()('saved').returns('ack')`. With 2.0.0-beta.4, the setup and the checks of such calls did not compile. +* `Arg.any('function')` is typed as any function or class, so it fits typed callback parameters. `Arg.any('object')` is typed `any`, like `Arg.any()` (it was `object`). +* `Arg.any('undefined')` only fits parameters and properties that accept `undefined`, such as an optional parameter, `number | undefined` or `unknown`. It was typed `never`, which fit every parameter, so code like `calculator.add(Arg.any('undefined'), 2)` no longer compiles. `Arg.any.not('undefined')` fits any parameter. +* Now supported: optional members (also `sub.received().optionalProperty = undefined`, for optional properties that are not functions), named members next to an index signature, overloads without parameters, up to 8 overloads, `(...args: unknown[])` methods, `.throws()` on methods that return `never`, `Arg.all()` after other arguments (after up to 6 of them), and types with very large unions of string literals, such as lib.dom's `HTMLInputElement`. +* An optional function-typed property (`onChange?: (value: string) => void`) does not accept `undefined` in a check. Write `(widget.received() as Widget).onChange = undefined`, or `widget.received().onChange = Arg.any.not('function')`. +* See [Typing limitations](README.md#typing-limitations) for what TypeScript cannot express. diff --git a/README.md b/README.md index 56d1c1e..556df8e 100644 --- a/README.md +++ b/README.md @@ -1,247 +1,1845 @@ - +Financial Contributors on Open Collective # What is this? [`@fluffy-spoon/substitute`](https://www.npmjs.com/package/@fluffy-spoon/substitute) is a TypeScript port of [NSubstitute](http://nsubstitute.github.io), which aims to provide a much more fluent mocking opportunity for strong-typed languages. -*You can read an in-depth comparison of `substitute.js` versus other popular TypeScript mocking frameworks here: https://medium.com/@mathiaslykkegaardlorenzen/with-typescript-3-and-substitute-js-you-are-already-missing-out-when-mocking-or-faking-a3b3240c4607* +*You can read an in-depth comparison of `substitute.js` versus other popular TypeScript mocking frameworks here: https://medium.com/@mathiaslykkegaardlorenzen/with-typescript-3-and-substitute-js-you-are-already-missing-out-when-mocking-or-faking-a3b3240c4607 (written for version 1; the ideas still apply).* **PRs are very welcome! Help is much appreciated.** +> Upgrading from 1.x or from a 2.0.0 beta? Read the [migration guide](MIGRATION.md). What changed in each version is in the [changelog](CHANGELOG.md). + +# Table of contents +- [Installing](#installing) · [Requirements](#requirements) · [Importing](#importing) +- [Usage](#usage): [creating a substitute](#creating-a-substitute), [return values](#setting-return-values), [promises](#working-with-promises), [exceptions](#throwing-exceptions), [mimicking](#mimicking-an-implementation), [members that are a property and a method](#members-used-as-a-property-and-as-a-method) +- [Argument matchers](#argument-matchers), [inside objects and arrays](#matchers-inside-objects-and-arrays), [how arguments are compared](#how-arguments-are-compared) and [match order](#match-order) +- [Re-configuring a call](#re-configuring-a-call-configure) · [Partial mocks](#partial-mocks) · [Auto-substitutes](#auto-substitutes-and-nested-members) and [which calls lead to a setup](#which-calls-lead-to-a-setup-or-a-check) +- [Verifying calls](#verifying-calls): [counts](#received-and-didnotreceive), [properties](#properties), [what counts as a call](#what-counts-as-a-call), [clearing](#clearing-received-calls), [SubstituteException](#substituteexception), [deferred failures](#assertions-that-fail-later) +- [Names that conflict with the library](#names-that-conflict-with-the-library), [`call`, `apply` and `bind`](#call-apply-and-bind) and [the symbol API](#the-symbol-api) +- [Special members](#special-members): [printing](#printing-a-substitute), [freezing and `in`](#freezing-defined-properties-and-in) · [Typing limitations](#typing-limitations) · [Test runners](#test-runners) and [debuggers](#debuggers) · [Performance](#performance) + # Installing -`npm install @fluffy-spoon/substitute --save-dev` +```sh +npm install @fluffy-spoon/substitute --save-dev +``` + +This README describes version 2. Until 2.0.1, `npm install` installed 1.208.0 (the `latest` tag). If you depend on version 1, pin it with `npm install @fluffy-spoon/substitute@1 --save-dev`; its README is at the [v1.208.0 tag](https://github.com/ffMathy/FluffySpoon.JavaScript.Testing.Faking/tree/v1.208.0#readme). # Requirements -* `TypeScript^3.0.0` +* Node.js 10 or newer for CommonJS (`require`). +* For the ES module entry point (`import`): Node.js 12.17 or newer on 12.x, 13.7 or newer on 13.x, or 14 or newer. Node.js 10.x, 12.0 to 12.16 and 13.0 to 13.1 have no ES modules without a flag, and 13.2 to 13.6 do not pick the package's ES module entry, so named imports fail there; use `require` on those versions. +* TypeScript 3.6 or newer, if you use TypeScript. `strict` mode, including `strictNullChecks`, is supported. +* Any test runner. ava, jest, mocha, node:test and vitest are tested on every change (see [Test runners](#test-runners)). + +# Importing +Prefer the named import, `import { Substitute, Arg } from '@fluffy-spoon/substitute'`: it works with every module system, bundler and loader. + +TypeScript, or code compiled by a bundler: + +```typescript +import { Substitute, Arg } from '@fluffy-spoon/substitute' +// or: import Substitute, { Arg } from '@fluffy-spoon/substitute' +// (but not in CommonJS bundles that keep the package external, or with ts-node's ESM loader; see below) +``` + +CommonJS: + +```js +const { Substitute, Arg } = require('@fluffy-spoon/substitute') + +const calculator = Substitute.for() +calculator.add(1, Arg.any()).returns(3) +console.log(calculator.add(1, 2)) // prints 3 +``` + +Native ES modules (`.mjs` files or `"type": "module"`). The default import is the `Substitute` class, and named imports work too: + + +```js +import Substitute, { Arg, received } from '@fluffy-spoon/substitute' + +const calculator = Substitute.for() +calculator.add(Arg.all()).returns(3) +console.log(calculator.add(1, 2)) // prints 3 +calculator[received](1).add(1, 2) +``` + +The ES module entry point wraps the CommonJS build, so both share one copy of the library. Bundlers that include the package in the bundle, or that emit ES modules, give the same exports: on every change, the package is bundled with Rollup and `@rollup/plugin-commonjs`, webpack, esbuild and a Vite SSR build with `ssr.noExternal`, and run in vitest with `server.deps.inline`, with and without `deps.interopDefault: false`. For esbuild's ES module output for Node.js (`format: 'esm'`, `platform: 'node'`), add the usual banner `import { createRequire } from 'module'; const require = createRequire(import.meta.url);`, because the library loads Node.js' `util` module with `require`. If a tool cannot hand the CommonJS exports to the ES module entry, `import` throws right away with an error that says so; use `require()` with that tool. + +Three setups need care. + +**CommonJS code that `require()`s the package, bundled with the package external.** This concerns CommonJS code bundled with Rollup's `@rollup/plugin-commonjs` while the package stays external, which Vite 7 and older do in SSR builds, because they keep dependencies external by default. With default options, the plugin turns that `require()` into a default import, which Node.js resolves to the ES module entry, so `require()` returns the `Substitute` class instead of the exports object. Nothing fails at that point, but `Substitute`, `Arg` and the other named exports are `undefined`, so `const { Substitute } = require('@fluffy-spoon/substitute')` followed by `Substitute.for()` throws `TypeError: Cannot read properties of undefined (reading 'for')`. Pass `commonjs({ esmExternals: true })` or `commonjs({ esmExternals: ['@fluffy-spoon/substitute'] })`, or bundle the package instead of keeping it external (in Vite: `ssr: { noExternal: ['@fluffy-spoon/substitute'] }`). In Vite 5 to 7, the plugin's option can also be passed as `build: { commonjsOptions: { esmExternals: ['@fluffy-spoon/substitute'] } }`. Vite 8 and newer are not affected by this, and neither is code that `import`s the package (but see the next paragraph for bundles with CommonJS output). On every change, the compatibility checks bundle such code with Rollup and each of the `commonjs()` settings above, with the package bundled, and with Vite's `ssr.noExternal`. + +**CommonJS output with the package external.** When a bundler compiles ES module code (or TypeScript) into CommonJS output and keeps the package external, the bundle loads the package with `require()`, and the default import follows Node.js' CommonJS interop: it is the exports object, not the `Substitute` class. The first use then throws, for example `TypeError: Substitute.for is not a function` (Rollup, Vite 7), `import_substitute.default.for is not a function` (esbuild), `_fluffy_spoon_substitute__WEBPACK_IMPORTED_MODULE_0__.for is not a function` (webpack) or `_fluffy_spoon_substitute.default.for is not a function` (Rolldown, Vite 8). This happens for every source file with Rollup and `output.format: 'cjs'`, and with the SSR builds of Vite 5 to 7 with `build.rollupOptions.output.format: 'cjs'`. It also happens for `.mjs` files, and for `.js` and `.ts` files in a package with `"type": "module"`, with esbuild (`format: 'cjs'` with the package external, for example `packages: 'external'`), with webpack (`target: 'node'` with a `commonjs` external, for example `externals: { '@fluffy-spoon/substitute': 'commonjs @fluffy-spoon/substitute' }`), with Rolldown (`format: 'cjs'`) and with the SSR builds of Vite 8 with `build.rolldownOptions.output.format: 'cjs'`. Use the named import there, which works in every setup: `import { Substitute, Arg } from '@fluffy-spoon/substitute'`. With Rollup, and Vite 5 to 7, `output.interop: 'auto'` (in Vite: `build.rollupOptions.output.interop: 'auto'`) also makes the default import work. ES module output, and bundles that include the package, are not affected. On every change, the compatibility checks bundle the named import into CommonJS output with Rollup, esbuild, webpack and a Vite SSR build, and check Rollup's `output.interop: 'auto'`. + +**ts-node's ESM loader.** With ts-node's ESM loader (`node --loader ts-node/esm`, also `mocha --loader=ts-node/esm`) and `module` and `moduleResolution` set to `node16` or `nodenext`, the default import does not type-check in `.mts` files and in `.ts` files of a package with `"type": "module"`. ts-node checks such a file against the package's CommonJS typings, so `import Substitute from '@fluffy-spoon/substitute'` followed by `Substitute.for()` is rejected with `error TS2339: Property 'for' does not exist on type 'typeof import(".../node_modules/@fluffy-spoon/substitute/dist/index")'`. ts-node does not show that message: the process exits with only `[Object: null prototype] { [Symbol(nodejs.util.inspect.custom)]: [Function: [nodejs.util.inspect.custom]] }` and the Node.js version. `tsc` accepts the same file. Use the named import, run the file with tsx (`node --import tsx`), or turn on ts-node's `transpileOnly` (`TS_NODE_TRANSPILE_ONLY=1`). + +Everything is exported from the package root: `Substitute`, `Arg`, `SubstituteException`, the type `SubstituteOf`, and the symbols `received`, `didNotReceive`, `clearReceivedCalls`, `mimick`, `configure`, `returns`, `throws`, `resolves`, `rejects` and `mimicks`. Paths inside the package (`@fluffy-spoon/substitute/dist/...`) are not public API and can change in any release. # Usage +The examples in this README use this interface: + + ```typescript -import { Substitute, Arg } from '@fluffy-spoon/substitute'; +import { Substitute, Arg } from '@fluffy-spoon/substitute' interface Calculator { - add(a: number, b: number): number; - subtract(a: number, b: number): number; - divide(a: number, b: number): number; - async heavyOperation(): Promise; - - isEnabled: boolean; + add(a: number, b: number): number + subtract(a: number, b: number): number + divide(a: number, b: number): number + heavyOperation(...numbers: number[]): Promise + isEnabled: boolean } // Create: -const calculator = Substitute.for(); - +const calculator = Substitute.for() +``` + +Each of the following examples starts with a fresh `calculator`: + + +```typescript // Set a return value: -calculator.add(1, 2).returns(3); - +calculator.add(1, 2).returns(3) + +// Use the substitute wherever a Calculator is expected (normally in the code under test): +const sum = (c: Calculator) => c.add(1, 2) +console.log(sum(calculator)) // prints 3 + // Check received calls: -calculator.received().add(1, Arg.any()); -calculator.didNotReceive().add(2, 2); +calculator.received().add(1, Arg.any()) +calculator.didNotReceive().add(2, 2) +``` + +## Creating a substitute +`Substitute.for()` creates a substitute for an interface, a class or any other type. Its type, `SubstituteOf`, is assignable to `T`, so you can hand it to the code under test. Nothing of a real instance is used: every member is substituted. (To use parts of a real instance, see [Partial mocks](#partial-mocks).) + + +```typescript +class Display { + constructor(private readonly calculator: Calculator) { } + + showSum(a: number, b: number) { + return `${a} + ${b} = ${this.calculator.add(a, b)}` + } +} + +calculator.add(1, 2).returns(3) +console.log(new Display(calculator).showSum(1, 2)) // prints 1 + 2 = 3 +``` + +A function type, or an interface with call signatures, works the same way: a call of the substitute has the setup methods, and the checks are called like the function. + +```typescript +import { Substitute, Arg, received } from '@fluffy-spoon/substitute' + +type Listener = (event: string) => string + +const listener = Substitute.for() +listener('saved').returns('ack') +listener(Arg.is(event => event.startsWith('delete'))).returns('nack') +console.log(listener('saved')) // prints ack +console.log(listener('deleted')) // prints nack + +listener.received(1)('saved') +listener[received](1)('deleted') +listener.didNotReceive()('created') ``` -## Creating a mock -`const calculator = Substitute.for();` +A class, or any other type that can be constructed, works the same way: `new` on a substitute, or on a member of it, is a call. It is recorded, and setups and checks written as calls apply to it: `sdk.Client(Arg.any()).returns(client)` answers `new sdk.Client('https://api')`, and `sdk.received(1).Client('https://api')` checks it. `new` returns the configured value when that is an object or a function (a setup with `throws()` throws), and otherwise the [auto-substitute](#auto-substitutes-and-nested-members) of that call, the same one that the call `sdk.Client('https://api')` returns. This holds for `new` on the substitute itself (`Substitute.for ApiClient>()`, configured as `Client('https://api').returns(client)` and checked as `Client.received(1)('https://api')`), and for `Reflect.construct()` and `new` on a function made with `bind()`, too. `String()` and failure messages show such a call as `new Client('https://api')`. + +```typescript +import { Substitute, Arg } from '@fluffy-spoon/substitute' + +interface ApiClient { get(path: string): Promise } +interface Sdk { Client: new (baseUrl: string) => ApiClient } + +// the code under test +class UserService { + private readonly client: ApiClient + constructor(sdk: Sdk) { this.client = new sdk.Client('https://api') } + name(id: number) { return this.client.get(`/users/${id}/name`) } +} + +const sdk = Substitute.for() +const client = Substitute.for() +sdk.Client(Arg.any()).returns(client) +client.get('/users/1/name').resolves('ann') -## Setting return types -See the example below. The same syntax also applies to properties and fields. +new UserService(sdk).name(1).then(name => console.log(name)) // prints ann +sdk.received(1).Client('https://api') +sdk.didNotReceive().Client('https://staging') +const Client = Substitute.for ApiClient>() +Client('https://api').returns(client) +console.log(new Client('https://api') === client) // prints true +Client.received(1)('https://api') +``` + +## Setting return values +Make the call with the arguments you want to configure, then call `.returns()` on it. The same syntax works for properties. + + ```typescript -// single return type -calculator.add(1, 2).returns(4); -console.log(calculator.add(1, 2)); // prints 4 -console.log(calculator.add(1, 2)); // prints undefined +// a single value is returned by every matching call +calculator.add(1, 2).returns(4) +console.log(calculator.add(1, 2)) // prints 4 +console.log(calculator.add(1, 2)) // prints 4 + +// several values are returned in sequence, and then the last value repeats +calculator.subtract(5, 1).returns(3, 7, 9) +console.log(calculator.subtract(5, 1)) // prints 3 +console.log(calculator.subtract(5, 1)) // prints 7 +console.log(calculator.subtract(5, 1)) // prints 9 +console.log(calculator.subtract(5, 1)) // prints 9 -// multiple return types in sequence -calculator.add(1, 2).returns(3, 7, 9); -console.log(calculator.add(1, 2)); // prints 3 -console.log(calculator.add(1, 2)); // prints 7 -console.log(calculator.add(1, 2)); // prints 9 -console.log(calculator.add(1, 2)); // prints undefined +// properties work the same way +calculator.isEnabled.returns(true) +console.log(calculator.isEnabled) // prints true ``` +A call or property that is not configured does not return `undefined`: it returns an [auto-substitute](#auto-substitutes-and-nested-members). A configured value can be changed later with [`configure`](#re-configuring-a-call-configure). Another substitute is a fine return value, too. + ## Working with promises -When working with promises you can also use `resolves()` and `rejects()` to return a promise. +For members that return a promise, `resolves()` and `rejects()` are shortcuts for returning a resolved or rejected promise. They work on methods and on promise-typed properties. + + +```typescript +calculator.heavyOperation(1, 2).resolves(4) +// same as calculator.heavyOperation(1, 2).returns(Promise.resolve(4)) + +calculator.heavyOperation(0).rejects(new Error('too light')) +// like calculator.heavyOperation(0).returns(Promise.reject(new Error('too light'))), except that the +// rejected promise is only created when heavyOperation(0) is called + +async function run() { + console.log(await calculator.heavyOperation(1, 2)) // prints 4 + await calculator.heavyOperation(0).catch(error => console.log(error.message)) // prints too light +} +run() +``` + +```typescript +import { Substitute } from '@fluffy-spoon/substitute' + +interface Connection { + ready: Promise +} + +const connection = Substitute.for() +connection.ready.resolves(true) +connection.ready.then(ready => console.log(ready)) // prints true +``` + +## Throwing exceptions +Exceptions can be thrown from methods and properties, with different exceptions for different arguments. The exception is thrown when the configured call happens. + + +```typescript +calculator.divide(Arg.any(), 0).throws(new Error('Cannot divide by 0')) +calculator.divide(1, 0) // throws Error: Cannot divide by 0 + +calculator.isEnabled.throws(new Error('Not available')) +calculator.isEnabled // throws Error: Not available +``` + +Like `returns()`, `throws()`, `resolves()`, `rejects()` and `mimicks()` take several values, which are used in sequence. The last one repeats. + +## Mimicking an implementation +`mimicks()` runs a function of your own for the matching calls. It gets the call's arguments, and its return value is returned. + + +```typescript +calculator.add(Arg.all()).mimicks((a, b) => a + b) +console.log(calculator.add(2, 3)) // prints 5 + +let enabled = false +calculator.isEnabled.mimicks(() => enabled) +console.log(calculator.isEnabled) // prints false +enabled = true +console.log(calculator.isEnabled) // prints true +``` + +The function is called with the `this` of the call, like a method: the substitute for `calculator.add(2, 3)`, the first argument of `.call()` and `.apply()`, and `undefined` for a property read or a call through a destructured reference. If the implementation needs `this` to be something else, for example the real instance of a method you pass in, pass an arrow function or a bound method (`realCalculator.add.bind(realCalculator)`). + +`mimicks()` must be given functions. Anything else, or nothing, throws a `TypeError` right away, at the setup, and the message names the member. When the code under test calls the member with [`new`](#creating-a-substitute), the function is called with `new` if it can be: a class, an ordinary `function` or a substitute. Other functions, such as arrow functions and methods, are called as usual. + +```js +const { Substitute, Arg } = require('@fluffy-spoon/substitute') + +const repository = Substitute.for() +repository.find(Arg.any()).mimicks({ id: 1 }) // throws TypeError: mimicks() expects a function to call for @Substitute.find(Arg.any{any}), but received { id: 1 }. + +class User { + constructor(name) { this.name = name } +} +const models = Substitute.for() +models.User(Arg.any()).mimicks(User) +const ann = new models.User('ann') +console.log(ann instanceof User, ann.name) // prints true ann +``` + +## Members used as a property and as a method +A member can be configured both as a method and as a property, for example a member of a callable interface. Calls are answered by the method setups and reads by the property setup. Configure the method first. Once the property answers with a value, `stats.size(...)` is a call of that value, so configure the method through [`configure`](#re-configuring-a-call-configure) then: `stats[configure]().size(Arg.any()).returns(10)`. + +```js +const { Substitute, Arg } = require('@fluffy-spoon/substitute') + +const stats = Substitute.for() +stats.size(Arg.any()).returns(10) +stats.size.returns(3) + +console.log(stats.size('files')) // prints 10 +console.log(stats.size.toFixed(1)) // prints 3.0 +console.log(stats.size.valueOf() + 1) // prints 4 +console.log(stats.size === 3) // prints false +``` + +Because such a member must stay callable, reading it gives a function that stands in for the configured value. Reading a member of it reads that member of the value, and methods read from it run on the value, like `stats.size.toFixed(1)`. If the value is a substitute, it records and answers its own calls. The stand-in itself is not the value, so compare or compute with it through its members, for example `valueOf()`. + +# Argument matchers +There are several ways of matching arguments. They work the same when you set up calls and when you verify them, and they also work for property assignments (`calculator.received().isEnabled = Arg.any()`). + +## Matching specific arguments +`Arg.any()` matches any value. `Arg.is(predicate)` matches the values for which the predicate returns `true`. When `Arg.is` replaces an argument, the type of the predicate's parameter is inferred from that argument. + ```typescript -calculator.heavyOperation(1, 2).resolves(4); -// same as calculator.heavyOperation(1, 2).returns(Promise.resolve(4)); -console.log(await calculator.heavyOperation(1, 2)); // prints 4 +// ignoring the first argument +calculator.add(Arg.any(), 2).returns(10) +console.log(calculator.add(1337, 2)) // prints 10 +// calculator.add(1337, 3) does not match: it returns an auto-substitute, not 10 + +// x is inferred as a number +calculator.subtract(Arg.is(x => x < 0), Arg.any()).returns(0) +console.log(calculator.subtract(-5, 3)) // prints 0 + +// matchers verify received calls, too +calculator.received().add(Arg.is(x => x > 1000), 2) +``` + +Outside of an argument position, for example in a variable, there is nothing to infer the type from, so annotate the parameter: + + +```typescript +const negative = Arg.is((x: number) => x < 0) +calculator.divide(negative, negative).returns(1) +console.log(calculator.divide(-4, -2)) // prints 1 +``` + +`Arg.is()` with something other than a function throws a `TypeError` right away. A predicate that throws, for example because it reads a property of `null`, counts as a non-match: the code under test is not affected, and a failed assertion says that the predicate threw. + +## Matching by type +`Arg.any(type)` matches values of a type: + +| `type` | Matches | +|---|---| +| `'any'` (the default) | any value, including `undefined` and `null` | +| `'string'`, `'number'`, `'boolean'`, `'symbol'`, `'bigint'`, `'undefined'` | values with that `typeof` | +| `'object'` | objects, arrays and substitutes, but not `null` | +| `'function'` | functions (and classes) and substitutes | +| `'array'` | arrays (`Array.isArray`) | + +```typescript +import { Substitute, Arg } from '@fluffy-spoon/substitute' + +interface Printer { + print(value: unknown): string +} + +const printer = Substitute.for() +printer.print(Arg.any('string')).returns('a string') +printer.print(Arg.any('object')).returns('an object') +printer.print(Arg.any('array')).returns('an array') + +console.log(printer.print('hello')) // prints a string +console.log(printer.print({ id: 1 })) // prints an object +// an array matches both 'object' and 'array'; the setup made last wins (see "Match order") +console.log(printer.print([1, 2])) // prints an array + +printer.print(null) +// { id: 1 } and [1, 2] are objects, null is not +printer.received(2).print(Arg.any('object')) +``` + +Any other type name, for example a typo or another case such as `'String'`, throws a `TypeError` right away, in `Arg.any()` and in `Arg.any.not()` (TypeScript does not compile it in the first place): `Arg.any expects one of 'any', 'string', 'number', 'boolean', 'symbol', 'undefined', 'object', 'function', 'array', 'bigint' (or no argument for 'any'), but received 'strnig'.` + +```js +const { Substitute, Arg } = require('@fluffy-spoon/substitute') + +const printer = Substitute.for() +printer.print(Arg.any('bigint')).returns('a bigint') +console.log(printer.print(10n)) // prints a bigint + +Arg.any.not('strnig') // throws TypeError: Arg.any.not expects one of ``` +In TypeScript, a type matcher must fit the parameter: `Arg.any('string')` only fits a parameter that accepts strings, and `Arg.any('undefined')` only one that accepts `undefined`, such as `string | undefined`, an optional parameter or `unknown`. `Arg.any()` and `Arg.any('object')` fit any parameter (see [Typing limitations](#typing-limitations)). `Arg.any('undefined')` also matches an argument that the call leaves out (see [How arguments are compared](#how-arguments-are-compared)). + ```typescript -calculator.heavyOperation(1, 2).rejects(new Error()); -// same as calculator.heavyOperation(1, 2).returns(Promise.reject(new Error())); -console.log(await calculator.heavyOperation(1, 2)); // throws Error +import { Substitute, Arg } from '@fluffy-spoon/substitute' + +interface Users { + find(name?: string): string + count(limit: number): number +} + +const users = Substitute.for() +users.find(Arg.any('undefined')).returns('all users') +console.log(users.find(undefined)) // prints all users +console.log(users.find()) // prints all users + +// @ts-expect-error a number parameter does not accept undefined +users.count(Arg.any('undefined')) ``` -## Verifying calls +## Inverse matchers +`Arg.is.not(predicate)` and `Arg.any.not(type)` match the values that the matcher without `.not` does not match. + + ```typescript -calculator.enabled = true; -const foo = calculator.add(1, 2); +const isZero = (x: number) => x === 0 -// verify call to add(1, 2) -calculator.received().add(1, 2); +// the first argument matches any number, the second any number except 0 +calculator.divide(Arg.any('number'), Arg.is.not(isZero)).returns(10) +console.log(calculator.divide(100, 10)) // prints 10 +// calculator.divide(100, 0) does not match -// verify property set to "true" -calculator.received().enabled = true; +calculator.received(1).divide(Arg.any(), Arg.is.not(isZero)) +calculator.didNotReceive().divide(Arg.any.not('number'), Arg.any()) +``` + +## Ignoring all arguments +`Arg.all()` as the only argument matches every call, whatever its arguments: + + +```typescript +calculator.add(Arg.all()).returns(10) +console.log(calculator.add(1, 3)) // prints 10 +console.log(calculator.add(5, 2)) // prints 10 ``` -## Argument matchers -There are several ways of matching arguments. The examples below also applies to properties and fields - both when setting up calls and verifying them. +After other arguments, `Arg.all()` matches the rest of the arguments, which can also be none. The arguments before it must match as usual. Arguments after `Arg.all()` are an error (a `SubstituteException`). -### Matching specific arguments ```typescript -import { Arg } from '@fluffy-spoon/substitute'; +import { Substitute, Arg } from '@fluffy-spoon/substitute' -// ignoring first argument -calculator.add(Arg.any(), 2).returns(10); -console.log(calculator.add(1337, 3)); // prints undefined since second argument doesn't match -console.log(calculator.add(1337, 2)); // prints 10 since second argument matches +interface Logger { + log(message: string, ...details: string[]): void +} + +const logger = Substitute.for() +logger.log('saved') +logger.log('saved', 'id 42', 'extra') +logger.log('deleted', 'id 7') -// received call with first arg 1 and second arg less than 0 -calculator.received().add(1, Arg.is(x => x < 0)); +logger.received(2).log('saved', Arg.all()) +logger.received(1).log('deleted', Arg.all()) +logger.received(3).log(Arg.all()) ``` -### Generic and inverse matchers +## Matchers inside objects and arrays +Matchers also work inside plain objects and arrays, also nested ones (up to the limits below). An object with a matcher matches an argument with the same keys (in any order), and an array with a matcher matches an array of the same length. Each nested matcher matches by its own rule, and every other value must be [equal](#how-arguments-are-compared). Like any call with a matcher, such a call is a setup or a check, never a received call, and in the [match order](#match-order) it ranks with the other matcher setups. + ```typescript -import { Arg } from '@fluffy-spoon/substitute'; +import { Substitute, Arg } from '@fluffy-spoon/substitute' + +interface User { + id: number + name: string + roles: string[] +} + +interface Repository { + save(user: User): string +} -const equalToZero = (x: number) => x === 0; +const repository = Substitute.for() +repository.save({ id: Arg.any(), name: 'bob', roles: [Arg.is(role => role.startsWith('admin'))] }).returns('saved') -// first argument will match any number -// second argument will match a number that is not '0' -calculator.divide(Arg.any('number'), Arg.is.not(equalToZero)).returns(10); -console.log(calculator.divide(100, 10)); // prints 10 +console.log(repository.save({ id: 1, name: 'bob', roles: ['admin:all'] })) // prints saved +console.log(repository.save({ name: 'bob', roles: ['admin:read'], id: 2 })) // prints saved +// another name, or a second role, does not match +repository.save({ id: 3, name: 'ann', roles: ['admin:all'] }) +repository.save({ id: 4, name: 'bob', roles: ['admin:all', 'user'] }) -const argIsNotZero = Arg.is.not(equalToZero); -calculator.received(1).divide(argIsNotZero, argIsNotZero); +repository.received(2).save({ id: Arg.any(), name: 'bob', roles: [Arg.any()] }) +repository.received(4).save(Arg.all()) +repository.didNotReceive().save({ id: Arg.any(), name: 'bob', roles: [] }) ``` -> #### Note: `Arg.is()` will automatically infer the type of the argument it's replacing +* `Arg.all()` as the last item of an array matches the remaining items, also none: `['level', Arg.all()]` matches `['level']` and `['level', 1, 2]`. Anywhere else in an array it is a `SubstituteException`. As the value of a key, `Arg.all()` matches any value, but the key must be there. (In TypeScript, `Arg.all()` inside an object or array does not type-check; use `Arg.any()` for a single value.) +* Only plain objects (created with `{ }` or `Object.create(null)`) and arrays are searched for matchers, and an object with matchers only matches an argument with the same prototype: `{ id: Arg.any() }` does not match a class instance. A matcher inside a class instance, a `Map` or a `Set` is not looked for: it is compared as a value, so such a setup never matches, and the call is an ordinary call. Matchers behind getters are not looked for either. Use `Arg.is()` for the whole argument in these cases. +* The search for matchers is bounded, so that large arguments stay fast. An array with more than 1,024 items and an object with more than 1,024 keys are not searched, and neither are arrays and objects more than 32 levels below the argument. Each argument also has a budget of 1,024 arrays and objects, which each of them shares evenly among its items: in an array of 1,000 objects, each object is searched, but the objects inside them are not. An item of a searched array or object that is itself a matcher is always found. An array or object that several values of one argument refer to is searched once, and an argument looks at 32,768 items and keys in all at most: a matcher in an array or object beyond that is not found. An array or object with more than 256 items or keys that holds no matcher within these limits is remembered (weakly, so this keeps nothing alive), and so is an object with more than 1,024 keys, whose keys are not listed again. If the search looked at everything inside it, it is not searched again. If the limits left arrays or objects inside it out, the second time it is passed it is searched within the limits again, and then once more without the budget (but still at most 32 levels deep and 32,768 items and keys): if that finds no matcher either, it is not searched again, and otherwise it is searched within the limits every time. So a lookup table passed to every call costs nothing after the first two calls, and a new batch of records passed to each call is searched once, within the limits. A matcher put into such an array or object after it is no longer searched is not found, even if items or keys were deleted (see [How arguments are compared](#how-arguments-are-compared)). A matcher that is not found is compared as a value, as above. Setups like `save({ user: { id: Arg.any(), roles: [Arg.any('string'), 'admin'] } })`, or an object with a few hundred keys and a matcher, are far from these limits. +* `String(sub)` shows nested matchers, for example `save({ id: Arg.any{any}, name: 'bob' }) => returns('saved')`. + +## How arguments are compared +Arguments that are not matchers are compared with deep strict equality, the rule of `assert.deepStrictEqual` (`util.isDeepStrictEqual`). Objects and arrays are equal when they have the same prototype and their own enumerable properties (with string or symbol keys) are equal. `NaN` equals `NaN`, but `0` and `-0` are different. Where Node.js changed the rule, the library follows the running version: two invalid `Date`s are different up to Node.js 22 and equal from Node.js 24 on, and two cyclic objects whose cycles have a different shape are equal up to Node.js 22 and different from Node.js 24 on. Substitutes are compared by identity and never member by member. + +Arguments are compared position by position, up to the longer of the two argument lists. An argument that one side leaves out at the end counts as `undefined` there: it matches only a literal `undefined` or a matcher that accepts `undefined`, such as `Arg.any()`, `Arg.any('undefined')`, `Arg.is(value => value === undefined)` or `Arg.any.not('number')`. A predicate that throws for `undefined` (`Arg.is(name => name.length > 0)`) does not match, as always. So `f(1)` and `f(1, undefined)` are the same call: they match the same setups and checks, return the same [auto-substitute](#auto-substitutes-and-nested-members), and are one setup in the [`configure`](#re-configuring-a-call-configure) view, where a setup of one replaces a setup of the other. Arguments with values still count: `f(1)` and `f(1, 2)` are different calls, either way round. This applies to the arguments themselves only. Inside an array or an object, deep strict equality decides, so `[1]` and `[1, undefined]` are different, and so are `{ id: 1 }` and `{ id: 1, name: undefined }`. Failure messages show each call as it was made. -### Ignoring all arguments ```typescript -// ignoring all arguments -calculator.add(Arg.all()).returns(10); -console.log(calculator.add(1, 3)); // prints 10 -console.log(calculator.add(5, 2)); // prints 10 +import { Substitute, Arg } from '@fluffy-spoon/substitute' + +interface Cache { + get(key: string, options?: { fresh: boolean }): string +} + +const cache = Substitute.for() +cache.get('a', Arg.any()).returns('any options') +cache.get('b', undefined).returns('no options') +cache.get('c', Arg.any('object')).returns('with options') + +// the code under test leaves the options out +console.log(cache.get('a')) // prints any options +console.log(cache.get('b')) // prints no options +// Arg.any('object') does not accept undefined +console.log(cache.get('c') === 'with options') // prints false + +cache.received(1).get('b', undefined) +cache.received(3).get(Arg.any(), Arg.any()) +cache.didNotReceive().get(Arg.any(), Arg.any('object')) +``` + +So a check like `didNotReceive().get('a', Arg.any())` fails after `get('a')`, and a matcher setup that accepts `undefined` answers calls that leave the argument out, which matters when you [re-configure such a call](#re-configuring-a-call-configure). + +Errors follow Node.js' rule, too. An object that inherits from `Error.prototype` and has the `Symbol.toStringTag` `'Error'` is compared like an error (its `name` and `message` count), so it can be equal to a native error with the same message. Objects that `Object.prototype.toString` shows as `[object Object]` are compared by their keys alone: error-like objects without that tag, and native errors whose `Symbol.toStringTag` is `'Object'`. On Node.js 24 and newer, Node.js still compares a native error with that tag as an error when it is the first argument of `isDeepStrictEqual`, so there the result can depend on the order. The library then passes the value of the setup or the check first, and for [auto-substitutes](#auto-substitutes-and-nested-members) the value of the earlier call. + +```js +const { Substitute } = require('@fluffy-spoon/substitute') + +const handler = Substitute.for() +handler.handle(new Error('timeout')).returns('retry') + +// not a native error, but deep strictly equal to the error above +const errorLike = Object.create(Error.prototype, { + message: { value: 'timeout' }, + [Symbol.toStringTag]: { value: 'Error' } +}) +console.log(handler.handle(errorLike)) // prints retry ``` -### Match order -The order of argument matchers matters. The first matcher that matches will always be used. Below are two examples. +Deep strict equality cannot see `#private` fields or other internal state. So all instances of a class that keeps its state only in `#private` fields are equal to each other. For such classes, pass the same instance, or match with `Arg.is()`: ```typescript -calculator.add(Arg.all()).returns(10); -calculator.add(1, 3).returns(1337); -console.log(calculator.add(1, 3)); // prints 10 -console.log(calculator.add(5, 2)); // prints 10 +import { Substitute, Arg } from '@fluffy-spoon/substitute' + +class Money { + #cents: number + constructor(cents: number) { this.#cents = cents } + get cents() { return this.#cents } +} + +interface Bank { + pay(amount: Money): string +} + +const bank = Substitute.for() +bank.pay(new Money(100)).returns('paid') +// all Money instances are equal to each other +console.log(bank.pay(new Money(5))) // prints paid + +const checkedBank = Substitute.for() +checkedBank.pay(Arg.is(amount => amount.cents === 100)).returns('paid') +console.log(checkedBank.pay(new Money(5)) === 'paid') // prints false +console.log(checkedBank.pay(new Money(100))) // prints paid +``` + +A value that cannot be read, such as an object with a getter that throws or a revoked proxy, is equal only to itself: Node.js' deep equality throws when it has to read such a value, which counts as unequal, and it does not read a value that it compares with itself. So the same value matches, and so does a new array or object that holds that same value, but another such value never does. This is decided again for each call, setup and check: once the value can be read, it is compared by its contents, like any other value, so it matches a setup made with an equal object. (A setup made while the value could not be read keeps matching that value itself, like a setup whose argument changed afterwards; see below.) A call or a setup reads such a value at most once, and a check reads it at most about once for each received call that it compares it with (Node.js' deep equality stops at the first getter that throws). + +```js +const { Substitute } = require('@fluffy-spoon/substitute') + +// a record whose getter throws until it is loaded +const unloaded = () => Object.defineProperty({}, 'name', { enumerable: true, get() { throw new Error('not loaded') } }) + +const cache = Substitute.for() +const user = unloaded() +cache.store([user]).returns('stored') + +console.log(cache.store([user])) // prints stored +console.log(cache.store([unloaded()]) === 'stored') // prints false + +// once the record can be read, it is compared by its contents +let loaded = false +const record = Object.defineProperty({}, 'name', { enumerable: true, get() { if (loaded) return 'ann'; throw new Error('not loaded') } }) +cache.load(record) // the code under test passes the record before it is loaded +loaded = true +cache.load({ name: 'ann' }).returns('loaded') +console.log(cache.load(record)) // prints loaded +``` + +Changing an object after you used it as an argument of a setup is not supported. The setup still matches when the code under test passes that same object again, but not a new object that equals it, before or after the change: + +```js +const { Substitute } = require('@fluffy-spoon/substitute') + +const repository = Substitute.for() +const user = { name: 'ann' } +repository.save(user).returns('saved') +user.name = 'bob' + +console.log(repository.save(user)) // prints saved +console.log(repository.save({ name: 'bob' }) === 'saved') // prints false +console.log(repository.save({ name: 'ann' }) === 'saved') // prints false +``` + +The library remembers the hash of an object with more than 256 keys, and of a `Map` or `Set` with more than 256 entries, from the first time that it is passed to any substitute (weakly, with the object), so that later calls with it need not list it again. This never changes a result. When such an object has changed since, a call with it still matches a setup made with an equal object, whether the setup was made before or after the change, and it gets the same auto-substitute as an equal copy. So a setup arranged before the code under test runs works for an object that the code under test builds, also when it passes the object to another substitute on the way: + +```js +const { Substitute } = require('@fluffy-spoon/substitute') + +// the code under test builds an index, and logs it on the way +function buildIndex(words, logger, search) { + const index = {} + for (const word of words) { + index[word] = true + if (Object.keys(index).length === 300) logger.debug('index', index) + } + return search.load(index) +} + +const words = Array.from({ length: 500 }, (_, i) => `word${i}`) +const logger = Substitute.for() +const search = Substitute.for() +search.load(Object.fromEntries(words.map(word => [word, true]))).returns(42) + +console.log(buildIndex(words, logger, search)) // prints 42 + +// a setup made after a wide table changed is matched by copies of it, too +const translations = {} +for (let i = 0; i < 300; i++) translations[`key${i}`] = `text ${i}` + +const i18n = Substitute.for() +i18n.load(translations) // the code under test passes the table +translations.key0 = 'changed' +i18n.load(translations).returns('loaded') + +console.log(i18n.load(translations)) // prints loaded +console.log(i18n.load({ ...translations }) === 'loaded') // prints true ``` +What stays unsupported is changing an argument after the call or setup that it was passed to, as above. That also holds for the auto-substitute that a call returned: once its argument has changed, a later call with a copy of the argument's new state can get the auto-substitute of that call (for an object with more than 256 keys whose hash was remembered), or a new one (for a smaller object). And a [matcher](#matchers-inside-objects-and-arrays) that you put into an object or array with more than 256 keys or items after it was first passed is not recognised once the search for matchers has remembered it (see [Matchers inside objects and arrays](#matchers-inside-objects-and-arrays)). Passing the same object again always finds what was recorded for it. + +Received calls keep the argument objects themselves, so a check compares an argument as it is at the time of the check. If the code under test changes an object after passing it, check its new value. + +## Match order +When several setups match a call, the most specific one wins: + +1. a setup whose arguments are all literal values, +2. then a setup with at least one `Arg.any()` / `Arg.is()` matcher, also inside an object or array (or literals followed by `Arg.all()`), +3. then a setup with `Arg.all()` as its only argument. + +Among setups of the same kind, the one configured last wins, so a later setup overrides an earlier one. + + ```typescript -calculator.add(1, 3).returns(1337); -calculator.add(Arg.all()).returns(10); -console.log(calculator.add(1, 3)); // prints 1337 -console.log(calculator.add(5, 2)); // prints 10 +calculator.add(1, 3).returns(1337) +calculator.add(Arg.all()).returns(10) +calculator.add(Arg.is(a => a > 100), Arg.any()).returns(100) + +// literal arguments win over matchers, and matchers win over Arg.all() +console.log(calculator.add(1, 3)) // prints 1337 +console.log(calculator.add(200, 3)) // prints 100 +console.log(calculator.add(5, 2)) // prints 10 + +// among setups with matchers, the newest one wins +calculator.add(Arg.any(), Arg.is(b => b > 10)).returns(-1) +console.log(calculator.add(200, 30)) // prints -1 +console.log(calculator.add(200, 3)) // prints 100 ``` -## Partial mocks -With partial mocks you always start with a true substitute where everything is mocked and then opt-out of substitutions in certain scenarios. +## Re-configuring a call (configure) +Outside of a setup, a call whose literal arguments match an existing setup is a real call: it returns the configured value. So writing the call out again does not configure it again, and what `.returns()` does then depends on the configured value: +* A primitive like `10`, a plain object or an array has no `.returns()`, so you get a `TypeError`. +* A substitute that you created with `Substitute.for()` has a member called `returns`, like every other name. `.returns(x)` is recorded as a call of that member, and nothing is configured. Nothing fails, and TypeScript does not catch it either. +* An auto-substitute (an unconfigured member of a substitute) is configured itself: `.returns(x)` configures that member, not the call. + +This also happens when a matcher setup answers a call that leaves out an argument that the matcher accepts as `undefined` (see [How arguments are compared](#how-arguments-are-compared)): after `calculator.multiply(1, Arg.any()).returns(10)`, `calculator.multiply(1)` returns 10, so `calculator.multiply(1).returns(1)` throws a `TypeError`. Likewise, `f()` is the call `f(undefined)`, so `f(undefined).returns(a)` followed by `f().returns(b)` is one call written twice. Make the literal setup first, or use `configure`. + +Use `sub[configure]()` instead. It gives a view of the substitute in which every call and property read is a setup: it never runs an existing setup and is never recorded as a received call. + + ```typescript -import { Substitute, Arg } from '@fluffy-spoon/substitute'; +import { configure } from '@fluffy-spoon/substitute' + +calculator.add(Arg.all()).returns(10) +// add(1, 3) matches the setup above, so it returns 10 and has no .returns(): +calculator.add(1, 3).returns(1337) // throws TypeError: calculator.add(...).returns is not a function + +calculator[configure]().add(1, 3).returns(1337) +console.log(calculator.add(1, 3)) // prints 1337 +console.log(calculator.add(5, 2)) // prints 10 + +// the same applies to changing a value that is already configured, and to properties +calculator.isEnabled.returns(true) +calculator[configure]().isEnabled.returns(false) +console.log(calculator.isEnabled) // prints false +``` + +```js +const { Substitute, Arg, configure } = require('@fluffy-spoon/substitute') +const calculator = Substitute.for() +calculator.multiply(1, Arg.any()).returns(10) +// multiply(1) leaves out the second argument, which Arg.any() accepts +calculator.multiply(1).returns(1) // throws TypeError: calculator.multiply(...).returns is not a function + +calculator[configure]().multiply(1).returns(1) +console.log(calculator.multiply(1)) // prints 1 +console.log(calculator.multiply(1, 5)) // prints 10 +``` + +Calls with argument matchers are always setups (see [What counts as a call](#what-counts-as-a-call)), so a catch-all setup *after* a specific one needs no `configure`. In TypeScript, the `configure` view only offers the setup methods. + +A setup in the `configure` view can go through a member or a call that already answers with a value. If that value is a substitute, the setup goes to that substitute, which keeps its other setups. If it is a real value (a plain object, an array, a primitive), or the member is configured with `throws()`, `resolves()`, `rejects()` or `mimicks()`, its members cannot be configured, and the setup throws a `SubstituteException` that says so. Nothing is replaced in that case. Members and calls that do not answer with a value yet are configured as usual. + +```js +const { Substitute, configure } = require('@fluffy-spoon/substitute') + +const repository = Substitute.for() +repository.find(2).returns('two') + +const container = Substitute.for() +container.getRepository().returns(repository) + +// getRepository() answers with a substitute, so the setup goes to that substitute +container[configure]().getRepository().find(1).returns('one') +console.log(container.getRepository() === repository) // prints true +console.log(repository.find(1)) // prints one +console.log(repository.find(2)) // prints two + +container.settings.returns({ port: 80 }) +container[configure]().settings.port.returns(1) // throws SubstituteException: settings returns { port: 80 }, which is not a substitute +``` + +For a call without matchers, the setup that answers the call counts, also a matcher setup: after `lookup.get(Arg.any()).returns(repository)`, `lookup[configure]().get(5).find(3).returns('three')` configures `repository.find(3)`. + +# Partial mocks +With partial mocks you always start with a true substitute where everything is mocked, and then opt out of substitutions in certain scenarios: per call with `mimicks()`, or for a whole instance with `[mimick]()`. The examples use this implementation: + + +```typescript class RealCalculator implements Calculator { - add(a: number, b: number) => a + b; - subtract(a: number, b: number) => a - b; - divide(a: number, b: number) => a / b; + isEnabled = true + add(a: number, b: number) { return a + b } + subtract(a: number, b: number) { return a - b } + divide(a: number, b: number) { return a / b } + async heavyOperation(...numbers: number[]) { return numbers.reduce((total, n) => total + n, 0) } } -const realCalculator = new RealCalculator(); -const fakeCalculator = Substitute.for(); +const realCalculator = new RealCalculator() +``` + +```typescript // let the subtract method always use the real method -fakeCalculator.subtract(Arg.all()).mimicks(realCalculator.subtract); -console.log(fakeCalculator.subtract(20, 10)); // prints 10 -console.log(fakeCalculator.subtract(1, 2)); // prints -1 +calculator.subtract(Arg.all()).mimicks(realCalculator.subtract) +console.log(calculator.subtract(20, 10)) // prints 10 +console.log(calculator.subtract(1, 2)) // prints -1 -// for the add method, we only use the real method when the first arg is less than 10 -// else, we always return 1337 -fakeCalculator.add(Arg.is(x < 10), Arg.any()).mimicks(realCalculator.add); -fakeCalculator.add(Arg.is(x >= 10), Arg.any()).returns(1337); -console.log(fakeCalculator.add(5, 100)); // prints 105 via real method -console.log(fakeCalculator.add(210, 7)); // prints 1337 via fake method +// for the add method, use the real method only when the first argument is less than 10 +// else, always return 1337 +calculator.add(Arg.is(x => x < 10), Arg.any()).mimicks(realCalculator.add) +calculator.add(Arg.is(x => x >= 10), Arg.any()).returns(1337) +console.log(calculator.add(5, 100)) // prints 105 +console.log(calculator.add(210, 7)) // prints 1337 -// for the divide method, we only use the real method for explicit arguments -fakeCalculator.divide(10, 2).mimicks(realCalculator.divide); -fakeCalculator.divide(Arg.all()).returns(1338); -console.log(fakeCalculator.divide(10, 5)); // prints 5 -console.log(fakeCalculator.divide(9, 5)); // prints 1338 +// for the divide method, use the real method only for these exact arguments +calculator.divide(10, 2).mimicks(realCalculator.divide) +calculator.divide(Arg.all()).returns(1338) +console.log(calculator.divide(10, 2)) // prints 5 +console.log(calculator.divide(10, 5)) // prints 1338 ``` -## Throwing exceptions -Exceptions can be thrown on properties or methods. You can add different exceptions for different arguments +`sub[mimick](instance)` hands everything that is not configured to a real instance: property reads return the instance's values, method calls run the instance's methods (with `this` being the instance, unless you pass another one with `.call()` or `.apply()`), and assignments write to the instance. If the instance is a function, calling the substitute calls it, with the `this` of the call. Members that the instance does not have read as `undefined`. Setups still win, and every call is recorded, so you can verify it. Because real calls are passed on to the instance, configure a mimicked substitute through [`[configure]()`](#re-configuring-a-call-configure). + ```typescript -import { Substitute, Arg } from '@fluffy-spoon/substitute'; +import { mimick, configure } from '@fluffy-spoon/substitute' -interface Calculator { - add(a: number, b: number): number; - subtract(a: number, b: number): number; - divide(a: number, b: number): number; - isEnabled: boolean; -} +calculator[mimick](realCalculator) +console.log(calculator.add(2, 3)) // prints 5 +console.log(calculator.isEnabled) // prints true + +calculator[configure]().divide(Arg.all()).returns(0) +console.log(calculator.divide(1, 1)) // prints 0 -const calculator = Substitute.for(); -calculator.divide(Arg.any(), 0).throws(new Error('Cannot divide by 0')); -calculator.divide(1, 0); // throws the exception Error: Cannot divide by 0 +// the code under test sets a property +const disable = (c: Calculator) => { c.isEnabled = false } +disable(calculator) +console.log(realCalculator.isEnabled) // prints false + +calculator.received().add(2, 3) +calculator.received().isEnabled = false ``` -# Benefits over other mocking libraries -- Easier-to-understand fluent syntax. -- No need to cast to `any` in certain places (for instance, when overriding read-only properties) due to the `myProperty.returns(...)` syntax. -- Doesn't weigh much. -- Produces very clean and descriptive error messages. Try it out - you'll love it. -- Doesn't rely on object instances - you can produce a strong-typed fake from nothing, ensuring that everything is mocked. +In the `configure` view, a setup through a member of the instance whose value is a substitute goes to that substitute, and from then on the member reads as that substitute. The members of a real value of the instance cannot be configured: with `sub[mimick]({ settings: { port: 80 } })`, `sub[configure]().settings.port.returns(1)` throws a `SubstituteException`. Configure the whole member instead: `sub[configure]().settings.returns({ port: 1 })`. A setup through a method of the instance, like `sub[configure]().load().size.returns(1)`, does not run the real method. It creates a setup for `load()`, which from then on answers that call instead of the instance. + +The string `mimick` is not part of the API (any more): `sub.mimick(...)` is an ordinary member, like every name except the [conflicting names](#names-that-conflict-with-the-library). + +# Auto-substitutes and nested members +A member or call that is not configured returns an auto-substitute: a substitute of its own, created the first time and then reused. The same member, or the same method with equal arguments, always gives the same auto-substitute. So the code under test can use nested members without crashing, and you can configure and verify them: + +```js +const { Substitute } = require('@fluffy-spoon/substitute') + +const app = Substitute.for() +console.log(app.logger === app.logger) // prints true +console.log(app.getCalculator() === app.getCalculator()) // prints true + +app.getCalculator().add(1, 2).returns(99) +console.log(app.getCalculator().add(1, 2)) // prints 99 -# Beware -## Names that conflict with Substitute.js -Let's say we have a class with a method called `received`, `didNotReceive` or `mimick` keyword - how do we mock it? +// the code under test logs a message +app.logger.info('started') -Simple! We disable the proxy methods temporarily while invoking the method by using the `disableFor` method which disables these special methods. +app.logger.received().info('started') +app.logger.didNotReceive().info('stopped') +``` + +Setups and calls never leak between members: `app.add(1, 2).returns(99)` does not configure `app.getCalculator().add(1, 2)`, and the other way round. `String(app.logger)` and `console.log(app.logger)` show the path of an auto-substitute, `@Substitute.logger`, and what it received and how it is configured (see [Printing a substitute](#printing-a-substitute)). + +**Typing limitation:** in TypeScript, nested auto-substitutes are typed as plain values, not as substitutes, so `app.getCalculator().add(1, 2).returns(99)` and `app.logger.received()` do not compile. They do work at runtime (in JavaScript, or through a cast). In TypeScript, configure the member to return a substitute you create yourself; that is fully typed: ```typescript -class Example { - received(someNumber: number) { - console.log(someNumber); +import { Substitute } from '@fluffy-spoon/substitute' + +interface Logger { info(message: string): void } +interface Calculator { add(a: number, b: number): number } +interface App { + logger: Logger + getCalculator(): Calculator +} + +const app = Substitute.for() +const logger = Substitute.for() +const calculator = Substitute.for() +app.logger.returns(logger) +app.getCalculator().returns(calculator) + +calculator.add(1, 2).returns(99) +console.log(app.getCalculator().add(1, 2)) // prints 99 + +app.logger.info('started') +logger.received().info('started') +``` + +## Which calls lead to a setup or a check +The reads and calls that lead up to a setup or a check in the same expression, like `app.getCalculator()` in `app.getCalculator().add(1, 2).returns(99)`, are part of that setup or check, so they are not recorded as received calls. A value that the code under test got from a substitute keeps the call that returned it, though, so you can configure or check that value and still verify how the code under test got it: + +```js +const { Substitute } = require('@fluffy-spoon/substitute') + +// the code under test +function openConnection(driver) { + return driver.connect('db://test') +} + +const driver = Substitute.for() +const connection = openConnection(driver) +connection.isOpen.returns(true) + +console.log(connection.isOpen) // prints true +driver.received(1).connect('db://test') +driver.didNotReceive().connect('db://test') // throws SubstituteException +``` + +The library tells the two apart by where they happen: the reads and calls before a setup or a check are left out only when they were made in the same file and the same function as the setup or check. (It compares the first stack frame outside the library: the position of the enclosing function, or on Node.js before 14.18 its name.) A call is made where it is invoked, which is not always where the method was read. So: + +* A chain written over several lines, or in a helper function of your own, is one setup or check. +* A handle that you store and use in the same function is part of the setup: after `const logger = app.logger` and `logger.level.returns(3)`, the read of `app.logger` is not recorded. The same holds for a method that you read and then call in that function (`const load = app.load` and `load(1).size.returns(3)`). +* A handle that you get in one function and use in another one keeps the reads that produced it. For example, after `const click = app.handlers.click` in a test, `t.notThrows(() => click.received(1).fire())` runs the check in a callback, so the reads of `handlers` and `click` stay recorded, and `app.didNotReceive().handlers` would fail. +* Calls that the code under test makes in its own functions are kept. That includes calls through a method that the test hands to it, like `new UserService(api.getUser)` or `openWith(driver.connect)`: the call is made where the code under test invokes the method, and its `called at` line in failure messages names that place, not the line of the test that read `api.getUser`. (For a direct call like `api.getUser(1)`, the read and the call are the same place.) This holds also when the code under test invokes the method with the substitute as `this`, like `Reflect.apply(this.fetch, this.client, [id])`, `fetch.call(api, id)` or a wrapper such as `(...args) => Reflect.apply(method, client, args)`: whether a read and a call belong to one expression depends on where they happen, as described here, and `this` plays no part. +* `Reflect.apply()` and a function's `call`, `apply` and `bind` have no stack frame of their own, so in a test, `Reflect.apply(app.getUser, app, [2]).name.returns('bob')` is one setup, like `app.getUser(2).name.returns('bob')`. A method that a built-in function calls itself, like `getUser` in `[1, 2].map(api.getUser)`, is called by that function, not by the test: those calls are kept, also when the test then configures their results, and their `called at` line reads `called at Array.map ()`. (`map` passes the index and the array as well, so these calls are `getUser(1, 0, [1, 2])` and `getUser(2, 1, [1, 2])`.) +* Calls that the code under test makes from a promise job, like `Promise.resolve(id).then(getUser)`, are kept too. Such a call has no stack frame outside the library (the library ignores the `async` frames that V8 adds for the functions awaiting the promise), and a call without a frame is never part of a setup or check that has one. +* Only when neither the call nor the setup or check has a stack frame outside the library does position alone decide: a setup or check right after the call that returned its value, with no other use of a substitute in between, leaves that call out. That happens when V8 collects no stack frames, as with `Error.stackTraceLimit = 0` or a limit that V8 cannot use, and when the library cannot read them because `Error.prepareStackTrace` cannot be replaced for a moment, for example when `Error` is frozen (see below). + +```js +const { Substitute } = require('@fluffy-spoon/substitute') + +// the code under test calls the function that it is given +class UserService { + constructor(fetchUser) { + this.fetchUser = fetchUser + } + + load(id) { + return this.fetchUser(id) } } -const fake = Substitute.for(); +const api = Substitute.for() +const user = new UserService(api.getUser).load(1) +user.name.returns('ann') + +console.log(user.name) // prints ann +api.received(1).getUser(1) +api.didNotReceive().getUser(1) // throws SubstituteException +``` + +```js +const { Substitute, Arg } = require('@fluffy-spoon/substitute') + +// the code under test calls the method with the client as `this` +class Loader { + constructor(client, fetch) { + this.client = client + this.fetch = fetch + } + + load(id) { + return Reflect.apply(this.fetch, this.client, [id]) + } +} -// BAD: this would have called substitute.js' "received" method. -// fake.received(2); +const api = Substitute.for() +const user = new Loader(api, api.getUser).load(1) +user.name.returns('ann') +api.received(1).getUser(1) +api.didNotReceive().getUser(1) // throws SubstituteException -// GOOD: we now call the "received" method we have defined in the class above. -Substitute.disableFor(fake).received(1337); +// Array.prototype.map calls getUser, so these calls are kept +const users = [1, 2].map(api.getUser) +users[1].name.returns('bob') +console.log(users[1].name) // prints bob +api.received(3).getUser(Arg.all()) -// now we can assert that we received a call to the "received" method. -fake.received().received(1337); +// in the test, Reflect.apply() is part of the setup +const app = Substitute.for() +Reflect.apply(app.getUser, app, [2]).name.returns('bob') +console.log(app.getUser(2).name) // prints bob +app.received(1).getUser(2) ``` -## Contributors +```js +const { Substitute, received } = require('@fluffy-spoon/substitute') + +// the code under test calls getUser from a promise job +const loadUser = (getUser, id) => Promise.resolve(id).then(getUser) + +async function test() { + const getUser = Substitute.for() + const user = await loadUser(getUser, 1) + user.name.returns('ann') + + console.log(user.name) // prints ann + getUser[received](1)(1) +} +test() +``` + +To read the stack frames, the library replaces `Error.prepareStackTrace` for a moment and then restores the exact property it found, so formatters such as `source-map-support` and `stack-chain` stay installed, and `Error.stack` stays a string. If the property cannot be replaced, the library reads no frames, and position alone decides, as above, although failure messages still have their `called at` lines. That is the case for: + +* a non-configurable, non-writable value. `Object.freeze(Error)` makes one on Node.js 20.20 and newer, where `Error` has an own `prepareStackTrace` (Node.js' own formatter); +* a missing property that cannot be added. On Node.js before 20.20, `Error` has no own `prepareStackTrace` unless a formatter installed one, so there `Object.freeze(Error)`, `Object.seal(Error)` and `Object.preventExtensions(Error)` all keep the library from reading frames. (On Node.js 20.20 and newer, a sealed or non-extensible `Error` keeps its writable `prepareStackTrace`, so the library reads frames.); +* a non-configurable accessor, which `stack-chain` defines when `Error.prepareStackTrace` is not already an own configurable property of `Error` when `stack-chain` loads (for example on Node.js 18; on Node.js 20.20, 22, 24 and 26 it is one, so the library reads frames there). + +While it captures a stack, the library also lowers `Error.stackTraceLimit` to 1 for a moment, where it can, and then restores it. It never defines or deletes the property, and leaves it as it found it. When the limit is a number of at least 1 that cannot be lowered, because the property is read-only or `Error` is frozen, each operation captures as many frames as the limit says, which is a little slower. When V8 collects no stack frames for any error, the library captures none either: with a limit that is an accessor (with or without a setter), that is missing (deleted), that is not a number (for example a string), or that is below 1, as with `Error.stackTraceLimit = 0`. Failure messages then have no `called at` lines, and position alone decides. + +```js +// for example in a hardened environment +Object.freeze(Error) +const { Substitute } = require('@fluffy-spoon/substitute') + +const calculator = Substitute.for() +calculator.add(1, 2).returns(3) +console.log(calculator.add(1, 2)) // prints 3 +calculator.received(2).add(1, 2) // throws SubstituteException +console.log(Error.stackTraceLimit) // prints 10 + +// the library cannot read frames, so position decides: the setup right after +// openConnection() leaves the call out (see the example at the top of this section) +function openConnection(driver) { + return driver.connect('db://test') +} +const driver = Substitute.for() +const connection = openConnection(driver) +connection.isOpen.returns(true) +driver.didNotReceive().connect('db://test') +driver.received(1).connect('db://test') // throws SubstituteException +``` + +# Verifying calls +## received and didNotReceive +`received()` checks that a call was received at least once, `received(count)` that it was received exactly `count` times, and `didNotReceive()` that it was never received. A failed check throws a [`SubstituteException`](#substituteexception). + + +```typescript +calculator.add(1, 2) +calculator.add(1, 2) +calculator.add(3, 4) + +calculator.received().add(1, 2) +calculator.received(2).add(1, 2) +calculator.received(3).add(Arg.all()) +calculator.didNotReceive().add(5, 6) +calculator.received(0).add(5, 6) // the same as didNotReceive() + +calculator.received(1).add(1, 2) // throws SubstituteException +``` + +The count must be a non-negative integer, or left out (meaning "1 or more"). Anything else (a negative or fractional number, `NaN`, `Infinity`, a string) throws a `SubstituteException` instead of letting the check pass: + + +```typescript +const items = ['a', 'b'] +calculator.received(items.length - 3).add(1, 2) // throws SubstituteException: Expected count has to be a non-negative integer +``` + +A failed check describes what was expected and lists the calls that were received (at most 50 of them): + + +```typescript +calculator.add(1, 2) +calculator.received().add(3, 4) // throws SubstituteException +``` + + +```text +SubstituteException: Call count mismatch in @Substitute.add: +Expected to receive 1 or more method calls matching add(3, 4), but received none. +All property or method calls to @Substitute.add received so far: +› ✘ @Substitute.add(1, 2) + called at Object. (test/calculator.test.ts:2:12) +``` + +The `called at` lines are stack frames, formatted by Node.js like any stack trace. Each recorded read or call captures its stack once, and Node.js formats the text only when a message shows it. So source maps apply: with `node --enable-source-maps`, jest with `ts-jest`, vitest (also in its `vm` pools) and `tsx`, they name the lines of your TypeScript source. A formatter installed as `Error.prepareStackTrace` formats them, too: the one in place when the message is made. (If it was removed by then, the lines of property reads in a chain, like `app.config` in `app.config.get('x')`, can still come from the last formatter the library saw.) A call through a method reference is shown where it was invoked; see [Which calls lead to a setup or a check](#which-calls-lead-to-a-setup-or-a-check). + +When the member was never used at all, the check fails as soon as it reads the member, before the arguments are known, so the message cannot name them: `Expected to receive 1 or more property reads or method calls matching add, but received none.` Once the method has been called, the message names the expected arguments, as above. + +A method that was read but never called fails a method check right away with the reads listed, and a hint: + + +```typescript +// the code under test registers a handler, which never fires +const handler = calculator.subtract +calculator.received(2).subtract(5, 1) // throws SubstituteException +``` + + +```text +SubstituteException: Call count mismatch in @Substitute.subtract: +Expected to receive 2 property reads or method calls matching subtract, but received 1 property read and no method calls. +All property or method calls to @Substitute.subtract received so far: +› ✘ @Substitute.subtract + called at Object. (test/calculator.test.ts:2:28) +@Substitute.subtract was read 1 time without being called; reading a method does not count as calling it. +``` + +The message contains ANSI colours only when the output is a terminal. `NO_COLOR`, `NODE_DISABLE_COLORS` and `TERM=dumb` turn colours off, and `FORCE_COLOR` turns them on. + +## Properties +`received().property` counts reads of a property, and `received().property = value` counts assignments of that value (matchers work here as well). + + +```typescript +// the code under test reads the property and sets it +const toggle = (c: Calculator) => { c.isEnabled = !c.isEnabled } + +calculator.isEnabled.returns(false) +toggle(calculator) + +calculator.received(1).isEnabled +calculator.received().isEnabled = true +calculator.received(1).isEnabled = Arg.any() +calculator.didNotReceive().isEnabled = false +``` + +In TypeScript, assigning a property on the substitute itself (`calculator.isEnabled = true`) does not compile, see [Typing limitations](#typing-limitations). The code under test assigns through its own type, like `toggle` above. In a check, read-only properties can be assigned, and optional properties that are not functions accept `undefined` (`form.received().note = undefined`). An optional callback (`onChange?: (value: string) => void`) does not; see [Typing limitations](#typing-limitations) for how to check that it was cleared. + +## What counts as a call +* Every invocation is a call of its own, also through a stored or destructured reference or a callback. +* `new` is a call, too: `new sdk.Client('https://api')` counts as a call `Client('https://api')` (see [Creating a substitute](#creating-a-substitute)). +* A call that leaves out arguments at the end is a call with `undefined` there: `f(1)` and `f(1, undefined)` count as the same call (see [How arguments are compared](#how-arguments-are-compared)). +* `.call()`, `.apply()` and `.bind()` work on a method, a function substitute and every other substitute value as on a function: `calculator.subtract.call(undefined, 5, 1)` returns what `calculator.subtract(5, 1)` is configured to return, and counts as a call `subtract(5, 1)`. It counts as a call of a member called `call` as well; see [`call`, `apply` and `bind`](#call-apply-and-bind). +* Reading a method without calling it, for example to register it as an event handler that never fires, is not a call. Method checks (`received().subtract(...)`, also with `Arg.all()`) only count invocations. +* A call with an argument matcher (`Arg.any()`, `Arg.is()`, `Arg.all()`, also with `.not`, also [inside an object or array](#matchers-inside-objects-and-arrays)) is a setup or a check, never a received call. It does not run an existing setup either. +* The reads and calls that lead up to a setup or a check in the same expression are not recorded; see [Which calls lead to a setup or a check](#which-calls-lead-to-a-setup-or-a-check). +* Checks never run setups or mimicked implementations, and are never recorded themselves. Checking a property configured with `throws()` does not throw, and checking a property configured with a sequence does not use up a value. + + +```typescript +const { add } = calculator +for (const n of [1, 2, 3]) add(n, n) +calculator.received(3).add(Arg.all()) + +const handler = calculator.subtract +calculator.received().subtract(Arg.all()) // throws SubstituteException + +calculator.subtract(5, 1).returns(4) +console.log(calculator.subtract.call(undefined, 5, 1)) // prints 4 +calculator.received(1).subtract(5, 1) + +calculator.divide(Arg.any(), 2) // a setup without a value, not a call +calculator.didNotReceive().divide(Arg.all()) +``` + +**Known issue in 2.0.1:** `didNotReceive().subtract(...)` (or `received(0)`) on a method that has been read but never called fails, because the library decides at `.subtract` whether you check a property read or a method call. If the code under test registers a method without calling it, clear the received calls after that (see below) before you check that it was not called. + +## Clearing received calls +`sub[clearReceivedCalls]()` forgets the received calls of a substitute and of its auto-substitutes. Setups are kept, including the position in a sequence of return values, and so are the auto-substitutes (`app.logger` stays the same object). To start over completely, create a new substitute. + + +```typescript +import { clearReceivedCalls } from '@fluffy-spoon/substitute' + +calculator.add(1, 2).returns(3) +calculator.add(1, 2) +calculator[clearReceivedCalls]() + +calculator.didNotReceive().add(1, 2) +console.log(calculator.add(1, 2)) // prints 3 +``` + +## SubstituteException +Failed checks, and invalid use of the library such as `received(-1)` or arguments after `Arg.all()`, throw a `SubstituteException`. It is exported, so you can check for it with `instanceof`: + + +```typescript +import { SubstituteException } from '@fluffy-spoon/substitute' + +try { + calculator.received().add(1, 2) +} catch (error) { + console.log(error instanceof SubstituteException) // prints true +} +``` + +## Assertions that fail later +Checks throw right away, with one exception: a property-style check, `sub.received(count).member` or `sub.didNotReceive().member` that is not followed by a call, on a member that has been called as a method. The library cannot know yet whether you are about to call it (`sub.received(2).member(...)`), so it reports the failure later, from a microtask (`queueMicrotask`; `process.nextTick` on Node.js 10, which has no `queueMicrotask`), and cancels the report if you call the member. There are two cases: + +* The property check fails, as in `calculator.received(2).add` below. +* `didNotReceive().member` or `received(0).member` on a member that was only called, never read: it would pass as a property check, but the parentheses were probably forgotten. The report says so: `Expected to receive 0 property reads or method calls matching add, but received 1 method call. add was called 1 time as a method; to assert calls, invoke it: sub.didNotReceive().add(...)`. + +Such a failure escapes `try`/`catch` and `t.throws()`: it is an uncaught exception, thrown from a microtask once the current synchronous code has finished. + + +```typescript +calculator.add(1, 2) +calculator.add(1, 2) +calculator.add(3, 4) + +// not followed by a call, so the library cannot decide yet: +// the SubstituteException is thrown later, from a microtask +calculator.received(2).add +``` + + +```typescript +calculator.add(1, 2) + +// the parentheses are missing: reported later, from a microtask +calculator.didNotReceive().add +``` + +To avoid this, check methods with a call (`calculator.received(2).add(1, 2)`, or `.add(Arg.all())`). Those are decided right away. + +Every test runner fails the run, but not all of them can tie the failure to the test, and two of them stop running tests. Seen with jest 29.7 and 30.5, vitest 5.1, ava 6.4, mocha 12.0 and node:test on Node.js 22, 24 and 26; the [compatibility checks](#test-runners) pin this for jest 30, vitest, ava, mocha and node:test on every change, with passing tests before and after the failing one (and, for mocha and ava, a second test file): + +* jest 29, and jest 30 on Node.js 24 and newer: as the failure of the running test (`● `). The other tests and test files still run and are reported, in band and with workers. +* jest 30 on Node.js 22: as a failure of the test file ("Test suite failed to run"). The other tests in the file still run and pass, and the run fails. (Node.js 22 loses the test context that jest 30 looks up for an exception thrown from a microtask.) +* vitest: every test runs and is listed as passed, and the run fails with one error: an "Unhandled Errors" entry with the `SubstituteException`, which names the test ("The last test to run before this error was ..."). This holds with `vi.useFakeTimers()` and in the `vm` pools, too. +* node:test: every test runs and passes, and the test file fails ("A resource generated asynchronous activity after the test ended", with the `SubstituteException`). +* mocha: the test is listed as passed (`✔ `) and then as failed (`1) `, with "Uncaught SubstituteException"), so the summary counts it both as passing and as failing. **Then mocha stops the run:** the tests after it in the same file, and every test in later files, do not run and are not listed. The run exits with a non-zero code. mocha marks a synchronous test as passed as soon as it returns, so no other way of reporting the failure later could change this. +* ava: `Uncaught exception in ` with the `SubstituteException`, the failing test listed as passed (`√ `), `× exited with a non-zero exit code: 1`, and "1 uncaught exception" in the summary. **ava ends the worker of that test file:** the tests of that file that had not finished are not reported at all. ava runs the tests of a file concurrently, so this includes `async` tests written before the failing one. Tests in other files, which run in other workers, are reported as usual. The run exits with a non-zero code. +* Plain Node.js prints the uncaught exception and exits with code 1. + +With mocha and ava, a check that fails later can therefore hide the results of other tests, including other failures. Fix it first, or avoid it altogether by checking methods with a call, as above. + +The report is scheduled with the `queueMicrotask` that the library found when it was loaded, so fake timers that are installed later, such as `jest.useFakeTimers()` or `vi.useFakeTimers()` in a test, or `@sinonjs/fake-timers` faking `queueMicrotask` and `nextTick`, do not delay or swallow it. Fake timers that replace `queueMicrotask` before the library is loaded, for example jest's `fakeTimers: { enableGlobally: true }` configuration or a setup file that installs them before the library is imported, can delay the report until the fake clock runs its microtasks. + +# Names that conflict with the library +A substituted type may have members with the same names as the library's methods: `received`, `didNotReceive`, `returns`, `throws`, `resolves`, `rejects` or `mimicks`. Each of them has a symbol (exported from the package) that always means the library method. Members called `call`, `apply` or `bind` need care too, because every function has them; see [`call`, `apply` and `bind`](#call-apply-and-bind). + +## In TypeScript +If the substituted type has a member with one of these names, `sub.received()` and `sub.didNotReceive()` are not offered, because they would be ambiguous. Use the symbols `sub[received]()` and `sub[didNotReceive]()`; they are always available. + +In generic code, the type parameter's constraint decides. A type parameter without a constraint gets the string forms: `sub.received()` and `sub.didNotReceive()` are offered on `SubstituteOf`, and the setup methods on calls that return `T`. For `T extends Account`, where `Account` has a member called `returns`, only the symbols are offered, as for `Account` itself. +```typescript +import { Substitute, Arg, received } from '@fluffy-spoon/substitute' + +class Example { + received(someNumber: number) { + return someNumber + } +} + +const fake = Substitute.for() + +// `fake.received` is the class' own method +fake.received(1).returns(2) +console.log(fake.received(1)) // prints 2 + +// check it with the symbol +fake[received]().received(1) +fake[received](1).received(Arg.any()) +fake[received](2).received(1) // throws SubstituteException +``` + +In the same way, `.returns()`, `.throws()`, `.mimicks()`, `.resolves()` and `.rejects()` are not offered on a value that has its own member with that name. That value is the property's type, or the return type of the call. Use the symbols `[returns]`, `[throws]`, `[mimicks]`, `[resolves]` and `[rejects]` there; they always work. + +```typescript +import { Substitute, returns } from '@fluffy-spoon/substitute' + +interface Order { + returns: string[] + total(): number +} + +interface Shop { + find(id: string): Order +} + +const shop = Substitute.for() +const order = Substitute.for() + +// an Order has a member called `returns`, so shop.find('1').returns is that member +shop.find('1')[returns](order) +order.total().returns(42) + +console.log(shop.find('1').total()) // prints 42 +``` + +At runtime, `.returns`, `.throws`, `.resolves`, `.rejects` and `.mimicks` on a member or call that is *not* configured always mean the setup methods. So if the code under test uses a member with one of these names on a value it gets from a substitute, configure that value first, as `shop.find('1')` above. + + +```typescript +import { Substitute, SubstituteOf, Arg } from '@fluffy-spoon/substitute' + +interface Repository { + get(id: string): T +} + +function stubGet(repository: SubstituteOf>, value: T) { + repository.get(Arg.any()).returns(value) +} + +function receivedOnce(sub: SubstituteOf) { + return sub.received(1) +} +``` + + +```typescript +const users = Substitute.for>() +stubGet(users, 'ann') +console.log(users.get('1')) // prints ann +receivedOnce(users).get('1') +``` + +With a constrained type parameter, such as in a helper or a test fixture written for every `T extends Calculator`, setups, checks and the `configure` view work through the constraint, also for keys that exist only through the constraint's string index signature, and the values they take are checked against the constraint's member types. [Typing limitations](#typing-limitations) lists the exceptions: optional and nullable members on TypeScript older than 4.8, methods whose return type differs between the variants of a union constraint (and, on TypeScript 5.4 and newer, methods that they declare with different parameter lists), and checks of sets of keys that exist only through an index signature. + +```typescript +import { Substitute, SubstituteOf, Arg, configure } from '@fluffy-spoon/substitute' + +interface Calculator { + add(a: number, b: number): number + total: number +} + +interface ScientificCalculator extends Calculator { + sqrt(x: number): number +} + +class CalculatorFixture { + readonly calculator: SubstituteOf = Substitute.for() + + arrange() { + this.calculator.add(Arg.all()).mimicks((a, b) => a + b) + this.calculator.total.returns(10) + this.calculator[configure]().add(0, 0).returns(-1) + } + + verifyAdded(a: number, b: number) { + this.calculator.received(1).add(a, b) + } +} + +const fixture = new CalculatorFixture() +fixture.arrange() +fixture.calculator.sqrt(4).returns(2) + +console.log(fixture.calculator.add(1, 2)) // prints 3 +console.log(fixture.calculator.add(0, 0)) // prints -1 +console.log(fixture.calculator.total + fixture.calculator.sqrt(4)) // prints 12 +fixture.verifyAdded(1, 2) +``` + +`clearReceivedCalls`, `mimick` and `configure` exist only as symbols, so members with those names never conflict. + +## In JavaScript +Without types, the library decides by how a name is used: + +* `sub.received(...)` and `sub.didNotReceive()` are checks when they are called and followed by a member, like `sub.received(2).add(1, 2)`. Followed by `.returns()`, `.throws()`, `.resolves()`, `.rejects()` or `.mimicks()`, they configure a member of your own called `received` or `didNotReceive`. +* `sub.received` that is not called is an ordinary member, so the code under test can read a property called `received`. +* `sub.received(count)` or `sub.didNotReceive()` followed directly by a call checks a call of the substitute itself: `listener.received(1)('saved')` checks that the function substitute `listener` was called with `'saved'`. On a member, `sub.method.received(1)(5)` checks the calls `sub.method(5)`. +* The symbols `sub[received]()` and `sub[didNotReceive]()` are always checks. Use them to check members called `returns`, `throws`, `resolves`, `rejects` or `mimicks`. + +```js +const { Substitute, received } = require('@fluffy-spoon/substitute') + +const mailbox = Substitute.for() +mailbox.received(1).returns(['mail']) +console.log(mailbox.received(1)) // prints [ 'mail' ] + +const builder = Substitute.for() +builder.returns(5) // the code under test calls its own `returns` method +builder[received]().returns(5) +``` + +## call, apply and bind +Every function has `call`, `apply` and `bind`, and a substituted object can have members with these names of its own, like the `call(method, ...args)` of an RPC client or the `bind(port)` of a socket. On every substitute value that can be called (a substitute, a member like `sub.method`, the result of a call, a nested auto-substitute), `x.call`, `x.apply` and `x.bind` therefore give a helper that handles both meanings: + +* If a setup for a member called `call`, `apply` or `bind` matches the arguments as they are, it answers. Such a setup comes from `x.call('getUser', 1).returns(user)`, from the `configure` view, or from a mimicked instance with such a member. +* Otherwise the helper works like the function's own `call`, `apply` and `bind`: it returns what `x(...arguments)` is configured to return, and a mimicked function or a `mimicks()` function gets the first argument as `this`. + +Either way, the invocation is recorded once and counts in both meanings: as a call of the member (`x.received().call('getUser', 1)`) and as a direct call of `x` (`x[received]()(1)`, or `sub.received().method(1)` when `x` is `sub.method`). `String(sub)` and failure messages show it once, for example `rpc(1) via .call('getUser', 1)`. A setup written through `call`, `apply` or `bind` only configures the member: `client.rpc.call('getUser', 1).returns(user)` does not answer `client.rpc.call('deleteUser', 1)` or `client.rpc(1)`. + +```js +const { Substitute, received } = require('@fluffy-spoon/substitute') + +// an RPC client with a member called call +const client = Substitute.for() +client.rpc.call('getUser', 1).returns({ name: 'ann' }) +console.log(client.rpc.call('getUser', 1)) // prints { name: 'ann' } +client.rpc.received(1).call('getUser', 1) +// the same invocation, read as rpc(1) with 'getUser' as this +client.received(1).rpc(1) + +// a function substitute that a helper calls through apply() +const once = fn => { + let done = false + return function (...args) { + if (!done) { + done = true + return fn.apply(this, args) + } + } +} +const listener = Substitute.for() +listener('saved').returns('ack') +console.log(once(listener)('saved')) // prints ack +listener[received](1)('saved') +``` + +* `x.bind(thisArg, ...arguments)` itself only counts as a call of a member called `bind`. Calling the function it returns is a direct call of `x`, with the bound arguments first. `.returns()` on the result of `x.bind(...)` configures the member `bind`. +* `x.apply(thisArg, value)` with a primitive `value` only has the member meaning, because a function's `apply` would throw. +* A member `call`, `apply` or `bind` configured as a property (`sub[configure]().call.returns(value)`) reads as that value. A substitute that mimicks an object without such a member reads it as `undefined`, like the object. +* In the `configure` view, `call`, `apply` and `bind` are ordinary members. + +# The symbol API +All of these are exported from the package root. + +| Symbol | Usage | Notes | +|---|---|---| +| `received` | `sub[received](count?).member...` | Always a check. | +| `didNotReceive` | `sub[didNotReceive]().member...` | Always a check, the same as `[received](0)`. | +| `clearReceivedCalls` | `sub[clearReceivedCalls]()` | Symbol only. See [Clearing received calls](#clearing-received-calls). | +| `mimick` | `sub[mimick](instance)` | Symbol only. See [Partial mocks](#partial-mocks). | +| `configure` | `sub[configure]().member...` | Symbol only. See [Re-configuring a call](#re-configuring-a-call-configure). | +| `returns`, `throws`, `resolves`, `rejects`, `mimicks` | `sub.member(...)[returns](value)`, `sub.property[throws](error)` | The same as the string methods. They configure a member or a call, so using them on the substitute itself (`sub[returns](1)`) is an error. | + +The symbols are registered with `Symbol.for()`, so they also work when two copies of the package are installed. + +# Special members +A few members are handled by the substitute itself and cannot be configured or checked: + +* `then` is always `undefined`, so a substitute is not a thenable. You can return it from an `async` function or `await` it, and you get the substitute back. In TypeScript, a member called `then` is typed `never`. +* `toJSON`: `JSON.stringify(sub)` gives the same text as `String(sub)`. +* `Symbol.toPrimitive` and `util.inspect.custom`: `String(sub)`, template strings and `console.log(sub)` show the substitute's setups and received calls (see [Printing a substitute](#printing-a-substitute)). + +```typescript +import { Substitute } from '@fluffy-spoon/substitute' + +interface Calculator { add(a: number, b: number): number } + +const calculator = Substitute.for() +async function load() { return calculator } +load().then(loaded => console.log(loaded === calculator)) // prints true +``` + +JavaScript, Node.js and test libraries read some members to find out what a value is. Unless you configure them, these read as `undefined` on every substitute and auto-substitute, and the reads are not recorded: + +* `Symbol.iterator`, `Symbol.asyncIterator`, `Symbol.hasInstance`, `Symbol.isConcatSpreadable`, `Symbol.match`, `Symbol.matchAll`, `Symbol.replace`, `Symbol.search`, `Symbol.split`, `Symbol.species`, `Symbol.toStringTag` and `Symbol.unscopables`, +* `util.promisify.custom`: both `Symbol.for('nodejs.util.promisify.custom')` and the running Node.js' own `require('util').promisify.custom`, which is a different symbol on Node.js 10.0 to 12.16.1 and 13.0 to 13.11, +* `asymmetricMatch`, which jest reads to find asymmetric matchers, +* `__esModule`, which code compiled from ES modules reads to find out whether a CommonJS module is an ES module (TypeScript with `esModuleInterop`, Babel and esbuild). + +So `[].concat(sub)` keeps the substitute as one element, `value instanceof sub.SomeClass` is `false`, `'text'.startsWith(sub.prefix)` works, `util.promisify(sub.readFile)` calls the substitute on every supported Node.js version (so a `mimicks()` setup that calls the callback works), `Object.prototype.toString.call(sub)` is `'[object Function]'`, and jest's `toEqual(sub)` and `toHaveBeenCalledWith(sub)` compare a substitute by identity, like any other function. A substitute is not iterable: `[...sub]`, `for...of`, `for await...of` and `Promise.all(sub)` throw a `TypeError`. A substitute that stands in for a whole module, for example one that a `jest.mock()` factory returns for a CommonJS module, is its own default export: `import mailer from './mailer'` gives the substitute itself, so the setups made on it answer the code under test. + +Unlike `then`, these members can be configured, through the `configure` view or by mimicking an instance that has them. The plain `sub[Symbol.iterator]().returns(...)` does not work, because the read gives `undefined`. + +```js +const { Substitute, configure, mimick } = require('@fluffy-spoon/substitute') + +const empty = Substitute.for() +console.log([].concat(empty).length) // prints 1 +const spread = () => [...empty] +spread() // throws TypeError + +const numbers = Substitute.for() +numbers[configure]()[Symbol.iterator]().mimicks(() => [1, 2][Symbol.iterator]()) +console.log([...numbers]) // prints [ 1, 2 ] + +const letters = Substitute.for() +letters[mimick](['a', 'b']) +console.log([...letters]) // prints [ 'a', 'b' ] + +const tagged = Substitute.for() +tagged[configure]()[Symbol.toStringTag].returns('Tagged') +console.log(Object.prototype.toString.call(tagged)) // prints [object Tagged] + +// what TypeScript (with esModuleInterop) makes of `import mailer from './mailer'` +const importDefault = mod => (mod && mod.__esModule) ? mod : { default: mod } +const mailerModule = Substitute.for() +console.log(importDefault(mailerModule).default === mailerModule) // prints true +``` + +## Printing a substitute +`String(sub)`, template strings, `util.inspect(sub)`, `console.log(sub)` and `JSON.stringify(sub)` show the received calls and the setups of a substitute. An auto-substitute shows its path, such as `@Substitute.logger`, `@Substitute.getUser(1)` or `@Substitute.a.b('x').c`, followed by its own received calls and setups, if it has any. A substitute also lists those of its auto-substitutes, under their paths: the calls in the order they were made, the setups in the order they were configured. A read of a member, like `logger` before `logger.info('started')`, is a received call of its own, so it is listed, too. In a failure message, in the printout of another substitute and in a path, an auto-substitute shows only its path, as in `emit('created', @Substitute.child)`. A call made with `new` shows as `new Client('https://api')`. + +```js +const { Substitute } = require('@fluffy-spoon/substitute') + +const app = Substitute.for() + +// the code under test +app.logger.info('started') +app.save({ id: 1 }) + +app.logger.level.returns(3) +app.getUser(1).name.returns('ann') + +const printedApp = [ + '@Substitute {', + ' received:', + ' logger', + " logger.info('started')", + ' save({ id: 1 })', + ' configured:', + ' logger.level => returns(3)', + " getUser(1).name => returns('ann')", + '}' +] +console.log(String(app) === printedApp.join('\n')) // prints true + +const logger = app.logger +const printedLogger = [ + '@Substitute.logger {', + ' received:', + " info('started')", + ' configured:', + ' level => returns(3)', + '}' +] +console.log(String(logger) === printedLogger.join('\n')) // prints true + +console.log(`${app.getUser(2)}`) // prints @Substitute.getUser(2) +console.log(JSON.stringify({ user: app.getUser(2) })) // prints {"user":"@Substitute.getUser(2)"} +``` + +jest and vitest print a function, and so a substitute, with its `name` member, which is a member of the substitute like any other: `expect(...)` failure messages show `app.logger` as `[Function @Substitute.logger.name]` (or as the value that `name` is configured to return). Printing a substitute for such a message reads `name` (vitest also reads `constructor`), and these reads are recorded. + +## Freezing, defined properties and `in` +`Object.freeze()`, `Object.seal()` and `Object.preventExtensions()` work on a substitute and on an auto-substitute, and it keeps working afterwards: reads, calls, `new`, setups, checks and printing work as before, and `Object.isFrozen()`, `Object.isSealed()` and `Object.isExtensible()` say what was done. So code under test that freezes what it is given, like `this.options = Object.freeze(options)`, works with a substitute. + +`Object.defineProperty(sub, key, descriptor)` defines a real property of the substitute. Reads return its value (a getter runs with the substitute as `this`), assignments write it (or fail, if it is not writable), and `delete` removes it (if it is configurable), after which the key is an ordinary member again. Reads and assignments of such a property are not recorded, and the property has no setup API. Without such properties, a substitute has no own properties: `Object.keys(sub)`, `Reflect.ownKeys(sub)` and `{ ...sub }` are empty, `Object.getOwnPropertyDescriptor(sub, 'name')` is `undefined`, and `delete sub.member` changes nothing. + +The values that the library hands out for checks and setups (`sub[received]()`, `sub[configure]()` and members of them), a function returned by `x.bind(...)` and a member configured both as a property and as a method cannot be frozen, sealed or given properties: `Object.freeze()`, `Object.seal()`, `Object.preventExtensions()` and `Object.defineProperty()` throw a `SubstituteException` that says so. `Object.setPrototypeOf(sub, prototype)` is not supported: it replaces the prototype of the library's internal function, after which `util.inspect(sub)` no longer shows the printout (setups and checks keep working). + +`key in sub`, and `Reflect.has(sub, key)`, is `true` when the key has a setup on the substitute: a property setup, a call setup, or a setup further down, like `sub.config.port.returns(80)` for `'config'`. It is also `true` when the substitute mimicks an instance that has the key (`key in instance`, so inherited members count), and for a property defined with `Object.defineProperty()`. Otherwise it is `false`: for members that the code under test used but that are not configured, for the members every function has (`call`, `apply`, `bind`, `name`, `length`, ...), for `then`, `toJSON` and the protocol members above (unless they are configured), and for the library's own methods. `in` records nothing. So code under test that checks whether an optional member exists, like `if ('destroy' in stream)`, takes the branch that the test configured. + +```js +const { Substitute, configure } = require('@fluffy-spoon/substitute') + +// the code under test freezes its options, and checks for an optional member +class Service { + constructor(options, stream) { + this.options = Object.freeze(options) + this.stream = stream + } + get name() { return this.options.name } + close() { return 'destroy' in this.stream ? this.stream.destroy() : this.stream.end() } +} + +const options = Substitute.for() +options.name.returns('billing') +const stream = Substitute.for() +stream.destroy().returns('destroyed') + +const service = new Service(options, stream) +console.log(service.name) // prints billing +console.log(Object.isFrozen(options)) // prints true +console.log(service.close()) // prints destroyed +console.log('end' in stream) // prints false + +const versioned = Substitute.for() +Object.defineProperty(versioned, 'version', { value: 2, enumerable: true, configurable: true }) +console.log(versioned.version, Object.keys(versioned)) // prints 2 [ 'version' ] +versioned.didNotReceive().version +console.log(Reflect.ownKeys(Substitute.for())) // prints [] + +Object.freeze(versioned[configure]()) // throws SubstituteException: cannot be used on +``` + +# Typing limitations +TypeScript cannot express a few things about substitutes: + +* **Assigning a property on the substitute** (`calculator.isEnabled = true`) does not compile, because the property's type also carries the setup API (`.returns()` and so on). Assign through the interface type, as the code under test does, and check with `calculator.received().isEnabled = true`. +* **`null` and `undefined`** are not part of the type of a call or property under `strictNullChecks`, although `.returns(null)` is accepted. Assign the value to the declared type, or give explicit type arguments (`t.is(repository.find(1), null)`). +* **A generic method called with explicit type arguments** (`store.get('answer')`) has no setup API. Call it without type arguments. +* **Generic methods** (`get(key: K): Config[K]`, a typed event emitter's `emit(event: E, ...args: Parameters)`, or Node.js' `EventEmitter` with a `@types/node` version that types the events, which needs TypeScript 4.8 or newer) have the setup API, the checks and the `configure` view, with their type parameters replaced by their constraints. So the arguments are checked against the constraints only, and the configured value against what the method returns for them. With `Config` being `{ port: number; host: string }`, `config.get('port').returns('eighty')` compiles, because `Config[keyof Config]` is `number | string`, and `emitter.emit('failed', 'id1')` compiles although `'failed'` takes an `Error`, because the event and its arguments are not matched up. A value that the method can never return is rejected (`config.get('port').returns(Symbol('80'))`). On TypeScript 4.1 and older, a setup whose arguments are all `Arg.any()` takes any value. +* **Overloads whose parameters have literal types** (`on(event: 'data', ...)`) resolve to the interface's own declaration when you call them directly. Configure them with `sub[configure]().on('data', ...)`. +* **More than 8 overloads:** only the last 8 have the setup API. +* **A property typed `never`** cannot be configured. On a method that returns `never`, `.returns()` only accepts `never`; use `.throws()`. +* **Members typed only `null` or `undefined`** (`error?: undefined`, `ownerDocument: null`) keep their plain type and have no setup API. Configure them through `sub[configure]()`. +* **Generic code:** the result of a call on the substitute (`box.get('a')`) is not assignable to `T`; read it through the plain interface type, or cast it. Checking a set of a property whose type is the type parameter itself (`holder.received().current = value`, with `current: T`) may not compile; write `(holder.received() as Holder).current = value`. Setups of such a property (`box.current.returns(value)`, and from TypeScript 3.9 on also with `maybe?: T` or `orNull: T | null`), of properties of types like `T[]` or `Promise`, and of calls that return `T` are fine. +* **Generic code on TypeScript older than 4.8:** on TypeScript 3.6 to 4.7, with a constrained type parameter (``), calls of optional methods and of members typed as a function or `undefined` have no setup API: `sub.reset().returns()` with `reset?(): void`, `sub.find('a').returns('b')` with `find?(id: string): string | undefined`, `sub.maybeAdd(1).returns(2)` with `maybeAdd: ((a: number) => number) | undefined`, and every method of `T extends Partial` (TypeScript reports "This expression is not callable"). On TypeScript 3.6 to 3.8, in addition, properties whose type includes `null` or `undefined` have no setup API: with a constrained type parameter (`name: string | null`, `limit?: number`, every property of `T extends Partial`), and also in an interface instantiated with any type parameter, constrained or not (`maybe?: T` and `orNull: T | null` in `SubstituteOf>`). Configure them through the `configure` view, which works on every version: `sub[configure]().reset().returns()`, `sub[configure]().limit.returns(10)`, `box[configure]().maybe.returns(value)`. Checks work as well (`sub.received().reset()`, `sub.received().name = null`). Calls of optional methods in an instantiated interface (`load?(): T` in `Box`) work on every version. TypeScript 4.8 and newer have none of these limitations. +* **Generic code with a union constraint** whose variants' methods return different types: in `function stubPet(pet: SubstituteOf)`, where `speak()` returns `'meow'` or `'woof'`, `.returns()` and the `configure` view take `never` (`pet.speak().returns('meow')` does not compile). Members whose signature is the same in every variant (`pet.age().returns(3)`) and properties (`pet.kind.returns('cat')`) work. Cast to the constraint: `(pet as SubstituteOf).speak().returns('meow')`. On TypeScript 5.4 and newer, a method that the variants of a union constraint declare with different parameter lists has no setup API at all, even when every variant returns the same type: with `log(message: string): void` in `LogA` and `log(message: string, level?: number): void` in `LogB`, `sub.log('x').returns()` does not compile in `function stubLog(sub: SubstituteOf)` (TypeScript 5.0 and older compile it). The `configure` view (`sub[configure]().log('x').returns()`), checks (`sub.received().log('x')`) and the cast to the constraint work there on every version. A concrete union, as in `Substitute.for()`, takes the union of the return types: `pet.speak().returns('meow')` compiles there, and so does `pet.speak().returns('woof')`, also when the variants have a string index signature, and when they declare the method with different parameter lists (see the next item). +* **A method that the variants of a concrete union declare with different parameter lists** (an extra optional parameter, other parameter types or other overloads, such as `read(path): string` and `read(path, encoding?): Uint8Array` in `Substitute.for()`) has the setup API, and `.returns()` takes the return types of the variants that the call can reach. Which those are depends on the number of arguments that the call passes. A call that leaves out an optional parameter in which the variants differ takes what every variant that accepts the call returns: with `get(key: string, options?: OptionsV1): number` in one variant and `get(key: string, options?: OptionsV2): string` in the other, `api.get('k').returns(1)` and `api.get('k').returns('s')` both compile, while `api.get('k', { retries: 1 }).returns('s')`, with `OptionsV1` options, does not. A single `Arg.all()` takes the return types of every variant, and a variant with a rest parameter counts for calls with any number of arguments. If every overload of every variant returns the same type, or one of them returns `any`, `.returns()` takes that type. Three cases can surprise: + * The values of the arguments do not count, so parameter types that only overlap do not either: with `letter(x: 'a' | 'b'): 'lower'` in one variant and `letter(x: 'b' | 'c'): 'upper'` in the other, `letters.letter('b').returns('upper')` does not compile. + * `Arg.any()`, and an `Arg.is()` predicate without a parameter type, resolve to the first variant's overload that takes that many arguments. When the variants' parameter types differ, such a call takes only the return types of the variants that accept that overload's parameters: with `m(x: string): 'A'` in `MatchA` and `m(x: number): 'B'` in `MatchB`, `matched.m(Arg.any()).returns('B')` does not compile. Use `Arg.all()`, or a typed matcher such as `Arg.any('number')`. + * A call that resolves to an overload with optional parameters also counts the variants whose parameter lists overlap with that overload's whole list: with `read(path): string` and `read(path, encoding?): Uint8Array`, `reader.read('p', 'utf8').returns('text')` compiles, although only the second variant takes an encoding. + + In these cases, cast to the variant: `(letters as SubstituteOf).letter('b').returns('upper')`. Editors and error messages show the parameters of such a method without their names (`AllArguments<[string, (string | undefined)?]>`). +* **Untyped callbacks in large unions whose variants return the same type**, such as the union of all HTML element types (`HTMLElementTagNameMap[keyof HTMLElementTagNameMap]`): a callback argument whose parameters have no type annotation gets no type from the method when the variants' callback types differ in more than their `this` type, so `anyElement.addEventListener('click', event => event.preventDefault())` reports that `event` implicitly has an `any` type (under `noImplicitAny`). Annotate the parameter: `(event: Event) => event.preventDefault()`. This keeps type-checking such unions fast. +* **Checking a set of an index-signature key in generic code:** with `T extends Settings`, where `Settings` is `{ [key: string]: number; port: number }`, keys that exist only through the index signature can be configured (`sub.timeout.returns(5)`) and read in a check (`sub.received().timeout`). A check of a set, `sub.received().timeout = 5` (also with `[received]()`, `didNotReceive()` or `received(1)`), does not compile, because TypeScript does not resolve a write through an index signature of a type parameter. Write `(sub.received() as Settings).timeout = 5`, or `(sub as SubstituteOf).received().timeout = 5`. +* **A union with `null` or `undefined`** (`Substitute.for()`) has no setup API. Substitute `Calculator`: the substitute can be passed where a `Calculator | undefined` is expected. +* **`Arg.all()` after other arguments** type-checks after up to 6 of them. It does not type-check with arguments after it (which is an error at runtime, too), after the last parameter of a fixed parameter list (`add(1, 2, Arg.all())`), or inside an object or array. Editors show the signatures that accept it with parameters named `arg0`, `arg1`, and so on. +* **`Arg.any('object')`** is typed `any`, like `Arg.any()`, so the compiler does not check it against the parameter. `Arg.any('function')` is typed as any function or class. +* **`Arg.any.not(type)`** is typed like `Arg.any(type)`, so `Arg.any.not('number')` only fits a parameter that accepts numbers, although it matches every value that is not a number. On a parameter that does not accept numbers it would match every value, so use `Arg.any()` there. `Arg.any.not('undefined')` fits any parameter. +* **An optional function-typed property** (`onChange?: (value: string) => void`) does not accept `undefined` in a check: `widget.received().onChange = undefined` does not compile, nor do the `[received]()`, `didNotReceive()` and `[didNotReceive]()` forms, because in a check the member is callable (`widget.received().onChange('x')` checks a call). Write `(widget.received() as Widget).onChange = undefined`, or `widget.received().onChange = Arg.any.not('function')`, which matches any value that is not a function. (`Arg.any('undefined')` does not fit there either.) +* **Assigning a function to a callable member in a check** (`button.received().onClick = handler`) does not compile, because in a check the member also has the call signatures that take `Arg.all()`. Write `(button.received() as Button).onClick = handler`. +* **Optional properties of a type with a string index signature** do not accept `undefined` in a check (`sub.received().note = undefined`). Without an index signature, optional properties that are not functions do. +* **Nested auto-substitutes** are not typed as substitutes, see [Auto-substitutes](#auto-substitutes-and-nested-members). + + +```typescript +import { configure, SubstituteOf } from '@fluffy-spoon/substitute' + +// @ts-expect-error the property's type carries the setup API +calculator.isEnabled = true +const asCalculator: Calculator = calculator +asCalculator.isEnabled = true +// at runtime, both assignments are recorded +calculator.received(2).isEnabled = true + +interface Repository { + find(id: number): string | null +} +const repository = Substitute.for() +repository.find(1).returns(null) +const found: string | null = repository.find(1) +console.log(found) // prints null + +interface Store { + get(key: string): T +} +const store = Substitute.for() +store.get('answer').returns(42) +console.log(store.get('answer')) // prints 42 + +interface Socket { + on(event: 'data', listener: (data: string) => void): Socket + on(event: 'close', listener: () => void): Socket +} +const socket = Substitute.for() +socket[configure]().on('data', Arg.any()).returns(socket) +console.log(socket.on('data', () => { }) === socket) // prints true + +interface Box { + current: T + items: T[] + get(key: string): T +} +function stubBox(box: SubstituteOf>, value: T) { + box.get(Arg.any()).returns(value) + box.items.returns([value]) + box.current.returns(value) +} +function checkCurrentSet(box: SubstituteOf>, value: T) { + (box.received() as Box).current = value +} +const box = Substitute.for>() +stubBox(box, 7) +console.log(box.current) // prints 7 +const replace = (b: Box) => { b.current = 8 } +replace(box) +checkCurrentSet(box, 8) +``` + + +```typescript +interface Widget { + onChange?: (value: string) => void + onClick?: (event: string) => void +} +const widget = Substitute.for() +const handler = (event: string) => { } + +// the code under test +const rewire = (w: Widget) => { + w.onChange = undefined + w.onClick = handler +} +rewire(widget) + +// @ts-expect-error an optional function-typed property does not accept undefined in a check +widget.received().onChange = undefined +;(widget.received() as Widget).onChange = undefined +widget.received().onChange = Arg.any.not('function') + +// @ts-expect-error in a check, a callable member also has the call signatures that take Arg.all() +widget.received().onClick = handler +;(widget.received() as Widget).onClick = handler + +interface Greeter { + greet(name: string): string +} +const greeter = Substitute.for() +// @ts-expect-error Arg.any.not('number') is typed like Arg.any('number') +greeter.greet(Arg.any.not('number')).returns('hi') +greeter.greet(Arg.any()).returns('hi') +greeter.greet(Arg.any.not('undefined')).returns('hi') + +const maybeCalculator = Substitute.for() +// @ts-expect-error a union with undefined has no setup API +maybeCalculator.add(1, 2).returns(3) +``` + +```typescript +import { Substitute, SubstituteOf, configure } from '@fluffy-spoon/substitute' + +interface Cat { kind: 'cat'; speak(): 'meow'; age(): number; load(): Promise } +interface Dog { kind: 'dog'; speak(): 'woof'; age(): number; load(): Promise } + +// a concrete union takes the union of the variants' return types +const pet = Substitute.for() +pet.speak().returns('woof') +pet.load().resolves('bone') +console.log(pet.speak()) // prints woof +// @ts-expect-error neither variant returns 'moo' +Substitute.for().speak().returns('moo') + +function stubPet(pet: SubstituteOf) { + ;(pet as SubstituteOf).speak().returns('meow') + pet.age().returns(3) +} +function doesNotCompile(pet: SubstituteOf) { + // @ts-expect-error in generic code, .returns() only takes what every variant's speak() returns: never + pet.speak().returns('meow') +} +const genericPet = Substitute.for() +stubPet(genericPet) +console.log(genericPet.speak(), genericPet.age()) // prints meow 3 + +interface Settings { + [key: string]: number + port: number +} +function stubSettings(settings: SubstituteOf) { + settings.timeout.returns(5) + settings[configure]().retries.returns(3) +} +function checkTimeoutSet(settings: SubstituteOf) { + // @ts-expect-error a set of a key that exists only through the index signature cannot be checked here + settings.received().timeout = 10 + ;(settings.received() as Settings).timeout = 10 +} +const settings = Substitute.for() +stubSettings(settings) +console.log(settings.timeout + settings.retries) // prints 8 +const setTimeoutTo10 = (s: Settings) => { s.timeout = 10 } +setTimeoutTo10(settings) +checkTimeoutSet(settings) + +// a union constraint whose variants declare the method with different parameter lists +interface LogA { kind: 'a'; log(message: string): void } +interface LogB { kind: 'b'; log(message: string, level?: number): void } +function stubLog(log: SubstituteOf) { + // @ts-expect-error no setup API on TypeScript 5.4 and newer + log.log('x').throws(new Error('full')) + log[configure]().log('y').throws(new Error('full')) +} +const log = Substitute.for() +stubLog(log) +log.log('y') // throws Error: full + +// generic methods: the type parameters are replaced by their constraints +interface Config { port: number; host: string } +interface ConfigService { get(key: K): Config[K] } +const config = Substitute.for() +config.get('host').returns('localhost') +console.log(config.get('host')) // prints localhost +// Config[keyof Config] is number | string, so this compiles, too +config.get('port').returns('eighty') +// @ts-expect-error no member of Config is a symbol +config[configure]().get('port').returns(Symbol('80')) + +interface Events { saved: (id: string) => void; failed: (error: Error) => void } +interface Emitter { emit(event: E, ...args: Parameters): boolean } +const emitter = Substitute.for() +emitter.emit('saved', 'id1').returns(true) +console.log(emitter.emit('saved', 'id1')) // prints true +emitter.received(1).emit('saved', 'id1') +// the event and its arguments are not matched up, so this compiles, too +emitter.didNotReceive().emit('failed', 'id1') +``` + +```typescript +import { Substitute, SubstituteOf, Arg, configure } from '@fluffy-spoon/substitute' + +// the variants declare the method with different parameter lists +interface ClientV1 { version: 1; fetch(url: string): Promise } +interface ClientV2 { version: 2; fetch(url: string, options?: { timeout: number }): Promise } +const client = Substitute.for() +client.fetch('/users').resolves('[]') +client.fetch('/users').then(body => console.log(body)) // prints [] + +interface ReaderA { kind: 'a'; read(path: string): string } +interface ReaderB { kind: 'b'; read(path: string, encoding?: string): Uint8Array } +const reader = Substitute.for() +reader.read('notes.txt').returns('text') +reader.read('image.png').returns(new Uint8Array([1, 2])) +reader[configure]().read('empty.txt').returns('') +console.log(reader.read('notes.txt')) // prints text +// @ts-expect-error neither variant's read() returns a number +Substitute.for().read('notes.txt').returns(1) + +// parameter types that only overlap do not count +interface Lower { kind: 'lower'; letter(x: 'a' | 'b'): 'lower' } +interface Upper { kind: 'upper'; letter(x: 'b' | 'c'): 'upper' } +// @ts-expect-error the call resolves to Lower's letter(), whose parameter type Upper's letter() does not accept as a whole +Substitute.for().letter('b').returns('upper') +const letters = Substitute.for() +;(letters as SubstituteOf).letter('b').returns('upper') +console.log(letters.letter('b')) // prints upper + +// a call that leaves out the options can reach both variants +interface ApiV1 { version: 1; get(key: string, options?: { retries: number }): number } +interface ApiV2 { version: 2; get(key: string, options?: { timeoutMs: number }): string } +const api = Substitute.for() +api.get('count').returns(1) +api.get('name').returns('ann') +console.log(api.get('count'), api.get('name')) // prints 1 ann +// @ts-expect-error only ApiV1 takes { retries }, and its get() returns a number +api.get('name', { retries: 1 }).returns('ann') + +// Arg.any() resolves to the first variant's m(x: string) +interface MatchA { kind: 'a'; m(x: string): 'A' } +interface MatchB { kind: 'b'; m(x: number): 'B' } +const matched = Substitute.for() +// @ts-expect-error the call resolves to m(x: string), which only MatchA declares +matched.m(Arg.any()).returns('B') +const typed = Substitute.for() +typed.m(Arg.any('number')).returns('B') +typed.m(Arg.all()).returns('A') +console.log(typed.m(2), typed.m('x')) // prints B A +``` + +# Test runners +Checks throw a `SubstituteException`, so they work with any test runner: a failed check fails the test, and you can expect one with your runner's `throws` assertion. ava, jest, mocha, node:test and vitest (also with the package inlined through `server.deps.inline`) are tested on every change, including a check that [fails later](#assertions-that-fail-later). Each of them fails the run for it, but not all in the same way: jest reports it as the failure of the running test (jest 30 on Node.js 22 as a failure of the test file), vitest and node:test run every test and fail the run or the file, mocha stops the run after that test, so the remaining tests and files do not run, and ava ends the worker of that test file, so its unfinished tests are not reported. In jest and vitest, the `called at` lines of failure messages name the lines of the TypeScript source. Fake timers that a test installs do not hold back such a report; see [Assertions that fail later](#assertions-that-fail-later) for how each runner reports it, and for fake timers that are installed before the library is loaded. + +Substitutes can be passed to your runner's own assertions: jest's `toEqual(sub)`, `toContainEqual(sub)` and `toHaveBeenCalledWith(sub)` compare substitutes by identity: a substitute only equals itself (see [Special members](#special-members)). In their failure messages, jest and vitest show a substitute by its `name` member, for example `[Function @Substitute.logger.name]` (see [Printing a substitute](#printing-a-substitute)). + +```typescript +import { test } from 'node:test' +import * as assert from 'node:assert' +import { Substitute, SubstituteException } from '@fluffy-spoon/substitute' + +interface Calculator { add(a: number, b: number): number } + +test('adds the numbers', () => { + const calculator = Substitute.for() + calculator.add(1, 2) + + calculator.received().add(1, 2) + assert.throws(() => calculator.received().add(3, 4), SubstituteException) +}) +``` + +With ava: + + +```typescript +import test from 'ava' +import { Substitute, SubstituteException } from '@fluffy-spoon/substitute' + +interface Calculator { add(a: number, b: number): number } + +test('adds the numbers', t => { + const calculator = Substitute.for() + calculator.add(1, 2) + + t.notThrows(() => calculator.received().add(1, 2)) + t.throws(() => calculator.received().add(3, 4), { instanceOf: SubstituteException }) +}) +``` + +## Debuggers +With "pause on caught exceptions" turned on (VS Code's "Caught Exceptions", Chrome DevTools' "Pause on caught exceptions", WebStorm's "Any exception"), an ordinary test raises no exception inside the library when `Error.prepareStackTrace` holds a function. That is the case on Node.js 20.20, 22, 24 and 26, which install a formatter of their own, with `source-map-support` (also on older Node.js versions), in jest 29's test environment, and in vitest's `forks` and `threads` pools. + +Where `Error.prepareStackTrace` is not a function, the library throws and catches an exception for each step of a chain like `app.repo.users.find(1)`, to read where that step was made, and the debugger stops twice for each, in `dist/internals/CallSite.js` (in `peekFirstFrame` and `readFirstFrame`): 40 times for a test of two setups, a call of the code under test and two checks, all through such chains. That happens on Node.js 18 and other versions before 20.20 without an installed formatter, when `Error.prepareStackTrace` was deleted, and in `vm` contexts: jest 30's test environment, vitest's `vmThreads` and `vmForks` pools, and `node:vm`. To skip these stops, add `**/node_modules/@fluffy-spoon/substitute/**` to the debugger's `skipFiles` (in VS Code's `launch.json`) or to its ignore list (in Chrome DevTools). + +A getter of your own that throws, in an argument that cannot be read yet (see [How arguments are compared](#how-arguments-are-compared)), stops the debugger whenever the library reads it: at most once for each call or setup that passes the value (only the first of several calls with the same object, unless the member has setups with literal arguments), and up to once for each received call that a check compares the value with. + +# Performance +A call or property read with small arguments takes a few microseconds. Measured on Node.js 22, 10,000 calls `sub.f(i)` take about 80 milliseconds, and 10,000 calls `app.a.b.c.d(i)` (four property reads and a call each) about 0.23 seconds. Much of that time goes into capturing where each call was made (see [Which calls lead to a setup or a check](#which-calls-lead-to-a-setup-or-a-check)); where V8 captures no stack frames, for example with `Error.stackTraceLimit` deleted, the same calls take about 40 and 55 milliseconds. + +Finding the setup and the auto-substitute for a call does not scan earlier calls. It looks the arguments up by a hash whose cost is bounded, whatever their size or shape: nested objects, objects with cycles (such as a child that refers back to its parent), errors, long arrays, `Buffer`s and typed arrays, long strings, `Map`s, `Set`s or `Date`s. Measured on Node.js 22, each of these takes about 0.1 to 0.25 seconds: 10,000 calls with nested-object arguments, 4,000 setups with object arguments plus 4,000 matching calls, 10,000 calls with a different `Error` each, 10,000 calls with objects that refer back to their parent, 200 calls with different 1 MB strings, and 20 calls with arrays of 150,000 objects. + +The hash reads only a bounded part of each argument: + +* at most 1,024 nested arrays and objects, which each of them shares evenly among its items, and at most 32 levels; +* of an array with more than 256 items, 256 of them: the first 64, the last 64 and 128 at a fixed stride; +* of a string or a byte array with more than 4,096 characters or bytes, 4,096 of them: the first 1,024, the last 1,024 and 2,048 at a fixed stride; +* of an object with more than 256 keys, and of a `Map` or `Set` with more than 256 entries (a wide one), every key and every value. An object among the values, a `Set` member that is an object, and a `Map` key that is an object count with a budget of 4 objects of their own, which they share among their values like any other object: enough for a small record and the objects right inside it. A wide object, `Map` or `Set` inside them counts only as such, and one that several of them share, or the container itself when they refer back to it, is listed at most once per call. Above 65,536 keys or entries, every key counts, but only about 256 of the values, chosen by their keys; the members of a `Set` that large, and the entries with object keys of a `Map` that large, count only shallowly. + +Objects with many keys in common, such as snapshots of a state or translation tables per locale, need not have their keys listed, which is what costs most about them: the first object with at least 1,025 string keys gives a list of 1,025 of its keys, and a later object that has all the keys of that list is hashed by the values of those keys alone. The library makes up to 16 such lists per process, each from the first object with at least 1,025 string keys that does not have all the keys of an earlier list. An object is looked up in a list only when it has the two keys of the list with the lowest and the highest hash, so small objects that happen to share a key with such a list (such as `id`) cost nothing extra, and items of arrays and values inside a wide object, `Map` or `Set` are not looked up at all. Any other wide object has its keys listed once. The hash of a wide object, `Map` or `Set` is computed the first time it is passed, and remembered with it (weakly) for later calls; this never changes a result (see [How arguments are compared](#how-arguments-are-compared)). + +Arguments that a setup or an earlier call already used are found by identity first, so a large object that is passed again and again costs little. And a call is looked up among the setups with literal arguments only when one of them could match it: a call whose primitive arguments (numbers, strings and so on) are those of no such setup skips that lookup. Measured on Node.js 22: + +* 10,000 calls that each pass one shared table with 300 to 10,000 keys, with a different first argument each time, take about 0.1 to 0.13 seconds, whatever the size of the table, and 2,000 calls with the same object with 10,000 keys about 25 milliseconds; +* 10 calls with 256 rows that share one object with 5,000 keys take about 20 milliseconds, 10 calls with 300 rows that share one `Map` with 10,000 entries about 25 milliseconds, and a setup with an object with 10,000 keys plus 2,000 calls with that object about 20 milliseconds; +* 10 calls with a `Map` of 2,000 records that share one object with 5,000 keys take about 25 milliseconds, 10 calls with tables of 300 such records about 15 milliseconds, and 10 calls with tables of 1,000 records that refer back to their table about 30 milliseconds; +* 200 calls with different objects with 5,000 keys each take about 30 milliseconds, and 100 calls with different objects with 70,000 keys each about 45 milliseconds; +* 50 calls with a normalized state whose `byId` holds 5,000 records take about 0.14 seconds, and 100 calls with different tables of 5,000 records, `Set`s of 5,000 records or `Map`s with 5,000 object keys and record values about 70 to 210 milliseconds; +* 1,000 calls that each pass a new array of 256 to 300 records with nested objects take about 0.25 to 0.3 seconds, the same per record for 257 records as for 256, and with 1,000 records each about 0.7 seconds; +* with 16 of the lists of keys above whose first key is `id`, 2,000 calls with arrays of 100 small records with an `id` take about 0.19 seconds, as without such lists. + +Arguments with the same hash are told apart by comparing them in full, with `util.isDeepStrictEqual`, so a copy of an object only matches a setup or an earlier call after that comparison. For wide objects, it costs about 1.3 milliseconds per 5,000 keys: 200 setups with different objects with 5,000 keys plus 200 calls with copies of them take about 0.37 seconds, of which about 0.27 seconds is that comparison. + +Arguments that differ only outside the parts that the hash reads get the same hash. They are still told apart correctly, but each new call is compared with every earlier call with that hash, so many such calls get slow: 200 calls with 1 MB strings that differ only in a few characters in the middle take about 1.2 seconds. The same applies to symbols with the same description (`Symbol('id')`), because a symbol is hashed by its description: 4,000 calls with such symbols take about 0.24 seconds. A value that cannot be read, such as an object with a getter that throws, is matched by its identity (see [How arguments are compared](#how-arguments-are-compared)) and read at most once per call: 4,000 calls with different such objects take about 0.1 seconds. + +Setups with matchers cannot be looked up by a hash: a call tries the matcher setups of its member one by one. So many matcher setups on the same member slow down each call of it: 4,000 setups with `Arg.is()` plus 4,000 calls take about 1 second, and with a matcher inside an object (`find({ id: i, name: Arg.any() })`) about 11 seconds. A check goes through the received calls of the member that it checks. + +Each received call is kept until [`[clearReceivedCalls]()`](#clearing-received-calls), at about 300 bytes per call (measured on Node.js 22, 64-bit). A distinct unconfigured call also keeps its auto-substitute, about 200 bytes more, for as long as the substitute lives, so that the same call always returns the same auto-substitute; `[clearReceivedCalls]()` keeps those. A call through a chain of property reads keeps a record of each read as well: `app.a.b.c.d(i)` with a different `i` each time keeps about 1,350 bytes per call. Symbols passed as arguments are not kept alive by the library once the substitute is gone. + +# Benefits over other mocking libraries +- Easier-to-understand fluent syntax. +- No need to cast to `any` in certain places (for instance, when overriding read-only properties) due to the `myProperty.returns(...)` syntax. +- Doesn't weigh much. +- Produces very clean and descriptive error messages. Try it out - you'll love it. +- Doesn't rely on object instances - you can produce a strong-typed fake from nothing, ensuring that everything is mocked. + +# Contributors -### Code Contributors +## Code Contributors This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)]. -### Financial Contributors +## Financial Contributors Become a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/substitute-js/contribute)] -#### Individuals +### Individuals -#### Organizations +### Organizations Support this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/substitute-js/contribute)] diff --git a/ava.config.js b/ava.config.js index d47ef16..c061cf5 100644 --- a/ava.config.js +++ b/ava.config.js @@ -1,10 +1,11 @@ - module.exports = { - files: ['spec/**/*.spec.ts'], + files: ['spec/**/*.spec.ts', 'spec/**/*.test.ts', 'packaging/**/*.test.js'], typescript: { compile: false, + // `npm run build:spec` compiles the specs (and the sources they import) into dist-spec/, + // so running the tests never touches the publishable dist/ directory. rewritePaths: { - '/': 'dist/' + '/': 'dist-spec/' } }, cache: false, diff --git a/compatibility-checks/bundlers/entry.mjs b/compatibility-checks/bundlers/entry.mjs new file mode 100644 index 0000000..32b47be --- /dev/null +++ b/compatibility-checks/bundlers/entry.mjs @@ -0,0 +1,32 @@ +// F1: test/bundlers.ts bundles this file with each bundler and runs the bundle with Node.js. It reports what the +// default, named and namespace imports of the package are inside the bundle, and whether the library works there. +import Substitute, { Substitute as NamedSubstitute, Arg, received, SubstituteException } from '@fluffy-spoon/substitute' +import * as namespace from '@fluffy-spoon/substitute' + +const report = { + defaultImport: typeof Substitute, + defaultIsNamedSubstitute: Substitute === NamedSubstitute, + namespaceDefaultIsSubstitute: namespace.default === Substitute, + arg: typeof Arg, + received: typeof received, + substituteException: typeof SubstituteException, + namespaceKeys: Object.keys(namespace).sort(), + undefinedNamespaceValues: Object.keys(namespace).filter(name => namespace[name] === undefined).sort() +} + +try { + const calculator = NamedSubstitute.for() + calculator.add(1, Arg.any()).returns(3) + report.returns = calculator.add(1, 2) + calculator[received](1).add(1, 2) + try { + calculator.received(2).add(1, 2) + report.failingAssertion = 'did not throw' + } catch (error) { + report.failingAssertion = error instanceof SubstituteException ? 'SubstituteException' : String(error) + } +} catch (error) { + report.error = String((error && error.stack) || error) +} + +console.log(JSON.stringify(report)) diff --git a/compatibility-checks/bundlers/named-entry.mjs b/compatibility-checks/bundlers/named-entry.mjs new file mode 100644 index 0000000..797aa3f --- /dev/null +++ b/compatibility-checks/bundlers/named-entry.mjs @@ -0,0 +1,29 @@ +// PK4-1 (P33): test/bundlers.ts bundles this file into CommonJS output while the package stays external, and runs +// the bundle with Node.js. It uses only the named import, which README "Importing" recommends for that case: there +// the default import follows Node.js's CommonJS interop and is the exports object, not the Substitute class. +import { Substitute, Arg, received, SubstituteException } from '@fluffy-spoon/substitute' + +const report = { + substitute: typeof Substitute, + substituteFor: typeof (Substitute && Substitute.for), + arg: typeof Arg, + received: typeof received, + substituteException: typeof SubstituteException +} + +try { + const calculator = Substitute.for() + calculator.add(1, Arg.any()).returns(3) + report.returns = calculator.add(1, 2) + calculator[received](1).add(1, 2) + try { + calculator.received(2).add(1, 2) + report.failingAssertion = 'did not throw' + } catch (error) { + report.failingAssertion = error instanceof SubstituteException ? 'SubstituteException' : String(error) + } +} catch (error) { + report.error = String((error && error.message) || error) +} + +console.log(JSON.stringify(report)) diff --git a/compatibility-checks/bundlers/require-entry.mjs b/compatibility-checks/bundlers/require-entry.mjs new file mode 100644 index 0000000..ec58b9f --- /dev/null +++ b/compatibility-checks/bundlers/require-entry.mjs @@ -0,0 +1,36 @@ +// P29: test/bundlers.ts bundles this file, which imports CommonJS code that require()s the package +// (require-helper.cjs), and runs the bundle with Node.js. It reports what require() returned inside the bundle and +// whether the library works there. +import helper from './require-helper.cjs' + +const { library, Substitute, Arg, received, SubstituteException } = helper + +// With esmExternals, Rollup's commonjs plugin hands require() a function that carries every export as a property +// (its namespace interop), so what counts is which properties are there, not typeof. +const report = { + requireIsSubstituteClass: typeof library === 'function' && typeof library.for === 'function', + exportKeys: Object.keys(library).sort(), + undefinedExportValues: Object.keys(library).filter(name => library[name] === undefined).sort(), + substitute: typeof Substitute, + defaultIsSubstitute: library.default === Substitute, + arg: typeof Arg, + received: typeof received, + substituteException: typeof SubstituteException +} + +try { + const calculator = Substitute.for() + calculator.add(1, Arg.any()).returns(3) + report.returns = calculator.add(1, 2) + calculator[received](1).add(1, 2) + try { + calculator.received(2).add(1, 2) + report.failingAssertion = 'did not throw' + } catch (error) { + report.failingAssertion = error instanceof SubstituteException ? 'SubstituteException' : String(error) + } +} catch (error) { + report.error = String((error && error.message) || error) +} + +console.log(JSON.stringify(report)) diff --git a/compatibility-checks/bundlers/require-helper.cjs b/compatibility-checks/bundlers/require-helper.cjs new file mode 100644 index 0000000..105506f --- /dev/null +++ b/compatibility-checks/bundlers/require-helper.cjs @@ -0,0 +1,7 @@ +// P29: CommonJS code that require()s the package, as a test helper written in CommonJS does. require-entry.mjs +// imports it, and test/bundlers.ts bundles that with the package kept external (and, for comparison, bundled). +'use strict' +const library = require('@fluffy-spoon/substitute') +const { Substitute, Arg, received, SubstituteException } = library + +module.exports = { library, Substitute, Arg, received, SubstituteException } diff --git a/compatibility-checks/package-lock.json b/compatibility-checks/package-lock.json index c7a0171..7e46b92 100644 --- a/compatibility-checks/package-lock.json +++ b/compatibility-checks/package-lock.json @@ -9,38 +9,32 @@ "version": "0.0.0", "license": "MIT", "devDependencies": { - "@types/mocha": "^10.0.6", - "@types/node": "^20.11.25", + "@jest/globals": "^30.5.2", + "@rollup/plugin-commonjs": "^29.0.3", + "@rollup/plugin-node-resolve": "^16.0.3", + "@types/mocha": "^10.0.10", + "@types/node": "^22.20.5", "ansi-regex": "^6.0.1", - "ava": "^6.1.2", - "jest": "^29.7.0", - "mocha": "^10.3.0", - "ts-jest": "^29.1.2", - "tsx": "^4.7.1", - "typescript": "^5.4.2", - "vitest": "^1.3.1" + "ava": "^6.4.1", + "esbuild": "^0.28.2", + "jest": "^30.5.2", + "mocha": "^12.0.3", + "rollup": "^4.68.4", + "ts-jest": "^29.4.15", + "tsx": "^4.23.15", + "typescript": "^5.9.3", + "vite": "^8.3.8", + "vitest": "^5.1.0", + "webpack": "^5.112.2" }, "engines": { - "node": ">=20" + "node": ">=22.12" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/substitute-js#section-contribute" } }, - "node_modules/@ampproject/remapping": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", - "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", - "dev": true, - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.24" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/@ava/typescript": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/@ava/typescript/-/typescript-3.0.1.tgz", @@ -57,114 +51,47 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.23.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz", - "integrity": "sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz", + "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/highlight": "^7.23.4", - "chalk": "^2.4.2" + "@babel/helper-validator-identifier": "^7.29.7", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/code-frame/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/code-frame/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/code-frame/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/@babel/code-frame/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "node_modules/@babel/code-frame/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/@babel/code-frame/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/code-frame/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/@babel/compat-data": { - "version": "7.23.5", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.23.5.tgz", - "integrity": "sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.7.tgz", + "integrity": "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.24.0", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.24.0.tgz", - "integrity": "sha512-fQfkg0Gjkza3nf0c7/w6Xf34BW4YvzNfACRLmmb7XRLa6XHdR+K9AlJlxneFfWYf6uhOzuzZVTjF/8KfndZANw==", - "dev": true, - "dependencies": { - "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.23.5", - "@babel/generator": "^7.23.6", - "@babel/helper-compilation-targets": "^7.23.6", - "@babel/helper-module-transforms": "^7.23.3", - "@babel/helpers": "^7.24.0", - "@babel/parser": "^7.24.0", - "@babel/template": "^7.24.0", - "@babel/traverse": "^7.24.0", - "@babel/types": "^7.24.0", + "version": "7.29.13", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.13.tgz", + "integrity": "sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.13", + "@babel/helper-compilation-targets": "^7.29.13", + "@babel/helper-module-transforms": "^7.29.13", + "@babel/helpers": "^7.29.13", + "@babel/parser": "^7.29.13", + "@babel/template": "^7.29.7", + "@babel/traverse": "^7.29.13", + "@babel/types": "^7.29.11", + "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -189,29 +116,32 @@ } }, "node_modules/@babel/generator": { - "version": "7.23.6", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.6.tgz", - "integrity": "sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw==", + "version": "7.29.14", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.14.tgz", + "integrity": "sha512-qSY56jgW5JnSXzuekLVil6zaOQxOCtOHidr65KkaMBw772IuAY28Qx4ZykAcDn8+FRF15qk80XzKwgSc/RYW6g==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/types": "^7.23.6", - "@jridgewell/gen-mapping": "^0.3.2", - "@jridgewell/trace-mapping": "^0.3.17", - "jsesc": "^2.5.1" + "@babel/parser": "^7.29.14", + "@babel/types": "^7.29.14", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", + "jsesc": "^3.0.2" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.23.6", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.23.6.tgz", - "integrity": "sha512-9JB548GZoQVmzrFgp8o7KxdgkTGm6xs9DW0o/Pim72UDjzr5ObUQ6ZzYPqA+g9OTS2bBQoctLJrky0RDCAWRgQ==", + "version": "7.29.13", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.29.13.tgz", + "integrity": "sha512-8WxJ4/Vmes3ghacj8VOJy3NW8eyHiFY/4thU/LSBuBE470+igjR/j1ZTNn8fV5VdNrLx6iXUwig526UdOvfP0w==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/compat-data": "^7.23.5", - "@babel/helper-validator-option": "^7.23.5", - "browserslist": "^4.22.2", + "@babel/compat-data": "^7.29.7", + "@babel/helper-validator-option": "^7.29.7", + "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" }, @@ -224,82 +154,55 @@ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", "dev": true, + "license": "ISC", "dependencies": { "yallist": "^3.0.2" } }, "node_modules/@babel/helper-compilation-targets/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "version": "6.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.2.tgz", + "integrity": "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ==", "dev": true, + "license": "ISC", "bin": { "semver": "bin/semver.js" } }, - "node_modules/@babel/helper-compilation-targets/node_modules/yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true - }, - "node_modules/@babel/helper-environment-visitor": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", - "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", - "dev": true, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-function-name": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", - "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", - "dev": true, - "dependencies": { - "@babel/template": "^7.22.15", - "@babel/types": "^7.23.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-hoist-variables": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", - "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", + "node_modules/@babel/helper-globals": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.29.7.tgz", + "integrity": "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==", "dev": true, - "dependencies": { - "@babel/types": "^7.22.5" - }, + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-imports": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz", - "integrity": "sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.29.7.tgz", + "integrity": "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/types": "^7.22.15" + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz", - "integrity": "sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==", + "version": "7.29.14", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.29.14.tgz", + "integrity": "sha512-2XDvQVd9JESaOgGc4jT2/jquTAO7ppA5noTZQqH+MmZ89yjCzScLwtCPbWtkPZylL+TLWR49IwWmk+QkRR4GsA==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-module-imports": "^7.22.15", - "@babel/helper-simple-access": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/helper-validator-identifier": "^7.22.20" + "@babel/helper-module-imports": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7", + "@babel/traverse": "^7.29.14" }, "engines": { "node": ">=6.9.0" @@ -309,169 +212,68 @@ } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.24.0", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.0.tgz", - "integrity": "sha512-9cUznXMG0+FxRuJfvL82QlTqIzhVW9sL0KjMPHhAOOvpQGL8QtdxnBKILjBqxlHyliz0yCa1G903ZXI/FuHy2w==", - "dev": true, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-simple-access": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz", - "integrity": "sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.29.7.tgz", + "integrity": "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw==", "dev": true, - "dependencies": { - "@babel/types": "^7.22.5" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-split-export-declaration": { - "version": "7.22.6", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", - "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", - "dev": true, - "dependencies": { - "@babel/types": "^7.22.5" - }, + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-string-parser": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz", - "integrity": "sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==", + "version": "7.29.14", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.14.tgz", + "integrity": "sha512-CXvKMFvM80ihI7Vox9jb+kQjnyjESQNPM+vB7U0Zz6TWuZA+Z/FL0QPMH300h33qJtIx+REeBhXqWOPW48TcAQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", - "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", + "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-option": { - "version": "7.23.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz", - "integrity": "sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.29.7.tgz", + "integrity": "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helpers": { - "version": "7.24.0", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.24.0.tgz", - "integrity": "sha512-ulDZdc0Aj5uLc5nETsa7EPx2L7rM0YJM8r7ck7U73AXi7qOV44IHHRAYZHY6iU1rr3C5N4NtTmMRUJP6kwCWeA==", - "dev": true, - "dependencies": { - "@babel/template": "^7.24.0", - "@babel/traverse": "^7.24.0", - "@babel/types": "^7.24.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/highlight": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", - "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", + "version": "7.29.14", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.14.tgz", + "integrity": "sha512-6E3Mi1r0B0umq6vmZa4/78q+64fqO2YY0THUdjDPKUCKhNb0yQy5NQIaPHCSD3ryTgiTss//P4JsWS80AsZ6LQ==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-validator-identifier": "^7.22.20", - "chalk": "^2.4.2", - "js-tokens": "^4.0.0" + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.14" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/highlight/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/@babel/highlight/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "node_modules/@babel/highlight/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/@babel/highlight/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "node_modules/@babel/parser": { + "version": "7.29.14", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.14.tgz", + "integrity": "sha512-VL220vXuyO2z3rNIQwY7ftj9UwpqOt+33sH+sBWkOekbsSR2g7EEMnOx24ZlCH0xOA3DM/33SifVFGbnJD8r/w==", "dev": true, + "license": "MIT", "dependencies": { - "has-flag": "^3.0.0" + "@babel/types": "^7.29.14" }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/parser": { - "version": "7.24.0", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.0.tgz", - "integrity": "sha512-QuP/FxEAzMSjXygs8v4N9dvdXzEHN4W1oF3PxuWAtPo08UdM17u89RDMgjLn/mlc56iM0HlLmVkO/wgR+rDgHg==", - "dev": true, "bin": { "parser": "bin/babel-parser.js" }, @@ -484,6 +286,7 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -496,6 +299,7 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz", "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -508,6 +312,7 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.12.13" }, @@ -515,11 +320,44 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/@babel/plugin-syntax-class-static-block": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz", + "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-attributes": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.29.7.tgz", + "integrity": "sha512-zGYcYfq/WmZ4V+kBIXQon9dSSc8ircGZqw9ZaNhhGj9nZkeBu1jHLBDQqYYi5WA9uawvA2sIMbry2nCFhf5Djg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, "node_modules/@babel/plugin-syntax-import-meta": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.10.4" }, @@ -532,6 +370,7 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -540,12 +379,13 @@ } }, "node_modules/@babel/plugin-syntax-jsx": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.23.3.tgz", - "integrity": "sha512-EB2MELswq55OHUoRZLGg/zC7QWUKfNLpE57m/S2yr1uEneIgsTgrSzXP3NXEsMkVn76OlaVVnzN+ugObuYGwhg==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.29.7.tgz", + "integrity": "sha512-TSu8+mHCoEaaCDEZ0I3+6mvTBYR4PCxQwf2z9/r5Tbztv6NaLR3B9thGTTxX2WGuGHJqRiAbKPeGTJ5XWXVg6A==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.29.7" }, "engines": { "node": ">=6.9.0" @@ -559,6 +399,7 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.10.4" }, @@ -571,6 +412,7 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -583,6 +425,7 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.10.4" }, @@ -595,6 +438,7 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -607,6 +451,7 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -619,6 +464,7 @@ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -626,11 +472,28 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/@babel/plugin-syntax-private-property-in-object": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz", + "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, "node_modules/@babel/plugin-syntax-top-level-await": { "version": "7.14.5", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.14.5" }, @@ -642,12 +505,13 @@ } }, "node_modules/@babel/plugin-syntax-typescript": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.23.3.tgz", - "integrity": "sha512-9EiNjVJOMwCO+43TqoTrgQ8jMwcAd0sWyXi9RPfIsLTj4R2MADDDQXELhffaUx/uJv2AYcxBgPwH6j4TIA4ytQ==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.29.7.tgz", + "integrity": "sha512-ngr+82Sh0xMz25TPCZi+nC2iTzjfCdWS2ONXTp/PtSCHCgaCNBpdMqgvJ2ccdLlClVZ7sisIgB914j/JFe+RZA==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.22.5" + "@babel/helper-plugin-utils": "^7.29.7" }, "engines": { "node": ">=6.9.0" @@ -657,49 +521,48 @@ } }, "node_modules/@babel/template": { - "version": "7.24.0", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.0.tgz", - "integrity": "sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA==", + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.7.tgz", + "integrity": "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.23.5", - "@babel/parser": "^7.24.0", - "@babel/types": "^7.24.0" + "@babel/code-frame": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/types": "^7.29.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.24.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.24.0.tgz", - "integrity": "sha512-HfuJlI8qq3dEDmNU5ChzzpZRWq+oxCZQyMzIMEqLho+AQnhMnKQUzH6ydo3RBl/YjPCuk68Y6s0Gx0AeyULiWw==", + "version": "7.29.14", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.14.tgz", + "integrity": "sha512-RAdQJrBgmIH1FWvN0X+1hoDxzMzlP4cv/1Zi4dn4tG1H0cTb+rw7CzUxQJhp1f4ANd8j5vH3fy8BAWFGkBDEsA==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.23.5", - "@babel/generator": "^7.23.6", - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-function-name": "^7.23.0", - "@babel/helper-hoist-variables": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.24.0", - "@babel/types": "^7.24.0", - "debug": "^4.3.1", - "globals": "^11.1.0" + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.14", + "@babel/helper-globals": "^7.29.7", + "@babel/parser": "^7.29.14", + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.14", + "debug": "^4.3.1" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/types": { - "version": "7.24.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.0.tgz", - "integrity": "sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w==", + "version": "7.29.14", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.14.tgz", + "integrity": "sha512-UjI/dKmwJwT9pOszJitq2G6EObZPnsZUfdCr92z2TlF3EZK9J3EdfOKUrCzHl6wFthbzwhzl1Soc/UIwxRiq6w==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-string-parser": "^7.23.4", - "@babel/helper-validator-identifier": "^7.22.20", - "to-fast-properties": "^2.0.0" + "@babel/helper-string-parser": "^7.29.14", + "@babel/helper-validator-identifier": "^7.29.7" }, "engines": { "node": ">=6.9.0" @@ -709,448 +572,571 @@ "version": "0.2.3", "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", - "dev": true + "dev": true, + "license": "MIT" + }, + "node_modules/@emnapi/core": { + "version": "2.0.0-beta.2", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-2.0.0-beta.2.tgz", + "integrity": "sha512-MzCVoWtcg4Pm2B3je5mMvYMvj3MmBKw+fU7vbsJc9/iT8ip6/eYIHo/Dsm/mr+wsHB6SEyJDuxB09Yy6r/8+4A==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/wasi-threads": "2.2.0", + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/runtime": { + "version": "2.0.0-beta.2", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-2.0.0-beta.2.tgz", + "integrity": "sha512-JcrSPzPvZuNZvJqPTF9Fw25LbOJ8avzFVlaf2grmH4Cku0oGP47tRgqPZadcfj3YoZMHkFVnCYFbQM8I+i5QEw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/wasi-threads": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-2.2.0.tgz", + "integrity": "sha512-JP7OYH38Q7+pyTAe14raZHLQIK7BDKbdwji+Xi3pcd/6QkJYQH3SX4wu6EplGrGJWRepoNzedfm0G3B9Z4e9Rw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz", - "integrity": "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.2.tgz", + "integrity": "sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ==", "cpu": [ "ppc64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "aix" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/android-arm": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.12.tgz", - "integrity": "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.2.tgz", + "integrity": "sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg==", "cpu": [ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/android-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz", - "integrity": "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.2.tgz", + "integrity": "sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/android-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.12.tgz", - "integrity": "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.2.tgz", + "integrity": "sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz", - "integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.2.tgz", + "integrity": "sha512-n4KqkOQrraxHJcgjM1RvwbigfQKIKJVpM7xp+KsxiyUSrRdIXnt73VhrPAx0fV44hgfmIVKjxMN9J1t5jySVkw==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz", - "integrity": "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.2.tgz", + "integrity": "sha512-uq6suIWYP37qzGddBKPw5QEQPi6HiLGsO7UmkpfyaYNQ3D+rN6w6WfwH+nuqcGXWvawGwxOEroO4YGnFh95azw==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz", - "integrity": "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.2.tgz", + "integrity": "sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "freebsd" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz", - "integrity": "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.2.tgz", + "integrity": "sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "freebsd" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-arm": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz", - "integrity": "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.2.tgz", + "integrity": "sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w==", "cpu": [ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz", - "integrity": "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.2.tgz", + "integrity": "sha512-pW4AC0P3it8c7do9MVM4p51FzHzdM/TZrerurgRcHJ2WTa1VQ1CIq18xncfpBJw4ojkiZZrKW2yIBWBP92j6Ug==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz", - "integrity": "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.2.tgz", + "integrity": "sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ==", "cpu": [ "ia32" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz", - "integrity": "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.2.tgz", + "integrity": "sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ==", "cpu": [ "loong64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz", - "integrity": "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.2.tgz", + "integrity": "sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA==", "cpu": [ "mips64el" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz", - "integrity": "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.2.tgz", + "integrity": "sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ==", "cpu": [ "ppc64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz", - "integrity": "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.2.tgz", + "integrity": "sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA==", "cpu": [ "riscv64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz", - "integrity": "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.2.tgz", + "integrity": "sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg==", "cpu": [ "s390x" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz", - "integrity": "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.2.tgz", + "integrity": "sha512-4xTZr1FUmSoQW4XIWmit3tzQrUTZM+N3P0XV8xROKYF50XfI7xeO90+1bZvNwxIufQ9hDQVRJH5YhgPVF8A/HQ==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.2.tgz", + "integrity": "sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz", - "integrity": "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.2.tgz", + "integrity": "sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "netbsd" ], "engines": { - "node": ">=12" + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.2.tgz", + "integrity": "sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz", - "integrity": "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.2.tgz", + "integrity": "sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "openbsd" ], "engines": { - "node": ">=12" + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.2.tgz", + "integrity": "sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz", - "integrity": "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.2.tgz", + "integrity": "sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "sunos" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz", - "integrity": "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.2.tgz", + "integrity": "sha512-PIhhEkE9uPBleRBrQEJpUn7MBnibZzbGzYWPmY3x+YoVg/95zbjB4CxPPOQ8l5tYYM4mMaCthF8/1DIfBQQyWQ==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz", - "integrity": "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.2.tgz", + "integrity": "sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA==", "cpu": [ "ia32" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz", - "integrity": "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.2.tgz", + "integrity": "sha512-5ebpxr3nWMzrL/rnUI755Jkuee0bHL/Gq0WTF9lvcpv73wAp5eu8MfBUgWK9bhWvZjj7yX8etf/8tI8Ney695g==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" ], "engines": { - "node": ">=12" + "node": ">=18" } }, - "node_modules/@istanbuljs/load-nyc-config": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", - "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", "dev": true, + "license": "ISC", "dependencies": { - "camelcase": "^5.3.1", - "find-up": "^4.1.0", - "get-package-type": "^0.1.0", - "js-yaml": "^3.13.1", - "resolve-from": "^5.0.0" + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" }, "engines": { - "node": ">=8" + "node": ">=12" } }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "node_modules/@isaacs/cliui/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", "dev": true, - "engines": { - "node": ">=6" - } + "license": "MIT" }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dev": true, + "license": "MIT", "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" }, "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", "dev": true, + "license": "MIT", "dependencies": { - "p-locate": "^4.1.0" + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" }, "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "node_modules/@isaacs/fs-minipass": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@isaacs/fs-minipass/-/fs-minipass-4.0.1.tgz", + "integrity": "sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==", "dev": true, + "license": "ISC", "dependencies": { - "p-try": "^2.0.0" + "minipass": "^7.0.4" }, "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=18.0.0" } }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "node_modules/@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", "dev": true, + "license": "ISC", "dependencies": { - "p-limit": "^2.2.0" + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" }, "engines": { "node": ">=8" @@ -1166,20 +1152,21 @@ } }, "node_modules/@jest/console": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz", - "integrity": "sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-30.5.2.tgz", + "integrity": "sha512-e8sQC4pCMHPBrPX7Hk8TJr+DM5dkUnImSTNag8SEWFAFAF6xIz4AJvCKapnrdHnZxep4bxw4PhG+ZbimYBMyKw==", "dev": true, + "license": "MIT", "dependencies": { - "@jest/types": "^29.6.3", + "@jest/types": "30.5.1", "@types/node": "*", - "chalk": "^4.0.0", - "jest-message-util": "^29.7.0", - "jest-util": "^29.7.0", + "chalk": "^4.1.2", + "jest-message-util": "30.5.1", + "jest-util": "30.5.1", "slash": "^3.0.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/console/node_modules/ansi-styles": { @@ -1187,6 +1174,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -1202,6 +1190,7 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -1218,6 +1207,7 @@ "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -1227,6 +1217,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -1235,42 +1226,43 @@ } }, "node_modules/@jest/core": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz", - "integrity": "sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-30.5.2.tgz", + "integrity": "sha512-/jqvFWoJF7LV1a6AUpYMbMm+2yIYsHJfR474H0SCzr9k8tnO/jl9wRg6zSG6lxgf6EozNlCG4amFzWsbZSvvZA==", "dev": true, + "license": "MIT", "dependencies": { - "@jest/console": "^29.7.0", - "@jest/reporters": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", + "@jest/console": "30.5.2", + "@jest/pattern": "30.5.0", + "@jest/reporters": "30.5.2", + "@jest/test-result": "30.5.2", + "@jest/transform": "30.5.2", + "@jest/types": "30.5.1", "@types/node": "*", - "ansi-escapes": "^4.2.1", - "chalk": "^4.0.0", - "ci-info": "^3.2.0", - "exit": "^0.1.2", - "graceful-fs": "^4.2.9", - "jest-changed-files": "^29.7.0", - "jest-config": "^29.7.0", - "jest-haste-map": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-regex-util": "^29.6.3", - "jest-resolve": "^29.7.0", - "jest-resolve-dependencies": "^29.7.0", - "jest-runner": "^29.7.0", - "jest-runtime": "^29.7.0", - "jest-snapshot": "^29.7.0", - "jest-util": "^29.7.0", - "jest-validate": "^29.7.0", - "jest-watcher": "^29.7.0", - "micromatch": "^4.0.4", - "pretty-format": "^29.7.0", - "slash": "^3.0.0", - "strip-ansi": "^6.0.0" + "ansi-escapes": "^4.3.2", + "chalk": "^4.1.2", + "ci-info": "^4.2.0", + "exit-x": "^0.2.2", + "fast-json-stable-stringify": "^2.1.0", + "graceful-fs": "^4.2.11", + "jest-changed-files": "30.5.1", + "jest-config": "30.5.2", + "jest-haste-map": "30.5.1", + "jest-message-util": "30.5.1", + "jest-regex-util": "30.5.0", + "jest-resolve": "30.5.1", + "jest-resolve-dependencies": "30.5.2", + "jest-runner": "30.5.2", + "jest-runtime": "30.5.2", + "jest-snapshot": "30.5.2", + "jest-util": "30.5.1", + "jest-validate": "30.5.1", + "jest-watcher": "30.5.2", + "pretty-format": "30.5.1", + "slash": "^3.0.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" }, "peerDependencies": { "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" @@ -1281,20 +1273,12 @@ } } }, - "node_modules/@jest/core/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/@jest/core/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -1310,6 +1294,7 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -1321,38 +1306,12 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/@jest/core/node_modules/ci-info": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", - "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/sibiraj-s" - } - ], - "engines": { - "node": ">=8" - } - }, "node_modules/@jest/core/node_modules/slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/@jest/core/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, + "license": "MIT", "engines": { "node": ">=8" } @@ -1362,6 +1321,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -1369,111 +1329,166 @@ "node": ">=8" } }, + "node_modules/@jest/diff-sequences": { + "version": "30.5.0", + "resolved": "https://registry.npmjs.org/@jest/diff-sequences/-/diff-sequences-30.5.0.tgz", + "integrity": "sha512-OsqBjHXCn8cadasoAZBP6nWYvMsRhpMzGXTpxJ5aO04NlbdhIz+FVe3q49l0AwVhsz/cEmIpBes6gAFl1/dWQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, "node_modules/@jest/environment": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", - "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-30.5.2.tgz", + "integrity": "sha512-nwFPOUMbmsjNNRCpnJpB9HbSZu4C07wDDds++5j+j1MezzPLxMPDdbdUVjr2o4RULDOValnDd70taPFI1EtxAg==", "dev": true, + "license": "MIT", "dependencies": { - "@jest/fake-timers": "^29.7.0", - "@jest/types": "^29.6.3", + "@jest/fake-timers": "30.5.2", + "@jest/types": "30.5.1", "@types/node": "*", - "jest-mock": "^29.7.0" + "jest-mock": "30.5.2" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/expect": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", - "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-30.5.2.tgz", + "integrity": "sha512-2E+1Pg6jJxbRjLNLpciC71iri/3qsKJL222/aXJEFwC0VdUSvfS+JZQQLEVjUYYc8t8pQu2MGE3cF2+bNTYRsg==", "dev": true, + "license": "MIT", "dependencies": { - "expect": "^29.7.0", - "jest-snapshot": "^29.7.0" + "expect": "30.5.2", + "jest-snapshot": "30.5.2" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/expect-utils": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", - "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-30.5.2.tgz", + "integrity": "sha512-d/HOLSrJUlBIl6n3LzOa7cjW3xdePm5H5gQw2lixZ/0h157l9sw3mLblzFqnPcTbhDzhRQdBOX3A3KcG73nm5Q==", "dev": true, + "license": "MIT", "dependencies": { - "jest-get-type": "^29.6.3" + "@jest/get-type": "30.5.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/fake-timers": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz", - "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-30.5.2.tgz", + "integrity": "sha512-GKk0h0tKT5SpDPxDhPg3r9mm5s8/YCBzVNMOGdRiQXwUiMsjU10mVPlMaQstH6/cu50vOb8N9oQUMETHuwwxKw==", "dev": true, + "license": "MIT", "dependencies": { - "@jest/types": "^29.6.3", - "@sinonjs/fake-timers": "^10.0.2", + "@jest/types": "30.5.1", + "@sinonjs/fake-timers": "^15.4.0", "@types/node": "*", - "jest-message-util": "^29.7.0", - "jest-mock": "^29.7.0", - "jest-util": "^29.7.0" + "jest-message-util": "30.5.1", + "jest-mock": "30.5.2", + "jest-util": "30.5.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/get-type": { + "version": "30.5.0", + "resolved": "https://registry.npmjs.org/@jest/get-type/-/get-type-30.5.0.tgz", + "integrity": "sha512-9/2VUPitAjmBzbvDvqrxmvB7BzWsBW0WmkkojX1ODuxX1NLGxx9gfaZpHB0z8DtJ9uhGNmZG/VXBhf8uO0OV8Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/globals": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", - "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-30.5.2.tgz", + "integrity": "sha512-62zfS+dL+M5aTNHXCNLyqD+j4oqxTIzDYrZbpqMP8Yn+gvlAGyzC6BSPNb1ZmFOakV1RtFYX/O3FCQXSWmQdgg==", "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "30.5.2", + "@jest/expect": "30.5.2", + "@jest/types": "30.5.1", + "jest-mock": "30.5.2" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/pattern": { + "version": "30.5.0", + "resolved": "https://registry.npmjs.org/@jest/pattern/-/pattern-30.5.0.tgz", + "integrity": "sha512-HdNQYSdRTEBNrginaqzQtTjG0HRMfrra/z6Ok7uL3S87vSlarIVohEsJsSj5edu3MiHoHjAkvPROz5ZjoKai+w==", + "dev": true, + "license": "MIT", "dependencies": { - "@jest/environment": "^29.7.0", - "@jest/expect": "^29.7.0", - "@jest/types": "^29.6.3", - "jest-mock": "^29.7.0" + "@types/node": "*", + "jest-regex-util": "30.5.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, + "node_modules/@jest/react-is-18": { + "name": "react-is", + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jest/react-is-19": { + "name": "react-is", + "version": "19.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-19.3.1.tgz", + "integrity": "sha512-RRieF6IyxQBkcK6pP8xOHprLTPW6QjRkbGdImtqNme+/hYVwCZkLQLdlZGOhUqXwkS9IEynaGvPJtv6XB/cz0Q==", + "dev": true, + "license": "MIT" + }, "node_modules/@jest/reporters": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz", - "integrity": "sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-30.5.2.tgz", + "integrity": "sha512-ev6E9iG73twQcfAfoTnviuYkr3yOrYbzAtMFCimv2fxHXPIp9PBt2u1wNMt0aYWgl8FPwIcS8oqRJg6alnht4Q==", "dev": true, + "license": "MIT", "dependencies": { "@bcoe/v8-coverage": "^0.2.3", - "@jest/console": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", - "@jridgewell/trace-mapping": "^0.3.18", + "@jest/console": "30.5.2", + "@jest/test-result": "30.5.2", + "@jest/transform": "30.5.2", + "@jest/types": "30.5.1", + "@jridgewell/trace-mapping": "^0.3.31", "@types/node": "*", - "chalk": "^4.0.0", - "collect-v8-coverage": "^1.0.0", - "exit": "^0.1.2", - "glob": "^7.1.3", - "graceful-fs": "^4.2.9", + "chalk": "^4.1.2", + "collect-v8-coverage": "^1.0.2", + "exit-x": "^0.2.2", + "glob": "^13.0.6", + "graceful-fs": "^4.2.11", "istanbul-lib-coverage": "^3.0.0", "istanbul-lib-instrument": "^6.0.0", "istanbul-lib-report": "^3.0.0", - "istanbul-lib-source-maps": "^4.0.0", + "istanbul-lib-source-maps": "^5.0.0", "istanbul-reports": "^3.1.3", - "jest-message-util": "^29.7.0", - "jest-util": "^29.7.0", - "jest-worker": "^29.7.0", + "jest-message-util": "30.5.1", + "jest-util": "30.5.1", + "jest-worker": "30.5.1", "slash": "^3.0.0", - "string-length": "^4.0.1", - "strip-ansi": "^6.0.0", + "string-length": "^4.0.2", "v8-to-istanbul": "^9.0.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" }, "peerDependencies": { "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" @@ -1484,20 +1499,12 @@ } } }, - "node_modules/@jest/reporters/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/@jest/reporters/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -1513,6 +1520,7 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -1529,18 +1537,7 @@ "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/@jest/reporters/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, + "license": "MIT", "engines": { "node": ">=8" } @@ -1550,6 +1547,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -1558,68 +1556,136 @@ } }, "node_modules/@jest/schemas": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", - "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "version": "30.5.0", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-30.5.0.tgz", + "integrity": "sha512-/hunigyNpc4RCjC0VaW3f5RCUZVM2+WQ65qP7z083Gmvac7or2LI50XVNOtE4YPgBpV0yxYiAgorAPGniCoJmg==", "dev": true, + "license": "MIT", "dependencies": { - "@sinclair/typebox": "^0.27.8" + "@sinclair/typebox": "^0.34.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, - "node_modules/@jest/source-map": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz", - "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", + "node_modules/@jest/snapshot-utils": { + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/@jest/snapshot-utils/-/snapshot-utils-30.5.1.tgz", + "integrity": "sha512-V3wnxNtiVmw5PPVg433Cn3VdXnsOeu/ofLw3KC04Bn2y1wIlU5kozXQn48rhrgj/02LrCVtntTEF1yBha0XSUw==", "dev": true, + "license": "MIT", "dependencies": { - "@jridgewell/trace-mapping": "^0.3.18", - "callsites": "^3.0.0", - "graceful-fs": "^4.2.9" + "@jest/types": "30.5.1", + "chalk": "^4.1.2", + "graceful-fs": "^4.2.11", + "natural-compare": "^1.4.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/source-map/node_modules/callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, - "engines": { - "node": ">=6" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, - "node_modules/@jest/test-result": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz", - "integrity": "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==", + "node_modules/@jest/snapshot-utils/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", "dependencies": { - "@jest/console": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "collect-v8-coverage": "^1.0.0" + "color-convert": "^2.0.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@jest/snapshot-utils/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@jest/snapshot-utils/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/source-map": { + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-30.5.2.tgz", + "integrity": "sha512-c5CehvkbfHX6yyNg7bMn2ylqlp9AHXuZ/3hPH/Lh5bxD/vefd/lV9HBjMqXef9yQNqkdwyZvkLSVSwB38hy8Qw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.31", + "callsites": "^3.1.0", + "convert-source-map": "^2.0.0", + "graceful-fs": "^4.2.11" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/@jest/source-map/node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/@jest/test-result": { + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-30.5.2.tgz", + "integrity": "sha512-eO6YU5rsLfs60ne694e0IAmRgeBnoA8mu0nlxXDbl/1j5km0o2vO9/VbbUIKIH+WRKKEI+ELgwraRGn2Lhep8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/console": "30.5.2", + "@jest/types": "30.5.1", + "@types/istanbul-lib-coverage": "^2.0.6", + "collect-v8-coverage": "^1.0.2" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/test-sequencer": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz", - "integrity": "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-30.5.2.tgz", + "integrity": "sha512-bmij8jZyYAC47ExT2GeP7PcrlwSNS+Bp3KeRuBH88gpcxqDv6fljN8PemS4J/lLZ79xb6mpaennQTTq0zUAVVg==", "dev": true, + "license": "MIT", "dependencies": { - "@jest/test-result": "^29.7.0", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.7.0", + "@jest/test-result": "30.5.2", + "graceful-fs": "^4.2.11", + "jest-haste-map": "30.5.1", "slash": "^3.0.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/test-sequencer/node_modules/slash": { @@ -1627,34 +1693,35 @@ "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/@jest/transform": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", - "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-30.5.2.tgz", + "integrity": "sha512-LBGwmaE886C41jDZ65eqR1YbXM7642MK3ZhTowZd5+xDlrDLuf4ePuDdDmVSvcr8NTVJ3MqxLkMbUCzuigUaoQ==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/core": "^7.11.6", - "@jest/types": "^29.6.3", - "@jridgewell/trace-mapping": "^0.3.18", - "babel-plugin-istanbul": "^6.1.1", - "chalk": "^4.0.0", + "@babel/core": "^7.27.4", + "@jest/types": "30.5.1", + "@jridgewell/trace-mapping": "^0.3.31", + "babel-plugin-istanbul": "^8.0.0", + "chalk": "^4.1.2", "convert-source-map": "^2.0.0", "fast-json-stable-stringify": "^2.1.0", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.7.0", - "jest-regex-util": "^29.6.3", - "jest-util": "^29.7.0", - "micromatch": "^4.0.4", - "pirates": "^4.0.4", + "graceful-fs": "^4.2.11", + "jest-haste-map": "30.5.1", + "jest-regex-util": "30.5.0", + "jest-util": "30.5.1", + "pirates": "^4.0.7", "slash": "^3.0.0", - "write-file-atomic": "^4.0.2" + "write-file-atomic": "^5.0.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/transform/node_modules/ansi-styles": { @@ -1688,6 +1755,19 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/@jest/transform/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/@jest/transform/node_modules/slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", @@ -1710,33 +1790,36 @@ } }, "node_modules/@jest/transform/node_modules/write-file-atomic": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", - "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-5.0.1.tgz", + "integrity": "sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==", "dev": true, + "license": "ISC", "dependencies": { "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.7" + "signal-exit": "^4.0.1" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, "node_modules/@jest/types": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", - "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-30.5.1.tgz", + "integrity": "sha512-LvVYn83nnXPl+Rg98nvcFgjx6nRMTArhSn6RAX/w3ELn54S8A42TYZvsCMdGUqTM8S0wyXbtlQdU6Hi6dykj9g==", "dev": true, + "license": "MIT", "dependencies": { - "@jest/schemas": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", + "@jest/pattern": "30.5.0", + "@jest/schemas": "30.5.0", + "@types/istanbul-lib-coverage": "^2.0.6", + "@types/istanbul-reports": "^3.0.4", "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" + "@types/yargs": "^17.0.33", + "chalk": "^4.1.2" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/types/node_modules/ansi-styles": { @@ -1783,17 +1866,25 @@ } }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", - "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", "dev": true, + "license": "MIT", "dependencies": { - "@jridgewell/set-array": "^1.2.1", - "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.24" - }, - "engines": { - "node": ">=6.0.0" } }, "node_modules/@jridgewell/resolve-uri": { @@ -1805,49 +1896,77 @@ "node": ">=6.0.0" } }, - "node_modules/@jridgewell/set-array": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", - "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "node_modules/@jridgewell/source-map": { + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.11.tgz", + "integrity": "sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==", "dev": true, - "engines": { - "node": ">=6.0.0" + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", - "dev": true + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", + "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", + "dev": true, + "license": "MIT" }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.25", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", - "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", "dev": true, + "license": "MIT", "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, "node_modules/@mapbox/node-pre-gyp": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz", - "integrity": "sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-2.0.3.tgz", + "integrity": "sha512-uwPAhccfFJlsfCxMYTwOdVfOz3xqyj8xYL3zJj8f0pb30tLohnnFPhLuqp4/qoEz8sNxe4SESZedcBojRefIzg==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { + "consola": "^3.2.3", "detect-libc": "^2.0.0", - "https-proxy-agent": "^5.0.0", - "make-dir": "^3.1.0", + "https-proxy-agent": "^7.0.5", "node-fetch": "^2.6.7", - "nopt": "^5.0.0", - "npmlog": "^5.0.1", - "rimraf": "^3.0.2", - "semver": "^7.3.5", - "tar": "^6.1.11" + "nopt": "^8.0.0", + "semver": "^7.5.3", + "tar": "^7.4.0" }, "bin": { "node-pre-gyp": "bin/node-pre-gyp" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@napi-rs/wasm-runtime": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.2.6.tgz", + "integrity": "sha512-mRyDmEw9/fCDXCGfL1sbgIw/GUK0PVxRW4YwgPN61F3LQ+fSyoBFarJVzgGyhF6kRzEQZ0FejDqm4WLXSeqQmw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@tybys/wasm-util": "^0.10.3" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=23.5.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + }, + "peerDependencies": { + "@emnapi/core": "^1.7.1 || 2.0.0-beta.2", + "@emnapi/runtime": "^1.7.1 || 2.0.0-beta.2" } }, "node_modules/@nodelib/fs.scandir": { @@ -1855,6 +1974,7 @@ "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" @@ -1868,6 +1988,7 @@ "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "dev": true, + "license": "MIT", "engines": { "node": ">= 8" } @@ -1877,6 +1998,7 @@ "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" @@ -1885,494 +2007,1903 @@ "node": ">= 8" } }, - "node_modules/@rollup/pluginutils": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.2.1.tgz", - "integrity": "sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==", + "node_modules/@oxc-project/types": { + "version": "0.156.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.156.0.tgz", + "integrity": "sha512-1Duyg48TdJNdyhEB8Xn1L36bT9Pv6GUtlKjHxOys8xkaF/rQq3XJE+bAurSK/AgIz5mGFsb77cn9Pb20+WCScw==", "dev": true, - "dependencies": { - "estree-walker": "^2.0.1", - "picomatch": "^2.2.2" - }, - "engines": { - "node": ">= 8.0.0" + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/oxc-project" } }, - "node_modules/@rollup/pluginutils/node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "node_modules/@parcel/watcher": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.6.0.tgz", + "integrity": "sha512-7FNeNl8NCE7aINx7WXiKQrPYZWC/hvrTsmk6zmxbI7LTXE7hVek/n8AfVgpe2y82zl3w0HvCHN0bVKMBoJcC0w==", "dev": true, + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "detect-libc": "^2.0.3", + "is-glob": "^4.0.3", + "node-addon-api": "^7.0.0", + "picomatch": "^4.0.4" + }, "engines": { - "node": ">=8.6" + "node": ">= 10.0.0" }, "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.12.1.tgz", - "integrity": "sha512-iU2Sya8hNn1LhsYyf0N+L4Gf9Qc+9eBTJJJsaOGUp+7x4n2M9dxTt8UvhJl3oeftSjblSlpCfvjA/IfP3g5VjQ==", + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "@parcel/watcher-android-arm64": "2.6.0", + "@parcel/watcher-darwin-arm64": "2.6.0", + "@parcel/watcher-darwin-x64": "2.6.0", + "@parcel/watcher-freebsd-x64": "2.6.0", + "@parcel/watcher-linux-arm-glibc": "2.6.0", + "@parcel/watcher-linux-arm-musl": "2.6.0", + "@parcel/watcher-linux-arm64-glibc": "2.6.0", + "@parcel/watcher-linux-arm64-musl": "2.6.0", + "@parcel/watcher-linux-x64-glibc": "2.6.0", + "@parcel/watcher-linux-x64-musl": "2.6.0", + "@parcel/watcher-win32-arm64": "2.6.0", + "@parcel/watcher-win32-x64": "2.6.0" + } + }, + "node_modules/@parcel/watcher-android-arm64": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.6.0.tgz", + "integrity": "sha512-trgpLSCKRC/huFjXX/Smh+0sWe4+YtKfktIToiMl59ghz7z+qkH6kMvNnUbLyRs9N11t8l4svSCs1+5B3rOAhA==", "cpu": [ - "arm" + "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" - ] + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } }, - "node_modules/@rollup/rollup-android-arm64": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.12.1.tgz", - "integrity": "sha512-wlzcWiH2Ir7rdMELxFE5vuM7D6TsOcJ2Yw0c3vaBR3VOsJFVTx9xvwnAvhgU5Ii8Gd6+I11qNHwndDscIm0HXg==", + "node_modules/@parcel/watcher-darwin-arm64": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.6.0.tgz", + "integrity": "sha512-Y3QV0gl7Q1zbfueunkWIERICbEojQFCgpyG7YqOGNFLsckXyI1xu9mAIUpKY9QBYzBtSkN8dBPwd3yiAO9ovMw==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ - "android" - ] + "darwin" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } }, - "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.12.1.tgz", - "integrity": "sha512-YRXa1+aZIFN5BaImK+84B3uNK8C6+ynKLPgvn29X9s0LTVCByp54TB7tdSMHDR7GTV39bz1lOmlLDuedgTwwHg==", + "node_modules/@parcel/watcher-darwin-x64": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-x64/-/watcher-darwin-x64-2.6.0.tgz", + "integrity": "sha512-Ohv6OpzhUfKYD7Beb8kDvG0jbIxORCYY1JRdZnaBtnjjkJxgD7ZVL0nw2sCYd0yTMKTvz3nnTnOF3cDifK+kvw==", "cpu": [ - "arm64" + "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" - ] + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } }, - "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.12.1.tgz", - "integrity": "sha512-opjWJ4MevxeA8FhlngQWPBOvVWYNPFkq6/25rGgG+KOy0r8clYwL1CFd+PGwRqqMFVQ4/Qd3sQu5t7ucP7C/Uw==", + "node_modules/@parcel/watcher-freebsd-x64": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-freebsd-x64/-/watcher-freebsd-x64-2.6.0.tgz", + "integrity": "sha512-5HmXvDgs8VK+74jF9y9/2FE3/OnlcKmc56tjmSrEuZjpSZOGL+fvAu+HKJBdPs9uwoP2hE6TlSUpXZ/C5jUFmQ==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ - "darwin" - ] + "freebsd" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } }, - "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.12.1.tgz", - "integrity": "sha512-uBkwaI+gBUlIe+EfbNnY5xNyXuhZbDSx2nzzW8tRMjUmpScd6lCQYKY2V9BATHtv5Ef2OBq6SChEP8h+/cxifQ==", + "node_modules/@parcel/watcher-linux-arm-glibc": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-glibc/-/watcher-linux-arm-glibc-2.6.0.tgz", + "integrity": "sha512-Ps/hui3A+vMbjdqlqAowK2ZL8+BO8dBjxeWXj6npTBs3jx4wWmbPpaLuqwrQrSqIVMCnpWo238bJ1U37GhQOYg==", "cpu": [ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" - ] + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } }, - "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.12.1.tgz", - "integrity": "sha512-0bK9aG1kIg0Su7OcFTlexkVeNZ5IzEsnz1ept87a0TUgZ6HplSgkJAnFpEVRW7GRcikT4GlPV0pbtVedOaXHQQ==", + "node_modules/@parcel/watcher-linux-arm-musl": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-musl/-/watcher-linux-arm-musl-2.6.0.tgz", + "integrity": "sha512-9c6AUHgHoG+IY88MRIHupztQiQnrbqHYQjkM2btA+Bf/wQnQMuiD0Wfk1EVv3TlNT3x41uU71rn6E4xh/+zvkw==", "cpu": [ - "arm64" + "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" - ] + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } }, - "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.12.1.tgz", - "integrity": "sha512-qB6AFRXuP8bdkBI4D7UPUbE7OQf7u5OL+R94JE42Z2Qjmyj74FtDdLGeriRyBDhm4rQSvqAGCGC01b8Fu2LthQ==", + "node_modules/@parcel/watcher-linux-arm64-glibc": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-glibc/-/watcher-linux-arm64-glibc-2.6.0.tgz", + "integrity": "sha512-yHRqS2owEXe6Hic9z6Mh1ECsCd+ODVOGvZDyciqRd21+v+o+DnXMOrw50DSpIG2sb8GPEaPPmfeCAWKPJdq46g==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" - ] + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } }, - "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.12.1.tgz", - "integrity": "sha512-sHig3LaGlpNgDj5o8uPEoGs98RII8HpNIqFtAI8/pYABO8i0nb1QzT0JDoXF/pxzqO+FkxvwkHZo9k0NJYDedg==", + "node_modules/@parcel/watcher-linux-arm64-musl": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-musl/-/watcher-linux-arm64-musl-2.6.0.tgz", + "integrity": "sha512-WhB2e/V7rqdHHWZusBSPuy5Ei8S6lSz6FE5TKKQz5h3a0O+C+mhY7vxU9b/stqvMb8beLnPY82ZrFTLKs+SrKA==", "cpu": [ - "riscv64" + "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" - ] + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } }, - "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.12.1.tgz", - "integrity": "sha512-nD3YcUv6jBJbBNFvSbp0IV66+ba/1teuBcu+fBBPZ33sidxitc6ErhON3JNavaH8HlswhWMC3s5rgZpM4MtPqQ==", + "node_modules/@parcel/watcher-linux-x64-glibc": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.6.0.tgz", + "integrity": "sha512-ulGE6x6Oz6iAwg75T8YQSoguBWasniIbX+QWpaYPcCnDOpdWX3k+4xbEYPZVLxOuoJI+svJJPD3sEj8G7lrQ3A==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" - ] + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } }, - "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.12.1.tgz", - "integrity": "sha512-7/XVZqgBby2qp/cO0TQ8uJK+9xnSdJ9ct6gSDdEr4MfABrjTyrW6Bau7HQ73a2a5tPB7hno49A0y1jhWGDN9OQ==", + "node_modules/@parcel/watcher-linux-x64-musl": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.6.0.tgz", + "integrity": "sha512-tkBYKt7YQrjIJWYDnto2YgO8MRkjlMTSNoRHzsXinBqbLdeOM3L32wPZJvIZxqaLMfSlS/4sUjH/6STVP/XDLw==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" - ] + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } }, - "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.12.1.tgz", - "integrity": "sha512-CYc64bnICG42UPL7TrhIwsJW4QcKkIt9gGlj21gq3VV0LL6XNb1yAdHVp1pIi9gkts9gGcT3OfUYHjGP7ETAiw==", + "node_modules/@parcel/watcher-win32-arm64": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-arm64/-/watcher-win32-arm64-2.6.0.tgz", + "integrity": "sha512-gIZAP23jaHjGWasY/TY6yL7NHFClf0Ga7FN+iINvk+KN94rhm94lYZhFsbYFNcA04/onvGD9kKmiJLJB2HbNwQ==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-win32-x64": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.6.0.tgz", + "integrity": "sha512-cA+/pXV2YkfxlIcXOQ5fSWqAzzPyD78/x5qbK/I0vUkrlYHA8TIz+MXjAbGouguKVSI4bOmkTSJ1/poVSsgt+A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@pkgr/core": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.3.6.tgz", + "integrity": "sha512-SEeaJLb3qBNF/OaXnaR1NmmBbFYk1zC0ZH/52fATcRPLFg/p791YrcyFFy44Bo9sLaGuSuLp5Q6axbb/O+v/RA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/pkgr" + } + }, + "node_modules/@rolldown/binding-android-arm-eabi": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.19.tgz", + "integrity": "sha512-e+Ebe0WT+9tbXmNKPIiC8YrWAHYwug3m6i4p3rZGGulfZri1jtI4HslT+OZnFf/OIHowWF71DTlHwXBP2SiA7A==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-android-arm64": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.19.tgz", + "integrity": "sha512-hOombrTJ+szt2ciEzS7oCA78lMPBgF5UMQWCJIyNfnrI7GLl8HYoFqCnpL2gcPOaXMqryGCU5ExdQKyDDcC+yA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.19.tgz", + "integrity": "sha512-XoMA2pwCKGTQzUjPgtRwkedH4WmXhdIPKT6l6oOxd1PUbNodGI6DcBekgN7EC//+x3pfBYX/qL1gNmZAqivw5g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-x64": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.19.tgz", + "integrity": "sha512-zo8EsSSwMZCY/e+fRnGaX02YGgvJD0yvhNi/9hpGPA2MJ9ZF8dPCw75UGfpI6OpQ/myR/dIYmogRvqiZD0TrXg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.19.tgz", + "integrity": "sha512-O8ISAOfI1nj7AuBPd30FSF47z7f7lzlk5poQVGgiikvQuGEBFYvW8ki+UEnT+YJPnNGjQzn304klt4O9FUE7mA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.19.tgz", + "integrity": "sha512-/lYCba5NO0yq4S0jGMH8QTBtkvQxoXjoQWzF5BcWp9MjB9jxVRD1GQDNofkVjcOj30DWyhLIN/4Oe60JKzaONw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.19.tgz", + "integrity": "sha512-pm/apFMBnSbFb3O6nG5pHO1iqHhZrjGDFEjSm+ot9J17XXPvH9L90y5h+jgfHCE+Qdlsvy8qKEcU4VKxgjD+vA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.19.tgz", + "integrity": "sha512-K1SmQp3FFichn8oqrNIwvFoZ5wcvjC7goBzpaMNvLf9FZc+QB/QvLmnpJZgAAGHiD980tP8FZZnXk2K94rvlxg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.19.tgz", + "integrity": "sha512-I0xwD57jP/3A7+5UPZin2w8Y7XHEmEM5zqpYZOcQ45MlNW6tUJUziymV3yRr7rL4vwyfEcRsRksC4a7Kc08p5Q==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.19.tgz", + "integrity": "sha512-BrtEHT24SNXj9HiXqy+s/kXiSiQGt6EKCPUlRirAoIioVxKGnbXBUEkbZASAei7iZJB0/Ynm+0JP00Ipx7AnSw==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.19.tgz", + "integrity": "sha512-rm75/9DkHKeU2WnA8w4X94WGYgLlDCFCfkQC+4bguVJmC/jvDRv2B+2wLOYhyE0fVuv7//Ckk39OoOufyCu76Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.19.tgz", + "integrity": "sha512-irh/4+iYFM4GAzpluDErgjz89bj6NDtqqMAG/6O1LG38Ed3NpyebzCpcVNkFW8uhy+/3/BocUvnXDR33CXWe9A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.19.tgz", + "integrity": "sha512-+KWTWNoPt+CfSq94CiceWu3yPE+QzkaG+phPyz9G60tmZLwfQkcA4AeksafzvJAw4pvg1mcd5a1TkUqVv0s4JA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-wasm32-wasi": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.2.19.tgz", + "integrity": "sha512-7EH+skOsl5qpWnK0vzamgJFhOv1cwxQpsxm8tI883K9fur5c27p8q87fzEO6BbBPabA2/+s/zR63/pLc137iOg==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "2.0.0-beta.2", + "@emnapi/runtime": "2.0.0-beta.2", + "@napi-rs/wasm-runtime": "1.2.6" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=23.5.0" + } + }, + "node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.19.tgz", + "integrity": "sha512-3Q1Yg1Q7tEvBWoZf5rFvG/GKZQPgwfru+p4wBajDfJFBs0SHCpL++dfTjW9gyAKd1T7ZpIYvdaUax7Pa/IhFVQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.19.tgz", + "integrity": "sha512-y/sqRRc6d7hECzOFc5n3LSeqctmIp9mMjY1Kq4s14uLPd/LZ4z7i1zrW6fMtp2mPeuQIC4e6ULMcwQzMomqQag==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.1.1.tgz", + "integrity": "sha512-glFIJDvLNDtJhT9qrMFWLPbvS+skxgt4L0K8Ei2YtnhPysAJnsI7nyxSJxKj4ADeKX0OLjC4ntRkwpLOoS3rwA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@rollup/plugin-commonjs": { + "version": "29.0.3", + "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-29.0.3.tgz", + "integrity": "sha512-ZaOxZceP7SOUW7Lqw5IRVweSQYWaeIPnXIGLiB690EBA3FGJTO40EEr2L5yZplJWsgTCogILRSpcAe7+U0Otdg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^5.0.1", + "commondir": "^1.0.1", + "estree-walker": "^2.0.2", + "fdir": "^6.2.0", + "is-reference": "1.2.1", + "magic-string": "^0.30.3", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=16.0.0 || 14 >= 14.17" + }, + "peerDependencies": { + "rollup": "^2.68.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-commonjs/node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/@rollup/plugin-node-resolve": { + "version": "16.0.3", + "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-16.0.3.tgz", + "integrity": "sha512-lUYM3UBGuM93CnMPG1YocWu7X802BrNF3jW2zny5gQyLQgRFJhV1Sq0Zi74+dh/6NBx1DxFC4b4GXg9wUCG5Qg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^5.0.1", + "@types/resolve": "1.20.2", + "deepmerge": "^4.2.2", + "is-module": "^1.0.0", + "resolve": "^1.22.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^2.78.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/pluginutils": { + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.5.1.tgz", + "integrity": "sha512-P9ZvnfouRu4MSC+ilERaw6FmZs8zqKhpHxEs4aGDGWQAMzQGXnhvCSvoNwokfNvdt7t3Y5Y4p6gStQgezeIqug==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "estree-walker": "^2.0.2", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.68.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.68.4.tgz", + "integrity": "sha512-8AfICPTDNFpsRltDrWzlX3iVEwHubamhXc10bjOJRCl4eZXj+BE25uCVMYzFpbcqfuxSfrt4VkSVL5QqiHoVDQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.68.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.68.4.tgz", + "integrity": "sha512-Vs4CxDXeCrCVNZ9jPnicohYT7aX7cxLzjMepkno/7f1zFhC80OUsKHM03BJsusLfYnjKrUe7D8vPvQNdD+rjCg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-x64": { + "version": "4.68.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-x64/-/rollup-android-x64-4.68.4.tgz", + "integrity": "sha512-EEytXPqw9k5OIyx1Cou+Xg8XhTwtWW31WIGq1cWTpX05ek6STIprxJ5wY6cOEZAk5sjXM/mE2/JohNhtUiPukg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.68.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.68.4.tgz", + "integrity": "sha512-eRYMGvFdL3TKnaXlacxifKMltpLxehT0XghbV5pPfzJUNCc+psia9rg/scZZPfeDK+VKpSZx9VoMz236yeYEaQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.68.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.68.4.tgz", + "integrity": "sha512-w+E1P+Ul1PgoAiH22tcONSEyx+3VjUcSIZeqr1QSOSC5vvawduMVtgD1ZtfQsPHkpTN/VJekrgN3JL2+YKhaDQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.68.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.68.4.tgz", + "integrity": "sha512-nukgdVNAx7X07qu8nZjJwuCRW/yDjLIio83yXhKUkuUUXTlmEGjVRN+XxrzxnkhiTRfHnqC/OYAga3t7vMQkAw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.68.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.68.4.tgz", + "integrity": "sha512-o5vn+twqv2XwxEpseC76YCNXpCXoRlPmr+ZYpSnmlxbFh5kdHysap9V93cS1hzAXtK6xuXa5kdtS+/8rkUfs4Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.68.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.68.4.tgz", + "integrity": "sha512-b2w9laiL8oWofYqGF+ABzin9wNMPxzHRD21EIPJ5A0iniq19d3flE4UP7uZKl1gj+d3Kv/bt1htVUSzI0bE1TQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.68.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.68.4.tgz", + "integrity": "sha512-Ao858LxFnvGrn4qbin3rr+LmEhOrF9pQKgzEnT14f9KjOpytd5smOuj7OOtkejJ7YVb5cBdPpYdT1zjwNcNq9g==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.68.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.68.4.tgz", + "integrity": "sha512-B78SoWLJeAleSOIDFZ+twb+7DoBla0g73LrdkxlkNwicAsrLfHeYX+NcPlOmxZ3Z8vKVvj0J/kmIMzEaqbQNGg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.68.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.68.4.tgz", + "integrity": "sha512-IK0JVhVLGer5AlmgU0eMbfuldxO1wNACZBwyq+ot9UW899hhkWPcO3k0eIrNlqmuWrySvMtzr7GK9xkbNekOTQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.68.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.68.4.tgz", + "integrity": "sha512-6MoYXMYy+6eqtVesSNehfsS3LY4A0P8MpHfhcnMkVsWVhaLv0vvuCj2EGkanchIoyHxAmxY+aR3ankaTkokC2A==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.68.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.68.4.tgz", + "integrity": "sha512-mo+MC3fHiG4EOdtp7uGSvBv/4hKpqxhV16QGpXn2D0mTBBiOW6hGIOXUK7nck8THlURRWjYdtUPvvJfxHKZ/2w==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.68.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.68.4.tgz", + "integrity": "sha512-uBRu6ztHsmoW/10bPsOVbhW8ie4Puw6+CQD/XLRGqr3ugv6pRNm3b4vebiwouhCgkjJ/ItJdqHKJ3mVhpr/wQA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.68.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.68.4.tgz", + "integrity": "sha512-XNY+QlYWmhqzeiMdOKjziVnx6aP5cXSxbk4rDqbb+MH2IcNiIZWX1wPRfAVV6ntiM17XHJJ2WUNcxnglDNH69A==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.68.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.68.4.tgz", + "integrity": "sha512-agahuMApMIOQgJMNEaJNtQRD+iUllqAvkF/V7WutWaBLTSeMgFd0urEo6m1scFmG0Cd+2zIPvnu2SWcKeuSB1Q==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.68.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.68.4.tgz", + "integrity": "sha512-1N+ysuGmcw/PAC4E5/vpotbjC7zHBMqOMJ+kdjkuvVGbj4Mkzu1/cNI4IMaU27VP6MWded1fQAU9ME2m/JmiUA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.68.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.68.4.tgz", + "integrity": "sha512-ZO0fVys5Rtut3W0FcpKl/T/CTuTgaujErjanLJHVSmqhWaXnPr1u1VAinHPb8ash+cHA8yMX4QnRbmXhrrXfAg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.68.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.68.4.tgz", + "integrity": "sha512-a4T4Ji3Is/TCh4rUuV6ehDdSMp3hxLH/v7mP4VT0kVB90Hfr9GUHVAiJhiJ3iy+tJ4qpvIG4haP+HpivOyWYpw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.68.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.68.4.tgz", + "integrity": "sha512-I4FcDk1+t2w7/JwKakDbhOKvtP07Q8Y/jqaTTdgVklmfqTqmTwtIk254iSP4iCgXgQWThKm8CN67mDzPGDnpqw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.68.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.68.4.tgz", + "integrity": "sha512-kpekXvZs3E/21ps5tUiPbQggi4C8bCx4jBl2eAIaVTerC7eDLWJunZ6nRw3/K4r20E5Z5f1bmbrfSS6H8GRv+A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.68.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.68.4.tgz", + "integrity": "sha512-mrnM4nr22FidljIL4vGK1htFcxPNCjLK/g2LQvgpBbq8pKL/zHY1czntTDbtYjoaYWVFu+XX0P2r2h/7zwWlIw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.68.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.68.4.tgz", + "integrity": "sha512-xKF6HKrBdrb3jpGFlGAGtNF6nMu/TGdnVO38durZTMQUaduIqH/aDIjyi7SXmXNDUXTfTMUEIGVwPQ5FuMhCLQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.68.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.68.4.tgz", + "integrity": "sha512-uu45X0jgiXEab6vcoWuPQLqhBPKUCZkXc+gv0oTI78mhn5DnQC2WGvNJ/s6Cnc68PvB/8vAtlE2dIHrpx/wySw==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.68.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.68.4.tgz", + "integrity": "sha512-+sVn72CSCbAemlPieSHWpBsJR5vkWH/xQM0Px0loHUhscMNl3CuH0UwTHuzCIaamlv+ZTi1V44jEKQ45FUaNwg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.68.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.68.4.tgz", + "integrity": "sha512-/eMzhxPPUGd5vjHdaNtvxHbblmoe+DyvPnJkZ4uQrDlVq9PQSd8br4pWwamycwRcLoNEzXwFy2mzcGoZTYqU5A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@sinclair/typebox": { + "version": "0.34.52", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.34.52.tgz", + "integrity": "sha512-XiMQh7qqVlxZzcVD+kkGMNGMzcTrDMLWI7S4x7z1MkCkbDPrekpZXEUK0eZqZFMuHQg2a2DZOcDIh9o5v3Gonw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@sindresorhus/merge-streams": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-2.3.0.tgz", + "integrity": "sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@sinonjs/commons": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", + "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "type-detect": "4.0.8" + } + }, + "node_modules/@sinonjs/fake-timers": { + "version": "15.5.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-15.5.0.tgz", + "integrity": "sha512-i7HpIYIsUmdSTQbtBjs2b3VqMgDsVDWfzVPV3MuUrXVqJNZmzFB8YJeM9SPms2bGg5zg7HvKH31sPS1WoLLRFg==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sinonjs/commons": "^3.0.1" + } + }, + "node_modules/@tybys/wasm-util": { + "version": "0.10.5", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.5.tgz", + "integrity": "sha512-dOGOPxlaNV+G046mZzN+9C0dAcQZeSKcXiVaM0TYy/LM4ttTmgSBDxYfovcYI8Em3+eAbiAYpvWLOv8+ZVRJKA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@types/babel__core": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "node_modules/@types/babel__generator": { + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.27.0.tgz", + "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.28.0.tgz", + "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.28.2" + } + }, + "node_modules/@types/chai": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz", + "integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/deep-eql": "*", + "assertion-error": "^2.0.1" + } + }, + "node_modules/@types/deep-eql": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz", + "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/estree": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.10.tgz", + "integrity": "sha512-lTyOMnOcmRBzdCv6/4zUZCrEhV0xrqQiUZBZtVcbmLHBXKLnN8q89v/wKRF/Q0HbwVsqbIG3o5HDoFl9sduM+g==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", + "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", + "dev": true + }, + "node_modules/@types/istanbul-lib-report": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz", + "integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==", + "dev": true, + "dependencies": { + "@types/istanbul-lib-coverage": "*" + } + }, + "node_modules/@types/istanbul-reports": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz", + "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==", + "dev": true, + "dependencies": { + "@types/istanbul-lib-report": "*" + } + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/mocha": { + "version": "10.0.10", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.10.tgz", + "integrity": "sha512-xPyYSz1cMPnJQhl0CLMH68j3gprKZaTjG3s5Vi+fDgx+uhG9NOXwbVt52eFS8ECyXhyKcjDLCBEqBExKuiZb7Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "22.20.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.20.5.tgz", + "integrity": "sha512-U2+DNr+wSjpsTS/wZGYHq7GcwfuSmKiKvoPvK22zwTlRhU91yOniN4qRR5KhIjvif7ysw/dz/hKmfDH0Ris4aA==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/@types/resolve": { + "version": "1.20.2", + "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz", + "integrity": "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/stack-utils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", + "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/yargs": { + "version": "17.0.35", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.35.tgz", + "integrity": "sha512-qUHkeCyQFxMXg79wQfTtfndEC+N9ZZg76HJftDJp+qH2tV7Gj4OJi7l+PiWwJ+pWtW8GwSmqsDj/oymhrTWXjg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "node_modules/@types/yargs-parser": { + "version": "21.0.3", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", + "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@ungap/structured-clone": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.4.0.tgz", + "integrity": "sha512-1mEZtMKPM09vDmQt5y7YvmN2+DFTP7Tg0EWXdic8/C6VRnpb33e4ghisCIE3WZjsE2N8mf+QV1Zqh7ZFYLWInQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/@unrs/resolver-binding-android-arm-eabi": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-android-arm-eabi/-/resolver-binding-android-arm-eabi-1.13.0.tgz", + "integrity": "sha512-60E5mvmIiW+i1E/HYeSX4iE4A8s9NJSGYPu7UM0DJght1c2tTkWwuyDyAwzsEXhKM/XbbndfnTiXdfrf27d2hw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@unrs/resolver-binding-android-arm64": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-android-arm64/-/resolver-binding-android-arm64-1.13.0.tgz", + "integrity": "sha512-qlh/JR3Tuy1cJ7xtf5pR4ykvLiK6os7X7EL2+zXZbrVc/s+yB8DoFdQrCAW9/a2TOxPVbR7QVNpkPWh7UWIsEQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@unrs/resolver-binding-darwin-arm64": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-darwin-arm64/-/resolver-binding-darwin-arm64-1.13.0.tgz", + "integrity": "sha512-yynnnnJXUC99WeD1GfvuXPKsKNfvgzGYC2eRayFnUfsHVROjqrbFOkFQLZiSx1H8+PLy5BzU8vqyPyLqbRfeBQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@unrs/resolver-binding-darwin-x64": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-darwin-x64/-/resolver-binding-darwin-x64-1.13.0.tgz", + "integrity": "sha512-t8PXE0Ip9tmGyhRlfVsnEbzGM5iSvJIeNIXciUACjzpg0mmPs13fGv2x7W8sBa0S8zbIiohxKXS9fL/LXW/ERQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@unrs/resolver-binding-freebsd-x64": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-freebsd-x64/-/resolver-binding-freebsd-x64-1.13.0.tgz", + "integrity": "sha512-qdtl9GDWDoDx6rhzF4RU5SJutV3lcLOiTiyqD6nBxYfEO6lAgLNukfrA+HJ2u2OiyWvV8JW5iEWD3LoONw7lYA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@unrs/resolver-binding-linux-arm-gnueabihf": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm-gnueabihf/-/resolver-binding-linux-arm-gnueabihf-1.13.0.tgz", + "integrity": "sha512-VrMUVwdrScTarsh4B6aUhTtziUavSlglo4Hi8XZ6CpAe4+j3nquY+XoP+tYkiSBDsXZ8386ne4pv4YYYBNi02w==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-arm-musleabihf": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm-musleabihf/-/resolver-binding-linux-arm-musleabihf-1.13.0.tgz", + "integrity": "sha512-zSbTVwaxiTC+zYJ9xVNTC6c+BYO/kOV/odcTI3bHuFFXa+XmjLoUkb/8UxsZeU5YF4K000m17wrXoTblNWuzOg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-arm64-gnu": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm64-gnu/-/resolver-binding-linux-arm64-gnu-1.13.0.tgz", + "integrity": "sha512-Z/Rax87moZHsuvJ8awdfP+zrMlsCt3d7mggUPIiPe32KpeagimyzJWnZSMQoV67an9uVQghyh92Pc0VprITnYA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-arm64-musl": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm64-musl/-/resolver-binding-linux-arm64-musl-1.13.0.tgz", + "integrity": "sha512-oUzXz8hNvFLNEAag8lBKJe1euiV2dmGHAR+eQ5fNpsZO0F1K7IMRb4J6pqYsd7uLMRQNPiu5A1WKUJHbFLWbbw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-loong64-gnu": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-loong64-gnu/-/resolver-binding-linux-loong64-gnu-1.13.0.tgz", + "integrity": "sha512-BxhGYvZBg0YrvNOeSEGR3eNklwXYy0mUJk7oeGJvZoQMKM68zYvbbf52+fQI3Le4X0fW276FTKIoTwjpMob80A==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-loong64-musl": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-loong64-musl/-/resolver-binding-linux-loong64-musl-1.13.0.tgz", + "integrity": "sha512-nZcIuup9Ar3gAlqoZfX/KW6x83TMI11tLpCjldZG5M1KeY8qNUPNJJ71+sPvG8HMBpoh+ix1pAm5gkMFvcSAcQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-ppc64-gnu": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-ppc64-gnu/-/resolver-binding-linux-ppc64-gnu-1.13.0.tgz", + "integrity": "sha512-AG6AgdDrkRNjAPwD/cftFJGgZUWCiJX+E8vpYCDEnwFHLTHZ7ppBiU6/vyPPwrfjcPUPQCDbbxE/eZUXsx49jQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-riscv64-gnu": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-riscv64-gnu/-/resolver-binding-linux-riscv64-gnu-1.13.0.tgz", + "integrity": "sha512-6vOqYGcAmzpRWpUURWutzvpf1qJ6eOu5cfYObdtPJnzZ0+Kw4cw+ZkZJqIYEh8fPuTBwSYDL/FwlUhma1G/JVQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-riscv64-musl": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-riscv64-musl/-/resolver-binding-linux-riscv64-musl-1.13.0.tgz", + "integrity": "sha512-4HeIn0S2KVUowK0A+EweXrDvZ8CKHEfTtif0kx9vt3ORNsqcXNFFIFnHE0tizma3/Gt5OGrU2ovYNuj+D/bN4g==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-s390x-gnu": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-s390x-gnu/-/resolver-binding-linux-s390x-gnu-1.13.0.tgz", + "integrity": "sha512-JfkvqY7NZbxyhexLE+g6Z8Hsx4utHOGaVazAVghPiBn8Upw2iERZPpKYnW1FBVU4WStv/BiIsoK/Muke0E7asA==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" ] }, - "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.12.1.tgz", - "integrity": "sha512-LN+vnlZ9g0qlHGlS920GR4zFCqAwbv2lULrR29yGaWP9u7wF5L7GqWu9Ah6/kFZPXPUkpdZwd//TNR+9XC9hvA==", + "node_modules/@unrs/resolver-binding-linux-x64-gnu": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-x64-gnu/-/resolver-binding-linux-x64-gnu-1.13.0.tgz", + "integrity": "sha512-iwjLeVdZo/8v5OKAeRIC+4VQV045t1EPZr5B/AVLgUQ04IdtNthWzg6not2cNjZgH2gHpSf4fOXMmN83aLO1FA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-linux-x64-musl": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-x64-musl/-/resolver-binding-linux-x64-musl-1.13.0.tgz", + "integrity": "sha512-TOh1fqOjyq1OPoht3BDLd7Y+HeMJRwd5g2VNmCQclknEbjp4py5GFRmT4L/rOybF5Af8q0LT9zHs2WGkwlqtrw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@unrs/resolver-binding-openharmony-arm64": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-openharmony-arm64/-/resolver-binding-openharmony-arm64-1.13.0.tgz", + "integrity": "sha512-3T2MNtF2dd1yjaXCVqrsi+/3VZeksEzU1hygPzqqkBLVVjn+2iJzXEkxxCKIVFrWnpmEbazeHJp/ruYD0RUVWA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@unrs/resolver-binding-win32-arm64-msvc": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-arm64-msvc/-/resolver-binding-win32-arm64-msvc-1.13.0.tgz", + "integrity": "sha512-hKWfSLiN3L4cIxg0jrpyP/66AXLTcyD37jmSn//rGdOUYGlizYxTEFdJ+GZbp2NnaML3YS/A73nCysze8FaJdg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@unrs/resolver-binding-win32-ia32-msvc": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-ia32-msvc/-/resolver-binding-win32-ia32-msvc-1.13.0.tgz", + "integrity": "sha512-N4gDKkDoiyIQEcn3vTqe2ksRxUAtBvQ8c5TiT+WonSa6FHgCAY5+RggnZ134hXJoRj57JEjv4/m+i/pAKHWrTQ==", "cpu": [ "ia32" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" ] }, - "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.12.1.tgz", - "integrity": "sha512-n+vkrSyphvmU0qkQ6QBNXCGr2mKjhP08mPRM/Xp5Ck2FV4NrHU+y6axzDeixUrCBHVUS51TZhjqrKBBsHLKb2Q==", + "node_modules/@unrs/resolver-binding-win32-x64-msvc": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-x64-msvc/-/resolver-binding-win32-x64-msvc-1.13.0.tgz", + "integrity": "sha512-DpLMlAqlrk4zBVK3DiDjwKD0oq7pZNy+8BiIBRuByqb6dm5jsdoLMhIiyh/xR7+WejaW/1Ui+XgbgMNa4+zWJg==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" ] }, - "node_modules/@sinclair/typebox": { - "version": "0.27.8", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", - "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", - "dev": true - }, - "node_modules/@sindresorhus/merge-streams": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-2.3.0.tgz", - "integrity": "sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==", + "node_modules/@vercel/nft": { + "version": "0.29.4", + "resolved": "https://registry.npmjs.org/@vercel/nft/-/nft-0.29.4.tgz", + "integrity": "sha512-6lLqMNX3TuycBPABycx7A9F1bHQR7kiQln6abjFbPrf5C/05qHM9M5E4PeTE59c7z8g6vHnx1Ioihb2AQl7BTA==", "dev": true, + "license": "MIT", + "dependencies": { + "@mapbox/node-pre-gyp": "^2.0.0", + "@rollup/pluginutils": "^5.1.3", + "acorn": "^8.6.0", + "acorn-import-attributes": "^1.9.5", + "async-sema": "^3.1.1", + "bindings": "^1.4.0", + "estree-walker": "2.0.2", + "glob": "^10.4.5", + "graceful-fs": "^4.2.9", + "node-gyp-build": "^4.2.2", + "picomatch": "^4.0.2", + "resolve-from": "^5.0.0" + }, + "bin": { + "nft": "out/cli.js" + }, "engines": { "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@sinonjs/commons": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", - "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", + "node_modules/@vercel/nft/node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true, - "dependencies": { - "type-detect": "4.0.8" - } + "license": "MIT" }, - "node_modules/@sinonjs/fake-timers": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", - "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", + "node_modules/@vercel/nft/node_modules/brace-expansion": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.8.tgz", + "integrity": "sha512-BnlDzDYQoplTsZSvPi86CNzmbcb07X8ufR8fk1zivaiEJlXJkiq1MQyDCVmlWcsWbj6aWXqHnrwwevbrm/Saig==", "dev": true, + "license": "MIT", "dependencies": { - "@sinonjs/commons": "^3.0.0" + "balanced-match": "^1.0.0" } }, - "node_modules/@types/babel__core": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", - "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", + "node_modules/@vercel/nft/node_modules/glob": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", + "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", "dev": true, + "license": "ISC", "dependencies": { - "@babel/parser": "^7.20.7", - "@babel/types": "^7.20.7", - "@types/babel__generator": "*", - "@types/babel__template": "*", - "@types/babel__traverse": "*" + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@types/babel__generator": { - "version": "7.6.8", - "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.8.tgz", - "integrity": "sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw==", + "node_modules/@vercel/nft/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", "dev": true, - "dependencies": { - "@babel/types": "^7.0.0" - } + "license": "ISC" }, - "node_modules/@types/babel__template": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", - "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", + "node_modules/@vercel/nft/node_modules/minimatch": { + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz", + "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==", "dev": true, + "license": "ISC", "dependencies": { - "@babel/parser": "^7.1.0", - "@babel/types": "^7.0.0" + "brace-expansion": "^2.0.2" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@types/babel__traverse": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.5.tgz", - "integrity": "sha512-WXCyOcRtH37HAUkpXhUduaxdm82b4GSlyTqajXviN4EfiuPgNYR109xMCKvpl6zPIpua0DGlMEDCq+g8EdoheQ==", + "node_modules/@vercel/nft/node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", "dev": true, + "license": "BlueOak-1.0.0", "dependencies": { - "@babel/types": "^7.20.7" + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@types/estree": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", - "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", - "dev": true - }, - "node_modules/@types/graceful-fs": { - "version": "4.1.9", - "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz", - "integrity": "sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==", + "node_modules/@vitest/mocker": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-5.1.0.tgz", + "integrity": "sha512-5umB9/jlWcqVS6fsrFmv5Gdnpu6wAUio/lEOwAmvB7v+lFo/IW2B9FhAD0p19GCULTgMzLCdUmuCDCnAzWgppQ==", "dev": true, + "license": "MIT", "dependencies": { - "@types/node": "*" + "@jridgewell/trace-mapping": "0.3.31", + "@vitest/spy": "5.1.0", + "estree-walker": "^3.0.3", + "magic-string": "^1.4.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9 || ^3.0.0", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } } }, - "node_modules/@types/istanbul-lib-coverage": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", - "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", - "dev": true - }, - "node_modules/@types/istanbul-lib-report": { + "node_modules/@vitest/mocker/node_modules/estree-walker": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz", - "integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", "dev": true, + "license": "MIT", "dependencies": { - "@types/istanbul-lib-coverage": "*" + "@types/estree": "^1.0.0" } }, - "node_modules/@types/istanbul-reports": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz", - "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==", + "node_modules/@vitest/spy": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-5.1.0.tgz", + "integrity": "sha512-2DPO5OMHWKrBngC+fCmTQqemNF0gidRhp3lxbBmRhW+M1XJrfgPpqNqWVevXtn2f2ufD5ZaR1B6B641aAlcX5A==", "dev": true, - "dependencies": { - "@types/istanbul-lib-report": "*" + "license": "MIT", + "funding": { + "url": "https://opencollective.com/vitest" } }, - "node_modules/@types/mocha": { - "version": "10.0.6", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.6.tgz", - "integrity": "sha512-dJvrYWxP/UcXm36Qn36fxhUKu8A/xMRXVT2cliFF1Z7UA9liG5Psj3ezNSZw+5puH2czDXRLcXQxf8JbJt0ejg==", - "dev": true - }, - "node_modules/@types/node": { - "version": "20.11.25", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.25.tgz", - "integrity": "sha512-TBHyJxk2b7HceLVGFcpAUjsa5zIdsPWlR6XHfyGzd0SFu+/NFgQgMAl96MSDZgQDvJAvV6BKsFOrt6zIL09JDw==", + "node_modules/@webassemblyjs/ast": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.14.1.tgz", + "integrity": "sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ==", "dev": true, + "license": "MIT", "dependencies": { - "undici-types": "~5.26.4" + "@webassemblyjs/helper-numbers": "1.13.2", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2" } }, - "node_modules/@types/stack-utils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", - "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==", - "dev": true + "node_modules/@webassemblyjs/floating-point-hex-parser": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.13.2.tgz", + "integrity": "sha512-6oXyTOzbKxGH4steLbLNOu71Oj+C8Lg34n6CqRvqfS2O71BxY6ByfMDRhBytzknj9yGUPVJ1qIKhRlAwO1AovA==", + "dev": true, + "license": "MIT" }, - "node_modules/@types/yargs": { - "version": "17.0.32", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.32.tgz", - "integrity": "sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog==", + "node_modules/@webassemblyjs/helper-api-error": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.13.2.tgz", + "integrity": "sha512-U56GMYxy4ZQCbDZd6JuvvNV/WFildOjsaWD3Tzzvmw/mas3cXzRJPMjP83JqEsgSbyrmaGjBfDtV7KDXV9UzFQ==", "dev": true, - "dependencies": { - "@types/yargs-parser": "*" - } + "license": "MIT" }, - "node_modules/@types/yargs-parser": { - "version": "21.0.3", - "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", - "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", - "dev": true + "node_modules/@webassemblyjs/helper-buffer": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.14.1.tgz", + "integrity": "sha512-jyH7wtcHiKssDtFPRB+iQdxlDf96m0E39yb0k5uJVhFGleZFoNw1c4aeIcVUPPbXUVJ94wwnMOAqUHyzoEPVMA==", + "dev": true, + "license": "MIT" }, - "node_modules/@vercel/nft": { - "version": "0.26.4", - "resolved": "https://registry.npmjs.org/@vercel/nft/-/nft-0.26.4.tgz", - "integrity": "sha512-j4jCOOXke2t8cHZCIxu1dzKLHLcFmYzC3yqAK6MfZznOL1QIJKd0xcFsXK3zcqzU7ScsE2zWkiMMNHGMHgp+FA==", + "node_modules/@webassemblyjs/helper-numbers": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.13.2.tgz", + "integrity": "sha512-FE8aCmS5Q6eQYcV3gI35O4J789wlQA+7JrqTTpJqn5emA4U2hvwJmvFRC0HODS+3Ye6WioDklgd6scJ3+PLnEA==", "dev": true, + "license": "MIT", "dependencies": { - "@mapbox/node-pre-gyp": "^1.0.5", - "@rollup/pluginutils": "^4.0.0", - "acorn": "^8.6.0", - "acorn-import-attributes": "^1.9.2", - "async-sema": "^3.1.1", - "bindings": "^1.4.0", - "estree-walker": "2.0.2", - "glob": "^7.1.3", - "graceful-fs": "^4.2.9", - "micromatch": "^4.0.2", - "node-gyp-build": "^4.2.2", - "resolve-from": "^5.0.0" - }, - "bin": { - "nft": "out/cli.js" - }, - "engines": { - "node": ">=16" + "@webassemblyjs/floating-point-hex-parser": "1.13.2", + "@webassemblyjs/helper-api-error": "1.13.2", + "@xtuc/long": "4.2.2" } }, - "node_modules/@vitest/expect": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.3.1.tgz", - "integrity": "sha512-xofQFwIzfdmLLlHa6ag0dPV8YsnKOCP1KdAeVVh34vSjN2dcUiXYCD9htu/9eM7t8Xln4v03U9HLxLpPlsXdZw==", + "node_modules/@webassemblyjs/helper-wasm-bytecode": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.13.2.tgz", + "integrity": "sha512-3QbLKy93F0EAIXLh0ogEVR6rOubA9AoZ+WRYhNbFyuB70j3dRdwH9g+qXhLAO0kiYGlg3TxDV+I4rQTr/YNXkA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@webassemblyjs/helper-wasm-section": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.14.1.tgz", + "integrity": "sha512-ds5mXEqTJ6oxRoqjhWDU83OgzAYjwsCV8Lo/N+oRsNDmx/ZDpqalmrtgOMkHwxsG0iI//3BwWAErYRHtgn0dZw==", "dev": true, + "license": "MIT", "dependencies": { - "@vitest/spy": "1.3.1", - "@vitest/utils": "1.3.1", - "chai": "^4.3.10" - }, - "funding": { - "url": "https://opencollective.com/vitest" + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-buffer": "1.14.1", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/wasm-gen": "1.14.1" } }, - "node_modules/@vitest/runner": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.3.1.tgz", - "integrity": "sha512-5FzF9c3jG/z5bgCnjr8j9LNq/9OxV2uEBAITOXfoe3rdZJTdO7jzThth7FXv/6b+kdY65tpRQB7WaKhNZwX+Kg==", + "node_modules/@webassemblyjs/ieee754": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.13.2.tgz", + "integrity": "sha512-4LtOzh58S/5lX4ITKxnAK2USuNEvpdVV9AlgGQb8rJDHaLeHciwG4zlGr0j/SNWlr7x3vO1lDEsuePvtcDNCkw==", "dev": true, + "license": "MIT", "dependencies": { - "@vitest/utils": "1.3.1", - "p-limit": "^5.0.0", - "pathe": "^1.1.1" - }, - "funding": { - "url": "https://opencollective.com/vitest" + "@xtuc/ieee754": "^1.2.0" } }, - "node_modules/@vitest/runner/node_modules/p-limit": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-5.0.0.tgz", - "integrity": "sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==", + "node_modules/@webassemblyjs/leb128": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.13.2.tgz", + "integrity": "sha512-Lde1oNoIdzVzdkNEAWZ1dZ5orIbff80YPdHx20mrHwHrVNNTjNr8E3xz9BdpcGqRQbAEa+fkrCb+fRFTl/6sQw==", "dev": true, + "license": "Apache-2.0", "dependencies": { - "yocto-queue": "^1.0.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "@xtuc/long": "4.2.2" } }, - "node_modules/@vitest/runner/node_modules/yocto-queue": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", - "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", + "node_modules/@webassemblyjs/utf8": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.13.2.tgz", + "integrity": "sha512-3NQWGjKTASY1xV5m7Hr0iPeXD9+RDobLll3T9d2AO+g3my8xy5peVyjSag4I50mR1bBSN/Ct12lo+R9tJk0NZQ==", "dev": true, - "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "license": "MIT" + }, + "node_modules/@webassemblyjs/wasm-edit": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.14.1.tgz", + "integrity": "sha512-RNJUIQH/J8iA/1NzlE4N7KtyZNHi3w7at7hDjvRNm5rcUXa00z1vRz3glZoULfJ5mpvYhLybmVcwcjGrC1pRrQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-buffer": "1.14.1", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/helper-wasm-section": "1.14.1", + "@webassemblyjs/wasm-gen": "1.14.1", + "@webassemblyjs/wasm-opt": "1.14.1", + "@webassemblyjs/wasm-parser": "1.14.1", + "@webassemblyjs/wast-printer": "1.14.1" } }, - "node_modules/@vitest/snapshot": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.3.1.tgz", - "integrity": "sha512-EF++BZbt6RZmOlE3SuTPu/NfwBF6q4ABS37HHXzs2LUVPBLx2QoY/K0fKpRChSo8eLiuxcbCVfqKgx/dplCDuQ==", + "node_modules/@webassemblyjs/wasm-gen": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.14.1.tgz", + "integrity": "sha512-AmomSIjP8ZbfGQhumkNvgC33AY7qtMCXnN6bL2u2Js4gVCg8fp735aEiMSBbDR7UQIj90n4wKAFUSEd0QN2Ukg==", "dev": true, + "license": "MIT", "dependencies": { - "magic-string": "^0.30.5", - "pathe": "^1.1.1", - "pretty-format": "^29.7.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/ieee754": "1.13.2", + "@webassemblyjs/leb128": "1.13.2", + "@webassemblyjs/utf8": "1.13.2" } }, - "node_modules/@vitest/spy": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.3.1.tgz", - "integrity": "sha512-xAcW+S099ylC9VLU7eZfdT9myV67Nor9w9zhf0mGCYJSO+zM2839tOeROTdikOi/8Qeusffvxb/MyBSOja1Uig==", + "node_modules/@webassemblyjs/wasm-opt": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.14.1.tgz", + "integrity": "sha512-PTcKLUNvBqnY2U6E5bdOQcSM+oVP/PmrDY9NzowJjislEjwP/C4an2303MCVS2Mg9d3AJpIGdUFIQQWbPds0Sw==", "dev": true, + "license": "MIT", "dependencies": { - "tinyspy": "^2.2.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-buffer": "1.14.1", + "@webassemblyjs/wasm-gen": "1.14.1", + "@webassemblyjs/wasm-parser": "1.14.1" } }, - "node_modules/@vitest/utils": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.3.1.tgz", - "integrity": "sha512-d3Waie/299qqRyHTm2DjADeTaNdNSVsnwHPWrs20JMpjh6eiVq7ggggweO8rc4arhf6rRkWuHKwvxGvejUXZZQ==", + "node_modules/@webassemblyjs/wasm-parser": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.14.1.tgz", + "integrity": "sha512-JLBl+KZ0R5qB7mCnud/yyX08jWFw5MsoalJ1pQ4EdFlgj9VdXKGuENGsiCIjegI1W7p91rUlcB/LB5yRJKNTcQ==", "dev": true, + "license": "MIT", "dependencies": { - "diff-sequences": "^29.6.3", - "estree-walker": "^3.0.3", - "loupe": "^2.3.7", - "pretty-format": "^29.7.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-api-error": "1.13.2", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/ieee754": "1.13.2", + "@webassemblyjs/leb128": "1.13.2", + "@webassemblyjs/utf8": "1.13.2" } }, - "node_modules/@vitest/utils/node_modules/estree-walker": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", - "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "node_modules/@webassemblyjs/wast-printer": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.14.1.tgz", + "integrity": "sha512-kPSSXE6De1XOR820C90RIo2ogvZG+c3KiHzqUoO/F34Y2shGzesfqv7o57xrxovZJH/MetF5UjroJ/R/3isoiw==", "dev": true, + "license": "MIT", "dependencies": { - "@types/estree": "^1.0.0" + "@webassemblyjs/ast": "1.14.1", + "@xtuc/long": "4.2.2" } }, + "node_modules/@xtuc/ieee754": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", + "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@xtuc/long": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", + "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", + "dev": true, + "license": "Apache-2.0" + }, "node_modules/abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", - "dev": true + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-3.0.1.tgz", + "integrity": "sha512-AO2ac6pjRB3SJmGJo+v5/aK6Omggp6fsLrs6wN9bd35ulu4cCwaAU9+7ZhXjeqHVkaHThLuzH0nZr0YpCDhygg==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^18.17.0 || >=20.5.0" + } }, "node_modules/acorn": { - "version": "8.11.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", - "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "version": "8.19.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.19.0.tgz", + "integrity": "sha512-oJlA3XiRm7Cyk6qFD2Jn8ak9B7jSy0qy00ADO3+8dpT0LSjFihQYv4C02LFCSYJV3Q37xYwwRy5m+IpIiUzqWw==", "dev": true, + "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -2381,42 +3912,84 @@ } }, "node_modules/acorn-import-attributes": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.2.tgz", - "integrity": "sha512-O+nfJwNolEA771IYJaiLWK1UAwjNsQmZbTRqqwBYxCgVQTmpFEMvBw6LOIQV0Me339L5UMVYFyRohGnGlQDdIQ==", + "version": "1.9.5", + "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", + "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", "dev": true, + "license": "MIT", "peerDependencies": { "acorn": "^8" } }, "node_modules/acorn-walk": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", - "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", + "version": "8.3.5", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.5.tgz", + "integrity": "sha512-HEHNfbars9v4pgpW6SO1KSPkfoS0xVOM/9UzkJltjlsHZmJasxg8aXkuZa7SMf8vKGIBhpUsPluQSqhJFCqebw==", "dev": true, + "license": "MIT", + "dependencies": { + "acorn": "^8.11.0" + }, "engines": { "node": ">=0.4.0" } }, "node_modules/agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/ajv": { + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz", + "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==", "dev": true, + "license": "MIT", "dependencies": { - "debug": "4" + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" }, - "engines": { - "node": ">= 6.0.0" + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "node_modules/ajv-formats": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz", + "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==", "dev": true, - "engines": { - "node": ">=6" + "license": "MIT", + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/ajv-keywords": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", + "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3" + }, + "peerDependencies": { + "ajv": "^8.8.2" } }, "node_modules/ansi-escapes": { @@ -2424,6 +3997,7 @@ "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", "dev": true, + "license": "MIT", "dependencies": { "type-fest": "^0.21.3" }, @@ -2439,6 +4013,7 @@ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", "dev": true, + "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=10" }, @@ -2459,10 +4034,11 @@ } }, "node_modules/ansi-styles": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", "dev": true, + "license": "MIT", "engines": { "node": ">=12" }, @@ -2484,10 +4060,11 @@ } }, "node_modules/anymatch/node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", "dev": true, + "license": "MIT", "engines": { "node": ">=8.6" }, @@ -2495,25 +4072,6 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/aproba": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", - "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", - "dev": true - }, - "node_modules/are-we-there-yet": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", - "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", - "dev": true, - "dependencies": { - "delegates": "^1.0.0", - "readable-stream": "^3.6.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -2554,72 +4112,75 @@ } }, "node_modules/assertion-error": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", "dev": true, + "license": "MIT", "engines": { - "node": "*" + "node": ">=12" } }, "node_modules/async-sema": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/async-sema/-/async-sema-3.1.1.tgz", "integrity": "sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/ava": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/ava/-/ava-6.1.2.tgz", - "integrity": "sha512-WcpxJ8yZ7mk9ABTinD0IAjcemovSeVGjuuwZx0JS9johREWFeLTl8UP6wd7l6nmnrWqkKZdwaD71a/ocH4qPKw==", + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/ava/-/ava-6.4.1.tgz", + "integrity": "sha512-vxmPbi1gZx9zhAjHBgw81w/iEDKcrokeRk/fqDTyA2DQygZ0o+dUGRHFOtX8RA5N0heGJTTsIk7+xYxitDb61Q==", "dev": true, + "license": "MIT", "dependencies": { - "@vercel/nft": "^0.26.2", - "acorn": "^8.11.3", - "acorn-walk": "^8.3.2", + "@vercel/nft": "^0.29.4", + "acorn": "^8.15.0", + "acorn-walk": "^8.3.4", "ansi-styles": "^6.2.1", "arrgv": "^1.0.2", "arrify": "^3.0.0", - "callsites": "^4.1.0", - "cbor": "^9.0.1", - "chalk": "^5.3.0", + "callsites": "^4.2.0", + "cbor": "^10.0.9", + "chalk": "^5.4.1", "chunkd": "^2.0.1", - "ci-info": "^4.0.0", + "ci-info": "^4.3.0", "ci-parallel-vars": "^1.0.1", "cli-truncate": "^4.0.0", "code-excerpt": "^4.0.0", "common-path-prefix": "^3.0.0", "concordance": "^5.0.4", "currently-unhandled": "^0.4.1", - "debug": "^4.3.4", - "emittery": "^1.0.1", - "figures": "^6.0.1", - "globby": "^14.0.0", + "debug": "^4.4.1", + "emittery": "^1.2.0", + "figures": "^6.1.0", + "globby": "^14.1.0", "ignore-by-default": "^2.1.0", "indent-string": "^5.0.0", "is-plain-object": "^5.0.0", "is-promise": "^4.0.0", "matcher": "^5.0.0", - "memoize": "^10.0.0", + "memoize": "^10.1.0", "ms": "^2.1.3", - "p-map": "^7.0.1", + "p-map": "^7.0.3", "package-config": "^5.0.0", - "picomatch": "^3.0.1", + "picomatch": "^4.0.2", "plur": "^5.1.0", - "pretty-ms": "^9.0.0", + "pretty-ms": "^9.2.0", "resolve-cwd": "^3.0.0", "stack-utils": "^2.0.6", "strip-ansi": "^7.1.0", "supertap": "^3.0.1", "temp-dir": "^3.0.0", - "write-file-atomic": "^5.0.1", + "write-file-atomic": "^6.0.0", "yargs": "^17.7.2" }, "bin": { "ava": "entrypoints/cli.mjs" }, "engines": { - "node": "^18.18 || ^20.8 || ^21" + "node": "^18.18 || ^20.8 || ^22 || ^23 || >=24" }, "peerDependencies": { "@ava/typescript": "*" @@ -2631,24 +4192,25 @@ } }, "node_modules/babel-jest": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", - "integrity": "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-30.5.2.tgz", + "integrity": "sha512-ES8WeJ2fNWPEDunyAtUfJ12nHyaWUloCHdkfK2oW5uSoQSUmjNKdWiGaXJITJwvFEWoD/evHEg/QoCXAvLaQqQ==", "dev": true, + "license": "MIT", "dependencies": { - "@jest/transform": "^29.7.0", - "@types/babel__core": "^7.1.14", - "babel-plugin-istanbul": "^6.1.1", - "babel-preset-jest": "^29.6.3", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.9", + "@jest/transform": "30.5.2", + "@types/babel__core": "^7.20.5", + "babel-plugin-istanbul": "^8.0.0", + "babel-preset-jest": "30.5.0", + "chalk": "^4.1.2", + "graceful-fs": "^4.2.11", "slash": "^3.0.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" }, "peerDependencies": { - "@babel/core": "^7.8.0" + "@babel/core": "^7.11.0 || ^8.0.0-0" } }, "node_modules/babel-jest/node_modules/ansi-styles": { @@ -2704,113 +4266,103 @@ } }, "node_modules/babel-plugin-istanbul": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", - "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-8.0.0.tgz", + "integrity": "sha512-18wCskrN3DgbuBmp1gr7LBGT8xdz5xhQQqFvFhVxbkl8VBCrMKQ2YtqBWtUal1Zrc1HTuX0011+Brjw78TCFkg==", "dev": true, + "license": "BSD-3-Clause", + "workspaces": [ + "test/babel-8" + ], "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", "@istanbuljs/load-nyc-config": "^1.0.0", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-instrument": "^5.0.4", - "test-exclude": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", - "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", - "dev": true, - "dependencies": { - "@babel/core": "^7.12.3", - "@babel/parser": "^7.14.7", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-coverage": "^3.2.0", - "semver": "^6.3.0" + "@istanbuljs/schema": "^0.1.3", + "istanbul-lib-instrument": "^6.0.2", + "test-exclude": "^7.0.1" }, "engines": { - "node": ">=8" - } - }, - "node_modules/babel-plugin-istanbul/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "bin": { - "semver": "bin/semver.js" + "node": ">=18" } }, "node_modules/babel-plugin-jest-hoist": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", - "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", + "version": "30.5.0", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-30.5.0.tgz", + "integrity": "sha512-gtGo1B+u14jrZQv6TdSWIWkTqclboo7Qn+dFAGUOIuXLFuJKAdg3U5MIWzZnW4vfUb4dX9skmAMiby86e/SF4A==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/template": "^7.3.3", - "@babel/types": "^7.3.3", - "@types/babel__core": "^7.1.14", - "@types/babel__traverse": "^7.0.6" + "@types/babel__core": "^7.20.5" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/babel-preset-current-node-syntax": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz", - "integrity": "sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.2.0.tgz", + "integrity": "sha512-E/VlAEzRrsLEb2+dv8yp3bo4scof3l9nR4lrld+Iy5NyVqgVYUJnDAmunkhPMisRI32Qc4iRiz425d8vM++2fg==", "dev": true, + "license": "MIT", "dependencies": { "@babel/plugin-syntax-async-generators": "^7.8.4", "@babel/plugin-syntax-bigint": "^7.8.3", - "@babel/plugin-syntax-class-properties": "^7.8.3", - "@babel/plugin-syntax-import-meta": "^7.8.3", + "@babel/plugin-syntax-class-properties": "^7.12.13", + "@babel/plugin-syntax-class-static-block": "^7.14.5", + "@babel/plugin-syntax-import-attributes": "^7.24.7", + "@babel/plugin-syntax-import-meta": "^7.10.4", "@babel/plugin-syntax-json-strings": "^7.8.3", - "@babel/plugin-syntax-logical-assignment-operators": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", - "@babel/plugin-syntax-numeric-separator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.10.4", "@babel/plugin-syntax-object-rest-spread": "^7.8.3", "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", "@babel/plugin-syntax-optional-chaining": "^7.8.3", - "@babel/plugin-syntax-top-level-await": "^7.8.3" + "@babel/plugin-syntax-private-property-in-object": "^7.14.5", + "@babel/plugin-syntax-top-level-await": "^7.14.5" }, "peerDependencies": { - "@babel/core": "^7.0.0" + "@babel/core": "^7.0.0 || ^8.0.0-0" } }, "node_modules/babel-preset-jest": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", - "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", + "version": "30.5.0", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-30.5.0.tgz", + "integrity": "sha512-ZGPn5ClP4lBDpuOK8W1yQIOy359HmbnZv3suucAlIe+SEE9yDsxV4S2PjSbH2Vc97U+WmzYD7vw3kr8NsQ/i6w==", "dev": true, + "license": "MIT", "dependencies": { - "babel-plugin-jest-hoist": "^29.6.3", - "babel-preset-current-node-syntax": "^1.0.0" + "babel-plugin-jest-hoist": "30.5.0", + "babel-preset-current-node-syntax": "^1.2.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" }, "peerDependencies": { - "@babel/core": "^7.0.0" + "@babel/core": "^7.11.0 || ^8.0.0-beta.1 || ^8.0.0" } }, "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } }, - "node_modules/binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "node_modules/baseline-browser-mapping": { + "version": "2.11.37", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.37.tgz", + "integrity": "sha512-QYph+vfurmaxhNwi9FprfmtkT5cx2Keg8FzZ0vnjO8ukscIybVyZGMFwdllKGlTI6qyU8ck43OM9UXh+IFJihQ==", "dev": true, + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.cjs" + }, "engines": { - "node": ">=8" + "node": ">=6.0.0" } }, "node_modules/bindings": { @@ -2818,6 +4370,7 @@ "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", "dev": true, + "license": "MIT", "dependencies": { "file-uri-to-path": "1.0.0" } @@ -2829,22 +4382,26 @@ "dev": true }, "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "5.0.13", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.13.tgz", + "integrity": "sha512-Vh3dmFbc4wZeox7M9I/0L9GfFd83Su4+yCck/OF9Gi/P/dAHn0RT7X4K9R7gMNMhDck3DvhR6QXsnQdjjgwNvQ==", "dev": true, + "license": "MIT", "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "20 || >=22" } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, + "license": "MIT", "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -2857,9 +4414,9 @@ "dev": true }, "node_modules/browserslist": { - "version": "4.23.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.0.tgz", - "integrity": "sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==", + "version": "4.29.5", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.5.tgz", + "integrity": "sha512-khTmKu5NGYTotqcYo8Bew2k4RAE9PuXRSFRXG2lQBrCEQHyeQ/vX6gKMxfokwywBsLiXZMnHsmWMG1pnO8J7uQ==", "dev": true, "funding": [ { @@ -2875,11 +4432,13 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "dependencies": { - "caniuse-lite": "^1.0.30001587", - "electron-to-chromium": "^1.4.668", - "node-releases": "^2.0.14", - "update-browserslist-db": "^1.0.13" + "baseline-browser-mapping": "^2.11.33", + "caniuse-lite": "^1.0.30001819", + "electron-to-chromium": "^1.5.464", + "node-releases": "^2.0.60", + "update-browserslist-db": "^1.3.4" }, "bin": { "browserslist": "cli.js" @@ -2913,22 +4472,15 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true - }, - "node_modules/cac": { - "version": "6.7.14", - "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", - "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", "dev": true, - "engines": { - "node": ">=8" - } + "license": "MIT" }, "node_modules/callsites": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-4.1.0.tgz", - "integrity": "sha512-aBMbD1Xxay75ViYezwT40aQONfr+pSXTHwNKvIXhXD6+LY3F1dLIcceoC5OZKBVHbXcysz1hL9D2w0JJIMXpUw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-4.2.0.tgz", + "integrity": "sha512-kfzR4zzQtAE9PC7CzZsjl3aBNbXWuXiSeOCdLcPpBfGW8YuCqQHcRPFDbr/BPVmd3EEPVpuFzLyuT/cUhPr4OQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=12.20" }, @@ -2937,21 +4489,19 @@ } }, "node_modules/camelcase": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", - "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true, + "license": "MIT", "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=6" } }, "node_modules/caniuse-lite": { - "version": "1.0.30001596", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001596.tgz", - "integrity": "sha512-zpkZ+kEr6We7w63ORkoJ2pOfBwBkY/bJrG/UZ90qNb45Isblu8wzDgevEOrRL1r9dWayHjYiiyCMEXPn4DweGQ==", + "version": "1.0.30001826", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001826.tgz", + "integrity": "sha512-wTB+9tIbLro/BCXwLuNV1meHE4L9dS6dArMDwgYfNBPMYScqClHyGunhkCSDtHhe/69Xl0sHlKgBVZ+fNsYtWA==", "dev": true, "funding": [ { @@ -2966,43 +4516,38 @@ "type": "github", "url": "https://github.com/sponsors/ai" } - ] + ], + "license": "CC-BY-4.0" }, "node_modules/cbor": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/cbor/-/cbor-9.0.2.tgz", - "integrity": "sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ==", + "version": "10.0.12", + "resolved": "https://registry.npmjs.org/cbor/-/cbor-10.0.12.tgz", + "integrity": "sha512-exQDevYd7ZQLP4moMQcZkKCVZsXLAtUSflObr3xTh4xzFIv/xBCdvCd6L259kQOUP2kcTC0jvC6PpZIf/WmRXA==", "dev": true, + "license": "MIT", "dependencies": { - "nofilter": "^3.1.0" + "nofilter": "^3.0.2" }, "engines": { - "node": ">=16" + "node": ">=20" } }, "node_modules/chai": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", - "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-6.3.0.tgz", + "integrity": "sha512-XWAtwJ6OHO+tj0EKCs0Y2UamnyOxseZWltU4x2U2wh8g4AigdjwvtUjvLP2tqkA/avxHEtzxNaqGq/YGNwckKg==", "dev": true, - "dependencies": { - "assertion-error": "^1.1.0", - "check-error": "^1.0.3", - "deep-eql": "^4.1.3", - "get-func-name": "^2.0.2", - "loupe": "^2.3.6", - "pathval": "^1.1.1", - "type-detect": "^4.0.8" - }, + "license": "MIT", "engines": { - "node": ">=4" + "node": ">=18" } }, "node_modules/chalk": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", - "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", + "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", "dev": true, + "license": "MIT", "engines": { "node": "^12.17.0 || ^14.13 || >=16.0.0" }, @@ -3015,56 +4560,45 @@ "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" } }, - "node_modules/check-error": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", - "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", + "node_modules/chokidar": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-5.0.0.tgz", + "integrity": "sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==", "dev": true, + "license": "MIT", "dependencies": { - "get-func-name": "^2.0.2" + "readdirp": "^5.0.0" }, "engines": { - "node": "*" + "node": ">= 20.19.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" } }, - "node_modules/chokidar": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", - "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "node_modules/chownr": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-3.0.0.tgz", + "integrity": "sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==", "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], - "dependencies": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" - }, + "license": "BlueOak-1.0.0", "engines": { - "node": ">= 8.10.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" + "node": ">=18" } }, - "node_modules/chownr": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", - "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "node_modules/chrome-trace-event": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.4.tgz", + "integrity": "sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ==", "dev": true, + "license": "MIT", "engines": { - "node": ">=10" + "node": ">=6.0" } }, "node_modules/chunkd": { @@ -3074,9 +4608,9 @@ "dev": true }, "node_modules/ci-info": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.0.0.tgz", - "integrity": "sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.5.0.tgz", + "integrity": "sha512-d1uM8k5UZEyPza1n/MG3ko8nKupKN0KJpFsipgPcgaCCvV+IqIfJ+NzTjetlLM+UcXZx3+cLrNr76+eAO7G1Mw==", "dev": true, "funding": [ { @@ -3084,6 +4618,7 @@ "url": "https://github.com/sponsors/sibiraj-s" } ], + "license": "MIT", "engines": { "node": ">=8" } @@ -3095,16 +4630,18 @@ "dev": true }, "node_modules/cjs-module-lexer": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz", - "integrity": "sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==", - "dev": true + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-2.3.0.tgz", + "integrity": "sha512-lmNyBzi6iYiqyrExTctfmjd8tInx+dHu9PBomTfH5RXS53c27JMFJgzNv5TyAnm3PgGf+MLy0+Ws41/HlVxdKQ==", + "dev": true, + "license": "MIT" }, "node_modules/cli-truncate": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-4.0.0.tgz", "integrity": "sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==", "dev": true, + "license": "MIT", "dependencies": { "slice-ansi": "^5.0.0", "string-width": "^7.0.0" @@ -3121,6 +4658,7 @@ "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "dev": true, + "license": "ISC", "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.1", @@ -3135,6 +4673,7 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -3143,22 +4682,15 @@ "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "node_modules/cliui/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, - "engines": { - "node": ">=8" - } + "license": "MIT" }, "node_modules/cliui/node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, + "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -3173,6 +4705,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, + "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -3185,6 +4718,7 @@ "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", "dev": true, + "license": "MIT", "engines": { "iojs": ">= 1.0.0", "node": ">= 0.12.0" @@ -3203,10 +4737,11 @@ } }, "node_modules/collect-v8-coverage": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", - "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==", - "dev": true + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.3.tgz", + "integrity": "sha512-1L5aqIkwPfiodaMgQunkF1zRhNqifHBmtbbbxcr6yVxxBnliw4TDOW6NxpO8DJLgJ16OT+Y4ztZqP6p/FtXnAw==", + "dev": true, + "license": "MIT" }, "node_modules/color-convert": { "version": "2.0.1", @@ -3226,14 +4761,12 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/color-support": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", - "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true, - "bin": { - "color-support": "bin.js" - } + "license": "MIT" }, "node_modules/common-path-prefix": { "version": "3.0.0", @@ -3241,11 +4774,12 @@ "integrity": "sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==", "dev": true }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true + "node_modules/commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", + "dev": true, + "license": "MIT" }, "node_modules/concordance": { "version": "5.0.4", @@ -3260,102 +4794,43 @@ "lodash": "^4.17.15", "md5-hex": "^3.0.1", "semver": "^7.3.2", - "well-known-symbols": "^2.0.0" - }, - "engines": { - "node": ">=10.18.0 <11 || >=12.14.0 <13 || >=14" - } - }, - "node_modules/console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", - "dev": true - }, - "node_modules/convert-source-map": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", - "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", - "dev": true - }, - "node_modules/convert-to-spaces": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/convert-to-spaces/-/convert-to-spaces-2.0.1.tgz", - "integrity": "sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - }, - "node_modules/create-jest": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", - "integrity": "sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==", - "dev": true, - "dependencies": { - "@jest/types": "^29.6.3", - "chalk": "^4.0.0", - "exit": "^0.1.2", - "graceful-fs": "^4.2.9", - "jest-config": "^29.7.0", - "jest-util": "^29.7.0", - "prompts": "^2.0.1" - }, - "bin": { - "create-jest": "bin/create-jest.js" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/create-jest/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/create-jest/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "well-known-symbols": "^2.0.0" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "node": ">=10.18.0 <11 || >=12.14.0 <13 || >=14" } }, - "node_modules/create-jest/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "node_modules/consola": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz", + "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==", "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, + "license": "MIT", "engines": { - "node": ">=8" + "node": "^14.18.0 || >=16.10.0" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true + }, + "node_modules/convert-to-spaces": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/convert-to-spaces/-/convert-to-spaces-2.0.1.tgz", + "integrity": "sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, + "license": "MIT", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -3390,12 +4865,13 @@ } }, "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", "dev": true, + "license": "MIT", "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -3406,29 +4882,12 @@ } } }, - "node_modules/debug/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/decamelize": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", - "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/dedent": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.1.tgz", - "integrity": "sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg==", + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.7.2.tgz", + "integrity": "sha512-WzMx3mW98SN+zn3hgemf4OzdmyNhhhKz5Ay0pUfQiMQ3e1g+xmTJWp/pKdwKVXhdSkAEGIIzqeuWrL3mV/AXbA==", "dev": true, + "license": "MIT", "peerDependencies": { "babel-plugin-macros": "^3.1.0" }, @@ -3438,38 +4897,22 @@ } } }, - "node_modules/deep-eql": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", - "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", - "dev": true, - "dependencies": { - "type-detect": "^4.0.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/deepmerge": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, - "node_modules/delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", - "dev": true - }, "node_modules/detect-libc": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.2.tgz", - "integrity": "sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", "dev": true, + "license": "Apache-2.0", "engines": { "node": ">=8" } @@ -3479,39 +4922,41 @@ "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/diff": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", - "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-9.0.0.tgz", + "integrity": "sha512-svtcdpS8CgJyqAjEQIXdb3OjhFVVYjzGAPO8WGCmRbrml64SPw/jJD4GoE98aR7r25A0XcgrK3F02yw9R/vhQw==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.3.1" } }, - "node_modules/diff-sequences": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", - "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", "dev": true, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } + "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.4.696", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.696.tgz", - "integrity": "sha512-SOr0bHP52OvYg2chCsz/0+FUSMGFm8L8HKwPpx3cbwRY24EOemVJtbgTm+IFO8LzhcnPy+hXmTq7ZcZ8uUuaYg==", - "dev": true + "version": "1.5.486", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.486.tgz", + "integrity": "sha512-rpybw4Ac4ak/An6G1Me2+61xzwobowDGyuJe71QHHOVpkZv4fPVobsLl7WH6zHSKusAMpaHxGKTpOvpy7+r3dQ==", + "dev": true, + "license": "ISC" }, "node_modules/emittery": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/emittery/-/emittery-1.0.3.tgz", - "integrity": "sha512-tJdCJitoy2lrC2ldJcqN4vkqJ00lT+tOWNT1hBJjO/3FDMJa5TTIiYGCKGkn/WfCyOzUMObeohbVTj00fhiLiA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-1.2.1.tgz", + "integrity": "sha512-sFz64DCRjirhwHLxofFqxYQm6DCp6o0Ix7jwKQvuCHPn4GMRZNuBZyLPu9Ccmk/QSCAMZt6FOUqA8JZCQvA9fw==", "dev": true, + "license": "MIT", "engines": { "node": ">=14.16" }, @@ -3520,63 +4965,101 @@ } }, "node_modules/emoji-regex": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.3.0.tgz", - "integrity": "sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==", - "dev": true + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz", + "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==", + "dev": true, + "license": "MIT" + }, + "node_modules/enhanced-resolve": { + "version": "5.27.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.27.0.tgz", + "integrity": "sha512-Do6BB2xzlcc/odFg+XEYyneAx4T/WfywO71yw9ePS2tVfRsf7JVR4mUeELadIeHzixkzbG5DpluiEFPi2WGfYQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.3.3" + }, + "engines": { + "node": ">=10.13.0" + } }, "node_modules/error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.4.tgz", + "integrity": "sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ==", "dev": true, + "license": "MIT", "dependencies": { "is-arrayish": "^0.2.1" } }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-module-lexer": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.3.2.tgz", + "integrity": "sha512-poHGpORABojJJucnV9KbOavETW8lBVnphkW77ER5/BQ5Fz7oXSoCNek7IH3vR5nRjdsEz926ibFYX8KtLQmdyw==", + "dev": true, + "license": "MIT" + }, "node_modules/esbuild": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz", - "integrity": "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==", + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.2.tgz", + "integrity": "sha512-HKVLS8dvII+xoKW9kmqxbRKrnWEXfJJr/FZhhJmiqIB0e053QNYFqOBouTMO/k5sID4MvCiUCvv8b9M4h32wIA==", "dev": true, "hasInstallScript": true, + "license": "MIT", "bin": { "esbuild": "bin/esbuild" }, "engines": { - "node": ">=12" + "node": ">=18" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.19.12", - "@esbuild/android-arm": "0.19.12", - "@esbuild/android-arm64": "0.19.12", - "@esbuild/android-x64": "0.19.12", - "@esbuild/darwin-arm64": "0.19.12", - "@esbuild/darwin-x64": "0.19.12", - "@esbuild/freebsd-arm64": "0.19.12", - "@esbuild/freebsd-x64": "0.19.12", - "@esbuild/linux-arm": "0.19.12", - "@esbuild/linux-arm64": "0.19.12", - "@esbuild/linux-ia32": "0.19.12", - "@esbuild/linux-loong64": "0.19.12", - "@esbuild/linux-mips64el": "0.19.12", - "@esbuild/linux-ppc64": "0.19.12", - "@esbuild/linux-riscv64": "0.19.12", - "@esbuild/linux-s390x": "0.19.12", - "@esbuild/linux-x64": "0.19.12", - "@esbuild/netbsd-x64": "0.19.12", - "@esbuild/openbsd-x64": "0.19.12", - "@esbuild/sunos-x64": "0.19.12", - "@esbuild/win32-arm64": "0.19.12", - "@esbuild/win32-ia32": "0.19.12", - "@esbuild/win32-x64": "0.19.12" + "@esbuild/aix-ppc64": "0.28.2", + "@esbuild/android-arm": "0.28.2", + "@esbuild/android-arm64": "0.28.2", + "@esbuild/android-x64": "0.28.2", + "@esbuild/darwin-arm64": "0.28.2", + "@esbuild/darwin-x64": "0.28.2", + "@esbuild/freebsd-arm64": "0.28.2", + "@esbuild/freebsd-x64": "0.28.2", + "@esbuild/linux-arm": "0.28.2", + "@esbuild/linux-arm64": "0.28.2", + "@esbuild/linux-ia32": "0.28.2", + "@esbuild/linux-loong64": "0.28.2", + "@esbuild/linux-mips64el": "0.28.2", + "@esbuild/linux-ppc64": "0.28.2", + "@esbuild/linux-riscv64": "0.28.2", + "@esbuild/linux-s390x": "0.28.2", + "@esbuild/linux-x64": "0.28.2", + "@esbuild/netbsd-arm64": "0.28.2", + "@esbuild/netbsd-x64": "0.28.2", + "@esbuild/openbsd-arm64": "0.28.2", + "@esbuild/openbsd-x64": "0.28.2", + "@esbuild/openharmony-arm64": "0.28.2", + "@esbuild/sunos-x64": "0.28.2", + "@esbuild/win32-arm64": "0.28.2", + "@esbuild/win32-ia32": "0.28.2", + "@esbuild/win32-x64": "0.28.2" } }, "node_modules/escalade": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", - "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -3610,7 +5093,8 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/esutils": { "version": "2.0.3", @@ -3621,6 +5105,16 @@ "node": ">=0.10.0" } }, + "node_modules/events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.x" + } + }, "node_modules/execa": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", @@ -3644,31 +5138,51 @@ "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, - "node_modules/exit": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", - "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", + "node_modules/exit-x": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/exit-x/-/exit-x-0.2.2.tgz", + "integrity": "sha512-+I6B/IkJc1o/2tiURyz/ivu/O0nKNEArIUB5O7zBrlDVJr22SCLH3xTeEry428LvFhRzIA1g8izguxJ/gbNcVQ==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8.0" } }, "node_modules/expect": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", - "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/expect/-/expect-30.5.2.tgz", + "integrity": "sha512-0LNuMvs8/5mRYhnCR4k+lGV7fqPMs6Bnksda4S3zsCUmdxBpAn4zU4NNzXdq1pMKe/H4W5t/zVIDSJ/H3e0vDA==", "dev": true, + "license": "MIT", "dependencies": { - "@jest/expect-utils": "^29.7.0", - "jest-get-type": "^29.6.3", - "jest-matcher-utils": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-util": "^29.7.0" + "@jest/expect-utils": "30.5.2", + "@jest/get-type": "30.5.0", + "jest-matcher-utils": "30.5.2", + "jest-message-util": "30.5.1", + "jest-mock": "30.5.2", + "jest-util": "30.5.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" + } + }, + "node_modules/expect-type": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.4.0.tgz", + "integrity": "sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" } }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" + }, "node_modules/fast-diff": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", @@ -3676,16 +5190,17 @@ "dev": true }, "node_modules/fast-glob": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", - "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", "glob-parent": "^5.1.2", "merge2": "^1.3.0", - "micromatch": "^4.0.4" + "micromatch": "^4.0.8" }, "engines": { "node": ">=8.6.0" @@ -3697,11 +5212,29 @@ "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true }, + "node_modules/fast-uri": { + "version": "3.1.9", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.9.tgz", + "integrity": "sha512-hS/0Wt3Ya043oKXs0sIxrMpKQITXhMLIrVAKKXi4gozGC9v7YRWVnXIZzjNPTO02M9BdxLCWqK1yRXgNziVyJQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "BSD-3-Clause" + }, "node_modules/fastq": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", - "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.20.3.tgz", + "integrity": "sha512-XKv5nnLs6nLF71NgiKJLIZFLkPyIEuOselLG7ujZnGrRfQK8HpvY+WqKhAJUAdLomwVHErVS4LfxFlPq0/FTAw==", "dev": true, + "license": "ISC", "dependencies": { "reusify": "^1.0.4" } @@ -3715,6 +5248,24 @@ "bser": "2.1.1" } }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, "node_modules/figures": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/figures/-/figures-6.1.0.tgz", @@ -3734,13 +5285,15 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, + "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -3749,26 +5302,25 @@ } }, "node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, + "license": "MIT", "dependencies": { - "locate-path": "^6.0.0", + "locate-path": "^5.0.0", "path-exists": "^4.0.0" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, "node_modules/find-up-simple": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/find-up-simple/-/find-up-simple-1.0.0.tgz", - "integrity": "sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/find-up-simple/-/find-up-simple-1.0.1.tgz", + "integrity": "sha512-afd4O7zpqHeRyg4PfDQsXmlDe2PfdHtJt6Akt8jOWaApLOZk5JXs6VMR29lz03pRe9mpykrRCYIYxaJYcfpncQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=18" }, @@ -3776,45 +5328,36 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/flat": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", - "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", - "dev": true, - "bin": { - "flat": "cli.js" - } - }, - "node_modules/fs-minipass": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", - "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "node_modules/foreground-child": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", + "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", "dev": true, + "license": "ISC", "dependencies": { - "minipass": "^3.0.0" + "cross-spawn": "^7.0.6", + "signal-exit": "^4.0.1" }, "engines": { - "node": ">= 8" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/fs-minipass/node_modules/minipass": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "node_modules/foreground-child/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, + "license": "ISC", "engines": { - "node": ">=8" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true - }, "node_modules/fsevents": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", @@ -3834,80 +5377,11 @@ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", "dev": true, + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/gauge": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", - "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", - "dev": true, - "dependencies": { - "aproba": "^1.0.3 || ^2.0.0", - "color-support": "^1.1.2", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.1", - "object-assign": "^4.1.1", - "signal-exit": "^3.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1", - "wide-align": "^1.1.2" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/gauge/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/gauge/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "node_modules/gauge/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/gauge/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/gauge/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -3922,15 +5396,17 @@ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true, + "license": "ISC", "engines": { "node": "6.* || 8.* || >= 10.*" } }, "node_modules/get-east-asian-width": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.2.0.tgz", - "integrity": "sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.7.0.tgz", + "integrity": "sha512-XjH1AECxf0giL2V1aU8vKyRR2ppRUb5c0EvT7zuJTokQ74bNo52zOtghqdWIqrhUD79fo3x0WfKZdOqxF6LG1Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=18" }, @@ -3938,20 +5414,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/get-func-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", - "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", - "dev": true, - "engines": { - "node": "*" - } - }, "node_modules/get-package-type": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=8.0.0" } @@ -3968,33 +5436,19 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/get-tsconfig": { - "version": "4.7.3", - "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.3.tgz", - "integrity": "sha512-ZvkrzoUA0PQZM6fy6+/Hce561s+faD1rsNwhnO5FelNjyy7EMGJ3Rz1AQ8GYDWjhRs/7dBLOEJvhK8MiEJOAFg==", - "dev": true, - "dependencies": { - "resolve-pkg-maps": "^1.0.0" - }, - "funding": { - "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" - } - }, "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "version": "13.0.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.7.tgz", + "integrity": "sha512-wfsFgXQ8A3SEI9XGf7Nl3Y9l7ffSrGh7SUCT7vU/2CzYPep9kjxAn1S40F9OPKxAMGCVl7HtNlJhrCJUeUq83g==", "dev": true, + "license": "BlueOak-1.0.0", "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "minimatch": "^10.2.2", + "minipass": "^7.1.3", + "path-scurry": "^2.0.2" }, "engines": { - "node": "*" + "node": "18 || 20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -4005,6 +5459,7 @@ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, + "license": "ISC", "dependencies": { "is-glob": "^4.0.1" }, @@ -4012,27 +5467,19 @@ "node": ">= 6" } }, - "node_modules/globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/globby": { - "version": "14.0.1", - "resolved": "https://registry.npmjs.org/globby/-/globby-14.0.1.tgz", - "integrity": "sha512-jOMLD2Z7MAhyG8aJpNOpmziMOP4rPLcc95oQPKXBazW82z+CEgPFBQvEpRUa1KeIMUJo4Wsm+q6uzO/Q/4BksQ==", + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-14.1.0.tgz", + "integrity": "sha512-0Ia46fDOaT7k4og1PDW4YbodWWr3scS2vAr2lTbsplOt2WkKp0vQbkI9wKis/T5LV/dqPjO3bpS/z6GTJB82LA==", "dev": true, + "license": "MIT", "dependencies": { "@sindresorhus/merge-streams": "^2.1.0", - "fast-glob": "^3.3.2", - "ignore": "^5.2.4", - "path-type": "^5.0.0", + "fast-glob": "^3.3.3", + "ignore": "^7.0.3", + "path-type": "^6.0.0", "slash": "^5.1.0", - "unicorn-magic": "^0.1.0" + "unicorn-magic": "^0.3.0" }, "engines": { "node": ">=18" @@ -4047,6 +5494,28 @@ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true }, + "node_modules/handlebars": { + "version": "4.7.10", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.10.tgz", + "integrity": "sha512-P5VJMVM7qgBn6vjXMw8WG9uVI+ncf2pi72j4de4yz5ZULLj2RGqLYaKOYGsgyrViQ0tePOVlN1tDCCXXtFqXKg==", + "dev": true, + "license": "MIT", + "dependencies": { + "minimist": "^1.2.8", + "neo-async": "^2.6.2", + "source-map": "^0.6.1", + "wordwrap": "^1.0.0" + }, + "bin": { + "handlebars": "bin/handlebars" + }, + "engines": { + "node": ">=0.4.7" + }, + "optionalDependencies": { + "uglify-js": "^3.1.4" + } + }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -4056,17 +5525,12 @@ "node": ">=8" } }, - "node_modules/has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", - "dev": true - }, "node_modules/hasown": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.1.tgz", - "integrity": "sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", + "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", "dev": true, + "license": "MIT", "dependencies": { "function-bind": "^1.1.2" }, @@ -4074,32 +5538,25 @@ "node": ">= 0.4" } }, - "node_modules/he": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", - "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", - "dev": true, - "bin": { - "he": "bin/he" - } - }, "node_modules/html-escaper": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", "dev": true, + "license": "MIT", "dependencies": { - "agent-base": "6", + "agent-base": "^7.1.2", "debug": "4" }, "engines": { - "node": ">= 6" + "node": ">= 14" } }, "node_modules/human-signals": { @@ -4112,10 +5569,11 @@ } }, "node_modules/ignore": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", - "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", + "version": "7.0.14", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.14.tgz", + "integrity": "sha512-wCBiZ77u1tuWde6G/nfOtLaCTYcFDU5yCzARzK10y+rLhzYoL7a7yEemcopcc2Mzow7gZOIjnV2ym1NYmdiJOQ==", "dev": true, + "license": "MIT", "engines": { "node": ">= 4" } @@ -4130,10 +5588,11 @@ } }, "node_modules/import-local": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", - "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz", + "integrity": "sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA==", "dev": true, + "license": "MIT", "dependencies": { "pkg-dir": "^4.2.0", "resolve-cwd": "^3.0.0" @@ -4153,6 +5612,7 @@ "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.8.19" } @@ -4169,27 +5629,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, "node_modules/irregular-plurals": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/irregular-plurals/-/irregular-plurals-3.5.0.tgz", "integrity": "sha512-1ANGLZ+Nkv1ptFb2pa8oG8Lem4krflKuX/gINiHJHjJUKaJHk/SXk5x6K3J+39/p0h1RQ2saROclJJ+QLvETCQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -4198,27 +5643,20 @@ "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", - "dev": true - }, - "node_modules/is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", "dev": true, - "dependencies": { - "binary-extensions": "^2.0.0" - }, - "engines": { - "node": ">=8" - } + "license": "MIT" }, "node_modules/is-core-module": { - "version": "2.13.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", - "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "version": "2.18.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.18.0.tgz", + "integrity": "sha512-qyax9fgaKOEC4qK8WZn7Q4IcoZC9RC1O1fFxRcRTq/oMMkWT/uXpqpXa12kzWR409zAt1drYN9N9BO26UmBCmw==", "dev": true, + "license": "MIT", "dependencies": { - "hasown": "^2.0.0" + "hasown": "^2.0.4" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -4229,20 +5667,19 @@ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/is-fullwidth-code-point": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz", - "integrity": "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, + "license": "MIT", "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, "node_modules/is-generator-fn": { @@ -4250,6 +5687,7 @@ "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -4259,6 +5697,7 @@ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, + "license": "MIT", "dependencies": { "is-extglob": "^2.1.1" }, @@ -4266,29 +5705,42 @@ "node": ">=0.10.0" } }, + "node_modules/is-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", + "integrity": "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==", + "dev": true, + "license": "MIT" + }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.12.0" } }, - "node_modules/is-plain-obj": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", - "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "node_modules/is-path-inside": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-4.0.0.tgz", + "integrity": "sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==", "dev": true, + "license": "MIT", "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/is-plain-object": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", - "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.1.0.tgz", + "integrity": "sha512-bUi/yjmtKYcRVUtWRGr0UA6xEFh2I6zWUwMrUXB3s7bmYCaZ8a+0ZsTRkrawh/mzlSD1Y0Ph8bp/U+TvBpWDNw==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -4299,6 +5751,16 @@ "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", "dev": true }, + "node_modules/is-reference": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", + "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "*" + } + }, "node_modules/is-stream": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", @@ -4339,10 +5801,11 @@ } }, "node_modules/istanbul-lib-instrument": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.2.tgz", - "integrity": "sha512-1WUsZ9R1lA0HtBSohTkm39WTPlNKSJ5iFk7UwqXkBLoHQT+hfqPsfsTDVuZdKGaBwn7din9bS7SsnoAr943hvw==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz", + "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "@babel/core": "^7.23.9", "@babel/parser": "^7.23.9", @@ -4359,6 +5822,7 @@ "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "istanbul-lib-coverage": "^3.0.0", "make-dir": "^4.0.0", @@ -4368,26 +5832,12 @@ "node": ">=10" } }, - "node_modules/istanbul-lib-report/node_modules/make-dir": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", - "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", - "dev": true, - "dependencies": { - "semver": "^7.5.3" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/istanbul-lib-report/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -4396,24 +5846,26 @@ } }, "node_modules/istanbul-lib-source-maps": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", - "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-5.0.6.tgz", + "integrity": "sha512-yg2d+Em4KizZC5niWhQaIomgf5WlL4vOOjZ5xGCmF8SnPE/mDWWXgvRExdcpCgh9lLRRa1/fSYp2ymmbJ1pI+A==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { + "@jridgewell/trace-mapping": "^0.3.23", "debug": "^4.1.1", - "istanbul-lib-coverage": "^3.0.0", - "source-map": "^0.6.1" + "istanbul-lib-coverage": "^3.0.0" }, "engines": { "node": ">=10" } }, "node_modules/istanbul-reports": { - "version": "3.1.7", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", - "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.2.0.tgz", + "integrity": "sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "html-escaper": "^2.0.0", "istanbul-lib-report": "^3.0.0" @@ -4422,22 +5874,39 @@ "node": ">=8" } }, + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, "node_modules/jest": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", - "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest/-/jest-30.5.2.tgz", + "integrity": "sha512-3gnpdBIza8ijCl3iMV9ChE3hSt1+46865qqod863gQtJr1DixOkAU5DoGbi3u+XlRcw++BhZQMu/y4xBdHBvSQ==", "dev": true, + "license": "MIT", "dependencies": { - "@jest/core": "^29.7.0", - "@jest/types": "^29.6.3", - "import-local": "^3.0.2", - "jest-cli": "^29.7.0" + "@jest/core": "30.5.2", + "@jest/types": "30.5.1", + "import-local": "^3.2.0", + "jest-cli": "30.5.2" }, "bin": { "jest": "bin/jest.js" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" }, "peerDependencies": { "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" @@ -4449,48 +5918,50 @@ } }, "node_modules/jest-changed-files": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz", - "integrity": "sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-30.5.1.tgz", + "integrity": "sha512-0+bvMM/ENhDI29Z8q1r4HxiDIi4G5tnBmSw4esfPQoj9q8Nik7KIyuxHkTVnnniJQf05SxpGaKDQ+4h28ynGPg==", "dev": true, + "license": "MIT", "dependencies": { - "execa": "^5.0.0", - "jest-util": "^29.7.0", + "execa": "^5.1.1", + "jest-util": "30.5.1", "p-limit": "^3.1.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-circus": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz", - "integrity": "sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-30.5.2.tgz", + "integrity": "sha512-vffFgjs5JSJ9q4ds1vNW3klKYPJfYfIY61LT/zaZgvTeASJOWZUt8LBfHgIcV4rwxlPBLl/ePBGccHEclS4PlQ==", "dev": true, + "license": "MIT", "dependencies": { - "@jest/environment": "^29.7.0", - "@jest/expect": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/types": "^29.6.3", + "@jest/environment": "30.5.2", + "@jest/expect": "30.5.2", + "@jest/test-result": "30.5.2", + "@jest/types": "30.5.1", "@types/node": "*", - "chalk": "^4.0.0", + "chalk": "^4.1.2", "co": "^4.6.0", - "dedent": "^1.0.0", - "is-generator-fn": "^2.0.0", - "jest-each": "^29.7.0", - "jest-matcher-utils": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-runtime": "^29.7.0", - "jest-snapshot": "^29.7.0", - "jest-util": "^29.7.0", + "dedent": "^1.6.0", + "is-generator-fn": "^2.1.0", + "jest-each": "30.5.2", + "jest-matcher-utils": "30.5.2", + "jest-message-util": "30.5.1", + "jest-runtime": "30.5.2", + "jest-snapshot": "30.5.2", + "jest-util": "30.5.1", "p-limit": "^3.1.0", - "pretty-format": "^29.7.0", - "pure-rand": "^6.0.0", + "pretty-format": "30.5.1", + "pure-rand": "^7.0.0", "slash": "^3.0.0", - "stack-utils": "^2.0.3" + "stack-utils": "^2.0.6" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-circus/node_modules/ansi-styles": { @@ -4498,6 +5969,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -4513,6 +5985,7 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -4529,6 +6002,7 @@ "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -4538,6 +6012,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -4546,28 +6021,28 @@ } }, "node_modules/jest-cli": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz", - "integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==", - "dev": true, - "dependencies": { - "@jest/core": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/types": "^29.6.3", - "chalk": "^4.0.0", - "create-jest": "^29.7.0", - "exit": "^0.1.2", - "import-local": "^3.0.2", - "jest-config": "^29.7.0", - "jest-util": "^29.7.0", - "jest-validate": "^29.7.0", - "yargs": "^17.3.1" + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-30.5.2.tgz", + "integrity": "sha512-YYYxUUVjFgPvgEleKNKMaYGIFgR3l3832Cl0kRL/oCiDZ03v7wImUtquHl2OOBCCNgprjZgBN5bczS/JklPBDg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/core": "30.5.2", + "@jest/test-result": "30.5.2", + "@jest/types": "30.5.1", + "chalk": "^4.1.2", + "exit-x": "^0.2.2", + "import-local": "^3.2.0", + "jest-config": "30.5.2", + "jest-util": "30.5.1", + "jest-validate": "30.5.1", + "yargs": "^17.7.2" }, "bin": { "jest": "bin/jest.js" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" }, "peerDependencies": { "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" @@ -4583,6 +6058,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -4598,6 +6074,7 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -4614,6 +6091,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -4622,45 +6100,51 @@ } }, "node_modules/jest-config": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz", - "integrity": "sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-30.5.2.tgz", + "integrity": "sha512-U6221OZekabePvGcGPf4raIBKMvYQWFHvhobDJRojOYaFMj2HaGytAdknjDhYc6JTz2fdHW9+6k0wWUDaNeOFQ==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/core": "^7.11.6", - "@jest/test-sequencer": "^29.7.0", - "@jest/types": "^29.6.3", - "babel-jest": "^29.7.0", - "chalk": "^4.0.0", - "ci-info": "^3.2.0", - "deepmerge": "^4.2.2", - "glob": "^7.1.3", - "graceful-fs": "^4.2.9", - "jest-circus": "^29.7.0", - "jest-environment-node": "^29.7.0", - "jest-get-type": "^29.6.3", - "jest-regex-util": "^29.6.3", - "jest-resolve": "^29.7.0", - "jest-runner": "^29.7.0", - "jest-util": "^29.7.0", - "jest-validate": "^29.7.0", - "micromatch": "^4.0.4", + "@babel/core": "^7.27.4", + "@jest/get-type": "30.5.0", + "@jest/pattern": "30.5.0", + "@jest/test-sequencer": "30.5.2", + "@jest/types": "30.5.1", + "babel-jest": "30.5.2", + "chalk": "^4.1.2", + "ci-info": "^4.2.0", + "deepmerge": "^4.3.1", + "glob": "^13.0.6", + "graceful-fs": "^4.2.11", + "jest-circus": "30.5.2", + "jest-docblock": "30.5.0", + "jest-environment-node": "30.5.2", + "jest-regex-util": "30.5.0", + "jest-resolve": "30.5.1", + "jest-runner": "30.5.2", + "jest-util": "30.5.1", + "jest-validate": "30.5.1", "parse-json": "^5.2.0", - "pretty-format": "^29.7.0", + "pretty-format": "30.5.1", "slash": "^3.0.0", "strip-json-comments": "^3.1.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" }, "peerDependencies": { "@types/node": "*", + "esbuild-register": ">=3.4.0", "ts-node": ">=9.0.0" }, "peerDependenciesMeta": { "@types/node": { "optional": true }, + "esbuild-register": { + "optional": true + }, "ts-node": { "optional": true } @@ -4671,6 +6155,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -4686,6 +6171,7 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -4697,26 +6183,12 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/jest-config/node_modules/ci-info": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", - "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/sibiraj-s" - } - ], - "engines": { - "node": ">=8" - } - }, "node_modules/jest-config/node_modules/slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -4726,6 +6198,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -4734,18 +6207,19 @@ } }, "node_modules/jest-diff": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", - "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-30.5.2.tgz", + "integrity": "sha512-rBtHnI6BWTiWj3lM7fOLVfChx7R9B0u9VV3PRHawKs79x6ZjW1QoSrKenaigNGWlvhtoi2BqvDbABDie+Os3xQ==", "dev": true, + "license": "MIT", "dependencies": { - "chalk": "^4.0.0", - "diff-sequences": "^29.6.3", - "jest-get-type": "^29.6.3", - "pretty-format": "^29.7.0" + "@jest/diff-sequences": "30.5.0", + "@jest/get-type": "30.5.0", + "chalk": "^4.1.2", + "pretty-format": "30.5.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-diff/node_modules/ansi-styles": { @@ -4753,6 +6227,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -4768,6 +6243,7 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -4784,6 +6260,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -4792,31 +6269,34 @@ } }, "node_modules/jest-docblock": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz", - "integrity": "sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==", + "version": "30.5.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-30.5.0.tgz", + "integrity": "sha512-NwDqcxtoZi33RhuW+zJS/RVA3rmheQ8BnwpYZuc/Eruaz6seQb7+aoCeDZu/3X7W2XmD8DbSo9Pn72DbKsBFYw==", "dev": true, + "license": "MIT", "dependencies": { - "detect-newline": "^3.0.0" + "detect-newline": "^3.1.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-each": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz", - "integrity": "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-30.5.2.tgz", + "integrity": "sha512-GRrW+7fmmgmkvyfEBqc1QFdWnF1Ex5yG6Y6AWL4TTxnkWlKIT98dsKh3P3UuWm6v4XsQwVE6DEzXIPMzWJ3ZbA==", "dev": true, + "license": "MIT", "dependencies": { - "@jest/types": "^29.6.3", - "chalk": "^4.0.0", - "jest-get-type": "^29.6.3", - "jest-util": "^29.7.0", - "pretty-format": "^29.7.0" + "@jest/get-type": "30.5.0", + "@jest/types": "30.5.1", + "chalk": "^4.1.2", + "jest-regex-util": "30.5.0", + "jest-util": "30.5.1", + "pretty-format": "30.5.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-each/node_modules/ansi-styles": { @@ -4824,6 +6304,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -4839,6 +6320,7 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -4855,6 +6337,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -4863,82 +6346,75 @@ } }, "node_modules/jest-environment-node": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz", - "integrity": "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-30.5.2.tgz", + "integrity": "sha512-Ciz4KgTGIbojxSKpuFImgWJj5EyqfE8xMq9NxWmOXnQywHHS03H9Mv+vaCB29J5pr3JBrY27WbRV18rBdjh8Dg==", "dev": true, + "license": "MIT", "dependencies": { - "@jest/environment": "^29.7.0", - "@jest/fake-timers": "^29.7.0", - "@jest/types": "^29.6.3", + "@jest/environment": "30.5.2", + "@jest/fake-timers": "30.5.2", + "@jest/types": "30.5.1", "@types/node": "*", - "jest-mock": "^29.7.0", - "jest-util": "^29.7.0" + "jest-mock": "30.5.2", + "jest-util": "30.5.1", + "jest-validate": "30.5.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-get-type": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", - "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", - "dev": true, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-haste-map": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", - "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-30.5.1.tgz", + "integrity": "sha512-VIFgt67jW480YDxKfEv9IYQKrFpYt7bOCMn3VsnjK7AK9qo7p6acpnA1DHwsVOULE3dTaYew/6JaTD/d0VDHoQ==", "dev": true, + "license": "MIT", "dependencies": { - "@jest/types": "^29.6.3", - "@types/graceful-fs": "^4.1.3", + "@jest/types": "30.5.1", + "@parcel/watcher": "^2.6.0", "@types/node": "*", - "anymatch": "^3.0.3", - "fb-watchman": "^2.0.0", - "graceful-fs": "^4.2.9", - "jest-regex-util": "^29.6.3", - "jest-util": "^29.7.0", - "jest-worker": "^29.7.0", - "micromatch": "^4.0.4", - "walker": "^1.0.8" + "anymatch": "^3.1.3", + "fb-watchman": "^2.0.2", + "fdir": "^6.5.0", + "graceful-fs": "^4.2.11", + "jest-regex-util": "30.5.0", + "jest-util": "30.5.1", + "jest-worker": "30.5.1", + "picomatch": "^4.0.3" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "optionalDependencies": { - "fsevents": "^2.3.2" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-leak-detector": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", - "integrity": "sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-30.5.1.tgz", + "integrity": "sha512-gt4GT2aWgEoCNTcBe4rqS74xTIUJxi+UD9SNSu9aOk5LmTEd6fS5KSTmAKAfitCCktQHNN+upUuL6EkBfFbMDQ==", "dev": true, + "license": "MIT", "dependencies": { - "jest-get-type": "^29.6.3", - "pretty-format": "^29.7.0" + "@jest/get-type": "30.5.0", + "pretty-format": "30.5.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-matcher-utils": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", - "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-30.5.2.tgz", + "integrity": "sha512-lFkB365PTIHOhPzwrb9T6gvlDnPpOZ7/c3ewOKKB7bzztqjVrtlyRL2MkyfJXpyY2u2SKw001JKrTx14fBUFcQ==", "dev": true, + "license": "MIT", "dependencies": { - "chalk": "^4.0.0", - "jest-diff": "^29.7.0", - "jest-get-type": "^29.6.3", - "pretty-format": "^29.7.0" + "@jest/get-type": "30.5.0", + "chalk": "^4.1.2", + "jest-diff": "30.5.2", + "pretty-format": "30.5.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-matcher-utils/node_modules/ansi-styles": { @@ -4946,6 +6422,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -4961,6 +6438,7 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -4977,6 +6455,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -4985,23 +6464,25 @@ } }, "node_modules/jest-message-util": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", - "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-30.5.1.tgz", + "integrity": "sha512-UdQlLdd9wL/Ys7xRErckqwD6wPlSZYueosSWuHc1r2ztGLwlgPvtSJq2+BPEgaEY13WLvfFbmhTj8pba0Sd1jg==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.12.13", - "@jest/types": "^29.6.3", - "@types/stack-utils": "^2.0.0", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.9", - "micromatch": "^4.0.4", - "pretty-format": "^29.7.0", + "@babel/code-frame": "^7.27.1", + "@jest/types": "30.5.1", + "@types/stack-utils": "^2.0.3", + "chalk": "^4.1.2", + "graceful-fs": "^4.2.11", + "jest-util": "30.5.1", + "picomatch": "^4.0.3", + "pretty-format": "30.5.1", "slash": "^3.0.0", - "stack-utils": "^2.0.3" + "stack-utils": "^2.0.6" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-message-util/node_modules/ansi-styles": { @@ -5009,6 +6490,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -5024,6 +6506,7 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -5040,6 +6523,7 @@ "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -5049,6 +6533,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -5057,76 +6542,62 @@ } }, "node_modules/jest-mock": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", - "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-30.5.2.tgz", + "integrity": "sha512-KTHb37Fhj8xY8qPFvTFaFJHcdsumQp+ExsUlgoX232Agmc706gagBs53+CYvulV7MVQo9AgXOUxsqzzVBoJlrA==", "dev": true, + "license": "MIT", "dependencies": { - "@jest/types": "^29.6.3", + "@jest/expect-utils": "30.5.2", + "@jest/types": "30.5.1", "@types/node": "*", - "jest-util": "^29.7.0" + "jest-util": "30.5.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-pnp-resolver": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", - "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", - "dev": true, - "engines": { - "node": ">=6" - }, - "peerDependencies": { - "jest-resolve": "*" - }, - "peerDependenciesMeta": { - "jest-resolve": { - "optional": true - } + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-regex-util": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", - "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", + "version": "30.5.0", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-30.5.0.tgz", + "integrity": "sha512-Mg0WK7A6xRHLSA1udJ8y9f3lM0uUhFTBnLKzwPmqB9AylvpleJ6BLemR8K9dK27DY+cesDryoA7yLZCAHsPG1A==", "dev": true, + "license": "MIT", "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-resolve": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz", - "integrity": "sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-30.5.1.tgz", + "integrity": "sha512-wprhLejRtwN6h8ZgaqC0eYjGJ1uMdGPT/+b3eFncbG4NWuuP9QL+vWwRinu9waw7hkOLcpMJGVJAMgBwsPssMQ==", "dev": true, + "license": "MIT", "dependencies": { - "chalk": "^4.0.0", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.7.0", - "jest-pnp-resolver": "^1.2.2", - "jest-util": "^29.7.0", - "jest-validate": "^29.7.0", - "resolve": "^1.20.0", - "resolve.exports": "^2.0.0", - "slash": "^3.0.0" + "chalk": "^4.1.2", + "graceful-fs": "^4.2.11", + "jest-haste-map": "30.5.1", + "jest-util": "30.5.1", + "jest-validate": "30.5.1", + "slash": "^3.0.0", + "unrs-resolver": "^1.12.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-resolve-dependencies": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz", - "integrity": "sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-30.5.2.tgz", + "integrity": "sha512-GMI0DP5enX9Z2qW2zFy1bOkrCfWAOPRJQ7qHt0pdfrxBPsgWxglMPrRSK2TX/wRWYxcPRSLFg3Z88qPOzHx7FQ==", "dev": true, + "license": "MIT", "dependencies": { - "jest-regex-util": "^29.6.3", - "jest-snapshot": "^29.7.0" + "jest-regex-util": "30.5.0", + "jest-snapshot": "30.5.2" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-resolve/node_modules/ansi-styles": { @@ -5134,6 +6605,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -5149,6 +6621,7 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -5165,6 +6638,7 @@ "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -5174,6 +6648,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -5182,35 +6657,37 @@ } }, "node_modules/jest-runner": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz", - "integrity": "sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-30.5.2.tgz", + "integrity": "sha512-/B6px7hiiNhVSRwuv9AGn0nawYvwsHeQZ3ItTd5Gp2diFd0EOKaWVeWqcbw3L88vx1GfpCKjQkxWItZCTl11Rw==", "dev": true, + "license": "MIT", "dependencies": { - "@jest/console": "^29.7.0", - "@jest/environment": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", + "@jest/console": "30.5.2", + "@jest/environment": "30.5.2", + "@jest/source-map": "30.5.2", + "@jest/test-result": "30.5.2", + "@jest/transform": "30.5.2", + "@jest/types": "30.5.1", "@types/node": "*", - "chalk": "^4.0.0", + "chalk": "^4.1.2", "emittery": "^0.13.1", - "graceful-fs": "^4.2.9", - "jest-docblock": "^29.7.0", - "jest-environment-node": "^29.7.0", - "jest-haste-map": "^29.7.0", - "jest-leak-detector": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-resolve": "^29.7.0", - "jest-runtime": "^29.7.0", - "jest-util": "^29.7.0", - "jest-watcher": "^29.7.0", - "jest-worker": "^29.7.0", - "p-limit": "^3.1.0", - "source-map-support": "0.5.13" + "exit-x": "^0.2.2", + "graceful-fs": "^4.2.11", + "jest-docblock": "30.5.0", + "jest-environment-node": "30.5.2", + "jest-haste-map": "30.5.1", + "jest-leak-detector": "30.5.1", + "jest-message-util": "30.5.1", + "jest-resolve": "30.5.1", + "jest-runtime": "30.5.2", + "jest-util": "30.5.1", + "jest-watcher": "30.5.2", + "jest-worker": "30.5.1", + "p-limit": "^3.1.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-runner/node_modules/ansi-styles": { @@ -5218,6 +6695,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -5233,6 +6711,7 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -5249,6 +6728,7 @@ "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=12" }, @@ -5261,6 +6741,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -5269,36 +6750,38 @@ } }, "node_modules/jest-runtime": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz", - "integrity": "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==", - "dev": true, - "dependencies": { - "@jest/environment": "^29.7.0", - "@jest/fake-timers": "^29.7.0", - "@jest/globals": "^29.7.0", - "@jest/source-map": "^29.6.3", - "@jest/test-result": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-30.5.2.tgz", + "integrity": "sha512-0paUAHBlheai10A3XSy9Xh+YBG0IROy+/qzcDPzQ/nbbXrznQzeWy5qniICWK6d3W3scaRQCVAbXdcK0ibBq4w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "30.5.2", + "@jest/fake-timers": "30.5.2", + "@jest/globals": "30.5.2", + "@jest/source-map": "30.5.2", + "@jest/test-result": "30.5.2", + "@jest/transform": "30.5.2", + "@jest/types": "30.5.1", "@types/node": "*", - "chalk": "^4.0.0", - "cjs-module-lexer": "^1.0.0", - "collect-v8-coverage": "^1.0.0", - "glob": "^7.1.3", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-mock": "^29.7.0", - "jest-regex-util": "^29.6.3", - "jest-resolve": "^29.7.0", - "jest-snapshot": "^29.7.0", - "jest-util": "^29.7.0", + "chalk": "^4.1.2", + "cjs-module-lexer": "^2.2.0", + "collect-v8-coverage": "^1.0.2", + "es-module-lexer": "^2.1.0", + "glob": "^13.0.6", + "graceful-fs": "^4.2.11", + "jest-haste-map": "30.5.1", + "jest-message-util": "30.5.1", + "jest-mock": "30.5.2", + "jest-regex-util": "30.5.0", + "jest-resolve": "30.5.1", + "jest-snapshot": "30.5.2", + "jest-util": "30.5.1", "slash": "^3.0.0", "strip-bom": "^4.0.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-runtime/node_modules/ansi-styles": { @@ -5306,6 +6789,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -5321,6 +6805,7 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -5337,6 +6822,7 @@ "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -5346,6 +6832,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -5354,34 +6841,36 @@ } }, "node_modules/jest-snapshot": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", - "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", - "dev": true, - "dependencies": { - "@babel/core": "^7.11.6", - "@babel/generator": "^7.7.2", - "@babel/plugin-syntax-jsx": "^7.7.2", - "@babel/plugin-syntax-typescript": "^7.7.2", - "@babel/types": "^7.3.3", - "@jest/expect-utils": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", - "babel-preset-current-node-syntax": "^1.0.0", - "chalk": "^4.0.0", - "expect": "^29.7.0", - "graceful-fs": "^4.2.9", - "jest-diff": "^29.7.0", - "jest-get-type": "^29.6.3", - "jest-matcher-utils": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-util": "^29.7.0", - "natural-compare": "^1.4.0", - "pretty-format": "^29.7.0", - "semver": "^7.5.3" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-30.5.2.tgz", + "integrity": "sha512-jKIdes25AnAH73dOCi2qE6J6vHJ6L2vyBS11M89kT50DVJcLTf2AOjvcc+2vVaN8lUbY5v2R83aqXo3Ro9fqYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.27.4", + "@babel/generator": "^7.27.5", + "@babel/plugin-syntax-jsx": "^7.27.1", + "@babel/plugin-syntax-typescript": "^7.27.1", + "@babel/types": "^7.27.3", + "@jest/expect-utils": "30.5.2", + "@jest/get-type": "30.5.0", + "@jest/snapshot-utils": "30.5.1", + "@jest/transform": "30.5.2", + "@jest/types": "30.5.1", + "babel-preset-current-node-syntax": "^1.2.0", + "chalk": "^4.1.2", + "expect": "30.5.2", + "graceful-fs": "^4.2.11", + "jest-diff": "30.5.2", + "jest-matcher-utils": "30.5.2", + "jest-message-util": "30.5.1", + "jest-util": "30.5.1", + "pretty-format": "30.5.1", + "semver": "^7.7.2", + "synckit": "^0.11.8" + }, + "engines": { + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-snapshot/node_modules/ansi-styles": { @@ -5389,6 +6878,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -5404,6 +6894,7 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -5420,6 +6911,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -5428,20 +6920,21 @@ } }, "node_modules/jest-util": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", - "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-30.5.1.tgz", + "integrity": "sha512-yKuxmNy2rSbTXw+3SIPanJo+nV4/BS1p26v44IYBFMsswSQySfMMcPHErnOncda7i9HEz0q605rIhSTBVgrZTg==", "dev": true, + "license": "MIT", "dependencies": { - "@jest/types": "^29.6.3", + "@jest/types": "30.5.1", "@types/node": "*", - "chalk": "^4.0.0", - "ci-info": "^3.2.0", - "graceful-fs": "^4.2.9", - "picomatch": "^2.2.3" + "chalk": "^4.1.2", + "ci-info": "^4.2.0", + "graceful-fs": "^4.2.11", + "picomatch": "^4.0.3" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-util/node_modules/ansi-styles": { @@ -5475,33 +6968,6 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/jest-util/node_modules/ci-info": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", - "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/sibiraj-s" - } - ], - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-util/node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, "node_modules/jest-util/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -5515,20 +6981,21 @@ } }, "node_modules/jest-validate": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", - "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-30.5.1.tgz", + "integrity": "sha512-i/buJ56wTpxihE93hQYNMfdOThS87+HGvLZzZJmU4xggPcdTYQq051iwALLCHp3q+SkCGH+EFejQZz5EbBSkkg==", "dev": true, + "license": "MIT", "dependencies": { - "@jest/types": "^29.6.3", - "camelcase": "^6.2.0", - "chalk": "^4.0.0", - "jest-get-type": "^29.6.3", + "@jest/get-type": "30.5.0", + "@jest/types": "30.5.1", + "camelcase": "^6.3.0", + "chalk": "^4.1.2", "leven": "^3.1.0", - "pretty-format": "^29.7.0" + "pretty-format": "30.5.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-validate/node_modules/ansi-styles": { @@ -5536,6 +7003,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -5546,11 +7014,25 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/jest-validate/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/jest-validate/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -5567,6 +7049,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -5575,22 +7058,23 @@ } }, "node_modules/jest-watcher": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz", - "integrity": "sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-30.5.2.tgz", + "integrity": "sha512-rqRgg4R11GA9m1UsEZwQeixHsgZReCn6TOHAHtIH33yXrIvoX0OGPA20Yzzjkz7X40fZvcRSxEpQppYPcWzmcQ==", "dev": true, + "license": "MIT", "dependencies": { - "@jest/test-result": "^29.7.0", - "@jest/types": "^29.6.3", + "@jest/test-result": "30.5.2", + "@jest/types": "30.5.1", "@types/node": "*", - "ansi-escapes": "^4.2.1", - "chalk": "^4.0.0", + "ansi-escapes": "^4.3.2", + "chalk": "^4.1.2", "emittery": "^0.13.1", - "jest-util": "^29.7.0", - "string-length": "^4.0.1" + "jest-util": "30.5.1", + "string-length": "^4.0.2" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/jest-watcher/node_modules/ansi-styles": { @@ -5598,6 +7082,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -5613,6 +7098,7 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -5629,6 +7115,7 @@ "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=12" }, @@ -5641,6 +7128,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -5649,18 +7137,20 @@ } }, "node_modules/jest-worker": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", - "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-30.5.1.tgz", + "integrity": "sha512-Cbxh5v7AoLuFRmFJSM4/aHdQ68rjXvUWr716EE0Dh3I7T+T/3FgFKhOERGXHcU2Meftq9+9zxPM3TSNyI9D+HA==", "dev": true, + "license": "MIT", "dependencies": { "@types/node": "*", - "jest-util": "^29.7.0", + "@ungap/structured-clone": "^1.3.0", + "jest-util": "30.5.1", "merge-stream": "^2.0.0", - "supports-color": "^8.0.0" + "supports-color": "^8.1.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/js-string-escape": { @@ -5676,13 +7166,15 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "version": "3.15.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.15.2.tgz", + "integrity": "sha512-6EuL879VkRA+1Cz578mKMiKvjPNEuk6+r1JaFzoSWejZmtf7xWbIyw1e3KkxlkzTIt9Taw6JBhEppG7utc1P+w==", "dev": true, + "license": "MIT", "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" @@ -5692,22 +7184,31 @@ } }, "node_modules/jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", "dev": true, + "license": "MIT", "bin": { "jsesc": "bin/jsesc" }, "engines": { - "node": ">=4" + "node": ">=6" } }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "dev": true + "dev": true, + "license": "MIT" + }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true, + "license": "MIT" }, "node_modules/json5": { "version": "2.2.3", @@ -5721,217 +7222,356 @@ "node": ">=6" } }, - "node_modules/jsonc-parser": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", - "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", - "dev": true - }, - "node_modules/kleur": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", - "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/leven": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } }, - "node_modules/lines-and-columns": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", - "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", - "dev": true - }, - "node_modules/load-json-file": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-7.0.1.tgz", - "integrity": "sha512-Gnxj3ev3mB5TkVBGad0JM6dmLiQL+o0t23JPBZ9sd+yvSLk05mFoqKBw5N8gbbkU4TNXyqCgIrl/VM17OgUIgQ==", + "node_modules/lightningcss": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.33.0.tgz", + "integrity": "sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==", "dev": true, + "license": "MPL-2.0", + "dependencies": { + "detect-libc": "^2.0.3" + }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">= 12.0.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-android-arm64": "1.33.0", + "lightningcss-darwin-arm64": "1.33.0", + "lightningcss-darwin-x64": "1.33.0", + "lightningcss-freebsd-x64": "1.33.0", + "lightningcss-linux-arm-gnueabihf": "1.33.0", + "lightningcss-linux-arm64-gnu": "1.33.0", + "lightningcss-linux-arm64-musl": "1.33.0", + "lightningcss-linux-x64-gnu": "1.33.0", + "lightningcss-linux-x64-musl": "1.33.0", + "lightningcss-win32-arm64-msvc": "1.33.0", + "lightningcss-win32-x64-msvc": "1.33.0" + } + }, + "node_modules/lightningcss-android-arm64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.33.0.tgz", + "integrity": "sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "node_modules/local-pkg": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.5.0.tgz", - "integrity": "sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==", + "node_modules/lightningcss-darwin-arm64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.33.0.tgz", + "integrity": "sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "mlly": "^1.4.2", - "pkg-types": "^1.0.3" - }, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=14" + "node": ">= 12.0.0" }, "funding": { - "url": "https://github.com/sponsors/antfu" + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "node_modules/lightningcss-darwin-x64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.33.0.tgz", + "integrity": "sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "p-locate": "^5.0.0" - }, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=10" + "node": ">= 12.0.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true + "node_modules/lightningcss-freebsd-x64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.33.0.tgz", + "integrity": "sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } }, - "node_modules/lodash.memoize": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", - "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==", - "dev": true + "node_modules/lightningcss-linux-arm-gnueabihf": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.33.0.tgz", + "integrity": "sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } }, - "node_modules/log-symbols": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", - "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "node_modules/lightningcss-linux-arm64-gnu": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.33.0.tgz", + "integrity": "sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "chalk": "^4.1.0", - "is-unicode-supported": "^0.1.0" + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-musl": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.33.0.tgz", + "integrity": "sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=10" + "node": ">= 12.0.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "node_modules/log-symbols/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/lightningcss-linux-x64-gnu": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.33.0.tgz", + "integrity": "sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "color-convert": "^2.0.1" + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-musl": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.33.0.tgz", + "integrity": "sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=8" + "node": ">= 12.0.0" }, "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "node_modules/log-symbols/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "node_modules/lightningcss-win32-arm64-msvc": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.33.0.tgz", + "integrity": "sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-x64-msvc": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.33.0.tgz", + "integrity": "sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": ">=10" + "node": ">= 12.0.0" }, "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "node_modules/log-symbols/node_modules/is-unicode-supported": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", - "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true, + "license": "MIT" + }, + "node_modules/load-json-file": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-7.0.1.tgz", + "integrity": "sha512-Gnxj3ev3mB5TkVBGad0JM6dmLiQL+o0t23JPBZ9sd+yvSLk05mFoqKBw5N8gbbkU4TNXyqCgIrl/VM17OgUIgQ==", "dev": true, "engines": { - "node": ">=10" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/log-symbols/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, + "license": "MIT", "dependencies": { - "has-flag": "^4.0.0" + "p-locate": "^4.1.0" }, "engines": { "node": ">=8" } }, - "node_modules/loupe": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", - "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", + "node_modules/lodash": { + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.18.1.tgz", + "integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==", "dev": true, - "dependencies": { - "get-func-name": "^2.0.1" - } + "license": "MIT" + }, + "node_modules/lodash.memoize": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", + "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==", + "dev": true }, "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "version": "11.5.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.3.tgz", + "integrity": "sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg==", "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, + "license": "BlueOak-1.0.0", "engines": { - "node": ">=10" + "node": "20 || >=22" } }, "node_modules/magic-string": { - "version": "0.30.8", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.8.tgz", - "integrity": "sha512-ISQTe55T2ao7XtlAStud6qwYPZjE4GK1S/BeVPus4jrq6JuOnQ00YKQC581RWhR122W7msZV263KzVeLoqidyQ==", + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-1.4.5.tgz", + "integrity": "sha512-oLLC2+YvQUfAa+vxoufE/yc1icb87M9iXIRqAoR/2EhE/8cb3SF/+Gi0c2By1B+5Vz2e2vQtUvHiu1+63Znh+w==", "dev": true, + "license": "MIT", "dependencies": { - "@jridgewell/sourcemap-codec": "^1.4.15" - }, - "engines": { - "node": ">=12" + "@jridgewell/sourcemap-codec": "^1.6.0" } }, "node_modules/make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", "dev": true, + "license": "MIT", "dependencies": { - "semver": "^6.0.0" + "semver": "^7.5.3" }, "engines": { - "node": ">=8" + "node": ">=10" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/make-dir/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "bin": { - "semver": "bin/semver.js" + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/make-error": { @@ -5940,20 +7580,12 @@ "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", "dev": true }, - "node_modules/makeerror": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", - "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", - "dev": true, - "dependencies": { - "tmpl": "1.0.5" - } - }, "node_modules/matcher": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/matcher/-/matcher-5.0.0.tgz", "integrity": "sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==", "dev": true, + "license": "MIT", "dependencies": { "escape-string-regexp": "^5.0.0" }, @@ -5977,12 +7609,13 @@ } }, "node_modules/memoize": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/memoize/-/memoize-10.0.0.tgz", - "integrity": "sha512-H6cBLgsi6vMWOcCpvVCdFFnl3kerEXbrYh9q+lY6VXvQSmM6CkmV08VOwT+WE2tzIEqRPFfAq3fm4v/UIW6mSA==", + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/memoize/-/memoize-10.2.0.tgz", + "integrity": "sha512-DeC6b7QBrZsRs3Y02A6A7lQyzFbsQbqgjI6UW0GigGWV+u1s25TycMr0XHZE4cJce7rY/vyw2ctMQqfDkIhUEA==", "dev": true, + "license": "MIT", "dependencies": { - "mimic-function": "^5.0.0" + "mimic-function": "^5.0.1" }, "engines": { "node": ">=18" @@ -6002,17 +7635,19 @@ "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 8" } }, "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, + "license": "MIT", "dependencies": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" }, "engines": { @@ -6020,10 +7655,11 @@ } }, "node_modules/micromatch/node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", "dev": true, + "license": "MIT", "engines": { "node": ">=8.6" }, @@ -6031,23 +7667,22 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/mimic-fn": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", - "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "node_modules/mime-db": { + "version": "1.54.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", "dev": true, + "license": "MIT", "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">= 0.6" } }, "node_modules/mimic-function": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.0.tgz", - "integrity": "sha512-RBfQ+9X9DpXdEoK7Bu+KeEU6vFhumEIiXKWECPzRBmDserEq4uR2b/VCm0LwpMSosoq2k+Zuxj/GzOr0Fn6h/g==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz", + "integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==", "dev": true, + "license": "MIT", "engines": { "node": ">=18" }, @@ -6056,156 +7691,195 @@ } }, "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "10.2.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz", + "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==", "dev": true, + "license": "BlueOak-1.0.0", "dependencies": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^5.0.8" }, "engines": { - "node": "*" + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/minipass": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", - "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "dev": true, - "engines": { - "node": ">=8" + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/minizlib": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", - "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "node_modules/minimizer-webpack-plugin": { + "version": "5.14.0", + "resolved": "https://registry.npmjs.org/minimizer-webpack-plugin/-/minimizer-webpack-plugin-5.14.0.tgz", + "integrity": "sha512-PnvQXCJxhgH2ZVVO7Lj0sM6q8L1XGxnUvd8wVQIRwi8khMCLq5wg0Ngxe44bcuZL2FSN81RdVE7YHEVzTKsQDQ==", "dev": true, + "license": "MIT", "dependencies": { - "minipass": "^3.0.0", - "yallist": "^4.0.0" + "jest-worker": "^27.4.5", + "schema-utils": "^4.6.0", + "terser": "^5.51.0" }, "engines": { - "node": ">= 8" + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.1.0" + }, + "peerDependenciesMeta": { + "@minify-html/node": { + "optional": true + }, + "@napi-rs/image": { + "optional": true + }, + "@swc/core": { + "optional": true + }, + "@swc/css": { + "optional": true + }, + "@swc/html": { + "optional": true + }, + "clean-css": { + "optional": true + }, + "cssnano": { + "optional": true + }, + "csso": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "html-minifier-terser": { + "optional": true + }, + "imagemin": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "postcss": { + "optional": true + }, + "sharp": { + "optional": true + }, + "svgo": { + "optional": true + }, + "uglify-js": { + "optional": true + } } }, - "node_modules/minizlib/node_modules/minipass": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "node_modules/minimizer-webpack-plugin/node_modules/jest-worker": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", + "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", "dev": true, + "license": "MIT", "dependencies": { - "yallist": "^4.0.0" + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" }, "engines": { - "node": ">=8" + "node": ">= 10.13.0" } }, - "node_modules/mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "node_modules/minipass": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", + "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", "dev": true, - "bin": { - "mkdirp": "bin/cmd.js" - }, + "license": "BlueOak-1.0.0", "engines": { - "node": ">=10" + "node": ">=16 || 14 >=14.17" } }, - "node_modules/mlly": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.6.1.tgz", - "integrity": "sha512-vLgaHvaeunuOXHSmEbZ9izxPx3USsk8KCQ8iC+aTlp5sKRSoZvwhHh5L9VbKSaVC6sJDqbyohIS76E2VmHIPAA==", + "node_modules/minizlib": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-3.1.0.tgz", + "integrity": "sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw==", "dev": true, + "license": "MIT", "dependencies": { - "acorn": "^8.11.3", - "pathe": "^1.1.2", - "pkg-types": "^1.0.3", - "ufo": "^1.3.2" + "minipass": "^7.1.2" + }, + "engines": { + "node": ">= 18" } }, "node_modules/mocha": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.3.0.tgz", - "integrity": "sha512-uF2XJs+7xSLsrmIvn37i/wnc91nw7XjOQB8ccyx5aEgdnohr7n+rEiZP23WkCYHjilR6+EboEnbq/ZQDz4LSbg==", - "dev": true, - "dependencies": { - "ansi-colors": "4.1.1", - "browser-stdout": "1.3.1", - "chokidar": "3.5.3", - "debug": "4.3.4", - "diff": "5.0.0", - "escape-string-regexp": "4.0.0", - "find-up": "5.0.0", - "glob": "8.1.0", - "he": "1.2.0", - "js-yaml": "4.1.0", - "log-symbols": "4.1.0", - "minimatch": "5.0.1", - "ms": "2.1.3", - "serialize-javascript": "6.0.0", - "strip-json-comments": "3.1.1", - "supports-color": "8.1.1", - "workerpool": "6.2.1", - "yargs": "16.2.0", - "yargs-parser": "20.2.4", - "yargs-unparser": "2.0.0" + "version": "12.0.3", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-12.0.3.tgz", + "integrity": "sha512-beammieDdiWdkjANWeWPpkxUROYGi5FN88fPOkLiticz7HTg3Y+Pho3EYE6SUdcuWnZ3h2WD8EXCA55JF4o6wg==", + "dev": true, + "license": "MIT", + "dependencies": { + "browser-stdout": "^1.3.1", + "chokidar": "^5.0.0", + "debug": "^4.3.5", + "diff": "^9.0.0", + "find-up-simple": "^1.0.1", + "glob": "^13.0.0", + "is-path-inside": "^4.0.0", + "is-unicode-supported": "^0.1.0", + "js-yaml": "^5.0.0", + "minimatch": "^10.2.2", + "ms": "^2.1.3", + "picocolors": "^1.1.1", + "serialize-javascript": "^7.1.1", + "strip-json-comments": "^5.0.3", + "supports-color": "^8.1.1", + "workerpool": "^10.0.0" }, "bin": { - "_mocha": "bin/_mocha", "mocha": "bin/mocha.js" }, "engines": { - "node": ">= 14.0.0" - } - }, - "node_modules/mocha/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" + "node": "^20.19.0 || >=22.12.0" } }, "node_modules/mocha/node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - }, - "node_modules/mocha/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/mocha/node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-3.0.4.tgz", + "integrity": "sha512-fwWK3Zq22l4XJJjx5mcBHGikIk+hJqO+32dPm0Jur7+rtG5x1scOjSfdT9ZKeWHPpsya/l0HHK4tDImBkTrtvA==", "dev": true, - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, - "node_modules/mocha/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/nodeca" + } + ], + "license": "PSF-2.0" }, - "node_modules/mocha/node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "node_modules/mocha/node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -6213,109 +7887,40 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/mocha/node_modules/glob": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", - "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/mocha/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/mocha/node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-5.5.0.tgz", + "integrity": "sha512-paNr4LFIFPjeeSmwNYdrb8FafLLG/Cr2Af3GjbsHJ5CxIjH4r0c2emlmRdAtpPAieP1gRVzk6buBbVP5gBMGAg==", "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/nodeca" + } + ], + "license": "MIT", "dependencies": { - "argparse": "^2.0.1" + "argparse": "^3.0.3" }, "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/mocha/node_modules/minimatch": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", - "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" + "js-yaml": "bin/js-yaml.mjs" } }, - "node_modules/mocha/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/mocha/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "node_modules/mocha/node_modules/strip-json-comments": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-5.1.0.tgz", + "integrity": "sha512-ErcwpJBYr8EfX/Br7JauOIGXoRE92w0hVtuS9j92UFgbATxA+WRSIZksSUDzEeItfWB/0QCEprTZT55RSINUHQ==", "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, + "license": "MIT", "engines": { - "node": ">=8" - } - }, - "node_modules/mocha/node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "dev": true, - "dependencies": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" + "node": ">=22" }, - "engines": { - "node": ">=10" - } - }, - "node_modules/mocha/node_modules/yargs-parser": { - "version": "20.2.4", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", - "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", - "dev": true, - "engines": { - "node": ">=10" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/ms": { @@ -6325,9 +7930,9 @@ "dev": true }, "node_modules/nanoid": { - "version": "3.3.7", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", - "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "version": "3.3.20", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz", + "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==", "dev": true, "funding": [ { @@ -6335,6 +7940,7 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "bin": { "nanoid": "bin/nanoid.cjs" }, @@ -6342,17 +7948,50 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, + "node_modules/napi-postinstall": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/napi-postinstall/-/napi-postinstall-0.3.8.tgz", + "integrity": "sha512-dHbDC5V1g/EI8OLEtL4Iuwbu0fgzmyykxenn2KnlsX9XdhTXL3gWnfbbP+ab+oUcgV6CFpb8QGyQt/ZXA0UXig==", + "dev": true, + "license": "MIT", + "bin": { + "napi-patch": "lib/patch.js", + "napi-postinstall": "lib/cli.js" + }, + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/napi-postinstall" + } + }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true + "dev": true, + "license": "MIT" + }, + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true, + "license": "MIT" + }, + "node_modules/node-addon-api": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz", + "integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==", + "dev": true, + "license": "MIT" }, "node_modules/node-fetch": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", "dev": true, + "license": "MIT", "dependencies": { "whatwg-url": "^5.0.0" }, @@ -6369,10 +8008,11 @@ } }, "node_modules/node-gyp-build": { - "version": "4.8.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.0.tgz", - "integrity": "sha512-u6fs2AEUljNho3EYTJNBfImO5QTo/J/1Etd+NVdCj7qWKUSN/bSLkZwhDv7I+w/MSC6qJ4cknepkAYykDdK8og==", + "version": "4.8.4", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.4.tgz", + "integrity": "sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==", "dev": true, + "license": "MIT", "bin": { "node-gyp-build": "bin.js", "node-gyp-build-optional": "optional.js", @@ -6386,33 +8026,39 @@ "dev": true }, "node_modules/node-releases": { - "version": "2.0.14", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", - "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==", - "dev": true + "version": "2.0.64", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.64.tgz", + "integrity": "sha512-zAPCKqMcnqs2nGy6nlkm7JduFseiBJy3EXHGLh+8pFR+TxGCBxxiEN21+UROU5CKwX/f4TlUcYjiM+vs/tsyxw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } }, "node_modules/nofilter": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/nofilter/-/nofilter-3.1.0.tgz", "integrity": "sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==", "dev": true, + "license": "MIT", "engines": { "node": ">=12.19" } }, "node_modules/nopt": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", - "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-8.1.0.tgz", + "integrity": "sha512-ieGu42u/Qsa4TFktmaKEwM6MQH0pOWnaB3htzh0JRtx84+Mebc0cbZYN5bC+6WTZ4+77xrL9Pn5m7CV6VIkV7A==", "dev": true, + "license": "ISC", "dependencies": { - "abbrev": "1" + "abbrev": "^3.0.0" }, "bin": { "nopt": "bin/nopt.js" }, "engines": { - "node": ">=6" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/normalize-path": { @@ -6436,34 +8082,18 @@ "node": ">=8" } }, - "node_modules/npmlog": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", - "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", - "dev": true, - "dependencies": { - "are-we-there-yet": "^2.0.0", - "console-control-strings": "^1.1.0", - "gauge": "^3.0.0", - "set-blocking": "^2.0.0" - } - }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "node_modules/obug": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/obug/-/obug-3.0.0.tgz", + "integrity": "sha512-5vvB5+W7ePv+p3uqxi+RcW1XAzLW0/hxt3/4X4Lc4qHudzOhmBiBwOY6DRob4WnanAEGvNcLjF+KNOufrUoEQw==", "dev": true, - "dependencies": { - "wrappy": "1" + "funding": [ + "https://github.com/sponsors/sxzz", + "https://opencollective.com/debug" + ], + "license": "MIT", + "engines": { + "node": ">=12.20.0" } }, "node_modules/onetime": { @@ -6495,6 +8125,7 @@ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, + "license": "MIT", "dependencies": { "yocto-queue": "^0.1.0" }, @@ -6506,25 +8137,40 @@ } }, "node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, + "license": "MIT", "dependencies": { - "p-limit": "^3.0.2" + "p-limit": "^2.2.0" }, "engines": { - "node": ">=10" + "node": ">=8" + } + }, + "node_modules/p-locate/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-map": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-7.0.1.tgz", - "integrity": "sha512-2wnaR0XL/FDOj+TgpDuRb2KTjLnu3Fma6b1ZUwGY7LcqenMcvP/YFpjpbPKY6WVGsbuJZRuoUz8iPrt8ORnAFw==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-7.1.1.tgz", + "integrity": "sha512-6Lh3jQPLthYujSrlw6ccWXBGZTkoTCz27Hd92g79LH/kjAbgoEu0t442cCCNbegPSJsA0lwDX8z0bcKtkpA32g==", "dev": true, + "license": "MIT", "engines": { "node": ">=18" }, @@ -6537,6 +8183,7 @@ "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -6557,11 +8204,19 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "dev": true, + "license": "BlueOak-1.0.0" + }, "node_modules/parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", "dev": true, + "license": "MIT", "dependencies": { "@babel/code-frame": "^7.0.0", "error-ex": "^1.3.1", @@ -6580,6 +8235,7 @@ "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-4.0.0.tgz", "integrity": "sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==", "dev": true, + "license": "MIT", "engines": { "node": ">=18" }, @@ -6592,19 +8248,11 @@ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", @@ -6618,58 +8266,65 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true + "dev": true, + "license": "MIT" }, - "node_modules/path-type": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-5.0.0.tgz", - "integrity": "sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==", + "node_modules/path-scurry": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.2.tgz", + "integrity": "sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==", "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" + }, "engines": { - "node": ">=12" + "node": "18 || 20 || >=22" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/pathe": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", - "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", - "dev": true - }, - "node_modules/pathval": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", - "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "node_modules/path-type": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-6.0.0.tgz", + "integrity": "sha512-Vj7sf++t5pBD637NSfkxpHSMfWaeig5+DKWLhcqIYx6mWQz5hdJTGDVMQiJcw1ZYkhs7AazKDGpRVji1LJCZUQ==", "dev": true, + "license": "MIT", "engines": { - "node": "*" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", - "dev": true + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" }, "node_modules/picomatch": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-3.0.1.tgz", - "integrity": "sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", + "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", "dev": true, + "license": "MIT", "engines": { - "node": ">=10" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/jonschlinkert" } }, "node_modules/pirates": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", - "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz", + "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==", "dev": true, + "license": "MIT", "engines": { "node": ">= 6" } @@ -6679,6 +8334,7 @@ "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", "dev": true, + "license": "MIT", "dependencies": { "find-up": "^4.0.0" }, @@ -6686,74 +8342,12 @@ "node": ">=8" } }, - "node_modules/pkg-dir/node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/pkg-dir/node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "dependencies": { - "p-locate": "^4.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/pkg-dir/node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "dependencies": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/pkg-dir/node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "dependencies": { - "p-limit": "^2.2.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/pkg-types": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.3.tgz", - "integrity": "sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==", - "dev": true, - "dependencies": { - "jsonc-parser": "^3.2.0", - "mlly": "^1.2.0", - "pathe": "^1.1.0" - } - }, "node_modules/plur": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/plur/-/plur-5.1.0.tgz", "integrity": "sha512-VP/72JeXqak2KiOzjgKtQen5y3IZHn+9GOuLDafPv0eXa47xq0At93XahYBs26MsifCQ4enGKwbjBTKgb9QJXg==", "dev": true, + "license": "MIT", "dependencies": { "irregular-plurals": "^3.3.0" }, @@ -6765,9 +8359,9 @@ } }, "node_modules/postcss": { - "version": "8.4.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.35.tgz", - "integrity": "sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==", + "version": "8.5.33", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.33.tgz", + "integrity": "sha512-RVHEU9/Pp1Fnjr/MpAJsZoADukCKhfIi15OunEYiGktIkYLkPVvC1sioWolGDS7XByMTx9m/IGbro0Js13zhnQ==", "dev": true, "funding": [ { @@ -6783,27 +8377,30 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "dependencies": { - "nanoid": "^3.3.7", - "picocolors": "^1.0.0", - "source-map-js": "^1.0.2" + "nanoid": "^3.3.20", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.2" }, "engines": { "node": "^10 || ^12 || >=14" } }, "node_modules/pretty-format": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", - "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "version": "30.5.1", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-30.5.1.tgz", + "integrity": "sha512-byhRAPguVKMQIj4kjJwJ5lAskVhfuiSdiYl/aLTWpgkGEmic2jYhJh1yE9ih8Ox44Xg9ccCT11/S6QrzSJuNrg==", "dev": true, + "license": "MIT", "dependencies": { - "@jest/schemas": "^29.6.3", - "ansi-styles": "^5.0.0", - "react-is": "^18.0.0" + "@jest/react-is-18": "npm:react-is@^18.3.1", + "@jest/react-is-19": "npm:react-is@^19.2.5", + "@jest/schemas": "30.5.0", + "ansi-styles": "^5.2.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/pretty-format/node_modules/ansi-styles": { @@ -6811,6 +8408,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -6819,10 +8417,11 @@ } }, "node_modules/pretty-ms": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-9.0.0.tgz", - "integrity": "sha512-E9e9HJ9R9NasGOgPaPE8VMeiPKAyWR5jcFpNnwIejslIhWqdqOrb2wShBsncMPUb+BcCd2OPYfh7p2W6oemTng==", + "version": "9.3.1", + "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-9.3.1.tgz", + "integrity": "sha512-HzMy3Geq23nVALD/M2LliU+F+M+gVNsvkQWWqeBZ8HDiCgzo6YPJ/Omrmtq24EFrIsk0a3EkQGEd7bDOo+IhGA==", "dev": true, + "license": "MIT", "dependencies": { "parse-ms": "^4.0.0" }, @@ -6833,23 +8432,10 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/prompts": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", - "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", - "dev": true, - "dependencies": { - "kleur": "^3.0.3", - "sisteransi": "^1.0.5" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/pure-rand": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.0.4.tgz", - "integrity": "sha512-LA0Y9kxMYv47GIPJy6MI84fqTd2HmYZI83W/kM/SkKfDlajnZYfmXFTxkbY+xSBPkLJxltMa9hIkmdc29eguMA==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-7.0.1.tgz", + "integrity": "sha512-oTUZM/NAZS8p7ANR3SHh30kXB+zK2r2BPcEn/awJIbOvq82WoMN4p62AWWp3Hhw50G0xMsw1mhIBLqHw64EcNQ==", "dev": true, "funding": [ { @@ -6860,7 +8446,8 @@ "type": "opencollective", "url": "https://opencollective.com/fast-check" } - ] + ], + "license": "MIT" }, "node_modules/queue-microtask": { "version": "1.2.3", @@ -6880,59 +8467,21 @@ "type": "consulting", "url": "https://feross.org/support" } - ] - }, - "node_modules/randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, - "dependencies": { - "safe-buffer": "^5.1.0" - } - }, - "node_modules/react-is": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", - "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", - "dev": true - }, - "node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } + ], + "license": "MIT" }, "node_modules/readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, - "dependencies": { - "picomatch": "^2.2.1" - }, - "engines": { - "node": ">=8.10.0" - } - }, - "node_modules/readdirp/node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-5.1.1.tgz", + "integrity": "sha512-Kko+Y5XQ6fM+Ce3dq3m9YGxnacYZYl9cA1wZjaF3Vbry2L3i1qVg8+CAgNPsXRArPMUMCaOR7oa9Nqntc43JKA==", "dev": true, + "license": "MIT", "engines": { - "node": ">=8.6" + "node": ">= 20.19.0" }, "funding": { - "url": "https://github.com/sponsors/jonschlinkert" + "type": "individual", + "url": "https://paulmillr.com/funding/" } }, "node_modules/require-directory": { @@ -6940,23 +8489,39 @@ "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/resolve": { - "version": "1.22.8", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", - "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "version": "1.22.14", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.14.tgz", + "integrity": "sha512-1ZjYvR9sbkiwC5+9QHetqW5HmA2pHRMaoupD01t2HlYnV/vydC2zPwLixhsMieSWVZt0JJRg5LVIk0Ow1D/TrA==", "dev": true, + "license": "MIT", "dependencies": { - "is-core-module": "^2.13.0", + "es-errors": "^1.3.0", + "is-core-module": "^2.18.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": { "resolve": "bin/resolve" }, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -6982,56 +8547,60 @@ "node": ">=8" } }, - "node_modules/resolve-pkg-maps": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", - "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", - "dev": true, - "funding": { - "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" - } - }, - "node_modules/resolve.exports": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", - "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", - "dev": true, - "engines": { - "node": ">=10" - } - }, "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", + "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", "dev": true, + "license": "MIT", "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" } }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "node_modules/rolldown": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.19.tgz", + "integrity": "sha512-QIiV1J9d0pzN4jeeTH4sjPy0AZ6cAy2cG0ExeoE1+U8Rvj+hR3gYkokx0YbeUNGlZqiQJJ2utcETe0oKXwzsuA==", "dev": true, + "license": "MIT", "dependencies": { - "glob": "^7.1.3" + "@oxc-project/types": "=0.156.0", + "@rolldown/pluginutils": "^1.0.0" }, "bin": { - "rimraf": "bin.js" + "rolldown": "bin/cli.mjs" }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "optionalDependencies": { + "@rolldown/binding-android-arm-eabi": "1.2.19", + "@rolldown/binding-android-arm64": "1.2.19", + "@rolldown/binding-darwin-arm64": "1.2.19", + "@rolldown/binding-darwin-x64": "1.2.19", + "@rolldown/binding-freebsd-x64": "1.2.19", + "@rolldown/binding-linux-arm-gnueabihf": "1.2.19", + "@rolldown/binding-linux-arm64-gnu": "1.2.19", + "@rolldown/binding-linux-arm64-musl": "1.2.19", + "@rolldown/binding-linux-ppc64-gnu": "1.2.19", + "@rolldown/binding-linux-s390x-gnu": "1.2.19", + "@rolldown/binding-linux-x64-gnu": "1.2.19", + "@rolldown/binding-linux-x64-musl": "1.2.19", + "@rolldown/binding-openharmony-arm64": "1.2.19", + "@rolldown/binding-wasm32-wasi": "1.2.19", + "@rolldown/binding-win32-arm64-msvc": "1.2.19", + "@rolldown/binding-win32-x64-msvc": "1.2.19" } }, "node_modules/rollup": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.12.1.tgz", - "integrity": "sha512-ggqQKvx/PsB0FaWXhIvVkSWh7a/PCLQAsMjBc+nA2M8Rv2/HG0X6zvixAB7KyZBRtifBUhy5k8voQX/mRnABPg==", + "version": "4.68.4", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.68.4.tgz", + "integrity": "sha512-5acdO1/M9urvHQuZVkoOt8JWQH6XxCnFnox1qodE39qkXaML67S2E7MhHDgx3pQYycM1A5dRJwahYMDLO9a3Yg==", "dev": true, + "license": "MIT", "dependencies": { - "@types/estree": "1.0.5" + "@types/estree": "^1.0.10" }, "bin": { "rollup": "dist/bin/rollup" @@ -7041,19 +8610,32 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.12.1", - "@rollup/rollup-android-arm64": "4.12.1", - "@rollup/rollup-darwin-arm64": "4.12.1", - "@rollup/rollup-darwin-x64": "4.12.1", - "@rollup/rollup-linux-arm-gnueabihf": "4.12.1", - "@rollup/rollup-linux-arm64-gnu": "4.12.1", - "@rollup/rollup-linux-arm64-musl": "4.12.1", - "@rollup/rollup-linux-riscv64-gnu": "4.12.1", - "@rollup/rollup-linux-x64-gnu": "4.12.1", - "@rollup/rollup-linux-x64-musl": "4.12.1", - "@rollup/rollup-win32-arm64-msvc": "4.12.1", - "@rollup/rollup-win32-ia32-msvc": "4.12.1", - "@rollup/rollup-win32-x64-msvc": "4.12.1", + "@rollup/rollup-android-arm-eabi": "4.68.4", + "@rollup/rollup-android-arm64": "4.68.4", + "@rollup/rollup-android-x64": "4.68.4", + "@rollup/rollup-darwin-arm64": "4.68.4", + "@rollup/rollup-darwin-x64": "4.68.4", + "@rollup/rollup-freebsd-arm64": "4.68.4", + "@rollup/rollup-freebsd-x64": "4.68.4", + "@rollup/rollup-linux-arm-gnueabihf": "4.68.4", + "@rollup/rollup-linux-arm-musleabihf": "4.68.4", + "@rollup/rollup-linux-arm64-gnu": "4.68.4", + "@rollup/rollup-linux-arm64-musl": "4.68.4", + "@rollup/rollup-linux-loong64-gnu": "4.68.4", + "@rollup/rollup-linux-loong64-musl": "4.68.4", + "@rollup/rollup-linux-ppc64-gnu": "4.68.4", + "@rollup/rollup-linux-ppc64-musl": "4.68.4", + "@rollup/rollup-linux-riscv64-gnu": "4.68.4", + "@rollup/rollup-linux-riscv64-musl": "4.68.4", + "@rollup/rollup-linux-s390x-gnu": "4.68.4", + "@rollup/rollup-linux-x64-gnu": "4.68.4", + "@rollup/rollup-linux-x64-musl": "4.68.4", + "@rollup/rollup-openbsd-x64": "4.68.4", + "@rollup/rollup-openharmony-arm64": "4.68.4", + "@rollup/rollup-win32-arm64-msvc": "4.68.4", + "@rollup/rollup-win32-ia32-msvc": "4.68.4", + "@rollup/rollup-win32-x64-gnu": "4.68.4", + "@rollup/rollup-win32-x64-msvc": "4.68.4", "fsevents": "~2.3.2" } }, @@ -7076,38 +8658,48 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "queue-microtask": "^1.2.2" } }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "node_modules/schema-utils": { + "version": "4.8.3", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.8.3.tgz", + "integrity": "sha512-qIfo3f+lRNqnMPgpXSKvUhsT3pY5U+ppmgGr4j8LanFP3W/Ze+xj8DY/dPb5qVu3m6qFIMyMWKVRLNKxrNhxWg==", "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" + "license": "MIT", + "dependencies": { + "@types/json-schema": "^7.0.15", + "ajv": "^8.20.0", + "ajv-formats": "^3.0.1", + "ajv-keywords": "^5.1.0" + }, + "bin": { + "schema-utils": "bin/schema-utils.js" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.0.0" + }, + "peerDependenciesMeta": { + "webpack": { + "optional": true } - ] + } }, "node_modules/semver": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", - "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.6.tgz", + "integrity": "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==", "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -7131,20 +8723,15 @@ } }, "node_modules/serialize-javascript": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", - "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-7.1.4.tgz", + "integrity": "sha512-FqlEuoTq/zRmA4Lg6aOqyH3lCHbUtCB0bmHCeFniX2GBdDqMJM3FwdvEhlE5Pim1dlt2FfBdVPmUNNiGhhKqpw==", "dev": true, - "dependencies": { - "randombytes": "^2.1.0" + "license": "BSD-3-Clause", + "engines": { + "node": ">=20.0.0" } }, - "node_modules/set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", - "dev": true - }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -7166,29 +8753,18 @@ "node": ">=8" } }, - "node_modules/siginfo": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", - "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", - "dev": true - }, "node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true }, - "node_modules/sisteransi": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", - "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", - "dev": true - }, "node_modules/slash": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz", "integrity": "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==", "dev": true, + "license": "MIT", "engines": { "node": ">=14.16" }, @@ -7201,6 +8777,7 @@ "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-5.0.0.tgz", "integrity": "sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^6.0.0", "is-fullwidth-code-point": "^4.0.0" @@ -7209,7 +8786,20 @@ "node": ">=12" }, "funding": { - "url": "https://github.com/chalk/slice-ansi?sponsor=1" + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/slice-ansi/node_modules/is-fullwidth-code-point": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz", + "integrity": "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/source-map": { @@ -7222,19 +8812,21 @@ } }, "node_modules/source-map-js": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", - "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz", + "integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } }, "node_modules/source-map-support": { - "version": "0.5.13", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", - "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", "dev": true, + "license": "MIT", "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -7267,32 +8859,19 @@ "node": ">=8" } }, - "node_modules/stackback": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", - "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", - "dev": true - }, "node_modules/std-env": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.7.0.tgz", - "integrity": "sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==", - "dev": true - }, - "node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-4.3.0.tgz", + "integrity": "sha512-OtU/EgQ1kIm5KwqQpBC6ZEMXrZRui11w8zgfTWp8cdO9B8OaPsbA8bTHO2P+HNo1VlUTGMVBwPhydu6poeXiag==", "dev": true, - "dependencies": { - "safe-buffer": "~5.2.0" - } + "license": "MIT" }, "node_modules/string-length": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", "dev": true, + "license": "MIT", "dependencies": { "char-regex": "^1.0.2", "strip-ansi": "^6.0.0" @@ -7306,6 +8885,7 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -7315,6 +8895,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, + "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -7323,10 +8904,11 @@ } }, "node_modules/string-width": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.1.0.tgz", - "integrity": "sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", "dev": true, + "license": "MIT", "dependencies": { "emoji-regex": "^10.3.0", "get-east-asian-width": "^1.0.0", @@ -7339,13 +8921,60 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/string-width-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", + "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", "dev": true, + "license": "MIT", "dependencies": { - "ansi-regex": "^6.0.1" + "ansi-regex": "^6.2.2" }, "engines": { "node": ">=12" @@ -7354,11 +8983,49 @@ "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi/node_modules/ansi-regex": { + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.6.0.tgz", + "integrity": "sha512-XZ5apbzreCbXSKwPjJstu8R0zOi247w3XYwWxtwBXgpZrCyc1Ka7p9/xY0A9/diMewmHbEKz+FIraWaEWjlN5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, "node_modules/strip-bom": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -7377,6 +9044,7 @@ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" }, @@ -7384,24 +9052,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/strip-literal": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-2.0.0.tgz", - "integrity": "sha512-f9vHgsCWBq2ugHAkGMiiYY+AYG0D/cbloKKg0nhaaaSNsujdGIpVXCNsrJpCKr5M0f4aI31mr13UjY6GAuXCKA==", - "dev": true, - "dependencies": { - "js-tokens": "^8.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/antfu" - } - }, - "node_modules/strip-literal/node_modules/js-tokens": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-8.0.3.tgz", - "integrity": "sha512-UfJMcSJc+SEXEl9lH/VLHSZbThQyLpw1vLO1Lb+j4RWDvG3N2f7yj3PVQA3cmkTBNldJ9eFnM+xEXxHIXrYiJw==", - "dev": true - }, "node_modules/supertap": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/supertap/-/supertap-3.0.1.tgz", @@ -7437,6 +9087,7 @@ "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -7444,21 +9095,61 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/synckit": { + "version": "0.11.13", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.11.13.tgz", + "integrity": "sha512-eNRKgb3z66Yp3D2CixVujOUvXLFUTij/zVnV8KRyvFdQwpz7I5DS8UfRkTeLzb64u+dkzDSdelE24izu+zSSUg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@pkgr/core": "^0.3.6" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/synckit" + } + }, + "node_modules/tapable": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.4.tgz", + "integrity": "sha512-NHFiWnAbMJxNNpBwiO7jJVGDuqMxT9/oV8v57RR+fgBQShkJil5inGD8/xWy0hjLyHQyX1tu27QANhlz3KBqCg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, "node_modules/tar": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.0.tgz", - "integrity": "sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==", + "version": "7.5.23", + "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.23.tgz", + "integrity": "sha512-lkukzdoGngZHJZXxW4S/E4Fp9ghTDlyZXrQGRNoJ/LXvDKcXUTq2sg5yQe74po7Voea6n/IN09+wE/QvJMiifA==", "dev": true, + "license": "BlueOak-1.0.0", "dependencies": { - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "minipass": "^5.0.0", - "minizlib": "^2.1.1", - "mkdirp": "^1.0.3", - "yallist": "^4.0.0" + "@isaacs/fs-minipass": "^4.0.0", + "chownr": "^3.0.0", + "minipass": "^7.1.2", + "minizlib": "^3.1.0", + "yallist": "^5.0.0" }, "engines": { - "node": ">=10" + "node": ">=18" + } + }, + "node_modules/tar/node_modules/yallist": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-5.0.0.tgz", + "integrity": "sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=18" } }, "node_modules/temp-dir": { @@ -7470,18 +9161,117 @@ "node": ">=14.16" } }, + "node_modules/terser": { + "version": "5.51.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.51.2.tgz", + "integrity": "sha512-bWnjSNscmuI+GJze6ZupnHP8G/cTcsJF+bXCeQknk2SHQsgbNJnLrqiH9jZ2W4STPVXH2mDKKRX3iwPhc9Cn/Q==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.15.0", + "commander": "^2.20.0", + "source-map-support": "~0.5.20" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/test-exclude": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", - "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-7.0.2.tgz", + "integrity": "sha512-u9E6A+ZDYdp7a4WnarkXPZOx8Ilz46+kby6p1yZ8zsGTz9gYa6FIS7lj2oezzNKmtdyyJNNmmXDppga5GB7kSw==", "dev": true, + "license": "ISC", "dependencies": { "@istanbuljs/schema": "^0.1.2", - "glob": "^7.1.4", - "minimatch": "^3.0.4" + "glob": "^10.4.1", + "minimatch": "^10.2.2" }, "engines": { - "node": ">=8" + "node": ">=18" + } + }, + "node_modules/test-exclude/node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/test-exclude/node_modules/brace-expansion": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.8.tgz", + "integrity": "sha512-BnlDzDYQoplTsZSvPi86CNzmbcb07X8ufR8fk1zivaiEJlXJkiq1MQyDCVmlWcsWbj6aWXqHnrwwevbrm/Saig==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/test-exclude/node_modules/glob": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", + "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/test-exclude/node_modules/glob/node_modules/minimatch": { + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz", + "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.2" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/test-exclude/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/test-exclude/node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/time-zone": { @@ -7494,42 +9284,40 @@ } }, "node_modules/tinybench": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.6.0.tgz", - "integrity": "sha512-N8hW3PG/3aOoZAN5V/NSAEDz0ZixDSSt5b/a05iqtpgfLWMSVuCo7w0k2vVvEjdrIoeGqZzweX2WlyioNIHchA==", - "dev": true - }, - "node_modules/tinypool": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.2.tgz", - "integrity": "sha512-SUszKYe5wgsxnNOVlBYO6IC+8VGWdVGZWAqUxp3UErNBtptZvWbwyUOyzNL59zigz2rCA92QiL3wvG+JDSdJdQ==", + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-6.2.3.tgz", + "integrity": "sha512-Al01C2JIBnO2CXCAPbpAl6sUiOZHeThGtHYNTa51JRw9PyWOCdr+9Ong05R4qg/Sk3+H645E8ov1h2c58ityNw==", "dev": true, + "license": "MIT", "engines": { - "node": ">=14.0.0" + "node": ">=20.0.0" } }, - "node_modules/tinyspy": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.1.tgz", - "integrity": "sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==", + "node_modules/tinyexec": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.3.1.tgz", + "integrity": "sha512-GCvB3aoys96IuDFBMcTB46JOR6mdMtAToqwiW8JlWhsoh1mhHi/xn9ss/Dg7N555GiJyEt2qzoG/NHCwM6h1EA==", "dev": true, + "license": "MIT", "engines": { - "node": ">=14.0.0" + "node": ">=18" } }, - "node_modules/tmpl": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", - "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", - "dev": true - }, - "node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "node_modules/tinyglobby": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, "engines": { - "node": ">=4" + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" } }, "node_modules/to-regex-range": { @@ -7537,6 +9325,7 @@ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, + "license": "MIT", "dependencies": { "is-number": "^7.0.0" }, @@ -7548,40 +9337,48 @@ "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/ts-jest": { - "version": "29.1.2", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.2.tgz", - "integrity": "sha512-br6GJoH/WUX4pu7FbZXuWGKGNDuU7b8Uj77g/Sp7puZV6EXzuByl6JrECvm0MzVzSTkSHWTihsXt+5XYER5b+g==", + "version": "29.4.15", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.4.15.tgz", + "integrity": "sha512-s2qmEUYFRqbjz1wv0EmccNPVOb45HOFpFuhzQJLKShYVisuTbCFPIIAIV2EuK5rIxb4BejLDbH7dnBZfYjybUQ==", "dev": true, + "license": "MIT", "dependencies": { - "bs-logger": "0.x", - "fast-json-stable-stringify": "2.x", - "jest-util": "^29.0.0", + "bs-logger": "^0.2.6", + "fast-json-stable-stringify": "^2.1.0", + "handlebars": "^4.7.10", "json5": "^2.2.3", - "lodash.memoize": "4.x", - "make-error": "1.x", - "semver": "^7.5.3", - "yargs-parser": "^21.0.1" + "lodash.memoize": "^4.1.2", + "make-error": "^1.3.6", + "semver": "^7.8.5", + "type-fest": "^4.41.0", + "yargs-parser": "^21.1.1" }, "bin": { "ts-jest": "cli.js" }, "engines": { - "node": "^16.10.0 || ^18.0.0 || >=20.0.0" + "node": "^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0" }, "peerDependencies": { - "@babel/core": ">=7.0.0-beta.0 <8", - "@jest/types": "^29.0.0", - "babel-jest": "^29.0.0", - "jest": "^29.0.0", - "typescript": ">=4.3 <6" + "@babel/core": ">=7.0.0-beta.0 <9", + "@jest/transform": "^29.0.0 || ^30.0.0", + "@jest/types": "^29.0.0 || ^30.0.0", + "babel-jest": "^29.0.0 || ^30.0.0", + "jest": "^29.0.0 || ^30.0.0", + "jest-util": "^29.0.0 || ^30.0.0", + "typescript": ">=4.3 <7" }, "peerDependenciesMeta": { "@babel/core": { "optional": true }, + "@jest/transform": { + "optional": true + }, "@jest/types": { "optional": true }, @@ -7590,17 +9387,41 @@ }, "esbuild": { "optional": true + }, + "jest-util": { + "optional": true } } }, + "node_modules/ts-jest/node_modules/type-fest": { + "version": "4.41.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", + "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/tslib": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.9.1.tgz", + "integrity": "sha512-a4Ux9VKuIMHsOS7ENbEq6hK2ZGYIT27Rtl0E4eD9KqwxhKiQeMZE/9xb3IdYwWaSOyIBQLExhQgXDTYoiCxnWA==", + "dev": true, + "license": "0BSD", + "optional": true + }, "node_modules/tsx": { - "version": "4.7.1", - "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.7.1.tgz", - "integrity": "sha512-8d6VuibXHtlN5E3zFkgY8u4DX7Y3Z27zvvPKVmLon/D4AjuKzarkUBTLDBgj9iTQ0hg5xM7c/mYiRVM+HETf0g==", + "version": "4.23.15", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.23.15.tgz", + "integrity": "sha512-Yiex1Ovn8z2xPpOWckIiysV1SSyRMY9BkLF++q0yKiDxCqRhosKfMg3janKkiLBwZ5c/YryloKwGZcrEmtwxKw==", "dev": true, + "license": "MIT", "dependencies": { - "esbuild": "~0.19.10", - "get-tsconfig": "^4.7.2" + "esbuild": "~0.28.0" }, "bin": { "tsx": "dist/cli.mjs" @@ -7617,6 +9438,7 @@ "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } @@ -7634,10 +9456,11 @@ } }, "node_modules/typescript": { - "version": "5.4.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.2.tgz", - "integrity": "sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==", + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, + "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -7646,23 +9469,33 @@ "node": ">=14.17" } }, - "node_modules/ufo": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.4.0.tgz", - "integrity": "sha512-Hhy+BhRBleFjpJ2vchUNN40qgkh0366FWJGqVLYBHev0vpHTrXSA0ryT+74UiW6KWsldNurQMKGqCm1M2zBciQ==", - "dev": true + "node_modules/uglify-js": { + "version": "3.19.3", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz", + "integrity": "sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==", + "dev": true, + "license": "BSD-2-Clause", + "optional": true, + "bin": { + "uglifyjs": "bin/uglifyjs" + }, + "engines": { + "node": ">=0.8.0" + } }, "node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "dev": true + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true, + "license": "MIT" }, "node_modules/unicorn-magic": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.1.0.tgz", - "integrity": "sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.3.0.tgz", + "integrity": "sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA==", "dev": true, + "license": "MIT", "engines": { "node": ">=18" }, @@ -7670,10 +9503,46 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/unrs-resolver": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/unrs-resolver/-/unrs-resolver-1.13.0.tgz", + "integrity": "sha512-mcPQo9Vm6kXd84d/WqMiYBi2CcA57QHBX/ev5PoUEb8b2oQzUvJ6xYsfseQblnCncgnVmCZGWiFwK7KkS5JZJA==", + "dev": true, + "license": "MIT", + "dependencies": { + "napi-postinstall": "^0.3.7" + }, + "funding": { + "url": "https://opencollective.com/unrs-resolver" + }, + "optionalDependencies": { + "@unrs/resolver-binding-android-arm-eabi": "1.13.0", + "@unrs/resolver-binding-android-arm64": "1.13.0", + "@unrs/resolver-binding-darwin-arm64": "1.13.0", + "@unrs/resolver-binding-darwin-x64": "1.13.0", + "@unrs/resolver-binding-freebsd-x64": "1.13.0", + "@unrs/resolver-binding-linux-arm-gnueabihf": "1.13.0", + "@unrs/resolver-binding-linux-arm-musleabihf": "1.13.0", + "@unrs/resolver-binding-linux-arm64-gnu": "1.13.0", + "@unrs/resolver-binding-linux-arm64-musl": "1.13.0", + "@unrs/resolver-binding-linux-loong64-gnu": "1.13.0", + "@unrs/resolver-binding-linux-loong64-musl": "1.13.0", + "@unrs/resolver-binding-linux-ppc64-gnu": "1.13.0", + "@unrs/resolver-binding-linux-riscv64-gnu": "1.13.0", + "@unrs/resolver-binding-linux-riscv64-musl": "1.13.0", + "@unrs/resolver-binding-linux-s390x-gnu": "1.13.0", + "@unrs/resolver-binding-linux-x64-gnu": "1.13.0", + "@unrs/resolver-binding-linux-x64-musl": "1.13.0", + "@unrs/resolver-binding-openharmony-arm64": "1.13.0", + "@unrs/resolver-binding-win32-arm64-msvc": "1.13.0", + "@unrs/resolver-binding-win32-ia32-msvc": "1.13.0", + "@unrs/resolver-binding-win32-x64-msvc": "1.13.0" + } + }, "node_modules/update-browserslist-db": { - "version": "1.0.13", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", - "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.4.tgz", + "integrity": "sha512-t8wonIOdQyOjtPd2VktlBu6QjTVTks6v8bSi7kd0r2Vll8TK1JYDZtRRdbmCHOAMphkZgrzK+L+vXK4pyZ8t4A==", "dev": true, "funding": [ { @@ -7689,9 +9558,10 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "dependencies": { - "escalade": "^3.1.1", - "picocolors": "^1.0.0" + "escalade": "^3.2.0", + "picocolors": "^1.1.1" }, "bin": { "update-browserslist-db": "cli.js" @@ -7700,17 +9570,12 @@ "browserslist": ">= 4.21.0" } }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", - "dev": true - }, "node_modules/v8-to-istanbul": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.2.0.tgz", - "integrity": "sha512-/EH/sDgxU2eGxajKdwLCDmQ4FWq+kpi3uCmBGpw1xJtnAxEjlD8j8PEiGWpCIMIs3ciNAgH0d3TTJiUkYzyZjA==", + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", + "integrity": "sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==", "dev": true, + "license": "ISC", "dependencies": { "@jridgewell/trace-mapping": "^0.3.12", "@types/istanbul-lib-coverage": "^2.0.1", @@ -7721,20 +9586,23 @@ } }, "node_modules/vite": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.1.5.tgz", - "integrity": "sha512-BdN1xh0Of/oQafhU+FvopafUp6WaYenLU/NFoL5WyJL++GxkNfieKzBhM24H3HVsPQrlAqB7iJYTHabzaRed5Q==", + "version": "8.3.8", + "resolved": "https://registry.npmjs.org/vite/-/vite-8.3.8.tgz", + "integrity": "sha512-LzOn3h9rG/0vhLdXrV4yJ4QFA9eEoqCl+Yx+kGJd7aB9w6nfNgVHKSYwLPZUHrz4ZGa+t+kXjV9itvcHDLQouA==", "dev": true, + "license": "MIT", "dependencies": { - "esbuild": "^0.19.3", - "postcss": "^8.4.35", - "rollup": "^4.2.0" + "lightningcss": "^1.33.0", + "picomatch": "^4.0.7", + "postcss": "^8.5.32", + "rolldown": "~1.2.18", + "tinyglobby": "^0.2.17" }, "bin": { "vite": "bin/vite.js" }, "engines": { - "node": "^18.0.0 || >=20.0.0" + "node": "^20.19.0 || >=22.12.0" }, "funding": { "url": "https://github.com/vitejs/vite?sponsor=1" @@ -7743,25 +9611,39 @@ "fsevents": "~2.3.3" }, "peerDependencies": { - "@types/node": "^18.0.0 || >=20.0.0", - "less": "*", - "lightningcss": "^1.21.0", - "sass": "*", - "stylus": "*", - "sugarss": "*", - "terser": "^5.4.0" + "@types/node": "^20.19.0 || >=22.12.0", + "@vitejs/devtools": "^0.7.1 || ^0.8.0", + "esbuild": "^0.27.0 || ^0.28.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" }, "peerDependenciesMeta": { "@types/node": { "optional": true }, + "@vitejs/devtools": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "jiti": { + "optional": true + }, "less": { "optional": true }, - "lightningcss": { + "sass": { "optional": true }, - "sass": { + "sass-embedded": { "optional": true }, "stylus": { @@ -7772,83 +9654,82 @@ }, "terser": { "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true } } }, - "node_modules/vite-node": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.3.1.tgz", - "integrity": "sha512-azbRrqRxlWTJEVbzInZCTchx0X69M/XPTCz4H+TLvlTcR/xH/3hkRqhOakT41fMJCMzXTu4UvegkZiEoJAWvng==", + "node_modules/vitest": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-5.1.0.tgz", + "integrity": "sha512-MzmNFnrwa8v8lF1bLxw3UJ4EREwVOVb75VqJZmUDRjJ6EluK/x9th7qTbaeDk41WxE1GxWqmTXcdsfobfH5sOA==", "dev": true, + "license": "MIT", "dependencies": { - "cac": "^6.7.14", - "debug": "^4.3.4", - "pathe": "^1.1.1", - "picocolors": "^1.0.0", - "vite": "^5.0.0" - }, - "bin": { - "vite-node": "vite-node.mjs" - }, - "engines": { - "node": "^18.0.0 || >=20.0.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/vitest": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.3.1.tgz", - "integrity": "sha512-/1QJqXs8YbCrfv/GPQ05wAZf2eakUPLPa18vkJAKE7RXOKfVHqMZZ1WlTjiwl6Gcn65M5vpNUB6EFLnEdRdEXQ==", - "dev": true, - "dependencies": { - "@vitest/expect": "1.3.1", - "@vitest/runner": "1.3.1", - "@vitest/snapshot": "1.3.1", - "@vitest/spy": "1.3.1", - "@vitest/utils": "1.3.1", - "acorn-walk": "^8.3.2", - "chai": "^4.3.10", - "debug": "^4.3.4", - "execa": "^8.0.1", - "local-pkg": "^0.5.0", - "magic-string": "^0.30.5", - "pathe": "^1.1.1", - "picocolors": "^1.0.0", - "std-env": "^3.5.0", - "strip-literal": "^2.0.0", - "tinybench": "^2.5.1", - "tinypool": "^0.8.2", - "vite": "^5.0.0", - "vite-node": "1.3.1", - "why-is-node-running": "^2.2.2" + "@types/chai": "^5.2.2", + "@vitest/mocker": "5.1.0", + "chai": "^6.3.0", + "es-module-lexer": "^2.3.2", + "expect-type": "^1.4.0", + "magic-string": "^1.4.3", + "obug": "^3.0.0", + "picomatch": "^4.0.7", + "std-env": "^4.3.0", + "tinybench": "^6.2.2", + "tinyexec": "^1.3.1", + "tinyglobby": "^0.2.17", + "why-is-node-running": "3.2.1" }, "bin": { "vitest": "vitest.mjs" }, "engines": { - "node": "^18.0.0 || >=20.0.0" + "node": "^22.12.0 || ^24.0.0 || >=26.0.0" }, "funding": { "url": "https://opencollective.com/vitest" }, "peerDependencies": { "@edge-runtime/vm": "*", - "@types/node": "^18.0.0 || >=20.0.0", - "@vitest/browser": "1.3.1", - "@vitest/ui": "1.3.1", + "@opentelemetry/api": "^1.9.0", + "@types/node": "^22.0.0 || >=24.0.0", + "@vitest/browser-playwright": "5.1.0", + "@vitest/browser-preview": "5.1.0", + "@vitest/browser-webdriverio": "^5.0.0-beta.5 || >=5.0.0", + "@vitest/coverage-istanbul": "5.1.0", + "@vitest/coverage-v8": "5.1.0", + "@vitest/ui": "5.1.0", "happy-dom": "*", - "jsdom": "*" + "jsdom": "*", + "vite": "^6.4.0 || ^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { "@edge-runtime/vm": { "optional": true }, + "@opentelemetry/api": { + "optional": true + }, "@types/node": { "optional": true }, - "@vitest/browser": { + "@vitest/browser-playwright": { + "optional": true + }, + "@vitest/browser-preview": { + "optional": true + }, + "@vitest/browser-webdriverio": { + "optional": true + }, + "@vitest/coverage-istanbul": { + "optional": true + }, + "@vitest/coverage-v8": { "optional": true }, "@vitest/ui": { @@ -7859,146 +9740,83 @@ }, "jsdom": { "optional": true + }, + "vite": { + "optional": false } } }, - "node_modules/vitest/node_modules/execa": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", - "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", + "node_modules/watchpack": { + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.6.4.tgz", + "integrity": "sha512-5H3Tce2GfzWbcr9VnSqyak2whFaONw4BdmI5BDnMXold4qSlCFd64XaMQESRh2vkDKmdUkv6rUo17UvZ9f9nXw==", "dev": true, + "license": "MIT", "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^8.0.1", - "human-signals": "^5.0.0", - "is-stream": "^3.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^4.1.0", - "strip-final-newline": "^3.0.0" - }, - "engines": { - "node": ">=16.17" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/vitest/node_modules/get-stream": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", - "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", - "dev": true, - "engines": { - "node": ">=16" + "graceful-fs": "^4.1.2" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/vitest/node_modules/human-signals": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", - "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", - "dev": true, - "engines": { - "node": ">=16.17.0" - } - }, - "node_modules/vitest/node_modules/is-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", - "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", - "dev": true, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=10.13.0" } }, - "node_modules/vitest/node_modules/npm-run-path": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", - "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", "dev": true, - "dependencies": { - "path-key": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } + "license": "BSD-2-Clause" }, - "node_modules/vitest/node_modules/onetime": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", - "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "node_modules/webpack": { + "version": "5.112.2", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.112.2.tgz", + "integrity": "sha512-B2tp1LI9D8GVpPDqprdt12ukTkXXahj9MzqSWJq4faSPgOUM7CdZaGAB6HrL/8E6UwbBpdj4vzWDbKoFnVoU6g==", "dev": true, + "license": "MIT", "dependencies": { - "mimic-fn": "^4.0.0" + "@types/estree": "^1.0.8", + "@types/json-schema": "^7.0.15", + "@webassemblyjs/ast": "^1.14.1", + "@webassemblyjs/wasm-edit": "^1.14.1", + "@webassemblyjs/wasm-parser": "^1.14.1", + "browserslist": "^4.28.1", + "chrome-trace-event": "^1.0.2", + "enhanced-resolve": "^5.26.0", + "es-module-lexer": "^2.1.0", + "events": "^3.2.0", + "graceful-fs": "^4.2.11", + "mime-db": "^1.54.0", + "minimizer-webpack-plugin": "^5.13.0", + "schema-utils": "^4.8.1", + "tapable": "^2.3.0", + "watchpack": "^2.6.3", + "webpack-sources": "^3.6.0" }, - "engines": { - "node": ">=12" + "bin": { + "webpack": "bin/webpack.js" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/vitest/node_modules/path-key": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", - "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", - "dev": true, "engines": { - "node": ">=12" + "node": ">=10.13.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/vitest/node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, - "engines": { - "node": ">=14" + "type": "opencollective", + "url": "https://opencollective.com/webpack" }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "peerDependenciesMeta": { + "webpack-cli": { + "optional": true + } } }, - "node_modules/vitest/node_modules/strip-final-newline": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", - "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "node_modules/webpack-sources": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.7.0.tgz", + "integrity": "sha512-PdUhbCycwEgiS1hB/FBDksWKg/ashAIuJKqwdbPn8/dFVgU5LxQiBvG0js6VRRIzPujMrStYCczywp82P0KWng==", "dev": true, + "license": "MIT", "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/walker": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", - "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", - "dev": true, - "dependencies": { - "makeerror": "1.0.12" + "node": ">=10.13.0" } }, - "node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", - "dev": true - }, "node_modules/well-known-symbols": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/well-known-symbols/-/well-known-symbols-2.0.0.tgz", @@ -8013,6 +9831,7 @@ "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", "dev": true, + "license": "MIT", "dependencies": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" @@ -8034,59 +9853,108 @@ } }, "node_modules/why-is-node-running": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz", - "integrity": "sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-3.2.1.tgz", + "integrity": "sha512-Tb2FUhB4vUsGQlfSquQLYkApkuPAFQXGFzxWKHHumVz2dK+X1RUm/HnID4+TfIGYJ1kTcwOaCk/buYCEJr6YjQ==", "dev": true, - "dependencies": { - "siginfo": "^2.0.0", - "stackback": "0.0.2" - }, + "license": "MIT", "bin": { "why-is-node-running": "cli.js" }, "engines": { - "node": ">=8" + "node": ">=20.11" + } + }, + "node_modules/wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/workerpool": { + "version": "10.0.3", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-10.0.3.tgz", + "integrity": "sha512-6z2Iis68Wqth93/G/wJP9u+R3O+d2XTlgWChGCwuT1qLbBsOYueGRZuJ++v3mtDP5KjYdy+WzvWC+VWETSVXJA==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/wide-align": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", - "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, + "license": "MIT", "dependencies": { - "string-width": "^1.0.2 || 2 || 3 || 4" + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/wide-align/node_modules/ansi-regex": { + "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, - "node_modules/wide-align/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "node_modules/wide-align/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/wide-align/node_modules/string-width": { + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/wrap-ansi-cjs/node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, + "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -8096,11 +9964,12 @@ "node": ">=8" } }, - "node_modules/wide-align/node_modules/strip-ansi": { + "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, + "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -8108,34 +9977,12 @@ "node": ">=8" } }, - "node_modules/workerpool": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", - "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==", - "dev": true - }, - "node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, "node_modules/wrap-ansi/node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -8145,6 +9992,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -8159,22 +10007,15 @@ "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "node_modules/wrap-ansi/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, - "engines": { - "node": ">=8" - } + "license": "MIT" }, "node_modules/wrap-ansi/node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, + "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -8189,6 +10030,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, + "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -8196,23 +10038,18 @@ "node": ">=8" } }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true - }, "node_modules/write-file-atomic": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-5.0.1.tgz", - "integrity": "sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-6.0.0.tgz", + "integrity": "sha512-GmqrO8WJ1NuzJ2DrziEI2o57jKAVIQNf8a18W3nCYU3H7PNWqCCVTeH6/NQE93CIllIgQS98rrmVkYgTX9fFJQ==", "dev": true, + "license": "ISC", "dependencies": { "imurmurhash": "^0.1.4", "signal-exit": "^4.0.1" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/write-file-atomic/node_modules/signal-exit": { @@ -8220,6 +10057,7 @@ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", "dev": true, + "license": "ISC", "engines": { "node": ">=14" }, @@ -8232,21 +10070,24 @@ "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "dev": true, + "license": "ISC", "engines": { "node": ">=10" } }, "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "license": "ISC" }, "node_modules/yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "version": "17.7.3", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.3.tgz", + "integrity": "sha512-GZtjxm/J/4TSxuL3FNYjCmLktBTnIw/rVmKSIyKeYAZpmJB2ig9VauCC5xsa82GNKVKDAqpOn3KVzNt0zmrU0g==", "dev": true, + "license": "MIT", "dependencies": { "cliui": "^8.0.1", "escalade": "^3.1.1", @@ -8269,26 +10110,12 @@ "node": ">=12" } }, - "node_modules/yargs-unparser": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", - "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", - "dev": true, - "dependencies": { - "camelcase": "^6.0.0", - "decamelize": "^4.0.0", - "flat": "^5.0.2", - "is-plain-obj": "^2.1.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/yargs/node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -8297,22 +10124,15 @@ "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "node_modules/yargs/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, - "engines": { - "node": ">=8" - } + "license": "MIT" }, "node_modules/yargs/node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, + "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -8327,6 +10147,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, + "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -8339,6 +10160,7 @@ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, diff --git a/compatibility-checks/package.json b/compatibility-checks/package.json index b611b98..8d0b9d5 100644 --- a/compatibility-checks/package.json +++ b/compatibility-checks/package.json @@ -1,7 +1,8 @@ { "name": "substitute-compatibility-checks", "version": "0.0.0", - "description": "Checks compatibility of @fluffy-spoon/substitute with various test runners.", + "private": true, + "description": "Checks compatibility of the packed @fluffy-spoon/substitute build with various test runners.", "license": "MIT", "funding": { "type": "opencollective", @@ -12,29 +13,40 @@ "url": "https://github.com/ffMathy/FluffySpoon.JavaScript.Testing.Faking.git" }, "engines": { - "node": ">=20" + "node": ">=22.12" }, "scripts": { + "install:local": "node scripts/install-local-build.js", "validate:ava": "ava test-runners/ava/**.ts", "validate:jest": "jest test-runners/jest/**.ts", + "validate:jest-matchers": "jest test-runners/jest-matchers/**.ts", "validate:mocha": "mocha --require tsx/cjs test-runners/mocha/**.ts", "validate:nodejs": "node --require tsx/cjs --test ./test-runners/nodejs/*.ts", "validate:vitest": "vitest run ./test-runners/vitest/*.ts", - "test": "node --require tsx/cjs --test test/**" + "validate:vitest-inline": "vitest run --config vitest.inline.config.mts ./test-runners/vitest-inline/index.spec.ts", + "pretest": "npm run install:local", + "test": "node --require tsx/cjs --test test/index.ts test/bundlers.ts" }, "devDependencies": { - "@types/mocha": "^10.0.6", - "@types/node": "^20.11.25", + "@jest/globals": "^30.5.2", + "@rollup/plugin-commonjs": "^29.0.3", + "@rollup/plugin-node-resolve": "^16.0.3", + "@types/mocha": "^10.0.10", + "@types/node": "^22.20.5", "ansi-regex": "^6.0.1", - "ava": "^6.1.2", - "jest": "^29.7.0", - "mocha": "^10.3.0", - "ts-jest": "^29.1.2", - "tsx": "^4.7.1", - "typescript": "^5.4.2", - "vitest": "^1.3.1" + "ava": "^6.4.1", + "esbuild": "^0.28.2", + "jest": "^30.5.2", + "mocha": "^12.0.3", + "rollup": "^4.68.4", + "ts-jest": "^29.4.15", + "tsx": "^4.23.15", + "typescript": "^5.9.3", + "vite": "^8.3.8", + "vitest": "^5.1.0", + "webpack": "^5.112.2" }, "volta": { - "node": "20.11.1" + "node": "24.22.3" } -} \ No newline at end of file +} diff --git a/compatibility-checks/scripts/install-local-build.js b/compatibility-checks/scripts/install-local-build.js new file mode 100644 index 0000000..ee4bb17 --- /dev/null +++ b/compatibility-checks/scripts/install-local-build.js @@ -0,0 +1,39 @@ +'use strict' +// Packs the repository root exactly like `npm publish` does (its prepack script builds dist/) and installs +// the tarball into this project, so the compatibility checks run against what would be published, not +// against ../src. Runs automatically before `npm test` (the pretest script). +// +// The tarball is installed with --no-save, so package.json and package-lock.json here stay untouched. + +const { execFileSync } = require('child_process') +const fs = require('fs') +const os = require('os') +const path = require('path') + +const here = path.resolve(__dirname, '..') +const root = path.resolve(here, '..') +const isWindows = process.platform === 'win32' +const npm = isWindows ? 'npm.cmd' : 'npm' + +const destination = fs.mkdtempSync(path.join(os.tmpdir(), 'substitute-compatibility-')) +try { + const output = execFileSync(npm, ['pack', '--json', '--silent', '--pack-destination', destination], { + cwd: root, + encoding: 'utf8', + stdio: ['ignore', 'pipe', 'inherit'], + shell: isWindows + }) + const [{ filename }] = JSON.parse(output.slice(output.indexOf('['))) + const tarball = path.join(destination, filename) + // Remove a previously installed build, so that npm never keeps a stale copy. + fs.rmSync(path.join(here, 'node_modules', '@fluffy-spoon', 'substitute'), { recursive: true, force: true }) + execFileSync(npm, ['install', '--no-save', '--no-audit', '--no-fund', tarball], { + cwd: here, + stdio: 'inherit', + shell: isWindows + }) + const installed = require(path.join(here, 'node_modules', '@fluffy-spoon', 'substitute', 'package.json')) + console.log(`Installed ${installed.name}@${installed.version} from ${filename}`) +} finally { + fs.rmSync(destination, { recursive: true, force: true }) +} diff --git a/compatibility-checks/test-runners/_common/index.ts b/compatibility-checks/test-runners/_common/index.ts index 3eadf2d..deec9d3 100644 --- a/compatibility-checks/test-runners/_common/index.ts +++ b/compatibility-checks/test-runners/_common/index.ts @@ -1,4 +1,4 @@ -import Substitute from '../../../src' +import Substitute from '@fluffy-spoon/substitute' interface Library { subSection: AmbiguousSection @@ -15,7 +15,11 @@ export const ambiguousPropertyTypeAssertion = () => { lib.subSection().returns('subSection as method') lib.subSection.returns({ subMethod: () => 'subSection as property' } as AmbiguousSection) + // Three calls, then a property-style assertion with a finite count that a method assertion could still + // satisfy. The member is never invoked afterwards, so the failure can only be reported on a microtask (E6), + // after the test function has returned. Every test runner must still report it as a failure. + lib.subSection() + lib.subSection() lib.subSection() - lib.subSection.subMethod() lib.received(2).subSection } diff --git a/compatibility-checks/test-runners/ava/index.ts b/compatibility-checks/test-runners/ava/index.ts index e29ce02..14eb19f 100644 --- a/compatibility-checks/test-runners/ava/index.ts +++ b/compatibility-checks/test-runners/ava/index.ts @@ -1,6 +1,21 @@ import test from 'ava' import { ambiguousPropertyTypeAssertion } from '../_common' +const delay = (milliseconds: number) => new Promise(resolve => setTimeout(resolve, milliseconds)) + +// R4-ADV-3 (E12): ava runs the tests of a file concurrently. The tests around the failing one, which finish later, and +// the test in later.ts, which runs in a worker of its own, show what ava does with a failure that is reported after +// the test returned (see test/index.ts). +test('passes before the failing test', async t => { + await delay(20) + t.pass() +}) + test('can substitute callable interfaces', () => { ambiguousPropertyTypeAssertion() }) + +test('passes after the failing test', async t => { + await delay(50) + t.pass() +}) diff --git a/compatibility-checks/test-runners/ava/later.ts b/compatibility-checks/test-runners/ava/later.ts new file mode 100644 index 0000000..07c7bbe --- /dev/null +++ b/compatibility-checks/test-runners/ava/later.ts @@ -0,0 +1,6 @@ +import test from 'ava' + +// R4-ADV-3 (E12): a file of its own, which ava runs in another worker (see test/index.ts). +test('runs in another file', t => { + t.pass() +}) diff --git a/compatibility-checks/test-runners/jest-matchers/index.spec.ts b/compatibility-checks/test-runners/jest-matchers/index.spec.ts new file mode 100644 index 0000000..71c17bd --- /dev/null +++ b/compatibility-checks/test-runners/jest-matchers/index.spec.ts @@ -0,0 +1,103 @@ +import { describe, expect, jest, test } from '@jest/globals' +import Substitute from '@fluffy-spoon/substitute' + +// P28 (ENG2-7): jest treats any value whose `asymmetricMatch` member is a function as an asymmetric matcher (like +// expect.any()) and asks it whether it matches. An unconfigured member of a substitute is an auto-substitute, which is +// a function that returns a truthy value, so every comparison with a substitute "matched": a non-matching +// toHaveBeenCalledWith(substitute) passed, and toEqual(substitute) threw an internal matcher error. A substitute must +// compare like any other value: by identity. +// +// Unlike the other runners, this suite is expected to pass. test/index.ts runs it with `npm run validate:jest-matchers`. + +interface Logger { + info(message: string): void +} + +/** Runs a jest assertion that must fail, and returns its error. */ +const failureOf = (assertion: () => void): Error => { + try { + assertion() + } catch (error) { + return error as Error + } + throw new Error('The assertion passed, but it should have failed: jest treated the substitute as a matcher.') +} + +/** jest's own assertion error (JestAssertionError with pass: false), not an internal error of a matcher. */ +const expectAssertionFailure = (error: Error, matcherName: string) => { + expect(error.message).not.toMatch(/Unexpected return from a matcher function/) + expect(error.message).toContain(matcherName) + expect((error as Error & { matcherResult?: { pass: boolean } }).matcherResult).toEqual(expect.objectContaining({ pass: false })) +} + +describe('P28 jest matchers compare a substitute by identity', () => { + test('a non-matching expect(fn).toHaveBeenCalledWith(substitute) fails', () => { + const logger = Substitute.for() + const fn = jest.fn() + fn('unrelated') + expectAssertionFailure(failureOf(() => expect(fn).toHaveBeenCalledWith(logger)), 'toHaveBeenCalledWith') + }) + + test('expect(42).toEqual(substitute) fails with a normal assertion error', () => { + const logger = Substitute.for() + expectAssertionFailure(failureOf(() => expect(42).toEqual(logger)), 'toEqual') + }) + + test('a non-matching toContainEqual(substitute) and toEqual between two substitutes fail', () => { + const logger = Substitute.for() + const otherLogger = Substitute.for() + expectAssertionFailure(failureOf(() => expect([1, 2]).toContainEqual(logger)), 'toContainEqual') + expectAssertionFailure(failureOf(() => expect({ logger: 'oops' }).toEqual({ logger })), 'toEqual') + expectAssertionFailure(failureOf(() => expect(otherLogger).toEqual(logger)), 'toEqual') + }) + + test('the same substitute still matches', () => { + const logger = Substitute.for() + const fn = jest.fn() + fn(logger) + expect(fn).toHaveBeenCalledWith(logger) + expect(logger).toEqual(logger) + expect({ logger }).toEqual({ logger }) + expect([1, logger]).toContainEqual(logger) + }) +}) + +// Round 7 (E24-E26): printing, freezing and the `in` operator of substitutes, as jest's matchers and pretty-format see +// them. jest's equality and pretty-format never use `in` on a function, and pretty-format prints a function as +// `[Function ]`, so a substitute shows the path of its `name` member. +describe('R7 jest matchers and pretty-format with printing, frozen substitutes and the in operator', () => { + test('E24 a substitute in a failure message is shown by its path, without the old internal label', () => { + const app = Substitute.for<{ logger: Logger }>() + const message = failureOf(() => expect(app.logger).toBe(42)).message + expect(message).toContain('[Function @Substitute.logger.name]') + expect(message).not.toContain('property<') + }) + + test('E25 a frozen substitute still compares by identity and is printed', () => { + const logger = Object.freeze(Substitute.for()) + const other = Substitute.for() + expect(Object.isFrozen(logger)).toBe(true) + expect(logger).toEqual(logger) + expect({ logger }).toEqual({ logger }) + expectAssertionFailure(failureOf(() => expect(logger).toEqual(other)), 'toEqual') + const fn = jest.fn() + fn(logger) + expect(fn).toHaveBeenCalledWith(logger) + expectAssertionFailure(failureOf(() => expect(fn).toHaveBeenCalledWith(other)), 'toHaveBeenCalledWith') + }) + + test('E26 configured members are in the substitute, and the matchers behave as before', () => { + const settings = Substitute.for<{ level: number, flush(): void }>() + settings.level.returns(3) + expect('level' in settings).toBe(true) + expect('other' in settings).toBe(false) + expect(settings).toHaveProperty('level', 3) + expect(jest.isMockFunction(settings)).toBe(false) + const fn = jest.fn() + fn(settings) + expect(fn).toHaveBeenCalledWith(settings) + expectAssertionFailure(failureOf(() => expect(fn).toHaveBeenCalledWith(Substitute.for())), 'toHaveBeenCalledWith') + jest.clearAllMocks() + expect(settings.level).toBe(3) + }) +}) diff --git a/compatibility-checks/test-runners/jest/index.spec.ts b/compatibility-checks/test-runners/jest/index.spec.ts index 6ddcfea..ac1ca87 100644 --- a/compatibility-checks/test-runners/jest/index.spec.ts +++ b/compatibility-checks/test-runners/jest/index.spec.ts @@ -1,5 +1,16 @@ +import { expect, test } from '@jest/globals' import { ambiguousPropertyTypeAssertion } from '../_common' +// R3-ADV-5 (E6): the tests around the failing one must still run and be reported, so that a crash of the jest +// process (which loses them) cannot pass for the failure of one test. +test('passes before the failing test', () => { + expect(1).toBe(1) +}) + test('can substitute callable interfaces', () => { ambiguousPropertyTypeAssertion() }) + +test('passes after the failing test', () => { + expect(1).toBe(1) +}) diff --git a/compatibility-checks/test-runners/mocha/index.ts b/compatibility-checks/test-runners/mocha/index.ts index 022935c..ac2fc45 100644 --- a/compatibility-checks/test-runners/mocha/index.ts +++ b/compatibility-checks/test-runners/mocha/index.ts @@ -1,6 +1,12 @@ import { test } from 'mocha' import { ambiguousPropertyTypeAssertion } from '../_common' +// R4-ADV-3 (E12): the tests around the failing one, and the test in later.ts, show what mocha does with a failure +// that is reported after the test returned (see test/index.ts). +test('passes before the failing test', () => { }) + test('can substitute callable interfaces', () => { ambiguousPropertyTypeAssertion() }) + +test('passes after the failing test', () => { }) diff --git a/compatibility-checks/test-runners/mocha/later.ts b/compatibility-checks/test-runners/mocha/later.ts new file mode 100644 index 0000000..64d6a33 --- /dev/null +++ b/compatibility-checks/test-runners/mocha/later.ts @@ -0,0 +1,7 @@ +import { test } from 'mocha' + +// R4-ADV-3 (E12): a file that mocha loads after index.ts (see test/index.ts). mocha loads every file before it runs +// the tests, so this line is printed whether or not the test below runs. +console.log('mocha loaded later.ts') + +test('runs in a later file', () => { }) diff --git a/compatibility-checks/test-runners/nodejs/index.ts b/compatibility-checks/test-runners/nodejs/index.ts index 14f7f6b..50409b1 100644 --- a/compatibility-checks/test-runners/nodejs/index.ts +++ b/compatibility-checks/test-runners/nodejs/index.ts @@ -1,6 +1,13 @@ import * as test from 'node:test' import { ambiguousPropertyTypeAssertion } from '../_common' +// R4-ADV-3 (E12): the tests around the failing one must still run and be reported (see test/index.ts). +test.test('passes before the failing test', () => { }) + test.test('can substitute callable interfaces', () => { ambiguousPropertyTypeAssertion() }) + +test.test('passes after the failing test', async () => { + await new Promise(resolve => setTimeout(resolve, 20)) +}) diff --git a/compatibility-checks/test-runners/vitest-inline/exports.test.ts b/compatibility-checks/test-runners/vitest-inline/exports.test.ts new file mode 100644 index 0000000..9743df3 --- /dev/null +++ b/compatibility-checks/test-runners/vitest-inline/exports.test.ts @@ -0,0 +1,25 @@ +import { createRequire } from 'node:module' +import { expect, test } from 'vitest' +import Substitute, { Arg, Substitute as NamedSubstitute, SubstituteException, received } from '@fluffy-spoon/substitute' +import * as namespace from '@fluffy-spoon/substitute' + +// F1: run by test/bundlers.ts with vitest.inline.config.mts, and expected to pass. +const exportNames = Object.keys(createRequire(__filename)('@fluffy-spoon/substitute')).sort() + +test('F1 default, named and namespace imports are the real exports when vitest inlines the package', () => { + expect(typeof Substitute.for).toBe('function') + expect(Substitute).toBe(NamedSubstitute) + expect(typeof Arg.any).toBe('function') + expect(typeof received).toBe('symbol') + expect(typeof SubstituteException).toBe('function') + expect(Object.keys(namespace).sort()).toEqual(exportNames) + expect(Object.keys(namespace).filter(name => (namespace as Record)[name] === undefined)).toEqual([]) +}) + +test('F1 the inlined package works', () => { + const calculator = Substitute.for<{ add(a: number, b: number): number }>() + calculator.add(1, Arg.any()).returns(3) + expect(calculator.add(1, 2)).toBe(3) + calculator[received](1).add(1, 2) + expect(() => calculator.received(2).add(1, 2)).toThrow(SubstituteException) +}) diff --git a/compatibility-checks/test-runners/vitest-inline/index.spec.ts b/compatibility-checks/test-runners/vitest-inline/index.spec.ts new file mode 100644 index 0000000..17bac6c --- /dev/null +++ b/compatibility-checks/test-runners/vitest-inline/index.spec.ts @@ -0,0 +1,7 @@ +import { test } from 'vitest' +import { ambiguousPropertyTypeAssertion } from '../_common' + +// The shared scenario, with the package inlined by vitest (vitest.inline.config.mts). +test('can substitute callable interfaces', () => { + ambiguousPropertyTypeAssertion() +}) diff --git a/compatibility-checks/test-runners/vitest-matchers/index.spec.ts b/compatibility-checks/test-runners/vitest-matchers/index.spec.ts new file mode 100644 index 0000000..9e419d7 --- /dev/null +++ b/compatibility-checks/test-runners/vitest-matchers/index.spec.ts @@ -0,0 +1,68 @@ +import { describe, expect, test, vi } from 'vitest' +import { inspect } from 'util' +import { Substitute, configure } from '@fluffy-spoon/substitute' + +// Round 7 (E24-E27): printing, freezing, the `in` operator and the __esModule probe of substitutes, as vitest's +// matchers, its pretty-format and util.inspect see them. Unlike test-runners/vitest, this suite is expected to pass; +// test/index.ts runs it. + +interface Logger { + info(message: string): void +} + +/** Runs a vitest assertion that must fail, and returns its error. */ +const failureOf = (assertion: () => void): Error => { + try { + assertion() + } catch (error) { + return error as Error + } + throw new Error('The assertion passed, but it should have failed.') +} + +describe('R7 vitest matchers with substitutes', () => { + test('E24 a substitute is printed by its path in failure messages and by util.inspect', () => { + const app = Substitute.for<{ logger: Logger }>() + app.logger.info('started') + expect(inspect(app.logger)).toBe("@Substitute.logger {\n received:\n info('started')\n}") + // (printing the value for the message reads members such as `name` and `constructor`, which are recorded) + const message = failureOf(() => expect(app.logger).toBe(42)).message + expect(message).toContain('@Substitute.logger') + expect(message).not.toContain('property<') + }) + + test('E25 a frozen substitute still compares by identity', () => { + const logger = Object.freeze(Substitute.for()) + const other = Substitute.for() + expect(Object.isFrozen(logger)).toBe(true) + expect(logger).toEqual(logger) + expect({ logger }).toStrictEqual({ logger }) + expect(failureOf(() => expect(logger).toEqual(other)).message).toContain('expected') + const fn = vi.fn() + fn(logger) + expect(fn).toHaveBeenCalledWith(logger) + failureOf(() => expect(fn).toHaveBeenCalledWith(other)) + }) + + test('E26 configured members are in the substitute, and the matchers behave as before', () => { + const settings = Substitute.for<{ level: number }>() + settings.level.returns(3) + expect('level' in settings).toBe(true) + expect('other' in settings).toBe(false) + expect(settings).toHaveProperty('level', 3) + expect(vi.isMockFunction(settings)).toBe(false) + const fn = vi.fn() + fn(settings) + expect(fn).toHaveBeenCalledWith(settings) + failureOf(() => expect(fn).toHaveBeenCalledWith(Substitute.for())) + }) + + test('E27 a substitute is its own default export under the module interop', () => { + const mailer = Substitute.for<{ send(to: string): boolean }>() + mailer.send('a@b.c').returns(true) + expect((mailer as any).__esModule).toBeUndefined() + const configured = Substitute.for() + configured[configure]().__esModule.returns(true) + expect(configured.__esModule).toBe(true) + }) +}) diff --git a/compatibility-checks/test-runners/vitest/index.spec.ts b/compatibility-checks/test-runners/vitest/index.spec.ts index c81ebe4..cbe7b53 100644 --- a/compatibility-checks/test-runners/vitest/index.spec.ts +++ b/compatibility-checks/test-runners/vitest/index.spec.ts @@ -1,6 +1,13 @@ import { test } from 'vitest' import { ambiguousPropertyTypeAssertion } from '../_common' +// R4-ADV-3 (E12): the tests around the failing one must still run and be reported (see test/index.ts). +test('passes before the failing test', () => { }) + test('can substitute callable interfaces', () => { ambiguousPropertyTypeAssertion() }) + +test('passes after the failing test', async () => { + await new Promise(resolve => setTimeout(resolve, 20)) +}) diff --git a/compatibility-checks/test/bundlers.ts b/compatibility-checks/test/bundlers.ts new file mode 100644 index 0000000..fc32452 --- /dev/null +++ b/compatibility-checks/test/bundlers.ts @@ -0,0 +1,405 @@ +// F1: the package's ES module entry (dist/index.mjs) wraps its CommonJS build. Bundlers and test runners that +// transform the package themselves turn that CommonJS build into an ES module in different ways (the __esModule +// interop), and once got only undefined exports. These checks bundle bundlers/entry.mjs with each of them, run the +// bundle with Node.js and check that the default, named and namespace imports are the real exports. +// +// P2 (P29): CommonJS code that require()s the package (bundlers/require-helper.cjs), bundled with Rollup's commonjs +// plugin while the package stays external. With default options the plugin turns that require() into a default +// import, which Node.js resolves to the ES module entry, whose default export is the Substitute class, so require() +// gets the class instead of the exports object. README "Importing" and MIGRATION "Imports and packaging" document +// this and its workarounds; the checks below make sure each documented workaround works and the caveat is still real. +// +// PK4-1 (P33): ES module code bundled into CommonJS output while the package stays external (Rollup format 'cjs', +// Vite SSR builds with CommonJS output, esbuild format 'cjs', webpack with a commonjs external). The bundle require()s +// the package at run time and turns the default import into module.exports, the exports object, as Node.js does for +// CommonJS (Rollup with its default output.interop for any source; esbuild, webpack and Rolldown for .mjs sources and +// sources in a "type": "module" package). README "Importing" and MIGRATION "Imports and packaging" recommend the named +// import there; the checks below make sure it works with each of them, that Rollup's output.interop: 'auto' fixes the +// default import, and that the caveat itself is still real. +// +// Like test/index.ts, they run against the packed package that `npm run install:local` installed. +import * as test from 'node:test' +import * as assert from 'node:assert' +import { execFile } from 'node:child_process' +import * as fs from 'node:fs' +import { builtinModules } from 'node:module' +import * as os from 'node:os' +import * as path from 'node:path' +import commonjs from '@rollup/plugin-commonjs' +import { nodeResolve } from '@rollup/plugin-node-resolve' +import * as esbuild from 'esbuild' +import { rollup } from 'rollup' +import webpack from 'webpack' +import { testRunnerEnvironment } from './environment' + +const here = path.resolve(__dirname, '..') +const entry = path.join(here, 'bundlers', 'entry.mjs') +const requireEntry = path.join(here, 'bundlers', 'require-entry.mjs') +const namedEntry = path.join(here, 'bundlers', 'named-entry.mjs') +const packageName = '@fluffy-spoon/substitute' +const exportNames = Object.keys(require(packageName)).sort() +const nodeBuiltins = [...builtinModules, ...builtinModules.map(name => `node:${name}`)] + +const run = (command: string, args: string[], cwd: string) => new Promise<{ status: number, output: string }>(resolve => { + execFile(command, args, { cwd, encoding: 'utf8', env: testRunnerEnvironment() }, (error, stdout, stderr) => { + resolve({ status: error ? (typeof error.code === 'number' ? error.code : 1) : 0, output: stdout + stderr }) + }) +}) + +type Bundler = { + name: string + /** Bundles `entry` into `outDir` and returns the path of the bundle. */ + bundle: (outDir: string) => Promise +} + +/** Bundles `input` with Rollup into an ES module file. Node.js built-ins and `external` stay external. */ +const rollupBundle = async (input: string, file: string, plugins: Parameters[0]['plugins'], external: string[] = []) => { + const build = await rollup({ + input, + external: [...nodeBuiltins, ...external], + onwarn: warning => { throw new Error(`rollup warning: ${warning.message}`) }, + plugins + }) + await build.write({ file, format: 'es' }) + await build.close() + return file +} + +/** Bundles `input` with Rollup into a CommonJS file (output.format 'cjs'), with the package and Node.js built-ins external. */ +const rollupCommonJsBundle = async (input: string, file: string, interop?: 'auto') => { + const build = await rollup({ + input, + external: [...nodeBuiltins, packageName], + onwarn: warning => { throw new Error(`rollup warning: ${warning.message}`) } + }) + await build.write({ file, format: 'cjs', ...(interop === undefined ? {} : { interop }) }) + await build.close() + return file +} + +/** Bundles `input` with webpack for Node.js into `outDir`/`filename`, with the given `externals`. */ +const webpackBundle = (input: string, outDir: string, filename: string, externals?: Record) => new Promise((resolve, reject) => { + webpack({ + mode: 'none', + target: 'node', + context: here, + entry: input, + ...(externals === undefined ? {} : { externals }), + output: { path: outDir, filename } + }, (error, stats) => { + if (error) return reject(error) + if (stats === undefined || stats.hasErrors() || stats.hasWarnings()) { + return reject(new Error(`webpack: ${stats && stats.toString('errors-warnings')}`)) + } + resolve(path.join(outDir, filename)) + }) +}) + +/** + * Runs a Vite SSR build of `input` into `outDir` with the given `ssr` options and returns the path of the bundle. + * `output` goes to build.rolldownOptions.output (Vite 8 and newer) or build.rollupOptions.output (older Vite). + */ +const viteSsrBundle = async (input: string, outDir: string, ssr?: object, output?: object) => { + const { build, version } = await import('vite') + const bundlerOptions = output === undefined ? {} : Number(version.split('.')[0]) >= 8 ? { rolldownOptions: { output } } : { rollupOptions: { output } } + await build({ + configFile: false, + root: here, + logLevel: 'silent', + ...(ssr === undefined ? {} : { ssr }), + build: { ssr: input, outDir, emptyOutDir: false, write: true, ...bundlerOptions } + }) + const name = path.basename(input, path.extname(input)) + const [file] = fs.readdirSync(outDir).filter(file => [`${name}.js`, `${name}.mjs`, `${name}.cjs`].includes(file)) + assert.ok(file, `vite wrote ${fs.readdirSync(outDir).join(', ')}`) + return path.join(outDir, file) +} + +const bundlers: Bundler[] = [ + { + name: 'rollup with @rollup/plugin-commonjs', + bundle: outDir => rollupBundle(entry, path.join(outDir, 'rollup.mjs'), [nodeResolve({ preferBuiltins: true }), commonjs()]) + }, + { + name: 'webpack', + bundle: outDir => webpackBundle(entry, outDir, 'webpack.cjs') + }, + { + name: 'esbuild (CommonJS output)', + bundle: async outDir => { + const outfile = path.join(outDir, 'esbuild.cjs') + await esbuild.build({ entryPoints: [entry], bundle: true, platform: 'node', format: 'cjs', outfile, logLevel: 'silent' }) + return outfile + } + }, + { + name: 'esbuild (ES module output)', + bundle: async outDir => { + const outfile = path.join(outDir, 'esbuild.mjs') + await esbuild.build({ + entryPoints: [entry], + bundle: true, + platform: 'node', + format: 'esm', + outfile, + logLevel: 'silent', + // esbuild's ES module output cannot require() Node.js built-ins (the library requires 'util') without this. + banner: { js: "import { createRequire } from 'module'; const require = createRequire(import.meta.url);" } + }) + return outfile + } + }, + { + name: 'Vite SSR build with ssr.noExternal', + bundle: outDir => viteSsrBundle(entry, outDir, { noExternal: true }) + } +] + +test.describe('F1 bundled ES module imports are the real exports', () => { + const outDirs: string[] = [] + test.after(() => { + for (const outDir of outDirs) fs.rmSync(outDir, { recursive: true, force: true }) + }) + + for (const bundler of bundlers) { + test.it(`F1 ${bundler.name}: default, named and namespace imports are the real exports`, async () => { + const outDir = fs.mkdtempSync(path.join(os.tmpdir(), 'substitute-bundle-')) + outDirs.push(outDir) + const bundle = await bundler.bundle(outDir) + const result = await run(process.execPath, [bundle], outDir) + assert.strictEqual(result.status, 0, result.output) + const report = JSON.parse(result.output.trim().split('\n').pop() as string) + assert.deepStrictEqual(report, { + defaultImport: 'function', + defaultIsNamedSubstitute: true, + namespaceDefaultIsSubstitute: true, + arg: 'object', + received: 'symbol', + substituteException: 'function', + namespaceKeys: exportNames, + undefinedNamespaceValues: [], + returns: 3, + failingAssertion: 'SubstituteException' + }, `${bundler.name}: ${result.output}`) + }) + } + + const vitestInline = [ + { id: 'F1', name: 'vitest with server.deps.inline', config: 'vitest.inline.config.mts' }, + // PK4-2: vitest then gives the package's ES module entry a default import without the named exports, and a + // namespace whose default is not the Substitute class. + { id: 'PK4-2', name: 'vitest with server.deps.inline and deps.interopDefault: false', config: 'vitest.inline-no-interop-default.config.mts' } + ] + for (const { id, name, config } of vitestInline) { + test.it(`${id} ${name}: default, named and namespace imports are the real exports`, async () => { + const vitestPackage = require.resolve('vitest/package.json', { paths: [here] }) + const vitest = path.join(path.dirname(vitestPackage), require(vitestPackage).bin.vitest) + const result = await run(process.execPath, [ + vitest, 'run', '--config', config, 'test-runners/vitest-inline/exports.test.ts' + ], here) + assert.strictEqual(result.status, 0, result.output) + assert.match(result.output, /Tests\s+2 passed/, result.output) + }) + } +}) + +// P2 (P29): bundles of bundlers/require-entry.mjs, which imports CommonJS code that require()s the package. +// A bundle that keeps the package external imports it at run time, so it is written below node_modules/ here, +// where Node.js finds the installed package. `fix` names the documented workaround that each bundle uses, and +// `external` says whether the package stays external (checked in the bundle, so a check cannot pass by accident). +type RequireBundler = Bundler & { fix: string, external: boolean } + +const requireBundlers: RequireBundler[] = [ + { + name: 'rollup with @rollup/plugin-commonjs and the package external', + fix: 'commonjs({ esmExternals: true })', + external: true, + bundle: outDir => rollupBundle(requireEntry, path.join(outDir, 'rollup-esm-externals.mjs'), [commonjs({ esmExternals: true })], [packageName]) + }, + { + name: 'rollup with @rollup/plugin-commonjs and the package external', + fix: `commonjs({ esmExternals: ['${packageName}'] })`, + external: true, + bundle: outDir => rollupBundle(requireEntry, path.join(outDir, 'rollup-esm-externals-list.mjs'), [commonjs({ esmExternals: [packageName] })], [packageName]) + }, + { + name: 'rollup with @rollup/plugin-commonjs', + fix: 'the package bundled (@rollup/plugin-node-resolve, not external)', + external: false, + bundle: outDir => rollupBundle(requireEntry, path.join(outDir, 'rollup-bundled.mjs'), [nodeResolve({ preferBuiltins: true }), commonjs()]) + }, + { + name: 'Vite SSR build', + fix: `ssr.noExternal: ['${packageName}']`, + external: false, + bundle: outDir => viteSsrBundle(requireEntry, outDir, { noExternal: [packageName] }) + }, + { + // Vite 8 bundles with Rolldown instead of Rollup and its commonjs plugin, so its default externals work. + // README and MIGRATION say that Vite 7 and older are affected; this makes sure the Vite in use here is not. + name: 'Vite SSR build (Vite 8 or newer, Rolldown)', + fix: 'the default externals', + external: true, + bundle: outDir => viteSsrBundle(requireEntry, outDir) + } +] + +/** + * Whether a bundle loads the package at run time instead of containing it: an import of it, an import() or a + * require() (Rolldown's is called `__require`). + */ +const loadsPackageAtRunTime = (bundle: string) => + /(?:\bfrom\s*|\bimport\s*\(\s*|require\s*\(\s*)(['"])@fluffy-spoon\/substitute\1/.test(fs.readFileSync(bundle, 'utf8')) + +/** Whether a bundle require()s the package at run time (CommonJS output with the package external). */ +const requiresPackageAtRunTime = (bundle: string) => + /require\s*\(\s*(['"])@fluffy-spoon\/substitute\1\s*\)/.test(fs.readFileSync(bundle, 'utf8')) + +// Bundles that keep the package external import it at run time, so they are written below node_modules/ here, +// where Node.js finds the installed package. +const bundleRoot = path.join(here, 'node_modules', '.substitute-bundles') +const makeOutDir = () => { + fs.mkdirSync(bundleRoot, { recursive: true }) + return fs.mkdtempSync(path.join(bundleRoot, 'bundle-')) +} + +/** Runs a bundle with Node.js and returns the report it prints on its last line. */ +const runBundle = async (bundle: string, cwd: string) => { + const result = await run(process.execPath, [bundle], cwd) + assert.strictEqual(result.status, 0, result.output) + return { report: JSON.parse(result.output.trim().split('\n').pop() as string), output: result.output } +} + +test.describe('P2 (P29) bundled CommonJS code that require()s the package gets the exports object with the documented settings', () => { + test.after(() => { + fs.rmSync(bundleRoot, { recursive: true, force: true }) + }) + + const runRequireBundle = async (bundler: Bundler & { external: boolean }) => { + const outDir = makeOutDir() + const bundle = await bundler.bundle(outDir) + assert.strictEqual(loadsPackageAtRunTime(bundle), bundler.external, + `${bundler.name}: the package is ${bundler.external ? 'external' : 'bundled'}`) + return runBundle(bundle, outDir) + } + + for (const bundler of requireBundlers) { + test.it(`P2 ${bundler.name}, with ${bundler.fix}: require() gives the exports object`, async () => { + const { report, output } = await runRequireBundle(bundler) + assert.deepStrictEqual(report, { + requireIsSubstituteClass: false, + exportKeys: exportNames, + undefinedExportValues: [], + substitute: 'function', + defaultIsSubstitute: true, + arg: 'object', + received: 'symbol', + substituteException: 'function', + returns: 3, + failingAssertion: 'SubstituteException' + }, `${bundler.name}, with ${bundler.fix}: ${output}`) + }) + } + + // The caveat itself. If this fails because require() now gives the exports object, the tools changed: update + // the caveat in README "Importing" and MIGRATION "Imports and packaging", and then this check. + test.it('P2 rollup with @rollup/plugin-commonjs (default options) and the package external: require() gives the Substitute class (the documented caveat)', async () => { + const { report, output } = await runRequireBundle({ + name: 'rollup with @rollup/plugin-commonjs (default options) and the package external', + external: true, + bundle: outDir => rollupBundle(requireEntry, path.join(outDir, 'rollup-default.mjs'), [commonjs()], [packageName]) + }) + assert.strictEqual(report.requireIsSubstituteClass, true, `require() gives the Substitute class: ${output}`) + assert.deepStrictEqual(report.exportKeys, [], output) + assert.strictEqual(report.substitute, 'undefined', output) + assert.strictEqual(report.arg, 'undefined', output) + }) +}) + +// PK4-1 (P33): ES module code bundled into CommonJS output with the package external. `bundle` builds `input` into +// `outDir` and returns the path of the bundle; each of them must require() the package at run time. +type CommonJsOutputBundler = { name: string, bundle: (input: string, outDir: string) => Promise } + +const commonJsOutputBundlers: CommonJsOutputBundler[] = [ + { + name: "rollup, output.format 'cjs'", + bundle: (input, outDir) => rollupCommonJsBundle(input, path.join(outDir, 'rollup.cjs')) + }, + { + name: "esbuild, format 'cjs' and packages: 'external'", + bundle: async (input, outDir) => { + const outfile = path.join(outDir, 'esbuild.cjs') + await esbuild.build({ entryPoints: [input], bundle: true, platform: 'node', format: 'cjs', packages: 'external', outfile, logLevel: 'silent' }) + return outfile + } + }, + { + name: "webpack, target 'node' and a commonjs external", + bundle: (input, outDir) => webpackBundle(input, outDir, 'webpack.cjs', { [packageName]: `commonjs ${packageName}` }) + }, + { + // Vite 8 bundles with Rolldown, older Vite with Rollup; both keep dependencies external in SSR builds. + name: "Vite SSR build with output.format 'cjs' (default externals)", + bundle: (input, outDir) => viteSsrBundle(input, outDir, undefined, { format: 'cjs', entryFileNames: '[name].cjs' }) + } +] + +test.describe('PK4-1 (P33) CommonJS output with the package external: the named import works, the default import is the exports object', () => { + test.after(() => { + fs.rmSync(bundleRoot, { recursive: true, force: true }) + }) + + const buildAndRun = async (bundler: CommonJsOutputBundler, input: string) => { + const outDir = makeOutDir() + const bundle = await bundler.bundle(input, outDir) + assert.ok(requiresPackageAtRunTime(bundle), `${bundler.name}: the bundle require()s the package at run time`) + return runBundle(bundle, outDir) + } + + for (const bundler of commonJsOutputBundlers) { + test.it(`PK4-1 ${bundler.name}, package external: the named import { Substitute, Arg } works`, async () => { + const { report, output } = await buildAndRun(bundler, namedEntry) + assert.deepStrictEqual(report, { + substitute: 'function', + substituteFor: 'function', + arg: 'object', + received: 'symbol', + substituteException: 'function', + returns: 3, + failingAssertion: 'SubstituteException' + }, `${bundler.name}: ${output}`) + }) + } + + // The documented fix for Rollup (and for Vite 7 and older, through build.rollupOptions.output.interop). + test.it("PK4-1 rollup, output.format 'cjs' with output.interop: 'auto', package external: the default import is the Substitute class", async () => { + const { report, output } = await buildAndRun({ + name: "rollup, output.format 'cjs', output.interop 'auto'", + bundle: (input, outDir) => rollupCommonJsBundle(input, path.join(outDir, 'rollup-interop-auto.cjs'), 'auto') + }, entry) + assert.deepStrictEqual(report, { + defaultImport: 'function', + defaultIsNamedSubstitute: true, + namespaceDefaultIsSubstitute: true, + arg: 'object', + received: 'symbol', + substituteException: 'function', + namespaceKeys: exportNames, + undefinedNamespaceValues: [], + returns: 3, + failingAssertion: 'SubstituteException' + }, output) + }) + + // The caveat itself, for bundlers/entry.mjs (an .mjs source). If one of these fails because the default import is + // now the Substitute class, the tool changed: update README "Importing" and MIGRATION "Imports and packaging", + // and then this check. + for (const bundler of commonJsOutputBundlers) { + test.it(`PK4-1 ${bundler.name}, package external: the default import of an .mjs source is the exports object (the documented caveat)`, async () => { + const { report, output } = await buildAndRun(bundler, entry) + assert.strictEqual(report.defaultImport, 'object', `the default import is module.exports: ${output}`) + assert.strictEqual(report.defaultIsNamedSubstitute, false, output) + assert.strictEqual(report.returns, 3, `the named import still works: ${output}`) + }) + } +}) diff --git a/compatibility-checks/test/environment.d.ts b/compatibility-checks/test/environment.d.ts new file mode 100644 index 0000000..70cad13 --- /dev/null +++ b/compatibility-checks/test/environment.d.ts @@ -0,0 +1,2 @@ +/** The environment the compatibility checks start each test runner with (see environment.js). */ +export declare const testRunnerEnvironment: (base?: Record) => Record diff --git a/compatibility-checks/test/environment.js b/compatibility-checks/test/environment.js new file mode 100644 index 0000000..227be6e --- /dev/null +++ b/compatibility-checks/test/environment.js @@ -0,0 +1,22 @@ +'use strict' +// The environment the compatibility checks start each test runner with. +// +// `node --test` sets NODE_TEST_CONTEXT in every process it runs. A nested `node --test` (the node:test +// compatibility check) that inherits it believes it is a child of the outer runner: it reports its results +// to the parent instead and exits with code 0 even when its own test failed. So every NODE_TEST_* variable +// is removed. Colours are disabled so that the output can be searched for plain text. + +/** + * @param {Record} [base] + * @returns {Record} + */ +const testRunnerEnvironment = (base = process.env) => { + const environment = { ...base, CI: '1', NO_COLOR: '1' } + delete environment.FORCE_COLOR + for (const name of Object.keys(environment)) { + if (name.startsWith('NODE_TEST_')) delete environment[name] + } + return environment +} + +module.exports = { testRunnerEnvironment } diff --git a/compatibility-checks/test/index.ts b/compatibility-checks/test/index.ts index afaa9ff..e79acad 100644 --- a/compatibility-checks/test/index.ts +++ b/compatibility-checks/test/index.ts @@ -1,18 +1,104 @@ import * as test from 'node:test' import * as assert from 'node:assert' import { execSync } from 'node:child_process' +import { readFileSync } from 'node:fs' +import * as path from 'node:path' +import { testRunnerEnvironment } from './environment' type TestRunner = { name: string - failureAcknowledgementText: string + /** + * One of these must appear in the runner's output. The shared scenario fails with a SubstituteException that is + * thrown on a microtask after the test returned (E6), which each runner reports in its own way. + */ + failureAcknowledgementTexts: string[] failureLocationText: string + /** E4: the "called at" lines of the message point at the TypeScript source (the runner applies source maps). */ + mapsCallSites?: boolean + /** Further checks of the runner's output. */ + verify?: (output: string) => void +} + +const nodeMajorVersion = Number(process.versions.node.split('.')[0]) + +/** The lines of the shared scenario that call the substitute, as the "called at" lines must name them. */ +const scenarioCallLines = readFileSync(path.join(__dirname, '../test-runners/_common/index.ts'), 'utf8') + .split('\n') + .flatMap((line, index) => line.trim() === 'lib.subSection()' ? [index + 1] : []) + +/** + * R3-ADV-5 (E6): jest must report the failure as the failure of the test, and run and report the other tests of the + * file. When a deferred report was thrown from process.nextTick, jest crashed instead: Node.js printed the exception as + * fatal and no summary followed (in band), or the file failed after the worker retries; that must fail this check. + * jest 30 finds the running test through AsyncLocalStorage, whose store Node.js 22 loses for an exception thrown from + * a microtask. On Node.js 22 jest 30 therefore reports the failure for the file ("Test suite failed to run"), and the + * other tests of the file still run and pass. + */ +const verifyJest = (output: string) => { + assert.ok(!/^Node\.js v\d/m.test(output), `The jest process crashed: ${output}`) + const testFailure = output.includes('● can substitute callable interfaces') && /Tests:\s+1 failed, 2 passed, 3 total/.test(output) + const fileFailure = output.includes('● Test suite failed to run') && /Tests:\s+3 passed, 3 total/.test(output) + // the "Tests:" summary counts the other two tests of the file, which passed + assert.ok( + testFailure || (nodeMajorVersion < 24 && fileFailure), + `jest did not report the failure of the test "can substitute callable interfaces" next to the 2 passing tests: ${output}` + ) +} + +/* + * R4-ADV-3 (E12): what each runner does with the tests around a failure that is reported after the test returned + * (on a microtask, E6). The fixtures have passing tests before and after the failing one (and mocha and ava a second + * file), and these checks pin what really happens, so that the README stays true when a runner changes. + */ + +/** + * mocha marks a synchronous test as passed when it returns. The later failure is reported as a second result of that + * test ("1) can substitute callable interfaces", "Uncaught SubstituteException"), and mocha then aborts the run: the + * remaining tests do not run, in the same file or in later files. No scheduling of the report can change this, as the + * test has passed before any callback runs. + */ +const verifyMocha = (output: string) => { + assert.ok(output.includes('✔ passes before the failing test'), `mocha did not report the test before the failing one: ${output}`) + assert.ok(output.includes('1) can substitute callable interfaces') && output.includes('Uncaught SubstituteException'), + `mocha did not report the failure of the test as uncaught: ${output}`) + assert.ok(/2 passing/.test(output) && /1 failing/.test(output), `mocha's summary changed: ${output}`) + assert.ok(output.includes('mocha loaded later.ts'), `mocha did not load the later file: ${output}`) + assert.ok(!output.includes('passes after the failing test') && !output.includes('runs in a later file'), + `mocha now runs the tests after the failure: update README "Assertions that fail later" and this check: ${output}`) +} + +/** + * ava runs each file in a worker of its own, and the tests of a file concurrently. The failure is an uncaught exception + * in the worker, which ends it: the failing test is reported as passed, then "Uncaught exception in " and + * " exited with a non-zero exit code"; the tests of that file that had not finished are not reported at all. + * Other files are not affected. + */ +const verifyAva = (output: string) => { + assert.ok(output.includes('later › runs in another file'), `ava did not report the test of the other file: ${output}`) + assert.ok(output.includes('index › can substitute callable interfaces'), `ava did not report the failing test: ${output}`) + assert.ok(output.includes('Uncaught exception in test-runners/ava/index.ts') && + output.includes('test-runners/ava/index.ts exited with a non-zero exit code'), `ava did not report the uncaught exception: ${output}`) + assert.ok(!output.includes('passes before the failing test') && !output.includes('passes after the failing test'), + `ava now reports the unfinished tests of the file: update README "Assertions that fail later" and this check: ${output}`) +} + +/** vitest runs and reports every test (as passed), and reports the failure as an unhandled error of the last test. */ +const verifyVitest = (output: string) => { + assert.ok(/Tests\s+3 passed \(3\)/.test(output) && /Errors\s+1 error/.test(output), `vitest's summary changed: ${output}`) + assert.ok(output.includes('The last test to run before this error was "can substitute callable interfaces"'), + `vitest did not name the test: ${output}`) +} + +/** node:test runs and reports every test (as passed), and fails the file with the error. */ +const verifyNodeTest = (output: string) => { + assert.ok(/pass 3/.test(output) && output.includes('passes after the failing test'), `node:test did not run every test: ${output}`) + assert.ok(output.includes('generated asynchronous activity after the test ended'), `node:test did not report the error: ${output}`) } test.describe('Verifies test runner compatibility', () => { const failingExec = (command: string): string => { - const { FORCE_COLOR, ...environment } = { ...process.env, CI: '1', NO_COLOR: '1' } as Partial> try { - execSync(command, { env: environment, stdio: 'pipe' }) + execSync(command, { env: testRunnerEnvironment(), stdio: 'pipe' }) assert.fail('Execution should have failed with a non-zero exit code. We expect the test runner have 1 failing test.') } catch (error) { if (error instanceof assert.AssertionError) throw error @@ -22,29 +108,73 @@ test.describe('Verifies test runner compatibility', () => { } const testRunners: TestRunner[] = [ - { name: 'ava', failureAcknowledgementText: '1 uncaught exception', failureLocationText: 'test-runners/ava/index.ts' }, - { name: 'jest', failureAcknowledgementText: '', failureLocationText: 'test-runners/jest/index.spec.ts' }, - { name: 'mocha', failureAcknowledgementText: '1 failing', failureLocationText: 'can substitute callable interfaces:' }, - { name: 'nodejs', failureAcknowledgementText: 'fail 1', failureLocationText: 'test-runners/nodejs/index.ts' }, - { name: 'vitest', failureAcknowledgementText: '1 error', failureLocationText: 'error originated in "test-runners/vitest/index.spec.ts" test file' } + { name: 'ava', failureAcknowledgementTexts: ['1 uncaught exception', '1 test failed'], failureLocationText: 'test-runners/ava/index.ts', verify: verifyAva }, + { + name: 'jest', + failureAcknowledgementTexts: ['Tests:'], + failureLocationText: 'test-runners/jest/index.spec.ts', + mapsCallSites: true, + verify: verifyJest + }, + { name: 'mocha', failureAcknowledgementTexts: ['1 failing'], failureLocationText: 'can substitute callable interfaces:', verify: verifyMocha }, + // G:CI-2: this check used to pass vacuously or fail, because the nested `node --test` inherited NODE_TEST_CONTEXT. + { name: 'nodejs', failureAcknowledgementTexts: ['fail 1'], failureLocationText: 'test-runners/nodejs/index.ts', verify: verifyNodeTest }, + { name: 'vitest', failureAcknowledgementTexts: ['1 error', '1 failed'], failureLocationText: 'test-runners/vitest/index.spec.ts', mapsCallSites: true, verify: verifyVitest }, + // F1: vitest with the package inlined (vitest.inline.config.mts), so that Vite, not Node.js, loads its ES module entry. + { name: 'vitest-inline', failureAcknowledgementTexts: ['1 error', '1 failed'], failureLocationText: 'test-runners/vitest-inline/index.spec.ts', mapsCallSites: true } ] + // P28 (ENG2-7): jest's matchers must compare a substitute like any other value. Unlike the runs above, this suite + // (test-runners/jest-matchers) must pass. + test.describe('jest matchers', () => { + test.it('P28 a non-matching toHaveBeenCalledWith(substitute) and toEqual(substitute) fail with normal assertion errors', () => { + try { + execSync('npm run validate:jest-matchers', { env: testRunnerEnvironment(), stdio: 'pipe' }) + } catch (error) { + // @ts-expect-error + assert.fail(`The jest matcher checks failed:\n${error.stdout.toString()}${error.stderr.toString()}`) + } + }) + }) + + // Round 7 (E24-E27): vitest's matchers, its pretty-format and util.inspect with printed, frozen and `in`-probed + // substitutes (test-runners/vitest-matchers). This suite must pass as well. + test.describe('vitest matchers', () => { + test.it('R7 substitutes print by their paths, can be frozen, answer `in`, and compare by identity', () => { + try { + execSync('npx vitest run ./test-runners/vitest-matchers/index.spec.ts', { env: testRunnerEnvironment(), stdio: 'pipe' }) + } catch (error) { + // @ts-expect-error + assert.fail(`The vitest matcher checks failed:\n${error.stdout.toString()}${error.stderr.toString()}`) + } + }) + }) + testRunners.forEach(testRunner => { test.describe(testRunner.name, () => { - test.it('reports the uncaught Substitute exception', () => { + test.it('reports the Substitute exception', () => { const result = failingExec(`npm run validate:${testRunner.name}`) assert.ok( - result.includes(testRunner.failureAcknowledgementText), - `Could not find the expected failure acknowledgement in the output. Expected "${testRunner.failureAcknowledgementText}"` + testRunner.failureAcknowledgementTexts.some(text => result.includes(text)), + `Could not find the expected failure acknowledgement in the output. Expected one of ${JSON.stringify(testRunner.failureAcknowledgementTexts)}: ${result}` ) assert.ok( result.includes(testRunner.failureLocationText), - `Could not find the expected failure location in the output. Expected "${testRunner.failureLocationText}"` + `Could not find the expected failure location in the output. Expected "${testRunner.failureLocationText}": ${result}` ) assert.ok( - result.includes('SubstituteException: Call count mismatch'), + result.includes('SubstituteException') && result.includes('Call count mismatch'), `Could not find the expected exception message in the output: ${result}` ) + // R3-ADV-5: a test runner that crashes does not report the failure of a test + assert.ok(!/^Node\.js v\d/m.test(result), `The test runner process crashed: ${result}`) + if (testRunner.mapsCallSites) { + // R3-ADV-3 (E4): source maps apply to the "called at" lines (they once showed the compiled position) + assert.equal(scenarioCallLines.length, 3) + for (const line of scenarioCallLines) + assert.ok(result.includes(`_common/index.ts:${line}:`), `No "called at" line names test-runners/_common/index.ts:${line}: ${result}`) + } + testRunner.verify?.(result) }) }) }) diff --git a/compatibility-checks/vitest.inline-no-interop-default.config.mts b/compatibility-checks/vitest.inline-no-interop-default.config.mts new file mode 100644 index 0000000..6c43379 --- /dev/null +++ b/compatibility-checks/vitest.inline-no-interop-default.config.mts @@ -0,0 +1,18 @@ +import { defineConfig } from 'vitest/config' + +// PK4-2: like vitest.inline.config.mts (the package inlined), plus `deps.interopDefault: false`. vitest then hands the +// package's ES module entry an object with only some of the exports as the default import of its CommonJS build, and +// the named exports through the namespace, whose default is that object instead of the Substitute class. The entry +// once rejected that namespace and threw at import time. Used by test/bundlers.ts. +export default defineConfig({ + test: { + server: { + deps: { + inline: ['@fluffy-spoon/substitute'] + } + }, + deps: { + interopDefault: false + } + } +}) diff --git a/compatibility-checks/vitest.inline.config.mts b/compatibility-checks/vitest.inline.config.mts new file mode 100644 index 0000000..2232847 --- /dev/null +++ b/compatibility-checks/vitest.inline.config.mts @@ -0,0 +1,15 @@ +import { defineConfig } from 'vitest/config' + +// F1: with inlined dependencies, vitest transforms @fluffy-spoon/substitute itself instead of letting Node.js load it. +// Vite then applies the __esModule interop to the CommonJS build that the package's ES module entry wraps, which +// once made every export of the package undefined. `server.deps.inline: true` and `ssr.noExternal` behave the same. +// Used by `npm run validate:vitest-inline` and by test/bundlers.ts. +export default defineConfig({ + test: { + server: { + deps: { + inline: ['@fluffy-spoon/substitute'] + } + } + } +}) diff --git a/package-lock.json b/package-lock.json index 2efcbf7..f62046e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@fluffy-spoon/substitute", - "version": "2.0.0-beta.4", + "version": "2.0.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@fluffy-spoon/substitute", - "version": "2.0.0-beta.4", + "version": "2.0.1", "license": "MIT", "devDependencies": { "@ava/typescript": "^3.0.1", diff --git a/package.json b/package.json index f03b6ba..d353fdd 100644 --- a/package.json +++ b/package.json @@ -19,14 +19,22 @@ ], "repository": { "type": "git", - "url": "https://github.com/ffMathy/FluffySpoon.JavaScript.Testing.Faking.git" + "url": "git+https://github.com/ffMathy/FluffySpoon.JavaScript.Testing.Faking.git" }, + "homepage": "https://github.com/ffMathy/FluffySpoon.JavaScript.Testing.Faking#readme", "keywords": [ - "NSubstitute", + "typescript", + "mock", "mocking", + "stub", + "fake", + "faking", + "substitute", + "nsubstitute", "test", "testing", - "faking" + "unit-testing", + "tdd" ], "bugs": { "url": "https://github.com/ffMathy/FluffySpoon.JavaScript.Testing.Faking/issues" @@ -34,14 +42,43 @@ "engines": { "node": ">=10" }, - "main": "dist/index.js", - "typings": "./dist/index.d.ts", + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "exports": { + ".": [ + { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "default": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + }, + "./dist/index.js" + ], + "./package.json": "./package.json", + "./dist/*.js": "./dist/*.js", + "./dist/*.mjs": "./dist/*.mjs", + "./dist/*": "./dist/*.js" + }, "files": [ "dist/**/*" ], + "publishConfig": { + "access": "public", + "registry": "https://registry.npmjs.org/" + }, "scripts": { - "build": "rm -rf dist && tsc", - "test": "npm run build -- -p spec && ava" + "build": "rm -rf dist && tsc && node packaging/build-esm.js", + "build:spec": "rm -rf dist-spec && tsc -p spec --outDir dist-spec", + "prepack": "npm run build", + "test": "npm run build:spec && ava", + "test:types": "tsc -p spec-types && tsc -p spec-types/loose", + "test:types:min-ts": "npm run build && node spec-types/min-ts/check.js", + "test:docs": "npm run build && node spec-docs/check.js && node spec-docs/self-test.js", + "test:compat": "npm --prefix compatibility-checks test" }, "devDependencies": { "@ava/typescript": "^3.0.1", @@ -52,6 +89,6 @@ "typescript": "^5.9.2" }, "volta": { - "node": "18.19.1" + "node": "24.22.3" } } diff --git a/packaging/build-esm.js b/packaging/build-esm.js new file mode 100644 index 0000000..e403749 --- /dev/null +++ b/packaging/build-esm.js @@ -0,0 +1,98 @@ +'use strict' +// Generates the native ES module entry point next to the CommonJS build: +// dist/index.mjs - re-exports every export of dist/index.js, plus the default export +// dist/index.d.mts - the matching typings for TypeScript's node16/nodenext/bundler resolution +// +// The ES module entry wraps the CommonJS build instead of being a second copy of the library, so +// CommonJS and ES module consumers share one module instance. The named exports are read from the +// CommonJS build at build time, so the wrapper never needs to be kept in sync by hand. Explicit +// `export const` bindings (instead of `export * from './index.js'`) also work on Node versions that +// cannot detect the named exports of a CommonJS module. +// +// The wrapper must not depend on how the importer turns a CommonJS module into an ES module (F1, PK4-2). +// dist/index.js sets `__esModule` and `exports.default`, and tools disagree about what `import cjs from './index.js'` +// and `import * as cjs from './index.js'` then are: +// - Node.js, webpack, esbuild and Rolldown (Vite 8 builds) give module.exports as the default import, which has +// every export; +// - Rollup's commonjs plugin, Vite SSR and vitest with inlined dependencies (server.deps.inline, ssr.noExternal) +// apply the __esModule interop and give exports.default, the Substitute class, as the default import. Their +// namespace import (`import * as`) has the named exports instead; +// - vitest with inlined dependencies and `deps.interopDefault: false` gives an object without the named exports +// as the default import, and the named exports plus that object (not the Substitute class) as the namespace. +// So the wrapper imports both views and uses whichever one holds every named export with the type it has at build +// time. The default export takes no part in that decision: the wrapper's own default export is the named export +// that dist/index.js exports as its default (the Substitute class), found here at build time. If neither view is +// complete, the wrapper fails loudly at import time (instead of exporting undefined values). +// +// Runs as part of `npm run build`, after tsc. + +const fs = require('fs') +const path = require('path') + +const dist = path.resolve(__dirname, '..', 'dist') +const entry = path.join(dist, 'index.js') +const cjs = require(entry) + +if (!Object.prototype.hasOwnProperty.call(cjs, 'default')) { + throw new Error(`${entry} has no default export`) +} + +const identifier = /^[A-Za-z_$][\w$]*$/ +const names = Object.keys(cjs).filter(name => name !== 'default').sort() +for (const name of names) { + if (!identifier.test(name)) throw new Error(`Cannot re-export ${JSON.stringify(name)} from an ES module`) +} + +// The default export of dist/index.js is also one of its named exports (`export default Substitute`). The typings +// re-export it under that name, so that `import Substitute from '@fluffy-spoon/substitute'` is the Substitute class +// for TypeScript, too, and the ES module entry exports that named export as its default. +const defaultName = names.find(name => cjs[name] === cjs.default) +if (defaultName === undefined) { + throw new Error(`The default export of ${entry} is not also a named export; cannot type it in index.d.mts`) +} +if (typeof cjs[defaultName] !== 'function') { + throw new Error(`The default export of ${entry} (${defaultName}) is not a function`) +} + +// The type of every named export, which a complete view of dist/index.js must reproduce (PK4-2). +const exportTypes = {} +for (const name of names) { + if (cjs[name] === undefined) throw new Error(`The export ${name} of ${entry} is undefined`) + exportTypes[name] = typeof cjs[name] +} + +const header = '// Generated by packaging/build-esm.js during `npm run build`. Do not edit.' +const packageJson = JSON.parse(fs.readFileSync(path.resolve(__dirname, '..', 'package.json'), 'utf8')) +const bugsUrl = packageJson.bugs && packageJson.bugs.url +if (typeof bugsUrl !== 'string') throw new Error('package.json has no bugs.url') +const interopFailure = `${packageJson.name}: the ES module entry could not read the exports of its CommonJS build (dist/index.js). ` + + `Please report this at ${bugsUrl} and name the bundler or test runner you use. As a workaround, load the package with require().` + +const mjs = [ + header, + "import cjsDefault, * as cjsNamespace from './index.js';", + '', + '// The type of every named export of dist/index.js, read at build time.', + `const exportTypes = ${JSON.stringify(exportTypes)};`, + '// A view of dist/index.js is complete when it holds every named export. Its own default export does not matter:', + '// some tools hand over a namespace whose default is not the Substitute class. See packaging/build-esm.js.', + 'const isCompleteExports = value => value != null && Object.keys(exportTypes).every(name => typeof value[name] === exportTypes[name]);', + '// Node.js and most bundlers give module.exports as the default import; tools that apply the __esModule interop', + '// give exports.default (or another object) instead, and the named exports through the namespace.', + 'const cjs = isCompleteExports(cjsDefault) ? cjsDefault : isCompleteExports(cjsNamespace) ? cjsNamespace : undefined;', + `if (cjs === undefined) throw new Error(${JSON.stringify(interopFailure)});`, + '', + ...names.map(name => `export const ${name} = cjs.${name};`), + `export default cjs.${defaultName};`, + '' +].join('\n') + +const dmts = [ + header, + "export * from './index.js';", + `export { ${defaultName} as default } from './index.js';`, + '' +].join('\n') + +fs.writeFileSync(path.join(dist, 'index.mjs'), mjs) +fs.writeFileSync(path.join(dist, 'index.d.mts'), dmts) diff --git a/packaging/dist-tag.js b/packaging/dist-tag.js new file mode 100644 index 0000000..9ba4ca5 --- /dev/null +++ b/packaging/dist-tag.js @@ -0,0 +1,32 @@ +'use strict' +// Prints the npm dist-tag for a release, and fails when the release tag does not match the package version. +// +// node packaging/dist-tag.js +// +// - A stable version (2.0.1) published from a normal release is tagged `latest`. +// - A semver prerelease version (2.1.0-beta.1, 3.0.0-rc.1) or a GitHub release marked as prerelease is tagged `beta`, +// so `npm install @fluffy-spoon/substitute` never picks it up by accident. +// Used by .github/workflows/npm-publish.yml. + +const [tag, version, prerelease] = process.argv.slice(2) + +const fail = message => { + console.error(message) + process.exit(1) +} + +if (!tag || !version || !['true', 'false'].includes(prerelease)) { + fail('usage: node packaging/dist-tag.js ') +} + +const semver = /^\d+\.\d+\.\d+(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?$/ +const parsed = semver.exec(version) +if (parsed === null) fail(`package.json version ${version} is not a valid semver version`) + +const tagVersion = tag.replace(/^v/, '') +if (tagVersion !== version) { + fail(`The release tag ${tag} does not match the package.json version ${version}. Bump the version (npm version ) or fix the tag.`) +} + +const isPrerelease = prerelease === 'true' || parsed[1] !== undefined +console.log(isPrerelease ? 'beta' : 'latest') diff --git a/packaging/helpers.js b/packaging/helpers.js new file mode 100644 index 0000000..9c1b54b --- /dev/null +++ b/packaging/helpers.js @@ -0,0 +1,130 @@ +'use strict' +const { execFileSync } = require('child_process') +const fs = require('fs') +const os = require('os') +const path = require('path') + +const root = path.resolve(__dirname, '..') +const npm = process.platform === 'win32' ? 'npm.cmd' : 'npm' + +const temporaryDirectories = [] +/** Creates a temporary directory that removeTemporaryDirectories() deletes again. */ +const makeTemporaryDirectory = prefix => { + const directory = fs.mkdtempSync(path.join(os.tmpdir(), `substitute-${prefix}-`)) + temporaryDirectories.push(directory) + return directory +} +const removeTemporaryDirectories = () => { + for (const directory of temporaryDirectories.splice(0)) fs.rmSync(directory, { recursive: true, force: true }) +} + +const readText = file => fs.readFileSync(path.join(root, file), 'utf8') +const readJson = file => JSON.parse(readText(file)) + +/** The environment for child processes, without what would make them behave like a child of a test runner. */ +const childEnvironment = () => { + const environment = { ...process.env } + for (const name of Object.keys(environment)) { + if (name.startsWith('NODE_TEST_') || name.startsWith('AVA_')) delete environment[name] + } + return environment +} + +/** + * Copies the working tree of the repository (as it is on disk, uncommitted changes included) into `destination` + * and returns it. Left out: build output (dist/, dist-spec/), .git, other directories whose name starts with a + * dot, packed tarballs and every node_modules/. The copy's node_modules/ is a link to the repository's, so that + * its scripts find the same tools. PK4-4: the packaging checks pack such a copy, so they never touch the + * working tree's dist/. + */ +const copyRepository = destination => { + const skippedAtRoot = name => name === 'dist' || name === 'dist-spec' || name === '.git' || /\.tgz$/.test(name) + const copy = (from, to, atRoot) => { + fs.mkdirSync(to, { recursive: true }) + for (const entry of fs.readdirSync(from, { withFileTypes: true })) { + if (entry.name === 'node_modules') continue + if (atRoot && (skippedAtRoot(entry.name) || (entry.isDirectory() && entry.name.startsWith('.')))) continue + const source = path.join(from, entry.name) + const target = path.join(to, entry.name) + if (entry.isDirectory()) copy(source, target, false) + else if (entry.isSymbolicLink()) fs.symlinkSync(fs.readlinkSync(source), target) + else if (entry.isFile()) fs.copyFileSync(source, target) + } + } + copy(root, destination, true) + fs.symlinkSync(path.join(root, 'node_modules'), path.join(destination, 'node_modules'), process.platform === 'win32' ? 'junction' : 'dir') + return destination +} + +/** + * A snapshot of every file below `directory` (path, size and modification time), or null if it does not exist. + * Two snapshots are equal only if nothing in the directory was written, removed or added in between. + */ +const snapshotDirectory = directory => { + if (!fs.existsSync(directory)) return null + const files = {} + const walk = (current, relative) => { + for (const entry of fs.readdirSync(current, { withFileTypes: true })) { + const file = path.join(current, entry.name) + const name = relative === '' ? entry.name : `${relative}/${entry.name}` + if (entry.isDirectory()) { + files[`${name}/`] = 'directory' + walk(file, name) + } else { + const stat = fs.lstatSync(file) + files[name] = `${stat.size} bytes, modified ${stat.mtimeMs}` + } + } + } + walk(directory, '') + return files +} + +/** + * Packs the repository (or the copy of it in `cwd`) exactly like `npm publish` does (lifecycle scripts + * included) and returns the tarball path and the list of files in it. + */ +const pack = (destination, cwd = root) => { + const output = execFileSync(npm, ['pack', '--json', '--silent', '--pack-destination', destination], { + cwd, + encoding: 'utf8', + env: childEnvironment(), + shell: process.platform === 'win32' + }) + const [result] = JSON.parse(output.slice(output.indexOf('['))) + return { + tarball: path.join(destination, result.filename), + files: result.files.map(file => file.path).sort() + } +} + +/** Creates an empty consumer project with the tarball extracted as node_modules/@fluffy-spoon/substitute. */ +const createConsumer = tarball => { + const consumer = makeTemporaryDirectory('consumer') + const target = path.join(consumer, 'node_modules', '@fluffy-spoon', 'substitute') + fs.mkdirSync(target, { recursive: true }) + execFileSync('tar', ['-xzf', tarball, '-C', target, '--strip-components=1']) + fs.writeFileSync(path.join(consumer, 'package.json'), JSON.stringify({ name: 'consumer', private: true })) + return consumer +} + +const runNode = (cwd, args) => execFileSync(process.execPath, args, { + cwd, + encoding: 'utf8', + env: childEnvironment(), + stdio: 'pipe' +}) + +module.exports = { + root, + readText, + readJson, + copyRepository, + snapshotDirectory, + pack, + createConsumer, + runNode, + childEnvironment, + makeTemporaryDirectory, + removeTemporaryDirectories +} diff --git a/packaging/package.test.js b/packaging/package.test.js new file mode 100644 index 0000000..7b4e29b --- /dev/null +++ b/packaging/package.test.js @@ -0,0 +1,500 @@ +'use strict' +// Packaging, release and CI checks. These run as part of `npm test` (see ava.config.js). +// They pack the repository the way `npm publish` does and use the tarball from a fresh consumer project. +const test = require('ava') +const { execFile, spawnSync } = require('child_process') +const fs = require('fs') +const path = require('path') + +const { + root, readText, readJson, copyRepository, snapshotDirectory, pack, createConsumer, runNode, childEnvironment, + makeTemporaryDirectory, removeTemporaryDirectories +} = require('./helpers') + +const packageJson = readJson('package.json') +const ciWorkflow = readText('.github/workflows/nodejs.yml') +const publishWorkflow = readText('.github/workflows/npm-publish.yml') +const minutes = n => n * 60 * 1000 + +/** Runs a command without blocking, so that slow checks run concurrently. */ +const run = (command, args, cwd) => new Promise(resolve => { + execFile(command, args, { cwd, encoding: 'utf8', env: childEnvironment() }, (error, stdout, stderr) => { + resolve({ status: error ? (typeof error.code === 'number' ? error.code : 1) : 0, output: stdout + stderr }) + }) +}) + +const state = {} + +test.before('pack a copy of the repository like npm publish does', t => { + t.timeout(minutes(5)) + // PK4-4: everything below happens in a temporary copy of the working tree, so `npm test` never writes into the + // working tree's dist/ (an interrupted run once left no dist/ at all). + state.distBefore = snapshotDirectory(path.join(root, 'dist')) + const copy = copyRepository(makeTemporaryDirectory('repository')) + // Start from a stale dist/ like the one `npm test` used to leave behind: spec output and no dist/index.js. + // Packing must rebuild the library from scratch. + fs.mkdirSync(path.join(copy, 'dist', 'spec'), { recursive: true }) + fs.writeFileSync(path.join(copy, 'dist', 'spec', 'Stale.spec.js'), '') + + const destination = makeTemporaryDirectory('pack') + state.packed = pack(destination, copy) + state.distAfter = snapshotDirectory(path.join(root, 'dist')) + state.consumer = createConsumer(state.packed.tarball) + for (const file of fs.readdirSync(path.join(__dirname, 'smoke'))) { + fs.copyFileSync(path.join(__dirname, 'smoke', file), path.join(state.consumer, file)) + } +}) + +test.after.always('remove temporary directories', () => { + removeTemporaryDirectories() +}) + +test('G:PK-3 npm pack rebuilds dist/ first: the tarball has the entry points and no stale or spec output', t => { + const { files } = state.packed + for (const entry of ['dist/index.js', 'dist/index.d.ts', 'dist/index.mjs', 'dist/index.d.mts', 'package.json', 'README.md', 'LICENSE']) { + t.true(files.includes(entry), `${entry} is in the tarball`) + } + t.deepEqual(files.filter(file => /(^|\/)spec(\/|$)|\.spec\.|\.test\.|dist-spec/.test(file)), [], 'no spec output in the tarball') + t.deepEqual(files.filter(file => !file.startsWith('dist/') && !['package.json', 'README.md', 'LICENSE'].includes(file)), [], 'only dist/ and the package metadata are published') + t.is(packageJson.scripts.prepack, 'npm run build', 'prepack builds the library') +}) + +test('G:PK-3 npm test compiles the specs into dist-spec/, so it never leaves dist/ unpublishable', t => { + const avaConfig = require('../ava.config.js') + t.deepEqual(avaConfig.typescript.rewritePaths, { '/': 'dist-spec/' }) + t.regex(packageJson.scripts['build:spec'], /--outDir dist-spec\b/) + t.regex(packageJson.scripts.test, /^npm run build:spec && ava\b/) + t.false(/\bnpm run build\b(?!:)/.test(packageJson.scripts.test), 'npm test does not run the library build with other options') +}) + +test('PK4-4 the packaging checks pack a temporary copy of the repository and never write into the working tree\'s dist/', t => { + // Packing (which rebuilds dist/ through prepack) and the stale dist/ it starts from happened in the copy. + t.deepEqual(state.distAfter, state.distBefore, 'dist/ of the working tree is exactly as it was before packing') + t.false(state.packed.tarball.startsWith(root + path.sep), 'the tarball is written outside the working tree') + // CONTRIBUTING.md says so, and that is now true. + const contributing = readText('CONTRIBUTING.md').replace(/\s+/g, ' ') + t.true(contributing.includes('never writes into `dist/`'), 'CONTRIBUTING.md says that npm test never writes into dist/') + t.regex(contributing, /temporary copy of the repository/, 'CONTRIBUTING.md says that the packaging checks pack a temporary copy') +}) + +test('DOCS:ESM the default import is the Substitute class under native ESM', t => { + const output = runNode(state.consumer, ['import.mjs']) + t.regex(output, /import smoke test passed/) +}) + +test('DOCS:ESM CommonJS require, deep imports and package.json still work with the exports map', t => { + t.regex(runNode(state.consumer, ['require.js']), /require smoke test passed/) + t.regex(runNode(state.consumer, ['deep-imports.js']), /deep import smoke test passed/) + t.regex(runNode(state.consumer, ['deep-imports.mjs']), /ESM deep import smoke test passed/) +}) + +// F1: tools that bundle or transform the package turn dist/index.js (CommonJS, with __esModule and exports.default) +// into an ES module in different ways. Each shape below is what one family of tools makes of it for the +// `import ... from './index.js'` in dist/index.mjs. compatibility-checks/test/bundlers.ts checks the real tools. +const commonJsViews = [ + { name: 'Node.js 12.17 to 14.12 (module.exports, no named exports)', defaultExport: 'real', namedExports: false }, + { name: 'Node.js 14.13+, webpack, esbuild and Rolldown (module.exports and the named exports)', defaultExport: 'real', namedExports: true }, + { name: 'the __esModule interop of Rollup\'s commonjs plugin, Vite SSR and vitest inlining (exports.default and the named exports)', defaultExport: 'real.default', namedExports: true } +] + +/** + * Writes a directory where dist/index.mjs imports an index.js that has the given shape. `defaultExport` is the + * source of index.js's default export; `namedExports` is false (none), true (the real ones) or 'undefined' (every + * named export present, but undefined). + */ +const simulateCommonJsView = (directory, cjsEntry, names, { defaultExport, namedExports }) => { + fs.mkdirSync(directory) + fs.writeFileSync(path.join(directory, 'package.json'), JSON.stringify({ type: 'module' })) + fs.copyFileSync(path.join(state.consumer, 'node_modules', '@fluffy-spoon', 'substitute', 'dist', 'index.mjs'), path.join(directory, 'index.mjs')) + const namedExportValue = name => namedExports === 'undefined' ? 'undefined' : `real.${name}` + fs.writeFileSync(path.join(directory, 'index.js'), [ + "import { createRequire } from 'module'", + `const real = createRequire(import.meta.url)(${JSON.stringify(cjsEntry)})`, + `export default ${defaultExport}`, + ...(namedExports ? names.filter(name => name !== 'default').map(name => `export const ${name} = ${namedExportValue(name)}`) : []), + '' + ].join('\n')) + fs.writeFileSync(path.join(directory, 'check.mjs'), [ + "import assert from 'assert'", + "import { createRequire } from 'module'", + "import Substitute, * as namespace from './index.mjs'", + `const real = createRequire(import.meta.url)(${JSON.stringify(cjsEntry)})`, + "assert.strictEqual(Substitute, real.default, 'the default import is the Substitute class')", + "assert.deepStrictEqual(Object.keys(namespace).sort(), Object.keys(real).sort(), 'the same export names')", + "for (const name of Object.keys(real)) assert.strictEqual(namespace[name], real[name], name)", + "console.log('ok')", + '' + ].join('\n')) +} + +test('F1 the ES module entry gives the real exports whichever CommonJS interop the importer applies', t => { + const cjsEntry = path.join(state.consumer, 'node_modules', '@fluffy-spoon', 'substitute', 'dist', 'index.js') + const names = Object.keys(require(cjsEntry)) + commonJsViews.forEach((view, index) => { + const directory = path.join(state.consumer, `interop-${index}`) + simulateCommonJsView(directory, cjsEntry, names, view) + const result = spawnSync(process.execPath, ['check.mjs'], { cwd: directory, encoding: 'utf8', env: childEnvironment() }) + t.is(result.status, 0, `${view.name}: ${result.stdout}${result.stderr}`) + }) + + // A view that has neither shape fails loudly at import time instead of exporting undefined values. + const unusableViews = [ + { name: 'an empty default import and no named exports', defaultExport: '{}', namedExports: false }, + { name: 'the Substitute class as the default import and undefined named exports', defaultExport: 'real.default', namedExports: 'undefined' } + ] + unusableViews.forEach((view, index) => { + const directory = path.join(state.consumer, `interop-unusable-${index}`) + simulateCommonJsView(directory, cjsEntry, names, view) + const result = spawnSync(process.execPath, ['check.mjs'], { cwd: directory, encoding: 'utf8', env: childEnvironment() }) + t.not(result.status, 0, view.name) + t.regex(result.stderr, /could not read the exports of its CommonJS build/, view.name) + }) +}) + +test('PK4-2 the ES module entry uses the named exports when the default import is an object without them (vitest server.deps.inline with deps.interopDefault: false)', t => { + const cjsEntry = path.join(state.consumer, 'node_modules', '@fluffy-spoon', 'substitute', 'dist', 'index.js') + const names = Object.keys(require(cjsEntry)) + // What vitest 3 and 5 hand dist/index.mjs with server.deps.inline and deps.interopDefault: false: the default import + // is an object with only some of the exports (SubstituteException and default), and the namespace has every named + // export plus that object as its default, not the Substitute class. + const directory = path.join(state.consumer, 'interop-vitest-inline-no-interop-default') + simulateCommonJsView(directory, cjsEntry, names, { + defaultExport: '{ SubstituteException: real.SubstituteException, default: real.default }', + namedExports: true + }) + const result = spawnSync(process.execPath, ['check.mjs'], { cwd: directory, encoding: 'utf8', env: childEnvironment() }) + t.is(result.status, 0, result.stdout + result.stderr) + t.regex(result.stdout, /^ok$/m) + + // The wrapper's default export is the class that dist/index.js exports as its default, found at build time, + // not whatever default the view it reads from has. + const wrapper = fs.readFileSync(path.join(path.dirname(cjsEntry), 'index.mjs'), 'utf8') + t.regex(wrapper, /^export default cjs\.Substitute;$/m) + t.notRegex(wrapper, /\b(?:cjs|value)\.default\b/, 'the wrapper never reads the default export of the view it uses') +}) + +test('PK4-2 the compatibility checks run vitest with the package inlined and deps.interopDefault: false', t => { + const compatibility = path.join(root, 'compatibility-checks') + const config = fs.readFileSync(path.join(compatibility, 'vitest.inline-no-interop-default.config.mts'), 'utf8') + t.regex(config, /inline:\s*\['@fluffy-spoon\/substitute'\]/) + t.regex(config, /interopDefault:\s*false/) + const bundlers = fs.readFileSync(path.join(compatibility, 'test', 'bundlers.ts'), 'utf8') + t.regex(bundlers, /'vitest\.inline-no-interop-default\.config\.mts'/, 'test/bundlers.ts runs vitest with that config') +}) + +test('F1 the compatibility checks bundle the packed package and run vitest with the package inlined', t => { + const compatibility = JSON.parse(fs.readFileSync(path.join(root, 'compatibility-checks', 'package.json'), 'utf8')) + t.regex(compatibility.scripts.test, /\btest\/bundlers\.ts\b/, 'npm test in compatibility-checks runs test/bundlers.ts') + for (const dependency of ['rollup', '@rollup/plugin-commonjs', '@rollup/plugin-node-resolve', 'webpack', 'esbuild', 'vite', 'vitest']) { + t.truthy(compatibility.devDependencies[dependency], `compatibility-checks depends on ${dependency}`) + } + const bundlers = fs.readFileSync(path.join(root, 'compatibility-checks', 'test', 'bundlers.ts'), 'utf8') + t.regex(bundlers, /commonjs\(\)/, 'a bundle is built with @rollup/plugin-commonjs') + t.regex(bundlers, /vitest\.inline\.config\.mts/, 'vitest runs with the inline config') + const inlineConfig = fs.readFileSync(path.join(root, 'compatibility-checks', 'vitest.inline.config.mts'), 'utf8') + t.regex(inlineConfig, /inline:\s*\['@fluffy-spoon\/substitute'\]/) + t.regex(compatibility.scripts['validate:vitest-inline'], /--config vitest\.inline\.config\.mts/) + t.regex(fs.readFileSync(path.join(root, 'compatibility-checks', 'test', 'index.ts'), 'utf8'), /name: 'vitest-inline'/) +}) + +test('P2 the compatibility checks bundle CommonJS code that require()s the package with each documented workaround', t => { + const compatibility = path.join(root, 'compatibility-checks') + const helper = fs.readFileSync(path.join(compatibility, 'bundlers', 'require-helper.cjs'), 'utf8') + t.regex(helper, /require\('@fluffy-spoon\/substitute'\)/, 'the fixture is CommonJS code that require()s the package') + t.regex(fs.readFileSync(path.join(compatibility, 'bundlers', 'require-entry.mjs'), 'utf8'), /from '\.\/require-helper\.cjs'/) + const bundlers = fs.readFileSync(path.join(compatibility, 'test', 'bundlers.ts'), 'utf8') + const p2 = bundlers.slice(bundlers.indexOf('const requireBundlers')) + t.true(p2.length < bundlers.length, 'test/bundlers.ts has the P2 checks') + // README "Importing" and MIGRATION "Imports and packaging" name these settings. + t.regex(p2, /commonjs\(\{ esmExternals: true \}\)/, 'commonjs({ esmExternals: true }) with the package external') + t.regex(p2, /commonjs\(\{ esmExternals: \[packageName\] \}\)/, 'commonjs({ esmExternals: [the package] }) with the package external') + t.regex(p2, /noExternal: \[packageName\]/, 'Vite with ssr.noExternal: [the package]') + t.regex(p2, /nodeResolve\(\{ preferBuiltins: true \}\), commonjs\(\)\]/, 'Rollup with the package bundled') + t.regex(p2, /documented caveat/, 'the caveat itself (default options, package external) is checked too') + t.regex(bundlers, /const packageName = '@fluffy-spoon\/substitute'/) +}) + +test('PK4-1 the compatibility checks bundle ES module code into CommonJS output with the package external and use the named import', t => { + const compatibility = path.join(root, 'compatibility-checks') + // The fixture uses only the named import, which README "Importing" recommends for this case. + const fixture = fs.readFileSync(path.join(compatibility, 'bundlers', 'named-entry.mjs'), 'utf8') + t.regex(fixture, /^import \{ Substitute, Arg\b[^}]*\} from '@fluffy-spoon\/substitute'$/m, 'named-entry.mjs uses the named import') + t.notRegex(fixture, /^import\s+(?!\{)[\w$]+/m, 'named-entry.mjs has no default import') + const bundlers = fs.readFileSync(path.join(compatibility, 'test', 'bundlers.ts'), 'utf8') + const pk41 = bundlers.slice(bundlers.indexOf('const commonJsOutputBundlers')) + t.true(pk41.length < bundlers.length, 'test/bundlers.ts has the PK4-1 checks') + // Each bundler emits CommonJS and keeps the package external; README and MIGRATION name these settings. + t.regex(pk41, /rollupCommonJsBundle\(input, /, "Rollup with output.format 'cjs'") + t.regex(bundlers, /format: 'cjs', \.\.\.\(interop === undefined/, "rollupCommonJsBundle writes output.format 'cjs'") + t.regex(pk41, /format: 'cjs', packages: 'external'/, "esbuild with format 'cjs' and packages: 'external'") + t.regex(pk41, /\[packageName\]: `commonjs \$\{packageName\}`/, 'webpack with a commonjs external') + t.regex(pk41, /viteSsrBundle\(input, outDir, undefined, \{ format: 'cjs'/, "a Vite SSR build with output.format 'cjs'") + t.regex(pk41, /requiresPackageAtRunTime\(bundle\)/, 'each bundle require()s the package at run time') + t.regex(pk41, /buildAndRun\(bundler, namedEntry\)/, 'the named import is checked with each of them') + t.regex(pk41, /rollupCommonJsBundle\(input, path\.join\([^)]*\), 'auto'\)/, "Rollup's output.interop: 'auto' workaround for the default import is checked") + t.regex(pk41, /documented caveat/, 'the caveat itself (the default import is the exports object) is checked too') +}) + +test('P28 the compatibility checks use substitutes inside jest matchers', t => { + const compatibility = JSON.parse(fs.readFileSync(path.join(root, 'compatibility-checks', 'package.json'), 'utf8')) + t.is(compatibility.scripts['validate:jest-matchers'], 'jest test-runners/jest-matchers/**.ts') + const harness = fs.readFileSync(path.join(root, 'compatibility-checks', 'test', 'index.ts'), 'utf8') + t.regex(harness, /execSync\('npm run validate:jest-matchers'/, 'test/index.ts runs the jest matcher suite and expects it to pass') + const suite = fs.readFileSync(path.join(root, 'compatibility-checks', 'test-runners', 'jest-matchers', 'index.spec.ts'), 'utf8') + t.regex(suite, /expect\(fn\)\.toHaveBeenCalledWith\(logger\)/) + t.regex(suite, /expect\(42\)\.toEqual\(logger\)/) + t.regex(suite, /Unexpected return from a matcher function/) +}) + +const typeScriptConsumer = [ + "import Substitute, { Arg, Substitute as Named } from '@fluffy-spoon/substitute'", + "import { Arg as DeepArg } from '@fluffy-spoon/substitute/dist/api/Arg'", + 'interface Calculator { add(a: number, b: number): number }', + 'const calculator = Substitute.for()', + 'calculator.add(1, Arg.any()).returns(3)', + 'const same: typeof Named = Substitute', + 'const deep: typeof Arg = DeepArg', + 'export const result: number = calculator.add(1, 2) + (same === Named ? 0 : 1) + (deep === Arg ? 0 : 1)', + '' +].join('\n') + +const typeScriptModes = [ + { name: 'nodenext (ESM)', file: 'esm.mts', options: ['--module', 'nodenext', '--moduleResolution', 'nodenext'] }, + { name: 'nodenext (CommonJS)', file: 'cjs.cts', options: ['--module', 'nodenext', '--moduleResolution', 'nodenext'] }, + { name: 'node16 (ESM)', file: 'esm.mts', options: ['--module', 'node16', '--moduleResolution', 'node16'] }, + { name: 'bundler', file: 'bundler.ts', options: ['--module', 'esnext', '--moduleResolution', 'bundler'] }, + { name: 'node10', file: 'node10.ts', options: ['--module', 'commonjs', '--moduleResolution', 'node'] } +] + +for (const mode of typeScriptModes) { + test(`DOCS:ESM TypeScript types the default import as Substitute with moduleResolution ${mode.name}`, async t => { + t.timeout(minutes(2)) + const directory = path.join(state.consumer, mode.name.replace(/\W+/g, '-')) + fs.mkdirSync(directory) + fs.writeFileSync(path.join(directory, mode.file), typeScriptConsumer) + const tsc = require.resolve('typescript/bin/tsc', { paths: [root] }) + const typeRoots = path.join(root, 'node_modules', '@types') + const result = await run(process.execPath, [ + tsc, '--noEmit', '--strict', '--skipLibCheck', '--target', 'es2019', '--typeRoots', typeRoots, '--types', 'node', + ...mode.options, mode.file + ], directory) + t.is(result.status, 0, `${mode.name}: ${result.output}`) + }) +} + +test('G:PK-4 package-lock.json has the same version as package.json', t => { + const lock = readJson('package-lock.json') + t.is(lock.version, packageJson.version) + t.is(lock.packages[''].version, packageJson.version) +}) + +const normalizeVersion = version => { + const parts = version.split('.') + while (parts.length < 3) parts.push('0') + return parts.join('.') +} + +test('G:PK-2 engines.node is the minimum Node version that CI smoke-tests the packed package on', t => { + const engines = /^>=\s*(\d+(?:\.\d+){0,2})$/.exec(packageJson.engines.node) + t.truthy(engines, `engines.node is a plain lower bound: ${packageJson.engines.node}`) + const minimum = /MINIMUM_NODE_VERSION:\s*['"]?(\d+\.\d+\.\d+)['"]?/.exec(ciWorkflow) + t.truthy(minimum, 'nodejs.yml defines MINIMUM_NODE_VERSION') + t.is(normalizeVersion(engines[1]), minimum[1], 'engines.node matches the version CI tests') + t.regex(ciWorkflow, /node-version:\s*\$\{\{\s*env\.MINIMUM_NODE_VERSION\s*\}\}/, 'a CI job runs on MINIMUM_NODE_VERSION') + t.regex(ciWorkflow, /node\s+require\.js/, 'that job runs the CommonJS smoke test') +}) + +test('F2 exports["."] falls back to the CommonJS entry for Node.js versions without conditional exports (13.0, 13.1)', t => { + const entry = packageJson.exports['.'] + t.true(Array.isArray(entry), 'exports["."] is a fallback array') + t.is(entry.length, 2) + const [conditions, fallback] = entry + t.deepEqual(conditions, { + import: { types: './dist/index.d.mts', default: './dist/index.mjs' }, + default: { types: './dist/index.d.ts', default: './dist/index.js' } + }, 'the conditions come first, so every Node.js version and tool that understands them uses them') + t.is(fallback, packageJson.main, 'the fallback is the CommonJS entry') + t.is(packageJson.engines.node, '>=10', 'engines.node stays >=10') + + // The packed package resolves like before on this Node.js version. + const resolved = runNode(state.consumer, ['-p', "require.resolve('@fluffy-spoon/substitute')"]).trim() + t.is(resolved, path.join(state.consumer, 'node_modules', '@fluffy-spoon', 'substitute', 'dist', 'index.js')) + + // CI smoke-tests the fallback on Node.js 13.0.0, and the ES module entry on 13.7.0, the oldest 13.x it supports. + t.regex(ciWorkflow, /EXPORTS_FALLBACK_NODE_VERSION:\s*'13\.0\.0'/) + t.regex(ciWorkflow, /MINIMUM_ESM_NODE_13_VERSION:\s*'13\.7\.0'/) + t.regex(ciWorkflow, /node-version:\s*\$\{\{\s*env\.EXPORTS_FALLBACK_NODE_VERSION\s*\}\}[\s\S]*?node require\.js/) + t.regex(ciWorkflow, /node-version:\s*\$\{\{\s*env\.MINIMUM_ESM_NODE_13_VERSION\s*\}\}[\s\S]*?node require\.js\s*\n\s*node import\.mjs/) +}) + +test('R3TD-5 CONTRIBUTING.md, MIGRATION.md and the deep-import smoke test agree on the Node.js versions where deep imports work', t => { + const { deepImportSupport } = require('./smoke/deep-import-support') + // Measured with the packed package on each of these Node.js versions: + // [version, the form without .js works, the form with .js works] + const measured = [ + ['v10.0.0', true, true], ['v12.0.0', true, true], ['v12.16.0', true, true], + ['v12.17.0', false, false], ['v12.18.0', false, false], ['v12.19.0', false, false], + ['v12.20.0', true, false], ['v12.22.12', true, false], + ['v13.0.0', false, false], ['v13.1.0', false, false], ['v13.7.0', false, false], ['v13.14.0', false, false], + ['v14.0.0', false, false], ['v14.13.0', true, false], ['v14.18.0', true, false], + ['v14.19.0', true, true], ['v14.21.3', true, true], + ['v16.0.0', true, false], ['v16.8.0', true, false], + ['v16.9.0', true, true], ['v16.20.2', true, true], ['v18.20.8', true, true], ['v20.20.2', true, true], + ['v22.0.0', true, true], ['v24.22.3', true, true], ['v26.13.1', true, true] + ] + for (const [version, withoutExtension, withExtension] of measured) { + t.deepEqual(deepImportSupport(version), { withoutExtension, withExtension }, version) + } + t.deepEqual(deepImportSupport('14.12.0'), { withoutExtension: false, withExtension: false }, '14.12.0 (no subpath patterns yet)') + t.is(deepImportSupport('v15.14.0'), undefined, '15.x was never checked, so nothing is claimed for it') + + // The documents state the same ranges. Comment markers and line breaks do not matter. + const prose = file => readText(file).replace(/^[ \t]*\/\/ ?/gm, '').replace(/\s+/g, ' ') + const range = (from, to) => `${from.replace(/\./g, '\\.')}\\s*(?:to|-|–)\\s*${to.replace(/\./g, '\\.')}` + const fail = new RegExp(`${range('12.17', '12.19')}, (?:all of )?13\\.x and ${range('14.0', '14.12')}`) + const withoutOnly = new RegExp(`${range('12.20', '12.22')}, ${range('14.13', '14.18')} and ${range('16.0', '16.8')}[^.;]*?only the form without \`\\.js\` works`) + for (const file of ['CONTRIBUTING.md', 'MIGRATION.md', 'packaging/smoke/deep-imports.js', 'packaging/smoke/deep-import-support.js']) { + // t.true instead of t.regex, so that a failure names the file instead of printing all of it. + const text = prose(file) + t.true(fail.test(text), `${file}: deep imports fail on 12.17 to 12.19, 13.x and 14.0 to 14.12`) + t.true(withoutOnly.test(text), `${file}: on 12.20 to 12.22, 14.13 to 14.18 and 16.0 to 16.8 only the form without .js works`) + t.false(/12\.17 to 12\.22|14\.0 to 14\.18/.test(text), `${file} does not claim that deep imports fail where the form without .js works`) + } + + // CI runs the smoke test, which checks the table on the running version, on every old Node.js version it installs. + const minimumNode = workflowJob(ciWorkflow, 'minimum-node') + const steps = minimumNode.split(/\n {6}- /).filter(step => /node require\.js/.test(step)) + t.is(steps.length, 4, 'four smoke test steps') + for (const step of steps) t.regex(step, /node deep-imports\.js/, step.split('\n')[0]) +}) + +test('G:CI-1 the release workflow only publishes to registries it can authenticate against', t => { + const owner = /github\.com\/([^/]+)\//.exec(packageJson.repository.url)[1].toLowerCase() + const scope = packageJson.name.split('/')[0] + for (const [, registry] of publishWorkflow.matchAll(/registry-url:\s*['"]?([^'"\s]+)/g)) { + if (registry.includes('npm.pkg.github.com')) { + // GitHub Packages only accepts packages whose scope is the repository owner. + t.is(scope, `@${owner}`, `GitHub Packages cannot host ${packageJson.name}: its scope is not @${owner}`) + } else { + t.is(registry, 'https://registry.npmjs.org/') + } + } + t.notRegex(publishWorkflow, /npm\.pkg\.github\.com/, 'no job publishes to GitHub Packages') + t.regex(publishWorkflow, /NODE_AUTH_TOKEN:\s*\$\{\{\s*secrets\.NPM_PUBLISH_TOKEN\s*\}\}/) + t.is(packageJson.publishConfig && packageJson.publishConfig.registry, 'https://registry.npmjs.org/') +}) + +const distTag = (...args) => spawnSync(process.execPath, [path.join(__dirname, 'dist-tag.js'), ...args], { + cwd: root, + encoding: 'utf8', + env: childEnvironment() +}) + +test('CI:dist-tag a stable release tag publishes as latest, a prerelease as beta', t => { + const cases = [ + { tag: 'v2.0.1', version: '2.0.1', prerelease: 'false', expected: 'latest' }, + { tag: '2.0.1', version: '2.0.1', prerelease: 'false', expected: 'latest' }, + { tag: 'v2.1.0-beta.1', version: '2.1.0-beta.1', prerelease: 'true', expected: 'beta' }, + { tag: 'v3.0.0-rc.2', version: '3.0.0-rc.2', prerelease: 'false', expected: 'beta' }, + { tag: 'v2.0.2', version: '2.0.2', prerelease: 'true', expected: 'beta' } + ] + for (const { tag, version, prerelease, expected } of cases) { + const result = distTag(tag, version, prerelease) + t.is(result.status, 0, result.stderr) + t.is(result.stdout.trim(), expected, `${tag} (prerelease: ${prerelease})`) + } + t.regex(publishWorkflow, /node packaging\/dist-tag\.js/, 'the publish workflow uses packaging/dist-tag.js') + t.notRegex(publishWorkflow, /contains\(github\.event\.release\.tag_name, 'beta'\)/) +}) + +test('CI:dist-tag a release tag that does not match package.json is rejected', t => { + const result = distTag('v2.0.2', '2.0.1', 'false') + t.not(result.status, 0) + t.regex(result.stderr, /does not match/) +}) + +test('G:CI-2 a nested node --test run reports its failures (NODE_TEST_CONTEXT is not inherited)', t => { + t.timeout(minutes(1)) + const { testRunnerEnvironment } = require('../compatibility-checks/test/environment.js') + const directory = makeTemporaryDirectory('node-test') + const inner = path.join(directory, 'inner.js') + const outer = path.join(directory, 'outer.js') + fs.writeFileSync(inner, "require('node:test').test('fails', () => { throw new Error('inner failure') })\n") + fs.writeFileSync(outer, [ + "const { spawnSync } = require('child_process')", + `const { testRunnerEnvironment } = require(${JSON.stringify(path.join(root, 'compatibility-checks', 'test', 'environment.js'))})`, + "require('node:test').test('nested run fails', () => {", + ` const result = spawnSync(process.execPath, ['--test', ${JSON.stringify(inner)}], { env: testRunnerEnvironment(), encoding: 'utf8' })`, + " if (result.status === 0) throw new Error('the nested node --test run did not report its failure')", + '})', + '' + ].join('\n')) + const result = spawnSync(process.execPath, ['--test', outer], { encoding: 'utf8', env: childEnvironment() }) + t.is(result.status, 0, result.stdout + result.stderr) + t.is(testRunnerEnvironment({ NODE_TEST_CONTEXT: 'child-v8', KEEP: '1' }).NODE_TEST_CONTEXT, undefined) + t.is(testRunnerEnvironment({ NODE_TEST_CONTEXT: 'child-v8', KEEP: '1' }).KEEP, '1') +}) + +test('G:CI-2 CI runs the compatibility checks against the packed local build', t => { + const compatibility = JSON.parse(fs.readFileSync(path.join(root, 'compatibility-checks', 'package.json'), 'utf8')) + t.is(compatibility.scripts.pretest, 'npm run install:local', 'npm test in compatibility-checks installs the packed local build first') + t.regex(compatibility.scripts['install:local'], /^node scripts\/install-local-build\.js$/) + const common = fs.readFileSync(path.join(root, 'compatibility-checks', 'test-runners', '_common', 'index.ts'), 'utf8') + t.regex(common, /from '@fluffy-spoon\/substitute'/, 'the test runners import the package, not ../src') + t.notRegex(common, /\.\.\/src/) + t.regex(ciWorkflow, /working-directory:\s*compatibility-checks[\s\S]*?run:\s*npm test|run:\s*npm test\s*\n\s*working-directory:\s*compatibility-checks/, 'a CI job runs npm test in compatibility-checks') +}) + +test('CI:matrix CI tests every supported Node LTS line and runs the type tests', t => { + const matrix = /node-version:\s*\[([^\]]+)\]/.exec(ciWorkflow) + t.truthy(matrix, 'nodejs.yml has a node-version matrix') + const versions = matrix[1].split(',').map(version => version.trim().replace(/['"]/g, '')) + for (const version of ['22', '24', '26']) t.true(versions.includes(version), `Node ${version} is tested`) + for (const version of ['18', '20', '21']) t.false(versions.includes(version), `end-of-life Node ${version} is not in the matrix`) + t.regex(ciWorkflow, /npm run test:types --if-present/) + t.regex(ciWorkflow, /pull_request/) +}) + +/** The body of a job in a workflow file: everything from ` :` up to the next job. */ +const workflowJob = (workflow, job) => { + const match = new RegExp(`\\n ${job}:\\n([\\s\\S]*?)(?=\\n [\\w-]+:\\n|$)`).exec(workflow) + return match ? match[1] : undefined +} + +test('F4 CI (and so the release gate) type-checks the built typings with the oldest supported TypeScript', t => { + t.regex(packageJson.scripts['test:types:min-ts'], /^npm run build && node spec-types\/min-ts\/check\.js$/) + t.regex(readText('spec-types/min-ts/check.js'), /MINIMUM_TYPESCRIPT_VERSION = '3\.6'/) + const job = workflowJob(ciWorkflow, 'types-min-ts') + t.truthy(job, 'nodejs.yml has a types-min-ts job') + t.regex(job, /run:\s*npm ci\b/) + t.regex(job, /run:\s*npm run test:types:min-ts\s*$/m) + t.notRegex(job, /\bif:/, 'the job always runs') + // The publish workflow runs the whole CI workflow, this job included, before it publishes. + t.regex(publishWorkflow, /uses:\s*\.\/\.github\/workflows\/nodejs\.yml/) + t.regex(workflowJob(publishWorkflow, 'publish-npm'), /needs:\s*ci\b/) +}) + +test('TD-12 CONTRIBUTING.md documents every CI check, including test:docs and test:types:min-ts', t => { + const contributing = readText('CONTRIBUTING.md') + for (const command of ['npm run test:docs', 'npm run test:types:min-ts', 'npm run test:types']) { + t.true(contributing.includes(command), `CONTRIBUTING.md shows how to run ${command}`) + } + for (const directory of ['spec-types/', 'spec-docs/']) { + t.regex(contributing, new RegExp(`\\| \`${directory}\` \\|`), `the project layout lists ${directory}`) + } + t.true(contributing.includes('spec-docs/README.md'), 'CONTRIBUTING.md points to the docs check documentation') + const ci = contributing.slice(contributing.indexOf('## Continuous integration'), contributing.indexOf('## Releasing')) + for (const [, job] of ciWorkflow.matchAll(/\n ([\w-]+):\n\s+name:/g)) { + t.true(ci.includes(`**${job}**`), `the Continuous integration section describes the ${job} job`) + } + for (const [, command] of workflowJob(ciWorkflow, 'test').matchAll(/run:\s*(npm [^\n]+)/g)) { + t.true(ci.includes(command.replace(' --if-present', '')), `the Continuous integration section mentions ${command}`) + } +}) + +test('DOCS:CONTRIBUTING CONTRIBUTING.md (linked from the README) exists and documents the release process', t => { + const contributing = readText('CONTRIBUTING.md') + for (const topic of ['npm test', 'test:types', 'compatibility-checks', 'release']) { + t.true(contributing.includes(topic), `CONTRIBUTING.md mentions ${topic}`) + } +}) diff --git a/packaging/smoke/deep-import-support.js b/packaging/smoke/deep-import-support.js new file mode 100644 index 0000000..3255aab --- /dev/null +++ b/packaging/smoke/deep-import-support.js @@ -0,0 +1,41 @@ +'use strict' +// Which deep imports of compiled files (`@fluffy-spoon/substitute/dist/`) a Node.js version resolves. +// Deep imports are not public API, but the "exports" map keeps them working where Node.js can: +// +// - older than 12.17: "exports" is ignored, so both forms work; +// - 12.17 to 12.19, all of 13.x and 14.0 to 14.12: "exports" without subpath patterns, so both forms fail; +// - 12.20 to 12.22, 14.13 to 14.18 and 16.0 to 16.8: subpath patterns without trailers, so only the form without +// `.js` works (through the "./dist/*" subpath); +// - 14.19 or newer on 14.x, 16.9 or newer, and every later version: pattern trailers ("./dist/*.js"), both forms work. +// +// 15.x is not listed: nobody checked it, so deep-imports.js does not assert anything about it. +// CONTRIBUTING.md and MIGRATION.md ("Imports and packaging") say the same; packaging/package.test.js checks that they +// agree with this table, and deep-imports.js checks the table against the Node.js version it runs on. +// Kept to syntax that the oldest supported Node version understands (see engines in package.json). + +/** + * @param {string} version A Node.js version such as `v14.18.0` (process.version) or `14.18.0`. + * @returns {{ withoutExtension: boolean, withExtension: boolean } | undefined} Whether + * `@fluffy-spoon/substitute/dist/api/Arg` and `@fluffy-spoon/substitute/dist/api/Arg.js` resolve, or undefined for + * a version nobody checked. + */ +function deepImportSupport (version) { + var parts = String(version).replace(/^v/, '').split('.') + var major = Number(parts[0]) + var minor = Number(parts[1]) + var atLeast = function (wantedMajor, wantedMinor) { + return major > wantedMajor || (major === wantedMajor && minor >= wantedMinor) + } + var support = function (withoutExtension, withExtension) { + return { withoutExtension: withoutExtension, withExtension: withExtension } + } + if (!atLeast(12, 17)) return support(true, true) + if (major === 12) return support(atLeast(12, 20), false) + if (major === 13) return support(false, false) + if (major === 14) return support(atLeast(14, 13), atLeast(14, 19)) + if (major === 15) return undefined + if (major === 16) return support(true, atLeast(16, 9)) + return support(true, true) +} + +module.exports = { deepImportSupport: deepImportSupport } diff --git a/packaging/smoke/deep-imports.js b/packaging/smoke/deep-imports.js new file mode 100644 index 0000000..e5a018e --- /dev/null +++ b/packaging/smoke/deep-imports.js @@ -0,0 +1,47 @@ +'use strict' +// Deep imports of compiled files under dist/ are not public API, but the "exports" map keeps them working where +// Node.js can: on versions older than 12.17 (which ignore "exports"), on 14.19 or newer on 14.x and on 16.9 or newer, +// with or without `.js`. They fail on 12.17 to 12.19, all of 13.x and 14.0 to 14.12; on 12.20 to 12.22, 14.13 to +// 14.18 and 16.0 to 16.8 only the form without `.js` works. deep-import-support.js holds that table, and this script +// checks it against the Node.js version it runs on: the forms the table says work must work, the others must fail. +// Run from a directory whose node_modules contains the extracted package tarball (with deep-import-support.js next +// to this file): +// node deep-imports.js +// Kept to syntax and APIs that the oldest supported Node version understands (see engines in package.json). +var assert = require('assert') + +var Arg = require('@fluffy-spoon/substitute').Arg +var support = require('./deep-import-support').deepImportSupport(process.version) + +var load = function (specifier) { + try { + return { exports: require(specifier) } + } catch (error) { + return { error: error } + } +} + +var check = function (specifier, works, label) { + var result = load(specifier) + if (works) { + assert.ok(!result.error, label + ' works on Node ' + process.version + ': ' + (result.error && result.error.message)) + assert.strictEqual(result.exports.Arg, Arg, label + ' gives the same module as the package root') + } else { + assert.ok(result.error, label + ' fails on Node ' + process.version + + ' (if it works now, update deep-import-support.js, CONTRIBUTING.md and MIGRATION.md)') + assert.ok(/NOT_EXPORTED$|^MODULE_NOT_FOUND$/.test(result.error.code), label + ': ' + result.error.code + ' ' + result.error.message) + } + return works ? 'works' : 'fails' +} + +assert.strictEqual(require('@fluffy-spoon/substitute/package.json').name, '@fluffy-spoon/substitute', 'package.json') + +if (support === undefined) { + console.log('deep import smoke test passed on Node ' + process.version + ' (deep imports not checked on this version)') +} else { + var withoutExtension = check('@fluffy-spoon/substitute/dist/api/Arg', support.withoutExtension, 'deep import without extension') + check('@fluffy-spoon/substitute/dist/index', support.withoutExtension, 'deep import of the index without extension') + var withExtension = check('@fluffy-spoon/substitute/dist/api/Arg.js', support.withExtension, 'deep import with extension') + console.log('deep import smoke test passed on Node ' + process.version + + ' (without .js: ' + withoutExtension + ', with .js: ' + withExtension + ')') +} diff --git a/packaging/smoke/deep-imports.mjs b/packaging/smoke/deep-imports.mjs new file mode 100644 index 0000000..d11e59f --- /dev/null +++ b/packaging/smoke/deep-imports.mjs @@ -0,0 +1,12 @@ +// ES module counterpart of deep-imports.js. Deep imports with an extension, like the two below, need pattern +// trailers in "exports": Node.js 14.19 or newer on 14.x, or 16.9 or newer (see deep-import-support.js). +// node deep-imports.mjs +import assert from 'assert' +import { Arg } from '@fluffy-spoon/substitute' +import argModule from '@fluffy-spoon/substitute/dist/api/Arg.js' +import esmEntry from '@fluffy-spoon/substitute/dist/index.mjs' + +assert.strictEqual(argModule.Arg, Arg, 'deep import of a compiled CommonJS file') +assert.strictEqual(typeof esmEntry.for, 'function', 'deep import of the ES module entry') + +console.log('ESM deep import smoke test passed on Node ' + process.version) diff --git a/packaging/smoke/import.mjs b/packaging/smoke/import.mjs new file mode 100644 index 0000000..306b612 --- /dev/null +++ b/packaging/smoke/import.mjs @@ -0,0 +1,35 @@ +// Smoke test of the packed package through native ES module `import`. +// Run from a directory whose node_modules contains the extracted package tarball: +// node import.mjs +import assert from 'assert' +import { createRequire } from 'module' + +import Substitute, { Substitute as NamedSubstitute, Arg, received, returns } from '@fluffy-spoon/substitute' +import * as namespace from '@fluffy-spoon/substitute' + +const require = createRequire(import.meta.url) +const cjs = require('@fluffy-spoon/substitute') + +// The default import is the Substitute class, as it is for CommonJS and TypeScript consumers. +assert.strictEqual(typeof Substitute.for, 'function', 'default import: Substitute.for is a function') +assert.strictEqual(Substitute, NamedSubstitute, 'the default import is the named Substitute export') +assert.strictEqual(namespace.default, Substitute, 'namespace.default is Substitute') + +// The ES module entry wraps the CommonJS build, so both module systems share one instance. +assert.strictEqual(Substitute, cjs.Substitute, 'ESM and CommonJS share the same Substitute') +assert.strictEqual(Arg, cjs.Arg, 'ESM and CommonJS share the same Arg') + +// Every named export of the CommonJS build is available as a named ESM export. +const cjsNames = Object.keys(cjs).sort() +const esmNames = Object.keys(namespace).sort() +assert.deepStrictEqual(esmNames, cjsNames, 'the ESM entry exports the same names as the CommonJS entry') + +const calculator = Substitute.for() +calculator.add(1, 2).returns(3) +calculator.subtract(Arg.any(), 1)[returns](7) +assert.strictEqual(calculator.add(1, 2), 3, 'returns() configures the return value') +assert.strictEqual(calculator.subtract(5, 1), 7, 'the returns symbol configures the return value') +calculator[received](1).add(1, 2) +assert.throws(() => calculator.received(2).add(1, 2), error => error.name === 'SubstituteException') + +console.log('import smoke test passed on Node ' + process.version) diff --git a/packaging/smoke/require.js b/packaging/smoke/require.js new file mode 100644 index 0000000..97eacd5 --- /dev/null +++ b/packaging/smoke/require.js @@ -0,0 +1,37 @@ +'use strict' +// Smoke test of the packed package through CommonJS `require`. +// Run from a directory whose node_modules contains the extracted package tarball: +// node require.js +// Kept to syntax and APIs that the oldest supported Node version understands (see engines in package.json). + +var assert = require('assert') + +var lib = require('@fluffy-spoon/substitute') +var Substitute = lib.Substitute +var Arg = lib.Arg + +assert.strictEqual(typeof Substitute.for, 'function', 'Substitute.for is a function') +assert.strictEqual(lib.default, Substitute, 'the default export is Substitute') +assert.strictEqual(typeof lib.received, 'symbol', 'the received symbol is exported') + +var calculator = Substitute.for() +calculator.add(1, 2).returns(3) +calculator.multiply(Arg.any(), Arg.is(function (x) { return x > 5 })).returns(42) + +assert.strictEqual(calculator.add(1, 2), 3, 'returns() configures the return value') +assert.strictEqual(calculator.multiply(0, 9), 42, 'Arg matchers match') + +calculator.received(1).add(1, 2) +calculator.received(1).multiply(Arg.any(), Arg.any('number')) +calculator.didNotReceive().subtract(Arg.all()) + +var failure +try { + calculator.received(2).add(1, 2) +} catch (error) { + failure = error +} +assert.ok(failure instanceof Error, 'a failing assertion throws') +assert.strictEqual(failure.name, 'SubstituteException', 'a failing assertion throws a SubstituteException') + +console.log('require smoke test passed on Node ' + process.version) diff --git a/spec-docs/README.md b/spec-docs/README.md new file mode 100644 index 0000000..a46eadb --- /dev/null +++ b/spec-docs/README.md @@ -0,0 +1,49 @@ +# Documentation check + +`npm run test:docs` builds the package and checks every code example in [README.md](../README.md), +[MIGRATION.md](../MIGRATION.md) and [CHANGELOG.md](../CHANGELOG.md), so the documentation cannot drift away from the +library: + +* ```` ```typescript ```` / ```` ```ts ```` blocks are type-checked under `strict` against the built package (resolved + through `package.json` like an installed copy, so the `exports` map and the published typings are what is checked), + and then run with Node.js, one process per block. +* ```` ```js ```` / ```` ```javascript ```` blocks are run with Node.js. +* Every block must have a language tag. Blocks in other languages (`sh`, `text`, ...) are not checked. +* Relative links must point to an existing file, and `#anchors` to an existing heading. + +It takes a few seconds. Then `spec-docs/self-test.js` runs the check on [fixtures/broken.md](fixtures/broken.md), whose +code blocks and links are broken on purpose, and fails if the check does not report each of them. + +## Writing examples +Promise what the code does in a comment, and the check holds the example to it: + +```ts +console.log(calculator.add(1, 2)) // prints 3 +calculator.received(2).add(1, 2) // throws SubstituteException +calculator.received(-1).add(1, 2) // throws SubstituteException: Expected count has to be a non-negative integer +``` + +* `console.log(...) // prints `: the line must print exactly `` (the `util.format` output, as console.log + prints it), exactly once. It also works inside a callback: `.then(value => console.log(value)) // prints 4`. +* ` // throws ` or `// throws : `: the statement must throw an error with that + `name`, whose message contains ``. It must be a complete statement on one line. +* A `console.log` without `// prints` fails the check, and so does any exception, uncaught exception, unhandled rejection + or non-zero exit code that the example does not promise. + +Blocks can be marked with an HTML comment right before the fence (several directives are separated by spaces): + +| Directive | Meaning | +|---|---| +| `` | Other blocks can use this block's code. Such a block must not contain `// prints` or `// throws`. | +| `` | Runs the named blocks' code first (and the code they use in turn), in the same module. Every block gets its own fresh copy. Several names are separated by commas. | +| `` | Only type-checked, for example code that needs a test runner. | +| `` | An ES module (`.mts` / `.mjs`) instead of CommonJS. | +| `` | The block must end with that uncaught exception (a check reported later, from a microtask). | +| `` | On a ```` ```text ```` block: must equal `: ` of the error thrown by the last `// throws` line of the checked block before it. Lines starting with `called at` match any stack frame. | +| `` | Not checked at all: code for an old version, or deliberately partial code. | + +Use `// @ts-expect-error` to show code that must not compile. To debug a failure, keep the generated files: + +```sh +npm run build && node spec-docs/check.js --keep README.md +``` diff --git a/spec-docs/check.js b/spec-docs/check.js new file mode 100644 index 0000000..7167af8 --- /dev/null +++ b/spec-docs/check.js @@ -0,0 +1,612 @@ +#!/usr/bin/env node +'use strict' +// The documentation check (`npm run test:docs`). It keeps README.md, MIGRATION.md and CHANGELOG.md honest: +// +// - Every ```typescript / ```ts block is type-checked under `strict` against the BUILT package (dist/, resolved through +// package.json like an installed copy of @fluffy-spoon/substitute), then run with Node.js. +// - Every ```javascript / ```js block is run with Node.js. +// - `console.log(...) // prints ` must print exactly (util.format output, like console.log). +// - ` // throws ` and ` // throws : ` must throw that error (by its +// `name`; the message must contain ). Both must be complete single-line statements. +// - Any other console.log, an unexpected exception, an uncaught exception or an unhandled rejection fails the check. +// - Relative links must point to an existing file, and #anchors to an existing heading. +// +// A block can be marked with an HTML comment on the lines before its fence: +// skip not checked at all (code for old versions, deliberately partial code) +// compile-only type-checked but not run (e.g. code that needs a test runner) +// name= lets other blocks use this block's code +// uses=[,] the named blocks' code (and the code they use) runs first, in the same module; each block +// gets a fresh copy +// esm an ES module (.mts / .mjs) instead of CommonJS +// uncaught= the block must end with an uncaught (a check reported later, from a microtask) +// A ```text block marked must equal ": " of the error thrown by the +// last `// throws` line of the preceding checked block (lines starting with "called at" match any stack frame). +// +// Usage: node spec-docs/check.js [--keep] [file.md ...] (default: README.md MIGRATION.md CHANGELOG.md; build first) +// See spec-docs/README.md for examples. +const fs = require('fs') +const os = require('os') +const path = require('path') +const { spawn } = require('child_process') + +const root = path.resolve(__dirname, '..') +const defaultFiles = ['README.md', 'MIGRATION.md', 'CHANGELOG.md'] +const checkedLanguages = { typescript: 'ts', ts: 'ts', javascript: 'js', js: 'js' } +const knownDirectives = new Set(['skip', 'compile-only', 'name', 'uses', 'esm', 'uncaught', 'error-message']) +const snippetTimeout = 20 * 1000 + +// --------------------------------------------------------------------------------------------------------------------- +// Markdown + +const directivePattern = /^\s*\s*$/ +const commentPattern = /^\s*\s*$/ +const fenceOpenPattern = /^(\s*)(`{3,}|~{3,})(.*)$/ + +const parseDirectives = (text, problems, location) => { + const directives = {} + const tokens = text.trim().split(/\s+/).filter(Boolean) + for (let index = 0; index < tokens.length; index++) { + const token = tokens[index] + const [key, ...rest] = token.split('=') + const value = rest.join('=') + if (!knownDirectives.has(key)) { + problems.push({ ...location, message: `unknown docs-check directive "${token}"` }) + continue + } + if (key === 'skip') { + directives.skip = tokens.slice(index + 1).join(' ') || 'no reason given' + break + } + if (key === 'compile-only') directives.compileOnly = true + else if (key === 'esm') directives.esm = true + else if (key === 'error-message') directives.errorMessage = true + else if (!value) problems.push({ ...location, message: `docs-check directive "${key}" needs a value (${key}=...)` }) + else if (key === 'name') directives.name = value + else if (key === 'uses') directives.uses = value.split(',').filter(Boolean) + else if (key === 'uncaught') directives.uncaught = value + } + return directives +} + +/** Splits a Markdown file into fenced code blocks, with the HTML comments directly before each fence. */ +const parseMarkdown = (file, text) => { + const lines = text.split(/\r?\n/) + const blocks = [] + const problems = [] + let pending = [] + for (let index = 0; index < lines.length; index++) { + const line = lines[index] + const open = fenceOpenPattern.exec(line) + if (open) { + const [, indent, fence, info] = open + const language = info.trim().split(/\s+/)[0] || '' + const fenceLine = index + 1 + const code = [] + let closed = false + for (index++; index < lines.length; index++) { + const close = /^\s*(`{3,}|~{3,})\s*$/.exec(lines[index]) + if (close && close[1][0] === fence[0] && close[1].length >= fence.length) { + closed = true + break + } + const content = lines[index] + const strip = Math.min(indent.length, content.length - content.trimStart().length) + code.push(content.slice(strip)) + } + const location = { file, line: fenceLine } + if (!closed) problems.push({ ...location, message: 'code block is not closed' }) + const directives = {} + const comments = [] + for (const comment of pending) { + comments.push(comment.text) + if (comment.directives) Object.assign(directives, parseDirectives(comment.directives, problems, location)) + } + pending = [] + blocks.push({ file, fenceLine, firstLine: fenceLine + 1, language, code, directives, comments }) + continue + } + const directive = directivePattern.exec(line) + const comment = commentPattern.exec(line) + if (comment) { + pending.push({ text: comment[1].trim(), line: index + 1, directives: directive ? directive[1] : undefined }) + } else if (line.trim() !== '') { + for (const comment of pending.filter(c => c.directives !== undefined)) { + problems.push({ file, line: comment.line, message: 'docs-check directive is not followed by a code block' }) + } + pending = [] + } + } + for (const comment of pending.filter(c => c.directives !== undefined)) { + problems.push({ file, line: comment.line, message: 'docs-check directive is not followed by a code block' }) + } + return { blocks, problems } +} + +// --------------------------------------------------------------------------------------------------------------------- +// Links: relative links must point to an existing file, and #anchors to an existing heading (GitHub's anchor rules). + +/** The lines of a Markdown file outside of fenced code blocks, with their line numbers. */ +const proseLines = text => { + const result = [] + let fence + text.split(/\r?\n/).forEach((line, index) => { + const marker = /^\s*(`{3,}|~{3,})/.exec(line) + if (fence) { + if (marker && marker[1][0] === fence[0] && marker[1].length >= fence.length && line.trim() === marker[1]) fence = undefined + } else if (marker) { + fence = marker[1] + } else { + result.push({ line, number: index + 1 }) + } + }) + return result +} + +const headingAnchors = text => { + const counts = new Map() + const anchors = new Set() + for (const { line } of proseLines(text)) { + const heading = /^#{1,6}\s+(.*?)\s*#*\s*$/.exec(line) + if (!heading) continue + const slug = heading[1] + .replace(/\[([^\]]*)\]\([^)]*\)/g, '$1') + .replace(/<[^>]*>/g, '') + .toLowerCase() + .replace(/[^\p{L}\p{M}\p{N}\p{Pc} -]/gu, '') + .replace(/ /g, '-') + const count = counts.get(slug) || 0 + counts.set(slug, count + 1) + anchors.add(count === 0 ? slug : `${slug}-${count}`) + } + return anchors +} + +const checkLinks = (file, text) => { + const problems = [] + const anchorsOf = new Map() + const anchors = target => { + if (!anchorsOf.has(target)) anchorsOf.set(target, headingAnchors(fs.readFileSync(target, 'utf8'))) + return anchorsOf.get(target) + } + for (const { line, number } of proseLines(text)) { + const withoutCode = line.replace(/`+[^`]*`+/g, '') + for (const [, target] of withoutCode.matchAll(/\]\(([^)\s]+)(?:\s+"[^"]*")?\)/g)) { + if (/^[a-z][a-z+.-]*:/i.test(target)) continue + const [pathPart, anchor] = target.split('#') + const targetFile = pathPart ? path.resolve(root, path.dirname(file), pathPart) : path.resolve(root, file) + const location = { file, line: number } + if (!fs.existsSync(targetFile)) { + problems.push({ ...location, message: `broken link ${target}: ${path.relative(root, targetFile)} does not exist` }) + } else if (anchor !== undefined && targetFile.endsWith('.md') && !anchors(targetFile).has(anchor)) { + problems.push({ ...location, message: `broken link ${target}: ${path.relative(root, targetFile)} has no heading with the anchor #${anchor}` }) + } + } + } + return problems +} + +// --------------------------------------------------------------------------------------------------------------------- +// Snippets + +const printsPattern = /^(.*?)\s*\/\/ prints (.*?)\s*$/ +const throwsPattern = /^(\s*)(.*?);?\s*\/\/ throws ([A-Za-z_$][\w$]*)(?::\s*(.*?))?\s*$/ + +/** Rewrites the `// prints` and `// throws` lines of a block and collects what they promise. Keeps the line count. */ +const instrument = (block, problems) => { + const expectations = [] + const lines = block.code.map((line, offset) => { + const markdownLine = block.firstLine + offset + const location = { file: block.file, line: markdownLine } + const prints = printsPattern.exec(line) + if (prints) { + const [, code, text] = prints + if (!code.includes('console.log(')) { + problems.push({ ...location, message: '"// prints" needs a console.log(...) call on the same line' }) + return line + } + expectations.push({ kind: 'prints', line: markdownLine, text }) + return code.replace('console.log(', `__docs.print(${markdownLine}, `) + } + const throws = throwsPattern.exec(line) + if (throws) { + const [, indent, code, name, message] = throws + expectations.push({ kind: 'throws', line: markdownLine, name, message }) + return `${indent}__docs.throws(${markdownLine}, () => { ${code} })` + } + if (line.includes('console.log(')) { + problems.push({ ...location, message: 'console.log(...) without a "// prints " comment' }) + } + return line + }) + return { lines, expectations } +} + +const slug = file => path.basename(file).replace(/\.md$/i, '').replace(/[^\w]+/g, '-').toLowerCase() + +const buildSnippets = parsed => { + const problems = [] + const named = new Map() + const snippets = [] + const messageChecks = [] + for (const { blocks } of parsed) { + let previous + for (const block of blocks) { + const location = { file: block.file, line: block.fenceLine } + const kind = checkedLanguages[block.language] + const { directives } = block + if (block.language === '') { + problems.push({ ...location, message: 'code block without a language tag (use ```typescript, ```js, ```sh, ```text, ...)' }) + continue + } + if (directives.errorMessage) { + if (block.language !== 'text') problems.push({ ...location, message: 'error-message is only allowed on ```text blocks' }) + else if (!previous) problems.push({ ...location, message: 'error-message block has no checked code block before it' }) + else messageChecks.push({ block, snippet: previous }) + continue + } + if (!kind) { + if (Object.keys(directives).length > 0 && !directives.skip) { + problems.push({ ...location, message: `docs-check directives on a \`\`\`${block.language} block, which is not checked` }) + } + continue + } + if (directives.skip) continue + const snippetProblems = [] + const { lines, expectations } = instrument(block, snippetProblems) + if (directives.compileOnly && expectations.length > 0) { + snippetProblems.push({ ...location, message: '"// prints" and "// throws" cannot be checked in a compile-only block' }) + } + if (kind === 'js' && directives.compileOnly) { + snippetProblems.push({ ...location, message: 'compile-only is only allowed on TypeScript blocks' }) + } + const extension = kind === 'ts' ? (directives.esm ? '.mts' : '.ts') : (directives.esm ? '.mjs' : '.js') + const snippet = { + id: `${slug(block.file)}-${String(block.fenceLine).padStart(4, '0')}`, + block, + kind, + extension, + lines, + expectations, + problems: snippetProblems, + directives + } + if (directives.name) { + if (named.has(directives.name)) problems.push({ ...location, message: `there is already a block named "${directives.name}"` }) + named.set(directives.name, snippet) + } + snippets.push(snippet) + previous = snippet + } + } + // The blocks a snippet uses, transitively and in order, each once. + const usedBlocks = (snippet, location, problems, path = []) => { + const result = [] + for (const name of snippet.directives.uses || []) { + const used = named.get(name) + if (!used) { + problems.push({ ...location, message: `uses=${name}: there is no block named "${name}"` }) + continue + } + if (used === snippet || path.includes(used)) { + problems.push({ ...location, message: `uses=${name}: blocks cannot use each other in a cycle` }) + continue + } + if (used.kind !== snippet.kind) problems.push({ ...location, message: `uses=${name}: a ${snippet.kind} block cannot use a ${used.kind} block` }) + if (used.expectations.length > 0) problems.push({ ...location, message: `uses=${name}: a block that other blocks use must not contain "// prints" or "// throws"` }) + for (const block of [...usedBlocks(used, location, problems, [...path, snippet]), used]) { + if (!result.includes(block)) result.push(block) + } + } + return result + } + for (const snippet of snippets) { + const location = { file: snippet.block.file, line: snippet.block.fenceLine } + snippet.source = [] + snippet.lineMap = [] + for (const used of usedBlocks(snippet, location, snippet.problems)) { + used.lines.forEach((line, offset) => { + snippet.source.push(line) + snippet.lineMap.push({ file: used.block.file, line: used.block.firstLine + offset }) + }) + } + snippet.lines.forEach((line, offset) => { + snippet.source.push(line) + snippet.lineMap.push({ file: snippet.block.file, line: snippet.block.firstLine + offset }) + }) + } + return { snippets, messageChecks, problems } +} + +// --------------------------------------------------------------------------------------------------------------------- +// Type-checking and running + +const globalsDeclaration = [ + '// Generated by spec-docs/check.js: the helpers that the `// prints` and `// throws` lines are rewritten to.', + 'declare const __docs: {', + ' print(line: number, ...values: unknown[]): void', + ' throws(line: number, statement: () => unknown): void', + '}', + '' +].join('\n') + +const prepareWorkDirectory = () => { + const work = fs.mkdtempSync(path.join(os.tmpdir(), 'substitute-docs-')) + fs.mkdirSync(path.join(work, 'src')) + fs.mkdirSync(path.join(work, 'out')) + const modules = path.join(work, 'node_modules') + fs.mkdirSync(path.join(modules, '@fluffy-spoon'), { recursive: true }) + // The package itself, resolved through its package.json (exports map, types) like an installed copy. + fs.symlinkSync(root, path.join(modules, '@fluffy-spoon', 'substitute'), 'junction') + // Test runners that examples may import (compile-only examples). + for (const name of ['ava']) { + const target = path.join(root, 'node_modules', name) + if (fs.existsSync(target)) fs.symlinkSync(target, path.join(modules, name), 'junction') + } + fs.writeFileSync(path.join(work, 'package.json'), JSON.stringify({ name: 'docs-check', private: true, type: 'commonjs' })) + return work +} + +const typeCheckAndEmit = (work, snippets) => { + const ts = require('typescript') + const sourceDirectory = path.join(work, 'src') + const outDirectory = path.join(work, 'out') + const byFile = new Map() + const rootNames = [path.join(sourceDirectory, 'docs-check-globals.d.ts')] + fs.writeFileSync(rootNames[0], globalsDeclaration) + for (const snippet of snippets.filter(s => s.kind === 'ts')) { + const file = path.join(sourceDirectory, snippet.id + snippet.extension) + fs.writeFileSync(file, snippet.source.join('\n') + '\n') + rootNames.push(file) + byFile.set(path.normalize(file), snippet) + snippet.sourceFile = file + snippet.outputFile = path.join(outDirectory, snippet.id + (snippet.extension === '.mts' ? '.mjs' : '.js')) + } + const options = { + strict: true, + target: ts.ScriptTarget.ES2019, + module: ts.ModuleKind.NodeNext, + moduleResolution: ts.ModuleResolutionKind.NodeNext, + moduleDetection: ts.ModuleDetectionKind.Force, + esModuleInterop: true, + types: ['node'], + typeRoots: [path.join(root, 'node_modules', '@types')], + rootDir: sourceDirectory, + outDir: outDirectory, + inlineSourceMap: true, + newLine: ts.NewLineKind.LineFeed, + skipLibCheck: false + } + const program = ts.createProgram({ rootNames, options }) + const general = [] + for (const diagnostic of ts.getPreEmitDiagnostics(program)) { + const text = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n') + const snippet = diagnostic.file && byFile.get(path.normalize(diagnostic.file.fileName)) + if (snippet && diagnostic.start !== undefined) { + const { line } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start) + const mapped = snippet.lineMap[line] || { file: snippet.block.file, line: snippet.block.fenceLine } + snippet.problems.push({ ...mapped, message: `error TS${diagnostic.code}: ${text}` }) + snippet.typeErrors = true + } else { + const where = diagnostic.file ? path.relative(root, diagnostic.file.fileName) : 'TypeScript' + general.push({ file: where, line: 0, message: `error TS${diagnostic.code}: ${text}` }) + } + } + program.emit() + return general +} + +const childEnvironment = () => { + const environment = { ...process.env, NO_COLOR: '1' } + for (const name of Object.keys(environment)) { + if (name === 'FORCE_COLOR' || name.startsWith('NODE_TEST_') || name.startsWith('AVA_')) delete environment[name] + } + return environment +} + +const runSnippet = (work, snippet) => new Promise(resolve => { + const resultFile = path.join(work, `${snippet.id}.result.json`) + const child = spawn(process.execPath, ['--enable-source-maps', path.join(__dirname, 'harness.js'), snippet.outputFile, resultFile], { + cwd: work, + env: childEnvironment(), + stdio: ['ignore', 'pipe', 'pipe'] + }) + let output = '' + child.stdout.on('data', data => { output += data }) + child.stderr.on('data', data => { output += data }) + const timer = setTimeout(() => child.kill('SIGKILL'), snippetTimeout) + child.on('close', (code, signal) => { + clearTimeout(timer) + let result + try { + result = JSON.parse(fs.readFileSync(resultFile, 'utf8')) + } catch (_) { + result = undefined + } + resolve({ code, signal, output, result }) + }) +}) + +const runAll = async (work, snippets) => { + const queue = snippets.slice() + const workers = Math.max(2, Math.min(8, os.cpus().length)) + const runWorker = async () => { + for (let snippet = queue.shift(); snippet; snippet = queue.shift()) { + snippet.run = await runSnippet(work, snippet) + } + } + await Promise.all(Array.from({ length: workers }, runWorker)) +} + +// --------------------------------------------------------------------------------------------------------------------- +// Evaluation + +/** Replaces positions in the generated snippet files with Markdown positions. */ +const mapStack = (snippet, text) => { + if (!text) return '' + const files = [snippet.sourceFile, snippet.outputFile].filter(Boolean) + let mapped = text + for (const file of files) { + const escaped = file.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + mapped = mapped.replace(new RegExp(`(?:file://)?${escaped}:(\\d+)(?::\\d+)?`, 'g'), (match, line) => { + const location = snippet.lineMap[Number(line) - 1] + return location ? `${location.file}:${location.line}` : match + }) + } + return mapped +} + +const quote = text => JSON.stringify(text) +const describeError = (snippet, error) => { + const message = mapStack(snippet, `${error.name}: ${error.message}`) + // The first lines of a stack repeat the message; show the frames after it. + const frames = mapStack(snippet, error.stack || '').split('\n').filter(line => /^\s+at /.test(line)).slice(0, 5) + return [message, ...frames].join('\n') +} + +const evaluateSnippet = snippet => { + const { run, block, directives } = snippet + const location = { file: block.file, line: block.fenceLine } + const problems = snippet.problems + if (!run.result) { + const reason = run.signal ? `was killed (${run.signal}, timeout ${snippetTimeout / 1000} s)` : `exited with code ${run.code}` + problems.push({ ...location, message: `the snippet ${reason} before reporting a result\n${mapStack(snippet, run.output)}` }) + return + } + const { prints, throws, uncaught, error } = run.result + if (error) problems.push({ ...location, message: `the snippet threw ${describeError(snippet, error)}` }) + for (const expectation of snippet.expectations) { + const at = { file: block.file, line: expectation.line } + if (expectation.kind === 'prints') { + const printed = prints.filter(p => p.line === expectation.line) + if (printed.length === 0 && !error) problems.push({ ...at, message: `expected to print ${quote(expectation.text)}, but the line printed nothing` }) + else if (printed.length > 1) problems.push({ ...at, message: `expected to print once, but printed ${printed.length} times: ${printed.map(p => quote(p.text)).join(', ')}` }) + else if (printed.length === 1 && printed[0].text !== expectation.text) { + problems.push({ ...at, message: `expected to print ${quote(expectation.text)}, but printed ${quote(printed[0].text)}` }) + } + } else { + const records = throws.filter(t => t.line === expectation.line) + const expected = expectation.name + (expectation.message ? `: ${expectation.message}` : '') + if (records.length === 0 && !error) problems.push({ ...at, message: `expected to throw ${expected}, but the line did not run` }) + for (const record of records) { + if (!record.threw) problems.push({ ...at, message: `expected to throw ${expected}, but it did not throw` }) + else if (record.name !== expectation.name || (expectation.message && !record.message.includes(expectation.message))) { + problems.push({ ...at, message: `expected to throw ${expected}, but it threw ${record.name}: ${record.message}` }) + } + } + } + } + const expectedUncaught = directives.uncaught + for (const failure of uncaught) { + if (expectedUncaught && failure.name === expectedUncaught && failure.kind === 'uncaught exception') continue + problems.push({ ...location, message: `${failure.kind}: ${describeError(snippet, failure)}` }) + } + if (expectedUncaught && !uncaught.some(f => f.name === expectedUncaught && f.kind === 'uncaught exception')) { + problems.push({ ...location, message: `expected an uncaught ${expectedUncaught} (uncaught=${expectedUncaught}), but there was none` }) + } + if (run.code !== 0 && problems.length === 0) { + problems.push({ ...location, message: `the snippet exited with code ${run.code}\n${mapStack(snippet, run.output)}` }) + } +} + +const normalizeMessage = text => { + const lines = text.split(/\r?\n/).map(line => line.trimEnd().replace(/^(\s*called at ).*$/, '$1…')) + while (lines.length > 0 && lines[lines.length - 1] === '') lines.pop() + return lines.join('\n') +} + +const evaluateMessageCheck = ({ block, snippet }, problems) => { + const location = { file: block.file, line: block.fenceLine } + const throwsLines = snippet.expectations.filter(e => e.kind === 'throws') + if (throwsLines.length === 0) { + problems.push({ ...location, message: 'error-message block: the code block before it has no "// throws" line' }) + return + } + if (!snippet.run || !snippet.run.result) { + problems.push({ ...location, message: 'error-message block: the code block before it did not run' }) + return + } + const last = throwsLines[throwsLines.length - 1] + const record = snippet.run.result.throws.find(t => t.line === last.line && t.threw) + if (!record) { + problems.push({ ...location, message: `error-message block: line ${last.line} did not throw` }) + return + } + const expected = normalizeMessage(block.code.join('\n')) + const actual = normalizeMessage(`${record.name}: ${record.message}`) + if (expected !== actual) { + problems.push({ ...location, message: `error-message block does not match the message thrown on line ${last.line}.\n--- expected (README)\n${expected}\n--- actual\n${actual}` }) + } +} + +// --------------------------------------------------------------------------------------------------------------------- + +/** + * Checks the code blocks of the given Markdown files. Returns every problem, and per code block the problems that + * belong to it (used by spec-docs/self-test.js). + */ +const checkDocs = async ({ files = defaultFiles, keep = false } = {}) => { + const absolute = files.map(file => path.resolve(root, file)) + const texts = absolute.map(file => ({ file: path.relative(root, file), text: fs.readFileSync(file, 'utf8') })) + const parsed = texts.map(({ file, text }) => parseMarkdown(file, text)) + const { snippets, messageChecks, problems: buildProblems } = buildSnippets(parsed) + const problems = [...parsed.flatMap(p => p.problems), ...buildProblems, ...texts.flatMap(({ file, text }) => checkLinks(file, text))] + + if (!fs.existsSync(path.join(root, 'dist', 'index.js')) || !fs.existsSync(path.join(root, 'dist', 'index.mjs'))) { + problems.push({ file: 'dist', line: 0, message: 'dist/ is not built: run `npm run build` first (or `npm run test:docs`)' }) + return { problems, snippets, blocks: parsed.flatMap(p => p.blocks), files: texts.map(t => t.file) } + } + + const work = prepareWorkDirectory() + try { + problems.push(...typeCheckAndEmit(work, snippets)) + for (const snippet of snippets.filter(s => s.kind === 'js')) { + snippet.outputFile = path.join(work, 'out', snippet.id + snippet.extension) + fs.writeFileSync(snippet.outputFile, snippet.source.join('\n') + '\n') + } + const runnable = snippets.filter(s => !s.directives.compileOnly && !s.typeErrors && s.problems.length === 0) + await runAll(work, runnable) + for (const snippet of runnable) evaluateSnippet(snippet) + for (const check of messageChecks) evaluateMessageCheck(check, problems) + } finally { + if (keep) console.log(`docs-check: kept the generated files in ${work}`) + else fs.rmSync(work, { recursive: true, force: true }) + } + for (const snippet of snippets) problems.push(...snippet.problems) + return { + problems, + snippets, + blocks: parsed.flatMap(p => p.blocks), + files: texts.map(t => t.file), + runnableCount: snippets.filter(s => s.run).length + } +} + +const formatProblem = problem => `${problem.file}:${problem.line}: ${problem.message.replace(/\n/g, '\n ')}` + +const main = async () => { + const args = process.argv.slice(2) + const keep = args.includes('--keep') + const files = args.filter(arg => !arg.startsWith('--')) + const started = Date.now() + const result = await checkDocs({ files: files.length > 0 ? files : defaultFiles, keep }) + const { problems, snippets, blocks, runnableCount } = result + const unique = [...new Map(problems.map(p => [formatProblem(p), p])).values()] + .sort((a, b) => a.file.localeCompare(b.file) || a.line - b.line) + const checkedFiles = result.files.join(', ') + const skipped = blocks.filter(b => checkedLanguages[b.language] && b.directives.skip).length + const compileOnly = snippets.filter(s => s.directives.compileOnly).length + const seconds = ((Date.now() - started) / 1000).toFixed(1) + for (const problem of unique) console.error(formatProblem(problem)) + console.log(`docs-check: ${snippets.length} code blocks in ${checkedFiles}: ${runnableCount || 0} type-checked and run, ` + + `${compileOnly} only type-checked, ${skipped} skipped; ${unique.length} problem(s) in ${seconds} s`) + process.exitCode = unique.length > 0 ? 1 : 0 +} + +if (require.main === module) { + main().catch(error => { + console.error(error) + process.exitCode = 1 + }) +} + +module.exports = { checkDocs, parseMarkdown, formatProblem } diff --git a/spec-docs/fixtures/broken.md b/spec-docs/fixtures/broken.md new file mode 100644 index 0000000..527933a --- /dev/null +++ b/spec-docs/fixtures/broken.md @@ -0,0 +1,236 @@ +# Fixture for spec-docs/self-test.js + +Every code block below is broken on purpose. `` says which problem the docs check must +report for the block (a substring of the message); `expect=pass` marks the control blocks that must pass. + + + +```typescript +import { Substitute, Arg } from '@fluffy-spoon/substitute' + +interface Calculator { + add(a: number, b: number): number + isEnabled: boolean +} + +const calculator = Substitute.for() +``` + + + +```typescript +calculator.add(1, 2).returns(3) +console.log(calculator.add(1, 2)) // prints 3 +calculator.received(1).add(1, 2) +calculator.received(2).add(1, 2) // throws SubstituteException: Expected to receive 2 method calls +``` + +A type error: + + + +```typescript +calculator.add('1', 2).returns(3) +``` + +The README text and the runtime disagree about a printed value: + + + +```typescript +calculator.add(1, 2).returns(3) +console.log(calculator.add(1, 2)) // prints 4 +``` + +The README promises an exception that does not happen: + + + +```typescript +calculator.add(1, 2) +calculator.received(1).add(1, 2) // throws SubstituteException +``` + +The wrong exception: + + + +```typescript +calculator.add(1, 2).throws(new Error('boom')) +calculator.add(1, 2) // throws SubstituteException +``` + +An exception the README does not mention: + + + +```typescript +calculator.received().add(1, 2) +``` + +A line that never runs: + + + +```typescript +if (calculator.isEnabled === true) { + console.log('never') // prints never +} +``` + +Output that is not checked: + + + +```typescript +console.log(calculator.add(1, 2)) +``` + +An assertion that is reported later, but the README does not say so: + + + +```typescript +calculator.add(1, 2) +calculator.add(1, 2) +calculator.add(1, 2) +calculator.received(2).add +``` + +The README says a failure is reported later, but it is not: + + + +```typescript +calculator.add(1, 2) +calculator.received(1).add(1, 2) +``` + +An unhandled rejection: + + +```typescript +Promise.reject(new Error('nobody waits for this')) +``` + +Top-level await in a CommonJS module: + + +```typescript +await Promise.resolve(1) +``` + +A failing node:test test: + + +```typescript +import { test } from 'node:test' +import * as assert from 'node:assert' + +test('fails', () => { + assert.strictEqual(1, 2) +}) +``` + +A block that uses a block that does not exist: + + + +```typescript +calculator.add(1, 2) +``` + +An unknown directive: + + + +```typescript +const value = 1 +``` + +A code block without a language: + + +``` +const value = 1 +``` + +`// prints` without console.log: + + + +```typescript +calculator.add(1, 2) // prints 3 +``` + +An ES module that cannot import a name: + + + +```js +import { Mock } from '@fluffy-spoon/substitute' +Mock.for() +``` + +An error message that does not match: + + + +```typescript +calculator.add(1, 2) +calculator.received().add(3, 4) // throws SubstituteException +``` + + + +```text +SubstituteException: Call count mismatch in @Substitute.add: +Expected to receive 1 or more method calls matching add(3, 5), but received none. +All property or method calls to @Substitute.add received so far: +› ✘ @Substitute.add(1, 2) + called at somewhere +``` + +Skipped blocks are not checked: + + + +```typescript +this is not TypeScript +``` + +Blocks can build on blocks that build on other blocks: + + + +```typescript +calculator.add(1, 1).returns(2) +``` + + + +```typescript +console.log(calculator.add(1, 1)) // prints 2 +``` + +But not in a cycle: + + + +```typescript +const a = 1 +``` + + + +```typescript +const b = 2 +``` + +Links are checked, too. These work: [the top of this file](#fixture-for-spec-docsself-testjs), [the README](../../README.md#usage) and `[not a link](in code)`. + + +A link to [a heading that does not exist](#no-such-heading). + + +A link to [a file that does not exist](MISSING.md). diff --git a/spec-docs/harness.js b/spec-docs/harness.js new file mode 100644 index 0000000..13a3592 --- /dev/null +++ b/spec-docs/harness.js @@ -0,0 +1,59 @@ +'use strict' +// Runs one compiled documentation snippet in its own process and records what it did: +// node harness.js +// check.js rewrites the `// prints` and `// throws` lines of a snippet into calls of the global `__docs` object below, +// so the result file says, per Markdown line, what was printed and what was thrown. Uncaught exceptions and unhandled +// rejections are recorded too (the snippet keeps running, like it would in a test runner). +const fs = require('fs') +const util = require('util') +const { pathToFileURL } = require('url') + +const [snippet, resultFile] = process.argv.slice(2) +const result = { prints: [], throws: [], uncaught: [], error: null } + +const describe = error => { + if (error === null || (typeof error !== 'object' && typeof error !== 'function')) { + return { name: typeof error, message: String(error), stack: '' } + } + let name + let message + let stack + try { name = String(error.name) } catch (_) { name = 'unknown' } + try { message = String(error.message) } catch (_) { message = '' } + try { stack = String(error.stack) } catch (_) { stack = '' } + return { name, message, stack } +} + +global.__docs = { + print (line, ...values) { + result.prints.push({ line, text: util.format(...values) }) + }, + throws (line, statement) { + try { + statement() + } catch (error) { + result.throws.push(Object.assign({ line, threw: true }, describe(error))) + return + } + result.throws.push({ line, threw: false }) + } +} + +process.on('uncaughtException', error => { + result.uncaught.push(Object.assign({ kind: 'uncaught exception' }, describe(error))) +}) +process.on('unhandledRejection', error => { + result.uncaught.push(Object.assign({ kind: 'unhandled rejection' }, describe(error))) +}) +process.on('exit', () => { + fs.writeFileSync(resultFile, JSON.stringify(result)) +}) + +const run = async () => { + if (snippet.endsWith('.mjs')) await import(pathToFileURL(snippet).href) + else require(snippet) +} + +run().catch(error => { + result.error = describe(error) +}) diff --git a/spec-docs/self-test.js b/spec-docs/self-test.js new file mode 100644 index 0000000..74d8d59 --- /dev/null +++ b/spec-docs/self-test.js @@ -0,0 +1,64 @@ +#!/usr/bin/env node +'use strict' +// Checks that the docs check fails when it should: runs it on spec-docs/fixtures/broken.md, whose code blocks are +// broken on purpose, and compares the problems it reports with the `` comment of each +// block, and with the `` comments for problems in the text (links). Part of +// `npm run test:docs`. +const fs = require('fs') +const path = require('path') +const { checkDocs, formatProblem } = require('./check') + +const fixture = path.join('spec-docs', 'fixtures', 'broken.md') + +const main = async () => { + const { problems, blocks } = await checkDocs({ files: [fixture] }) + const failures = [] + const claimed = new Set() + for (const block of blocks) { + const comment = block.comments.find(text => text.startsWith('self-test:')) + if (!comment) { + failures.push(`${fixture}:${block.fenceLine}: the block has no comment`) + continue + } + const expected = comment.replace(/^self-test:\s*expect=/, '').trim() + const lastLine = block.fenceLine + block.code.length + 1 + const own = problems.filter(problem => problem.line >= block.fenceLine && problem.line <= lastLine) + own.forEach(problem => claimed.add(problem)) + if (expected === 'pass') { + if (own.length > 0) failures.push(`${fixture}:${block.fenceLine}: expected no problems, but got:\n ${own.map(formatProblem).join('\n ')}`) + } else if (!own.some(problem => problem.message.includes(expected))) { + failures.push(`${fixture}:${block.fenceLine}: expected a problem containing ${JSON.stringify(expected)}, but got:\n ` + + (own.length > 0 ? own.map(formatProblem).join('\n ') : '(none)')) + } + } + const lines = fs.readFileSync(path.resolve(__dirname, '..', fixture), 'utf8').split(/\r?\n/) + let brokenLines = 0 + lines.forEach((line, index) => { + const comment = //.exec(line) + if (!comment) return + brokenLines++ + const own = problems.filter(problem => problem.line === index + 2) + own.forEach(problem => claimed.add(problem)) + if (!own.some(problem => problem.message.includes(comment[1]))) { + failures.push(`${fixture}:${index + 2}: expected a problem containing ${JSON.stringify(comment[1])}, but got:\n ` + + (own.length > 0 ? own.map(formatProblem).join('\n ') : '(none)')) + } + }) + for (const problem of problems.filter(p => !claimed.has(p))) { + failures.push(`unexpected problem outside of the fixture's code blocks: ${formatProblem(problem)}`) + } + const broken = blocks.filter(block => !block.comments.some(text => text === 'self-test: expect=pass')).length + if (failures.length > 0) { + console.error(failures.join('\n')) + console.error(`docs-check self-test: ${failures.length} of ${blocks.length} expectations failed`) + process.exitCode = 1 + } else { + console.log(`docs-check self-test: all ${broken} deliberately broken code blocks and ${brokenLines} broken links were reported, ` + + `the ${blocks.length - broken} other code blocks passed`) + } +} + +main().catch(error => { + console.error(error) + process.exitCode = 1 +}) diff --git a/spec-types/D05.configure.ts b/spec-types/D05.configure.ts new file mode 100644 index 0000000..e4b9cbb --- /dev/null +++ b/spec-types/D05.configure.ts @@ -0,0 +1,64 @@ +// D5 `sub[configure]()` is a view of the substitute in which member reads and calls are always setups. They expose the +// setup API (returns / throws / mimicks, and resolves / rejects for promises) and nothing else: no received / +// didNotReceive, and not the configured value. +import { Substitute, Arg, configure, returns, throws, mimicks, resolves, rejects } from '../src' +import { expectType } from './helpers' + +interface Calculator { + add(a: number, b: number): number + divide(a: number, b: number): number + heavyOperation(): Promise + find(id: string): string | null + reset(): void + isEnabled: boolean + received(count: number): string + returns: string[] +} + +const calculator = Substitute.for() +const setup = calculator[configure]() +setup.add(1, 3).returns(1337) +setup.add(1, 3).returns(1, 2, 3) +setup.add(Arg.all()).mimicks((a, b) => a + b) +setup.add(Arg.any(), Arg.is(b => b > 0)).throws(new Error()) +setup.divide(1, 0)[throws](new Error('Cannot divide by 0')) +setup.heavyOperation().resolves(4) +setup.heavyOperation().rejects(new Error()) +setup.heavyOperation()[resolves](4) +setup.heavyOperation()[rejects](new Error()) +setup.find('1').returns(null) +setup.reset().returns() +setup.isEnabled.returns(true) +setup.isEnabled[mimicks](() => false) +setup.add.returns((a, b) => a * b) +// members named like the library's methods are ordinary members here +setup.received(1).returns('one') +setup.returns.returns(['r']) +setup.returns[returns](['r']) + +// @ts-expect-error the configured value must have the member's type +setup.add(1, 3).returns('1337') +// @ts-expect-error resolves() is only offered for promises +setup.add(1, 3).resolves(1) +// @ts-expect-error the view only offers the setup API, not the value +const value: number = setup.add(1, 3) +// @ts-expect-error no assertions on the configure view +calculator[configure]().received(1).add(1, 3) +// @ts-expect-error the view has no assertion methods +setup.didNotReceive() +// @ts-expect-error the view has no configure method itself +setup[configure]() + +expectType(calculator.add(1, 3)) +export { value } + +// members typed `any` +interface Loose { value: any; call: any; method(input: any): any } +const loose = Substitute.for() +loose[configure]().call(1, 2).returns(3) +loose[configure]().value.returns(1) +loose[configure]().method(Arg.any()).returns(2) +loose.call(1).returns(3) +loose.value.returns(1) +loose.method(1).returns(2) +loose.received().call(1) diff --git a/spec-types/D11.assertion-name-conflicts.ts b/spec-types/D11.assertion-name-conflicts.ts new file mode 100644 index 0000000..7e985f0 --- /dev/null +++ b/spec-types/D11.assertion-name-conflicts.ts @@ -0,0 +1,74 @@ +// D11 If T has a member named received, didNotReceive, returns, throws, resolves, rejects or mimicks, only the symbol +// forms `sub[received]()` / `sub[didNotReceive]()` are offered. This rules out the ambiguous `sub.received().returns(5)`, +// which the runtime treats as a setup of a member called `received`. The symbol forms are always offered. +import { Substitute, Arg, received, didNotReceive, clearReceivedCalls } from '../src' + +interface Plain { add(a: number, b: number): number } +const plain = Substitute.for() +plain.received().add(1, 2) +plain.received(2).add(1, 2) +plain.didNotReceive().add(1, 2) +plain[received]().add(1, 2) +plain[received](0).add(1, 2) +plain[didNotReceive]().add(1, 2) +plain[clearReceivedCalls]() + +interface Account { + returns(item: string): number + balance(): number +} +const account = Substitute.for() +account.returns('book').returns(5) +account[received]().returns('book') +account[received](1).balance() +account[didNotReceive]().returns(Arg.any()) +// @ts-expect-error ambiguous: Account has a member named `returns` +account.received().returns('book') +// @ts-expect-error ambiguous: Account has a member named `returns` +account.didNotReceive().balance() + +interface Inbox { + received: string[] + didNotReceive(): boolean + open(): void +} +const inbox = Substitute.for() +inbox.received.returns(['mail']) +inbox.didNotReceive().returns(true) +inbox[received]().open() +inbox[received]().didNotReceive() +inbox[received](2).received +inbox[didNotReceive]().open() +// `inbox.received` is the member, not the assertion +// @ts-expect-error string[] is not callable +inbox.received(1) + +// every name in the rule +interface WithThrows { throws: boolean; run(): void } +interface WithResolves { resolves(): void; run(): void } +interface WithRejects { rejects: number; run(): void } +interface WithMimicks { mimicks(): void; run(): void } +const withThrows = Substitute.for() +const withResolves = Substitute.for() +const withRejects = Substitute.for() +const withMimicks = Substitute.for() +withThrows[received]().run() +withResolves[received]().run() +withRejects[received]().run() +withMimicks[received]().run() +// @ts-expect-error WithThrows has a member named `throws` +withThrows.received() +// @ts-expect-error WithResolves has a member named `resolves` +withResolves.received() +// @ts-expect-error WithRejects has a member named `rejects` +withRejects.didNotReceive() +// @ts-expect-error WithMimicks has a member named `mimicks` +withMimicks.didNotReceive() + +// Members named mimick, configure or clearReceivedCalls do not conflict: those are symbol-only APIs. +interface Tools { mimick(): void; configure(): void; clearReceivedCalls(): void } +const tools = Substitute.for() +tools.received().configure() +tools.configure().returns() +tools.clearReceivedCalls() +tools[clearReceivedCalls]() diff --git a/spec-types/G-RG-9.substitute-exception.ts b/spec-types/G-RG-9.substitute-exception.ts new file mode 100644 index 0000000..22fc028 --- /dev/null +++ b/spec-types/G-RG-9.substitute-exception.ts @@ -0,0 +1,20 @@ +// G:RG-9 SubstituteException is exported from the package index, so `instanceof` works without deep imports. +import SubstituteDefault, { Substitute, SubstituteException } from '../src' +import { expectType } from './helpers' + +interface Calculator { add(a: number, b: number): number } +const calculator = Substitute.for() + +try { + calculator.received().add(1, 2) +} catch (error) { + if (error instanceof SubstituteException) { + expectType(error.message) + expectType(error.type) + expectType(error) + } +} + +const exception: Error = new SubstituteException('message') +expectType(SubstituteDefault) +export { exception } diff --git a/spec-types/R3TD-1.T33.constrained-generics.ts b/spec-types/R3TD-1.T33.constrained-generics.ts new file mode 100644 index 0000000..986166f --- /dev/null +++ b/spec-types/R3TD-1.T33.constrained-generics.ts @@ -0,0 +1,86 @@ +// R3TD-1 / T33 SubstituteOf for a constrained type parameter (`T extends Calculator`): setups, checks and the +// configure view work through the constraint, as for a SubstituteOf. The values they take are checked +// against the constraint's member types. +// (On TypeScript 3.6 to 3.8, members whose type includes null or undefined, such as `name` and `limit` below, have no +// setup API in generic code, and on TypeScript 3.6 to 4.7 calls of optional methods are not callable there; see +// R4TD-2.R4V-1.T40.generic-optional-members.ts. spec-types/min-ts/consumer.ts checks the rest with TypeScript 3.6.) +import { Substitute, SubstituteOf, Arg, configure, received, didNotReceive, returns, mimicks } from '../src' + +interface Calculator { + add(a: number, b: number): number + load(id: string): Promise + total: number + name: string | null + limit?: number +} + +export function stub(s: SubstituteOf) { + s.total.returns(1) + s.total.returns(1, 2) + s.total[returns](3) + s.add(1, 2).returns(3) + s.add(Arg.any(), Arg.is(b => b > 0)).returns(4) + s.add(1, Arg.all()).returns(5) + s.add(Arg.all()).mimicks((a, b) => a + b) + s.add(1, 2)[mimicks]((a, b) => a - b) + s.load('a').resolves(1) + s.load('a').rejects(new Error()) + s.name.returns('x') + s.name.returns(null) + s.limit.returns(10) + s[configure]().total.returns(1) + s[configure]().add(1, 2).returns(3) + s[configure]().load(Arg.any()).resolves(2) + + s.received().add(1, 2) + s.received(2).add(1, Arg.all()) + s.didNotReceive().add(Arg.all()) + s.received().total = 1 + s.received(1).total = Arg.any() + s.didNotReceive().name = null + s.received().limit = undefined + s[received](1).total = 2 + s[didNotReceive]().add(1, 2) + const total: number = s.received().total + + // @ts-expect-error the configured value has the member's type + s.total.returns('1') + // @ts-expect-error the configured value has the member's type + s.add(1, 2).returns('3') + // @ts-expect-error the arguments keep their types + s.add('1', 2) + // @ts-expect-error the arguments keep their types in the assertion view + s.received().add('1', 2) + // @ts-expect-error a property check keeps the member's type + s.received().total = '1' + // @ts-expect-error a required property does not accept undefined + s.received().total = undefined + // @ts-expect-error the configure view checks the value too + s[configure]().total.returns('1') + // @ts-expect-error resolves() is only offered for promises + s.add(1, 2).resolves(3) + // @ts-expect-error not a member of the constraint + s.subtract(1, 2) + return total +} + +export class Fixture { + sub = Substitute.for() + arrange() { + this.sub.add(1, 2).returns(3) + this.sub.total.returns(10) + this.sub[configure]().add(Arg.all()).returns(0) + } + verify() { + this.sub.received().add(1, 2) + this.sub.received().total = 10 + } +} + +interface ScientificCalculator extends Calculator { sqrt(x: number): number } +const fixture = new Fixture() +fixture.arrange() +fixture.sub.sqrt(4).returns(2) +fixture.verify() +stub(Substitute.for()) +stub(fixture.sub) diff --git a/spec-types/R3TD-2.T34.optional-callback-assertion.ts b/spec-types/R3TD-2.T34.optional-callback-assertion.ts new file mode 100644 index 0000000..eccf7f2 --- /dev/null +++ b/spec-types/R3TD-2.T34.optional-callback-assertion.ts @@ -0,0 +1,47 @@ +// R3TD-2 / T34 Checking that the code under test cleared an OPTIONAL FUNCTION-TYPED property. +// Limitation (TypeScript 3.6 to 5.9 with strictNullChecks): `widget.received().onChange = undefined` does not compile. +// In the assertion view `onChange` is callable (`widget.received().onChange('x')` checks a call), and TypeScript uses +// one type for reading and writing such a property: a type that accepts `undefined` cannot be called without a +// "possibly undefined" error. Optional properties that are not functions accept `undefined` (TD-7.T30). +// Ways around it, all checked at runtime the same way (a property set to `undefined`): +// (widget.received() as Widget).onChange = undefined +// widget.received().onChange = Arg.any.not('function') (a set to any value that is not a function) +import { Substitute, SubstituteOf, Arg, received, didNotReceive } from '../src' + +interface Widget { + note?: string + onChange?: (value: string) => void + onClose?(): void +} +const widget = Substitute.for() +const detach = (w: Widget) => { w.note = undefined; w.onChange = undefined } +detach(widget) + +widget.received().note = undefined +// calls of optional callbacks are checked as calls +widget.received().onChange('x') +widget.received().onChange(Arg.all()) +widget.didNotReceive().onClose() +widget[received](1).onChange(Arg.any()) + +// @ts-expect-error limitation: an optional function-typed property does not accept undefined in the assertion view +widget.received().onChange = undefined +// @ts-expect-error limitation, also in the symbol form +widget[received](1).onChange = undefined + +// the ways around it +;(widget.received() as Widget).onChange = undefined +;(widget[received](1) as Widget).onChange = undefined +;(widget.didNotReceive() as Widget).onChange = undefined +;(widget[didNotReceive]() as Widget).onChange = undefined +widget.received().onChange = Arg.any.not('function') + +// @ts-expect-error the cast keeps the property's type +;(widget.received() as Widget).onChange = 'x' + +// The same in generic code over a constraint (T33) +export function cleared(sub: SubstituteOf) { + sub.received().note = undefined + sub.received().onChange('x') + ;(sub.received() as Widget).onChange = undefined +} diff --git a/spec-types/R3TD-4.T36.null-only-union-variants.ts b/spec-types/R3TD-4.T36.null-only-union-variants.ts new file mode 100644 index 0000000..65b8956 --- /dev/null +++ b/spec-types/R3TD-4.T36.null-only-union-variants.ts @@ -0,0 +1,76 @@ +// R3TD-4 / T36 A union whose variants declare members as only null/undefined (`{ data: T; error: null } | +// { data: null; error: E }`, and the `?: undefined` "XOR" form) does not reduce Substitute.for<...>() to `never`. +// Such a member reads as the setup API intersected with the other variants' types, and `.returns(...)` takes the type +// the variants have in common (`string[] | null`). Unions without such members (Cat | Dog) are unchanged. +import { Substitute, SubstituteOf, configure, received } from '../src' +import { assert, Equals, expectType } from './helpers' + +// PostgREST / Supabase style +type QueryResult = { data: string[]; error: null } | { data: null; error: Error } +const result = Substitute.for() +result.data.returns(['a']) +result.data.returns(null) +result.error.returns(null) +result.error.returns(new Error('x')) +result[configure]().data.returns(['b']) +result.received().data +result.received().error = null +result[received](1).data = ['a'] +const asResult: QueryResult = result +const data: string[] = result.data +// @ts-expect-error the configured value has the members' common type +result.data.returns('a') +// @ts-expect-error the assertion view keeps the members' common type +result.received().error = 'x' + +// The XOR form, which compiled with 2.0.0-beta.4 +type Outcome = { ok: true; value: string; error?: undefined } | { ok: false; value?: undefined; error: Error } +const outcome = Substitute.for() +outcome.ok.returns(true) +outcome.value.returns('x') +outcome.value.returns(undefined) +outcome.error.returns(new Error()) +outcome.received().value = undefined +const asOutcome: Outcome = outcome +// @ts-expect-error `ok` is a boolean +outcome.ok.returns('yes') + +// Only some variants declare the member as null +type Load = { status: 'idle'; data: null } | { status: 'done'; data: string } +const load = Substitute.for() +load.status.returns('idle') +load.status.returns('done') +load.data.returns('x') +load.data.returns(null) +const asLoad: Load = load +// @ts-expect-error `status` is 'idle' | 'done' +load.status.returns('loading') + +// A member that is only null/undefined in every variant keeps its plain type (T25) +type Both = { kind: 'a'; a: number; gone: null } | { kind: 'b'; b: number; gone: null } +const both = Substitute.for() +both.kind.returns('a') +assert>() +const asBoth: Both = both + +// Unions without such members +interface Cat { kind: 'cat'; name: string; meow(): string } +interface Dog { kind: 'dog'; name: string; bark(times: number): string } +const pet = Substitute.for() +pet.kind.returns('cat') +pet.name.returns('Rex') +pet.received().name +const asPet: Cat | Dog = pet +expectType>(pet) +// @ts-expect-error not a member of every variant +pet.meow() +// @ts-expect-error `kind` is 'cat' | 'dog' +pet.kind.returns('cow') + +// In generic code nothing changes +export function generic(sub: SubstituteOf) { + sub.received().data + return sub +} + +export { asResult, asOutcome, asLoad, asBoth, asPet, data } diff --git a/spec-types/R3TD-6.R3-3.T37.function-substitutes.ts b/spec-types/R3TD-6.R3-3.T37.function-substitutes.ts new file mode 100644 index 0000000..62acdcd --- /dev/null +++ b/spec-types/R3TD-6.R3-3.T37.function-substitutes.ts @@ -0,0 +1,108 @@ +// R3TD-6 / R3-3 / T37 A substitute of a function type, or of an interface with call signatures, is called like the +// function: each call has the setup API (`listener('saved').returns('ack')`), and the assertion and configure views +// are callable too (`listener.received(1)('saved')`, `listener[received](1)('saved')`, +// `listener[configure]()('saved').returns('ack')`). +import { Substitute, SubstituteOf, Arg, received, didNotReceive, configure, mimick, returns, throws } from '../src' +import { assert, Equals, expectType } from './helpers' + +type Listener = (event: string) => string +const listener = Substitute.for() +listener('saved').returns('ack') +listener('saved').returns('ack', 'again') +listener(Arg.any()).returns('any') +listener(Arg.is(event => event.length > 3)).throws(new Error()) +listener(Arg.all()).mimicks(event => event.toUpperCase()) +listener('saved')[returns]('ack') +listener('saved')[throws](new Error()) +listener.received(1)('saved') +listener.received()(Arg.any()) +listener.didNotReceive()('deleted') +listener.didNotReceive()(Arg.all()) +listener[received](1)('saved') +listener[didNotReceive]()(Arg.is(event => event === '')) +listener[configure]()('saved').returns('ack') +listener[configure]()(Arg.all()).mimicks(event => event) +listener[mimick](event => event) +const asListener: Listener = listener +const answer: string = listener('saved') +expectType>(listener) + +// @ts-expect-error the configured value keeps the return type +listener('saved').returns(1) +// @ts-expect-error the arguments keep their types +listener(1) +// @ts-expect-error the arguments keep their types in the assertion view +listener.received(1)(1) +// @ts-expect-error the arguments keep their types in the assertion view +listener[received](1)(1) +// @ts-expect-error the arguments keep their types in the configure view +listener[configure]()(1).returns('x') +// @ts-expect-error a call in the assertion view returns nothing +listener.received(1)('saved').returns('x') +// @ts-expect-error the configure view only offers the setup API, not the value +const configured: string = listener[configure]()('saved') +// @ts-expect-error the call has a parameter +listener.received(1)() + +// Overloads, a promise and void +interface Format { + (value: number): string + (value: string, radix: number): number +} +const format = Substitute.for() +format(1).returns('1') +format('10', 2).returns(2) +format.received()('10', 2) +format[configure]()(Arg.all()).returns('x') +// @ts-expect-error the overload taking a number returns a string +format(1).returns(1) +// @ts-expect-error no overload takes a string alone +format('10') + +type Load = (id: number) => Promise +const load = Substitute.for() +load(1).resolves('one') +load(Arg.any()).rejects(new Error()) +// @ts-expect-error the promise resolves to a string +load(1).resolves(1) + +type Notify = () => void +const notify = Substitute.for() +notify().returns() +notify.received(2)() + +// An interface with a call signature and members +interface Counter { + (step: number): number + count: number + reset(): void +} +const counter = Substitute.for() +counter(1).returns(2) +counter.count.returns(5) +counter.reset().returns() +counter.received()(1) +counter.received().reset() +counter.received().count = 3 +counter[configure]()(2).returns(4) +counter[configure]().count.returns(6) +const asCounter: Counter = counter +// @ts-expect-error the call returns a number +counter(1).returns('2') + +// A function type as a member keeps working as before +interface Emitter { listener: Listener } +const emitter = Substitute.for() +emitter.listener('saved').returns('ack') +emitter.received().listener('saved') + +// Types that are not callable get no call signatures +interface Calculator { add(a: number, b: number): number } +const calculator = Substitute.for() +// @ts-expect-error a Calculator is not callable +calculator(1) +// @ts-expect-error not callable in the assertion view either +calculator.received()(1) +assert>() + +export { asListener, asCounter, configured } diff --git a/spec-types/R3TD-7.T38.arg-any-undefined.ts b/spec-types/R3TD-7.T38.arg-any-undefined.ts new file mode 100644 index 0000000..64dc2e7 --- /dev/null +++ b/spec-types/R3TD-7.T38.arg-any-undefined.ts @@ -0,0 +1,66 @@ +// R3TD-7 / T38 `Arg.any('undefined')` fits only parameters (and properties) that accept `undefined`. It used to be +// typed `never`, which fits every parameter. Its type is taken from where it is used: the parameter type when that +// accepts `undefined`, otherwise `undefined` (a compile error there). On its own it is `undefined`. +// `Arg.any.not('undefined')` matches every defined value and still fits any parameter. +import { Substitute, SubstituteOf, Arg, configure, received } from '../src' +import { Argument } from '../src/shared' +import { assert, Equals } from './helpers' + +interface Calculator { + add(a: number, b: number): number + find(id?: string): string + maybe(value: number | undefined): number + anything(value: unknown): void + save(item: { id: string }): void + note?: string + title: string +} +const calculator = Substitute.for() + +calculator.find(Arg.any('undefined')).returns('none') +calculator.maybe(Arg.any('undefined')).returns(0) +calculator.anything(Arg.any('undefined')) +calculator.received().find(Arg.any('undefined')) +calculator.didNotReceive().maybe(Arg.any('undefined')) +calculator[received](1).anything(Arg.any('undefined')) +calculator[configure]().find(Arg.any('undefined')).returns('none') +calculator.received().note = Arg.any('undefined') + +// @ts-expect-error a number parameter does not accept undefined +calculator.add(Arg.any('undefined'), 2).returns(3) +// @ts-expect-error nor in the assertion view +calculator.received().add(1, Arg.any('undefined')) +// @ts-expect-error nor in the configure view +calculator[configure]().add(Arg.any('undefined'), 2).returns(3) +// @ts-expect-error an object parameter does not accept undefined +calculator.save(Arg.any('undefined')) +// @ts-expect-error a required property does not accept undefined +calculator.received().title = Arg.any('undefined') + +// on its own +const missing = Arg.any('undefined') +assert>() +calculator.find(missing) +// @ts-expect-error a number parameter does not accept undefined +calculator.add(missing, 2) + +// as a matcher object (spec/regression/Arguments.spec.ts does this) +const matches: boolean = (>Arg.any('undefined')).matches(undefined) + +// the inverse fits any parameter +calculator.add(Arg.any.not('undefined'), 2).returns(3) +calculator.save(Arg.any.not('undefined')) +calculator.received().title = Arg.any.not('undefined') +// the other types are unchanged (`Arg.any.not('number')` is typed like `Arg.any('number')`) +calculator.add(Arg.any('number'), Arg.any.not('number')) +// @ts-expect-error a string matcher does not fit a number parameter +calculator.add(Arg.any('string'), 2) + +// generic code over a constraint (T33) +export function stub(sub: SubstituteOf) { + sub.find(Arg.any('undefined')).returns('none') + // @ts-expect-error a number parameter does not accept undefined + sub.add(Arg.any('undefined'), 2) +} + +export { matches } diff --git a/spec-types/R4TD-1.T39.function-union-members.ts b/spec-types/R4TD-1.T39.function-union-members.ts new file mode 100644 index 0000000..3c38c82 --- /dev/null +++ b/spec-types/R4TD-1.T39.function-union-members.ts @@ -0,0 +1,115 @@ +// R4TD-1 / T39 A member whose type is a union of function types with different signatures (`Cat | Dog` whose methods +// return different types, `this`-returning methods in a union, a callback member typed as a union of function types) +// has the setup API, with the union of the variants' return types: `.returns('meow')`, `.resolves(1)`, `.mimicks(...)` +// and the configure view take what any variant returns (a regression in round 4, where they took `never`). +// Generic code is unchanged: see R3TD-1.T33.constrained-generics.ts. +import { Substitute, SubstituteOf, Arg, configure, received, didNotReceive, returns, mimicks, resolves } from '../src' + +interface Cat { kind: 'cat'; speak(): 'meow'; load(): Promise; rename(name: string): this; age(): number } +interface Dog { kind: 'dog'; speak(): 'woof'; load(): Promise; rename(name: string): this; age(): number } +const pet = Substitute.for() +pet.speak().returns('meow') +pet.speak().returns('woof', 'meow') +pet.speak()[returns]('woof') +pet.speak().mimicks(() => 'woof') +pet.speak()[mimicks](() => 'meow') +pet.load().resolves(1) +pet.load().resolves('one') +pet.load()[resolves](2) +pet.load().rejects(new Error()) +pet.rename('Rex').returns(pet) +pet.rename(Arg.any()).returns(pet) +pet.age().returns(3) +pet[configure]().speak().returns('meow') +pet[configure]().load().resolves(1) +pet[configure]().rename('Rex').returns(pet) +pet.received().speak() +pet.received(1).rename('Rex') +pet[received](1).load() +pet[didNotReceive]().speak() +const said: 'meow' | 'woof' = pet.speak() +const asPet: Cat | Dog = pet + +// @ts-expect-error the configured value is one of the variants' return types +pet.speak().returns('moo') +// @ts-expect-error the promise resolves to a number or a string +pet.load().resolves(true) +// @ts-expect-error the implementation returns one of the variants' return types +pet.speak().mimicks(() => 'moo') +// @ts-expect-error the configure view checks the value too +pet[configure]().speak().returns('moo') +// @ts-expect-error resolves() is only offered for promises +pet.speak().resolves('meow') +// @ts-expect-error the arguments keep their types +pet.rename(1) +// @ts-expect-error the arguments keep their types in the assertion view +pet.received().rename(1) +// @ts-expect-error a call in the assertion view returns nothing +pet.received().speak().returns('meow') + +// A callback member typed as a union of function types +interface Listeners { onResult: ((result: string) => number) | ((result: string) => string) } +const listeners = Substitute.for() +listeners.onResult('x').returns(1) +listeners.onResult('x').returns('y') +listeners.onResult(Arg.all()).mimicks(result => result.length) +listeners[configure]().onResult('x').returns(1) +listeners.received().onResult('x') +// @ts-expect-error the configured value is a number or a string +listeners.onResult('x').returns(true) +// @ts-expect-error the arguments keep their types +listeners.onResult(1) + +// Object unions whose methods differ +type Shape = { kind: 'circle'; area(): number } | { kind: 'text'; area(): string } +const shape = Substitute.for() +shape.area().returns(1) +shape.area().returns('x') +shape[configure]().area().returns(2) +// @ts-expect-error the configured value is a number or a string +shape.area().returns(true) +const asShape: Shape = shape + +interface Ok { ok: true; get(): string } +interface Fail { ok: false; get(): never } +const outcome = Substitute.for() +outcome.get().returns('x') +outcome.get().throws(new Error()) +// @ts-expect-error the configured value is a string +outcome.get().returns(1) + +// A substitute of a union of function types +type Handler = ((event: string) => number) | ((event: string) => string) +const handler = Substitute.for() +handler('x').returns(1) +handler('x').returns('y') +handler[configure]()('x').returns(2) +handler.received()('x') +// @ts-expect-error the configured value is a number or a string +handler('x').returns(true) + +// lib.dom unions +const field = Substitute.for() +field.checkValidity().returns(true) +field.cloneNode().returns(document.createElement('input')) +field.setCustomValidity('x').returns() +field.received().addEventListener('change', Arg.any()) + +// A rest parameter typed as a union of tuples puts both tuples in every overload position of the expansion. The +// signatures of identical positions must stay identical types, so that their intersection collapses; with one +// distinct type per position, type-checking this took minutes (and ran out of memory on TypeScript 5.4). +interface Varargs { log(...args: [string] | [string, number]): boolean } +const varargs = Substitute.for() +const asVarargs: Varargs = varargs +varargs.received().log('a') +varargs.received().log('a', 1) + +// Generic code with a union constraint: members whose signature is the same in every variant are configured through +// the constraint (T33). (Members whose signatures differ are a documented limitation, see limitations.ts.) +export function stub(sub: SubstituteOf) { + sub.age().returns(1) + sub.kind.returns('cat') + sub.received().speak() +} + +export { said, asPet, asShape, asVarargs } diff --git a/spec-types/R4TD-2.R4V-1.T40.generic-optional-members.ts b/spec-types/R4TD-2.R4V-1.T40.generic-optional-members.ts new file mode 100644 index 0000000..cc66560 --- /dev/null +++ b/spec-types/R4TD-2.R4V-1.T40.generic-optional-members.ts @@ -0,0 +1,106 @@ +// R4TD-2 / R4V-1 / T40 Optional and nullable members in generic code. +// Everything below compiles with TypeScript 4.8 and newer (`npm run test:types`). Older versions have limitations that +// the typings cannot avoid (checked with the cross-version harness on TypeScript 3.6, 3.7, 3.8, 3.9, 4.0, 4.1, 4.5, +// 4.7, 4.8, 4.9, 5.0, 5.4, 5.9 and 7.0): +// - TypeScript 3.6 to 4.7: with a constrained type parameter, calls of optional methods and of members typed +// `fn | undefined` are "not callable" (TS2349): `sub.reset()`, `sub.find('a')`, `sub.maybeAdd(1)`, `sub.load()` in +// `stub` below, `this.sub.reset()` in `Fixture`, and the methods of `T extends Partial`. +// - TypeScript 3.6 to 3.8: properties whose type includes `null` or `undefined` have no setup API (TS2339), with a +// constrained type parameter (`sub.limit`, `sub.name`, the properties of `T extends Partial`) and in an +// interface instantiated with any type parameter, constrained or not (`box.maybe` with `maybe?: T`, `box.orNull` +// with `orNull: T | null`). +// The configure view and the checks work on every version (spec-types/min-ts/consumer.ts checks them with TypeScript +// 3.6): `sub[configure]().reset().returns()`, `sub[configure]().limit.returns(10)`, `box[configure]().maybe.returns(x)`, +// `sub.received().reset()`. +// (Intersecting the setup API with `Required` instead of `T` in generic code would remove both limitations, but a +// substitute would then no longer be assignable to a constraint class with private or protected members.) +import { Substitute, SubstituteOf, Arg, configure, received, didNotReceive, returns } from '../src' + +interface Calculator { + add(a: number, b: number): number + total: number + name: string | null + limit?: number + reset?(): void + find?(id: string): string | undefined + maybeAdd: ((a: number) => number) | undefined + load?(): Promise +} + +export function stub(sub: SubstituteOf) { + sub.name.returns('x') + sub.name.returns(null) + sub.limit.returns(10) + sub.limit.returns(undefined) + sub.reset().returns() + sub.reset()[returns]() + sub.find('a').returns('b') + sub.find(Arg.any()).returns(undefined) + sub.maybeAdd(1).returns(2) + sub.load().resolves(1) + + // the forms that work on every version + sub[configure]().reset().returns() + sub[configure]().find('a').returns('b') + sub[configure]().maybeAdd(1).returns(2) + sub[configure]().limit.returns(10) + sub[configure]().name.returns(null) + sub.received().reset() + sub.received().find('a') + sub.received().limit = undefined + sub[received](1).maybeAdd(Arg.all()) + sub[didNotReceive]().reset() + + // @ts-expect-error the configured value has the member's type + sub.limit.returns('10') + // @ts-expect-error the configured value has the member's type + sub.find('a').returns(1) + // @ts-expect-error the promise resolves to a number + sub.load().resolves('x') + // @ts-expect-error the arguments keep their types + sub.maybeAdd('1') + // @ts-expect-error the method has no parameters + sub.reset(1) + // @ts-expect-error a call in the assertion view returns nothing + sub.received().reset().returns() + const asT: T = sub + const asCalculator: Calculator = sub + return [asT, asCalculator] +} + +export class Fixture { + sub = Substitute.for() + arrange() { + this.sub.reset().returns() + this.sub.limit.returns(1) + this.sub[configure]().reset().returns() + } +} + +export function partial>(sub: SubstituteOf) { + sub.total.returns(1) + sub.add(1, 2).returns(3) + sub[configure]().add(1, 2).returns(3) + sub.received().add(1, 2) +} + +interface Box { current: T; maybe?: T; orNull: T | null; load?(): T } +export function stubBox(box: SubstituteOf>, value: T) { + box.current.returns(value) + box.maybe.returns(value) + box.maybe.returns(undefined) + box.orNull.returns(value) + box.orNull.returns(null) + box.load().returns(value) + box[configure]().maybe.returns(value) + box[configure]().orNull.returns(value) + ;(box.received() as Box).maybe = value // see limitations.ts (`current: T`) + const asBox: Box = box + return asBox +} + +const calculator = Substitute.for() +stub(calculator) +new Fixture().arrange() +partial(calculator) +stubBox(Substitute.for>(), 'x') diff --git a/spec-types/R4TD-3.T41.generic-index-signatures.ts b/spec-types/R4TD-3.T41.generic-index-signatures.ts new file mode 100644 index 0000000..e366220 --- /dev/null +++ b/spec-types/R4TD-3.T41.generic-index-signatures.ts @@ -0,0 +1,69 @@ +// R4TD-3 / T41 Constrained generic code: keys that exist only through the constraint's string index signature +// (`T extends { [key: string]: number; port: number }`, `sub.timeout`) can be configured, with values checked against +// the index signature's type, and called (index signatures of function types) and read in checks. +// Checking a set of such a key (`sub.received().timeout = 5`) does not compile: TypeScript does not resolve a write +// through an index signature on a generic type (TS2339). Check it through the constraint type instead (below). +import { Substitute, SubstituteOf, Arg, configure, received, didNotReceive, returns } from '../src' + +interface Settings { [key: string]: number; port: number } +export function stubSettings(sub: SubstituteOf) { + sub.port.returns(80) + sub.timeout.returns(5) + sub.timeout.returns(5, 6) + sub.timeout[returns](7) + sub[configure]().timeout.returns(5) + sub.received().timeout + sub[received](1).timeout + sub.didNotReceive().timeout + sub.received().port = 80 + const timeout: number = sub.timeout + ;(sub.received() as Settings).timeout = 5 + ;(sub as SubstituteOf).received().timeout = 5 + + // @ts-expect-error the configured value has the index signature's type + sub.timeout.returns('5') + // @ts-expect-error the configure view checks the value too + sub[configure]().timeout.returns('5') + // @ts-expect-error the named member keeps its own type + sub.port.returns('80') + // @ts-expect-error the limitation: a set of an index-signature key in a check + sub.received().timeout = 5 + return timeout +} + +interface Mixed { [key: string]: number | string; id: number; name: string } +export function stubMixed(sub: SubstituteOf) { + sub.id.returns(1) + sub.extra.returns(1) + sub.extra.returns('x') + sub[configure]().extra.returns('y') + // @ts-expect-error the configured value has the index signature's type + sub.extra.returns(true) +} + +interface Handlers { [name: string]: (payload: string) => number; save(payload: string): number } +export function stubHandlers(sub: SubstituteOf) { + sub.save('x').returns(1) + sub.other('x').returns(2) + sub.other(Arg.all()).mimicks(payload => payload.length) + sub[configure]().other('x').returns(2) + sub.received().other('x') + sub[didNotReceive]().other(Arg.any()) + // @ts-expect-error the call returns a number + sub.other('x').returns('2') + // @ts-expect-error the arguments keep their types + sub.received().other(1) +} + +// Concrete types are unchanged +const settings = Substitute.for() +settings.timeout.returns(5) +settings.received().timeout = 5 +// @ts-expect-error the configured value has the index signature's type +settings.timeout.returns('5') +const mixed = Substitute.for() +mixed.extra.returns(1) +mixed.extra.returns('x') +stubSettings(settings) +stubMixed(mixed) +stubHandlers(Substitute.for()) diff --git a/spec-types/R5TD-1.T42.union-variant-parameter-lists.ts b/spec-types/R5TD-1.T42.union-variant-parameter-lists.ts new file mode 100644 index 0000000..b9f5c2d --- /dev/null +++ b/spec-types/R5TD-1.T42.union-variant-parameter-lists.ts @@ -0,0 +1,260 @@ +// R5TD-1 / T42 A union whose variants declare a method with DIFFERENT parameter lists (an extra optional parameter, +// different parameter types, a generic method in one variant, overloads in one variant) has the setup API on calls of +// that method, as for variants whose parameter lists are the same (T39, R4TD-1.T39.function-union-members.ts): +// `.returns()`, `.resolves()`, `.rejects()`, `.throws()`, `.mimicks()` and the configure view take what any variant +// whose overloads the call can reach returns. Values no variant returns are still rejected. +import { Substitute, SubstituteOf, Arg, configure, received, didNotReceive, returns } from '../src' +import { expectType } from './helpers' + +// API clients of two versions: the newer `fetch` takes an optional second parameter; same return type. +interface Options { timeout: number } +interface ClientV1 { version: 1; fetch(url: string): Promise } +interface ClientV2 { version: 2; fetch(url: string, options?: Options): Promise } +const client = Substitute.for() +client.fetch('/a').resolves('ok') +client.fetch(Arg.any()).returns(Promise.resolve('ok')) +client.fetch('/a', { timeout: 1 }).resolves('ok') +client.fetch('/a').rejects(new Error('offline')) +client.fetch(Arg.all()).resolves('ok') +client.fetch('/a', Arg.all()).resolves('ok') +client[configure]().fetch('/a').resolves('ok') +client.received().fetch('/a') +client.received(1).fetch('/a', { timeout: 1 }) +client[didNotReceive]().fetch(Arg.any()) +const fetched: Promise = client.fetch('/a') +const asClient: ClientV1 | ClientV2 = client +// @ts-expect-error the promise resolves to a string +client.fetch('/a').resolves(1) +// @ts-expect-error the configure view checks the value too +client[configure]().fetch('/a').resolves(1) +// @ts-expect-error the arguments keep their types +client.fetch(1) +// @ts-expect-error the arguments keep their types in the assertion view +client.received().fetch('/a', { timeout: '1' }) + +// The same return type (`void`), differing parameter lists. +interface LogA { kind: 'a'; log(message: string): void } +interface LogB { kind: 'b'; log(message: string, level?: number): void } +const logger = Substitute.for() +logger.log('x').returns() +logger.log('x').throws(new Error()) +logger.log('x', 2).returns() +logger.log(Arg.is(message => message.length > 0)).returns() +logger.log('x')[returns](undefined) +logger[configure]().log('x').returns() +logger.received().log('x') +logger.received().log('x', 1) +// @ts-expect-error `log` returns nothing +logger.log('x').returns(1) +// @ts-expect-error the arguments keep their types +logger.log('x', 'warning') + +// Differing return types and differing parameter lists. +interface ReaderA { kind: 'a'; read(path: string): string } +interface ReaderB { kind: 'b'; read(path: string, encoding?: string): Uint8Array } +const reader = Substitute.for() +reader.read('p').returns('text') +reader.read('p').returns(new Uint8Array()) +reader.read('p').returns('text', new Uint8Array()) +reader.read('p', 'utf8').returns('text') +reader.read(Arg.any()).returns('text') +reader.read(Arg.all()).returns(new Uint8Array()) +reader.read('p').mimicks(path => path) +reader.read('p').mimicks(() => new Uint8Array()) +reader[configure]().read('p').returns('text') +reader[configure]().read('p').returns(new Uint8Array()) +reader[received](1).read('p') +const read: string | Uint8Array = reader.read('p') +// @ts-expect-error the configured value is a string or a Uint8Array +reader.read('p').returns(1) +// @ts-expect-error the configure view checks the value too +reader[configure]().read('p').returns(1) +// @ts-expect-error the implementation returns a string or a Uint8Array +reader.read('p').mimicks(() => 1) +// @ts-expect-error resolves() is only offered for promises +reader.read('p').resolves('text') +// @ts-expect-error a call in the assertion view returns nothing +reader.received().read('p').returns('text') + +// Variants whose parameter lists differ only in optionality. +interface CatA { kind: 'cat'; feed(food: string, amount?: number): 'purr' } +interface DogA { kind: 'dog'; feed(food: string): 'wag' } +const a = Substitute.for() +a.feed('x').returns('purr') +a.feed('x').returns('wag') +const fedA: 'purr' | 'wag' = a.feed('x') +const asA: CatA | DogA = a +// @ts-expect-error the configured value is 'purr' or 'wag' +a.feed('x').returns('moo') + +// Variants whose parameter types differ. +interface CatB { kind: 'cat'; pet(where: 'head'): 'purr' } +interface DogB { kind: 'dog'; pet(where: 'head' | 'belly'): 'wag' } +const b = Substitute.for() +b.pet('head').returns('purr') +b.pet('head').returns('wag') +// @ts-expect-error the configured value is 'purr' or 'wag' +b.pet('head').returns('moo') + +// A union return type in one variant, overlapping the other. +interface CatC { kind: 'cat'; size(): number | string } +interface DogC { kind: 'dog'; size(): number } +const c = Substitute.for() +c.size().returns(1) +c.size().returns('big') +// @ts-expect-error the configured value is a number or a string +c.size().returns(true) + +// Overloads in one variant. +interface CatD { kind: 'cat'; get(key: 'a'): number; get(key: string): string } +interface DogD { kind: 'dog'; get(key: string): boolean } +const d = Substitute.for() +d.get('b').returns('x') +d.get('b').returns(true) +d[configure]().get('b').returns('x') +const asD: CatD | DogD = d +// @ts-expect-error the configured value is what `get(key: string)` returns in either variant +d.get('b').returns(Symbol()) + +// Overloads in both variants. +interface StoreA { kind: 'a'; get(): string[]; get(key: string): string } +interface StoreB { kind: 'b'; get(): number[]; get(key: string, fallback?: number): number } +const store = Substitute.for() +store.get().returns(['a']) +store.get().returns([1]) +store.get('k').returns('v') +store.get('k').returns(1) +store.get('k', 2).returns(1) +// @ts-expect-error `get()` returns an array +store.get().returns('v') +// @ts-expect-error `get(key)` returns a string or a number +store.get('k').returns(['v']) + +// A generic method in one variant. +interface CatE { kind: 'cat'; id(x: T): T } +interface DogE { kind: 'dog'; id(x: string): string } +const e = Substitute.for() +e.id('x').returns('y') + +// `any` return in one variant. +interface CatF { kind: 'cat'; raw(): any } +interface DogF { kind: 'dog'; raw(): string } +const f = Substitute.for() +f.raw().returns(1) +// The same with the variant returning `any` declared second. +interface DogF2 { kind: 'dog'; raw(): string } +interface CatF2 { kind: 'cat'; raw(): any } +const f2 = Substitute.for() +f2.raw().returns(1) +f2[configure]().raw().returns(1) + +// `void` and `number`. +interface CatG { kind: 'cat'; run(): void } +interface DogG { kind: 'dog'; run(): number } +const g = Substitute.for() +g.run().returns(1) +g.run().returns(undefined) +// @ts-expect-error the configured value is a number or undefined +g.run().returns('x') + +// `Arg.all()`, also after leading arguments. +interface CatH { kind: 'cat'; log(a: string, b: number): 'c' } +interface DogH { kind: 'dog'; log(a: string, b: number): 'd' } +const h = Substitute.for() +h.log('a', Arg.all()).returns('c') +h.log(Arg.all()).returns('d') +h.received().log('a', Arg.all()) +h.log('a', 1).throws(new Error()) +// @ts-expect-error the configured value is 'c' or 'd' +h.log(Arg.all()).returns('e') +// @ts-expect-error the configured value is 'c' or 'd' +h.log('a', Arg.all()).returns('e') +// @ts-expect-error resolves() is only offered for promises +h.log('a', 1).resolves('c') + +// Promises in the variants. +interface CatI { kind: 'cat'; load(): Promise } +interface DogI { kind: 'dog'; load(): Promise | undefined } +const i = Substitute.for() +i.load().resolves(1) +i.load().returns(undefined) +i.load().rejects(new Error()) + +// Three variants with the same parameter list. +interface W1 { k: 1; m(): 'a' } +interface W2 { k: 2; m(): 'b' } +interface W3 { k: 3; m(): 'c' } +const w = Substitute.for() +w.m().returns('c') +w[configure]().m().returns('a') +w[received](1).m() +// @ts-expect-error the configured value is 'a', 'b' or 'c' +w.m().returns('d') +// @ts-expect-error the configure view checks the value too +w[configure]().m().returns('d') + +// Three variants with differing parameter lists. +interface V1 { k: 1; m(): 'a' } +interface V2 { k: 2; m(x?: string): 'b' } +interface V3 { k: 3; m(x: string, y?: number): 'c' } +const v = Substitute.for() +v.m().returns('a') +v.m().returns('b') +v.m('x').returns('b') +v.m('x').returns('c') +v[configure]().m().returns('a') +v[received](1).m() +// @ts-expect-error a call without arguments reaches only `m()` and `m(x?)` +v.m().returns('c') +// @ts-expect-error the configured value is 'b' or 'c' +v.m('x').returns('d') +// @ts-expect-error the configure view checks the value too +v[configure]().m().returns('d') + +// Variants whose methods require different numbers of arguments. (TypeScript 5.3 and older paired the call +// `f('s', 1)` with `f(a)` as well, which `.returns('y')` then had to satisfy too; see `CombinedSignatures`.) +interface CatJ { kind: 'cat'; f(a: string): 'x' } +interface DogJ { kind: 'dog'; f(a: string, b: number): 'y' } +const j = Substitute.for() +j.f('s').returns('x') +j.f('s', 1).returns('y') +j.f(Arg.any(), Arg.any()).returns('y') +j[configure]().f('s', 1).returns('y') +j.received().f('s', 1) +// @ts-expect-error a call with one argument reaches only `f(a)` +j.f('s').returns('y') + +// A substitute of a union of function types whose parameter lists differ. +type Handler = ((event: string) => number) | ((event: string, retry?: boolean) => string) +const handler = Substitute.for() +handler('x').returns(1) +handler('x').returns('y') +handler[configure]()('x').returns(2) +handler.received()('x') +// @ts-expect-error the configured value is a number or a string +handler('x').returns(true) + +// A callback member typed as a union of function types whose parameter lists differ. +interface Listeners { onResult: ((result: string) => number) | ((result: string, index?: number) => string) } +const listeners = Substitute.for() +listeners.onResult('x').returns(1) +listeners.onResult('x').returns('y') +listeners[configure]().onResult('x').returns(2) +// @ts-expect-error the configured value is a number or a string +listeners.onResult('x').returns(true) + +// A member typed as a union of function types, one of which returns a type parameter. +interface Picker { pick: (() => T) | ((fallback?: string) => string) } +export function stubPicker(picker: SubstituteOf>, value: T) { + picker.pick().returns(value) + picker.pick().returns('x') + picker[configure]().pick().returns(value) +} +const picker = Substitute.for>() +picker.pick().returns(1) +picker.pick().returns('x') +// @ts-expect-error the configured value is a number or a string +picker.pick().returns(true) + +expectType<'purr' | 'wag'>(a.feed('x')) +export { fetched, asClient, read, fedA, asA, asD } diff --git a/spec-types/R6FE-3.T47.construct-signatures.ts b/spec-types/R6FE-3.T47.construct-signatures.ts new file mode 100644 index 0000000..a7663fb --- /dev/null +++ b/spec-types/R6FE-3.T47.construct-signatures.ts @@ -0,0 +1,73 @@ +// R6FE-3 / T47 Substitutes of constructor types and constructor members: `new` keeps its typing, and the call syntax +// of E23 (`new` is recorded and answered like a call) type-checks for setups and checks. +import { Substitute, SubstituteOf, Arg, configure, received, didNotReceive } from '../src' + +interface ApiClient { baseUrl: string; get(path: string): Promise } +type ClientFactory = new (baseUrl: string) => ApiClient + +const Client = Substitute.for() +const client = Substitute.for() +Client('https://api').returns(client) +Client(Arg.any()).returns(client) +Client(Arg.all()).returns(client) +Client[configure]()('https://api').returns(client) +Client.received(1)('https://api') +Client[received](1)(Arg.any()) +Client.didNotReceive()('https://other') +Client[didNotReceive]()(Arg.all()) +const created: ApiClient = new Client('https://api') +const asFactory: ClientFactory = Client +// @ts-expect-error the configured value is an ApiClient +Client('https://api').returns('not a client') +// @ts-expect-error the base URL is a string +Client(1) +// @ts-expect-error `new` keeps the constructor's parameters +new Client(1) +// @ts-expect-error a check returns nothing +Client.received(1)('https://api').returns(client) + +// A class constructor as a member of a module-like object. +class Connection { + constructor(readonly host: string, readonly port?: number) { } + open(): boolean { return true } +} +interface Driver { Connection: typeof Connection; version: string } +const driver = Substitute.for() +const connection = Substitute.for() +driver.Connection('db', 5432).returns(connection) +driver.Connection(Arg.any()).returns(connection) +driver[configure]().Connection('db').returns(connection) +driver.received(1).Connection('db', 5432) +driver[received](1).Connection(Arg.all()) +driver.didNotReceive().Connection('other') +driver.version.returns('1.0') +const opened: boolean = new driver.Connection('db').open() +const asDriver: Driver = driver +// @ts-expect-error the configured value is a Connection +driver.Connection('db').returns(42) +// @ts-expect-error the port is a number +driver.Connection('db', '5432') + +// A constructor type with overloads. +interface DateLike { valueOf(): number } +interface DateLikeConstructor { + new (): DateLike + new (value: number): DateLike + new (year: number, month: number): DateLike +} +const DateCtor = Substitute.for() +const date = Substitute.for() +DateCtor().returns(date) +DateCtor(0).returns(date) +DateCtor(2026, 10).returns(date) +DateCtor.received(1)(2026, 10) +// @ts-expect-error no overload takes a string +DateCtor('2026') + +// In generic code, through the constraint. +export function stubFactory(factory: SubstituteOf, instance: ApiClient) { + factory('https://api').returns(instance) + factory.received(1)('https://api') +} + +export { created, asFactory, opened, asDriver } diff --git a/spec-types/R6FE-5.T48.arg-any-bigint.ts b/spec-types/R6FE-5.T48.arg-any-bigint.ts new file mode 100644 index 0000000..31c8f8f --- /dev/null +++ b/spec-types/R6FE-5.T48.arg-any-bigint.ts @@ -0,0 +1,20 @@ +// R6FE-5 / T48 `Arg.any('bigint')` is typed like the other type names: it matches bigint parameters, and only those. +import { Substitute, Arg, configure } from '../src' +import { expectType, value } from './helpers' + +interface Ledger { + credit(amount: bigint): bigint + label(id: string): string +} +const ledger = Substitute.for() +const one = value() +ledger.credit(Arg.any('bigint')).returns(one) +ledger.credit(Arg.any.not('undefined')).returns(one) +ledger[configure]().credit(Arg.any('bigint')).mimicks(amount => amount + one) +ledger.received().credit(Arg.any('bigint')) +ledger.didNotReceive().credit(Arg.any('any')) +expectType(Arg.any('bigint')) +// @ts-expect-error a bigint matcher does not fit a string parameter +ledger.label(Arg.any('bigint')) +// @ts-expect-error not a type name +Arg.any('BigInt') diff --git a/spec-types/R6FE-7.T46.generic-methods.ts b/spec-types/R6FE-7.T46.generic-methods.ts new file mode 100644 index 0000000..b11d007 --- /dev/null +++ b/spec-types/R6FE-7.T46.generic-methods.ts @@ -0,0 +1,98 @@ +// R6FE-7 / T46 Generic methods are never typed `never` on a substitute: setups, checks and the configure view compile, +// also with `Arg.any()` and `Arg.all()`, and values the method cannot return are rejected. (The type parameters are +// replaced by their constraints: see limitations.ts for what that leaves unchecked.) +import { EventEmitter } from 'events' +import { Substitute, Arg, configure, received, didNotReceive } from '../src' + +// Node's EventEmitter with an event map. +type OrderEvents = { paid: [orderId: string, amount: number]; cancelled: [orderId: string] } +const emitter = Substitute.for>() +emitter.emit('paid', 'o1', 20).returns(true) +emitter.emit('paid', Arg.any(), Arg.any()).returns(true) +emitter.emit('cancelled', 'o1').returns(false) +emitter[configure]().emit('paid', 'o1', 20).returns(true) +emitter.on('paid', Arg.any()).returns(emitter) +emitter.once('cancelled', (orderId: string) => undefined).returns(emitter) +emitter.listenerCount('paid').returns(2) +emitter.received(1).emit('paid', 'o1', 20) +emitter[received](1).emit('paid', Arg.any(), Arg.any()) +emitter[didNotReceive]().emit('cancelled', 'o2') +const asEmitter: EventEmitter = emitter +// @ts-expect-error emit returns a boolean +emitter.emit('paid', 'o1', 20).returns('yes') +// @ts-expect-error the amount is a number +emitter.received().emit('paid', 'o1', '20') +// @ts-expect-error the member is callable, not `never` +const notNever: 1 = emitter.emit + +// A hand-written typed emitter. +interface Events { saved: (id: string) => void; failed: (error: Error) => void } +interface Emitter { + on(event: E, listener: Events[E]): this + emit(event: E, ...args: Parameters): boolean +} +const typed = Substitute.for() +typed.emit('saved', 'id1').returns(true) +typed.emit('saved', Arg.any()).returns(true) +typed.emit(Arg.all()).returns(false) +typed[configure]().emit('saved', 'id1').returns(true) +typed[configure]().emit('saved', Arg.any()).returns(true) +typed.on('saved', Arg.any()).returns(typed) +typed.on(Arg.any(), Arg.any()).returns(typed) +typed[configure]().on(Arg.any(), Arg.any()).returns(typed) +typed.received().emit('saved', 'id1') +typed.received(1).on('saved', Arg.any()) +// @ts-expect-error 'saved' takes a string id +typed.emit('saved', 1) +// @ts-expect-error emit returns a boolean +typed.emit('saved', 'id1').returns(1) + +// Generic methods whose return type depends on a type parameter. +interface User { name: string; age: number } +interface Repo { find(key: K, value: User[K]): Promise } +const repo = Substitute.for() +repo.find('age', 30).resolves([]) +repo.find(Arg.any(), Arg.any()).resolves([]) +repo.find(Arg.all()).resolves([]) +repo.received().find('name', Arg.any()) +// @ts-expect-error resolves to a list of users +repo.find(Arg.any(), Arg.any()).resolves('none') + +interface Config { port: number; host: string; debug: boolean } +interface ConfigService { get(key: K): Config[K] } +const config = Substitute.for() +config.get('port').returns(80) +config.get(Arg.any()).returns(80) +config.get(Arg.all()).returns('localhost') +config[configure]().get('host').returns('localhost') +config.received().get(Arg.any()) +// @ts-expect-error no member of Config is a symbol +config.get('port').returns(Symbol('80')) +// @ts-expect-error the key is a key of Config +config.get('timeout') + +interface Store { first(items: T[]): T; id(value: T): T } +const store = Substitute.for() +store.first([1, 2]).returns(1) +store.first(Arg.any()).returns(1) +store.id(Arg.any()).returns('x') +store.received().first(Arg.all()) + +// The parameter list of a signature is taken as a whole (T46), so a rest parameter typed as a union of tuples (which +// `emit(event, ...args: Parameters)` gives with the constraint) has the setup API too. +interface Logger { log(...args: [string] | [string, number]): boolean } +const logger = Substitute.for() +logger.log('a').returns(true) +logger.log('a', 1).returns(false) +logger.log(Arg.any()).returns(true) +logger.log(Arg.all()).returns(true) +logger[configure]().log('a').returns(true) +logger.received(1).log('a', 1) +// @ts-expect-error log returns a boolean +logger.log('a').returns('yes') +// @ts-expect-error the second argument is a number +logger.log('a', 'b') +// @ts-expect-error the first argument is a string +logger.received().log(1) + +export { asEmitter, notNever } diff --git a/spec-types/R6TD-1.T45.union-call-arguments.ts b/spec-types/R6TD-1.T45.union-call-arguments.ts new file mode 100644 index 0000000..298b180 --- /dev/null +++ b/spec-types/R6TD-1.T45.union-call-arguments.ts @@ -0,0 +1,101 @@ +// R6TD-1 / T45 Concrete unions whose variants declare a method with different parameter lists and different return +// types (T42): which variants a call can reach is decided by the arguments the call passes. A call that omits an +// optional parameter in which the variants differ, a single `Arg.all()`, and calls of a variant with a rest parameter +// take what every variant that accepts these arguments returns. (For `Arg.any()` and untyped `Arg.is()` predicates see +// limitations.ts.) +import { Substitute, SubstituteOf, Arg, configure, received } from '../src' + +// Two API versions whose options type changed, together with the return type. +interface OptionsV1 { retries: number } +interface OptionsV2 { timeoutMs: number } +interface ApiV1 { version: 1; get(key: string, options?: OptionsV1): number } +interface ApiV2 { version: 2; get(key: string, options?: OptionsV2): string } +const api = Substitute.for() +api.get('k').returns(1) +api.get('k').returns('s') +api[configure]().get('k').returns('s') +api.get(Arg.any()).returns('s') +api.get(Arg.all()).returns('s') +api.get('k', { retries: 1 }).returns(1) +api.get('k', { timeoutMs: 1 }).returns('s') +api.received().get('k') +const fromAnyVersion: number | string = api.get('k') +// @ts-expect-error the configured value is a number or a string +api.get('k').returns(true) +// @ts-expect-error `get(key, options: OptionsV1)` is only declared by ApiV1, which returns a number +api.get('k', { retries: 1 }).returns('s') +// @ts-expect-error `get(key, options: OptionsV2)` is only declared by ApiV2, which returns a string +api.get('k', { timeoutMs: 1 }).returns(1) +// @ts-expect-error the options keep their types +api.get('k', { retries: 'many' }) + +// A single `Arg.all()` matches every call of every variant. +interface NA { kind: 'a'; m(x: string): 'A' } +interface NB { kind: 'b'; m(x: number): 'B' } +const n = Substitute.for() +n.m(Arg.all()).returns('A') +n.m(Arg.all()).returns('B') +n[configure]().m(Arg.all()).returns('B') +n.m('s').returns('A') +n.m(1).returns('B') +n.m(Arg.any('number')).returns('B') +n.m(Arg.is((x: number) => x > 1)).returns('B') +// @ts-expect-error a string argument only reaches NA's `m` +n.m('s').returns('B') +// @ts-expect-error a number argument only reaches NB's `m` +n.m(1).returns('A') +// @ts-expect-error the configured value is 'A' or 'B' +n.m(Arg.all()).returns('C') +// @ts-expect-error neither variant takes a boolean +n.m(true) + +// A variant with a rest parameter. +interface RA { kind: 'a'; log(...args: string[]): 'A' } +interface RB { kind: 'b'; log(first: string, second?: number): 'B' } +const r = Substitute.for() +r.log('x').returns('A') +r.log('x').returns('B') +r.log().returns('A') +r.log('x', 'y', 'z').returns('A') +r.log('x', 1).returns('B') +r.log(Arg.all()).returns('A') +r.log(Arg.all()).returns('B') +r.received().log('x', 'y', 'z') +// @ts-expect-error three arguments only reach RA's `log` +r.log('x', 'y', 'z').returns('B') +// @ts-expect-error a number as the second argument only reaches RB's `log` +r.log('x', 1).returns('A') + +// Overloads with optional parameters next to an overload that requires them. +interface Plot { kind: 'plot'; draw(x: number, y?: number, z?: number): 'flat'; draw(x: number, y: number, z: number): 'solid' } +interface Sketch { kind: 'sketch'; draw(x: number): 'line' } +const drawing = Substitute.for() +drawing.draw(1, 2, 3).returns('solid') +drawing.draw(1, 2, 3).returns('flat') +drawing.draw(1).returns('line') +drawing.draw(1).returns('flat') +// @ts-expect-error `draw(x)` with one argument never returns 'solid' +drawing.draw(1).returns('solid') + +// An optional parameter with a literal type (TypeScript tries such a signature first when it calls the union). +interface ReaderA { kind: 'a'; read(path: string): string } +interface ReaderB { kind: 'b'; read(path: string, encoding?: 'buffer'): Uint8Array } +const reader = Substitute.for() +reader.read('p').returns('text') +reader.read('p').returns(new Uint8Array()) +reader[configure]().read('p').returns('text') +reader.read('p', 'buffer').returns(new Uint8Array()) +const readResult: string | Uint8Array = reader.read('p') +// @ts-expect-error the configured value is a string or a Uint8Array +reader.read('p').returns(1) +const root = Substitute.for() +root.querySelector('a').returns(null) +root.querySelectorAll('div') + +// Generic code keeps the variant's own signatures (see limitations.ts for union constraints). +export function stubApi(sub: SubstituteOf) { + sub.get('k').returns(1) + sub[received](1).get('k') +} + +export { fromAnyVersion, readResult } diff --git a/spec-types/R6TD-3.T48.indexed-unions.ts b/spec-types/R6TD-3.T48.indexed-unions.ts new file mode 100644 index 0000000..f70d4e8 --- /dev/null +++ b/spec-types/R6TD-3.T48.indexed-unions.ts @@ -0,0 +1,52 @@ +// R6TD-3 / T48 Concrete unions whose variants have a string index signature take the union of the variants' return +// types too (T39, T42), as unions without one do: the union is mapped as one type, not variant by variant. +import { Substitute, SubstituteOf, Arg, configure, received } from '../src' + +interface IA { kind: 'a'; [key: string]: unknown; speak(): 'meow' } +interface IB { kind: 'b'; [key: string]: unknown; speak(): 'woof' } +const pet = Substitute.for() +pet.speak().returns('meow') +pet.speak().returns('woof') +pet[configure]().speak().returns('meow') +pet.received().speak() +pet[received](1).speak() +pet.kind.returns('a') +pet.other.returns(1) +const asPet: IA | IB = pet +// @ts-expect-error the configured value is 'meow' or 'woof' +pet.speak().returns('moo') +// @ts-expect-error the configure view checks the value too +pet[configure]().speak().returns('moo') + +// Different parameter lists. +interface JA { kind: 'a'; [key: string]: unknown; read(path: string): string } +interface JB { kind: 'b'; [key: string]: unknown; read(path: string, encoding?: string): Uint8Array } +const reader = Substitute.for() +reader.read('p').returns('x') +reader.read('p').returns(new Uint8Array()) +reader.read('p', 'utf8').returns(new Uint8Array()) +// @ts-expect-error the configured value is a string or a Uint8Array +reader.read('p').returns(1) + +// Records of function types. +type Handlers = Record number> | Record string> +const handlers = Substitute.for() +handlers.foo('x').returns(1) +handlers.foo('x').returns('s') +handlers.bar(Arg.any()).returns(2) +// @ts-expect-error the configured value is a number or a string +handlers.foo('x').returns(true) + +// The same variants on their own still work as before (T:TY-8). +const one = Substitute.for() +one.speak().returns('meow') +one.kind.returns('a') +// @ts-expect-error IA's `speak` returns 'meow' +one.speak().returns('woof') + +// Generic code keeps the constraint's members (T41). +export function stubSpeak(sub: SubstituteOf) { + sub.speak().returns('meow') +} + +export { asPet } diff --git a/spec-types/R6TD-4.T48.union-constraint-parameter-lists.ts b/spec-types/R6TD-4.T48.union-constraint-parameter-lists.ts new file mode 100644 index 0000000..e190ac0 --- /dev/null +++ b/spec-types/R6TD-4.T48.union-constraint-parameter-lists.ts @@ -0,0 +1,28 @@ +// R6TD-4 / T48 (documented limitation) Generic code whose constraint is a union whose variants declare a method with +// different parameter lists: on TypeScript 5.4 and newer such a call has no setup API at all, also when every variant +// returns the same type (TypeScript computes the call from each variant of the constraint and pairs each variant's +// substitute signatures with the other variant's own method). TypeScript 5.0 and older compile it. The configure view +// and a cast to the constraint work on every version. (For different return types see limitations.ts.) +import { Substitute, SubstituteOf, configure } from '../src' + +interface LogA { kind: 'a'; log(message: string): void } +interface LogB { kind: 'b'; log(message: string, level?: number): void } +export function stubLog(sub: SubstituteOf) { + // @ts-expect-error no setup API on TypeScript 5.4 and newer + sub.log('x').returns() + sub[configure]().log('x').returns() + ;(sub as SubstituteOf).log('x').returns() + sub.received().log('x') +} + +interface ClientV1 { version: 1; fetch(url: string): Promise } +interface ClientV2 { version: 2; fetch(url: string, options?: { timeout: number }): Promise } +export class Fixture { + sub = Substitute.for() + arrange() { + // @ts-expect-error no setup API on TypeScript 5.4 and newer + this.sub.fetch('/a').resolves('ok') + this.sub[configure]().fetch('/a').resolves('ok') + ;(this.sub as SubstituteOf).fetch('/a').resolves('ok') + } +} diff --git a/spec-types/R6V-4.T43.generic-key-members.ts b/spec-types/R6V-4.T43.generic-key-members.ts new file mode 100644 index 0000000..5694048 --- /dev/null +++ b/spec-types/R6V-4.T43.generic-key-members.ts @@ -0,0 +1,57 @@ +// R6V-4 / T43 Generic code that reaches a member through a generic key of a mapped type (`s[k]` on a +// `SubstituteOf number>>`, a handler map indexed by a generic event name): the member keeps its setup +// API, as for any other member in generic code (T26, T33). Only concrete unions take the combined signatures of T42. +import { Substitute, SubstituteOf, Arg, configure } from '../src' + +export function f3(s: SubstituteOf number>>, k: K) { + s[k]().returns(1) + s[k]().returns(1, 2) + s[k]().mimicks(() => 3) + s[k]().throws(new Error()) + s[configure]()[k]().returns(1) + // @ts-expect-error the member returns a number + s[k]().returns('x') + // @ts-expect-error the configure view checks the value too + s[configure]()[k]().returns('x') + // @ts-expect-error resolves() is only offered for promises + s[k]().resolves(1) +} + +export function f3b(s: SubstituteOf Promise>>, k: K) { + s[k]('a').resolves(1) + s[k]('a').rejects(new Error()) + s[k](Arg.any()).resolves(2) + s[k](Arg.all()).returns(Promise.resolve(3)) + // @ts-expect-error the promise resolves to a number + s[k]('a').resolves('x') + // @ts-expect-error the argument is a string + s[k](1) +} + +// A handler map keyed by a generic event name. +type Handlers = { [P in E]: (payload: string) => boolean } +export function f4(h: SubstituteOf>, e: E) { + h[e]('p').returns(true) + h[e](Arg.is(payload => payload.length > 0)).returns(false) + h[configure]()[e]('p').returns(true) + // @ts-expect-error the handler returns a boolean + h[e]('p').returns('yes') +} + +// The same with a concrete union of keys, and with a generic key of a concrete interface. +type Api = Record<'a' | 'b', () => number> +export function f5(s: SubstituteOf, k: 'a' | 'b') { + s[k]().returns(1) + // @ts-expect-error the member returns a number + s[k]().returns('x') +} +interface Repo { find(): number; count(): number } +export function f6(s: SubstituteOf, k: K) { + s[k]().returns(1) +} + +// A generic record of members passed through a helper. +export function stubAll(s: SubstituteOf string>>, keys: K[]) { + for (const key of keys) s[key]().returns(key) +} +stubAll(Substitute.for string>>(), ['x', 'y']) diff --git a/spec-types/R6V-5.R6TD-2.T44.check-cost.js b/spec-types/R6V-5.R6TD-2.T44.check-cost.js new file mode 100644 index 0000000..649121d --- /dev/null +++ b/spec-types/R6V-5.R6TD-2.T44.check-cost.js @@ -0,0 +1,68 @@ +#!/usr/bin/env node +// R6V-5 / R6TD-2 / T44 Type-check cost of a substitute of a large concrete union. Compiles +// spec-types/R6V-5.R6TD-2.T44.element-union.ts against the BUILT package typings (dist/*.d.ts) with the project's +// TypeScript and fails when it needs more type instantiations than the budget below. Instantiation counts are +// deterministic (unlike timings). With the comparison of every variant with every other one (T42, 2.0.1 before T44) +// the file needed about 525 000 instantiations on TypeScript 5.9, and the element union took 1.6 to 1.8 times as long +// to check as before T42 on TypeScript 3.6 to 3.8; now it needs about 442 000, and the element union checks about as +// fast as before T42. +// +// npm run build && node spec-types/R6V-5.R6TD-2.T44.check-cost.js +// +// `npm run test:types:min-ts` runs it too (see spec-types/min-ts/check.js). The consumer only exists in memory. +'use strict' +const fs = require('fs') +const path = require('path') +const ts = require('typescript') + +const INSTANTIATION_BUDGET = 470000 + +const root = path.resolve(__dirname, '..') +if (!fs.existsSync(path.join(root, 'dist', 'index.d.ts'))) { + console.error('The package typings (dist/index.d.ts) were not found: run `npm run build` first.') + process.exit(1) +} + +const fixturePath = path.join(__dirname, 'R6V-5.R6TD-2.T44.element-union.ts') +const consumerPath = path.join(__dirname, '__T44-consumer__.ts') +const consumer = fs.readFileSync(fixturePath, 'utf8').replace(/from '\.\.\/src'/g, "from '../dist'") + +const options = { + strict: true, + noEmit: true, + target: ts.ScriptTarget.ES2018, + module: ts.ModuleKind.CommonJS, + moduleResolution: ts.ModuleResolutionKind.Node10 || ts.ModuleResolutionKind.NodeJs, + lib: ['lib.es2018.d.ts', 'lib.dom.d.ts'], + types: [], + skipLibCheck: true +} +const host = ts.createCompilerHost(options) +const getSourceFile = host.getSourceFile +host.getSourceFile = (fileName, languageVersion, ...rest) => + path.resolve(fileName) === consumerPath ? + ts.createSourceFile(fileName, consumer, languageVersion, true) : + getSourceFile.call(host, fileName, languageVersion, ...rest) +const fileExists = host.fileExists +host.fileExists = fileName => path.resolve(fileName) === consumerPath || fileExists.call(host, fileName) +const readFile = host.readFile +host.readFile = fileName => path.resolve(fileName) === consumerPath ? consumer : readFile.call(host, fileName) + +const program = ts.createProgram([consumerPath], options, host) +const diagnostics = ts.getPreEmitDiagnostics(program) +const instantiations = program.getInstantiationCount() + +let failed = false +if (diagnostics.length > 0) { + failed = true + console.log(`FAIL ${path.basename(fixturePath)} does not compile:`) + console.log(ts.formatDiagnostics(diagnostics, { + getCanonicalFileName: fileName => fileName, + getCurrentDirectory: () => root, + getNewLine: () => '\n' + }).trim().replace(/^/gm, ' ')) +} +const withinBudget = instantiations <= INSTANTIATION_BUDGET +failed = failed || !withinBudget +console.log(`${withinBudget ? 'ok ' : 'FAIL'} ${path.basename(fixturePath)}: ${instantiations} type instantiations (budget ${INSTANTIATION_BUDGET}, TypeScript ${ts.version})`) +process.exit(failed ? 1 : 0) diff --git a/spec-types/R6V-5.R6TD-2.T44.element-union.ts b/spec-types/R6V-5.R6TD-2.T44.element-union.ts new file mode 100644 index 0000000..dce0dc4 --- /dev/null +++ b/spec-types/R6V-5.R6TD-2.T44.element-union.ts @@ -0,0 +1,43 @@ +// R6V-5 / R6TD-2 / T44 A substitute of a large concrete union (every lib.dom element type) type-checks about as fast +// as in 2.0.1 before T42: its members whose variants declare different parameter lists but return the same type +// (`addEventListener`, `removeEventListener`, `remove`) get one signature computed from the whole member type, without +// comparing the variants with each other. spec-types/R6V-5.R6TD-2.T44.check-cost.js (run by +// `npm run test:types:min-ts`) checks the cost of this file. The setups and checks below must keep compiling. +import { Substitute, Arg, configure, received } from '../src' + +type AnyElement = HTMLElementTagNameMap[keyof HTMLElementTagNameMap] +const element = Substitute.for() +element.hasAttribute('a').returns(true) +element.cloneNode().returns(document.createElement('div')) +element.getAttribute('a').returns('b') +element.id.returns('x') +element[configure]().focus().returns() +element.received().click() +element.addEventListener('click', Arg.any()) +element.addEventListener('click', () => undefined).returns() +element.addEventListener('keydown', (event: Event) => event.type.length).returns() +element.removeEventListener('click', Arg.all()).returns() +element[received](1).addEventListener('click', Arg.any()) +element.remove().returns() +const asElement: AnyElement = element +// @ts-expect-error the listener methods return nothing +element.addEventListener('click', Arg.any()).returns(1) +// @ts-expect-error the event name keeps its type +element.addEventListener(1, Arg.any()) + +// Variants whose callback types differ only in their `this` type: callbacks are typed from the context. +const field = Substitute.for() +field.addEventListener('click', event => event.preventDefault()).returns() +field.addEventListener('input', function () { return this.value }).returns() +field.received().addEventListener('click', Arg.any()) +// (For the element union above, callbacks without parameter types get no contextual type: see limitations.ts.) + +const doc = Substitute.for() +doc.createElement('div').returns(document.createElement('div')) +doc.getElementById('x').returns(null) +doc.title.returns('t') +doc[configure]().createTextNode('x').returns(document.createTextNode('x')) +doc.received().querySelectorAll('x') +const asDocument: Document = doc + +export { asElement, asDocument } diff --git a/spec-types/T-TY-01.mimicks-union-return.ts b/spec-types/T-TY-01.mimicks-union-return.ts new file mode 100644 index 0000000..e0d704e --- /dev/null +++ b/spec-types/T-TY-01.mimicks-union-return.ts @@ -0,0 +1,33 @@ +// T:TY-1 mimicks() on methods with parameters whose return type is a union (boolean, T | undefined, enums, literal unions) +import { Substitute, Arg, mimicks } from '../src' + +enum Status { Active, Disabled } + +interface Validator { + isValid(input: string): boolean + find(id: number): string | undefined + status(id: number): Status + level(id: number): 'low' | 'high' + isReady(): boolean + enabled: boolean +} + +const v = Substitute.for() +v.isValid(Arg.any()).mimicks((input: string) => input.length > 3) +v.find(Arg.any()).mimicks((id: number) => (id > 0 ? 'found' : undefined)) +v.status(Arg.all()).mimicks((id: number) => Status.Active) +v.level(1).mimicks(id => (id > 1 ? 'high' : 'low')) +v.isValid('x')[mimicks](() => true) +v.isReady().mimicks(() => false) +v.enabled.mimicks(() => true) + +v.isValid('x').returns(true) +v.isValid('x').returns(false, true) +v.find(1).returns(undefined) +v.find(1).returns('a', undefined) +v.status(1).returns(Status.Disabled) + +// @ts-expect-error the implementation must return the member's return type +v.isValid('x').mimicks(() => 'yes') +// @ts-expect-error the implementation must accept the member's parameters +v.find(1).mimicks((id: string) => id) diff --git a/spec-types/T-TY-02.G-RG-4.setup-method-name-conflicts.ts b/spec-types/T-TY-02.G-RG-4.setup-method-name-conflicts.ts new file mode 100644 index 0000000..38625e5 --- /dev/null +++ b/spec-types/T-TY-02.G-RG-4.setup-method-name-conflicts.ts @@ -0,0 +1,90 @@ +// T:TY-2 / G:RG-4 One rule for `.returns` vs `[returns]` (also throws, mimicks, resolves, rejects): +// the string form is offered unless the VALUE it is accessed on (the property type or the call's return type) has a +// member with that name. The symbol form is always offered. Whether the containing interface has such a member does +// not matter, and properties, methods without arguments and methods with arguments all behave the same. +import { Substitute, Arg, returns, throws, mimicks, resolves, rejects, configure } from '../src' +import { expectType } from './helpers' + +// (A) the mocked interface has members named returns / throws / mimicks +interface Order { + returns: string[] + throws: boolean + mimicks(): void + id: string + total(): number + lineTotal(index: number): number +} +const order = Substitute.for() +order.lineTotal(0).returns(5) +order.total().returns(10) +order.id.returns('o-1') +order.lineTotal(0).throws(new Error()) +order.total().throws(new Error()) +order.id.throws(new Error()) +order.lineTotal(0).mimicks(index => index * 2) +order.total().mimicks(() => 1) +order.id.mimicks(() => 'o-2') +order.lineTotal(0)[returns](5) +order.total()[returns](10) +order.id[returns]('o-1') +order.id[throws](new Error()) +order.total()[mimicks](() => 1) +// the conflicting members themselves are ordinary members +order.returns.returns(['r-1']) +order.throws.returns(true) +order.mimicks().returns() + +// (B) a member's VALUE type has members named returns / throws / mimicks +interface Shop { + current: Order + latest(): Order + find(id: string): Order + maybe(id: string): Order | undefined + load(): Promise +} +const shop = Substitute.for() +const o: Order = Substitute.for() +shop.find('1')[returns](o) +shop.latest()[returns](o) +shop.current[returns](o) +shop.maybe('1')[returns](o) +shop.maybe('1')[returns](undefined) +shop.find('1')[throws](new Error()) +shop.latest()[mimicks](() => o) +shop.find(Arg.any())[mimicks](() => o) +// `.returns` / `.throws` / `.mimicks` are the Order's own members there +expectType(shop.find('1').returns) +expectType(shop.current.throws) +// @ts-expect-error not the setup method: Order's own `returns: string[]` +shop.find('1').returns(o) +// @ts-expect-error not the setup method: Order's own `returns: string[]` +shop.latest().returns(o) +// @ts-expect-error not the setup method: Order's own `returns: string[]` +shop.current.returns(o) +// @ts-expect-error not the setup method: Order's own `returns: string[]` +shop.maybe('1').returns(o) +// @ts-expect-error not the setup method: Order's own `mimicks(): void` +shop.find('1').mimicks(() => o) +// a Promise has no member named returns, so the string form is offered there +shop.load().returns(Promise.resolve(o)) +shop.load().resolves(o) + +// (C) resolves / rejects on a promise type that has members with those names +interface Deferred extends Promise { + resolves: number + rejects: number +} +interface Scheduler { next(): Deferred } +const scheduler = Substitute.for() +scheduler.next()[resolves]('done') +scheduler.next()[rejects](new Error()) +scheduler.next().returns(value>()) +// @ts-expect-error not the setup method: Deferred's own `resolves: number` +scheduler.next().resolves('done') + +// The [configure]() view never returns the value itself, so the string forms are always offered there. +shop[configure]().find('1').returns(o) +shop[configure]().current.returns(o) +shop[configure]().latest().mimicks(() => o) + +declare function value(): T diff --git a/spec-types/T-TY-03.G-RG-3.generic-helpers.ts b/spec-types/T-TY-03.G-RG-3.generic-helpers.ts new file mode 100644 index 0000000..b27ec0a --- /dev/null +++ b/spec-types/T-TY-03.G-RG-3.generic-helpers.ts @@ -0,0 +1,68 @@ +// T:TY-3 / G:RG-3 received / didNotReceive / clearReceivedCalls / mimick / configure on SubstituteOf for a generic T. +// The symbol API is always available. The string forms `sub.received()` / `sub.didNotReceive()` are offered unless +// TypeScript can tell that T has a conflicting member (D11): for a constrained type parameter it checks the constraint. +// For an unconstrained one the conflict cannot be decided, so the string forms are offered, as in 2.0.0-beta.4 (T26, +// see TD-2.V2-2.T26.generic-code.ts). +import { Substitute, SubstituteOf, received, didNotReceive, clearReceivedCalls, mimick, configure } from '../src' + +export function expectNoCalls(sub: SubstituteOf) { + return sub[didNotReceive]() +} +export function expectSomeCall(sub: SubstituteOf) { + return sub[received]() +} +export function once(sub: SubstituteOf) { + return sub[received](1) +} +export function reset(sub: SubstituteOf) { + sub[clearReceivedCalls]() +} +export function setup(sub: SubstituteOf) { + return sub[configure]() +} +export function delegate(sub: SubstituteOf, instance: T) { + sub[mimick](instance) +} +export function create(): SubstituteOf { + const sub = Substitute.for() + sub[received]() + return sub +} +export class Fixture { + sub = Substitute.for() + verify() { + return this.sub[received]() + } +} + +interface Calculator { add(a: number, b: number): number } + +const calculator = create() +calculator.add(1, 2) +once(calculator).add(1, 2) +expectNoCalls(calculator).add(3, 4) +expectSomeCall(calculator).add(1, 2) +setup(calculator).add(1, 2).returns(3) +delegate(calculator, { add: (a, b) => a + b }) +new Fixture().verify().add(1, 2) + +// A constraint without conflicting members keeps the string forms. +export function viaConstraint(sub: SubstituteOf) { + sub.received().add(1, 2) + sub.didNotReceive().add(1, 2) + sub[received](2).add(1, 2) +} + +// For an unconstrained T the conflict cannot be decided, so the string forms are offered (T26). +export function stringFormsInGenericCode(sub: SubstituteOf) { + sub.received() + sub.didNotReceive() +} + +// A constraint with a conflicting member decides it: only the symbol forms. +interface Account { returns(item: string): number } +export function viaConflictingConstraint(sub: SubstituteOf) { + sub[received]().returns('book') + // @ts-expect-error ambiguous: the constraint has a member named `returns` + sub.received() +} diff --git a/spec-types/T-TY-05.D12.mimick-symbol-only.ts b/spec-types/T-TY-05.D12.mimick-symbol-only.ts new file mode 100644 index 0000000..cad9f2b --- /dev/null +++ b/spec-types/T-TY-05.D12.mimick-symbol-only.ts @@ -0,0 +1,23 @@ +// T:TY-5 / D12 `mimick` is a symbol-only API: `sub[mimick](instance)`. The string `mimick` is never a library method, +// it is an ordinary member of T (if T has one). +import { Substitute, mimick } from '../src' + +interface Calculator { add(a: number, b: number): number } +const real: Calculator = { add: (a, b) => a + b } +const calculator = Substitute.for() +calculator[mimick](real) +calculator[mimick]({ add: () => 0 }) +// @ts-expect-error the string form is not a library method +calculator.mimick(real) +// @ts-expect-error the instance must implement T +calculator[mimick]({ subtract: (a: number, b: number) => a - b }) + +// A member called `mimick` is just a member. +interface Puppet { + mimick(sound: string): string + speak(): string +} +const puppet = Substitute.for() +puppet.mimick('woof').returns('WOOF') +puppet.received().mimick('woof') +puppet[mimick]({ mimick: sound => sound, speak: () => 'hi' }) diff --git a/spec-types/T-TY-07.optional-members.ts b/spec-types/T-TY-07.optional-members.ts new file mode 100644 index 0000000..20b3d29 --- /dev/null +++ b/spec-types/T-TY-07.optional-members.ts @@ -0,0 +1,35 @@ +// T:TY-7 Optional properties and methods (`prop?`, `method?()`) are configured and asserted like required ones. +import { Substitute, Arg, configure, received } from '../src' + +interface Options { + timeout?: number + onDone?(): string + format?(value: number): string + callback?: (error: Error | null) => void + nested?: { level: number } +} + +const o = Substitute.for() +o.timeout.returns(1000) +o.timeout.returns(undefined) +o.onDone().returns('done') +o.format(1).returns('1') +o.format(Arg.any()).mimicks(value => String(value)) +o.callback(null).returns() +o.nested.returns({ level: 1 }) +o.received().format(1) +o.received().onDone() +o.didNotReceive().callback(Arg.any()) +o.received().timeout = 5 +o[received](1).timeout +o[configure]().timeout.returns(1) +o[configure]().format(Arg.all()).returns('x') + +// The substitute is still an Options. +const options: Options = o +export { options } + +// @ts-expect-error the configured value must have the member's type +o.timeout.returns('1000') +// @ts-expect-error wrong argument type +o.format('1') diff --git a/spec-types/T-TY-08.index-signatures.ts b/spec-types/T-TY-08.index-signatures.ts new file mode 100644 index 0000000..ba34c47 --- /dev/null +++ b/spec-types/T-TY-08.index-signatures.ts @@ -0,0 +1,36 @@ +// T:TY-8 An index signature does not wipe out the substitute typing of the named members. +import { Substitute } from '../src' + +interface Config { + name: string + load(): string + get(key: string): string + [key: string]: unknown +} +const c = Substitute.for() +c.name.returns('app') +c.load().returns('loaded') +c.get('a').returns('b') +c.received().get('a') +c.anything.returns(42) + +interface Registry { + [id: string]: (input: number) => number +} +const registry = Substitute.for() +registry.double(2).returns(4) +registry.received().double(2) + +interface NumberIndexed { + length: number + [index: number]: string +} +const list = Substitute.for() +list.length.returns(1) +list[0].returns('first') + +const record = Substitute.for number>>() +record.foo().returns(1) + +// @ts-expect-error the configured value must have the member's type +c.name.returns(1) diff --git a/spec-types/T-TY-10.zero-argument-overloads.ts b/spec-types/T-TY-10.zero-argument-overloads.ts new file mode 100644 index 0000000..ad868db --- /dev/null +++ b/spec-types/T-TY-10.zero-argument-overloads.ts @@ -0,0 +1,33 @@ +// T:TY-10 Overloads without parameters do not break the other overloads, and a single matcher argument resolves to +// the overload with one parameter (not to an Arg.all() signature of the zero-parameter overload). +import { Substitute, Arg } from '../src' +import { expectType } from './helpers' + +// (a) zero-parameter overload declared last +interface Field { + value(newValue: string): void + value(): string +} +const field = Substitute.for() +field.value().returns('current') +field.value('x').throws(new Error('read-only')) +field.value(Arg.any()).returns() +field.received().value('x') +field.received().value() + +// (b) zero-parameter overload declared first +interface Store { + get(): string[] + get(key: string): string +} +const store = Substitute.for() +store.get('k').returns('v') +store.get(Arg.any()).returns('v') +store.get(Arg.is(k => k.startsWith('user:'))).returns('v') +store.get().returns(['a']) +store.received().get(Arg.is(k => k.length > 0)) +expectType(store.get('k')) +expectType(store.get()) + +// @ts-expect-error the overload with a parameter returns a string +store.get(Arg.any()).returns(['v']) diff --git a/spec-types/T-TY-11.many-overloads.ts b/spec-types/T-TY-11.many-overloads.ts new file mode 100644 index 0000000..2890981 --- /dev/null +++ b/spec-types/T-TY-11.many-overloads.ts @@ -0,0 +1,61 @@ +// T:TY-11 Methods with up to 8 overloads keep the substitute typing on every overload. (With more than 8 overloads, +// only the last 8 have it; that limit is documented.) +import { Substitute, Arg, configure } from '../src' + +interface A { a: 1 } interface B { b: 1 } interface C { c: 1 } interface D { d: 1 } +interface E { e: 1 } interface F { f: 1 } interface G { g: 1 } interface H { h: 1 } + +interface Six { + f(a: string): string[] + f(a: number): number[] + f(a: boolean): boolean[] + f(a: symbol): symbol[] + f(a: Date): Date[] + f(a: RegExp): RegExp[] +} +const six = Substitute.for() +six.f('x').returns(['x']) +six.f(1).returns([1]) +six.f(true).returns([true]) +six.f(Symbol.iterator).returns([Symbol.iterator]) +six.f(new Date()).returns([]) +six.f(/x/).returns([/x/]) +six.f(Arg.all()).returns(['any']) +six.received().f('x') +six.received().f(/x/) + +interface Eight { + g(a: A): 'A' + g(a: B): 'B' + g(a: C): 'C' + g(a: D): 'D' + g(a: E): 'E' + g(a: F): 'F' + g(a: G): 'G' + g(a: H): 'H' +} +const eight = Substitute.for() +eight.g({ a: 1 }).returns('A') +eight.g({ d: 1 }).returns('D') +eight.g({ h: 1 }).returns('H') + +// @ts-expect-error each overload keeps its own return type +six.f('x').returns([1]) +// @ts-expect-error each overload keeps its own return type +eight.g({ a: 1 }).returns('B') + +// Overloads whose parameters are declared with literal types (`f(a: 'x')`, `f(a: null)`) are tried first by TypeScript, +// before any other signature, so a direct call resolves to the interface's own declaration and has no setup API. +// The [configure]() view has no such declarations: use it to configure these overloads. +interface Events { + on(event: 'data', listener: (chunk: string) => void): this + on(event: 'end', listener: () => void): this + get(key: null): undefined + get(key: string): string +} +const events = Substitute.for() +events[configure]().on('data', Arg.any()).returns(events) +events[configure]().on('end', Arg.any()).returns(events) +events[configure]().get(null).returns(undefined) +events.get('k').returns('v') +events.received().on('data', Arg.any()) diff --git a/spec-types/T-TY-12.never-return.ts b/spec-types/T-TY-12.never-return.ts new file mode 100644 index 0000000..e7efaf1 --- /dev/null +++ b/spec-types/T-TY-12.never-return.ts @@ -0,0 +1,17 @@ +// T:TY-12 Members that return `never` can be configured with .throws() (and .mimicks()). +import { Substitute, Arg, throws } from '../src' + +interface Guard { + fail(message: string): never + abort(): never +} +const g = Substitute.for() +g.fail('boom').throws(new Error('boom')) +g.fail(Arg.any()).throws(new Error('boom')) +g.abort().throws(new Error('abort')) +g.abort()[throws](new Error('abort')) +g.fail(Arg.all()).mimicks((message: string) => { throw new Error(message) }) +g.received().fail('boom') + +// @ts-expect-error nothing can be returned from a member that never returns +g.abort().returns(1) diff --git a/spec-types/T-TY-13.unknown-rest-parameters.ts b/spec-types/T-TY-13.unknown-rest-parameters.ts new file mode 100644 index 0000000..b776e4b --- /dev/null +++ b/spec-types/T-TY-13.unknown-rest-parameters.ts @@ -0,0 +1,19 @@ +// T:TY-13 Methods declared with `(...args: unknown[])` keep the substitute typing. +import { Substitute, Arg } from '../src' + +interface Logger { + format(...args: unknown[]): string + formatAny(...args: any[]): string + log(message: string, ...rest: unknown[]): void + anything(...args: unknown[]): unknown +} +const logger = Substitute.for() +logger.format('a', 1).returns('a 1') +logger.format(Arg.all()).mimicks((...args: unknown[]) => args.join(' ')) +logger.formatAny('a', 1).returns('a 1') +logger.log('x', 1, 2).returns() +logger.anything(1).returns(2) +logger.received().format('a', 1) + +// @ts-expect-error the configured value must be a string +logger.format('a', 1).returns(1) diff --git a/spec-types/T-TY-14.private-member-conflicts.ts b/spec-types/T-TY-14.private-member-conflicts.ts new file mode 100644 index 0000000..d9219f2 --- /dev/null +++ b/spec-types/T-TY-14.private-member-conflicts.ts @@ -0,0 +1,44 @@ +// T:TY-14 A class with a private member named received / didNotReceive / mimick (or returns, throws, ...) does not turn +// the substitute type into `never`. Such a class is treated like a conflicting member (D11): use the symbol forms. +import { Substitute, received, didNotReceive, returns } from '../src' + +class Inbox { + private received: string[] = [] + count(): number { return this.received.length } +} +const inbox = Substitute.for() +inbox.count().returns(3) +inbox[received]().count() +inbox[didNotReceive]().count() +const asInbox: Inbox = inbox + +class Outbox { + private didNotReceive = false + private mimick = 1 + send(message: string): boolean { return !this.didNotReceive && this.mimick > 0 && message.length > 0 } +} +const outbox = Substitute.for() +outbox.send('hi').returns(true) +outbox[received]().send('hi') + +// A value type with a private member named like a setup method uses the symbol form for it. +class Receipt { + private returns = 0 + total(): number { return this.returns } +} +interface Till { print(): Receipt } +const till = Substitute.for() +const receipt: Receipt = Substitute.for() +till.print()[returns](receipt) +till.print().throws(new Error()) +till.print().total() + +class Protected { + protected received = 1 + size(): number { return this.received } +} +const prot = Substitute.for() +prot.size().returns(2) +prot[received]().size() + +export { asInbox } diff --git a/spec-types/T-TY-16.D20.special-members.ts b/spec-types/T-TY-16.D20.special-members.ts new file mode 100644 index 0000000..176c37b --- /dev/null +++ b/spec-types/T-TY-16.D20.special-members.ts @@ -0,0 +1,41 @@ +// T:TY-16 / D20 Members the runtime special-cases. +// - `then`: a substitute never exposes it (so that it is not a thenable and `await sub` resolves to the substitute). +// It is `never` on the substitute: calling, configuring or asserting it does not compile. +// - `toJSON`: answered by the substitute itself (it serializes the substitute). It keeps its declared type, but it has +// no setup API and cannot be configured or asserted. +import { Substitute, Arg, configure, received } from '../src' +import { expectType } from './helpers' + +interface Job { + then(callback: (value: number) => void): void + toJSON(): string + run(): number +} +const j = Substitute.for() +j.run().returns(1) +expectType(j.toJSON()) +// The substitute is still a Job (for the code under test). +const asJob: Job = j +async function awaitsTheSubstitute() { + const awaited = await j + return awaited.run() +} + +// @ts-expect-error `then` is never exposed by a substitute +j.then(Arg.any()) +// @ts-expect-error `then` cannot be configured +j.then.returns(() => undefined) +// @ts-expect-error `toJSON` cannot be configured +j.toJSON().returns('{}') +// @ts-expect-error `toJSON` cannot be configured +j.toJSON.returns(() => '{}') +// @ts-expect-error `then` cannot be asserted +j.received().then(Arg.any()) +// @ts-expect-error `toJSON` cannot be asserted +j[received]().toJSON() +// @ts-expect-error `then` cannot be configured +j[configure]().then(Arg.any()) +// @ts-expect-error `toJSON` cannot be configured +j[configure]().toJSON().returns('{}') + +export { asJob, awaitsTheSubstitute } diff --git a/spec-types/TD-1.T25.null-only-members.ts b/spec-types/TD-1.T25.null-only-members.ts new file mode 100644 index 0000000..02d975a --- /dev/null +++ b/spec-types/TD-1.T25.null-only-members.ts @@ -0,0 +1,53 @@ +// TD-1 / T25 A member typed only `null` and/or `undefined` (`error?: undefined`, `ownerDocument: null`) does not +// reduce SubstituteOf to `never`. Such a member keeps its plain type and has no setup API. +import { Substitute, Arg, received } from '../src' +import { assert, Equals } from './helpers' + +// A variant of a discriminated union, written the usual "XOR" way +interface Ok { data: string; error?: undefined } +const ok = Substitute.for() +ok.data.returns('x') +ok.received().data +ok[received](1).data +assert>() +const asOk: Ok = ok + +interface Members { + nothing: null + missing: undefined + maybeNothing?: null + either: null | undefined + count: number + reset(): void + find(id: string): null +} +const members = Substitute.for() +members.count.returns(1) +members.reset().returns() +members.find(Arg.any()).returns(null) +assert>() +assert>() +assert>() +members.received().nothing = null +members.received().maybeNothing = undefined +members.received().find('1') +const asMembers: Members = members + +// @ts-expect-error nothing to configure on a member that can only be null +members.nothing.returns(null) +// @ts-expect-error nothing to configure on a member that can only be undefined +ok.error.returns(undefined) + +// lib.dom: Document.ownerDocument is `null`, as are the `textContent` overrides of Document and DocumentType +const doc = Substitute.for() +doc.title.returns('t') +doc.getElementById('x').returns(null) +doc.querySelector(Arg.any()).returns(null) +doc.received().getElementById('x') +assert>() +const asDocument: Document = doc +const documentType = Substitute.for() +documentType.name.returns('html') +const asDocumentType: DocumentType = documentType + +export { asOk, asMembers, asDocument, asDocumentType } diff --git a/spec-types/TD-10.T32.jsdoc.js b/spec-types/TD-10.T32.jsdoc.js new file mode 100644 index 0000000..929c0f6 --- /dev/null +++ b/spec-types/TD-10.T32.jsdoc.js @@ -0,0 +1,136 @@ +#!/usr/bin/env node +// TD-10 / T32 The public API carries documentation comments that editors show (quick info), in the BUILT package +// typings (dist/*.d.ts). Each `/*@name*/` marker in the consumer below sits right before an identifier; the check asks +// the TypeScript language service for the quick info at that identifier and fails when it has no documentation. +// R3TD-3 / T35 At an `Arg.is.not(...)` / `Arg.any.not(...)` call site (and on `.not` itself) the documentation +// describes the inverse matcher, and at `Arg.is(...)` / `Arg.any(...)` it does not (see `expectations` below). +// +// npm run build && node spec-types/TD-10.T32.jsdoc.js +// +// `npm run test:types:min-ts` runs it too (see spec-types/min-ts/check.js). The consumer only exists in memory. +'use strict' +const fs = require('fs') +const path = require('path') +const ts = require('typescript') + +const root = path.resolve(__dirname, '..') +if (!fs.existsSync(path.join(root, 'dist', 'index.d.ts'))) { + console.error('The package typings (dist/index.d.ts) were not found: run `npm run build` first.') + process.exit(1) +} + +const consumerPath = path.join(__dirname, '__jsdoc-consumer__.ts') +const consumer = ` +import { + Substitute, Arg, SubstituteOf, SubstituteException, + received, didNotReceive, mimick, clearReceivedCalls, configure, returns, throws, resolves, rejects, mimicks +} from '../dist' + +interface Calculator { + add(a: number, b: number): number + load(): Promise +} +const calculator = Substitute./*@Substitute.for*/for() +const asSubstitute: /*@SubstituteOf*/SubstituteOf = calculator + +calculator.add(/*@Arg*/Arg.any(), 2) +calculator.add(Arg./*@Arg.any*/any('number'), Arg.any./*@Arg.any.not*/not('number')) +calculator.add(Arg./*@Arg.is*/is(x => x > 0), Arg.is./*@Arg.is.not*/not(x => x === 0)) +calculator.add(Arg./*@Arg.all*/all()) +const notZero = Arg.is./*@Arg.is.not (standalone)*/not((x: number) => x === 0) +const isNot = Arg.is./*@Arg.is.not (not called)*/not +const anyNot = Arg.any./*@Arg.any.not (not called)*/not +calculator.add(Arg.any./*@Arg.any.not (no type)*/not(), notZero) + +calculator.add(1, 2)./*@returns()*/returns(3) +calculator.add(1, 2)./*@throws()*/throws(new Error()) +calculator.add(1, 2)./*@mimicks()*/mimicks((a, b) => a + b) +calculator.load()./*@resolves()*/resolves(1) +calculator.load()./*@rejects()*/rejects(new Error()) +calculator.add(1, 2)[/*@[returns]*/returns](3) +calculator.add(1, 2)[/*@[throws]*/throws](new Error()) +calculator.add(1, 2)[/*@[mimicks]*/mimicks]((a, b) => a + b) +calculator.load()[/*@[resolves]*/resolves](1) +calculator.load()[/*@[rejects]*/rejects](new Error()) + +calculator./*@received()*/received(1).add(1, 2) +calculator./*@didNotReceive()*/didNotReceive().add(1, 2) +calculator[/*@[received]*/received]().add(1, 2) +calculator[/*@[didNotReceive]*/didNotReceive]().add(1, 2) +calculator[/*@[configure]*/configure]().add(1, 2).returns(3) +calculator[/*@[mimick]*/mimick]({ add: (a, b) => a + b, load: async () => 1 }) +calculator[/*@[clearReceivedCalls]*/clearReceivedCalls]() + +const error = new /*@SubstituteException*/SubstituteException('message') +export { asSubstitute, error } +` + +const compilerOptions = { + module: ts.ModuleKind.CommonJS, + moduleResolution: ts.ModuleResolutionKind.NodeJs, + target: ts.ScriptTarget.ES2018, + lib: ['lib.es2018.d.ts'], + strict: true, + noEmit: true, + types: [] +} +const host = { + getScriptFileNames: () => [consumerPath], + getScriptVersion: () => '1', + getScriptSnapshot: fileName => { + const text = fileName === consumerPath ? consumer : (fs.existsSync(fileName) ? fs.readFileSync(fileName, 'utf8') : undefined) + return text === undefined ? undefined : ts.ScriptSnapshot.fromString(text) + }, + getCurrentDirectory: () => __dirname, + getCompilationSettings: () => compilerOptions, + getDefaultLibFileName: options => ts.getDefaultLibFilePath(options), + fileExists: fileName => fileName === consumerPath || fs.existsSync(fileName), + readFile: fileName => fileName === consumerPath ? consumer : fs.readFileSync(fileName, 'utf8'), + readDirectory: ts.sys.readDirectory, + directoryExists: ts.sys.directoryExists, + getDirectories: ts.sys.getDirectories +} +const service = ts.createLanguageService(host, ts.createDocumentRegistry()) + +let failed = false +const diagnostics = service.getSemanticDiagnostics(consumerPath).concat(service.getSyntacticDiagnostics(consumerPath)) +for (const diagnostic of diagnostics) { + failed = true + console.log(`FAIL the consumer does not compile: ${ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n')}`) +} + +// R3TD-3 / T35 What the documentation must (or must not) say at some markers: [marker name pattern, text pattern, +// whether the text must be present, what is checked]. +const expectations = [ + [/^Arg\.(is|any)\.not\b/, /^The inverse of `Arg\.(is|any)`/, true, 'describes the inverse matcher'], + [/^Arg\.is\.not\b/, /falsy/i, true, 'says that the predicate returns a falsy value'], + [/^Arg\.any\.not\b/, /\bNOT of the given type\b/, true, 'says that the argument is not of the type'], + [/^Arg\.(is|any)$/, /\binverse\b/i, false, 'describes the matcher itself, not its inverse'] +] + +const marker = /\/\*@(.+?)\*\//g +let match +let count = 0 +while ((match = marker.exec(consumer)) !== null) { + count++ + const name = match[1] + const info = service.getQuickInfoAtPosition(consumerPath, match.index + match[0].length) + const documentation = info ? ts.displayPartsToString(info.documentation).trim() : '' + if (documentation === '') { + failed = true + console.log(`FAIL ${name}: no documentation comment`) + continue + } + const wrong = expectations.filter(([names, text, present]) => names.test(name) && text.test(documentation) !== present) + if (wrong.length > 0) { + failed = true + for (const [, , , what] of wrong) console.log(`FAIL ${name}: the documentation ${what}: ${documentation.split('\n')[0]}`) + } else { + console.log(`ok ${name}: ${documentation.split('\n')[0].slice(0, 90)}`) + } +} +if (count === 0) { + failed = true + console.log('FAIL no markers found') +} +process.exit(failed ? 1 : 0) diff --git a/spec-types/TD-2.V2-2.T26.generic-code.ts b/spec-types/TD-2.V2-2.T26.generic-code.ts new file mode 100644 index 0000000..b1f5121 --- /dev/null +++ b/spec-types/TD-2.V2-2.T26.generic-code.ts @@ -0,0 +1,85 @@ +// TD-2 / V2-2 / T26 Generic code, where a type is an unresolved type parameter. +// - The setup API (`.returns`, `.throws`, `.mimicks`, `.resolves`, the symbol forms and the configure view) is offered on +// calls that return the type parameter, as in 2.0.0-beta.4. +// - `sub.received()` / `sub.didNotReceive()` are offered on SubstituteOf for an unconstrained T: the D11 conflict rule +// applies only where it can be decided (concrete types, or a constraint; see T-TY-03.G-RG-3.generic-helpers.ts). +// - A PROPERTY whose type is the type parameter itself (`current: T`) has the setup API as well (round 4, T33; it had +// none in round 3, when `repo[configure]().current.returns(value)` was the way around it). For a concrete type, a +// member that can only be null or undefined still has none (TD-1.T25.null-only-members.ts). +import { Substitute, SubstituteOf, Arg, configure, received, didNotReceive, returns, throws } from '../src' + +interface Repo { + get(id: string): T + find(id: string): T | undefined + all(): T[] + load(id: string): Promise + count: number + current: T + items: T[] +} + +export function stubRepo(repo: SubstituteOf>, value: T) { + repo.count.returns(1) + repo.get(Arg.any()).returns(value) + repo.get('a').returns(value, value) + repo.get('a').throws(new Error()) + repo.get('a').mimicks(id => value) + repo.get('a')[returns](value) + repo.get('a')[throws](new Error()) + repo.find('a').returns(undefined) + repo.find('a').returns(value) + repo.all().returns([value]) + repo.load('a').resolves(value) + repo.load('a').rejects(new Error()) + repo.items.returns([value]) + repo[configure]().get('b').returns(value) + repo[configure]().find(Arg.all()).returns(value) + repo[configure]().current.returns(value) + repo.received().get('a') + repo.received(2).count + repo.didNotReceive().find(Arg.any()) + repo[received]().all() + repo[didNotReceive]().load('a') + + // @ts-expect-error the configured value must be a T + repo.get('a').returns(1) + // @ts-expect-error resolves() is only offered for promises + repo.get('a').resolves(value) + // @ts-expect-error the configured value must be a T + repo.current.returns(1) + repo.current.returns(value) + repo.current.mimicks(() => value) +} + +// The G:RG-3 / V2-2 helpers +export function once(sub: SubstituteOf) { + return sub.received(1) +} +export function never(sub: SubstituteOf) { + return sub.didNotReceive() +} +export function expectNoCalls(sub: SubstituteOf) { + sub.didNotReceive() + sub.received() +} +export class Fixture { + sub = Substitute.for() + verify() { + return this.sub.received() + } +} + +interface Calc { add(a: number, b: number): number } +const calculator = Substitute.for() +calculator.add(1, 2) +once(calculator).add(1, 2) +never(calculator).add(3, 4) +new Fixture().verify().add(1, 2) +// @ts-expect-error the helpers keep the substituted type +once(calculator).subtract(1, 2) + +interface Entity { id: string } +export function stubEntity(repo: SubstituteOf>, value: T) { + repo.get('a').returns(value) + repo.received().get(value.id) +} diff --git a/spec-types/TD-3.T27.arg-all-trailing.ts b/spec-types/TD-3.T27.arg-all-trailing.ts new file mode 100644 index 0000000..6639a0d --- /dev/null +++ b/spec-types/TD-3.T27.arg-all-trailing.ts @@ -0,0 +1,50 @@ +// TD-3 / T27 `Arg.all()` type-checks in any trailing position (D14): after leading arguments it matches the rest of +// the arguments. It replaces the parameter at its position (required, optional or rest), up to the 7th parameter. +import { Substitute, Arg, configure, received } from '../src' + +interface Calculator { add(a: number, b: number): number } +interface Logger { + log(message: string, ...details: string[]): void + find(id: string, options?: { deep: boolean }): string + record(a: number, b: string, c: boolean, d: number, e: string, f: number, g: boolean): void +} +interface Store { + get(): string[] + get(key: string): string + set(key: string, value: string): void + set(entries: Record): void +} + +const calculator = Substitute.for() +calculator.add(1, Arg.all()).returns(3) +calculator.add(Arg.any(), Arg.all()).returns(3) +calculator.add(Arg.is(a => a > 0), Arg.all()).mimicks((a, b) => a + b) +calculator.received().add(1, Arg.all()) +calculator.didNotReceive().add(2, Arg.all()) +calculator[received](1).add(1, Arg.all()) +calculator[configure]().add(1, Arg.all()).returns(3) + +const logger = Substitute.for() +logger.received().log('saved', Arg.all()) +logger.log('saved', 'a', Arg.all()).returns() +logger.log('saved', 'a', 'b', 'c', 'd', 'e', Arg.all()).returns() +logger.find('1', Arg.all()).returns('x') +logger.received().find('1', Arg.all()) +logger.record(1, 'b', true, Arg.all()).returns() +logger.record(1, 'b', true, 4, 'e', 6, Arg.all()).returns() + +const store = Substitute.for() +store.set('k', Arg.all()).returns() +store.received().set('k', Arg.all()) +store.get(Arg.all()).returns(['a']) + +// @ts-expect-error the leading arguments keep their types +calculator.add('1', Arg.all()) +// @ts-expect-error nothing may follow Arg.all() +calculator.add(Arg.all(), 2) +// @ts-expect-error Calculator.add has no parameter at that position +calculator.add(1, 2, Arg.all()) +// @ts-expect-error the configured value keeps its type +calculator.add(1, Arg.all()).returns('3') +// @ts-expect-error the leading arguments keep their types +logger.received().log(1, Arg.all()) diff --git a/spec-types/TD-5.T28.arg-any-function-object.ts b/spec-types/TD-5.T28.arg-any-function-object.ts new file mode 100644 index 0000000..09f2a87 --- /dev/null +++ b/spec-types/TD-5.T28.arg-any-function-object.ts @@ -0,0 +1,28 @@ +// TD-5 / T28 `Arg.any('function')` is assignable to typed function (and constructor) parameters, `Arg.any('object')` to +// typed object parameters. +import { Substitute, Arg, configure } from '../src' + +class Widget { name = 'w' } +interface Bus { + subscribe(handler: (value: number) => void): () => void + once(event: string, handler?: (value: string) => boolean): void + save(item: { id: string }): void + saveAll(items: { id: string }[], options: Partial<{ force: boolean }>): number + register(type: new () => Widget): void + send(payload: object, callback: Function): void +} + +const bus = Substitute.for() +bus.subscribe(Arg.any('function')).returns(() => { }) +bus.received().subscribe(Arg.any('function')) +bus.once('saved', Arg.any('function')) +bus.received().save(Arg.any('object')) +bus.saveAll(Arg.any('array'), Arg.any('object')).returns(1) +bus.register(Arg.any('function')) +bus.send(Arg.any('object'), Arg.any('function')) +bus[configure]().subscribe(Arg.any.not('function')).returns(() => { }) + +interface Calculator { add(a: number, b: number): number } +const calculator = Substitute.for() +// @ts-expect-error a function matcher does not fit a number parameter +calculator.add(Arg.any('function'), 1) diff --git a/spec-types/TD-6.T29.arg-is-standalone.ts b/spec-types/TD-6.T29.arg-is-standalone.ts new file mode 100644 index 0000000..9741711 --- /dev/null +++ b/spec-types/TD-6.T29.arg-is-standalone.ts @@ -0,0 +1,27 @@ +// TD-6 / T29 A matcher created on its own from an annotated predicate (README "Matching specific arguments") takes its +// type from the predicate. spec-types/min-ts/consumer.ts checks the same pattern with TypeScript 3.6. +import { Substitute, Arg } from '../src' +import { assert, Equals, expectType } from './helpers' + +interface Calculator { + add(a: number, b: number): number + divide(a: number, b: number): number +} +const calculator = Substitute.for() + +const negative = Arg.is((x: number) => x < 0) +calculator.divide(negative, negative).returns(1) +calculator.received().divide(negative, Arg.any()) +expectType(negative) + +const notZero = Arg.is.not((x: number) => x === 0) +calculator.divide(1, notZero).returns(2) + +const explicit = Arg.is(x => x > 0) +calculator.add(explicit, 1) + +// in argument position the predicate's parameter type still comes from the parameter +calculator.add(Arg.is(a => { assert>(); return a > 1 }), Arg.any()).returns(1) + +// @ts-expect-error a string matcher does not fit a number parameter +calculator.divide(Arg.is((x: string) => x === ''), 1) diff --git a/spec-types/TD-7.T30.optional-property-assertion.ts b/spec-types/TD-7.T30.optional-property-assertion.ts new file mode 100644 index 0000000..932576a --- /dev/null +++ b/spec-types/TD-7.T30.optional-property-assertion.ts @@ -0,0 +1,30 @@ +// TD-7 / T30 In the assertion view an optional property keeps `undefined` in its type, so a check that the code under +// test cleared it compiles: `sub.received().optionalProp = undefined`. +import { Substitute, Arg, received, didNotReceive } from '../src' + +interface Form { + note?: string + count?: number + format?(value: number): string + onSubmit?: (values: string[]) => void + title: string +} +const form = Substitute.for
() +const clear = (f: Form) => { f.note = undefined } +clear(form) + +form.received().note = undefined +form.received().note = 'x' +form.received(1).note = Arg.any() +form.didNotReceive().count = undefined +form[received](1).note = undefined +form[didNotReceive]().count = undefined +// optional methods are still asserted as calls +form.received().format(1) +form.didNotReceive().onSubmit(Arg.any()) +form.received().title = 'x' + +// @ts-expect-error the property keeps its type +form.received().note = 1 +// @ts-expect-error a required property does not accept undefined +form.received().title = undefined diff --git a/spec-types/TD-8.T31.large-unions.ts b/spec-types/TD-8.T31.large-unions.ts new file mode 100644 index 0000000..01e4472 --- /dev/null +++ b/spec-types/TD-8.T31.large-unions.ts @@ -0,0 +1,42 @@ +// TD-8 / T31 Types with a member whose type is a very large union of string literals (lib.dom's HTMLInputElement, +// HTMLSelectElement and HTMLTextAreaElement have `autocomplete: AutoFill`) do not fail with TS2590 ("union type that +// is too complex to represent"). +import { Substitute, Arg } from '../src' + +const input = Substitute.for() +input.value.returns('x') +input.autocomplete.returns('on') +input.checkValidity().returns(true) +input.received().value = 'y' +input.received().focus() +const asInput: HTMLInputElement = input + +const select = Substitute.for() +select.value.returns('a') +select.item(Arg.any()).returns(null) +const asSelect: HTMLSelectElement = select + +const textArea = Substitute.for() +textArea.value.returns('text') +const asTextArea: HTMLTextAreaElement = textArea + +// A user type with a 10 000-member template literal union +type Digit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' +type Code = `${Digit}${Digit}${Digit}${Digit}` +interface Lock { + code: Code + open(code: Code): boolean + current(): Code +} +const lock = Substitute.for() +lock.code.returns('1234') +lock.open('1234').returns(true) +lock.open(Arg.any()).returns(false) +lock.current().returns('0000') +lock.received().open('1234') +const asLock: Lock = lock + +// @ts-expect-error the configured value keeps its type +lock.code.returns('12345') + +export { asInput, asSelect, asTextArea, asLock } diff --git a/spec-types/helpers.ts b/spec-types/helpers.ts new file mode 100644 index 0000000..9907154 --- /dev/null +++ b/spec-types/helpers.ts @@ -0,0 +1,13 @@ +// Helpers for the type-level tests. Nothing in spec-types/ is executed: `npm run test:types` only type-checks it. +// Lines that must NOT compile are marked with `// @ts-expect-error` (tsc fails if such a line compiles). + +export type Equals = (() => T extends A ? 1 : 2) extends (() => T extends B ? 1 : 2) ? true : false + +/** Compile-time assertion: `assert>()` compiles only when X and Y are the same type. */ +export function assert(): void { } + +/** Compile-time assertion: compiles only when `value` is assignable to `T`. */ +export function expectType(_value: T): void { } + +/** A value of any type, for arguments whose value does not matter. */ +export declare function value(): T diff --git a/spec-types/limitations.ts b/spec-types/limitations.ts new file mode 100644 index 0000000..5ab8cf7 --- /dev/null +++ b/spec-types/limitations.ts @@ -0,0 +1,124 @@ +// Documented limitations of the typings (TypeScript cannot express these). Each `@ts-expect-error` line shows the +// limitation, the line after it a way around it. +import { Substitute, SubstituteOf, Arg, configure } from '../src' + +// T:TY-6 Assigning a property directly on a substitute: the property's type carries the setup API (`.returns`, ...), +// and TypeScript uses the same type for reads and writes of a mapped property. +interface Calculator { isEnabled: boolean } +const calculator = Substitute.for() +// @ts-expect-error `true` lacks the setup API +calculator.isEnabled = true +const asCalculator: Calculator = calculator +asCalculator.isEnabled = true // as the code under test does it +calculator.received().isEnabled = true + +// T:TY-9 `null` / `undefined` cannot carry the setup API, so they are not part of the type of a call or property read +// (strictNullChecks). The value is still assignable to the declared type. +interface UserRepo { find(id: number): string | null } +const repo = Substitute.for() +repo.find(1).returns(null) +const found: string | null = repo.find(1) +declare function is(actual: Actual, expected: Expected): void // like ava's t.is +// @ts-expect-error `null` is not part of `string & setup API` +is(repo.find(1), null) +is(repo.find(1), null) + +// T:TY-15 Explicit type arguments on a generic method resolve to the interface's own declaration (TypeScript cannot +// carry a method's type parameters over to the substitute's signatures). +interface Repository { get(id: string): T } +const repository = Substitute.for() +repository.get('1').returns({ a: 1 }) +// @ts-expect-error no setup API on the interface's own declaration +repository.get('1').returns(1) +repository.get('1').returns(1) + +// Overloads whose parameters are declared with literal types: see T-TY-11.many-overloads.ts. +interface Events { on(event: 'data', listener: () => void): this } +const events = Substitute.for() +// @ts-expect-error resolves to the interface's own declaration +events.on('data', Arg.any()).returns(events) +events[configure]().on('data', Arg.any()).returns(events) + +// Assigning a function to a callable member in the assertion view: the member's type there also carries the +// `Arg.all()` call signatures, which a plain function does not have. Check the set through the type itself. +interface Button { onClick?: (event: string) => void } +const button = Substitute.for