From 04fbfd3e1797b21294d74121ac1f2a15a4883927 Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Tue, 20 Feb 2024 19:16:19 -0800 Subject: [PATCH] tests: Migrate to Vitest from Jest. (#236) * Remove jest dep. * Update tests. * Update babel plugins. * Update babel. * Update swc. * Update stuff. * More stuff. * Add fs layer. * Start on tests. * Share fs. * Update package. * Get examples working. * Include wrappers. * Handle assets via bundle. * Fix some tests. * Update outputs. * Update deps. * Fix more tests. * Update docs. * Fix test. * Fix script. * Add preset. * Fix test. * More fixes. --- .moon/tasks.yml | 4 +- babel.config.js | 22 - jest.config.js | 13 - package.json | 15 +- .../jest.config.js | 3 - .../tests/plugin.test.ts | 1 + .../jest.config.js | 11 - .../tests/__snapshots__/plugin.test.ts.snap | 12 +- .../tests/plugin.test.ts | 1 + .../babel-plugin-env-constants/jest.config.js | 3 - .../tests/__snapshots__/plugin.test.ts.snap | 14 +- .../tests/plugin.test.ts | 1 + packages/packemon/jest.config.js | 5 - packages/packemon/package.json | 7 +- packages/packemon/src/Artifact.ts | 21 +- packages/packemon/src/FileSystem.ts | 32 + packages/packemon/src/Package.ts | 25 +- packages/packemon/src/Packemon.ts | 25 +- packages/packemon/src/babel.ts | 3 +- packages/packemon/src/babel/config.ts | 2 +- packages/packemon/src/bin.ts | 3 +- packages/packemon/src/commands/Init.tsx | 9 +- packages/packemon/src/commands/Scaffold.tsx | 56 +- .../packemon/src/components/Init/index.tsx | 18 +- packages/packemon/src/constants.ts | 7 +- .../src/helpers/compat/convertCjsTypes.ts | 13 +- packages/packemon/src/helpers/getVersion.ts | 10 +- .../packemon/src/helpers/loadTsconfigJson.ts | 11 +- .../src/helpers/shouldKeepDynamicImport.ts | 14 +- packages/packemon/src/index.ts | 1 + packages/packemon/src/rollup/config.ts | 8 +- .../src/rollup/plugins/copyAndRefAssets.ts | 109 +- .../rollup/plugins/preserveDynamicImport.ts | 6 +- packages/packemon/src/rollup/plugins/swc.ts | 6 +- packages/packemon/src/schemas.ts | 1 + packages/packemon/src/swc/config.ts | 2 +- packages/packemon/src/types.ts | 5 +- packages/packemon/templates/base/README.md | 5 +- .../packemon/templates/base/jest.config.js | 6 - .../packemon/templates/monorepo/package.json | 2 +- .../templates/package/tests/index.test.ts | 1 + .../packemon/templates/polyrepo/package.json | 2 +- packages/packemon/tests/Artifact.test.ts | 42 +- packages/packemon/tests/Package.test.ts | 165 +- .../packemon/tests/PackageValidator.test.ts | 15 +- packages/packemon/tests/Packemon.test.ts | 44 +- .../tests/__snapshots__/Package.test.ts.snap | 32 +- .../tests/__snapshots__/outputs.test.ts.snap | 19710 ++++++++++++++-- .../babel/__snapshots__/config.test.ts.snap | 97 +- packages/packemon/tests/babel/config.test.ts | 9 +- packages/packemon/tests/configs.test.ts | 41 +- .../__snapshots__/assetImports.test.ts.snap | 1470 +- .../__snapshots__/asyncAwait.test.ts.snap | 818 +- .../__snapshots__/cjsEsmInterop.test.ts.snap | 394 +- .../__snapshots__/cjsMjsWrapper.test.ts.snap | 1698 +- .../__snapshots__/dynamicImports.test.ts.snap | 1630 +- .../__snapshots__/externals.test.ts.snap | 786 +- .../__snapshots__/generators.test.ts.snap | 818 +- .../__snapshots__/jsonImports.test.ts.snap | 818 +- .../__snapshots__/namespaces.test.ts.snap | 818 +- .../__snapshots__/newSyntax.test.ts.snap | 818 +- .../__snapshots__/nodePolyfills.test.ts.snap | 818 +- .../examples/__snapshots__/react.test.ts.snap | 818 +- .../examples/__snapshots__/solid.test.ts.snap | 834 +- .../tests/examples/assetImports.test.ts | 1 + .../tests/examples/asyncAwait.test.ts | 1 + .../tests/examples/cjsEsmInterop.test.ts | 1 + .../tests/examples/cjsMjsWrapper.test.ts | 1 + .../tests/examples/dynamicImports.test.ts | 1 + .../packemon/tests/examples/externals.test.ts | 1 + .../tests/examples/generators.test.ts | 1 + .../tests/examples/jsonImports.test.ts | 1 + .../tests/examples/namespaces.test.ts | 1 + .../packemon/tests/examples/newSyntax.test.ts | 1 + .../tests/examples/nodePolyfills.test.ts | 1 + .../packemon/tests/examples/react.test.ts | 1 + .../packemon/tests/examples/solid.test.ts | 1 + packages/packemon/tests/helpers.ts | 134 +- .../packemon/tests/helpers/loadModule.test.ts | 1 + .../helpers/sortExportConditions.test.ts | 1 + packages/packemon/tests/outputs.test.ts | 81 +- packages/packemon/tests/rollup/config.test.ts | 39 +- .../MyComponent/MySubComponent/bar.mjs | 2 +- .../MyComponent/MySubComponent/test.svg | 2 +- .../rollup/plugins/addBinShebang.test.ts | 1 + .../rollup/plugins/copyAndRefAssets.test.ts | 81 +- .../swc/__snapshots__/config.test.ts.snap | 84 +- packages/packemon/tests/swc/config.test.ts | 7 +- scenarios/jest/babel.config.js | 11 + scenarios/jest/package.json | 4 +- scenarios/vite/package.json | 2 +- scenarios/webpack/package.json | 2 +- tests/__fixtures__/examples/package.json | 8 - .../project-rollup/src/test-utils/base.ts | 4 +- vitest.config.ts | 15 + website/docs/features.md | 2 +- website/docs/install.mdx | 2 +- website/docs/scaffold.md | 4 +- website/moon.yml | 2 +- website/package.json | 2 +- yarn.lock | 633 +- 101 files changed, 23569 insertions(+), 10776 deletions(-) delete mode 100644 babel.config.js delete mode 100644 jest.config.js delete mode 100644 packages/babel-plugin-cjs-esm-interop/jest.config.js delete mode 100644 packages/babel-plugin-conditional-invariant/jest.config.js delete mode 100644 packages/babel-plugin-env-constants/jest.config.js delete mode 100644 packages/packemon/jest.config.js create mode 100644 packages/packemon/src/FileSystem.ts delete mode 100644 packages/packemon/templates/base/jest.config.js create mode 100644 scenarios/jest/babel.config.js create mode 100644 vitest.config.ts diff --git a/.moon/tasks.yml b/.moon/tasks.yml index 1bec5306a..d686ff72d 100644 --- a/.moon/tasks.yml +++ b/.moon/tasks.yml @@ -22,7 +22,9 @@ tasks: NODE_ENV: 'production' test: - command: 'noop' # TODO + command: 'vitest run --config ../../vitest.config.ts' + inputs: + - '/vitest.config.ts' deps: - '^:build' diff --git a/babel.config.js b/babel.config.js deleted file mode 100644 index 37a55d410..000000000 --- a/babel.config.js +++ /dev/null @@ -1,22 +0,0 @@ -const plugins = []; - -if (!process.env.NO_INTEROP) { - // Needed for Jest - plugins.push(['babel-plugin-cjs-esm-interop', { format: 'cjs' }]); -} - -module.exports = { - babelrc: true, - babelrcRoots: ['packages/*', 'scenarios/*', 'website'], - comments: false, - presets: [ - [ - 'moon', - { - decorators: true, - react: 'automatic', - }, - ], - ], - plugins, -}; diff --git a/jest.config.js b/jest.config.js deleted file mode 100644 index a95359904..000000000 --- a/jest.config.js +++ /dev/null @@ -1,13 +0,0 @@ -module.exports = { - preset: 'jest-preset-moon', - coveragePathIgnorePatterns: [ - 'src/commands', - 'src/components', - 'tests/__fixtures__', - 'tests/helpers.ts', - 'website', - ], - extensionsToTreatAsEsm: [], - testEnvironment: 'node', - testPathIgnorePatterns: ['scenarios'], -}; diff --git a/package.json b/package.json index f57736d17..a59461bac 100644 --- a/package.json +++ b/package.json @@ -23,28 +23,25 @@ "devDependencies": { "@babel/cli": "^7.23.9", "@babel/core": "^7.23.9", - "@moonrepo/cli": "^1.21.3", + "@moonrepo/cli": "^1.21.4", "@moonrepo/dev": "^2.0.1", "@swc/cli": "^0.3.9", - "@types/fs-extra": "^11.0.4", - "@types/jest": "^29.5.12", "@types/micromatch": "^4.0.6", - "@types/node": "^16.18.80", - "@types/react": "^18.2.55", + "@types/node": "^16.18.82", + "@types/react": "^18.2.57", "@types/semver": "^7.5.7", "babel-preset-moon": "^2.0.14", "chokidar": "^3.6.0", - "electron-to-chromium": "^1.4.665", + "electron-to-chromium": "^1.4.675", "eslint": "^8.56.0", "eslint-config-moon": "^2.1.1", - "jest": "^29.7.0", - "jest-preset-moon": "^2.0.7", "lerna": "^8.1.2", "prettier": "^3.2.5", "prettier-config-moon": "^1.1.2", "ts-node": "^10.9.2", "tsconfig-moon": "^1.3.0", - "typescript": "^5.3.3" + "typescript": "^5.3.3", + "vitest": "^1.3.0" }, "funding": { "type": "ko-fi", diff --git a/packages/babel-plugin-cjs-esm-interop/jest.config.js b/packages/babel-plugin-cjs-esm-interop/jest.config.js deleted file mode 100644 index f587435ad..000000000 --- a/packages/babel-plugin-cjs-esm-interop/jest.config.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - preset: 'jest-preset-moon', -}; diff --git a/packages/babel-plugin-cjs-esm-interop/tests/plugin.test.ts b/packages/babel-plugin-cjs-esm-interop/tests/plugin.test.ts index 8693e583f..08bbf6eb9 100644 --- a/packages/babel-plugin-cjs-esm-interop/tests/plugin.test.ts +++ b/packages/babel-plugin-cjs-esm-interop/tests/plugin.test.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from 'vitest'; import { transformAsync, TransformOptions } from '@babel/core'; import cjsEsmInterop, { CjsEsmInteropOptions } from '../src'; diff --git a/packages/babel-plugin-conditional-invariant/jest.config.js b/packages/babel-plugin-conditional-invariant/jest.config.js deleted file mode 100644 index 9b7e37083..000000000 --- a/packages/babel-plugin-conditional-invariant/jest.config.js +++ /dev/null @@ -1,11 +0,0 @@ -module.exports = { - coverageThreshold: { - global: { - branches: 80, - functions: 85, - lines: 85, - statements: 85, - }, - }, - preset: 'jest-preset-moon', -}; diff --git a/packages/babel-plugin-conditional-invariant/tests/__snapshots__/plugin.test.ts.snap b/packages/babel-plugin-conditional-invariant/tests/__snapshots__/plugin.test.ts.snap index f3bda8606..a02842a3c 100644 --- a/packages/babel-plugin-conditional-invariant/tests/__snapshots__/plugin.test.ts.snap +++ b/packages/babel-plugin-conditional-invariant/tests/__snapshots__/plugin.test.ts.snap @@ -1,12 +1,12 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`conditionalInvariantPlugin() will not transform if wrapped in a matching conditional 1`] = ` +exports[`conditionalInvariantPlugin() > will not transform if wrapped in a matching conditional 1`] = ` "if (process.env.NODE_ENV !== 'production') { invariant(); }" `; -exports[`conditionalInvariantPlugin() will not transform if wrapped in a matching conditional that is layers deep 1`] = ` +exports[`conditionalInvariantPlugin() > will not transform if wrapped in a matching conditional that is layers deep 1`] = ` "if (process.env.NODE_ENV !== 'production') { if (true) { if (false) { @@ -16,7 +16,7 @@ exports[`conditionalInvariantPlugin() will not transform if wrapped in a matchin }" `; -exports[`conditionalInvariantPlugin() will transform if wrapped in a non-matching conditional 1`] = ` +exports[`conditionalInvariantPlugin() > will transform if wrapped in a non-matching conditional 1`] = ` "if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV !== 'production') { invariant(); @@ -24,7 +24,7 @@ exports[`conditionalInvariantPlugin() will transform if wrapped in a non-matchin }" `; -exports[`conditionalInvariantPlugin() will transform if wrapped in a non-matching conditional that is layers deep 1`] = ` +exports[`conditionalInvariantPlugin() > will transform if wrapped in a non-matching conditional that is layers deep 1`] = ` "if (process.env.NODE_ENV === 'development') { if (true) { if (false) { @@ -36,7 +36,7 @@ exports[`conditionalInvariantPlugin() will transform if wrapped in a non-matchin }" `; -exports[`conditionalInvariantPlugin() will transform valid expressions 1`] = ` +exports[`conditionalInvariantPlugin() > will transform valid expressions 1`] = ` "if (process.env.NODE_ENV !== 'production') { invariant(); } diff --git a/packages/babel-plugin-conditional-invariant/tests/plugin.test.ts b/packages/babel-plugin-conditional-invariant/tests/plugin.test.ts index ce9cd3904..97b9d7365 100644 --- a/packages/babel-plugin-conditional-invariant/tests/plugin.test.ts +++ b/packages/babel-plugin-conditional-invariant/tests/plugin.test.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from 'vitest'; import { transformAsync, TransformOptions } from '@babel/core'; import conditionalInvariantPlugin from '../src'; diff --git a/packages/babel-plugin-env-constants/jest.config.js b/packages/babel-plugin-env-constants/jest.config.js deleted file mode 100644 index f587435ad..000000000 --- a/packages/babel-plugin-env-constants/jest.config.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - preset: 'jest-preset-moon', -}; diff --git a/packages/babel-plugin-env-constants/tests/__snapshots__/plugin.test.ts.snap b/packages/babel-plugin-env-constants/tests/__snapshots__/plugin.test.ts.snap index fac933729..ee3440dac 100644 --- a/packages/babel-plugin-env-constants/tests/__snapshots__/plugin.test.ts.snap +++ b/packages/babel-plugin-env-constants/tests/__snapshots__/plugin.test.ts.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`envConstantsPlugin() transforms __DEV__ expressions 1`] = ` +exports[`envConstantsPlugin() > transforms __DEV__ expressions 1`] = ` "if (process.env.NODE_ENV !== 'production') {} else if (process.env.NODE_ENV !== 'production' && 123) {} else if (true || process.env.NODE_ENV !== 'production') {} else if (!(process.env.NODE_ENV !== 'production')) {} else {} switch (process.env.NODE_ENV !== 'production') {} while (process.env.NODE_ENV !== 'production') {} @@ -13,7 +13,7 @@ const arrayValue = [process.env.NODE_ENV !== 'production']; React.createElement(Foo, null, process.env.NODE_ENV !== 'production' ? 'Child' : null);" `; -exports[`envConstantsPlugin() transforms __PROD__ expressions 1`] = ` +exports[`envConstantsPlugin() > transforms __PROD__ expressions 1`] = ` "if (process.env.NODE_ENV === 'production') {} else if (process.env.NODE_ENV === 'production' && 123) {} else if (true || process.env.NODE_ENV === 'production') {} else if (!(process.env.NODE_ENV === 'production')) {} else {} switch (process.env.NODE_ENV === 'production') {} while (process.env.NODE_ENV === 'production') {} @@ -26,7 +26,7 @@ const arrayValue = [process.env.NODE_ENV === 'production']; React.createElement(Foo, null, process.env.NODE_ENV === 'production' ? 'Child' : null);" `; -exports[`envConstantsPlugin() transforms __TEST__ expressions 1`] = ` +exports[`envConstantsPlugin() > transforms __TEST__ expressions 1`] = ` "if (process.env.NODE_ENV === 'test') {} else if (process.env.NODE_ENV === 'test' && 123) {} else if (true || process.env.NODE_ENV === 'test') {} else if (!(process.env.NODE_ENV === 'test')) {} else {} switch (process.env.NODE_ENV === 'test') {} while (process.env.NODE_ENV === 'test') {} @@ -39,7 +39,7 @@ const arrayValue = [process.env.NODE_ENV === 'test']; React.createElement(Foo, null, process.env.NODE_ENV === 'test' ? 'Child' : null);" `; -exports[`envConstantsPlugin() will not transform invalid __DEV__ expressions 1`] = ` +exports[`envConstantsPlugin() > will not transform invalid __DEV__ expressions 1`] = ` "const __DEV__ = 123; const objectProperty = { __DEV__: true @@ -53,7 +53,7 @@ const arrayIndex = []; arrayIndex[__DEV__] = 1;" `; -exports[`envConstantsPlugin() will not transform invalid __PROD__ expressions 1`] = ` +exports[`envConstantsPlugin() > will not transform invalid __PROD__ expressions 1`] = ` "const __PROD__ = 123; const objectProperty = { __PROD__: true @@ -67,7 +67,7 @@ const arrayIndex = []; arrayIndex[__PROD__] = 1;" `; -exports[`envConstantsPlugin() will not transform invalid __TEST__ expressions 1`] = ` +exports[`envConstantsPlugin() > will not transform invalid __TEST__ expressions 1`] = ` "const __TEST__ = 123; const objectProperty = { __TEST__: true diff --git a/packages/babel-plugin-env-constants/tests/plugin.test.ts b/packages/babel-plugin-env-constants/tests/plugin.test.ts index 86b85b5c4..2ac293538 100644 --- a/packages/babel-plugin-env-constants/tests/plugin.test.ts +++ b/packages/babel-plugin-env-constants/tests/plugin.test.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from 'vitest'; import { transformAsync, TransformOptions } from '@babel/core'; import envConstantsPlugin from '../src'; diff --git a/packages/packemon/jest.config.js b/packages/packemon/jest.config.js deleted file mode 100644 index 1be1c7ed8..000000000 --- a/packages/packemon/jest.config.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - coveragePathIgnorePatterns: ['src/commands', 'src/components'], - preset: 'jest-preset-moon', - testTimeout: 10_000, -}; diff --git a/packages/packemon/package.json b/packages/packemon/package.json index 1076d6b59..3714439d7 100644 --- a/packages/packemon/package.json +++ b/packages/packemon/package.json @@ -78,18 +78,17 @@ "@rollup/plugin-commonjs": "^25.0.7", "@rollup/plugin-json": "^6.1.0", "@rollup/plugin-node-resolve": "^15.2.3", - "@swc/core": "^1.4.0", + "@swc/core": "^1.4.2", "@swc/helpers": "^0.5.6", "babel-plugin-cjs-esm-interop": "^3.0.3", "babel-plugin-conditional-invariant": "^3.0.1", "babel-plugin-env-constants": "^3.0.1", - "babel-preset-solid": "^1.8.12", - "browserslist": "^4.22.3", + "babel-preset-solid": "^1.8.15", + "browserslist": "^4.23.0", "debug": "^4.3.4", "execa": "^8.0.1", "fast-glob": "^3.3.2", "filesize": "^10.1.0", - "fs-extra": "^11.2.0", "ink": "^4.4.1", "ink-progress-bar": "^3.0.0", "ink-spinner": "^5.0.0", diff --git a/packages/packemon/src/Artifact.ts b/packages/packemon/src/Artifact.ts index 54c5f74eb..7fcb5919c 100644 --- a/packages/packemon/src/Artifact.ts +++ b/packages/packemon/src/Artifact.ts @@ -1,5 +1,4 @@ import { execa } from 'execa'; -import fs from 'fs-extra'; import { rollup } from 'rollup'; import { applyStyle } from '@boost/cli'; import { isObject, Path, toArray, VirtualPath } from '@boost/common'; @@ -14,7 +13,7 @@ import type { Build, BuildOptions, BuildResult, - BuildResultFiles, + BuildResultFile, ConfigFile, FeatureFlags, Format, @@ -108,7 +107,7 @@ export class Artifact { }, }); - const files: BuildResultFiles[] = []; + const files: BuildResultFile[] = []; await Promise.all( toArray(output).map(async (out, index) => { @@ -126,6 +125,15 @@ export class Artifact { // Update build results and stats const bundledCode = result.output.reduce((code, chunk) => { + if (chunk.type === 'asset') { + files.push({ + code: typeof chunk.source === 'string' ? chunk.source : '', + file: chunk.fileName.endsWith('js') + ? `${originalFormat}/${chunk.fileName}` + : chunk.fileName, + }); + } + if (chunk.type === 'chunk') { files.push({ code: chunk.code, @@ -195,7 +203,7 @@ export class Artifact { if (hasCjs) { this.debug('CJS types compatibility enabled, renaming `.d.ts` to `.d.cts`'); - await convertCjsTypes(this.package.path.append('cjs')); + await convertCjsTypes(this.package.path.append('cjs'), this.package.fs); } } } @@ -206,12 +214,15 @@ export class Artifact { const dirs = ['assets', 'dts', ...this.builds.map((build) => build.format)]; await Promise.all( + // eslint-disable-next-line @typescript-eslint/require-await dirs.map(async (dir) => { const dirPath = this.package.path.append(dir).path(); this.debug(' - %s', dirPath); - await fs.remove(dirPath); + if (this.package.fs.exists(dirPath)) { + this.package.fs.removeDir(dirPath); + } }), ); } diff --git a/packages/packemon/src/FileSystem.ts b/packages/packemon/src/FileSystem.ts new file mode 100644 index 000000000..fa7adc0e0 --- /dev/null +++ b/packages/packemon/src/FileSystem.ts @@ -0,0 +1,32 @@ +import fs from 'node:fs'; +import { json } from '@boost/common'; + +export interface FileSystem { + copyFile: (from: string, to: string) => void; + createDirAll: (path: string) => void; + exists: (path: string) => boolean; + readFile: (path: string) => string; + readJson: (path: string) => T; + removeDir: (path: string) => void; + removeFile: (path: string) => void; + writeFile: (path: string, data: string) => void; + writeJson: (path: string, data: unknown) => void; +} + +export const nodeFileSystem: FileSystem = { + copyFile: fs.copyFileSync, + createDirAll: (path) => fs.mkdirSync(path, { recursive: true }), + exists: (path) => fs.existsSync(path), + readFile: (path) => fs.readFileSync(path, 'utf8'), + readJson: (path) => json.parse(nodeFileSystem.readFile(path)), + removeDir: (path) => { + fs.rmSync(path, { recursive: true }); + }, + removeFile: fs.unlinkSync, + writeFile: (path, data) => { + fs.writeFileSync(path, `${data.trim()}\n`, 'utf8'); + }, + writeJson: (path, data) => { + nodeFileSystem.writeFile(path, JSON.stringify(data, null, 2)); + }, +}; diff --git a/packages/packemon/src/Package.ts b/packages/packemon/src/Package.ts index 8f5ea6851..260517763 100644 --- a/packages/packemon/src/Package.ts +++ b/packages/packemon/src/Package.ts @@ -3,7 +3,6 @@ /* eslint-disable @typescript-eslint/member-ordering */ import glob from 'fast-glob'; -import fs from 'fs-extra'; import semver from 'semver'; import { isObject, Memoize, PackageStructure, Path, toArray } from '@boost/common'; import { optimal } from '@boost/common/optimal'; @@ -19,6 +18,7 @@ import { NODE_SUPPORTED_VERSIONS, SUPPORT_PRIORITY, } from './constants'; +import { FileSystem, nodeFileSystem } from './FileSystem'; import { loadTsconfigJson } from './helpers/loadTsconfigJson'; import { matchesPattern } from './helpers/matchesPattern'; import { mergeExports } from './helpers/mergeExports'; @@ -43,6 +43,8 @@ export class Package { readonly debug!: Debugger; + fs: FileSystem = nodeFileSystem; + readonly json: PackemonPackage; readonly jsonPath: Path; @@ -95,31 +97,42 @@ export class Package { }), ); + let updated = false; + // Add package entry points based on artifacts - this.addEntryPoints(); + if (options.addEntries) { + updated = true; + this.addEntryPoints(); + } // Add package `engines` based on artifacts if (options.addEngines) { + updated = true; this.addEngines(); } // Add package `exports` based on artifacts if (options.addExports) { + updated = true; this.addExports(features); } // Add package `files` whitelist if (options.addFiles) { + updated = true; this.addFiles(); } // Stamp with a timestamp if (options.stamp) { + updated = true; this.json.release = String(Date.now()); } // Sync `package.json` in case it was modified - await this.syncJson(); + if (updated) { + this.syncJson(); + } } async clean(): Promise { @@ -269,7 +282,7 @@ export class Package { this.path.append('tsconfig.json').exists() || this.workspaceRoot.append('tsconfig.json').exists() ) { - const tsConfig = loadTsconfigJson(this.path.append('tsconfig.json')); + const tsConfig = loadTsconfigJson(this.path.append('tsconfig.json'), this.fs); flags.typescript = true; flags.typescriptComposite = Boolean( @@ -383,8 +396,8 @@ export class Package { }); } - async syncJson() { - await fs.writeJson(this.jsonPath.path(), this.json, { spaces: 2 }); + syncJson() { + this.fs.writeJson(this.jsonPath.path(), this.json); } protected addEngines() { diff --git a/packages/packemon/src/Packemon.ts b/packages/packemon/src/Packemon.ts index dec20f6fc..6d8fdad41 100644 --- a/packages/packemon/src/Packemon.ts +++ b/packages/packemon/src/Packemon.ts @@ -1,8 +1,8 @@ -import fs from 'fs-extra'; -import { json, Path, PortablePath, Project } from '@boost/common'; +import { Path, PortablePath, Project } from '@boost/common'; import { optimal } from '@boost/common/optimal'; import { createDebugger, Debugger } from '@boost/debug'; import { Config } from './Config'; +import { FileSystem, nodeFileSystem } from './FileSystem'; import { matchesPattern } from './helpers/matchesPattern'; import { Package } from './Package'; import { PackageValidator } from './PackageValidator'; @@ -14,6 +14,8 @@ export class Packemon { readonly debug: Debugger; + fs: FileSystem = nodeFileSystem; + readonly workingDir: Path; constructor(cwd: PortablePath = process.cwd()) { @@ -59,7 +61,7 @@ export class Packemon { * Find and load the package that has been configured with a `packemon` * block in the `package.json`. Once loaded, validate the configuration. */ - async findPackage({ skipPrivate }: FilterOptions = {}): Promise { + findPackage({ skipPrivate }: FilterOptions = {}): Package | null { this.debug('Finding package in %s', this.workingDir); const pkgPath = this.workingDir.append('package.json'); @@ -68,7 +70,7 @@ export class Packemon { throw new Error(`No \`package.json\` found in ${this.workingDir}.`); } - const pkgContents = json.parse(await fs.readFile(pkgPath.path(), 'utf8')); + const pkgContents = this.fs.readJson(pkgPath.path()); if (skipPrivate && pkgContents.private) { this.debug('Package is private and `skipPrivate` has been provided'); @@ -82,7 +84,10 @@ export class Packemon { return null; } - return new Package(this.workingDir, pkgContents, this.findWorkspaceRoot()); + const pkg = new Package(this.workingDir, pkgContents, this.findWorkspaceRoot()); + pkg.fs = this.fs; + + return pkg; } /** @@ -109,17 +114,21 @@ export class Packemon { let packages: Package[] = []; await Promise.all( + // eslint-disable-next-line @typescript-eslint/require-await pkgPaths.map(async (pkgPath) => { if (!pkgPath.exists()) { return; } - const contents = json.parse(await fs.readFile(pkgPath.path(), 'utf8')); + const contents = this.fs.readJson(pkgPath.path()); if (contents.packemon) { this.debug(' - %s (%s)', contents.name, pkgPath.path()); - packages.push(new Package(pkgPath.parent(), contents, workspaceRoot)); + const pkg = new Package(pkgPath.parent(), contents, workspaceRoot); + pkg.fs = this.fs; + + packages.push(pkg); } else { this.debug('No `packemon` configuration found for %s, skipping', contents.name); } @@ -189,7 +198,7 @@ export class Packemon { const pkgPath = dir.append('package.json'); if (pkgPath.exists()) { - const pkg = json.parse(fs.readFileSync(pkgPath.path(), 'utf8')); + const pkg = this.fs.readJson(pkgPath.path()); if (pkg.workspaces) { return dir; diff --git a/packages/packemon/src/babel.ts b/packages/packemon/src/babel.ts index fc2b1b408..943e7cc65 100644 --- a/packages/packemon/src/babel.ts +++ b/packages/packemon/src/babel.ts @@ -1,4 +1,3 @@ -import fs from 'fs-extra'; import { TransformOptions as ConfigStructure } from '@babel/core'; import { Path, toArray } from '@boost/common'; import { FeatureFlags } from './types'; @@ -44,8 +43,8 @@ export interface ConfigOptions { export function createConfig(folder: string, options: ConfigOptions = {}): ConfigStructure { const path = new Path(folder); - const contents = fs.readJsonSync(path.append('package.json').path()) as PackemonPackage; const packemon = new Packemon(); + const contents = packemon.fs.readJson(path.append('package.json').path()); // Create package and configs const pkg = new Package(path, contents, packemon.findWorkspaceRoot()); diff --git a/packages/packemon/src/babel/config.ts b/packages/packemon/src/babel/config.ts index 3bd38912e..488306797 100644 --- a/packages/packemon/src/babel/config.ts +++ b/packages/packemon/src/babel/config.ts @@ -55,7 +55,7 @@ function getPlatformEnvOptions( ]; // https://caniuse.com/es6-module-dynamic-import - if (shouldKeepDynamicImport(platform, support)) { + if (shouldKeepDynamicImport(platform, format)) { exclude.push('@babel/plugin-proposal-dynamic-import'); } diff --git a/packages/packemon/src/bin.ts b/packages/packemon/src/bin.ts index 0f43517e0..b45cb775e 100644 --- a/packages/packemon/src/bin.ts +++ b/packages/packemon/src/bin.ts @@ -1,5 +1,6 @@ import debug from 'debug'; import { checkPackageOutdated, Program } from '@boost/cli'; +import { nodeFileSystem } from './FileSystem'; import { getVersion } from './helpers/getVersion'; import { BuildCommand, @@ -17,7 +18,7 @@ import { let version = '0.0.0-internal'; try { - version = getVersion(); + version = getVersion(nodeFileSystem); } catch { // Ignore } diff --git a/packages/packemon/src/commands/Init.tsx b/packages/packemon/src/commands/Init.tsx index e15573b91..3924434fd 100644 --- a/packages/packemon/src/commands/Init.tsx +++ b/packages/packemon/src/commands/Init.tsx @@ -38,7 +38,9 @@ export class InitCommand extends BaseCommand { return ( this.writeConfigToPackageJson(pkg, config)} + onComplete={(config) => { + this.writeConfigToPackageJson(pkg, config); + }} /> ); } @@ -84,10 +86,9 @@ export class InitCommand extends BaseCommand { return config; } - async writeConfigToPackageJson(pkg: Package, config: PackemonPackageConfig) { + writeConfigToPackageJson(pkg: Package, config: PackemonPackageConfig) { // eslint-disable-next-line no-param-reassign pkg.json.packemon = this.formatConfigObject(config); - - return pkg.syncJson(); + pkg.syncJson(); } } diff --git a/packages/packemon/src/commands/Scaffold.tsx b/packages/packemon/src/commands/Scaffold.tsx index 557c65ea6..60eed730f 100644 --- a/packages/packemon/src/commands/Scaffold.tsx +++ b/packages/packemon/src/commands/Scaffold.tsx @@ -3,9 +3,9 @@ import path from 'node:path'; import { fileURLToPath } from 'node:url'; import glob from 'fast-glob'; -import fs from 'fs-extra'; import { Arg, Command, Config } from '@boost/cli'; import { json } from '@boost/common'; +import { nodeFileSystem } from '../FileSystem'; import { InfraType, ScaffoldParams, TemplateType } from '../types'; @Config('scaffold', 'Scaffold projects and packages with ease') @@ -80,7 +80,7 @@ export class ScaffoldCommand extends Command { } async scaffoldMonorepo(params: ScaffoldParams) { - await this.checkExistingInfrastructure('monorepo'); + this.checkExistingInfrastructure('monorepo'); await this.copyFilesFromTemplate('base', this.destDir, params); await this.copyFilesFromTemplate('monorepo', this.destDir, { ...params, @@ -89,7 +89,7 @@ export class ScaffoldCommand extends Command { await this.installDependencies('monorepo'); try { - await fs.mkdir(path.join(this.destDir, this.packagesFolder)); + nodeFileSystem.createDirAll(path.join(this.destDir, this.packagesFolder)); } catch { // Ignore } @@ -98,7 +98,7 @@ export class ScaffoldCommand extends Command { async scaffoldMonorepoPackage(params: ScaffoldParams) { const packagesDir = path.join(this.destDir, this.packagesFolder); - fs.mkdirSync(packagesDir, { recursive: true }); + nodeFileSystem.createDirAll(packagesDir); const { packageName } = params; const folderName = packageName.startsWith('@') ? packageName.split('/')[1] : packageName; @@ -111,11 +111,11 @@ export class ScaffoldCommand extends Command { packagePath, }); - await this.addProjectReference(packagePath); + this.addProjectReference(packagePath); } async scaffoldPolyrepo(params: ScaffoldParams) { - await this.checkExistingInfrastructure('polyrepo'); + this.checkExistingInfrastructure('polyrepo'); await this.copyFilesFromTemplate('base', this.destDir, params); await this.copyFilesFromTemplate('polyrepo', this.destDir, params); await this.installDependencies('polyrepo'); @@ -127,9 +127,9 @@ export class ScaffoldCommand extends Command { await this.copyFilesFromTemplate('package', this.destDir, params); } - async addProjectReference(packagePath: string) { + addProjectReference(packagePath: string) { const tsconfigPath = path.join(this.destDir, 'tsconfig.json'); - const tsconfig = await this.loadJsonConfig<{ references?: { path: string }[] }>(tsconfigPath); + const tsconfig = nodeFileSystem.readJson<{ references?: { path: string }[] }>(tsconfigPath); if (!Array.isArray(tsconfig.references)) { tsconfig.references = []; @@ -141,7 +141,7 @@ export class ScaffoldCommand extends Command { tsconfig.references.sort((a, b) => a.path.localeCompare(b.path)); - await fs.writeJson(tsconfigPath, tsconfig, { spaces: 2 }); + nodeFileSystem.writeJson(tsconfigPath, tsconfig); } async installDependencies(type: InfraType) { @@ -150,17 +150,15 @@ export class ScaffoldCommand extends Command { } const args = [ - '@types/jest', '@types/node', 'eslint-config-moon', 'eslint', - 'jest-preset-moon', - 'jest', 'packemon', 'prettier-config-moon', 'prettier', 'tsconfig-moon', 'typescript', + 'vitest', ]; switch (this.packageManager) { @@ -187,14 +185,14 @@ export class ScaffoldCommand extends Command { }); } - async checkExistingInfrastructure(type: InfraType) { + checkExistingInfrastructure(type: InfraType) { const packagePath = path.join(this.destDir, 'package.json'); - if (!fs.existsSync(packagePath)) { + if (!nodeFileSystem.exists(packagePath)) { return; } - const pkg = await this.loadJsonConfig<{ infra: string }>(packagePath); + const pkg = nodeFileSystem.readJson<{ infra: string }>(packagePath); if (pkg.infra === undefined) { throw new Error( @@ -207,37 +205,37 @@ export class ScaffoldCommand extends Command { } } - async copyFile(fromTemplate: string, toDest: string, params: Record) { + copyFile(fromTemplate: string, toDest: string, params: Record) { const isPackage = fromTemplate.endsWith('package.json') && toDest.endsWith('package.json'); // Dont overwrite existing files (except package.json) - if (fs.existsSync(toDest) && !this.force && !isPackage) { + if (nodeFileSystem.exists(toDest) && !this.force && !isPackage) { return; } const toDir = path.dirname(toDest); - if (!fs.existsSync(toDir)) { - await fs.ensureDir(toDir); + if (!nodeFileSystem.exists(toDir)) { + nodeFileSystem.createDirAll(toDir); } // Interpolate params into string content - let content = await fs.readFile(fromTemplate, 'utf8'); + let content = nodeFileSystem.readFile(fromTemplate); Object.entries(params).forEach(([key, value]) => { content = content.replace(new RegExp(`<${key}>`, 'g'), String(value)); }); // Instead of overwriting package.json, we want to merge them - if (fs.existsSync(toDest) && isPackage) { - const prevContent = await this.loadJsonConfig(toDest); + if (nodeFileSystem.exists(toDest) && isPackage) { + const prevContent = nodeFileSystem.readJson(toDest); const nextContent = json.parse(content); - await fs.writeJson(toDest, { ...prevContent, ...nextContent }, { spaces: 2 }); + nodeFileSystem.writeJson(toDest, { ...prevContent, ...nextContent }); // Otherwise write content as a string } else { - await fs.writeFile(toDest, content, 'utf8'); + nodeFileSystem.writeFile(toDest, content); } } @@ -254,14 +252,10 @@ export class ScaffoldCommand extends Command { }); return Promise.all( - files.map((file) => - this.copyFile(path.join(templateDir, file), path.join(destDir, file), { ...params }), + files.map( + (file) => + void this.copyFile(path.join(templateDir, file), path.join(destDir, file), { ...params }), ), ); } - - async loadJsonConfig(filePath: string) { - // Supports comments - return json.parse(await fs.readFile(filePath, 'utf8')); - } } diff --git a/packages/packemon/src/components/Init/index.tsx b/packages/packemon/src/components/Init/index.tsx index 271759fd2..bac7e2d8f 100644 --- a/packages/packemon/src/components/Init/index.tsx +++ b/packages/packemon/src/components/Init/index.tsx @@ -10,7 +10,7 @@ export type InitPackageConfigs = Record; export interface InitProps { packageName: string; - onComplete: (config: PackemonPackageConfig) => Promise; + onComplete: (config: PackemonPackageConfig) => void; } export function Init({ packageName, onComplete }: InitProps) { @@ -18,17 +18,13 @@ export function Init({ packageName, onComplete }: InitProps) { const handleSubmit = useCallback( (config: PackemonPackageConfig) => { - async function complete() { - try { - await onComplete(config); - } catch (error: unknown) { - exit(error as Error); - } finally { - exit(); - } + try { + onComplete(config); + } catch (error: unknown) { + exit(error as Error); + } finally { + exit(); } - - void complete(); }, [exit, onComplete], ); diff --git a/packages/packemon/src/constants.ts b/packages/packemon/src/constants.ts index c133dedfb..f2d35a002 100644 --- a/packages/packemon/src/constants.ts +++ b/packages/packemon/src/constants.ts @@ -9,12 +9,15 @@ import { Support, } from './types'; -export const ASSETS = [ +export const TEXT_ASSETS = [ // Styles '.css', '.scss', '.sass', '.less', +]; + +export const BINARY_ASSETS = [ // Images '.svg', '.png', @@ -39,6 +42,8 @@ export const ASSETS = [ '.ttf', ]; +export const ASSETS = [...TEXT_ASSETS, ...BINARY_ASSETS]; + export const EXTENSIONS = ['.ts', '.tsx', '.cts', '.mts', '.js', '.jsx', '.cjs', '.mjs']; export const EXCLUDE = [ diff --git a/packages/packemon/src/helpers/compat/convertCjsTypes.ts b/packages/packemon/src/helpers/compat/convertCjsTypes.ts index 5a904dedb..2fb58f8bb 100644 --- a/packages/packemon/src/helpers/compat/convertCjsTypes.ts +++ b/packages/packemon/src/helpers/compat/convertCjsTypes.ts @@ -1,31 +1,34 @@ import glob from 'fast-glob'; -import fs from 'fs-extra'; import { Path } from '@boost/common'; +import { FileSystem } from '../../FileSystem'; -export async function convertCjsTypes(cjsDir: Path) { +export async function convertCjsTypes(cjsDir: Path, fs: FileSystem) { const dtsFiles = await glob(['**/*.d.ts', '**/*.d.ts.map'], { absolute: true, cwd: cjsDir.path(), }); await Promise.all( + // eslint-disable-next-line @typescript-eslint/require-await dtsFiles.map(async (dtsFile) => { const dtsPath = Path.create(dtsFile); const inName = dtsPath.name(); const outName = inName.replace('.d.ts', '.d.cts'); // Read contents and fix source map paths - let contents = (await fs.readFile(dtsPath.path(), 'utf8')).replace(inName, outName); + let contents = fs.readFile(dtsPath.path()).replace(inName, outName); if (dtsFile.endsWith('.map')) { contents = contents.replace(inName.replace('.map', ''), outName.replace('.map', '')); } // Write the new file - await fs.writeFile(dtsPath.parent().append(outName).path(), contents); + fs.writeFile(dtsPath.parent().append(outName).path(), contents); // Delete the old file - await fs.unlink(dtsPath.path()); + if (fs.exists(dtsPath.path())) { + fs.removeFile(dtsPath.path()); + } }), ); } diff --git a/packages/packemon/src/helpers/getVersion.ts b/packages/packemon/src/helpers/getVersion.ts index 911840c80..6ded45350 100644 --- a/packages/packemon/src/helpers/getVersion.ts +++ b/packages/packemon/src/helpers/getVersion.ts @@ -1,10 +1,6 @@ -import fs from 'node:fs'; import { PackageStructure } from '@boost/common'; +import { FileSystem } from '../FileSystem'; -export function getVersion(): string { - return ( - JSON.parse( - fs.readFileSync(new URL('../../package.json', import.meta.url), 'utf8'), - ) as PackageStructure - ).version; +export function getVersion(fs: FileSystem): string { + return fs.readJson(new URL('../../package.json', import.meta.url).href).version; } diff --git a/packages/packemon/src/helpers/loadTsconfigJson.ts b/packages/packemon/src/helpers/loadTsconfigJson.ts index 90fd701b4..6e69d813a 100644 --- a/packages/packemon/src/helpers/loadTsconfigJson.ts +++ b/packages/packemon/src/helpers/loadTsconfigJson.ts @@ -1,11 +1,14 @@ -import fs from 'node:fs'; import { Path, PortablePath } from '@boost/common'; +import { FileSystem } from '../FileSystem'; import { TSConfigStructure } from '../types'; import { loadModule } from './loadModule'; const CACHE = new Map(); -export function loadTsconfigJson(path: PortablePath): TSConfigStructure | undefined { +export function loadTsconfigJson( + path: PortablePath, + fs: FileSystem, +): TSConfigStructure | undefined { const tsconfigJsonPath = Path.create(path); const tsconfig = CACHE.get(tsconfigJsonPath); @@ -23,9 +26,7 @@ export function loadTsconfigJson(path: PortablePath): TSConfigStructure | undefi ) as typeof import('typescript'); // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment - const { config, error } = ts.readConfigFile(tsconfigJsonPath.path(), (name) => - fs.readFileSync(name, 'utf8'), - ); + const { config, error } = ts.readConfigFile(tsconfigJsonPath.path(), fs.readFile); const host = { getCanonicalFileName: (fileName: string) => fileName, diff --git a/packages/packemon/src/helpers/shouldKeepDynamicImport.ts b/packages/packemon/src/helpers/shouldKeepDynamicImport.ts index ed2fbc23e..26690fde9 100644 --- a/packages/packemon/src/helpers/shouldKeepDynamicImport.ts +++ b/packages/packemon/src/helpers/shouldKeepDynamicImport.ts @@ -1,7 +1,11 @@ -import { Platform, Support } from '../types'; +import { Format, Platform } from '../types'; // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#browser_compatibility -export function shouldKeepDynamicImport(platform: Platform, support: Support): boolean { +export function shouldKeepDynamicImport(platform: Platform, format: Format): boolean { + if (format === 'umd') { + return false; + } + switch (platform) { case 'node': // >= v13.2 @@ -12,9 +16,11 @@ export function shouldKeepDynamicImport(platform: Platform, support: Support): b // >= 2019 // https://caniuse.com/es6-module-dynamic-import return true; + case 'native': + // >= RN 0.72 + // https://metrobundler.dev/docs/module-api/#import-dynamic-import + return true; default: - // RN does not support code splitting - // https://github.com/facebook/metro/issues/52 return false; } } diff --git a/packages/packemon/src/index.ts b/packages/packemon/src/index.ts index b03ea065f..119ac0502 100644 --- a/packages/packemon/src/index.ts +++ b/packages/packemon/src/index.ts @@ -17,6 +17,7 @@ export * from './commands/Scaffold'; export * from './commands/Validate'; export * from './commands/Watch'; export * from './constants'; +export type { FileSystem } from './FileSystem'; export * from './Package'; export * from './PackageValidator'; export * from './Packemon'; diff --git a/packages/packemon/src/rollup/config.ts b/packages/packemon/src/rollup/config.ts index 3e493b9eb..0a859ee1b 100644 --- a/packages/packemon/src/rollup/config.ts +++ b/packages/packemon/src/rollup/config.ts @@ -103,6 +103,7 @@ export function getRollupOutputConfig( format: getRollupModuleFormat(format), originalFormat: format, interop: 'auto', + exports: 'named', // Map our externals to local paths with trailing extension paths: getRollupPaths(artifact, entryExt), // Use our extension for file names @@ -120,7 +121,7 @@ export function getRollupOutputConfig( }, // Output specific plugins plugins: [ - preserveDynamicImport(platform, support), + preserveDynamicImport(platform, format), isSwc ? swcOutput({ ...getSwcOutputConfig(platform, support, format, features, packemonConfig), @@ -202,7 +203,8 @@ export async function getRollupConfig( json({ compact: true, namedExports: false }), // Copy assets and update import references copyAndRefAssets({ - dir: artifact.package.path.append('assets').path(), + fs: artifact.package.fs, + root: artifact.package.path.path(), }), // Declare Babel/swc here so we can parse TypeScript/Flow isSwc @@ -215,7 +217,7 @@ export async function getRollupConfig( }) : getBabelInputPlugin({ ...getBabelInputConfig(artifact, features, packemonConfig), - babelHelpers: artifact.features.helpers, + babelHelpers: artifact.features.helpers ?? 'bundled', exclude: isTest ? [] : EXCLUDE, extensions: EXTENSIONS, filename: artifact.package.path.path(), diff --git a/packages/packemon/src/rollup/plugins/copyAndRefAssets.ts b/packages/packemon/src/rollup/plugins/copyAndRefAssets.ts index 3655086f7..111a3899b 100644 --- a/packages/packemon/src/rollup/plugins/copyAndRefAssets.ts +++ b/packages/packemon/src/rollup/plugins/copyAndRefAssets.ts @@ -1,11 +1,12 @@ import { createHash } from 'node:crypto'; +import fsn from 'node:fs'; import path from 'node:path'; -import fs from 'fs-extra'; import MagicString from 'magic-string'; import { Plugin } from 'rollup'; import { VirtualPath } from '@boost/common'; import type { TSESTree } from '@typescript-eslint/types'; -import { ASSETS } from '../../constants'; +import { ASSETS, TEXT_ASSETS } from '../../constants'; +import { FileSystem } from '../../FileSystem'; function isAsset(id: string): boolean { return ASSETS.some((ext) => id.endsWith(ext)); @@ -25,42 +26,49 @@ function isRequireStatement(node: TSESTree.Expression): node is TSESTree.CallExp } export interface CopyAssetsOptions { - dir: string; + dir?: string; + fs: FileSystem; + root: string; } export function copyAndRefAssets( - { dir }: CopyAssetsOptions, + { dir: customDir, fs, root }: CopyAssetsOptions, assetsToCopyInit: Record = {}, ): Plugin { + const dir = customDir ?? path.join(root, 'assets'); const assetsToCopy = assetsToCopyInit; + const assetSourceMap = new Set(); + const pattern = /^\.{1,2}(\/|\\)/; - function determineNewAsset(source: string, importer?: string | null): VirtualPath { - let preparedImporter = importer ? path.dirname(importer) : ''; - - // Find overlapping directory names and remove them - const normalizedRelativePath = path.normalize(source); - const absoluteParts = preparedImporter.split(path.sep); - const relativeParts = normalizedRelativePath.split(path.sep); - - for (let i = absoluteParts.length - 1; i >= 0; i -= 1) { - if ( - absoluteParts[i] === relativeParts[0] && - absoluteParts.slice(i).every((p: string, idx: number) => p === relativeParts[idx]) - ) { - const overlap = absoluteParts.slice(i, absoluteParts.length).join(path.sep); - preparedImporter = preparedImporter.slice(0, -overlap.length); + function findMatchingSource(relSource: string): string | undefined { + let source = relSource; + + if (source.startsWith('node:') || source.startsWith('bun:')) { + return undefined; + } + + while (source.startsWith('.')) { + source = source.replace(pattern, ''); + } + + for (const id of assetSourceMap) { + if (id.endsWith(source)) { + return id; } } - const fullPath = path.join(preparedImporter, source); - const id = new VirtualPath(fullPath); + return undefined; + } + + function determineNewAsset(absSource: string): VirtualPath { + const id = new VirtualPath(absSource); const ext = id.ext(); const name = id.name(true); // Generate a hash of the source file path, // and have it match between nix and windows const hash = createHash('sha256') - .update(id.path().replace(new VirtualPath(path.dirname(dir)).path(), '')) + .update(id.path().replace(new VirtualPath(root).path(), '')) .digest('hex') .slice(0, 8); @@ -76,8 +84,10 @@ export function copyAndRefAssets( name: 'packemon-copy-and-ref-assets', // Delete old assets to remove any possible stale assets - async buildStart() { - await fs.remove(dir); + buildStart() { + if (fs.exists(dir) && process.env.NODE_ENV !== 'test') { + fs.removeDir(dir); + } }, // Find assets and mark as external @@ -87,7 +97,9 @@ export function copyAndRefAssets( // Check that the file actually exists, because they may be // using path aliases, or bundler specific syntax - if (source.startsWith('.') && fs.existsSync(id)) { + if (source.startsWith('.') && fs.exists(id)) { + assetSourceMap.add(id); + return { id, external: true }; } @@ -109,15 +121,6 @@ export function copyAndRefAssets( return null; } - /* - chunk.facadeModuleId is not ideal because the bundled code gets moved up to the - root (output) directory compared to where it was located in the source files, - the imports in the source files that get bundled get changed to be relative - to the new bundle location, but the chunk.facadeModuleId is the old location of - the index. So, you have the old path + the new updated imports and there could be - overlap due to this "hoisting", which has a workaround in determineNewAsset - */ - const parentId = chunk.facadeModuleId; // This correct? const magicString = new MagicString(code); let hasChanged = false; @@ -147,22 +150,17 @@ export function copyAndRefAssets( return; } - // Update to new path (ignore files coming from node modules) - const sourcePath = String(source.value); + const relSource = String(source.value); - if (sourcePath.includes(':')) { + if (!ASSETS.some((ext) => relSource.endsWith(ext))) { return; } - const parentDir = parentId ? path.dirname(parentId) : ''; + const absSource = findMatchingSource(relSource); - if ( - sourcePath && - isAsset(sourcePath) && - sourcePath.startsWith('.') && - fs.existsSync(path.join(parentDir, sourcePath)) - ) { - const newId = determineNewAsset(sourcePath, parentId); + if (absSource) { + const newId = determineNewAsset(absSource); + const parentDir = path.dirname(chunk.facadeModuleId!); const importPath = options.preserveModules ? new VirtualPath(path.relative(parentDir, newId.path())).path() : `../assets/${newId.name()}`; @@ -185,21 +183,30 @@ export function copyAndRefAssets( }, // Copy all found assets - async generateBundle() { + async generateBundle(options, bundle) { // Only create the folder if we have assets to copy, // otherwise it throws off `files` and other detection! if (Object.keys(assetsToCopy).length > 0) { - await fs.mkdir(dir, { recursive: true }); + fs.createDirAll(dir); } - // We don't use `assetFileNames` as we want a single assets folder + // We don't use `assetFileNames` or `emitFile` as we want a single assets folder // at the root of the package, which Rollup does not allow. It wants // multiple asset folders within each format! await Promise.all( + // eslint-disable-next-line @typescript-eslint/require-await Object.entries(assetsToCopy).map(async ([oldId, newId]) => { - if (!newId.exists()) { - await fs.copyFile(oldId, newId.path()); - } + const newName = newId.name(); + const isStringSource = TEXT_ASSETS.some((ext) => newName.endsWith(ext)); + + // eslint-disable-next-line no-param-reassign + bundle[newId.path()] = { + fileName: `../assets/${newName}`, + name: undefined, + needsCodeReference: false, + source: isStringSource ? fs.readFile(oldId) : fsn.readFileSync(oldId), + type: 'asset', + }; }), ); }, diff --git a/packages/packemon/src/rollup/plugins/preserveDynamicImport.ts b/packages/packemon/src/rollup/plugins/preserveDynamicImport.ts index 539286bbf..94c2167ca 100644 --- a/packages/packemon/src/rollup/plugins/preserveDynamicImport.ts +++ b/packages/packemon/src/rollup/plugins/preserveDynamicImport.ts @@ -1,9 +1,9 @@ import { OutputPlugin } from 'rollup'; import { shouldKeepDynamicImport } from '../../helpers/shouldKeepDynamicImport'; -import { Platform, Support } from '../../types'; +import { Format, Platform } from '../../types'; -export function preserveDynamicImport(platform: Platform, support: Support): OutputPlugin { - const preserve = shouldKeepDynamicImport(platform, support); +export function preserveDynamicImport(platform: Platform, format: Format): OutputPlugin { + const preserve = shouldKeepDynamicImport(platform, format); return { name: 'packemon-preserve-dynamic-import', diff --git a/packages/packemon/src/rollup/plugins/swc.ts b/packages/packemon/src/rollup/plugins/swc.ts index de90c118a..da3988898 100644 --- a/packages/packemon/src/rollup/plugins/swc.ts +++ b/packages/packemon/src/rollup/plugins/swc.ts @@ -9,6 +9,7 @@ export function swcInput(config: Partial): Plugin { return transform(code, { ...config, filename, + sourceMaps: true, }); }, }; @@ -19,7 +20,10 @@ export function swcOutput(config: Partial): OutputPlugin { name: 'packemon-swc-output', async renderChunk(code) { - return transform(code, config); + return transform(code, { + ...config, + sourceMaps: true, + }); }, }; } diff --git a/packages/packemon/src/schemas.ts b/packages/packemon/src/schemas.ts index 5daf3f914..20467411a 100644 --- a/packages/packemon/src/schemas.ts +++ b/packages/packemon/src/schemas.ts @@ -94,6 +94,7 @@ export const packemonBlueprint: Blueprint = { export const buildBlueprint: Blueprint = { addEngines: bool(), + addEntries: bool(true), addExports: bool(), addFiles: bool(), concurrency: number(1).gte(1), diff --git a/packages/packemon/src/swc/config.ts b/packages/packemon/src/swc/config.ts index 03df31dd8..1c2f3cffb 100644 --- a/packages/packemon/src/swc/config.ts +++ b/packages/packemon/src/swc/config.ts @@ -175,7 +175,7 @@ export function getSwcOutputConfig( const module: ModuleConfig = { type: getModuleConfigType(format), - ignoreDynamic: shouldKeepDynamicImport(platform, support), + ignoreDynamic: shouldKeepDynamicImport(platform, format), }; // This is to trick the Babel plugin to not transform the const diff --git a/packages/packemon/src/types.ts b/packages/packemon/src/types.ts index 90dfbb610..eacf25c44 100644 --- a/packages/packemon/src/types.ts +++ b/packages/packemon/src/types.ts @@ -140,6 +140,7 @@ export interface FilterOptions { export interface BuildOptions extends FilterOptions { addEngines?: boolean; + addEntries?: boolean; addExports?: boolean; addFiles?: boolean; concurrency?: number; @@ -157,13 +158,13 @@ export interface BuildParams { support: Support; } -export interface BuildResultFiles { +export interface BuildResultFile { code: string; file: string; } export interface BuildResult { - files: BuildResultFiles[]; + files: BuildResultFile[]; time: number; } diff --git a/packages/packemon/templates/base/README.md b/packages/packemon/templates/base/README.md index a36652d4c..0f1fe3b07 100644 --- a/packages/packemon/templates/base/README.md +++ b/packages/packemon/templates/base/README.md @@ -17,8 +17,6 @@ installed and [pre-configured using moonrepo presets](https://github.com/moonrep [babel-preset-moon](https://www.npmjs.com/package/babel-preset-moon). - [ESLint](https://eslint.org/) for linting, configured with [eslint-config-moon](https://www.npmjs.com/package/eslint-config-moon). -- [Jest](https://jestjs.io/) for unit testing, configured with - [jest-preset-moon](https://www.npmjs.com/package/jest-preset-moon). - [Prettier](https://prettier.io/) for code formatting, configured with [prettier-config-moon](https://www.npmjs.com/package/prettier-config-moon). - [Rollup](https://rollupjs.org) for bundling and distributing, configured dynamically with @@ -35,7 +33,6 @@ simple! Open the following files and remove the `// Uncomment if using React/Sol surrounding comments. - root `.eslintrc.js` (also replace `moon/node` with `moon/browser`) -- root `jest.config.js` - every `tsconfig.json` - root `tsconfig.options.json` @@ -72,7 +69,7 @@ The tooling mentioned above can be ran with the following yarn/npm scripts. For - `check` - Run the type checker, linter, and testing suite all at once. - `format` - Run Prettier and format all files in the project. - `lint` - Run the linter with ESLint. -- `test`, `coverage` - Run the unit testing suite with Jest, and optionally with code coverage. +- `test`, `coverage` - Run the unit testing suite with Vitest, and optionally with code coverage. - `type` - Run the type checker with TypeScript. ## What's next? diff --git a/packages/packemon/templates/base/jest.config.js b/packages/packemon/templates/base/jest.config.js deleted file mode 100644 index bd2fba70a..000000000 --- a/packages/packemon/templates/base/jest.config.js +++ /dev/null @@ -1,6 +0,0 @@ -// https://www.npmjs.com/package/jest-preset-moon -module.exports = { - preset: 'jest-preset-moon', - // Uncomment if using React/Solid - // testEnvironment: 'jsdom', -}; diff --git a/packages/packemon/templates/monorepo/package.json b/packages/packemon/templates/monorepo/package.json index 6b559a59d..b29bc5713 100644 --- a/packages/packemon/templates/monorepo/package.json +++ b/packages/packemon/templates/monorepo/package.json @@ -11,7 +11,7 @@ "pack": "packemon pack-workspace --addEngines --declaration", "prelease": "yarn run pack && yarn run check", "release": "echo 'Customize your own release script!'", - "test": "jest", + "test": "vitest", "type": "tsc --build" }, "workspaces": [ diff --git a/packages/packemon/templates/package/tests/index.test.ts b/packages/packemon/templates/package/tests/index.test.ts index 17c144c11..fd303e84b 100644 --- a/packages/packemon/templates/package/tests/index.test.ts +++ b/packages/packemon/templates/package/tests/index.test.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from 'vitest'; import { add } from '../src'; describe('add()', () => { diff --git a/packages/packemon/templates/polyrepo/package.json b/packages/packemon/templates/polyrepo/package.json index b905eda4e..4f16fdcb3 100644 --- a/packages/packemon/templates/polyrepo/package.json +++ b/packages/packemon/templates/polyrepo/package.json @@ -11,7 +11,7 @@ "pack": "packemon pack --addEngines --declaration", "prelease": "yarn run pack && yarn run check", "release": "echo 'Customize your own release script!'", - "test": "jest", + "test": "vitest", "type": "tsc && tsc -p ./tests", "validate": "packemon validate", "watch": "packemon watch" diff --git a/packages/packemon/tests/Artifact.test.ts b/packages/packemon/tests/Artifact.test.ts index 3c06fdef2..11569af31 100644 --- a/packages/packemon/tests/Artifact.test.ts +++ b/packages/packemon/tests/Artifact.test.ts @@ -1,14 +1,14 @@ import { execa } from 'execa'; -import fsx from 'fs-extra'; import { rollup } from 'rollup'; +import { beforeEach, describe, expect, it, type MockInstance, vi } from 'vitest'; import { applyStyle } from '@boost/cli'; import { Path } from '@boost/common'; import { Artifact } from '../src/Artifact'; import { getRollupConfig } from '../src/rollup/config'; import { getFixturePath, loadPackageAtPath, mockSpy } from './helpers'; -jest.mock('../src/rollup/config', () => ({ - getRollupConfig: jest.fn(() => ({ +vi.mock('../src/rollup/config', () => ({ + getRollupConfig: vi.fn(() => ({ input: true, output: [ { originalFormat: 'lib', a: true }, @@ -18,15 +18,15 @@ jest.mock('../src/rollup/config', () => ({ })), })); -jest.mock('execa'); +vi.mock('execa'); -jest.mock('rimraf', () => - jest.fn((path, cb) => { +vi.mock('rimraf', () => + vi.fn((path, cb) => { cb(); }), ); -jest.mock('rollup', () => ({ rollup: jest.fn() })); +vi.mock('rollup', () => ({ rollup: vi.fn() })); class TestArtifact extends Artifact { log = this.logWithSource.bind(this); @@ -50,8 +50,8 @@ describe('Artifact', () => { describe('build()', () => { it('builds code and types', async () => { - const codeSpy = jest.spyOn(artifact, 'buildCode').mockImplementation(); - const typesSpy = jest.spyOn(artifact, 'buildTypes').mockImplementation(); + const codeSpy = vi.spyOn(artifact, 'buildCode').mockImplementation(() => Promise.resolve()); + const typesSpy = vi.spyOn(artifact, 'buildTypes').mockImplementation(() => Promise.resolve()); await artifact.build({}, {}, {}); @@ -61,10 +61,10 @@ describe('Artifact', () => { }); describe('buildCode()', () => { - let bundleWriteSpy: jest.SpyInstance; + let bundleWriteSpy: MockInstance; beforeEach(() => { - bundleWriteSpy = jest.fn(() => ({ output: [{ type: 'chunk', code: 'code' }] })); + bundleWriteSpy = vi.fn(() => ({ output: [{ type: 'chunk', code: 'code' }] })); mockSpy(rollup) .mockReset() @@ -175,12 +175,16 @@ describe('Artifact', () => { describe('clean()', () => { it('removes the dir for each format', async () => { - const spy = jest.spyOn(fsx, 'remove'); + const spy = vi.spyOn(artifact.package.fs, 'removeDir').mockImplementation(() => {}); + + // Folders have to exist + artifact.package.fs.createDirAll(fixturePath.append('cjs').path()); + artifact.package.fs.createDirAll(fixturePath.append('mjs').path()); await artifact.clean(); - expect(spy).toHaveBeenCalledWith(fixturePath.append('assets').path()); - expect(spy).toHaveBeenCalledWith(fixturePath.append('dts').path()); + expect(spy).not.toHaveBeenCalledWith(fixturePath.append('assets').path()); + expect(spy).not.toHaveBeenCalledWith(fixturePath.append('dts').path()); expect(spy).toHaveBeenCalledWith(fixturePath.append('cjs').path()); expect(spy).toHaveBeenCalledWith(fixturePath.append('mjs').path()); }); @@ -658,7 +662,7 @@ describe('Artifact', () => { describe('logWithSource()', () => { it('logs a message to level', () => { - const spy = jest.spyOn(console, 'info').mockImplementation(); + const spy = vi.spyOn(console, 'info').mockImplementation(() => {}); artifact.log('Hello', 'info'); @@ -668,7 +672,7 @@ describe('Artifact', () => { }); it('includes output name and ID', () => { - const spy = jest.spyOn(console, 'error').mockImplementation(); + const spy = vi.spyOn(console, 'error').mockImplementation(() => {}); artifact.log('Hello', 'error', { id: 'id', output: 'index' }); @@ -678,7 +682,7 @@ describe('Artifact', () => { }); it('includes source information', () => { - const spy = jest.spyOn(console, 'warn').mockImplementation(); + const spy = vi.spyOn(console, 'warn').mockImplementation(() => {}); artifact.log('Hello', 'warn', { sourceFile: fixturePath.append('test.js').path(), @@ -694,7 +698,7 @@ describe('Artifact', () => { }); it('includes source line without column', () => { - const spy = jest.spyOn(console, 'warn').mockImplementation(); + const spy = vi.spyOn(console, 'warn').mockImplementation(() => {}); artifact.log('Hello', 'warn', { sourceLine: 10, @@ -706,7 +710,7 @@ describe('Artifact', () => { }); it('includes source column without line', () => { - const spy = jest.spyOn(console, 'info').mockImplementation(); + const spy = vi.spyOn(console, 'info').mockImplementation(() => {}); artifact.log('Hello', 'info', { sourceColumn: 55, diff --git a/packages/packemon/tests/Package.test.ts b/packages/packemon/tests/Package.test.ts index e70ac0540..e622a58b3 100644 --- a/packages/packemon/tests/Package.test.ts +++ b/packages/packemon/tests/Package.test.ts @@ -1,12 +1,13 @@ -import fsx from 'fs-extra'; +import { beforeEach, describe, expect, it, vi } from 'vitest'; import { Path } from '@boost/common'; import { mockNormalizedFilePath } from '@boost/common/test'; import { Artifact } from '../src/Artifact'; +import { nodeFileSystem } from '../src/FileSystem'; import { Package } from '../src/Package'; import { Build, ConfigFile, Platform, Support } from '../src/types'; -import { getFixturePath, loadPackageAtPath } from './helpers'; +import { createStubbedFileSystem, getFixturePath, loadPackageAtPath } from './helpers'; -jest.mock('rollup', () => ({ rollup: jest.fn() })); +vi.mock('rollup', () => ({ rollup: vi.fn() })); describe('Package', () => { const fixturePath = getFixturePath('project'); @@ -38,7 +39,7 @@ describe('Package', () => { } beforeEach(() => { - pkg = loadPackageAtPath(fixturePath); + pkg = loadPackageAtPath(fixturePath, null, createStubbedFileSystem()); }); it('sets properties on instantiation', () => { @@ -63,23 +64,17 @@ describe('Package', () => { }); describe('build()', () => { - let writeSpy: jest.SpyInstance; let config: ConfigFile; beforeEach(() => { - writeSpy = jest.spyOn(fsx, 'writeJson').mockImplementation(); config = {}; }); - afterEach(() => { - writeSpy.mockRestore(); - }); - it('calls `build` on each artifact', async () => { const [a, b, c] = createArtifacts(); - const aSpy = jest.spyOn(a, 'build').mockImplementation(); - const bSpy = jest.spyOn(b, 'build').mockImplementation(); - const cSpy = jest.spyOn(c, 'build').mockImplementation(); + const aSpy = vi.spyOn(a, 'build').mockImplementation(() => Promise.resolve()); + const bSpy = vi.spyOn(b, 'build').mockImplementation(() => Promise.resolve()); + const cSpy = vi.spyOn(c, 'build').mockImplementation(() => Promise.resolve()); pkg.artifacts.push(a, b, c); @@ -108,7 +103,7 @@ describe('Package', () => { it('sets failed state and result time on error', async () => { const artifact = new Artifact(pkg, []); - jest.spyOn(artifact, 'build').mockImplementation(() => { + vi.spyOn(artifact, 'build').mockImplementation(() => { throw new Error('Whoops'); }); @@ -127,11 +122,11 @@ describe('Package', () => { it('syncs `package.json` when done building', async () => { const artifact = new Artifact(pkg, []); - const spy = jest.spyOn(pkg, 'syncJson'); + const spy = vi.spyOn(pkg, 'syncJson'); pkg.artifacts.push(artifact); - await pkg.build({}, config); + await pkg.build({ addEntries: true }, config); expect(spy).toHaveBeenCalled(); }); @@ -214,7 +209,7 @@ describe('Package', () => { it('adds "main" for node `lib` format', async () => { pkg.artifacts.push(createCodeArtifact([{ format: 'lib' }])); - await pkg.build({}, config); + await pkg.build({ addEntries: true }, config); expect(pkg.json).toEqual( expect.objectContaining({ @@ -226,7 +221,7 @@ describe('Package', () => { it('adds "main" for node `cjs` format', async () => { pkg.artifacts.push(createCodeArtifact([{ format: 'cjs' }])); - await pkg.build({}, config); + await pkg.build({ addEntries: true }, config); expect(pkg.json).toEqual( expect.objectContaining({ @@ -238,7 +233,7 @@ describe('Package', () => { it('adds "main" for node `mjs` format', async () => { pkg.artifacts.push(createCodeArtifact([{ format: 'mjs' }])); - await pkg.build({}, config); + await pkg.build({ addEntries: true }, config); expect(pkg.json).toEqual( expect.objectContaining({ @@ -251,7 +246,7 @@ describe('Package', () => { const a = createCodeArtifact([{ format: 'lib' }], 'browser'); pkg.artifacts.push(a); - await pkg.build({}, config); + await pkg.build({ addEntries: true }, config); expect(pkg.json).toEqual( expect.objectContaining({ @@ -263,7 +258,7 @@ describe('Package', () => { it('adds "main" for browser `esm` format', async () => { pkg.artifacts.push(createCodeArtifact([{ format: 'esm' }], 'browser')); - await pkg.build({}, config); + await pkg.build({ addEntries: true }, config); expect(pkg.json).toEqual( expect.objectContaining({ @@ -276,7 +271,7 @@ describe('Package', () => { const a = createCodeArtifact([{ format: 'lib' }], 'native'); pkg.artifacts.push(a); - await pkg.build({}, config); + await pkg.build({ addEntries: true }, config); expect(pkg.json).toEqual( expect.objectContaining({ @@ -290,7 +285,7 @@ describe('Package', () => { a.inputs = { server: 'src/index.ts' }; pkg.artifacts.push(a); - await pkg.build({}, config); + await pkg.build({ addEntries: true }, config); expect(pkg.json.main).toBe('./lib/server.js'); }); @@ -304,7 +299,7 @@ describe('Package', () => { b.sharedLib = true; pkg.artifacts.push(b); - await pkg.build({}, config); + await pkg.build({ addEntries: true }, config); expect(pkg.json).toEqual( expect.objectContaining({ @@ -322,7 +317,7 @@ describe('Package', () => { a.sharedLib = true; pkg.artifacts.push(a); - await pkg.build({}, config); + await pkg.build({ addEntries: true }, config); expect(pkg.json).toEqual( expect.objectContaining({ @@ -337,7 +332,7 @@ describe('Package', () => { const a = createCodeArtifact([{ format: 'esm' }], 'browser'); pkg.artifacts.push(a); - await pkg.build({}, config); + await pkg.build({ addEntries: true }, config); expect(pkg.json).toEqual( expect.objectContaining({ @@ -359,7 +354,7 @@ describe('Package', () => { }); it('adds "browser" when browser and node are sharing a lib', async () => { - await pkg.build({}, config); + await pkg.build({ addEntries: true }, config); expect(pkg.json).toEqual( expect.objectContaining({ @@ -372,7 +367,7 @@ describe('Package', () => { it('adds "browser" for umd builds', async () => { pkg.artifacts[1] = createCodeArtifact([{ format: 'umd' }], 'browser'); - await pkg.build({}, config); + await pkg.build({ addEntries: true }, config); expect(pkg.json).toEqual( expect.objectContaining({ @@ -386,7 +381,7 @@ describe('Package', () => { // @ts-expect-error Types are wrong pkg.json.browser = { module: 'foo' }; - await pkg.build({}, config); + await pkg.build({ addEntries: true }, config); expect(pkg.json).toEqual( expect.objectContaining({ @@ -401,7 +396,7 @@ describe('Package', () => { it('adds "types" when a types artifact exists', async () => { pkg.artifacts.push(createCodeArtifact([{ declaration: true, format: 'lib' }])); - await pkg.build({}, config); + await pkg.build({ addEntries: true }, config); expect(pkg.json).toEqual( expect.objectContaining({ @@ -417,7 +412,7 @@ describe('Package', () => { a.inputs = { bin: 'src/bin.ts' }; pkg.artifacts.push(a); - await pkg.build({}, config); + await pkg.build({ addEntries: true }, config); expect(pkg.json).toEqual( expect.objectContaining({ @@ -431,7 +426,7 @@ describe('Package', () => { a.inputs = { bin: 'src/bin.ts' }; pkg.artifacts.push(a); - await pkg.build({}, config); + await pkg.build({ addEntries: true }, config); expect(pkg.json).toEqual( expect.objectContaining({ @@ -445,7 +440,7 @@ describe('Package', () => { a.inputs = { bin: 'src/bin.ts' }; pkg.artifacts.push(a); - await pkg.build({}, config); + await pkg.build({ addEntries: true }, config); expect(pkg.json).toEqual( expect.objectContaining({ @@ -461,7 +456,7 @@ describe('Package', () => { pkg.json.bin = {}; - await pkg.build({}, config); + await pkg.build({ addEntries: true }, config); expect(pkg.json.bin).toEqual({}); }); @@ -765,10 +760,10 @@ describe('Package', () => { }); it('includes assets folder if it exists', async () => { - pkg = loadPackageAtPath(getFixturePath('project-assets')); + pkg = loadPackageAtPath(getFixturePath('project-assets'), null, createStubbedFileSystem()); try { - fsx.mkdirSync(pkg.path.append('assets').path()); + nodeFileSystem.createDirAll(pkg.path.append('assets').path()); } catch { // Ignore } @@ -810,7 +805,7 @@ describe('Package', () => { pkg.artifacts.push(a, b, c, d); - await pkg.build({ addExports: true }, config); + await pkg.build({ addExports: true, addEntries: true }, config); expect(pkg.json).toEqual( expect.objectContaining({ @@ -876,7 +871,7 @@ describe('Package', () => { pkg.artifacts.push(a, b, c, d); - await pkg.build({ addExports: true }, config); + await pkg.build({ addExports: true, addEntries: true }, config); expect(pkg.json).toEqual( expect.objectContaining({ @@ -945,7 +940,7 @@ describe('Package', () => { pkg.artifacts.push(a, b, c, d); - await pkg.build({ addExports: true }, config); + await pkg.build({ addExports: true, addEntries: true }, config); expect(pkg.json).toEqual( expect.objectContaining({ @@ -995,9 +990,9 @@ describe('Package', () => { describe('cleanup()', () => { it('calls `cleanup` on each artifact', async () => { const [a, b, c] = createArtifacts(); - const aSpy = jest.spyOn(a, 'clean'); - const bSpy = jest.spyOn(b, 'clean'); - const cSpy = jest.spyOn(c, 'clean'); + const aSpy = vi.spyOn(a, 'clean'); + const bSpy = vi.spyOn(b, 'clean'); + const cSpy = vi.spyOn(c, 'clean'); pkg.artifacts.push(a, b, c); @@ -1133,9 +1128,22 @@ describe('Package', () => { describe('generateArtifacts()', () => { it('generates build artifacts for each config in a package', () => { - const pkg1 = loadPackageAtPath(getFixturePath('workspaces', 'packages/valid-array')); - const pkg2 = loadPackageAtPath(getFixturePath('workspaces', 'packages/valid-object')); - const pkg3 = loadPackageAtPath(getFixturePath('workspaces', 'packages/valid-object-private')); + const fs = createStubbedFileSystem(); + const pkg1 = loadPackageAtPath( + getFixturePath('workspaces', 'packages/valid-array'), + null, + fs, + ); + const pkg2 = loadPackageAtPath( + getFixturePath('workspaces', 'packages/valid-object'), + null, + fs, + ); + const pkg3 = loadPackageAtPath( + getFixturePath('workspaces', 'packages/valid-object-private'), + null, + fs, + ); pkg1.generateArtifacts({}); pkg2.generateArtifacts({}); @@ -1155,9 +1163,22 @@ describe('Package', () => { }); it('generates type artifacts for each config in a package', () => { - const pkg1 = loadPackageAtPath(getFixturePath('workspaces', 'packages/valid-array')); - const pkg2 = loadPackageAtPath(getFixturePath('workspaces', 'packages/valid-object')); - const pkg3 = loadPackageAtPath(getFixturePath('workspaces', 'packages/valid-object-private')); + const fs = createStubbedFileSystem(); + const pkg1 = loadPackageAtPath( + getFixturePath('workspaces', 'packages/valid-array'), + null, + fs, + ); + const pkg2 = loadPackageAtPath( + getFixturePath('workspaces', 'packages/valid-object'), + null, + fs, + ); + const pkg3 = loadPackageAtPath( + getFixturePath('workspaces', 'packages/valid-object-private'), + null, + fs, + ); pkg1.generateArtifacts({ declaration: true }); pkg2.generateArtifacts({ declaration: true }); @@ -1178,7 +1199,11 @@ describe('Package', () => { }); it('generates build artifacts for projects with multiple platforms', () => { - pkg = loadPackageAtPath(getFixturePath('project-multi-platform')); + pkg = loadPackageAtPath( + getFixturePath('project-multi-platform'), + null, + createStubbedFileSystem(), + ); pkg.generateArtifacts({}); @@ -1190,7 +1215,11 @@ describe('Package', () => { }); it('filters formats using `filterFormats`', () => { - pkg = loadPackageAtPath(getFixturePath('project-multi-platform')); + pkg = loadPackageAtPath( + getFixturePath('project-multi-platform'), + null, + createStubbedFileSystem(), + ); pkg.generateArtifacts({ filterFormats: 'esm', @@ -1201,7 +1230,11 @@ describe('Package', () => { }); it('filters platforms using `filterPlatforms`', () => { - pkg = loadPackageAtPath(getFixturePath('project-multi-platform')); + pkg = loadPackageAtPath( + getFixturePath('project-multi-platform'), + null, + createStubbedFileSystem(), + ); pkg.generateArtifacts({ filterPlatforms: 'node', @@ -1220,7 +1253,11 @@ describe('Package', () => { }; beforeEach(() => { - pkg = loadPackageAtPath(getFixturePath('workspaces-feature-flags', 'packages/common')); + pkg = loadPackageAtPath( + getFixturePath('workspaces-feature-flags', 'packages/common'), + null, + createStubbedFileSystem(), + ); // @ts-expect-error Allow override pkg.configs = []; }); @@ -1599,24 +1636,20 @@ describe('Package', () => { }); describe('syncJson()', () => { - it('writes to `package.json', async () => { - const spy = jest.spyOn(fsx, 'writeJson').mockImplementation(); + it('writes to `package.json`', () => { + const spy = vi.spyOn(pkg.fs, 'writeJson').mockImplementation(() => {}); - await pkg.syncJson(); + pkg.syncJson(); - expect(spy).toHaveBeenCalledWith( - pkg.jsonPath.path(), - { - name: 'project', - packemon: { - inputs: { - index: 'src/index.ts', - test: 'src/sub/test.ts', - }, + expect(spy).toHaveBeenCalledWith(pkg.jsonPath.path(), { + name: 'project', + packemon: { + inputs: { + index: 'src/index.ts', + test: 'src/sub/test.ts', }, }, - { spaces: 2 }, - ); + }); }); }); }); diff --git a/packages/packemon/tests/PackageValidator.test.ts b/packages/packemon/tests/PackageValidator.test.ts index d341810e3..ebe8e868b 100644 --- a/packages/packemon/tests/PackageValidator.test.ts +++ b/packages/packemon/tests/PackageValidator.test.ts @@ -1,11 +1,12 @@ import { execa } from 'execa'; -import fs from 'fs-extra'; +import { beforeEach, describe, expect, it, type MockInstance, vi } from 'vitest'; import { Path } from '@boost/common'; +import { nodeFileSystem } from '../src/FileSystem'; import { Package } from '../src/Package'; import { PackageValidator } from '../src/PackageValidator'; import { getFixturePath, mockSpy } from './helpers'; -jest.mock('execa'); +vi.mock('execa'); function createValidator(fixture: string) { const root = new Path(getFixturePath(fixture)); @@ -17,18 +18,18 @@ function createValidator(fixture: string) { description: 'Test', keywords: ['test'], packemon: {}, - ...fs.readJsonSync(root.append('package.json').path()), + ...nodeFileSystem.readJson(root.append('package.json').path()), }), ); } describe('PackageValidator', () => { let validator: PackageValidator; - let urlSpy: jest.SpyInstance; + let urlSpy: MockInstance; function createUrlSpy() { // @ts-expect-error Private - urlSpy = jest.spyOn(validator, 'doesUrlExist').mockImplementation(() => true); + urlSpy = vi.spyOn(validator, 'doesUrlExist').mockImplementation(() => true); } describe('hasErrors()', () => { @@ -198,8 +199,8 @@ describe('PackageValidator', () => { describe('lerna', () => { beforeEach(() => { // @ts-expect-error Allow override - jest.spyOn(validator, 'isLernaManaged').mockImplementation(() => true); - jest + vi.spyOn(validator, 'isLernaManaged').mockImplementation(() => true); + vi // @ts-expect-error Allow override .spyOn(validator, 'getWorkspacePackageNames') .mockImplementation(() => ['foo', 'bar', 'baz']); diff --git a/packages/packemon/tests/Packemon.test.ts b/packages/packemon/tests/Packemon.test.ts index 16fce1e6a..33fcb57e9 100644 --- a/packages/packemon/tests/Packemon.test.ts +++ b/packages/packemon/tests/Packemon.test.ts @@ -1,12 +1,13 @@ +import { beforeEach, describe, expect, it, vi } from 'vitest'; import { Path } from '@boost/common'; import { Package } from '../src/Package'; import { Packemon } from '../src/Packemon'; import { BuildOptions } from '../src/types'; import { getFixturePath, loadPackageAtPath } from './helpers'; -jest.mock('../src/PackageValidator', () => ({ +vi.mock('../src/PackageValidator', () => ({ PackageValidator: class MockValidator { - validate = jest.fn(() => this); + validate = vi.fn(() => this); }, })); @@ -31,6 +32,7 @@ describe('Packemon', () => { const options: BuildOptions = { addEngines: false, + addEntries: true, addExports: false, addFiles: false, concurrency: 1, @@ -46,7 +48,7 @@ describe('Packemon', () => { }; it('runs build on package', async () => { - const spy = jest.spyOn(pkg, 'build').mockImplementation(); + const spy = vi.spyOn(pkg, 'build').mockImplementation(() => Promise.resolve()); await packemon.build(pkg, { addEngines: true, concurrency: 3 }); @@ -54,7 +56,7 @@ describe('Packemon', () => { }); it('throws if build fails', async () => { - jest.spyOn(pkg, 'build').mockImplementation(() => { + vi.spyOn(pkg, 'build').mockImplementation(() => { throw new Error('Oops'); }); @@ -65,7 +67,7 @@ describe('Packemon', () => { it('inherits for a polyrepo', async () => { pkg = loadPackageAtPath(getFixturePath('config-files-polyrepo')); - const spy = jest.spyOn(pkg, 'build').mockImplementation(); + const spy = vi.spyOn(pkg, 'build').mockImplementation(() => Promise.resolve()); await packemon.build(pkg, { loadConfigs: true }); @@ -86,7 +88,7 @@ describe('Packemon', () => { it('inherits for a monorepo', async () => { pkg = loadPackageAtPath(getFixturePath('config-files-monorepo', 'packages/baz')); - const spy = jest.spyOn(pkg, 'build').mockImplementation(); + const spy = vi.spyOn(pkg, 'build').mockImplementation(() => Promise.resolve()); await packemon.build(pkg, { loadConfigs: true }); @@ -107,7 +109,7 @@ describe('Packemon', () => { it('doesnt inherit if `loadConfigs` is false', async () => { pkg = loadPackageAtPath(getFixturePath('config-files-polyrepo')); - const spy = jest.spyOn(pkg, 'build').mockImplementation(); + const spy = vi.spyOn(pkg, 'build').mockImplementation(() => Promise.resolve()); await packemon.build(pkg, { loadConfigs: false }); @@ -122,7 +124,7 @@ describe('Packemon', () => { }); it('runs clean on package', async () => { - const spy = jest.spyOn(pkg, 'clean').mockImplementation(); + const spy = vi.spyOn(pkg, 'clean').mockImplementation(() => Promise.resolve()); await packemon.clean(pkg); @@ -154,38 +156,37 @@ describe('Packemon', () => { }); describe('findPackage()', () => { - it('errors if no `package.json`', async () => { + it('errors if no `package.json`', () => { packemon = new Packemon(getFixturePath('workspaces', 'no-package')); - await expect(packemon.findPackage()).rejects.toThrow( + expect(() => packemon.findPackage()).toThrow( `No \`package.json\` found in ${packemon.workingDir}.`, ); }); - it('errors for invalid `packemon` config', async () => { + it('errors for invalid `packemon` config', () => { packemon = new Packemon(getFixturePath('workspaces', 'packages/invalid-config')); - await expect(packemon.findPackage()).rejects.toThrow( + expect(() => packemon.findPackage()).toThrow( 'Invalid `packemon` configuration for pkg-invalid-config, must be an object or array of objects.', ); }); - it('returns null if package is private and `skipPrivate` is true', async () => { + it('returns null if package is private and `skipPrivate` is true', () => { packemon = new Packemon(getFixturePath('workspace-private')); - await expect(packemon.findPackage({ skipPrivate: true })).resolves.toBeNull(); + expect(packemon.findPackage({ skipPrivate: true })).toBeNull(); }); - it('returns null if package does not have a `packemon` config', async () => { + it('returns null if package does not have a `packemon` config', () => { packemon = new Packemon(getFixturePath('workspaces', 'packages/no-config')); - await expect(packemon.findPackage({})).resolves.toBeNull(); + expect(packemon.findPackage({})).toBeNull(); }); - it('loads a package with a single `packemon` config', async () => { + it('loads a package with a single `packemon` config', () => { packemon = new Packemon(getFixturePath('workspaces', 'packages/valid-object')); - - pkg = (await packemon.findPackage({}))!; + pkg = packemon.findPackage({})!; expect(pkg).toBeInstanceOf(Package); expect(pkg.configs).toEqual([ @@ -203,10 +204,9 @@ describe('Packemon', () => { ]); }); - it('loads a package with multiple `packemon` configs', async () => { + it('loads a package with multiple `packemon` configs', () => { packemon = new Packemon(getFixturePath('workspaces', 'packages/valid-array')); - - pkg = (await packemon.findPackage({}))!; + pkg = packemon.findPackage({})!; expect(pkg).toBeInstanceOf(Package); expect(pkg.configs).toEqual([ diff --git a/packages/packemon/tests/__snapshots__/Package.test.ts.snap b/packages/packemon/tests/__snapshots__/Package.test.ts.snap index a87b78638..274f0e566 100644 --- a/packages/packemon/tests/__snapshots__/Package.test.ts.snap +++ b/packages/packemon/tests/__snapshots__/Package.test.ts.snap @@ -1,26 +1,26 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`Package setConfigs() errors if input name contains a slash 1`] = ` -"The following validations have failed for \`flag-common\`: - - Invalid field "inputs". Invalid key "foo/bar". String does not match. (pattern "^[a-zA-Z0-9-_]+$")" +exports[`Package > setConfigs() > errors if input name contains a slash 1`] = ` +[OptimalError: The following validations have failed for \`flag-common\`: + - Invalid field "inputs". Invalid key "foo/bar". String does not match. (pattern "^[a-zA-Z0-9-_]+$")] `; -exports[`Package setConfigs() errors if input name contains a space 1`] = ` -"The following validations have failed for \`flag-common\`: - - Invalid field "inputs". Invalid key "foo bar". String does not match. (pattern "^[a-zA-Z0-9-_]+$")" +exports[`Package > setConfigs() > errors if input name contains a space 1`] = ` +[OptimalError: The following validations have failed for \`flag-common\`: + - Invalid field "inputs". Invalid key "foo bar". String does not match. (pattern "^[a-zA-Z0-9-_]+$")] `; -exports[`Package setConfigs() errors if invalid format is provided for \`browser\` platform 1`] = ` -"The following validations have failed for \`flag-common\`: - - Invalid field "format". String must be one of: lib, esm, umd. Received "mjs"." +exports[`Package > setConfigs() > errors if invalid format is provided for \`browser\` platform 1`] = ` +[OptimalError: The following validations have failed for \`flag-common\`: + - Invalid field "format". String must be one of: lib, esm, umd. Received "mjs".] `; -exports[`Package setConfigs() errors if invalid format is provided for \`native\` platform 1`] = ` -"The following validations have failed for \`flag-common\`: - - Invalid field "format". String must be one of: lib. Received "esm"." +exports[`Package > setConfigs() > errors if invalid format is provided for \`native\` platform 1`] = ` +[OptimalError: The following validations have failed for \`flag-common\`: + - Invalid field "format". String must be one of: lib. Received "esm".] `; -exports[`Package setConfigs() errors if invalid format is provided for \`node\` platform 1`] = ` -"The following validations have failed for \`flag-common\`: - - Invalid field "format". String must be one of: lib, mjs, cjs. Received "umd"." +exports[`Package > setConfigs() > errors if invalid format is provided for \`node\` platform 1`] = ` +[OptimalError: The following validations have failed for \`flag-common\`: + - Invalid field "format". String must be one of: lib, mjs, cjs. Received "umd".] `; diff --git a/packages/packemon/tests/__snapshots__/outputs.test.ts.snap b/packages/packemon/tests/__snapshots__/outputs.test.ts.snap index da73f8efd..e284300b6 100644 --- a/packages/packemon/tests/__snapshots__/outputs.test.ts.snap +++ b/packages/packemon/tests/__snapshots__/outputs.test.ts.snap @@ -1,9 +1,7 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`Feature flags compiles 1`] = ` -[ - "lib/helpers.js", - "'use strict'; +exports[`Feature flags > compiles > lib/helpers.js 1`] = ` +"'use strict'; var _newArrowCheck = require("@babel/runtime/helpers/newArrowCheck"); var _classCallCheck = require("@babel/runtime/helpers/classCallCheck"); @@ -33,14 +31,11 @@ var Example = /*#__PURE__*/function () { }(); exports.Example = Example; //# sourceMappingURL=helpers.js.map -", -] +" `; -exports[`Feature flags compiles 2`] = ` -[ - "lib/helpers.js", - "'use strict'; +exports[`Feature flags > compiles > lib/helpers.js 2`] = ` +"'use strict'; var Example = /*#__PURE__*/function () { function Example() { @@ -66,14 +61,11 @@ var Example = /*#__PURE__*/function () { }(); exports.Example = Example; //# sourceMappingURL=helpers.js.map -", -] +" `; -exports[`Feature flags compiles 3`] = ` -[ - "lib/helpers.js", - ""use strict"; +exports[`Feature flags > compiles > lib/helpers.js 3`] = ` +""use strict"; function _array_like_to_array(arr, len) { if (len == null || len > arr.length) len = arr.length; for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i]; @@ -156,14 +148,11 @@ var Example = /*#__PURE__*/ function() { }(); exports.Example = Example; //# sourceMappingURL=helpers.js.map -", -] +" `; -exports[`Feature flags compiles 4`] = ` -[ - "lib/helpers.js", - ""use strict"; +exports[`Feature flags > compiles > lib/helpers.js 4`] = ` +""use strict"; function _array_like_to_array(arr, len) { if (len == null || len > arr.length) len = arr.length; for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i]; @@ -246,14 +235,11 @@ var Example = /*#__PURE__*/ function() { }(); exports.Example = Example; //# sourceMappingURL=helpers.js.map -", -] +" `; -exports[`Outputs (babel) artifacts builds all the artifacts with rollup 1`] = ` -[ - "cjs/server.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Outputs (babel) > artifacts > builds all the artifacts with rollup > cjs/server.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: cjs 'use strict'; @@ -271,14 +257,18 @@ https__default.default.createServer((req, res) => { res.end(); }).listen(8080); //# sourceMappingURL=server.cjs.map -", -] +" `; -exports[`Outputs (babel) artifacts builds all the artifacts with rollup 2`] = ` -[ - "esm/client.js", - "function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } +exports[`Outputs (babel) > artifacts > builds all the artifacts with rollup > cjs/server-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './server.cjs';" +`; + +exports[`Outputs (babel) > artifacts > builds all the artifacts with rollup > esm/client.js 1`] = ` +"function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } @@ -313,14 +303,1102 @@ async function createClient() { } export { createClient }; //# sourceMappingURL=client.js.map -", -] +" `; -exports[`Outputs (babel) artifacts builds all the artifacts with rollup 3`] = ` -[ - "lib/client.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Outputs (babel) > artifacts > builds all the artifacts with rollup > lib/bundle-ly9OXwfJ.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: native, Support: experimental, Format: lib + +'use strict'; + +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } +function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); } +function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } +const comma = ','.charCodeAt(0); +const semicolon = ';'.charCodeAt(0); +const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; +const intToChar = new Uint8Array(64); // 64 possible chars. +const charToInt = new Uint8Array(128); // z is 122 in ASCII +for (let i = 0; i < chars.length; i++) { + const c = chars.charCodeAt(i); + intToChar[i] = c; + charToInt[c] = i; +} +// Provide a fallback for older environments. +const td = typeof TextDecoder !== 'undefined' ? /* #__PURE__ */new TextDecoder() : typeof Buffer !== 'undefined' ? { + decode(buf) { + const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength); + return out.toString(); + } +} : { + decode(buf) { + let out = ''; + for (let i = 0; i < buf.length; i++) { + out += String.fromCharCode(buf[i]); + } + return out; + } +}; +function encode(decoded) { + const state = new Int32Array(5); + const bufLength = 1024 * 16; + const subLength = bufLength - 36; + const buf = new Uint8Array(bufLength); + const sub = buf.subarray(0, subLength); + let pos = 0; + let out = ''; + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + if (i > 0) { + if (pos === bufLength) { + out += td.decode(buf); + pos = 0; + } + buf[pos++] = semicolon; + } + if (line.length === 0) continue; + state[0] = 0; + for (let j = 0; j < line.length; j++) { + const segment = line[j]; + // We can push up to 5 ints, each int can take at most 7 chars, and we + // may push a comma. + if (pos > subLength) { + out += td.decode(sub); + buf.copyWithin(0, subLength, pos); + pos -= subLength; + } + if (j > 0) buf[pos++] = comma; + pos = encodeInteger(buf, pos, state, segment, 0); // genColumn + if (segment.length === 1) continue; + pos = encodeInteger(buf, pos, state, segment, 1); // sourcesIndex + pos = encodeInteger(buf, pos, state, segment, 2); // sourceLine + pos = encodeInteger(buf, pos, state, segment, 3); // sourceColumn + if (segment.length === 4) continue; + pos = encodeInteger(buf, pos, state, segment, 4); // namesIndex + } + } + return out + td.decode(buf.subarray(0, pos)); +} +function encodeInteger(buf, pos, state, segment, j) { + const next = segment[j]; + let num = next - state[j]; + state[j] = next; + num = num < 0 ? -num << 1 | 1 : num << 1; + do { + let clamped = num & 0b011111; + num >>>= 5; + if (num > 0) clamped |= 0b100000; + buf[pos++] = intToChar[clamped]; + } while (num > 0); + return pos; +} +class BitSet { + constructor(arg) { + this.bits = arg instanceof BitSet ? arg.bits.slice() : []; + } + add(n) { + this.bits[n >> 5] |= 1 << (n & 31); + } + has(n) { + return !!(this.bits[n >> 5] & 1 << (n & 31)); + } +} +class Chunk { + constructor(start, end, content) { + this.start = start; + this.end = end; + this.original = content; + this.intro = ''; + this.outro = ''; + this.content = content; + this.storeName = false; + this.edited = false; + { + this.previous = null; + this.next = null; + } + } + appendLeft(content) { + this.outro += content; + } + appendRight(content) { + this.intro = this.intro + content; + } + clone() { + const chunk = new Chunk(this.start, this.end, this.original); + chunk.intro = this.intro; + chunk.outro = this.outro; + chunk.content = this.content; + chunk.storeName = this.storeName; + chunk.edited = this.edited; + return chunk; + } + contains(index) { + return this.start < index && index < this.end; + } + eachNext(fn) { + let chunk = this; + while (chunk) { + fn(chunk); + chunk = chunk.next; + } + } + eachPrevious(fn) { + let chunk = this; + while (chunk) { + fn(chunk); + chunk = chunk.previous; + } + } + edit(content, storeName, contentOnly) { + this.content = content; + if (!contentOnly) { + this.intro = ''; + this.outro = ''; + } + this.storeName = storeName; + this.edited = true; + return this; + } + prependLeft(content) { + this.outro = content + this.outro; + } + prependRight(content) { + this.intro = content + this.intro; + } + reset() { + this.intro = ''; + this.outro = ''; + if (this.edited) { + this.content = this.original; + this.storeName = false; + this.edited = false; + } + } + split(index) { + const sliceIndex = index - this.start; + const originalBefore = this.original.slice(0, sliceIndex); + const originalAfter = this.original.slice(sliceIndex); + this.original = originalBefore; + const newChunk = new Chunk(index, this.end, originalAfter); + newChunk.outro = this.outro; + this.outro = ''; + this.end = index; + if (this.edited) { + // after split we should save the edit content record into the correct chunk + // to make sure sourcemap correct + // For example: + // ' test'.trim() + // split -> ' ' + 'test' + // ✔️ edit -> '' + 'test' + // ✖️ edit -> 'test' + '' + // TODO is this block necessary?... + newChunk.edit('', false); + this.content = ''; + } else { + this.content = originalBefore; + } + newChunk.next = this.next; + if (newChunk.next) newChunk.next.previous = newChunk; + newChunk.previous = this; + this.next = newChunk; + return newChunk; + } + toString() { + return this.intro + this.content + this.outro; + } + trimEnd(rx) { + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + const trimmed = this.content.replace(rx, ''); + if (trimmed.length) { + if (trimmed !== this.content) { + this.split(this.start + trimmed.length).edit('', undefined, true); + if (this.edited) { + // save the change, if it has been edited + this.edit(trimmed, this.storeName, true); + } + } + return true; + } else { + this.edit('', undefined, true); + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + } + } + trimStart(rx) { + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + const trimmed = this.content.replace(rx, ''); + if (trimmed.length) { + if (trimmed !== this.content) { + const newChunk = this.split(this.end - trimmed.length); + if (this.edited) { + // save the change, if it has been edited + newChunk.edit(trimmed, this.storeName, true); + } + this.edit('', undefined, true); + } + return true; + } else { + this.edit('', undefined, true); + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + } + } +} +function getBtoa() { + if (typeof globalThis !== 'undefined' && typeof globalThis.btoa === 'function') { + return str => globalThis.btoa(unescape(encodeURIComponent(str))); + } else if (typeof Buffer === 'function') { + return str => Buffer.from(str, 'utf-8').toString('base64'); + } else { + return () => { + throw new Error('Unsupported environment: \`window.btoa\` or \`Buffer\` should be supported.'); + }; + } +} +const btoa = /*#__PURE__*/getBtoa(); +class SourceMap { + constructor(properties) { + this.version = 3; + this.file = properties.file; + this.sources = properties.sources; + this.sourcesContent = properties.sourcesContent; + this.names = properties.names; + this.mappings = encode(properties.mappings); + if (typeof properties.x_google_ignoreList !== 'undefined') { + this.x_google_ignoreList = properties.x_google_ignoreList; + } + } + toString() { + return JSON.stringify(this); + } + toUrl() { + return 'data:application/json;charset=utf-8;base64,' + btoa(this.toString()); + } +} +function guessIndent(code) { + const lines = code.split('\\n'); + const tabbed = lines.filter(line => /^\\t+/.test(line)); + const spaced = lines.filter(line => /^ {2,}/.test(line)); + if (tabbed.length === 0 && spaced.length === 0) { + return null; + } + + // More lines tabbed than spaced? Assume tabs, and + // default to tabs in the case of a tie (or nothing + // to go on) + if (tabbed.length >= spaced.length) { + return '\\t'; + } + + // Otherwise, we need to guess the multiple + const min = spaced.reduce((previous, current) => { + const numSpaces = /^ +/.exec(current)[0].length; + return Math.min(numSpaces, previous); + }, Infinity); + return new Array(min + 1).join(' '); +} +function getRelativePath(from, to) { + const fromParts = from.split(/[/\\\\]/); + const toParts = to.split(/[/\\\\]/); + fromParts.pop(); // get dirname + + while (fromParts[0] === toParts[0]) { + fromParts.shift(); + toParts.shift(); + } + if (fromParts.length) { + let i = fromParts.length; + while (i--) fromParts[i] = '..'; + } + return fromParts.concat(toParts).join('/'); +} +const toString = Object.prototype.toString; +function isObject(thing) { + return toString.call(thing) === '[object Object]'; +} +function getLocator(source) { + const originalLines = source.split('\\n'); + const lineOffsets = []; + for (let i = 0, pos = 0; i < originalLines.length; i++) { + lineOffsets.push(pos); + pos += originalLines[i].length + 1; + } + return function locate(index) { + let i = 0; + let j = lineOffsets.length; + while (i < j) { + const m = i + j >> 1; + if (index < lineOffsets[m]) { + j = m; + } else { + i = m + 1; + } + } + const line = i - 1; + const column = index - lineOffsets[line]; + return { + line, + column + }; + }; +} +const wordRegex = /\\w/; +class Mappings { + constructor(hires) { + this.hires = hires; + this.generatedCodeLine = 0; + this.generatedCodeColumn = 0; + this.raw = []; + this.rawSegments = this.raw[this.generatedCodeLine] = []; + this.pending = null; + } + addEdit(sourceIndex, content, loc, nameIndex) { + if (content.length) { + let contentLineEnd = content.indexOf('\\n', 0); + let previousContentLineEnd = -1; + while (contentLineEnd >= 0) { + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + if (nameIndex >= 0) { + segment.push(nameIndex); + } + this.rawSegments.push(segment); + this.generatedCodeLine += 1; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + this.generatedCodeColumn = 0; + previousContentLineEnd = contentLineEnd; + contentLineEnd = content.indexOf('\\n', contentLineEnd + 1); + } + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + if (nameIndex >= 0) { + segment.push(nameIndex); + } + this.rawSegments.push(segment); + this.advance(content.slice(previousContentLineEnd + 1)); + } else if (this.pending) { + this.rawSegments.push(this.pending); + this.advance(content); + } + this.pending = null; + } + addUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) { + let originalCharIndex = chunk.start; + let first = true; + // when iterating each char, check if it's in a word boundary + let charInHiresBoundary = false; + while (originalCharIndex < chunk.end) { + if (this.hires || first || sourcemapLocations.has(originalCharIndex)) { + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + if (this.hires === 'boundary') { + // in hires "boundary", group segments per word boundary than per char + if (wordRegex.test(original[originalCharIndex])) { + // for first char in the boundary found, start the boundary by pushing a segment + if (!charInHiresBoundary) { + this.rawSegments.push(segment); + charInHiresBoundary = true; + } + } else { + // for non-word char, end the boundary by pushing a segment + this.rawSegments.push(segment); + charInHiresBoundary = false; + } + } else { + this.rawSegments.push(segment); + } + } + if (original[originalCharIndex] === '\\n') { + loc.line += 1; + loc.column = 0; + this.generatedCodeLine += 1; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + this.generatedCodeColumn = 0; + first = true; + } else { + loc.column += 1; + this.generatedCodeColumn += 1; + first = false; + } + originalCharIndex += 1; + } + this.pending = null; + } + advance(str) { + if (!str) return; + const lines = str.split('\\n'); + if (lines.length > 1) { + for (let i = 0; i < lines.length - 1; i++) { + this.generatedCodeLine++; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + } + this.generatedCodeColumn = 0; + } + this.generatedCodeColumn += lines[lines.length - 1].length; + } +} +const n = '\\n'; +const warned = { + insertLeft: false, + insertRight: false, + storeName: false +}; +class MagicString { + constructor(string, options = {}) { + const chunk = new Chunk(0, string.length, string); + Object.defineProperties(this, { + original: { + writable: true, + value: string + }, + outro: { + writable: true, + value: '' + }, + intro: { + writable: true, + value: '' + }, + firstChunk: { + writable: true, + value: chunk + }, + lastChunk: { + writable: true, + value: chunk + }, + lastSearchedChunk: { + writable: true, + value: chunk + }, + byStart: { + writable: true, + value: {} + }, + byEnd: { + writable: true, + value: {} + }, + filename: { + writable: true, + value: options.filename + }, + indentExclusionRanges: { + writable: true, + value: options.indentExclusionRanges + }, + sourcemapLocations: { + writable: true, + value: new BitSet() + }, + storedNames: { + writable: true, + value: {} + }, + indentStr: { + writable: true, + value: undefined + }, + ignoreList: { + writable: true, + value: options.ignoreList + } + }); + this.byStart[0] = chunk; + this.byEnd[string.length] = chunk; + } + addSourcemapLocation(char) { + this.sourcemapLocations.add(char); + } + append(content) { + if (typeof content !== 'string') throw new TypeError('outro content must be a string'); + this.outro += content; + return this; + } + appendLeft(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + this._split(index); + const chunk = this.byEnd[index]; + if (chunk) { + chunk.appendLeft(content); + } else { + this.intro += content; + } + return this; + } + appendRight(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + this._split(index); + const chunk = this.byStart[index]; + if (chunk) { + chunk.appendRight(content); + } else { + this.outro += content; + } + return this; + } + clone() { + const cloned = new MagicString(this.original, { + filename: this.filename + }); + let originalChunk = this.firstChunk; + let clonedChunk = cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone(); + while (originalChunk) { + cloned.byStart[clonedChunk.start] = clonedChunk; + cloned.byEnd[clonedChunk.end] = clonedChunk; + const nextOriginalChunk = originalChunk.next; + const nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone(); + if (nextClonedChunk) { + clonedChunk.next = nextClonedChunk; + nextClonedChunk.previous = clonedChunk; + clonedChunk = nextClonedChunk; + } + originalChunk = nextOriginalChunk; + } + cloned.lastChunk = clonedChunk; + if (this.indentExclusionRanges) { + cloned.indentExclusionRanges = this.indentExclusionRanges.slice(); + } + cloned.sourcemapLocations = new BitSet(this.sourcemapLocations); + cloned.intro = this.intro; + cloned.outro = this.outro; + return cloned; + } + generateDecodedMap(options) { + options = options || {}; + const sourceIndex = 0; + const names = Object.keys(this.storedNames); + const mappings = new Mappings(options.hires); + const locate = getLocator(this.original); + if (this.intro) { + mappings.advance(this.intro); + } + this.firstChunk.eachNext(chunk => { + const loc = locate(chunk.start); + if (chunk.intro.length) mappings.advance(chunk.intro); + if (chunk.edited) { + mappings.addEdit(sourceIndex, chunk.content, loc, chunk.storeName ? names.indexOf(chunk.original) : -1); + } else { + mappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations); + } + if (chunk.outro.length) mappings.advance(chunk.outro); + }); + return { + file: options.file ? options.file.split(/[/\\\\]/).pop() : undefined, + sources: [options.source ? getRelativePath(options.file || '', options.source) : options.file || ''], + sourcesContent: options.includeContent ? [this.original] : undefined, + names, + mappings: mappings.raw, + x_google_ignoreList: this.ignoreList ? [sourceIndex] : undefined + }; + } + generateMap(options) { + return new SourceMap(this.generateDecodedMap(options)); + } + _ensureindentStr() { + if (this.indentStr === undefined) { + this.indentStr = guessIndent(this.original); + } + } + _getRawIndentString() { + this._ensureindentStr(); + return this.indentStr; + } + getIndentString() { + this._ensureindentStr(); + return this.indentStr === null ? '\\t' : this.indentStr; + } + indent(indentStr, options) { + const pattern = /^[^\\r\\n]/gm; + if (isObject(indentStr)) { + options = indentStr; + indentStr = undefined; + } + if (indentStr === undefined) { + this._ensureindentStr(); + indentStr = this.indentStr || '\\t'; + } + if (indentStr === '') return this; // noop + + options = options || {}; + + // Process exclusion ranges + const isExcluded = {}; + if (options.exclude) { + const exclusions = typeof options.exclude[0] === 'number' ? [options.exclude] : options.exclude; + exclusions.forEach(exclusion => { + for (let i = exclusion[0]; i < exclusion[1]; i += 1) { + isExcluded[i] = true; + } + }); + } + let shouldIndentNextCharacter = options.indentStart !== false; + const replacer = match => { + if (shouldIndentNextCharacter) return \`\${indentStr}\${match}\`; + shouldIndentNextCharacter = true; + return match; + }; + this.intro = this.intro.replace(pattern, replacer); + let charIndex = 0; + let chunk = this.firstChunk; + while (chunk) { + const end = chunk.end; + if (chunk.edited) { + if (!isExcluded[charIndex]) { + chunk.content = chunk.content.replace(pattern, replacer); + if (chunk.content.length) { + shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === '\\n'; + } + } + } else { + charIndex = chunk.start; + while (charIndex < end) { + if (!isExcluded[charIndex]) { + const char = this.original[charIndex]; + if (char === '\\n') { + shouldIndentNextCharacter = true; + } else if (char !== '\\r' && shouldIndentNextCharacter) { + shouldIndentNextCharacter = false; + if (charIndex === chunk.start) { + chunk.prependRight(indentStr); + } else { + this._splitChunk(chunk, charIndex); + chunk = chunk.next; + chunk.prependRight(indentStr); + } + } + } + charIndex += 1; + } + } + charIndex = chunk.end; + chunk = chunk.next; + } + this.outro = this.outro.replace(pattern, replacer); + return this; + } + insert() { + throw new Error('magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)'); + } + insertLeft(index, content) { + if (!warned.insertLeft) { + console.warn('magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead'); // eslint-disable-line no-console + warned.insertLeft = true; + } + return this.appendLeft(index, content); + } + insertRight(index, content) { + if (!warned.insertRight) { + console.warn('magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead'); // eslint-disable-line no-console + warned.insertRight = true; + } + return this.prependRight(index, content); + } + move(start, end, index) { + if (index >= start && index <= end) throw new Error('Cannot move a selection inside itself'); + this._split(start); + this._split(end); + this._split(index); + const first = this.byStart[start]; + const last = this.byEnd[end]; + const oldLeft = first.previous; + const oldRight = last.next; + const newRight = this.byStart[index]; + if (!newRight && last === this.lastChunk) return this; + const newLeft = newRight ? newRight.previous : this.lastChunk; + if (oldLeft) oldLeft.next = oldRight; + if (oldRight) oldRight.previous = oldLeft; + if (newLeft) newLeft.next = first; + if (newRight) newRight.previous = last; + if (!first.previous) this.firstChunk = last.next; + if (!last.next) { + this.lastChunk = first.previous; + this.lastChunk.next = null; + } + first.previous = newLeft; + last.next = newRight || null; + if (!newLeft) this.firstChunk = first; + if (!newRight) this.lastChunk = last; + return this; + } + overwrite(start, end, content, options) { + options = options || {}; + return this.update(start, end, content, _objectSpread(_objectSpread({}, options), {}, { + overwrite: !options.contentOnly + })); + } + update(start, end, content, options) { + if (typeof content !== 'string') throw new TypeError('replacement content must be a string'); + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + if (end > this.original.length) throw new Error('end is out of bounds'); + if (start === end) throw new Error('Cannot overwrite a zero-length range – use appendLeft or prependRight instead'); + this._split(start); + this._split(end); + if (options === true) { + if (!warned.storeName) { + console.warn('The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string'); // eslint-disable-line no-console + warned.storeName = true; + } + options = { + storeName: true + }; + } + const storeName = options !== undefined ? options.storeName : false; + const overwrite = options !== undefined ? options.overwrite : false; + if (storeName) { + const original = this.original.slice(start, end); + Object.defineProperty(this.storedNames, original, { + writable: true, + value: true, + enumerable: true + }); + } + const first = this.byStart[start]; + const last = this.byEnd[end]; + if (first) { + let chunk = first; + while (chunk !== last) { + if (chunk.next !== this.byStart[chunk.end]) { + throw new Error('Cannot overwrite across a split point'); + } + chunk = chunk.next; + chunk.edit('', false); + } + first.edit(content, storeName, !overwrite); + } else { + // must be inserting at the end + const newChunk = new Chunk(start, end, '').edit(content, storeName); + + // TODO last chunk in the array may not be the last chunk, if it's moved... + last.next = newChunk; + newChunk.previous = last; + } + return this; + } + prepend(content) { + if (typeof content !== 'string') throw new TypeError('outro content must be a string'); + this.intro = content + this.intro; + return this; + } + prependLeft(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + this._split(index); + const chunk = this.byEnd[index]; + if (chunk) { + chunk.prependLeft(content); + } else { + this.intro = content + this.intro; + } + return this; + } + prependRight(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + this._split(index); + const chunk = this.byStart[index]; + if (chunk) { + chunk.prependRight(content); + } else { + this.outro = content + this.outro; + } + return this; + } + remove(start, end) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + if (start === end) return this; + if (start < 0 || end > this.original.length) throw new Error('Character is out of bounds'); + if (start > end) throw new Error('end must be greater than start'); + this._split(start); + this._split(end); + let chunk = this.byStart[start]; + while (chunk) { + chunk.intro = ''; + chunk.outro = ''; + chunk.edit(''); + chunk = end > chunk.end ? this.byStart[chunk.end] : null; + } + return this; + } + reset(start, end) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + if (start === end) return this; + if (start < 0 || end > this.original.length) throw new Error('Character is out of bounds'); + if (start > end) throw new Error('end must be greater than start'); + this._split(start); + this._split(end); + let chunk = this.byStart[start]; + while (chunk) { + chunk.reset(); + chunk = end > chunk.end ? this.byStart[chunk.end] : null; + } + return this; + } + lastChar() { + if (this.outro.length) return this.outro[this.outro.length - 1]; + let chunk = this.lastChunk; + do { + if (chunk.outro.length) return chunk.outro[chunk.outro.length - 1]; + if (chunk.content.length) return chunk.content[chunk.content.length - 1]; + if (chunk.intro.length) return chunk.intro[chunk.intro.length - 1]; + } while (chunk = chunk.previous); + if (this.intro.length) return this.intro[this.intro.length - 1]; + return ''; + } + lastLine() { + let lineIndex = this.outro.lastIndexOf(n); + if (lineIndex !== -1) return this.outro.substr(lineIndex + 1); + let lineStr = this.outro; + let chunk = this.lastChunk; + do { + if (chunk.outro.length > 0) { + lineIndex = chunk.outro.lastIndexOf(n); + if (lineIndex !== -1) return chunk.outro.substr(lineIndex + 1) + lineStr; + lineStr = chunk.outro + lineStr; + } + if (chunk.content.length > 0) { + lineIndex = chunk.content.lastIndexOf(n); + if (lineIndex !== -1) return chunk.content.substr(lineIndex + 1) + lineStr; + lineStr = chunk.content + lineStr; + } + if (chunk.intro.length > 0) { + lineIndex = chunk.intro.lastIndexOf(n); + if (lineIndex !== -1) return chunk.intro.substr(lineIndex + 1) + lineStr; + lineStr = chunk.intro + lineStr; + } + } while (chunk = chunk.previous); + lineIndex = this.intro.lastIndexOf(n); + if (lineIndex !== -1) return this.intro.substr(lineIndex + 1) + lineStr; + return this.intro + lineStr; + } + slice(start = 0, end = this.original.length) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + let result = ''; + + // find start chunk + let chunk = this.firstChunk; + while (chunk && (chunk.start > start || chunk.end <= start)) { + // found end chunk before start + if (chunk.start < end && chunk.end >= end) { + return result; + } + chunk = chunk.next; + } + if (chunk && chunk.edited && chunk.start !== start) throw new Error(\`Cannot use replaced character \${start} as slice start anchor.\`); + const startChunk = chunk; + while (chunk) { + if (chunk.intro && (startChunk !== chunk || chunk.start === start)) { + result += chunk.intro; + } + const containsEnd = chunk.start < end && chunk.end >= end; + if (containsEnd && chunk.edited && chunk.end !== end) throw new Error(\`Cannot use replaced character \${end} as slice end anchor.\`); + const sliceStart = startChunk === chunk ? start - chunk.start : 0; + const sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length; + result += chunk.content.slice(sliceStart, sliceEnd); + if (chunk.outro && (!containsEnd || chunk.end === end)) { + result += chunk.outro; + } + if (containsEnd) { + break; + } + chunk = chunk.next; + } + return result; + } + + // TODO deprecate this? not really very useful + snip(start, end) { + const clone = this.clone(); + clone.remove(0, start); + clone.remove(end, clone.original.length); + return clone; + } + _split(index) { + if (this.byStart[index] || this.byEnd[index]) return; + let chunk = this.lastSearchedChunk; + const searchForward = index > chunk.end; + while (chunk) { + if (chunk.contains(index)) return this._splitChunk(chunk, index); + chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start]; + } + } + _splitChunk(chunk, index) { + if (chunk.edited && chunk.content.length) { + // zero-length edited chunks are a special case (overlapping replacements) + const loc = getLocator(this.original)(index); + throw new Error(\`Cannot split a chunk that has already been edited (\${loc.line}:\${loc.column} – "\${chunk.original}")\`); + } + const newChunk = chunk.split(index); + this.byEnd[index] = chunk; + this.byStart[index] = newChunk; + this.byEnd[newChunk.end] = newChunk; + if (chunk === this.lastChunk) this.lastChunk = newChunk; + this.lastSearchedChunk = chunk; + return true; + } + toString() { + let str = this.intro; + let chunk = this.firstChunk; + while (chunk) { + str += chunk.toString(); + chunk = chunk.next; + } + return str + this.outro; + } + isEmpty() { + let chunk = this.firstChunk; + do { + if (chunk.intro.length && chunk.intro.trim() || chunk.content.length && chunk.content.trim() || chunk.outro.length && chunk.outro.trim()) return false; + } while (chunk = chunk.next); + return true; + } + length() { + let chunk = this.firstChunk; + let length = 0; + do { + length += chunk.intro.length + chunk.content.length + chunk.outro.length; + } while (chunk = chunk.next); + return length; + } + trimLines() { + return this.trim('[\\\\r\\\\n]'); + } + trim(charType) { + return this.trimStart(charType).trimEnd(charType); + } + trimEndAborted(charType) { + const rx = new RegExp((charType || '\\\\s') + '+$'); + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + let chunk = this.lastChunk; + do { + const end = chunk.end; + const aborted = chunk.trimEnd(rx); + + // if chunk was trimmed, we have a new lastChunk + if (chunk.end !== end) { + if (this.lastChunk === chunk) { + this.lastChunk = chunk.next; + } + this.byEnd[chunk.end] = chunk; + this.byStart[chunk.next.start] = chunk.next; + this.byEnd[chunk.next.end] = chunk.next; + } + if (aborted) return true; + chunk = chunk.previous; + } while (chunk); + return false; + } + trimEnd(charType) { + this.trimEndAborted(charType); + return this; + } + trimStartAborted(charType) { + const rx = new RegExp('^' + (charType || '\\\\s') + '+'); + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + let chunk = this.firstChunk; + do { + const end = chunk.end; + const aborted = chunk.trimStart(rx); + if (chunk.end !== end) { + // special case... + if (chunk === this.lastChunk) this.lastChunk = chunk.next; + this.byEnd[chunk.end] = chunk; + this.byStart[chunk.next.start] = chunk.next; + this.byEnd[chunk.next.end] = chunk.next; + } + if (aborted) return true; + chunk = chunk.next; + } while (chunk); + return false; + } + trimStart(charType) { + this.trimStartAborted(charType); + return this; + } + hasChanged() { + return this.original !== this.toString(); + } + _replaceRegexp(searchValue, replacement) { + function getReplacement(match, str) { + if (typeof replacement === 'string') { + return replacement.replace(/\\$(\\$|&|\\d+)/g, (_, i) => { + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_string_as_a_parameter + if (i === '$') return '$'; + if (i === '&') return match[0]; + const num = +i; + if (num < match.length) return match[+i]; + return \`$\${i}\`; + }); + } else { + return replacement(...match, match.index, str, match.groups); + } + } + function matchAll(re, str) { + let match; + const matches = []; + while (match = re.exec(str)) { + matches.push(match); + } + return matches; + } + if (searchValue.global) { + const matches = matchAll(searchValue, this.original); + matches.forEach(match => { + if (match.index != null) this.overwrite(match.index, match.index + match[0].length, getReplacement(match, this.original)); + }); + } else { + const match = this.original.match(searchValue); + if (match && match.index != null) this.overwrite(match.index, match.index + match[0].length, getReplacement(match, this.original)); + } + return this; + } + _replaceString(string, replacement) { + const original = this.original; + const index = original.indexOf(string); + if (index !== -1) { + this.overwrite(index, index + string.length, replacement); + } + return this; + } + replace(searchValue, replacement) { + if (typeof searchValue === 'string') { + return this._replaceString(searchValue, replacement); + } + return this._replaceRegexp(searchValue, replacement); + } + _replaceAllString(string, replacement) { + const original = this.original; + const stringLength = string.length; + for (let index = original.indexOf(string); index !== -1; index = original.indexOf(string, index + stringLength)) { + this.overwrite(index, index + stringLength, replacement); + } + return this; + } + replaceAll(searchValue, replacement) { + if (typeof searchValue === 'string') { + return this._replaceAllString(searchValue, replacement); + } + if (!searchValue.global) { + throw new TypeError('MagicString.prototype.replaceAll called with a non-global RegExp argument'); + } + return this._replaceRegexp(searchValue, replacement); + } +} +exports.SourceMap = SourceMap; +exports.default = MagicString; +//# sourceMappingURL=bundle-ly9OXwfJ.js.map +" +`; + +exports[`Outputs (babel) > artifacts > builds all the artifacts with rollup > lib/client.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: lib 'use strict'; @@ -358,14 +1436,11 @@ async function createClient() { } exports.createClient = createClient; //# sourceMappingURL=client.js.map -", -] +" `; -exports[`Outputs (babel) artifacts builds all the artifacts with rollup 4`] = ` -[ - "lib/index.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Outputs (babel) > artifacts > builds all the artifacts with rollup > lib/index.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: lib 'use strict'; @@ -373,62 +1448,7331 @@ exports[`Outputs (babel) artifacts builds all the artifacts with rollup 4`] = ` const EXAMPLE = 'foo'; exports.EXAMPLE = EXAMPLE; //# sourceMappingURL=index.js.map -", -] +" `; -exports[`Outputs (babel) artifacts builds all the artifacts with rollup 5`] = ` -[ - "lib/test.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Outputs (babel) > artifacts > builds all the artifacts with rollup > lib/test.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: experimental, Format: lib - -'use strict'; - -class Spy { - called = false; - mock = () => {}; - method() {} -} -function spy() { - const inst = new Spy(); - return jest.fn(inst.mock); -} -async function wait() {} -exports.spy = spy; -exports.wait = wait; +'use strict';const _excluded=["maxLength"],_excluded2=["value"];function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key];}}return target;}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i=0)continue;target[key]=source[key];}return target;}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);icollector.add(key);Object.getOwnPropertyNames(obj).forEach(collect);Object.getOwnPropertySymbols(obj).forEach(collect);}function getOwnProperties(obj){const ownProps=/* @__PURE__ */new Set();if(isFinalObj(obj))return[];collectOwnProperties(obj,ownProps);return Array.from(ownProps);}const defaultCloneOptions={forceWritable:false};function deepClone(val,options=defaultCloneOptions){const seen=/* @__PURE__ */new WeakMap();return clone(val,seen,options);}function clone(val,seen,options=defaultCloneOptions){let k,out;if(seen.has(val))return seen.get(val);if(Array.isArray(val)){out=Array(k=val.length);seen.set(val,out);while(k--)out[k]=clone(val[k],seen,options);return out;}if(Object.prototype.toString.call(val)==="[object Object]"){out=Object.create(Object.getPrototypeOf(val));seen.set(val,out);const props=getOwnProperties(val);for(const k2 of props){const descriptor=Object.getOwnPropertyDescriptor(val,k2);if(!descriptor)continue;const cloned=clone(val[k2],seen,options);if("get"in descriptor){Object.defineProperty(out,k2,_objectSpread(_objectSpread({},descriptor),{},{get(){return cloned;}}));}else{Object.defineProperty(out,k2,_objectSpread(_objectSpread({},descriptor),{},{writable:options.forceWritable?true:descriptor.writable,value:cloned}));}}return out;}return val;}function objectAttr(source,path,defaultValue=void 0){const paths=path.replace(/\\[(\\d+)\\]/g,".$1").split(".");let result=source;for(const p of paths){result=Object(result)[p];if(result===void 0)return defaultValue;}return result;}function createDefer(){let resolve=null;let reject=null;const p=new Promise((_resolve,_reject)=>{resolve=_resolve;reject=_reject;});p.resolve=resolve;p.reject=reject;return p;}var commonjsGlobal$1=typeof globalThis!=='undefined'?globalThis:typeof window!=='undefined'?window:typeof global!=='undefined'?global:typeof self!=='undefined'?self:{};function getDefaultExportFromCjs$2(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,'default')?x['default']:x;}function getAugmentedNamespace(n){if(n.__esModule)return n;var f=n.default;if(typeof f=="function"){var a=function a(){if(this instanceof a){return Reflect.construct(f,arguments,this.constructor);}return f.apply(this,arguments);};a.prototype=f.prototype;}else a={};Object.defineProperty(a,'__esModule',{value:true});Object.keys(n).forEach(function(k){var d=Object.getOwnPropertyDescriptor(n,k);Object.defineProperty(a,k,d.get?d:{enumerable:true,get:function(){return n[k];}});});return a;}var build$1={};var ansiStyles={exports:{}};ansiStyles.exports;(function(module){const ANSI_BACKGROUND_OFFSET=10;const wrapAnsi256=(offset=0)=>code=>\`\\u001B[\${38+offset};5;\${code}m\`;const wrapAnsi16m=(offset=0)=>(red,green,blue)=>\`\\u001B[\${38+offset};2;\${red};\${green};\${blue}m\`;function assembleStyles(){const codes=new Map();const styles={modifier:{reset:[0,0],// 21 isn't widely supported and 22 does the same thing +bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],// Bright color +blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],// Bright color +bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};// Alias bright black as gray (and grey) +styles.color.gray=styles.color.blackBright;styles.bgColor.bgGray=styles.bgColor.bgBlackBright;styles.color.grey=styles.color.blackBright;styles.bgColor.bgGrey=styles.bgColor.bgBlackBright;for(const _ref of Object.entries(styles)){var _ref2=_slicedToArray(_ref,2);const groupName=_ref2[0];const group=_ref2[1];for(const _ref3 of Object.entries(group)){var _ref4=_slicedToArray(_ref3,2);const styleName=_ref4[0];const style=_ref4[1];styles[styleName]={open:\`\\u001B[\${style[0]}m\`,close:\`\\u001B[\${style[1]}m\`};group[styleName]=styles[styleName];codes.set(style[0],style[1]);}Object.defineProperty(styles,groupName,{value:group,enumerable:false});}Object.defineProperty(styles,'codes',{value:codes,enumerable:false});styles.color.close='\\u001B[39m';styles.bgColor.close='\\u001B[49m';styles.color.ansi256=wrapAnsi256();styles.color.ansi16m=wrapAnsi16m();styles.bgColor.ansi256=wrapAnsi256(ANSI_BACKGROUND_OFFSET);styles.bgColor.ansi16m=wrapAnsi16m(ANSI_BACKGROUND_OFFSET);// From https://github.com/Qix-/color-convert/blob/3f0e0d4e92e235796ccb17f6e85c72094a651f49/conversions.js +Object.defineProperties(styles,{rgbToAnsi256:{value:(red,green,blue)=>{// We use the extended greyscale palette here, with the exception of +// black and white. normal palette only has 4 greyscale shades. +if(red===green&&green===blue){if(red<8){return 16;}if(red>248){return 231;}return Math.round((red-8)/247*24)+232;}return 16+36*Math.round(red/255*5)+6*Math.round(green/255*5)+Math.round(blue/255*5);},enumerable:false},hexToRgb:{value:hex=>{const matches=/(?[a-f\\d]{6}|[a-f\\d]{3})/i.exec(hex.toString(16));if(!matches){return[0,0,0];}let colorString=matches.groups.colorString;if(colorString.length===3){colorString=colorString.split('').map(character=>character+character).join('');}const integer=Number.parseInt(colorString,16);return[integer>>16&0xFF,integer>>8&0xFF,integer&0xFF];},enumerable:false},hexToAnsi256:{value:hex=>styles.rgbToAnsi256(...styles.hexToRgb(hex)),enumerable:false}});return styles;}// Make the export immutable +Object.defineProperty(module,'exports',{enumerable:true,get:assembleStyles});})(ansiStyles);var ansiStylesExports=ansiStyles.exports;var collections={};Object.defineProperty(collections,'__esModule',{value:true});collections.printIteratorEntries=printIteratorEntries;collections.printIteratorValues=printIteratorValues;collections.printListItems=printListItems;collections.printObjectProperties=printObjectProperties;/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */const getKeysOfEnumerableProperties=(object,compareKeys)=>{const rawKeys=Object.keys(object);const keys=compareKeys!==null?rawKeys.sort(compareKeys):rawKeys;if(Object.getOwnPropertySymbols){Object.getOwnPropertySymbols(object).forEach(symbol=>{if(Object.getOwnPropertyDescriptor(object,symbol).enumerable){keys.push(symbol);}});}return keys;};/** + * Return entries (for example, of a map) + * with spacing, indentation, and comma + * without surrounding punctuation (for example, braces) + */function printIteratorEntries(iterator,config,indentation,depth,refs,printer,// Too bad, so sad that separator for ECMAScript Map has been ' => ' +// What a distracting diff if you change a data structure to/from +// ECMAScript Object or Immutable.Map/OrderedMap which use the default. +separator=': '){let result='';let width=0;let current=iterator.next();if(!current.done){result+=config.spacingOuter;const indentationNext=indentation+config.indent;while(!current.done){result+=indentationNext;if(width++===config.maxWidth){result+='…';break;}const name=printer(current.value[0],config,indentationNext,depth,refs);const value=printer(current.value[1],config,indentationNext,depth,refs);result+=name+separator+value;current=iterator.next();if(!current.done){result+=\`,\${config.spacingInner}\`;}else if(!config.min){result+=',';}}result+=config.spacingOuter+indentation;}return result;}/** + * Return values (for example, of a set) + * with spacing, indentation, and comma + * without surrounding punctuation (braces or brackets) + */function printIteratorValues(iterator,config,indentation,depth,refs,printer){let result='';let width=0;let current=iterator.next();if(!current.done){result+=config.spacingOuter;const indentationNext=indentation+config.indent;while(!current.done){result+=indentationNext;if(width++===config.maxWidth){result+='…';break;}result+=printer(current.value,config,indentationNext,depth,refs);current=iterator.next();if(!current.done){result+=\`,\${config.spacingInner}\`;}else if(!config.min){result+=',';}}result+=config.spacingOuter+indentation;}return result;}/** + * Return items (for example, of an array) + * with spacing, indentation, and comma + * without surrounding punctuation (for example, brackets) + **/function printListItems(list,config,indentation,depth,refs,printer){let result='';if(list.length){result+=config.spacingOuter;const indentationNext=indentation+config.indent;for(let i=0;i{const stringedValue=val.toString();if(stringedValue==='ArrayContaining'||stringedValue==='ArrayNotContaining'){if(++depth>config.maxDepth){return\`[\${stringedValue}]\`;}return\`\${stringedValue+SPACE$2}[\${(0,_collections$3.printListItems)(val.sample,config,indentation,depth,refs,printer)}]\`;}if(stringedValue==='ObjectContaining'||stringedValue==='ObjectNotContaining'){if(++depth>config.maxDepth){return\`[\${stringedValue}]\`;}return\`\${stringedValue+SPACE$2}{\${(0,_collections$3.printObjectProperties)(val.sample,config,indentation,depth,refs,printer)}}\`;}if(stringedValue==='StringMatching'||stringedValue==='StringNotMatching'){return stringedValue+SPACE$2+printer(val.sample,config,indentation,depth,refs);}if(stringedValue==='StringContaining'||stringedValue==='StringNotContaining'){return stringedValue+SPACE$2+printer(val.sample,config,indentation,depth,refs);}if(typeof val.toAsymmetricMatcher!=='function'){throw new Error(\`Asymmetric matcher \${val.constructor.name} does not implement toAsymmetricMatcher()\`);}return val.toAsymmetricMatcher();};AsymmetricMatcher$4.serialize=serialize$7;const test$7=val=>val&&val.$$typeof===asymmetricMatcher;AsymmetricMatcher$4.test=test$7;const plugin$6={serialize:serialize$7,test:test$7};var _default$7=plugin$6;AsymmetricMatcher$4.default=_default$7;var DOMCollection$3={};Object.defineProperty(DOMCollection$3,'__esModule',{value:true});DOMCollection$3.test=DOMCollection$3.serialize=DOMCollection$3.default=void 0;var _collections$2=collections;/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */const SPACE$1=' ';const OBJECT_NAMES=['DOMStringMap','NamedNodeMap'];const ARRAY_REGEXP=/^(HTML\\w*Collection|NodeList)$/;const testName=name=>OBJECT_NAMES.indexOf(name)!==-1||ARRAY_REGEXP.test(name);const test$6=val=>val&&val.constructor&&!!val.constructor.name&&testName(val.constructor.name);DOMCollection$3.test=test$6;const isNamedNodeMap=collection=>collection.constructor.name==='NamedNodeMap';const serialize$6=(collection,config,indentation,depth,refs,printer)=>{const name=collection.constructor.name;if(++depth>config.maxDepth){return\`[\${name}]\`;}return(config.min?'':name+SPACE$1)+(OBJECT_NAMES.indexOf(name)!==-1?\`{\${(0,_collections$2.printObjectProperties)(isNamedNodeMap(collection)?Array.from(collection).reduce((props,attribute)=>{props[attribute.name]=attribute.value;return props;},{}):_objectSpread({},collection),config,indentation,depth,refs,printer)}}\`:\`[\${(0,_collections$2.printListItems)(Array.from(collection),config,indentation,depth,refs,printer)}]\`);};DOMCollection$3.serialize=serialize$6;const plugin$5={serialize:serialize$6,test:test$6};var _default$6=plugin$5;DOMCollection$3.default=_default$6;var DOMElement$3={};var markup={};var escapeHTML$1={};Object.defineProperty(escapeHTML$1,'__esModule',{value:true});escapeHTML$1.default=escapeHTML;/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */function escapeHTML(str){return str.replace(//g,'>');}Object.defineProperty(markup,'__esModule',{value:true});markup.printText=markup.printProps=markup.printElementAsLeaf=markup.printElement=markup.printComment=markup.printChildren=void 0;var _escapeHTML=_interopRequireDefault$1(escapeHTML$1);function _interopRequireDefault$1(obj){return obj&&obj.__esModule?obj:{default:obj};}/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ // Return empty string if keys is empty. +const printProps=(keys,props,config,indentation,depth,refs,printer)=>{const indentationNext=indentation+config.indent;const colors=config.colors;return keys.map(key=>{const value=props[key];let printed=printer(value,config,indentationNext,depth,refs);if(typeof value!=='string'){if(printed.indexOf('\\n')!==-1){printed=config.spacingOuter+indentationNext+printed+config.spacingOuter+indentation;}printed=\`{\${printed}}\`;}return\`\${config.spacingInner+indentation+colors.prop.open+key+colors.prop.close}=\${colors.value.open}\${printed}\${colors.value.close}\`;}).join('');};// Return empty string if children is empty. +markup.printProps=printProps;const printChildren=(children,config,indentation,depth,refs,printer)=>children.map(child=>config.spacingOuter+indentation+(typeof child==='string'?printText(child,config):printer(child,config,indentation,depth,refs))).join('');markup.printChildren=printChildren;const printText=(text,config)=>{const contentColor=config.colors.content;return contentColor.open+(0,_escapeHTML.default)(text)+contentColor.close;};markup.printText=printText;const printComment=(comment,config)=>{const commentColor=config.colors.comment;return\`\${commentColor.open}\${commentColor.close}\`;};// Separate the functions to format props, children, and element, +// so a plugin could override a particular function, if needed. +// Too bad, so sad: the traditional (but unnecessary) space +// in a self-closing tagColor requires a second test of printedProps. +markup.printComment=printComment;const printElement=(type,printedProps,printedChildren,config,indentation)=>{const tagColor=config.colors.tag;return\`\${tagColor.open}<\${type}\${printedProps&&tagColor.close+printedProps+config.spacingOuter+indentation+tagColor.open}\${printedChildren?\`>\${tagColor.close}\${printedChildren}\${config.spacingOuter}\${indentation}\${tagColor.open}\${tagColor.close}\`;};markup.printElement=printElement;const printElementAsLeaf=(type,config)=>{const tagColor=config.colors.tag;return\`\${tagColor.open}<\${type}\${tagColor.close} …\${tagColor.open} />\${tagColor.close}\`;};markup.printElementAsLeaf=printElementAsLeaf;Object.defineProperty(DOMElement$3,'__esModule',{value:true});DOMElement$3.test=DOMElement$3.serialize=DOMElement$3.default=void 0;var _markup$2=markup;/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */const ELEMENT_NODE=1;const TEXT_NODE=3;const COMMENT_NODE=8;const FRAGMENT_NODE=11;const ELEMENT_REGEXP=/^((HTML|SVG)\\w*)?Element$/;const testHasAttribute=val=>{try{return typeof val.hasAttribute==='function'&&val.hasAttribute('is');}catch{return false;}};const testNode=val=>{const constructorName=val.constructor.name;const nodeType=val.nodeType,tagName=val.tagName;const isCustomElement=typeof tagName==='string'&&tagName.includes('-')||testHasAttribute(val);return nodeType===ELEMENT_NODE&&(ELEMENT_REGEXP.test(constructorName)||isCustomElement)||nodeType===TEXT_NODE&&constructorName==='Text'||nodeType===COMMENT_NODE&&constructorName==='Comment'||nodeType===FRAGMENT_NODE&&constructorName==='DocumentFragment';};const test$5=val=>val?.constructor?.name&&testNode(val);DOMElement$3.test=test$5;function nodeIsText(node){return node.nodeType===TEXT_NODE;}function nodeIsComment(node){return node.nodeType===COMMENT_NODE;}function nodeIsFragment(node){return node.nodeType===FRAGMENT_NODE;}const serialize$5=(node,config,indentation,depth,refs,printer)=>{if(nodeIsText(node)){return(0,_markup$2.printText)(node.data,config);}if(nodeIsComment(node)){return(0,_markup$2.printComment)(node.data,config);}const type=nodeIsFragment(node)?'DocumentFragment':node.tagName.toLowerCase();if(++depth>config.maxDepth){return(0,_markup$2.printElementAsLeaf)(type,config);}return(0,_markup$2.printElement)(type,(0,_markup$2.printProps)(nodeIsFragment(node)?[]:Array.from(node.attributes,attr=>attr.name).sort(),nodeIsFragment(node)?{}:Array.from(node.attributes).reduce((props,attribute)=>{props[attribute.name]=attribute.value;return props;},{}),config,indentation+config.indent,depth,refs,printer),(0,_markup$2.printChildren)(Array.prototype.slice.call(node.childNodes||node.children),config,indentation+config.indent,depth,refs,printer),config,indentation);};DOMElement$3.serialize=serialize$5;const plugin$4={serialize:serialize$5,test:test$5};var _default$5=plugin$4;DOMElement$3.default=_default$5;var Immutable$3={};Object.defineProperty(Immutable$3,'__esModule',{value:true});Immutable$3.test=Immutable$3.serialize=Immutable$3.default=void 0;var _collections$1=collections;/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ // SENTINEL constants are from https://github.com/facebook/immutable-js +const IS_ITERABLE_SENTINEL='@@__IMMUTABLE_ITERABLE__@@';const IS_LIST_SENTINEL='@@__IMMUTABLE_LIST__@@';const IS_KEYED_SENTINEL$1='@@__IMMUTABLE_KEYED__@@';const IS_MAP_SENTINEL='@@__IMMUTABLE_MAP__@@';const IS_ORDERED_SENTINEL$1='@@__IMMUTABLE_ORDERED__@@';const IS_RECORD_SENTINEL='@@__IMMUTABLE_RECORD__@@';// immutable v4 +const IS_SEQ_SENTINEL='@@__IMMUTABLE_SEQ__@@';const IS_SET_SENTINEL$1='@@__IMMUTABLE_SET__@@';const IS_STACK_SENTINEL='@@__IMMUTABLE_STACK__@@';const getImmutableName=name=>\`Immutable.\${name}\`;const printAsLeaf=name=>\`[\${name}]\`;const SPACE=' ';const LAZY='…';// Seq is lazy if it calls a method like filter +const printImmutableEntries=(val,config,indentation,depth,refs,printer,type)=>++depth>config.maxDepth?printAsLeaf(getImmutableName(type)):\`\${getImmutableName(type)+SPACE}{\${(0,_collections$1.printIteratorEntries)(val.entries(),config,indentation,depth,refs,printer)}}\`;// Record has an entries method because it is a collection in immutable v3. +// Return an iterator for Immutable Record from version v3 or v4. +function getRecordEntries(val){let i=0;return{next(){if(i{// _name property is defined only for an Immutable Record instance +// which was constructed with a second optional descriptive name arg +const name=getImmutableName(val._name||'Record');return++depth>config.maxDepth?printAsLeaf(name):\`\${name+SPACE}{\${(0,_collections$1.printIteratorEntries)(getRecordEntries(val),config,indentation,depth,refs,printer)}}\`;};const printImmutableSeq=(val,config,indentation,depth,refs,printer)=>{const name=getImmutableName('Seq');if(++depth>config.maxDepth){return printAsLeaf(name);}if(val[IS_KEYED_SENTINEL$1]){return\`\${name+SPACE}{\${// from Immutable collection of entries or from ECMAScript object +val._iter||val._object?(0,_collections$1.printIteratorEntries)(val.entries(),config,indentation,depth,refs,printer):LAZY}}\`;}return\`\${name+SPACE}[\${val._iter||// from Immutable collection of values +val._array||// from ECMAScript array +val._collection||// from ECMAScript collection in immutable v4 +val._iterable// from ECMAScript collection in immutable v3 +?(0,_collections$1.printIteratorValues)(val.values(),config,indentation,depth,refs,printer):LAZY}]\`;};const printImmutableValues=(val,config,indentation,depth,refs,printer,type)=>++depth>config.maxDepth?printAsLeaf(getImmutableName(type)):\`\${getImmutableName(type)+SPACE}[\${(0,_collections$1.printIteratorValues)(val.values(),config,indentation,depth,refs,printer)}]\`;const serialize$4=(val,config,indentation,depth,refs,printer)=>{if(val[IS_MAP_SENTINEL]){return printImmutableEntries(val,config,indentation,depth,refs,printer,val[IS_ORDERED_SENTINEL$1]?'OrderedMap':'Map');}if(val[IS_LIST_SENTINEL]){return printImmutableValues(val,config,indentation,depth,refs,printer,'List');}if(val[IS_SET_SENTINEL$1]){return printImmutableValues(val,config,indentation,depth,refs,printer,val[IS_ORDERED_SENTINEL$1]?'OrderedSet':'Set');}if(val[IS_STACK_SENTINEL]){return printImmutableValues(val,config,indentation,depth,refs,printer,'Stack');}if(val[IS_SEQ_SENTINEL]){return printImmutableSeq(val,config,indentation,depth,refs,printer);}// For compatibility with immutable v3 and v4, let record be the default. +return printImmutableRecord(val,config,indentation,depth,refs,printer);};// Explicitly comparing sentinel properties to true avoids false positive +// when mock identity-obj-proxy returns the key as the value for any key. +Immutable$3.serialize=serialize$4;const test$4=val=>val&&(val[IS_ITERABLE_SENTINEL]===true||val[IS_RECORD_SENTINEL]===true);Immutable$3.test=test$4;const plugin$3={serialize:serialize$4,test:test$4};var _default$4=plugin$3;Immutable$3.default=_default$4;var ReactElement$3={};var reactIs={exports:{}};var reactIs_production_min={};/** + * @license React + * react-is.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var hasRequiredReactIs_production_min;function requireReactIs_production_min(){if(hasRequiredReactIs_production_min)return reactIs_production_min;hasRequiredReactIs_production_min=1;var b=Symbol.for("react.element"),c=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),e=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),g=Symbol.for("react.provider"),h=Symbol.for("react.context"),k=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),n=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),t=Symbol.for("react.offscreen"),u;u=Symbol.for("react.module.reference");function v(a){if("object"===typeof a&&null!==a){var r=a.$$typeof;switch(r){case b:switch(a=a.type,a){case d:case f:case e:case m:case n:return a;default:switch(a=a&&a.$$typeof,a){case k:case h:case l:case q:case p:case g:return a;default:return r;}}case c:return r;}}}reactIs_production_min.ContextConsumer=h;reactIs_production_min.ContextProvider=g;reactIs_production_min.Element=b;reactIs_production_min.ForwardRef=l;reactIs_production_min.Fragment=d;reactIs_production_min.Lazy=q;reactIs_production_min.Memo=p;reactIs_production_min.Portal=c;reactIs_production_min.Profiler=f;reactIs_production_min.StrictMode=e;reactIs_production_min.Suspense=m;reactIs_production_min.SuspenseList=n;reactIs_production_min.isAsyncMode=function(){return!1;};reactIs_production_min.isConcurrentMode=function(){return!1;};reactIs_production_min.isContextConsumer=function(a){return v(a)===h;};reactIs_production_min.isContextProvider=function(a){return v(a)===g;};reactIs_production_min.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===b;};reactIs_production_min.isForwardRef=function(a){return v(a)===l;};reactIs_production_min.isFragment=function(a){return v(a)===d;};reactIs_production_min.isLazy=function(a){return v(a)===q;};reactIs_production_min.isMemo=function(a){return v(a)===p;};reactIs_production_min.isPortal=function(a){return v(a)===c;};reactIs_production_min.isProfiler=function(a){return v(a)===f;};reactIs_production_min.isStrictMode=function(a){return v(a)===e;};reactIs_production_min.isSuspense=function(a){return v(a)===m;};reactIs_production_min.isSuspenseList=function(a){return v(a)===n;};reactIs_production_min.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===d||a===f||a===e||a===m||a===n||a===t||"object"===typeof a&&null!==a&&(a.$$typeof===q||a.$$typeof===p||a.$$typeof===g||a.$$typeof===h||a.$$typeof===l||a.$$typeof===u||void 0!==a.getModuleId)?!0:!1;};reactIs_production_min.typeOf=v;return reactIs_production_min;}var reactIs_development={};/** + * @license React + * react-is.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var hasRequiredReactIs_development;function requireReactIs_development(){if(hasRequiredReactIs_development)return reactIs_development;hasRequiredReactIs_development=1;if(process.env.NODE_ENV!=="production"){(function(){// ----------------------------------------------------------------------------- +var enableScopeAPI=false;// Experimental Create Event Handle API. +var enableCacheElement=false;var enableTransitionTracing=false;// No known bugs, but needs performance testing +var enableLegacyHidden=false;// Enables unstable_avoidThisFallback feature in Fiber +// stuff. Intended to enable React core members to more easily debug scheduling +// issues in DEV builds. +var enableDebugTracing=false;// Track which Fiber(s) schedule render work. +// ATTENTION +var REACT_ELEMENT_TYPE=Symbol.for('react.element');var REACT_PORTAL_TYPE=Symbol.for('react.portal');var REACT_FRAGMENT_TYPE=Symbol.for('react.fragment');var REACT_STRICT_MODE_TYPE=Symbol.for('react.strict_mode');var REACT_PROFILER_TYPE=Symbol.for('react.profiler');var REACT_PROVIDER_TYPE=Symbol.for('react.provider');var REACT_CONTEXT_TYPE=Symbol.for('react.context');var REACT_SERVER_CONTEXT_TYPE=Symbol.for('react.server_context');var REACT_FORWARD_REF_TYPE=Symbol.for('react.forward_ref');var REACT_SUSPENSE_TYPE=Symbol.for('react.suspense');var REACT_SUSPENSE_LIST_TYPE=Symbol.for('react.suspense_list');var REACT_MEMO_TYPE=Symbol.for('react.memo');var REACT_LAZY_TYPE=Symbol.for('react.lazy');var REACT_OFFSCREEN_TYPE=Symbol.for('react.offscreen');var REACT_MODULE_REFERENCE;{REACT_MODULE_REFERENCE=Symbol.for('react.module.reference');}function isValidElementType(type){if(typeof type==='string'||typeof type==='function'){return true;}// Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill). +if(type===REACT_FRAGMENT_TYPE||type===REACT_PROFILER_TYPE||enableDebugTracing||type===REACT_STRICT_MODE_TYPE||type===REACT_SUSPENSE_TYPE||type===REACT_SUSPENSE_LIST_TYPE||enableLegacyHidden||type===REACT_OFFSCREEN_TYPE||enableScopeAPI||enableCacheElement||enableTransitionTracing){return true;}if(typeof type==='object'&&type!==null){if(type.$$typeof===REACT_LAZY_TYPE||type.$$typeof===REACT_MEMO_TYPE||type.$$typeof===REACT_PROVIDER_TYPE||type.$$typeof===REACT_CONTEXT_TYPE||type.$$typeof===REACT_FORWARD_REF_TYPE||// This needs to include all possible module reference object +// types supported by any Flight configuration anywhere since +// we don't know which Flight build this will end up being used +// with. +type.$$typeof===REACT_MODULE_REFERENCE||type.getModuleId!==undefined){return true;}}return false;}function typeOf(object){if(typeof object==='object'&&object!==null){var $$typeof=object.$$typeof;switch($$typeof){case REACT_ELEMENT_TYPE:var type=object.type;switch(type){case REACT_FRAGMENT_TYPE:case REACT_PROFILER_TYPE:case REACT_STRICT_MODE_TYPE:case REACT_SUSPENSE_TYPE:case REACT_SUSPENSE_LIST_TYPE:return type;default:var $$typeofType=type&&type.$$typeof;switch($$typeofType){case REACT_SERVER_CONTEXT_TYPE:case REACT_CONTEXT_TYPE:case REACT_FORWARD_REF_TYPE:case REACT_LAZY_TYPE:case REACT_MEMO_TYPE:case REACT_PROVIDER_TYPE:return $$typeofType;default:return $$typeof;}}case REACT_PORTAL_TYPE:return $$typeof;}}return undefined;}var ContextConsumer=REACT_CONTEXT_TYPE;var ContextProvider=REACT_PROVIDER_TYPE;var Element=REACT_ELEMENT_TYPE;var ForwardRef=REACT_FORWARD_REF_TYPE;var Fragment=REACT_FRAGMENT_TYPE;var Lazy=REACT_LAZY_TYPE;var Memo=REACT_MEMO_TYPE;var Portal=REACT_PORTAL_TYPE;var Profiler=REACT_PROFILER_TYPE;var StrictMode=REACT_STRICT_MODE_TYPE;var Suspense=REACT_SUSPENSE_TYPE;var SuspenseList=REACT_SUSPENSE_LIST_TYPE;var hasWarnedAboutDeprecatedIsAsyncMode=false;var hasWarnedAboutDeprecatedIsConcurrentMode=false;// AsyncMode should be deprecated +function isAsyncMode(object){{if(!hasWarnedAboutDeprecatedIsAsyncMode){hasWarnedAboutDeprecatedIsAsyncMode=true;// Using console['warn'] to evade Babel and ESLint +console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, '+'and will be removed in React 18+.');}}return false;}function isConcurrentMode(object){{if(!hasWarnedAboutDeprecatedIsConcurrentMode){hasWarnedAboutDeprecatedIsConcurrentMode=true;// Using console['warn'] to evade Babel and ESLint +console['warn']('The ReactIs.isConcurrentMode() alias has been deprecated, '+'and will be removed in React 18+.');}}return false;}function isContextConsumer(object){return typeOf(object)===REACT_CONTEXT_TYPE;}function isContextProvider(object){return typeOf(object)===REACT_PROVIDER_TYPE;}function isElement(object){return typeof object==='object'&&object!==null&&object.$$typeof===REACT_ELEMENT_TYPE;}function isForwardRef(object){return typeOf(object)===REACT_FORWARD_REF_TYPE;}function isFragment(object){return typeOf(object)===REACT_FRAGMENT_TYPE;}function isLazy(object){return typeOf(object)===REACT_LAZY_TYPE;}function isMemo(object){return typeOf(object)===REACT_MEMO_TYPE;}function isPortal(object){return typeOf(object)===REACT_PORTAL_TYPE;}function isProfiler(object){return typeOf(object)===REACT_PROFILER_TYPE;}function isStrictMode(object){return typeOf(object)===REACT_STRICT_MODE_TYPE;}function isSuspense(object){return typeOf(object)===REACT_SUSPENSE_TYPE;}function isSuspenseList(object){return typeOf(object)===REACT_SUSPENSE_LIST_TYPE;}reactIs_development.ContextConsumer=ContextConsumer;reactIs_development.ContextProvider=ContextProvider;reactIs_development.Element=Element;reactIs_development.ForwardRef=ForwardRef;reactIs_development.Fragment=Fragment;reactIs_development.Lazy=Lazy;reactIs_development.Memo=Memo;reactIs_development.Portal=Portal;reactIs_development.Profiler=Profiler;reactIs_development.StrictMode=StrictMode;reactIs_development.Suspense=Suspense;reactIs_development.SuspenseList=SuspenseList;reactIs_development.isAsyncMode=isAsyncMode;reactIs_development.isConcurrentMode=isConcurrentMode;reactIs_development.isContextConsumer=isContextConsumer;reactIs_development.isContextProvider=isContextProvider;reactIs_development.isElement=isElement;reactIs_development.isForwardRef=isForwardRef;reactIs_development.isFragment=isFragment;reactIs_development.isLazy=isLazy;reactIs_development.isMemo=isMemo;reactIs_development.isPortal=isPortal;reactIs_development.isProfiler=isProfiler;reactIs_development.isStrictMode=isStrictMode;reactIs_development.isSuspense=isSuspense;reactIs_development.isSuspenseList=isSuspenseList;reactIs_development.isValidElementType=isValidElementType;reactIs_development.typeOf=typeOf;})();}return reactIs_development;}if(process.env.NODE_ENV==='production'){reactIs.exports=requireReactIs_production_min();}else{reactIs.exports=requireReactIs_development();}var reactIsExports=reactIs.exports;Object.defineProperty(ReactElement$3,'__esModule',{value:true});ReactElement$3.test=ReactElement$3.serialize=ReactElement$3.default=void 0;var ReactIs=_interopRequireWildcard(reactIsExports);var _markup$1=markup;function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=='function')return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=='object'&&typeof obj!=='function'){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=='default'&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ // Given element.props.children, or subtree during recursive traversal, +// return flattened array of children. +const getChildren=(arg,children=[])=>{if(Array.isArray(arg)){arg.forEach(item=>{getChildren(item,children);});}else if(arg!=null&&arg!==false){children.push(arg);}return children;};const getType$1=element=>{const type=element.type;if(typeof type==='string'){return type;}if(typeof type==='function'){return type.displayName||type.name||'Unknown';}if(ReactIs.isFragment(element)){return'React.Fragment';}if(ReactIs.isSuspense(element)){return'React.Suspense';}if(typeof type==='object'&&type!==null){if(ReactIs.isContextProvider(element)){return'Context.Provider';}if(ReactIs.isContextConsumer(element)){return'Context.Consumer';}if(ReactIs.isForwardRef(element)){if(type.displayName){return type.displayName;}const functionName=type.render.displayName||type.render.name||'';return functionName!==''?\`ForwardRef(\${functionName})\`:'ForwardRef';}if(ReactIs.isMemo(element)){const functionName=type.displayName||type.type.displayName||type.type.name||'';return functionName!==''?\`Memo(\${functionName})\`:'Memo';}}return'UNDEFINED';};const getPropKeys$1=element=>{const props=element.props;return Object.keys(props).filter(key=>key!=='children'&&props[key]!==undefined).sort();};const serialize$3=(element,config,indentation,depth,refs,printer)=>++depth>config.maxDepth?(0,_markup$1.printElementAsLeaf)(getType$1(element),config):(0,_markup$1.printElement)(getType$1(element),(0,_markup$1.printProps)(getPropKeys$1(element),element.props,config,indentation+config.indent,depth,refs,printer),(0,_markup$1.printChildren)(getChildren(element.props.children),config,indentation+config.indent,depth,refs,printer),config,indentation);ReactElement$3.serialize=serialize$3;const test$3=val=>val!=null&&ReactIs.isElement(val);ReactElement$3.test=test$3;const plugin$2={serialize:serialize$3,test:test$3};var _default$3=plugin$2;ReactElement$3.default=_default$3;var ReactTestComponent$3={};Object.defineProperty(ReactTestComponent$3,'__esModule',{value:true});ReactTestComponent$3.test=ReactTestComponent$3.serialize=ReactTestComponent$3.default=void 0;var _markup=markup;var Symbol$1=globalThis['jest-symbol-do-not-touch']||globalThis.Symbol;/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ // Child can be \`number\` in Stack renderer but not in Fiber renderer. +const testSymbol=typeof Symbol$1==='function'&&Symbol$1.for?Symbol$1.for('react.test.json'):0xea71357;const getPropKeys=object=>{const props=object.props;return props?Object.keys(props).filter(key=>props[key]!==undefined).sort():[];};const serialize$2=(object,config,indentation,depth,refs,printer)=>++depth>config.maxDepth?(0,_markup.printElementAsLeaf)(object.type,config):(0,_markup.printElement)(object.type,object.props?(0,_markup.printProps)(getPropKeys(object),object.props,config,indentation+config.indent,depth,refs,printer):'',object.children?(0,_markup.printChildren)(object.children,config,indentation+config.indent,depth,refs,printer):'',config,indentation);ReactTestComponent$3.serialize=serialize$2;const test$2=val=>val&&val.$$typeof===testSymbol;ReactTestComponent$3.test=test$2;const plugin$1={serialize:serialize$2,test:test$2};var _default$2=plugin$1;ReactTestComponent$3.default=_default$2;Object.defineProperty(build$1,'__esModule',{value:true});build$1.default=build$1.DEFAULT_OPTIONS=void 0;var format_1=build$1.format=format$1;var plugins_1=build$1.plugins=void 0;var _ansiStyles=_interopRequireDefault(ansiStylesExports);var _collections=collections;var _AsymmetricMatcher=_interopRequireDefault(AsymmetricMatcher$4);var _DOMCollection=_interopRequireDefault(DOMCollection$3);var _DOMElement=_interopRequireDefault(DOMElement$3);var _Immutable=_interopRequireDefault(Immutable$3);var _ReactElement=_interopRequireDefault(ReactElement$3);var _ReactTestComponent=_interopRequireDefault(ReactTestComponent$3);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ /* eslint-disable local/ban-types-eventually */const toString$2=Object.prototype.toString;const toISOString=Date.prototype.toISOString;const errorToString=Error.prototype.toString;const regExpToString=RegExp.prototype.toString;/** + * Explicitly comparing typeof constructor to function avoids undefined as name + * when mock identity-obj-proxy returns the key as the value for any key. + */const getConstructorName$1=val=>typeof val.constructor==='function'&&val.constructor.name||'Object';/* global window */ /** Is val is equal to global window object? Works even if it does not exist :) */const isWindow=val=>typeof window!=='undefined'&&val===window;const SYMBOL_REGEXP=/^Symbol\\((.*)\\)(.*)$/;const NEWLINE_REGEXP=/\\n/gi;class PrettyFormatPluginError extends Error{constructor(message,stack){super(message);this.stack=stack;this.name=this.constructor.name;}}function isToStringedArrayType(toStringed){return toStringed==='[object Array]'||toStringed==='[object ArrayBuffer]'||toStringed==='[object DataView]'||toStringed==='[object Float32Array]'||toStringed==='[object Float64Array]'||toStringed==='[object Int8Array]'||toStringed==='[object Int16Array]'||toStringed==='[object Int32Array]'||toStringed==='[object Uint8Array]'||toStringed==='[object Uint8ClampedArray]'||toStringed==='[object Uint16Array]'||toStringed==='[object Uint32Array]';}function printNumber(val){return Object.is(val,-0)?'-0':String(val);}function printBigInt(val){return String(\`\${val}n\`);}function printFunction(val,printFunctionName){if(!printFunctionName){return'[Function]';}return\`[Function \${val.name||'anonymous'}]\`;}function printSymbol(val){return String(val).replace(SYMBOL_REGEXP,'Symbol($1)');}function printError(val){return\`[\${errorToString.call(val)}]\`;}/** + * The first port of call for printing an object, handles most of the + * data-types in JS. + */function printBasicValue(val,printFunctionName,escapeRegex,escapeString){if(val===true||val===false){return\`\${val}\`;}if(val===undefined){return'undefined';}if(val===null){return'null';}const typeOf=typeof val;if(typeOf==='number'){return printNumber(val);}if(typeOf==='bigint'){return printBigInt(val);}if(typeOf==='string'){if(escapeString){return\`"\${val.replace(/"|\\\\/g,'\\\\$&')}"\`;}return\`"\${val}"\`;}if(typeOf==='function'){return printFunction(val,printFunctionName);}if(typeOf==='symbol'){return printSymbol(val);}const toStringed=toString$2.call(val);if(toStringed==='[object WeakMap]'){return'WeakMap {}';}if(toStringed==='[object WeakSet]'){return'WeakSet {}';}if(toStringed==='[object Function]'||toStringed==='[object GeneratorFunction]'){return printFunction(val,printFunctionName);}if(toStringed==='[object Symbol]'){return printSymbol(val);}if(toStringed==='[object Date]'){return isNaN(+val)?'Date { NaN }':toISOString.call(val);}if(toStringed==='[object Error]'){return printError(val);}if(toStringed==='[object RegExp]'){if(escapeRegex){// https://github.com/benjamingr/RegExp.escape/blob/main/polyfill.js +return regExpToString.call(val).replace(/[\\\\^$*+?.()|[\\]{}]/g,'\\\\$&');}return regExpToString.call(val);}if(val instanceof Error){return printError(val);}return null;}/** + * Handles more complex objects ( such as objects with circular references. + * maps and sets etc ) + */function printComplexValue(val,config,indentation,depth,refs,hasCalledToJSON){if(refs.indexOf(val)!==-1){return'[Circular]';}refs=refs.slice();refs.push(val);const hitMaxDepth=++depth>config.maxDepth;const min=config.min;if(config.callToJSON&&!hitMaxDepth&&val.toJSON&&typeof val.toJSON==='function'&&!hasCalledToJSON){return printer(val.toJSON(),config,indentation,depth,refs,true);}const toStringed=toString$2.call(val);if(toStringed==='[object Arguments]'){return hitMaxDepth?'[Arguments]':\`\${min?'':'Arguments '}[\${(0,_collections.printListItems)(val,config,indentation,depth,refs,printer)}]\`;}if(isToStringedArrayType(toStringed)){return hitMaxDepth?\`[\${val.constructor.name}]\`:\`\${min?'':!config.printBasicPrototype&&val.constructor.name==='Array'?'':\`\${val.constructor.name} \`}[\${(0,_collections.printListItems)(val,config,indentation,depth,refs,printer)}]\`;}if(toStringed==='[object Map]'){return hitMaxDepth?'[Map]':\`Map {\${(0,_collections.printIteratorEntries)(val.entries(),config,indentation,depth,refs,printer,' => ')}}\`;}if(toStringed==='[object Set]'){return hitMaxDepth?'[Set]':\`Set {\${(0,_collections.printIteratorValues)(val.values(),config,indentation,depth,refs,printer)}}\`;}// Avoid failure to serialize global window object in jsdom test environment. +// For example, not even relevant if window is prop of React element. +return hitMaxDepth||isWindow(val)?\`[\${getConstructorName$1(val)}]\`:\`\${min?'':!config.printBasicPrototype&&getConstructorName$1(val)==='Object'?'':\`\${getConstructorName$1(val)} \`}{\${(0,_collections.printObjectProperties)(val,config,indentation,depth,refs,printer)}}\`;}function isNewPlugin(plugin){return plugin.serialize!=null;}function printPlugin(plugin,val,config,indentation,depth,refs){let printed;try{printed=isNewPlugin(plugin)?plugin.serialize(val,config,indentation,depth,refs,printer):plugin.print(val,valChild=>printer(valChild,config,indentation,depth,refs),str=>{const indentationNext=indentation+config.indent;return indentationNext+str.replace(NEWLINE_REGEXP,\`\\n\${indentationNext}\`);},{edgeSpacing:config.spacingOuter,min:config.min,spacing:config.spacingInner},config.colors);}catch(error){throw new PrettyFormatPluginError(error.message,error.stack);}if(typeof printed!=='string'){throw new Error(\`pretty-format: Plugin must return type "string" but instead returned "\${typeof printed}".\`);}return printed;}function findPlugin(plugins,val){for(let p=0;poptions;const DEFAULT_OPTIONS=toOptionsSubtype({callToJSON:true,compareKeys:undefined,escapeRegex:false,escapeString:true,highlight:false,indent:2,maxDepth:Infinity,maxWidth:Infinity,min:false,plugins:[],printBasicPrototype:true,printFunctionName:true,theme:DEFAULT_THEME});build$1.DEFAULT_OPTIONS=DEFAULT_OPTIONS;function validateOptions(options){Object.keys(options).forEach(key=>{if(!Object.prototype.hasOwnProperty.call(DEFAULT_OPTIONS,key)){throw new Error(\`pretty-format: Unknown option "\${key}".\`);}});if(options.min&&options.indent!==undefined&&options.indent!==0){throw new Error('pretty-format: Options "min" and "indent" cannot be used together.');}if(options.theme!==undefined){if(options.theme===null){throw new Error('pretty-format: Option "theme" must not be null.');}if(typeof options.theme!=='object'){throw new Error(\`pretty-format: Option "theme" must be of type "object" but instead received "\${typeof options.theme}".\`);}}}const getColorsHighlight=options=>DEFAULT_THEME_KEYS.reduce((colors,key)=>{const value=options.theme&&options.theme[key]!==undefined?options.theme[key]:DEFAULT_THEME[key];const color=value&&_ansiStyles.default[value];if(color&&typeof color.close==='string'&&typeof color.open==='string'){colors[key]=color;}else{throw new Error(\`pretty-format: Option "theme" has a key "\${key}" whose value "\${value}" is undefined in ansi-styles.\`);}return colors;},Object.create(null));const getColorsEmpty=()=>DEFAULT_THEME_KEYS.reduce((colors,key)=>{colors[key]={close:'',open:''};return colors;},Object.create(null));const getPrintFunctionName=options=>options?.printFunctionName??DEFAULT_OPTIONS.printFunctionName;const getEscapeRegex=options=>options?.escapeRegex??DEFAULT_OPTIONS.escapeRegex;const getEscapeString=options=>options?.escapeString??DEFAULT_OPTIONS.escapeString;const getConfig=options=>({callToJSON:options?.callToJSON??DEFAULT_OPTIONS.callToJSON,colors:options?.highlight?getColorsHighlight(options):getColorsEmpty(),compareKeys:typeof options?.compareKeys==='function'||options?.compareKeys===null?options.compareKeys:DEFAULT_OPTIONS.compareKeys,escapeRegex:getEscapeRegex(options),escapeString:getEscapeString(options),indent:options?.min?'':createIndent(options?.indent??DEFAULT_OPTIONS.indent),maxDepth:options?.maxDepth??DEFAULT_OPTIONS.maxDepth,maxWidth:options?.maxWidth??DEFAULT_OPTIONS.maxWidth,min:options?.min??DEFAULT_OPTIONS.min,plugins:options?.plugins??DEFAULT_OPTIONS.plugins,printBasicPrototype:options?.printBasicPrototype??true,printFunctionName:getPrintFunctionName(options),spacingInner:options?.min?' ':'\\n',spacingOuter:options?.min?'':'\\n'});function createIndent(indent){return new Array(indent+1).join(' ');}/** + * Returns a presentation string of your \`val\` object + * @param val any potential JavaScript object + * @param options Custom settings + */function format$1(val,options){if(options){validateOptions(options);if(options.plugins){const plugin=findPlugin(options.plugins,val);if(plugin!==null){return printPlugin(plugin,val,getConfig(options),'',0,[]);}}}const basicResult=printBasicValue(val,getPrintFunctionName(options),getEscapeRegex(options),getEscapeString(options));if(basicResult!==null){return basicResult;}return printComplexValue(val,getConfig(options),'',0,[]);}const plugins={AsymmetricMatcher:_AsymmetricMatcher.default,DOMCollection:_DOMCollection.default,DOMElement:_DOMElement.default,Immutable:_Immutable.default,ReactElement:_ReactElement.default,ReactTestComponent:_ReactTestComponent.default};plugins_1=build$1.plugins=plugins;var _default$1=format$1;build$1.default=_default$1;const ansiColors={bold:['1','22'],dim:['2','22'],italic:['3','23'],underline:['4','24'],// 5 & 6 are blinking +inverse:['7','27'],hidden:['8','28'],strike:['9','29'],// 10-20 are fonts +// 21-29 are resets for 1-9 +black:['30','39'],red:['31','39'],green:['32','39'],yellow:['33','39'],blue:['34','39'],magenta:['35','39'],cyan:['36','39'],white:['37','39'],brightblack:['30;1','39'],brightred:['31;1','39'],brightgreen:['32;1','39'],brightyellow:['33;1','39'],brightblue:['34;1','39'],brightmagenta:['35;1','39'],brightcyan:['36;1','39'],brightwhite:['37;1','39'],grey:['90','39']};const styles={special:'cyan',number:'yellow',bigint:'yellow',boolean:'yellow',undefined:'grey',null:'bold',string:'green',symbol:'green',date:'magenta',regexp:'red'};const truncator='…';function colorise(value,styleType){const color=ansiColors[styles[styleType]]||ansiColors[styleType];if(!color){return String(value);}return\`\\u001b[\${color[0]}m\${String(value)}\\u001b[\${color[1]}m\`;}function normaliseOptions({showHidden=false,depth=2,colors=false,customInspect=true,showProxy=false,maxArrayLength=Infinity,breakLength=Infinity,seen=[],// eslint-disable-next-line no-shadow +truncate=Infinity,stylize=String}={}){const options={showHidden:Boolean(showHidden),depth:Number(depth),colors:Boolean(colors),customInspect:Boolean(customInspect),showProxy:Boolean(showProxy),maxArrayLength:Number(maxArrayLength),breakLength:Number(breakLength),truncate:Number(truncate),seen,stylize};if(options.colors){options.stylize=colorise;}return options;}function truncate(string,length,tail=truncator){string=String(string);const tailLength=tail.length;const stringLength=string.length;if(tailLength>length&&stringLength>tailLength){return tail;}if(stringLength>length&&stringLength>tailLength){return\`\${string.slice(0,length-tailLength)}\${tail}\`;}return string;}// eslint-disable-next-line complexity +function inspectList(list,options,inspectItem,separator=', '){inspectItem=inspectItem||options.inspect;const size=list.length;if(size===0)return'';const originalLength=options.truncate;let output='';let peek='';let truncated='';for(let i=0;ioriginalLength&&output.length+truncated.length<=originalLength){break;}// If this isn't the last or second to last element to scan, +// but the string is already over length then break here +if(!last&&!secondToLast&&truncatedLength>originalLength){break;}// Peek at the next string to determine if we should +// break early before adding this item to the output +peek=last?'':inspectItem(list[i+1],options)+(secondToLast?'':separator);// If we have one element left, but this element and +// the next takes over length, the break early +if(!last&&secondToLast&&truncatedLength>originalLength&&nextLength+peek.length>originalLength){break;}output+=string;// If the next element takes us to length - +// but there are more after that, then we should truncate now +if(!last&&!secondToLast&&nextLength+peek.length>=originalLength){truncated=\`\${truncator}(\${list.length-i-1})\`;break;}truncated='';}return\`\${output}\${truncated}\`;}function quoteComplexKey(key){if(key.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/)){return key;}return JSON.stringify(key).replace(/'/g,"\\\\'").replace(/\\\\"/g,'"').replace(/(^"|"$)/g,"'");}function inspectProperty([key,value],options){options.truncate-=2;if(typeof key==='string'){key=quoteComplexKey(key);}else if(typeof key!=='number'){key=\`[\${options.inspect(key,options)}]\`;}options.truncate-=key.length;value=options.inspect(value,options);return\`\${key}: \${value}\`;}function inspectArray(array,options){// Object.keys will always output the Array indices first, so we can slice by +// \`array.length\` to get non-index properties +const nonIndexProperties=Object.keys(array).slice(array.length);if(!array.length&&!nonIndexProperties.length)return'[]';options.truncate-=4;const listContents=inspectList(array,options);options.truncate-=listContents.length;let propertyContents='';if(nonIndexProperties.length){propertyContents=inspectList(nonIndexProperties.map(key=>[key,array[key]]),options,inspectProperty);}return\`[ \${listContents}\${propertyContents?\`, \${propertyContents}\`:''} ]\`;}/* ! + * Chai - getFuncName utility + * Copyright(c) 2012-2016 Jake Luer + * MIT Licensed + */ /** + * ### .getFuncName(constructorFn) + * + * Returns the name of a function. + * When a non-function instance is passed, returns \`null\`. + * This also includes a polyfill function if \`aFunc.name\` is not defined. + * + * @name getFuncName + * @param {Function} funct + * @namespace Utils + * @api public + */var toString$1=Function.prototype.toString;var functionNameMatch=/\\s*function(?:\\s|\\s*\\/\\*[^(?:*\\/)]+\\*\\/\\s*)*([^\\s\\(\\/]+)/;var maxFunctionSourceLength=512;function getFuncName(aFunc){if(typeof aFunc!=='function'){return null;}var name='';if(typeof Function.prototype.name==='undefined'&&typeof aFunc.name==='undefined'){// eslint-disable-next-line prefer-reflect +var functionSource=toString$1.call(aFunc);// To avoid unconstrained resource consumption due to pathalogically large function names, +// we limit the available return value to be less than 512 characters. +if(functionSource.indexOf('(')>maxFunctionSourceLength){return name;}// Here we run a polyfill if Function does not support the \`name\` property and if aFunc.name is not defined +var match=functionSource.match(functionNameMatch);if(match){name=match[1];}}else{// If we've got a \`name\` property we just use it +name=aFunc.name;}return name;}var getFuncName_1=getFuncName;const getFuncName$1=/*@__PURE__*/getDefaultExportFromCjs$2(getFuncName_1);const getArrayName=array=>{// We need to special case Node.js' Buffers, which report to be Uint8Array +if(typeof Buffer==='function'&&array instanceof Buffer){return'Buffer';}if(array[Symbol.toStringTag]){return array[Symbol.toStringTag];}return getFuncName$1(array.constructor);};function inspectTypedArray(array,options){const name=getArrayName(array);options.truncate-=name.length+4;// Object.keys will always output the Array indices first, so we can slice by +// \`array.length\` to get non-index properties +const nonIndexProperties=Object.keys(array).slice(array.length);if(!array.length&&!nonIndexProperties.length)return\`\${name}[]\`;// As we know TypedArrays only contain Unsigned Integers, we can skip inspecting each one and simply +// stylise the toString() value of them +let output='';for(let i=0;i[key,array[key]]),options,inspectProperty);}return\`\${name}[ \${output}\${propertyContents?\`, \${propertyContents}\`:''} ]\`;}function inspectDate(dateObject,options){const stringRepresentation=dateObject.toJSON();if(stringRepresentation===null){return'Invalid Date';}const split=stringRepresentation.split('T');const date=split[0];// If we need to - truncate the time portion, but never the date +return options.stylize(\`\${date}T\${truncate(split[1],options.truncate-date.length-1)}\`,'date');}function inspectFunction(func,options){const name=getFuncName$1(func);if(!name){return options.stylize('[Function]','special');}return options.stylize(\`[Function \${truncate(name,options.truncate-11)}]\`,'special');}function inspectMapEntry([key,value],options){options.truncate-=4;key=options.inspect(key,options);options.truncate-=key.length;value=options.inspect(value,options);return\`\${key} => \${value}\`;}// IE11 doesn't support \`map.entries()\` +function mapToEntries(map){const entries=[];map.forEach((value,key)=>{entries.push([key,value]);});return entries;}function inspectMap(map,options){const size=map.size-1;if(size<=0){return'Map{}';}options.truncate-=7;return\`Map{ \${inspectList(mapToEntries(map),options,inspectMapEntry)} }\`;}const isNaN$2=Number.isNaN||(i=>i!==i);// eslint-disable-line no-self-compare +function inspectNumber(number,options){if(isNaN$2(number)){return options.stylize('NaN','number');}if(number===Infinity){return options.stylize('Infinity','number');}if(number===-Infinity){return options.stylize('-Infinity','number');}if(number===0){return options.stylize(1/number===Infinity?'+0':'-0','number');}return options.stylize(truncate(number,options.truncate),'number');}function inspectBigInt(number,options){let nums=truncate(number.toString(),options.truncate-1);if(nums!==truncator)nums+='n';return options.stylize(nums,'bigint');}function inspectRegExp(value,options){const flags=value.toString().split('/')[2];const sourceLength=options.truncate-(2+flags.length);const source=value.source;return options.stylize(\`/\${truncate(source,sourceLength)}/\${flags}\`,'regexp');}// IE11 doesn't support \`Array.from(set)\` +function arrayFromSet(set){const values=[];set.forEach(value=>{values.push(value);});return values;}function inspectSet(set,options){if(set.size===0)return'Set{}';options.truncate-=7;return\`Set{ \${inspectList(arrayFromSet(set),options)} }\`;}const stringEscapeChars=new RegExp("['\\\\u0000-\\\\u001f\\\\u007f-\\\\u009f\\\\u00ad\\\\u0600-\\\\u0604\\\\u070f\\\\u17b4\\\\u17b5"+'\\\\u200c-\\\\u200f\\\\u2028-\\\\u202f\\\\u2060-\\\\u206f\\\\ufeff\\\\ufff0-\\\\uffff]','g');const escapeCharacters={'\\b':'\\\\b','\\t':'\\\\t','\\n':'\\\\n','\\f':'\\\\f','\\r':'\\\\r',"'":"\\\\'",'\\\\':'\\\\\\\\'};const hex=16;const unicodeLength=4;function escape(char){return escapeCharacters[char]||\`\\\\u\${\`0000\${char.charCodeAt(0).toString(hex)}\`.slice(-unicodeLength)}\`;}function inspectString(string,options){if(stringEscapeChars.test(string)){string=string.replace(stringEscapeChars,escape);}return options.stylize(\`'\${truncate(string,options.truncate-2)}'\`,'string');}function inspectSymbol(value){if('description'in Symbol.prototype){return value.description?\`Symbol(\${value.description})\`:'Symbol()';}return value.toString();}let getPromiseValue$1=()=>'Promise{…}';try{const _process$binding=process.binding('util'),getPromiseDetails=_process$binding.getPromiseDetails,kPending=_process$binding.kPending,kRejected=_process$binding.kRejected;if(Array.isArray(getPromiseDetails(Promise.resolve()))){getPromiseValue$1=(value,options)=>{const _getPromiseDetails=getPromiseDetails(value),_getPromiseDetails2=_slicedToArray(_getPromiseDetails,2),state=_getPromiseDetails2[0],innerValue=_getPromiseDetails2[1];if(state===kPending){return'Promise{}';}return\`Promise\${state===kRejected?'!':''}{\${options.inspect(innerValue,options)}}\`;};}}catch(notNode){/* ignore */}const inspectPromise=getPromiseValue$1;function inspectObject$1(object,options){const properties=Object.getOwnPropertyNames(object);const symbols=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(object):[];if(properties.length===0&&symbols.length===0){return'{}';}options.truncate-=4;options.seen=options.seen||[];if(options.seen.indexOf(object)>=0){return'[Circular]';}options.seen.push(object);const propertyContents=inspectList(properties.map(key=>[key,object[key]]),options,inspectProperty);const symbolContents=inspectList(symbols.map(key=>[key,object[key]]),options,inspectProperty);options.seen.pop();let sep='';if(propertyContents&&symbolContents){sep=', ';}return\`{ \${propertyContents}\${sep}\${symbolContents} }\`;}const toStringTag=typeof Symbol!=='undefined'&&Symbol.toStringTag?Symbol.toStringTag:false;function inspectClass(value,options){let name='';if(toStringTag&&toStringTag in value){name=value[toStringTag];}name=name||getFuncName$1(value.constructor);// Babel transforms anonymous classes to the name \`_class\` +if(!name||name==='_class'){name='';}options.truncate-=name.length;return\`\${name}\${inspectObject$1(value,options)}\`;}function inspectArguments(args,options){if(args.length===0)return'Arguments[]';options.truncate-=13;return\`Arguments[ \${inspectList(args,options)} ]\`;}const errorKeys=['stack','line','column','name','message','fileName','lineNumber','columnNumber','number','description'];function inspectObject(error,options){const properties=Object.getOwnPropertyNames(error).filter(key=>errorKeys.indexOf(key)===-1);const name=error.name;options.truncate-=name.length;let message='';if(typeof error.message==='string'){message=truncate(error.message,options.truncate);}else{properties.unshift('message');}message=message?\`: \${message}\`:'';options.truncate-=message.length+5;const propertyContents=inspectList(properties.map(key=>[key,error[key]]),options,inspectProperty);return\`\${name}\${message}\${propertyContents?\` { \${propertyContents} }\`:''}\`;}function inspectAttribute([key,value],options){options.truncate-=3;if(!value){return\`\${options.stylize(key,'yellow')}\`;}return\`\${options.stylize(key,'yellow')}=\${options.stylize(\`"\${value}"\`,'string')}\`;}function inspectHTMLCollection(collection,options){// eslint-disable-next-line no-use-before-define +return inspectList(collection,options,inspectHTML,'\\n');}function inspectHTML(element,options){const properties=element.getAttributeNames();const name=element.tagName.toLowerCase();const head=options.stylize(\`<\${name}\`,'special');const headClose=options.stylize(\`>\`,'special');const tail=options.stylize(\`\`,'special');options.truncate-=name.length*2+5;let propertyContents='';if(properties.length>0){propertyContents+=' ';propertyContents+=inspectList(properties.map(key=>[key,element.getAttribute(key)]),options,inspectAttribute,' ');}options.truncate-=propertyContents.length;const truncate=options.truncate;let children=inspectHTMLCollection(element.children,options);if(children&&children.length>truncate){children=\`\${truncator}(\${element.children.length})\`;}return\`\${head}\${propertyContents}\${headClose}\${children}\${tail}\`;}/* ! + * loupe + * Copyright(c) 2013 Jake Luer + * MIT Licensed + */const symbolsSupported=typeof Symbol==='function'&&typeof Symbol.for==='function';const chaiInspect=symbolsSupported?Symbol.for('chai/inspect'):'@@chai/inspect';let nodeInspect$1=false;try{// eslint-disable-next-line global-require +const nodeUtil=require('util');nodeInspect$1=nodeUtil.inspect?nodeUtil.inspect.custom:false;}catch(noNodeInspect){nodeInspect$1=false;}function FakeMap$1(){// eslint-disable-next-line prefer-template +this.key='chai/loupe__'+Math.random()+Date.now();}FakeMap$1.prototype={// eslint-disable-next-line object-shorthand +get:function get(key){return key[this.key];},// eslint-disable-next-line object-shorthand +has:function has(key){return this.key in key;},// eslint-disable-next-line object-shorthand +set:function set(key,value){if(Object.isExtensible(key)){Object.defineProperty(key,this.key,{// eslint-disable-next-line object-shorthand +value:value,configurable:true});}}};const constructorMap=new(typeof WeakMap==='function'?WeakMap:FakeMap$1)();const stringTagMap={};const baseTypesMap={undefined:(value,options)=>options.stylize('undefined','undefined'),null:(value,options)=>options.stylize(null,'null'),boolean:(value,options)=>options.stylize(value,'boolean'),Boolean:(value,options)=>options.stylize(value,'boolean'),number:inspectNumber,Number:inspectNumber,bigint:inspectBigInt,BigInt:inspectBigInt,string:inspectString,String:inspectString,function:inspectFunction,Function:inspectFunction,symbol:inspectSymbol,// A Symbol polyfill will return \`Symbol\` not \`symbol\` from typedetect +Symbol:inspectSymbol,Array:inspectArray,Date:inspectDate,Map:inspectMap,Set:inspectSet,RegExp:inspectRegExp,Promise:inspectPromise,// WeakSet, WeakMap are totally opaque to us +WeakSet:(value,options)=>options.stylize('WeakSet{…}','special'),WeakMap:(value,options)=>options.stylize('WeakMap{…}','special'),Arguments:inspectArguments,Int8Array:inspectTypedArray,Uint8Array:inspectTypedArray,Uint8ClampedArray:inspectTypedArray,Int16Array:inspectTypedArray,Uint16Array:inspectTypedArray,Int32Array:inspectTypedArray,Uint32Array:inspectTypedArray,Float32Array:inspectTypedArray,Float64Array:inspectTypedArray,Generator:()=>'',DataView:()=>'',ArrayBuffer:()=>'',Error:inspectObject,HTMLCollection:inspectHTMLCollection,NodeList:inspectHTMLCollection};// eslint-disable-next-line complexity +const inspectCustom=(value,options,type)=>{if(chaiInspect in value&&typeof value[chaiInspect]==='function'){return value[chaiInspect](options);}if(nodeInspect$1&&nodeInspect$1 in value&&typeof value[nodeInspect$1]==='function'){return value[nodeInspect$1](options.depth,options);}if('inspect'in value&&typeof value.inspect==='function'){return value.inspect(options.depth,options);}if('constructor'in value&&constructorMap.has(value.constructor)){return constructorMap.get(value.constructor)(value,options);}if(stringTagMap[type]){return stringTagMap[type](value,options);}return'';};const toString=Object.prototype.toString;// eslint-disable-next-line complexity +function inspect$4(value,options){options=normaliseOptions(options);options.inspect=inspect$4;const _options2=options,customInspect=_options2.customInspect;let type=value===null?'null':typeof value;if(type==='object'){type=toString.call(value).slice(8,-1);}// If it is a base value that we already support, then use Loupe's inspector +if(baseTypesMap[type]){return baseTypesMap[type](value,options);}// If \`options.customInspect\` is set to true then try to use the custom inspector +if(customInspect&&value){const output=inspectCustom(value,options,type);if(output){if(typeof output==='string')return output;return inspect$4(output,options);}}const proto=value?Object.getPrototypeOf(value):false;// If it's a plain Object then use Loupe's inspector +if(proto===Object.prototype||proto===null){return inspectObject$1(value,options);}// Specifically account for HTMLElements +// eslint-disable-next-line no-undef +if(value&&typeof HTMLElement==='function'&&value instanceof HTMLElement){return inspectHTML(value,options);}if('constructor'in value){// If it is a class, inspect it like an object but add the constructor name +if(value.constructor!==Object){return inspectClass(value,options);}// If it is an object with an anonymous prototype, display it as an object. +return inspectObject$1(value,options);}// last chance to check if it's an object +if(value===Object(value)){return inspectObject$1(value,options);}// We have run out of options! Just stringify the value +return options.stylize(String(value),type);}function registerConstructor(constructor,inspector){if(constructorMap.has(constructor)){return false;}constructorMap.set(constructor,inspector);return true;}function registerStringTag(stringTag,inspector){if(stringTag in stringTagMap){return false;}stringTagMap[stringTag]=inspector;return true;}const custom=chaiInspect;const loupe$1=/*#__PURE__*/Object.freeze({__proto__:null,custom,default:inspect$4,inspect:inspect$4,registerConstructor,registerStringTag});const _plugins_=plugins_1,AsymmetricMatcher$3=_plugins_.AsymmetricMatcher,DOMCollection$2=_plugins_.DOMCollection,DOMElement$2=_plugins_.DOMElement,Immutable$2=_plugins_.Immutable,ReactElement$2=_plugins_.ReactElement,ReactTestComponent$2=_plugins_.ReactTestComponent;const PLUGINS$2=[ReactTestComponent$2,ReactElement$2,DOMElement$2,DOMCollection$2,Immutable$2,AsymmetricMatcher$3];function stringify(object,maxDepth=10,_ref5={}){let maxLength=_ref5.maxLength,options=_objectWithoutProperties(_ref5,_excluded);const MAX_LENGTH=maxLength??1e4;let result;try{result=format_1(object,_objectSpread({maxDepth,escapeString:false,// min: true, +plugins:PLUGINS$2},options));}catch{result=format_1(object,_objectSpread({callToJSON:false,maxDepth,escapeString:false,// min: true, +plugins:PLUGINS$2},options));}return result.length>=MAX_LENGTH&&maxDepth>1?stringify(object,Math.floor(maxDepth/2)):result;}const formatRegExp=/%[sdjifoOcj%]/g;function format(...args){if(typeof args[0]!=="string"){const objects=[];for(let i2=0;i2{if(x==="%%")return"%";if(i>=len)return x;switch(x){case"%s":{const value=args[i++];if(typeof value==="bigint")return\`\${value.toString()}n\`;if(typeof value==="number"&&value===0&&1/value<0)return"-0";if(typeof value==="object"&&value!==null)return inspect$3(value,{depth:0,colors:false,compact:3});return String(value);}case"%d":{const value=args[i++];if(typeof value==="bigint")return\`\${value.toString()}n\`;return Number(value).toString();}case"%i":{const value=args[i++];if(typeof value==="bigint")return\`\${value.toString()}n\`;return Number.parseInt(String(value)).toString();}case"%f":return Number.parseFloat(String(args[i++])).toString();case"%o":return inspect$3(args[i++],{showHidden:true,showProxy:true});case"%O":return inspect$3(args[i++]);case"%c":{i++;return"";}case"%j":try{return JSON.stringify(args[i++]);}catch(err){const m=err.message;if(// chromium +m.includes("circular structure")||m.includes("cyclic structures")||m.includes("cyclic object"))return"[Circular]";throw err;}default:return x;}});for(let x=args[i];i=options.truncate){if(type==="[object Function]"){const fn=obj;return!fn.name||fn.name===""?"[Function]":\`[Function: \${fn.name}]\`;}else if(type==="[object Array]"){return\`[ Array(\${obj.length}) ]\`;}else if(type==="[object Object]"){const keys=Object.keys(obj);const kstr=keys.length>2?\`\${keys.splice(0,2).join(", ")}, ...\`:keys.join(", ");return\`{ Object (\${kstr}) }\`;}else{return str;}}return str;}const SAFE_TIMERS_SYMBOL=Symbol("vitest:SAFE_TIMERS");const SAFE_COLORS_SYMBOL=Symbol("vitest:SAFE_COLORS");const colorsMap={bold:["\\x1B[1m","\\x1B[22m","\\x1B[22m\\x1B[1m"],dim:["\\x1B[2m","\\x1B[22m","\\x1B[22m\\x1B[2m"],italic:["\\x1B[3m","\\x1B[23m"],underline:["\\x1B[4m","\\x1B[24m"],inverse:["\\x1B[7m","\\x1B[27m"],hidden:["\\x1B[8m","\\x1B[28m"],strikethrough:["\\x1B[9m","\\x1B[29m"],black:["\\x1B[30m","\\x1B[39m"],red:["\\x1B[31m","\\x1B[39m"],green:["\\x1B[32m","\\x1B[39m"],yellow:["\\x1B[33m","\\x1B[39m"],blue:["\\x1B[34m","\\x1B[39m"],magenta:["\\x1B[35m","\\x1B[39m"],cyan:["\\x1B[36m","\\x1B[39m"],white:["\\x1B[37m","\\x1B[39m"],gray:["\\x1B[90m","\\x1B[39m"],bgBlack:["\\x1B[40m","\\x1B[49m"],bgRed:["\\x1B[41m","\\x1B[49m"],bgGreen:["\\x1B[42m","\\x1B[49m"],bgYellow:["\\x1B[43m","\\x1B[49m"],bgBlue:["\\x1B[44m","\\x1B[49m"],bgMagenta:["\\x1B[45m","\\x1B[49m"],bgCyan:["\\x1B[46m","\\x1B[49m"],bgWhite:["\\x1B[47m","\\x1B[49m"]};const colorsEntries=Object.entries(colorsMap);function string$1(str){return String(str);}string$1.open="";string$1.close="";const defaultColors=/* @__PURE__ */colorsEntries.reduce((acc,[key])=>{acc[key]=string$1;return acc;},{isColorSupported:false});function getColors(){return globalThis[SAFE_COLORS_SYMBOL]||defaultColors;}function getSafeTimers(){const _ref6=globalThis[SAFE_TIMERS_SYMBOL]||globalThis,safeSetTimeout=_ref6.setTimeout,safeSetInterval=_ref6.setInterval,safeClearInterval=_ref6.clearInterval,safeClearTimeout=_ref6.clearTimeout,safeSetImmediate=_ref6.setImmediate,safeClearImmediate=_ref6.clearImmediate;const _ref7=globalThis[SAFE_TIMERS_SYMBOL]||globalThis.process||{nextTick:cb=>cb()},safeNextTick=_ref7.nextTick;return{nextTick:safeNextTick,setTimeout:safeSetTimeout,setInterval:safeSetInterval,clearInterval:safeClearInterval,clearTimeout:safeClearTimeout,setImmediate:safeSetImmediate,clearImmediate:safeClearImmediate};}function createSimpleStackTrace(options){const _ref8=options||{},_ref8$message=_ref8.message,message=_ref8$message===void 0?"error":_ref8$message,_ref8$stackTraceLimit=_ref8.stackTraceLimit,stackTraceLimit=_ref8$stackTraceLimit===void 0?1:_ref8$stackTraceLimit;const limit=Error.stackTraceLimit;const prepareStackTrace=Error.prepareStackTrace;Error.stackTraceLimit=stackTraceLimit;Error.prepareStackTrace=e=>e.stack;const err=new Error(message);const stackTrace=err.stack||"";Error.prepareStackTrace=prepareStackTrace;Error.stackTraceLimit=limit;return stackTrace;}// Copyright 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Simon Lydell +// License: MIT. +var LineTerminatorSequence$1;LineTerminatorSequence$1=/\\r?\\n|[\\r\\u2028\\u2029]/y;RegExp(LineTerminatorSequence$1.source);// src/index.ts +var reservedWords$1={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"]};new Set(reservedWords$1.keyword);new Set(reservedWords$1.strict);var build={};Object.defineProperty(build,'__esModule',{value:true});var _default=build.default=diffSequence;/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ // This diff-sequences package implements the linear space variation in +// An O(ND) Difference Algorithm and Its Variations by Eugene W. Myers +// Relationship in notation between Myers paper and this package: +// A is a +// N is aLength, aEnd - aStart, and so on +// x is aIndex, aFirst, aLast, and so on +// B is b +// M is bLength, bEnd - bStart, and so on +// y is bIndex, bFirst, bLast, and so on +// Δ = N - M is negative of baDeltaLength = bLength - aLength +// D is d +// k is kF +// k + Δ is kF = kR - baDeltaLength +// V is aIndexesF or aIndexesR (see comment below about Indexes type) +// index intervals [1, N] and [1, M] are [0, aLength) and [0, bLength) +// starting point in forward direction (0, 0) is (-1, -1) +// starting point in reverse direction (N + 1, M + 1) is (aLength, bLength) +// The “edit graph” for sequences a and b corresponds to items: +// in a on the horizontal axis +// in b on the vertical axis +// +// Given a-coordinate of a point in a diagonal, you can compute b-coordinate. +// +// Forward diagonals kF: +// zero diagonal intersects top left corner +// positive diagonals intersect top edge +// negative diagonals insersect left edge +// +// Reverse diagonals kR: +// zero diagonal intersects bottom right corner +// positive diagonals intersect right edge +// negative diagonals intersect bottom edge +// The graph contains a directed acyclic graph of edges: +// horizontal: delete an item from a +// vertical: insert an item from b +// diagonal: common item in a and b +// +// The algorithm solves dual problems in the graph analogy: +// Find longest common subsequence: path with maximum number of diagonal edges +// Find shortest edit script: path with minimum number of non-diagonal edges +// Input callback function compares items at indexes in the sequences. +// Output callback function receives the number of adjacent items +// and starting indexes of each common subsequence. +// Either original functions or wrapped to swap indexes if graph is transposed. +// Indexes in sequence a of last point of forward or reverse paths in graph. +// Myers algorithm indexes by diagonal k which for negative is bad deopt in V8. +// This package indexes by iF and iR which are greater than or equal to zero. +// and also updates the index arrays in place to cut memory in half. +// kF = 2 * iF - d +// kR = d - 2 * iR +// Division of index intervals in sequences a and b at the middle change. +// Invariant: intervals do not have common items at the start or end. +const pkg='diff-sequences';// for error messages +const NOT_YET_SET=0;// small int instead of undefined to avoid deopt in V8 +// Return the number of common items that follow in forward direction. +// The length of what Myers paper calls a “snake” in a forward path. +const countCommonItemsF=(aIndex,aEnd,bIndex,bEnd,isCommon)=>{let nCommon=0;while(aIndex{let nCommon=0;while(aStart<=aIndex&&bStart<=bIndex&&isCommon(aIndex,bIndex)){aIndex-=1;bIndex-=1;nCommon+=1;}return nCommon;};// A simple function to extend forward paths from (d - 1) to d changes +// when forward and reverse paths cannot yet overlap. +const extendPathsF=(d,aEnd,bEnd,bF,isCommon,aIndexesF,iMaxF// return the value because optimization might decrease it +)=>{// Unroll the first iteration. +let iF=0;let kF=-d;// kF = 2 * iF - d +let aFirst=aIndexesF[iF];// in first iteration always insert +let aIndexPrev1=aFirst;// prev value of [iF - 1] in next iteration +aIndexesF[iF]+=countCommonItemsF(aFirst+1,aEnd,bF+aFirst-kF+1,bEnd,isCommon);// Optimization: skip diagonals in which paths cannot ever overlap. +const nF=d{// Unroll the first iteration. +let iR=0;let kR=d;// kR = d - 2 * iR +let aFirst=aIndexesR[iR];// in first iteration always insert +let aIndexPrev1=aFirst;// prev value of [iR - 1] in next iteration +aIndexesR[iR]-=countCommonItemsR(aStart,aFirst-1,bStart,bR+aFirst-kR-1,isCommon);// Optimization: skip diagonals in which paths cannot ever overlap. +const nR=d{const bF=bStart-aStart;// bIndex = bF + aIndex - kF +const aLength=aEnd-aStart;const bLength=bEnd-bStart;const baDeltaLength=bLength-aLength;// kF = kR - baDeltaLength +// Range of diagonals in which forward and reverse paths might overlap. +const kMinOverlapF=-baDeltaLength-(d-1);// -(d - 1) <= kR +const kMaxOverlapF=-baDeltaLength+(d-1);// kR <= (d - 1) +let aIndexPrev1=NOT_YET_SET;// prev value of [iF - 1] in next iteration +// Optimization: skip diagonals in which paths cannot ever overlap. +const nF=d{const bR=bEnd-aEnd;// bIndex = bR + aIndex - kR +const aLength=aEnd-aStart;const bLength=bEnd-bStart;const baDeltaLength=bLength-aLength;// kR = kF + baDeltaLength +// Range of diagonals in which forward and reverse paths might overlap. +const kMinOverlapR=baDeltaLength-d;// -d <= kF +const kMaxOverlapR=baDeltaLength+d;// kF <= d +let aIndexPrev1=NOT_YET_SET;// prev value of [iR - 1] in next iteration +// Optimization: skip diagonals in which paths cannot ever overlap. +const nR=d{const bF=bStart-aStart;// bIndex = bF + aIndex - kF +const bR=bEnd-aEnd;// bIndex = bR + aIndex - kR +const aLength=aEnd-aStart;const bLength=bEnd-bStart;// Because graph has square or portrait orientation, +// length difference is minimum number of items to insert from b. +// Corresponding forward and reverse diagonals in graph +// depend on length difference of the sequences: +// kF = kR - baDeltaLength +// kR = kF + baDeltaLength +const baDeltaLength=bLength-aLength;// Optimization: max diagonal in graph intersects corner of shorter side. +let iMaxF=aLength;let iMaxR=aLength;// Initialize no changes yet in forward or reverse direction: +aIndexesF[0]=aStart-1;// at open start of interval, outside closed start +aIndexesR[0]=aEnd;// at open end of interval +if(baDeltaLength%2===0){// The number of changes in paths is 2 * d if length difference is even. +const dMin=(nChange||baDeltaLength)/2;const dMax=(aLength+bLength)/2;for(let d=1;d<=dMax;d+=1){iMaxF=extendPathsF(d,aEnd,bEnd,bF,isCommon,aIndexesF,iMaxF);if(d{if(bEnd-bStart{foundSubsequence(nCommon,aCommon,bCommon);},isCommon:(bIndex,aIndex)=>isCommon(aIndex,bIndex)};}const tStart=aStart;const tEnd=aEnd;aStart=bStart;aEnd=bEnd;bStart=tStart;bEnd=tEnd;}const _callbacks=callbacks[transposed?1:0],foundSubsequence=_callbacks.foundSubsequence,isCommon=_callbacks.isCommon;// Divide the index intervals at the middle change. +divide(nChange,aStart,aEnd,bStart,bEnd,isCommon,aIndexesF,aIndexesR,division);const nChangePreceding=division.nChangePreceding,aEndPreceding=division.aEndPreceding,bEndPreceding=division.bEndPreceding,nCommonPreceding=division.nCommonPreceding,aCommonPreceding=division.aCommonPreceding,bCommonPreceding=division.bCommonPreceding,nCommonFollowing=division.nCommonFollowing,aCommonFollowing=division.aCommonFollowing,bCommonFollowing=division.bCommonFollowing,nChangeFollowing=division.nChangeFollowing,aStartFollowing=division.aStartFollowing,bStartFollowing=division.bStartFollowing;// Unless either index interval is empty, they might contain common items. +if(aStart{if(typeof arg!=='number'){throw new TypeError(\`\${pkg}: \${name} typeof \${typeof arg} is not a number\`);}if(!Number.isSafeInteger(arg)){throw new RangeError(\`\${pkg}: \${name} value \${arg} is not a safe integer\`);}if(arg<0){throw new RangeError(\`\${pkg}: \${name} value \${arg} is a negative integer\`);}};const validateCallback=(name,arg)=>{const type=typeof arg;if(type!=='function'){throw new TypeError(\`\${pkg}: \${name} typeof \${type} is not a function\`);}};// Compare items in two sequences to find a longest common subsequence. +// Given lengths of sequences and input function to compare items at indexes, +// return by output function the number of adjacent items and starting indexes +// of each common subsequence. +function diffSequence(aLength,bLength,isCommon,foundSubsequence){validateLength('aLength',aLength);validateLength('bLength',bLength);validateCallback('isCommon',isCommon);validateCallback('foundSubsequence',foundSubsequence);// Count common items from the start in the forward direction. +const nCommonF=countCommonItemsF(0,aLength,0,bLength,isCommon);if(nCommonF!==0){foundSubsequence(nCommonF,0,0);}// Unless both sequences consist of common items only, +// find common items in the half-trimmed index intervals. +if(aLength!==nCommonF||bLength!==nCommonF){// Invariant: intervals do not have common items at the start. +// The start of an index interval is closed like array slice method. +const aStart=nCommonF;const bStart=nCommonF;// Count common items from the end in the reverse direction. +const nCommonR=countCommonItemsR(aStart,aLength-1,bStart,bLength-1,isCommon);// Invariant: intervals do not have common items at the end. +// The end of an index interval is open like array slice method. +const aEnd=aLength-nCommonR;const bEnd=bLength-nCommonR;// Unless one sequence consists of common items only, +// therefore the other trimmed index interval consists of changes only, +// find common items in the trimmed index intervals. +const nCommonFR=nCommonF+nCommonR;if(aLength!==nCommonFR&&bLength!==nCommonFR){const nChange=0;// number of change items is not yet known +const transposed=false;// call the original unwrapped functions +const callbacks=[{foundSubsequence,isCommon}];// Indexes in sequence a of last points in furthest reaching paths +// from outside the start at top left in the forward direction: +const aIndexesF=[NOT_YET_SET];// from the end at bottom right in the reverse direction: +const aIndexesR=[NOT_YET_SET];// Initialize one object as output of all calls to divide function. +const division={aCommonFollowing:NOT_YET_SET,aCommonPreceding:NOT_YET_SET,aEndPreceding:NOT_YET_SET,aStartFollowing:NOT_YET_SET,bCommonFollowing:NOT_YET_SET,bCommonPreceding:NOT_YET_SET,bEndPreceding:NOT_YET_SET,bStartFollowing:NOT_YET_SET,nChangeFollowing:NOT_YET_SET,nChangePreceding:NOT_YET_SET,nCommonFollowing:NOT_YET_SET,nCommonPreceding:NOT_YET_SET};// Find and return common subsequences in the trimmed index intervals. +findSubsequences(nChange,aStart,aEnd,bStart,bEnd,transposed,callbacks,aIndexesF,aIndexesR,division);}if(nCommonR!==0){foundSubsequence(nCommonR,aEnd,bEnd);}}}function getType(value){if(value===void 0){return"undefined";}else if(value===null){return"null";}else if(Array.isArray(value)){return"array";}else if(typeof value==="boolean"){return"boolean";}else if(typeof value==="function"){return"function";}else if(typeof value==="number"){return"number";}else if(typeof value==="string"){return"string";}else if(typeof value==="bigint"){return"bigint";}else if(typeof value==="object"){if(value!=null){if(value.constructor===RegExp)return"regexp";else if(value.constructor===Map)return"map";else if(value.constructor===Set)return"set";else if(value.constructor===Date)return"date";}return"object";}else if(typeof value==="symbol"){return"symbol";}throw new Error(\`value of unknown type: \${value}\`);}const DIFF_DELETE=-1;const DIFF_INSERT=1;const DIFF_EQUAL=0;class Diff{0;1;constructor(op,text){this[0]=op;this[1]=text;}}const NO_DIFF_MESSAGE="Compared values have no visual difference.";const SIMILAR_MESSAGE="Compared values serialize to the same structure.\\nPrinting internal object structure without calling \`toJSON\` instead.";function formatTrailingSpaces(line,trailingSpaceFormatter){return line.replace(/\\s+$/,match=>trailingSpaceFormatter(match));}function printDiffLine(line,isFirstOrLast,color,indicator,trailingSpaceFormatter,emptyFirstOrLastLinePlaceholder){return line.length!==0?color(\`\${indicator} \${formatTrailingSpaces(line,trailingSpaceFormatter)}\`):indicator!==" "?color(indicator):isFirstOrLast&&emptyFirstOrLastLinePlaceholder.length!==0?color(\`\${indicator} \${emptyFirstOrLastLinePlaceholder}\`):"";}function printDeleteLine(line,isFirstOrLast,{aColor,aIndicator,changeLineTrailingSpaceColor,emptyFirstOrLastLinePlaceholder}){return printDiffLine(line,isFirstOrLast,aColor,aIndicator,changeLineTrailingSpaceColor,emptyFirstOrLastLinePlaceholder);}function printInsertLine(line,isFirstOrLast,{bColor,bIndicator,changeLineTrailingSpaceColor,emptyFirstOrLastLinePlaceholder}){return printDiffLine(line,isFirstOrLast,bColor,bIndicator,changeLineTrailingSpaceColor,emptyFirstOrLastLinePlaceholder);}function printCommonLine(line,isFirstOrLast,{commonColor,commonIndicator,commonLineTrailingSpaceColor,emptyFirstOrLastLinePlaceholder}){return printDiffLine(line,isFirstOrLast,commonColor,commonIndicator,commonLineTrailingSpaceColor,emptyFirstOrLastLinePlaceholder);}function createPatchMark(aStart,aEnd,bStart,bEnd,{patchColor}){return patchColor(\`@@ -\${aStart+1},\${aEnd-aStart} +\${bStart+1},\${bEnd-bStart} @@\`);}function joinAlignedDiffsNoExpand(diffs,options){const iLength=diffs.length;const nContextLines=options.contextLines;const nContextLines2=nContextLines+nContextLines;let jLength=iLength;let hasExcessAtStartOrEnd=false;let nExcessesBetweenChanges=0;let i=0;while(i!==iLength){const iStart=i;while(i!==iLength&&diffs[i][0]===DIFF_EQUAL)i+=1;if(iStart!==i){if(iStart===0){if(i>nContextLines){jLength-=i-nContextLines;hasExcessAtStartOrEnd=true;}}else if(i===iLength){const n=i-iStart;if(n>nContextLines){jLength-=n-nContextLines;hasExcessAtStartOrEnd=true;}}else{const n=i-iStart;if(n>nContextLines2){jLength-=n-nContextLines2;nExcessesBetweenChanges+=1;}}}while(i!==iLength&&diffs[i][0]!==DIFF_EQUAL)i+=1;}const hasPatch=nExcessesBetweenChanges!==0||hasExcessAtStartOrEnd;if(nExcessesBetweenChanges!==0)jLength+=nExcessesBetweenChanges+1;else if(hasExcessAtStartOrEnd)jLength+=1;const jLast=jLength-1;const lines=[];let jPatchMark=0;if(hasPatch)lines.push("");let aStart=0;let bStart=0;let aEnd=0;let bEnd=0;const pushCommonLine=line=>{const j=lines.length;lines.push(printCommonLine(line,j===0||j===jLast,options));aEnd+=1;bEnd+=1;};const pushDeleteLine=line=>{const j=lines.length;lines.push(printDeleteLine(line,j===0||j===jLast,options));aEnd+=1;};const pushInsertLine=line=>{const j=lines.length;lines.push(printInsertLine(line,j===0||j===jLast,options));bEnd+=1;};i=0;while(i!==iLength){let iStart=i;while(i!==iLength&&diffs[i][0]===DIFF_EQUAL)i+=1;if(iStart!==i){if(iStart===0){if(i>nContextLines){iStart=i-nContextLines;aStart=iStart;bStart=iStart;aEnd=aStart;bEnd=bStart;}for(let iCommon=iStart;iCommon!==i;iCommon+=1)pushCommonLine(diffs[iCommon][1]);}else if(i===iLength){const iEnd=i-iStart>nContextLines?iStart+nContextLines:i;for(let iCommon=iStart;iCommon!==iEnd;iCommon+=1)pushCommonLine(diffs[iCommon][1]);}else{const nCommon=i-iStart;if(nCommon>nContextLines2){const iEnd=iStart+nContextLines;for(let iCommon=iStart;iCommon!==iEnd;iCommon+=1)pushCommonLine(diffs[iCommon][1]);lines[jPatchMark]=createPatchMark(aStart,aEnd,bStart,bEnd,options);jPatchMark=lines.length;lines.push("");const nOmit=nCommon-nContextLines2;aStart=aEnd+nOmit;bStart=bEnd+nOmit;aEnd=aStart;bEnd=bStart;for(let iCommon=i-nContextLines;iCommon!==i;iCommon+=1)pushCommonLine(diffs[iCommon][1]);}else{for(let iCommon=iStart;iCommon!==i;iCommon+=1)pushCommonLine(diffs[iCommon][1]);}}}while(i!==iLength&&diffs[i][0]===DIFF_DELETE){pushDeleteLine(diffs[i][1]);i+=1;}while(i!==iLength&&diffs[i][0]===DIFF_INSERT){pushInsertLine(diffs[i][1]);i+=1;}}if(hasPatch)lines[jPatchMark]=createPatchMark(aStart,aEnd,bStart,bEnd,options);return lines.join("\\n");}function joinAlignedDiffsExpand(diffs,options){return diffs.map((diff,i,diffs2)=>{const line=diff[1];const isFirstOrLast=i===0||i===diffs2.length-1;switch(diff[0]){case DIFF_DELETE:return printDeleteLine(line,isFirstOrLast,options);case DIFF_INSERT:return printInsertLine(line,isFirstOrLast,options);default:return printCommonLine(line,isFirstOrLast,options);}}).join("\\n");}const noColor=string=>string;const DIFF_CONTEXT_DEFAULT=5;function getDefaultOptions(){const c=getColors();return{aAnnotation:"Expected",aColor:c.green,aIndicator:"-",bAnnotation:"Received",bColor:c.red,bIndicator:"+",changeColor:c.inverse,changeLineTrailingSpaceColor:noColor,commonColor:c.dim,commonIndicator:" ",commonLineTrailingSpaceColor:noColor,compareKeys:void 0,contextLines:DIFF_CONTEXT_DEFAULT,emptyFirstOrLastLinePlaceholder:"",expand:true,includeChangeCounts:false,omitAnnotationLines:false,patchColor:c.yellow};}function getCompareKeys(compareKeys){return compareKeys&&typeof compareKeys==="function"?compareKeys:void 0;}function getContextLines(contextLines){return typeof contextLines==="number"&&Number.isSafeInteger(contextLines)&&contextLines>=0?contextLines:DIFF_CONTEXT_DEFAULT;}function normalizeDiffOptions(options={}){return _objectSpread(_objectSpread(_objectSpread({},getDefaultOptions()),options),{},{compareKeys:getCompareKeys(options.compareKeys),contextLines:getContextLines(options.contextLines)});}function isEmptyString(lines){return lines.length===1&&lines[0].length===0;}function countChanges(diffs){let a=0;let b=0;diffs.forEach(diff2=>{switch(diff2[0]){case DIFF_DELETE:a+=1;break;case DIFF_INSERT:b+=1;break;}});return{a,b};}function printAnnotation({aAnnotation,aColor,aIndicator,bAnnotation,bColor,bIndicator,includeChangeCounts,omitAnnotationLines},changeCounts){if(omitAnnotationLines)return"";let aRest="";let bRest="";if(includeChangeCounts){const aCount=String(changeCounts.a);const bCount=String(changeCounts.b);const baAnnotationLengthDiff=bAnnotation.length-aAnnotation.length;const aAnnotationPadding=" ".repeat(Math.max(0,baAnnotationLengthDiff));const bAnnotationPadding=" ".repeat(Math.max(0,-baAnnotationLengthDiff));const baCountLengthDiff=bCount.length-aCount.length;const aCountPadding=" ".repeat(Math.max(0,baCountLengthDiff));const bCountPadding=" ".repeat(Math.max(0,-baCountLengthDiff));aRest=\`\${aAnnotationPadding} \${aIndicator} \${aCountPadding}\${aCount}\`;bRest=\`\${bAnnotationPadding} \${bIndicator} \${bCountPadding}\${bCount}\`;}const a=\`\${aIndicator} \${aAnnotation}\${aRest}\`;const b=\`\${bIndicator} \${bAnnotation}\${bRest}\`;return\`\${aColor(a)} +\${bColor(b)} + +\`;}function printDiffLines(diffs,options){return printAnnotation(options,countChanges(diffs))+(options.expand?joinAlignedDiffsExpand(diffs,options):joinAlignedDiffsNoExpand(diffs,options));}function diffLinesUnified(aLines,bLines,options){return printDiffLines(diffLinesRaw(isEmptyString(aLines)?[]:aLines,isEmptyString(bLines)?[]:bLines),normalizeDiffOptions(options));}function diffLinesUnified2(aLinesDisplay,bLinesDisplay,aLinesCompare,bLinesCompare,options){if(isEmptyString(aLinesDisplay)&&isEmptyString(aLinesCompare)){aLinesDisplay=[];aLinesCompare=[];}if(isEmptyString(bLinesDisplay)&&isEmptyString(bLinesCompare)){bLinesDisplay=[];bLinesCompare=[];}if(aLinesDisplay.length!==aLinesCompare.length||bLinesDisplay.length!==bLinesCompare.length){return diffLinesUnified(aLinesDisplay,bLinesDisplay,options);}const diffs=diffLinesRaw(aLinesCompare,bLinesCompare);let aIndex=0;let bIndex=0;diffs.forEach(diff2=>{switch(diff2[0]){case DIFF_DELETE:diff2[1]=aLinesDisplay[aIndex];aIndex+=1;break;case DIFF_INSERT:diff2[1]=bLinesDisplay[bIndex];bIndex+=1;break;default:diff2[1]=bLinesDisplay[bIndex];aIndex+=1;bIndex+=1;}});return printDiffLines(diffs,normalizeDiffOptions(options));}function diffLinesRaw(aLines,bLines){const aLength=aLines.length;const bLength=bLines.length;const isCommon=(aIndex2,bIndex2)=>aLines[aIndex2]===bLines[bIndex2];const diffs=[];let aIndex=0;let bIndex=0;const foundSubsequence=(nCommon,aCommon,bCommon)=>{for(;aIndex!==aCommon;aIndex+=1)diffs.push(new Diff(DIFF_DELETE,aLines[aIndex]));for(;bIndex!==bCommon;bIndex+=1)diffs.push(new Diff(DIFF_INSERT,bLines[bIndex]));for(;nCommon!==0;nCommon-=1,aIndex+=1,bIndex+=1)diffs.push(new Diff(DIFF_EQUAL,bLines[bIndex]));};const diffSequences=_default.default||_default;diffSequences(aLength,bLength,isCommon,foundSubsequence);for(;aIndex!==aLength;aIndex+=1)diffs.push(new Diff(DIFF_DELETE,aLines[aIndex]));for(;bIndex!==bLength;bIndex+=1)diffs.push(new Diff(DIFF_INSERT,bLines[bIndex]));return diffs;}function getCommonMessage(message,options){const _normalizeDiffOptions=normalizeDiffOptions(options),commonColor=_normalizeDiffOptions.commonColor;return commonColor(message);}const _plugins_2=plugins_1,AsymmetricMatcher$2=_plugins_2.AsymmetricMatcher,DOMCollection$1=_plugins_2.DOMCollection,DOMElement$1=_plugins_2.DOMElement,Immutable$1=_plugins_2.Immutable,ReactElement$1=_plugins_2.ReactElement,ReactTestComponent$1=_plugins_2.ReactTestComponent;const PLUGINS$1=[ReactTestComponent$1,ReactElement$1,DOMElement$1,DOMCollection$1,Immutable$1,AsymmetricMatcher$2];const FORMAT_OPTIONS={plugins:PLUGINS$1};const FALLBACK_FORMAT_OPTIONS={callToJSON:false,maxDepth:10,plugins:PLUGINS$1};function diff(a,b,options){if(Object.is(a,b))return"";const aType=getType(a);let expectedType=aType;let omitDifference=false;if(aType==="object"&&typeof a.asymmetricMatch==="function"){if(a.$$typeof!==Symbol.for("jest.asymmetricMatcher")){return null;}if(typeof a.getExpectedType!=="function"){return null;}expectedType=a.getExpectedType();omitDifference=expectedType==="string";}if(expectedType!==getType(b)){const _normalizeDiffOptions2=normalizeDiffOptions(options),aAnnotation=_normalizeDiffOptions2.aAnnotation,aColor=_normalizeDiffOptions2.aColor,aIndicator=_normalizeDiffOptions2.aIndicator,bAnnotation=_normalizeDiffOptions2.bAnnotation,bColor=_normalizeDiffOptions2.bColor,bIndicator=_normalizeDiffOptions2.bIndicator;const formatOptions=getFormatOptions(FALLBACK_FORMAT_OPTIONS,options);const aDisplay=format_1(a,formatOptions);const bDisplay=format_1(b,formatOptions);const aDiff=\`\${aColor(\`\${aIndicator} \${aAnnotation}:\`)} +\${aDisplay}\`;const bDiff=\`\${bColor(\`\${bIndicator} \${bAnnotation}:\`)} +\${bDisplay}\`;return\`\${aDiff} + +\${bDiff}\`;}if(omitDifference)return null;switch(aType){case"string":return diffLinesUnified(a.split("\\n"),b.split("\\n"),options);case"boolean":case"number":return comparePrimitive(a,b,options);case"map":return compareObjects(sortMap(a),sortMap(b),options);case"set":return compareObjects(sortSet(a),sortSet(b),options);default:return compareObjects(a,b,options);}}function comparePrimitive(a,b,options){const aFormat=format_1(a,FORMAT_OPTIONS);const bFormat=format_1(b,FORMAT_OPTIONS);return aFormat===bFormat?"":diffLinesUnified(aFormat.split("\\n"),bFormat.split("\\n"),options);}function sortMap(map){return new Map(Array.from(map.entries()).sort());}function sortSet(set){return new Set(Array.from(set.values()).sort());}function compareObjects(a,b,options){let difference;let hasThrown=false;try{const formatOptions=getFormatOptions(FORMAT_OPTIONS,options);difference=getObjectsDifference(a,b,formatOptions,options);}catch{hasThrown=true;}const noDiffMessage=getCommonMessage(NO_DIFF_MESSAGE,options);if(difference===void 0||difference===noDiffMessage){const formatOptions=getFormatOptions(FALLBACK_FORMAT_OPTIONS,options);difference=getObjectsDifference(a,b,formatOptions,options);if(difference!==noDiffMessage&&!hasThrown){difference=\`\${getCommonMessage(SIMILAR_MESSAGE,options)} + +\${difference}\`;}}return difference;}function getFormatOptions(formatOptions,options){const _normalizeDiffOptions3=normalizeDiffOptions(options),compareKeys=_normalizeDiffOptions3.compareKeys;return _objectSpread(_objectSpread({},formatOptions),{},{compareKeys});}function getObjectsDifference(a,b,formatOptions,options){const formatOptionsZeroIndent=_objectSpread(_objectSpread({},formatOptions),{},{indent:0});const aCompare=format_1(a,formatOptionsZeroIndent);const bCompare=format_1(b,formatOptionsZeroIndent);if(aCompare===bCompare){return getCommonMessage(NO_DIFF_MESSAGE,options);}else{const aDisplay=format_1(a,formatOptions);const bDisplay=format_1(b,formatOptions);return diffLinesUnified2(aDisplay.split("\\n"),bDisplay.split("\\n"),aCompare.split("\\n"),bCompare.split("\\n"),options);}}const IS_RECORD_SYMBOL="@@__IMMUTABLE_RECORD__@@";const IS_COLLECTION_SYMBOL="@@__IMMUTABLE_ITERABLE__@@";function isImmutable(v){return v&&(v[IS_COLLECTION_SYMBOL]||v[IS_RECORD_SYMBOL]);}const OBJECT_PROTO=Object.getPrototypeOf({});function getUnserializableMessage(err){if(err instanceof Error)return\`: \${err.message}\`;if(typeof err==="string")return\`: \${err}\`;return"";}function serializeError(val,seen=/* @__PURE__ */new WeakMap()){if(!val||typeof val==="string")return val;if(typeof val==="function")return\`Function<\${val.name||"anonymous"}>\`;if(typeof val==="symbol")return val.toString();if(typeof val!=="object")return val;if(isImmutable(val))return serializeError(val.toJSON(),seen);if(val instanceof Promise||val.constructor&&val.constructor.prototype==="AsyncFunction")return"Promise";if(typeof Element!=="undefined"&&val instanceof Element)return val.tagName;if(typeof val.asymmetricMatch==="function")return\`\${val.toString()} \${format(val.sample)}\`;if(seen.has(val))return seen.get(val);if(Array.isArray(val)){const clone=new Array(val.length);seen.set(val,clone);val.forEach((e,i)=>{try{clone[i]=serializeError(e,seen);}catch(err){clone[i]=getUnserializableMessage(err);}});return clone;}else{const clone=/* @__PURE__ */Object.create(null);seen.set(val,clone);let obj=val;while(obj&&obj!==OBJECT_PROTO){Object.getOwnPropertyNames(obj).forEach(key=>{if(key in clone)return;try{clone[key]=serializeError(val[key],seen);}catch(err){delete clone[key];clone[key]=getUnserializableMessage(err);}});obj=Object.getPrototypeOf(obj);}return clone;}}function normalizeErrorMessage(message){return message.replace(/__(vite_ssr_import|vi_import)_\\d+__\\./g,"");}function processError(err,diffOptions){if(!err||typeof err!=="object")return{message:err};if(err.stack)err.stackStr=String(err.stack);if(err.name)err.nameStr=String(err.name);if(err.showDiff||err.showDiff===void 0&&err.expected!==void 0&&err.actual!==void 0){const clonedActual=deepClone(err.actual,{forceWritable:true});const clonedExpected=deepClone(err.expected,{forceWritable:true});const _replaceAsymmetricMat=replaceAsymmetricMatcher(clonedActual,clonedExpected),replacedActual=_replaceAsymmetricMat.replacedActual,replacedExpected=_replaceAsymmetricMat.replacedExpected;err.diff=diff(replacedExpected,replacedActual,_objectSpread(_objectSpread({},diffOptions),err.diffOptions));}if(typeof err.expected!=="string")err.expected=stringify(err.expected,10);if(typeof err.actual!=="string")err.actual=stringify(err.actual,10);try{if(typeof err.message==="string")err.message=normalizeErrorMessage(err.message);if(typeof err.cause==="object"&&typeof err.cause.message==="string")err.cause.message=normalizeErrorMessage(err.cause.message);}catch{}try{return serializeError(err);}catch(e){return serializeError(new Error(\`Failed to fully serialize error: \${e==null?void 0:e.message} +Inner error message: \${err==null?void 0:err.message}\`));}}function isAsymmetricMatcher(data){const type=getType$2(data);return type==="Object"&&typeof data.asymmetricMatch==="function";}function isReplaceable(obj1,obj2){const obj1Type=getType$2(obj1);const obj2Type=getType$2(obj2);return obj1Type===obj2Type&&(obj1Type==="Object"||obj1Type==="Array");}function replaceAsymmetricMatcher(actual,expected,actualReplaced=/* @__PURE__ */new WeakSet(),expectedReplaced=/* @__PURE__ */new WeakSet()){if(!isReplaceable(actual,expected))return{replacedActual:actual,replacedExpected:expected};if(actualReplaced.has(actual)||expectedReplaced.has(expected))return{replacedActual:actual,replacedExpected:expected};actualReplaced.add(actual);expectedReplaced.add(expected);getOwnProperties(expected).forEach(key=>{const expectedValue=expected[key];const actualValue=actual[key];if(isAsymmetricMatcher(expectedValue)){if(expectedValue.asymmetricMatch(actualValue))actual[key]=expectedValue;}else if(isAsymmetricMatcher(actualValue)){if(actualValue.asymmetricMatch(expectedValue))expected[key]=actualValue;}else if(isReplaceable(actualValue,expectedValue)){const replaced=replaceAsymmetricMatcher(actualValue,expectedValue,actualReplaced,expectedReplaced);actual[key]=replaced.replacedActual;expected[key]=replaced.replacedExpected;}});return{replacedActual:actual,replacedExpected:expected};}function createChainable(keys,fn){function create(context){const chain2=function(...args){return fn.apply(context,args);};Object.assign(chain2,fn);chain2.withContext=()=>chain2.bind(context);chain2.setContext=(key,value)=>{context[key]=value;};chain2.mergeContext=ctx=>{Object.assign(context,ctx);};for(const key of keys){Object.defineProperty(chain2,key,{get(){return create(_objectSpread(_objectSpread({},context),{},{[key]:true}));}});}return chain2;}const chain=create({});chain.fn=fn;return chain;}function getNames(task){const names=[task.name];let current=task;while((current==null?void 0:current.suite)||(current==null?void 0:current.file)){current=current.suite||current.file;if(current==null?void 0:current.name)names.unshift(current.name);}return names;}const _DRIVE_LETTER_START_RE=/^[A-Za-z]:\\//;function normalizeWindowsPath$1(input=""){if(!input){return input;}return input.replace(/\\\\/g,"/").replace(_DRIVE_LETTER_START_RE,r=>r.toUpperCase());}const _IS_ABSOLUTE_RE$1=/^[/\\\\](?![/\\\\])|^[/\\\\]{2}(?!\\.)|^[A-Za-z]:[/\\\\]/;function cwd$1(){if(typeof process!=="undefined"&&typeof process.cwd==="function"){return process.cwd().replace(/\\\\/g,"/");}return"/";}const resolve$3=function(...arguments_){arguments_=arguments_.map(argument=>normalizeWindowsPath$1(argument));let resolvedPath="";let resolvedAbsolute=false;for(let index=arguments_.length-1;index>=-1&&!resolvedAbsolute;index--){const path=index>=0?arguments_[index]:cwd$1();if(!path||path.length===0){continue;}resolvedPath=\`\${path}/\${resolvedPath}\`;resolvedAbsolute=isAbsolute$1(path);}resolvedPath=normalizeString$1(resolvedPath,!resolvedAbsolute);if(resolvedAbsolute&&!isAbsolute$1(resolvedPath)){return\`/\${resolvedPath}\`;}return resolvedPath.length>0?resolvedPath:".";};function normalizeString$1(path,allowAboveRoot){let res="";let lastSegmentLength=0;let lastSlash=-1;let dots=0;let char=null;for(let index=0;index<=path.length;++index){if(index2){const lastSlashIndex=res.lastIndexOf("/");if(lastSlashIndex===-1){res="";lastSegmentLength=0;}else{res=res.slice(0,lastSlashIndex);lastSegmentLength=res.length-1-res.lastIndexOf("/");}lastSlash=index;dots=0;continue;}else if(res.length>0){res="";lastSegmentLength=0;lastSlash=index;dots=0;continue;}}if(allowAboveRoot){res+=res.length>0?"/..":"..";lastSegmentLength=2;}}else{if(res.length>0){res+=\`/\${path.slice(lastSlash+1,index)}\`;}else{res=path.slice(lastSlash+1,index);}lastSegmentLength=index-lastSlash-1;}lastSlash=index;dots=0;}else if(char==="."&&dots!==-1){++dots;}else{dots=-1;}}return res;}const isAbsolute$1=function(p){return _IS_ABSOLUTE_RE$1.test(p);};const fnMap=/* @__PURE__ */new WeakMap();const fixtureMap=/* @__PURE__ */new WeakMap();const hooksMap=/* @__PURE__ */new WeakMap();function setFn(key,fn){fnMap.set(key,fn);}function setFixture(key,fixture){fixtureMap.set(key,fixture);}function getFixture(key){return fixtureMap.get(key);}function setHooks(key,hooks){hooksMap.set(key,hooks);}function getHooks(key){return hooksMap.get(key);}class PendingError extends Error{constructor(message,task){super(message);this.message=message;this.taskId=task.id;}code="VITEST_PENDING";taskId;}const collectorContext={tasks:[],currentSuite:null};function collectTask(task){var _a;(_a=collectorContext.currentSuite)==null?void 0:_a.tasks.push(task);}async function runWithSuite(suite,fn){const prev=collectorContext.currentSuite;collectorContext.currentSuite=suite;await fn();collectorContext.currentSuite=prev;}function withTimeout(fn,timeout,isHook=false){if(timeout<=0||timeout===Number.POSITIVE_INFINITY)return fn;const _getSafeTimers=getSafeTimers(),setTimeout=_getSafeTimers.setTimeout,clearTimeout=_getSafeTimers.clearTimeout;return(...args)=>{return Promise.race([fn(...args),new Promise((resolve,reject)=>{var _a;const timer=setTimeout(()=>{clearTimeout(timer);reject(new Error(makeTimeoutMsg(isHook,timeout)));},timeout);(_a=timer.unref)==null?void 0:_a.call(timer);})]);};}function createTestContext(test,runner){var _a;const context=function(){throw new Error("done() callback is deprecated, use promise instead");};context.task=test;context.skip=()=>{test.pending=true;throw new PendingError("test is skipped; abort execution",test);};context.onTestFailed=fn=>{test.onFailed||(test.onFailed=[]);test.onFailed.push(fn);};context.onTestFinished=fn=>{test.onFinished||(test.onFinished=[]);test.onFinished.push(fn);};return((_a=runner.extendTaskContext)==null?void 0:_a.call(runner,context))||context;}function makeTimeoutMsg(isHook,timeout){return\`\${isHook?"Hook":"Test"} timed out in \${timeout}ms. +If this is a long-running \${isHook?"hook":"test"}, pass a timeout value as the last argument or configure it globally with "\${isHook?"hookTimeout":"testTimeout"}".\`;}function mergeContextFixtures(fixtures,context={}){const fixtureOptionKeys=["auto"];const fixtureArray=Object.entries(fixtures).map(([prop,value])=>{const fixtureItem={value};if(Array.isArray(value)&&value.length>=2&&isObject$1(value[1])&&Object.keys(value[1]).some(key=>fixtureOptionKeys.includes(key))){Object.assign(fixtureItem,value[1]);fixtureItem.value=value[0];}fixtureItem.prop=prop;fixtureItem.isFn=typeof fixtureItem.value==="function";return fixtureItem;});if(Array.isArray(context.fixtures))context.fixtures=context.fixtures.concat(fixtureArray);else context.fixtures=fixtureArray;fixtureArray.forEach(fixture=>{if(fixture.isFn){const usedProps=getUsedProps(fixture.value);if(usedProps.length)fixture.deps=context.fixtures.filter(({prop})=>prop!==fixture.prop&&usedProps.includes(prop));}});return context;}const fixtureValueMaps=/* @__PURE__ */new Map();const cleanupFnArrayMap=/* @__PURE__ */new Map();function withFixtures(fn,testContext){return hookContext=>{const context=hookContext||testContext;if(!context)return fn({});const fixtures=getFixture(context);if(!(fixtures==null?void 0:fixtures.length))return fn(context);const usedProps=getUsedProps(fn);const hasAutoFixture=fixtures.some(({auto})=>auto);if(!usedProps.length&&!hasAutoFixture)return fn(context);if(!fixtureValueMaps.get(context))fixtureValueMaps.set(context,/* @__PURE__ */new Map());const fixtureValueMap=fixtureValueMaps.get(context);if(!cleanupFnArrayMap.has(context))cleanupFnArrayMap.set(context,[]);const cleanupFnArray=cleanupFnArrayMap.get(context);const usedFixtures=fixtures.filter(({prop,auto})=>auto||usedProps.includes(prop));const pendingFixtures=resolveDeps(usedFixtures);if(!pendingFixtures.length)return fn(context);async function resolveFixtures(){for(const fixture of pendingFixtures){if(fixtureValueMap.has(fixture))continue;const resolvedValue=fixture.isFn?await resolveFixtureFunction(fixture.value,context,cleanupFnArray):fixture.value;context[fixture.prop]=resolvedValue;fixtureValueMap.set(fixture,resolvedValue);cleanupFnArray.unshift(()=>{fixtureValueMap.delete(fixture);});}}return resolveFixtures().then(()=>fn(context));};}async function resolveFixtureFunction(fixtureFn,context,cleanupFnArray){const useFnArgPromise=createDefer();let isUseFnArgResolved=false;const fixtureReturn=fixtureFn(context,async useFnArg=>{isUseFnArgResolved=true;useFnArgPromise.resolve(useFnArg);const useReturnPromise=createDefer();cleanupFnArray.push(async()=>{useReturnPromise.resolve();await fixtureReturn;});await useReturnPromise;}).catch(e=>{if(!isUseFnArgResolved){useFnArgPromise.reject(e);return;}throw e;});return useFnArgPromise;}function resolveDeps(fixtures,depSet=/* @__PURE__ */new Set(),pendingFixtures=[]){fixtures.forEach(fixture=>{if(pendingFixtures.includes(fixture))return;if(!fixture.isFn||!fixture.deps){pendingFixtures.push(fixture);return;}if(depSet.has(fixture))throw new Error(\`Circular fixture dependency detected: \${fixture.prop} <- \${[...depSet].reverse().map(d=>d.prop).join(" <- ")}\`);depSet.add(fixture);resolveDeps(fixture.deps,depSet,pendingFixtures);pendingFixtures.push(fixture);depSet.clear();});return pendingFixtures;}function getUsedProps(fn){const match=fn.toString().match(/[^(]*\\(([^)]*)/);if(!match)return[];const args=splitByComma(match[1]);if(!args.length)return[];const first=args[0];if(!(first.startsWith("{")&&first.endsWith("}")))throw new Error(\`The first argument inside a fixture must use object destructuring pattern, e.g. ({ test } => {}). Instead, received "\${first}".\`);const _first=first.slice(1,-1).replace(/\\s/g,"");const props=splitByComma(_first).map(prop=>{return prop.replace(/\\:.*|\\=.*/g,"");});const last=props.at(-1);if(last&&last.startsWith("..."))throw new Error(\`Rest parameters are not supported in fixtures, received "\${last}".\`);return props;}function splitByComma(s){const result=[];const stack=[];let start=0;for(let i=0;i{};if(typeof optionsOrTest==="object"){if(typeof optionsOrFn==="object")throw new TypeError("Cannot use two objects as arguments. Please provide options and a function callback in that order.");options=optionsOrTest;}else if(typeof optionsOrTest==="number"){options={timeout:optionsOrTest};}else if(typeof optionsOrFn==="object"){options=optionsOrFn;}if(typeof optionsOrFn==="function"){if(typeof optionsOrTest==="function")throw new TypeError("Cannot use two functions as arguments. Please use the second argument for options.");fn=optionsOrFn;}else if(typeof optionsOrTest==="function"){fn=optionsOrTest;}return{options,handler:fn};}function createSuiteCollector(name,factory=()=>{},mode,shuffle,each,suiteOptions){const tasks=[];const factoryQueue=[];let suite2;initSuite();const task=function(name2="",options={}){const task2={id:"",name:name2,suite:void 0,each:options.each,fails:options.fails,context:void 0,type:"custom",retry:options.retry??runner.config.retry,repeats:options.repeats,mode:options.only?"only":options.skip?"skip":options.todo?"todo":"run",meta:options.meta??/* @__PURE__ */Object.create(null)};const handler=options.handler;if(options.concurrent||!options.sequential&&runner.config.sequence.concurrent)task2.concurrent=true;if(shuffle)task2.shuffle=true;const context=createTestContext(task2,runner);Object.defineProperty(task2,"context",{value:context,enumerable:false});setFixture(context,options.fixtures);if(handler){setFn(task2,withTimeout(withFixtures(handler,context),(options==null?void 0:options.timeout)??runner.config.testTimeout));}tasks.push(task2);return task2;};const test2=createTest(function(name2,optionsOrFn,optionsOrTest){let _parseArguments=parseArguments(optionsOrFn,optionsOrTest),options=_parseArguments.options,handler=_parseArguments.handler;if(typeof suiteOptions==="object")options=Object.assign({},suiteOptions,options);options.concurrent=this.concurrent||!this.sequential&&(options==null?void 0:options.concurrent);options.sequential=this.sequential||!this.concurrent&&(options==null?void 0:options.sequential);const test3=task(formatName(name2),_objectSpread(_objectSpread(_objectSpread({},this),options),{},{handler}));test3.type="test";});const collector={type:"collector",name,mode,options:suiteOptions,test:test2,tasks,collect,task,clear,on:addHook};function addHook(name2,...fn){getHooks(suite2)[name2].push(...fn);}function initSuite(){if(typeof suiteOptions==="number")suiteOptions={timeout:suiteOptions};suite2={id:"",type:"suite",name,mode,each,shuffle,tasks:[],meta:/* @__PURE__ */Object.create(null),projectName:""};setHooks(suite2,createSuiteHooks());}function clear(){tasks.length=0;factoryQueue.length=0;initSuite();}async function collect(file){factoryQueue.length=0;if(factory)await runWithSuite(collector,()=>factory(test2));const allChildren=[];for(const i of[...factoryQueue,...tasks])allChildren.push(i.type==="collector"?await i.collect(file):i);suite2.file=file;suite2.tasks=allChildren;allChildren.forEach(task2=>{task2.suite=suite2;if(file)task2.file=file;});return suite2;}collectTask(collector);return collector;}function createSuite(){function suiteFn(name,factoryOrOptions,optionsOrFactory={}){const mode=this.only?"only":this.skip?"skip":this.todo?"todo":"run";const currentSuite=getCurrentSuite();let _parseArguments2=parseArguments(factoryOrOptions,optionsOrFactory),options=_parseArguments2.options,factory=_parseArguments2.handler;if(currentSuite==null?void 0:currentSuite.options)options=_objectSpread(_objectSpread({},currentSuite.options),options);options.concurrent=this.concurrent||!this.sequential&&(options==null?void 0:options.concurrent);options.sequential=this.sequential||!this.concurrent&&(options==null?void 0:options.sequential);return createSuiteCollector(formatName(name),factory,mode,this.shuffle,this.each,options);}suiteFn.each=function(cases,...args){const suite2=this.withContext();this.setContext("each",true);if(Array.isArray(cases)&&args.length)cases=formatTemplateString(cases,args);return(name,optionsOrFn,fnOrOptions)=>{const _name=formatName(name);const arrayOnlyCases=cases.every(Array.isArray);const _parseArguments3=parseArguments(optionsOrFn,fnOrOptions),options=_parseArguments3.options,handler=_parseArguments3.handler;cases.forEach((i,idx)=>{const items=Array.isArray(i)?i:[i];arrayOnlyCases?suite2(formatTitle(_name,items,idx),options,()=>handler(...items)):suite2(formatTitle(_name,items,idx),options,()=>handler(i));});this.setContext("each",void 0);};};suiteFn.skipIf=condition=>condition?suite.skip:suite;suiteFn.runIf=condition=>condition?suite:suite.skip;return createChainable(["concurrent","sequential","shuffle","skip","only","todo"],suiteFn);}function createTaskCollector(fn,context){const taskFn=fn;taskFn.each=function(cases,...args){const test2=this.withContext();this.setContext("each",true);if(Array.isArray(cases)&&args.length)cases=formatTemplateString(cases,args);return(name,optionsOrFn,fnOrOptions)=>{const _name=formatName(name);const arrayOnlyCases=cases.every(Array.isArray);const _parseArguments4=parseArguments(optionsOrFn,fnOrOptions),options=_parseArguments4.options,handler=_parseArguments4.handler;cases.forEach((i,idx)=>{const items=Array.isArray(i)?i:[i];arrayOnlyCases?test2(formatTitle(_name,items,idx),options,()=>handler(...items)):test2(formatTitle(_name,items,idx),options,()=>handler(i));});this.setContext("each",void 0);};};taskFn.skipIf=function(condition){return condition?this.skip:this;};taskFn.runIf=function(condition){return condition?this:this.skip;};taskFn.extend=function(fixtures){const _context=mergeContextFixtures(fixtures,context);return createTest(function fn2(name,optionsOrFn,optionsOrTest){getCurrentSuite().test.fn.call(this,formatName(name),optionsOrFn,optionsOrTest);},_context);};const _test=createChainable(["concurrent","sequential","skip","only","todo","fails"],taskFn);if(context)_test.mergeContext(context);return _test;}function createTest(fn,context){return createTaskCollector(fn,context);}function formatName(name){return typeof name==="string"?name:name instanceof Function?name.name||"":String(name);}function formatTitle(template,items,idx){if(template.includes("%#")){template=template.replace(/%%/g,"__vitest_escaped_%__").replace(/%#/g,\`\${idx}\`).replace(/__vitest_escaped_%__/g,"%%");}const count=template.split("%").length-1;let formatted=format(template,...items.slice(0,count));if(isObject$1(items[0])){formatted=formatted.replace(/\\$([$\\w_.]+)/g,// https://github.com/chaijs/chai/pull/1490 +(_,key)=>{var _a,_b;return objDisplay$2(objectAttr(items[0],key),{truncate:(_b=(_a=void 0)==null?void 0:_a.chaiConfig)==null?void 0:_b.truncateThreshold});});}return formatted;}function formatTemplateString(cases,args){const header=cases.join("").trim().replace(/ /g,"").split("\\n").map(i=>i.split("|"))[0];const res=[];for(let i=0;i + * MIT Licensed + */ /*! + * Return a function that will copy properties from + * one object to another excluding any originally + * listed. Returned function will create a new \`{}\`. + * + * @param {String} excluded properties ... + * @return {Function} + */function exclude(){var excludes=[].slice.call(arguments);function excludeProps(res,obj){Object.keys(obj).forEach(function(key){if(!~excludes.indexOf(key))res[key]=obj[key];});}return function extendExclude(){var args=[].slice.call(arguments),i=0,res={};for(;i + * @see https://github.com/logicalparadox/filtr + * MIT Licensed + */ /** + * ### .hasProperty(object, name) + * + * This allows checking whether an object has own + * or inherited from prototype chain named property. + * + * Basically does the same thing as the \`in\` + * operator but works properly with null/undefined values + * and other primitives. + * + * var obj = { + * arr: ['a', 'b', 'c'] + * , str: 'Hello' + * } + * + * The following would be the results. + * + * hasProperty(obj, 'str'); // true + * hasProperty(obj, 'constructor'); // true + * hasProperty(obj, 'bar'); // false + * + * hasProperty(obj.str, 'length'); // true + * hasProperty(obj.str, 1); // true + * hasProperty(obj.str, 5); // false + * + * hasProperty(obj.arr, 'length'); // true + * hasProperty(obj.arr, 2); // true + * hasProperty(obj.arr, 3); // false + * + * @param {Object} object + * @param {String|Symbol} name + * @returns {Boolean} whether it exists + * @namespace Utils + * @name hasProperty + * @api public + */function hasProperty(obj,name){if(typeof obj==='undefined'||obj===null){return false;}// The \`in\` operator does not work with primitives. +return name in Object(obj);}/* ! + * ## parsePath(path) + * + * Helper function used to parse string object + * paths. Use in conjunction with \`internalGetPathValue\`. + * + * var parsed = parsePath('myobject.property.subprop'); + * + * ### Paths: + * + * * Can be infinitely deep and nested. + * * Arrays are also valid using the formal \`myobject.document[3].property\`. + * * Literal dots and brackets (not delimiter) must be backslash-escaped. + * + * @param {String} path + * @returns {Object} parsed + * @api private + */function parsePath(path){var str=path.replace(/([^\\\\])\\[/g,'$1.[');var parts=str.match(/(\\\\\\.|[^.]+?)+/g);return parts.map(function mapMatches(value){if(value==='constructor'||value==='__proto__'||value==='prototype'){return{};}var regexp=/^\\[(\\d+)\\]$/;var mArr=regexp.exec(value);var parsed=null;if(mArr){parsed={i:parseFloat(mArr[1])};}else{parsed={p:value.replace(/\\\\([.[\\]])/g,'$1')};}return parsed;});}/* ! + * ## internalGetPathValue(obj, parsed[, pathDepth]) + * + * Helper companion function for \`.parsePath\` that returns + * the value located at the parsed address. + * + * var value = getPathValue(obj, parsed); + * + * @param {Object} object to search against + * @param {Object} parsed definition from \`parsePath\`. + * @param {Number} depth (nesting level) of the property we want to retrieve + * @returns {Object|Undefined} value + * @api private + */function internalGetPathValue(obj,parsed,pathDepth){var temporaryValue=obj;var res=null;pathDepth=typeof pathDepth==='undefined'?parsed.length:pathDepth;for(var i=0;i1?internalGetPathValue(obj,parsed,parsed.length-1):obj,name:last.p||last.i,value:internalGetPathValue(obj,parsed)};info.exists=hasProperty(info.parent,info.name);return info;}/** + * ### .getPathValue(object, path) + * + * This allows the retrieval of values in an + * object given a string path. + * + * var obj = { + * prop1: { + * arr: ['a', 'b', 'c'] + * , str: 'Hello' + * } + * , prop2: { + * arr: [ { nested: 'Universe' } ] + * , str: 'Hello again!' + * } + * } + * + * The following would be the results. + * + * getPathValue(obj, 'prop1.str'); // Hello + * getPathValue(obj, 'prop1.att[2]'); // b + * getPathValue(obj, 'prop2.arr[0].nested'); // Universe + * + * @param {Object} object + * @param {String} path + * @returns {Object} value or \`undefined\` + * @namespace Utils + * @name getPathValue + * @api public + */function getPathValue(obj,path){var info=getPathInfo(obj,path);return info.value;}/** + * ### .setPathValue(object, path, value) + * + * Define the value in an object at a given string path. + * + * \`\`\`js + * var obj = { + * prop1: { + * arr: ['a', 'b', 'c'] + * , str: 'Hello' + * } + * , prop2: { + * arr: [ { nested: 'Universe' } ] + * , str: 'Hello again!' + * } + * }; + * \`\`\` + * + * The following would be acceptable. + * + * \`\`\`js + * var properties = require('tea-properties'); + * properties.set(obj, 'prop1.str', 'Hello Universe!'); + * properties.set(obj, 'prop1.arr[2]', 'B'); + * properties.set(obj, 'prop2.arr[0].nested.value', { hello: 'universe' }); + * \`\`\` + * + * @param {Object} object + * @param {String} path + * @param {Mixed} value + * @api private + */function setPathValue(obj,path,val){var parsed=parsePath(path);internalSetPathValue(obj,val,parsed);return obj;}var pathval={hasProperty:hasProperty,getPathInfo:getPathInfo,getPathValue:getPathValue,setPathValue:setPathValue};/*! + * Chai - flag utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ /** + * ### .flag(object, key, [value]) + * + * Get or set a flag value on an object. If a + * value is provided it will be set, else it will + * return the currently set value or \`undefined\` if + * the value is not set. + * + * utils.flag(this, 'foo', 'bar'); // setter + * utils.flag(this, 'foo'); // getter, returns \`bar\` + * + * @param {Object} object constructed Assertion + * @param {String} key + * @param {Mixed} value (optional) + * @namespace Utils + * @name flag + * @api private + */var flag$5=function flag(obj,key,value){var flags=obj.__flags||(obj.__flags=Object.create(null));if(arguments.length===3){flags[key]=value;}else{return flags[key];}};/*! + * Chai - test utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ /*! + * Module dependencies + */var flag$4=flag$5;/** + * ### .test(object, expression) + * + * Test an object for expression. + * + * @param {Object} object (constructed Assertion) + * @param {Arguments} chai.Assertion.prototype.assert arguments + * @namespace Utils + * @name test + */var test$1=function test(obj,args){var negate=flag$4(obj,'negate'),expr=args[0];return negate?!expr:expr;};var typeDetect$1={exports:{}};(function(module,exports){(function(global,factory){module.exports=factory();})(commonjsGlobal$1,function(){/* ! + * type-detect + * Copyright(c) 2013 jake luer + * MIT Licensed + */var promiseExists=typeof Promise==='function';/* eslint-disable no-undef */var globalObject=typeof self==='object'?self:commonjsGlobal$1;// eslint-disable-line id-blacklist +var symbolExists=typeof Symbol!=='undefined';var mapExists=typeof Map!=='undefined';var setExists=typeof Set!=='undefined';var weakMapExists=typeof WeakMap!=='undefined';var weakSetExists=typeof WeakSet!=='undefined';var dataViewExists=typeof DataView!=='undefined';var symbolIteratorExists=symbolExists&&typeof Symbol.iterator!=='undefined';var symbolToStringTagExists=symbolExists&&typeof Symbol.toStringTag!=='undefined';var setEntriesExists=setExists&&typeof Set.prototype.entries==='function';var mapEntriesExists=mapExists&&typeof Map.prototype.entries==='function';var setIteratorPrototype=setEntriesExists&&Object.getPrototypeOf(new Set().entries());var mapIteratorPrototype=mapEntriesExists&&Object.getPrototypeOf(new Map().entries());var arrayIteratorExists=symbolIteratorExists&&typeof Array.prototype[Symbol.iterator]==='function';var arrayIteratorPrototype=arrayIteratorExists&&Object.getPrototypeOf([][Symbol.iterator]());var stringIteratorExists=symbolIteratorExists&&typeof String.prototype[Symbol.iterator]==='function';var stringIteratorPrototype=stringIteratorExists&&Object.getPrototypeOf(''[Symbol.iterator]());var toStringLeftSliceLength=8;var toStringRightSliceLength=-1;/** + * ### typeOf (obj) + * + * Uses \`Object.prototype.toString\` to determine the type of an object, + * normalising behaviour across engine versions & well optimised. + * + * @param {Mixed} object + * @return {String} object type + * @api public + */function typeDetect(obj){/* ! Speed optimisation + * Pre: + * string literal x 3,039,035 ops/sec ±1.62% (78 runs sampled) + * boolean literal x 1,424,138 ops/sec ±4.54% (75 runs sampled) + * number literal x 1,653,153 ops/sec ±1.91% (82 runs sampled) + * undefined x 9,978,660 ops/sec ±1.92% (75 runs sampled) + * function x 2,556,769 ops/sec ±1.73% (77 runs sampled) + * Post: + * string literal x 38,564,796 ops/sec ±1.15% (79 runs sampled) + * boolean literal x 31,148,940 ops/sec ±1.10% (79 runs sampled) + * number literal x 32,679,330 ops/sec ±1.90% (78 runs sampled) + * undefined x 32,363,368 ops/sec ±1.07% (82 runs sampled) + * function x 31,296,870 ops/sec ±0.96% (83 runs sampled) + */var typeofObj=typeof obj;if(typeofObj!=='object'){return typeofObj;}/* ! Speed optimisation + * Pre: + * null x 28,645,765 ops/sec ±1.17% (82 runs sampled) + * Post: + * null x 36,428,962 ops/sec ±1.37% (84 runs sampled) + */if(obj===null){return'null';}/* ! Spec Conformance + * Test: \`Object.prototype.toString.call(window)\`\` + * - Node === "[object global]" + * - Chrome === "[object global]" + * - Firefox === "[object Window]" + * - PhantomJS === "[object Window]" + * - Safari === "[object Window]" + * - IE 11 === "[object Window]" + * - IE Edge === "[object Window]" + * Test: \`Object.prototype.toString.call(this)\`\` + * - Chrome Worker === "[object global]" + * - Firefox Worker === "[object DedicatedWorkerGlobalScope]" + * - Safari Worker === "[object DedicatedWorkerGlobalScope]" + * - IE 11 Worker === "[object WorkerGlobalScope]" + * - IE Edge Worker === "[object WorkerGlobalScope]" + */if(obj===globalObject){return'global';}/* ! Speed optimisation + * Pre: + * array literal x 2,888,352 ops/sec ±0.67% (82 runs sampled) + * Post: + * array literal x 22,479,650 ops/sec ±0.96% (81 runs sampled) + */if(Array.isArray(obj)&&(symbolToStringTagExists===false||!(Symbol.toStringTag in obj))){return'Array';}// Not caching existence of \`window\` and related properties due to potential +// for \`window\` to be unset before tests in quasi-browser environments. +if(typeof window==='object'&&window!==null){/* ! Spec Conformance + * (https://html.spec.whatwg.org/multipage/browsers.html#location) + * WhatWG HTML$7.7.3 - The \`Location\` interface + * Test: \`Object.prototype.toString.call(window.location)\`\` + * - IE <=11 === "[object Object]" + * - IE Edge <=13 === "[object Object]" + */if(typeof window.location==='object'&&obj===window.location){return'Location';}/* ! Spec Conformance + * (https://html.spec.whatwg.org/#document) + * WhatWG HTML$3.1.1 - The \`Document\` object + * Note: Most browsers currently adher to the W3C DOM Level 2 spec + * (https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26809268) + * which suggests that browsers should use HTMLTableCellElement for + * both TD and TH elements. WhatWG separates these. + * WhatWG HTML states: + * > For historical reasons, Window objects must also have a + * > writable, configurable, non-enumerable property named + * > HTMLDocument whose value is the Document interface object. + * Test: \`Object.prototype.toString.call(document)\`\` + * - Chrome === "[object HTMLDocument]" + * - Firefox === "[object HTMLDocument]" + * - Safari === "[object HTMLDocument]" + * - IE <=10 === "[object Document]" + * - IE 11 === "[object HTMLDocument]" + * - IE Edge <=13 === "[object HTMLDocument]" + */if(typeof window.document==='object'&&obj===window.document){return'Document';}if(typeof window.navigator==='object'){/* ! Spec Conformance + * (https://html.spec.whatwg.org/multipage/webappapis.html#mimetypearray) + * WhatWG HTML$8.6.1.5 - Plugins - Interface MimeTypeArray + * Test: \`Object.prototype.toString.call(navigator.mimeTypes)\`\` + * - IE <=10 === "[object MSMimeTypesCollection]" + */if(typeof window.navigator.mimeTypes==='object'&&obj===window.navigator.mimeTypes){return'MimeTypeArray';}/* ! Spec Conformance + * (https://html.spec.whatwg.org/multipage/webappapis.html#pluginarray) + * WhatWG HTML$8.6.1.5 - Plugins - Interface PluginArray + * Test: \`Object.prototype.toString.call(navigator.plugins)\`\` + * - IE <=10 === "[object MSPluginsCollection]" + */if(typeof window.navigator.plugins==='object'&&obj===window.navigator.plugins){return'PluginArray';}}if((typeof window.HTMLElement==='function'||typeof window.HTMLElement==='object')&&obj instanceof window.HTMLElement){/* ! Spec Conformance + * (https://html.spec.whatwg.org/multipage/webappapis.html#pluginarray) + * WhatWG HTML$4.4.4 - The \`blockquote\` element - Interface \`HTMLQuoteElement\` + * Test: \`Object.prototype.toString.call(document.createElement('blockquote'))\`\` + * - IE <=10 === "[object HTMLBlockElement]" + */if(obj.tagName==='BLOCKQUOTE'){return'HTMLQuoteElement';}/* ! Spec Conformance + * (https://html.spec.whatwg.org/#htmltabledatacellelement) + * WhatWG HTML$4.9.9 - The \`td\` element - Interface \`HTMLTableDataCellElement\` + * Note: Most browsers currently adher to the W3C DOM Level 2 spec + * (https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-82915075) + * which suggests that browsers should use HTMLTableCellElement for + * both TD and TH elements. WhatWG separates these. + * Test: Object.prototype.toString.call(document.createElement('td')) + * - Chrome === "[object HTMLTableCellElement]" + * - Firefox === "[object HTMLTableCellElement]" + * - Safari === "[object HTMLTableCellElement]" + */if(obj.tagName==='TD'){return'HTMLTableDataCellElement';}/* ! Spec Conformance + * (https://html.spec.whatwg.org/#htmltableheadercellelement) + * WhatWG HTML$4.9.9 - The \`td\` element - Interface \`HTMLTableHeaderCellElement\` + * Note: Most browsers currently adher to the W3C DOM Level 2 spec + * (https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-82915075) + * which suggests that browsers should use HTMLTableCellElement for + * both TD and TH elements. WhatWG separates these. + * Test: Object.prototype.toString.call(document.createElement('th')) + * - Chrome === "[object HTMLTableCellElement]" + * - Firefox === "[object HTMLTableCellElement]" + * - Safari === "[object HTMLTableCellElement]" + */if(obj.tagName==='TH'){return'HTMLTableHeaderCellElement';}}}/* ! Speed optimisation + * Pre: + * Float64Array x 625,644 ops/sec ±1.58% (80 runs sampled) + * Float32Array x 1,279,852 ops/sec ±2.91% (77 runs sampled) + * Uint32Array x 1,178,185 ops/sec ±1.95% (83 runs sampled) + * Uint16Array x 1,008,380 ops/sec ±2.25% (80 runs sampled) + * Uint8Array x 1,128,040 ops/sec ±2.11% (81 runs sampled) + * Int32Array x 1,170,119 ops/sec ±2.88% (80 runs sampled) + * Int16Array x 1,176,348 ops/sec ±5.79% (86 runs sampled) + * Int8Array x 1,058,707 ops/sec ±4.94% (77 runs sampled) + * Uint8ClampedArray x 1,110,633 ops/sec ±4.20% (80 runs sampled) + * Post: + * Float64Array x 7,105,671 ops/sec ±13.47% (64 runs sampled) + * Float32Array x 5,887,912 ops/sec ±1.46% (82 runs sampled) + * Uint32Array x 6,491,661 ops/sec ±1.76% (79 runs sampled) + * Uint16Array x 6,559,795 ops/sec ±1.67% (82 runs sampled) + * Uint8Array x 6,463,966 ops/sec ±1.43% (85 runs sampled) + * Int32Array x 5,641,841 ops/sec ±3.49% (81 runs sampled) + * Int16Array x 6,583,511 ops/sec ±1.98% (80 runs sampled) + * Int8Array x 6,606,078 ops/sec ±1.74% (81 runs sampled) + * Uint8ClampedArray x 6,602,224 ops/sec ±1.77% (83 runs sampled) + */var stringTag=symbolToStringTagExists&&obj[Symbol.toStringTag];if(typeof stringTag==='string'){return stringTag;}var objPrototype=Object.getPrototypeOf(obj);/* ! Speed optimisation + * Pre: + * regex literal x 1,772,385 ops/sec ±1.85% (77 runs sampled) + * regex constructor x 2,143,634 ops/sec ±2.46% (78 runs sampled) + * Post: + * regex literal x 3,928,009 ops/sec ±0.65% (78 runs sampled) + * regex constructor x 3,931,108 ops/sec ±0.58% (84 runs sampled) + */if(objPrototype===RegExp.prototype){return'RegExp';}/* ! Speed optimisation + * Pre: + * date x 2,130,074 ops/sec ±4.42% (68 runs sampled) + * Post: + * date x 3,953,779 ops/sec ±1.35% (77 runs sampled) + */if(objPrototype===Date.prototype){return'Date';}/* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-promise.prototype-@@tostringtag) + * ES6$25.4.5.4 - Promise.prototype[@@toStringTag] should be "Promise": + * Test: \`Object.prototype.toString.call(Promise.resolve())\`\` + * - Chrome <=47 === "[object Object]" + * - Edge <=20 === "[object Object]" + * - Firefox 29-Latest === "[object Promise]" + * - Safari 7.1-Latest === "[object Promise]" + */if(promiseExists&&objPrototype===Promise.prototype){return'Promise';}/* ! Speed optimisation + * Pre: + * set x 2,222,186 ops/sec ±1.31% (82 runs sampled) + * Post: + * set x 4,545,879 ops/sec ±1.13% (83 runs sampled) + */if(setExists&&objPrototype===Set.prototype){return'Set';}/* ! Speed optimisation + * Pre: + * map x 2,396,842 ops/sec ±1.59% (81 runs sampled) + * Post: + * map x 4,183,945 ops/sec ±6.59% (82 runs sampled) + */if(mapExists&&objPrototype===Map.prototype){return'Map';}/* ! Speed optimisation + * Pre: + * weakset x 1,323,220 ops/sec ±2.17% (76 runs sampled) + * Post: + * weakset x 4,237,510 ops/sec ±2.01% (77 runs sampled) + */if(weakSetExists&&objPrototype===WeakSet.prototype){return'WeakSet';}/* ! Speed optimisation + * Pre: + * weakmap x 1,500,260 ops/sec ±2.02% (78 runs sampled) + * Post: + * weakmap x 3,881,384 ops/sec ±1.45% (82 runs sampled) + */if(weakMapExists&&objPrototype===WeakMap.prototype){return'WeakMap';}/* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-dataview.prototype-@@tostringtag) + * ES6$24.2.4.21 - DataView.prototype[@@toStringTag] should be "DataView": + * Test: \`Object.prototype.toString.call(new DataView(new ArrayBuffer(1)))\`\` + * - Edge <=13 === "[object Object]" + */if(dataViewExists&&objPrototype===DataView.prototype){return'DataView';}/* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%mapiteratorprototype%-@@tostringtag) + * ES6$23.1.5.2.2 - %MapIteratorPrototype%[@@toStringTag] should be "Map Iterator": + * Test: \`Object.prototype.toString.call(new Map().entries())\`\` + * - Edge <=13 === "[object Object]" + */if(mapExists&&objPrototype===mapIteratorPrototype){return'Map Iterator';}/* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%setiteratorprototype%-@@tostringtag) + * ES6$23.2.5.2.2 - %SetIteratorPrototype%[@@toStringTag] should be "Set Iterator": + * Test: \`Object.prototype.toString.call(new Set().entries())\`\` + * - Edge <=13 === "[object Object]" + */if(setExists&&objPrototype===setIteratorPrototype){return'Set Iterator';}/* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%arrayiteratorprototype%-@@tostringtag) + * ES6$22.1.5.2.2 - %ArrayIteratorPrototype%[@@toStringTag] should be "Array Iterator": + * Test: \`Object.prototype.toString.call([][Symbol.iterator]())\`\` + * - Edge <=13 === "[object Object]" + */if(arrayIteratorExists&&objPrototype===arrayIteratorPrototype){return'Array Iterator';}/* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%stringiteratorprototype%-@@tostringtag) + * ES6$21.1.5.2.2 - %StringIteratorPrototype%[@@toStringTag] should be "String Iterator": + * Test: \`Object.prototype.toString.call(''[Symbol.iterator]())\`\` + * - Edge <=13 === "[object Object]" + */if(stringIteratorExists&&objPrototype===stringIteratorPrototype){return'String Iterator';}/* ! Speed optimisation + * Pre: + * object from null x 2,424,320 ops/sec ±1.67% (76 runs sampled) + * Post: + * object from null x 5,838,000 ops/sec ±0.99% (84 runs sampled) + */if(objPrototype===null){return'Object';}return Object.prototype.toString.call(obj).slice(toStringLeftSliceLength,toStringRightSliceLength);}return typeDetect;});})(typeDetect$1);var typeDetectExports$1=typeDetect$1.exports;/*! + * Chai - expectTypes utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ /** + * ### .expectTypes(obj, types) + * + * Ensures that the object being tested against is of a valid type. + * + * utils.expectTypes(this, ['array', 'object', 'string']); + * + * @param {Mixed} obj constructed Assertion + * @param {Array} type A list of allowed types for this assertion + * @namespace Utils + * @name expectTypes + * @api public + */var AssertionError=assertionError;var flag$3=flag$5;var type$3=typeDetectExports$1;var expectTypes=function expectTypes(obj,types){var flagMsg=flag$3(obj,'message');var ssfi=flag$3(obj,'ssfi');flagMsg=flagMsg?flagMsg+': ':'';obj=flag$3(obj,'object');types=types.map(function(t){return t.toLowerCase();});types.sort();// Transforms ['lorem', 'ipsum'] into 'a lorem, or an ipsum' +var str=types.map(function(t,index){var art=~['a','e','i','o','u'].indexOf(t.charAt(0))?'an':'a';var or=types.length>1&&index===types.length-1?'or ':'';return or+art+' '+t;}).join(', ');var objType=type$3(obj).toLowerCase();if(!types.some(function(expected){return objType===expected;})){throw new AssertionError(flagMsg+'object tested must be '+str+', but '+objType+' given',undefined,ssfi);}};/*! + * Chai - getActual utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ /** + * ### .getActual(object, [actual]) + * + * Returns the \`actual\` value for an Assertion. + * + * @param {Object} object (constructed Assertion) + * @param {Arguments} chai.Assertion.prototype.assert arguments + * @namespace Utils + * @name getActual + */var getActual$1=function getActual(obj,args){return args.length>4?args[4]:obj._obj;};const require$$1=/*@__PURE__*/getAugmentedNamespace(loupe$1);var config$5={/** + * ### config.includeStack + * + * User configurable property, influences whether stack trace + * is included in Assertion error message. Default of false + * suppresses stack trace in the error message. + * + * chai.config.includeStack = true; // enable stack on error + * + * @param {Boolean} + * @api public + */includeStack:false,/** + * ### config.showDiff + * + * User configurable property, influences whether or not + * the \`showDiff\` flag should be included in the thrown + * AssertionErrors. \`false\` will always be \`false\`; \`true\` + * will be true when the assertion has requested a diff + * be shown. + * + * @param {Boolean} + * @api public + */showDiff:true,/** + * ### config.truncateThreshold + * + * User configurable property, sets length threshold for actual and + * expected values in assertion errors. If this threshold is exceeded, for + * example for large data structures, the value is replaced with something + * like \`[ Array(3) ]\` or \`{ Object (prop1, prop2) }\`. + * + * Set it to zero if you want to disable truncating altogether. + * + * This is especially userful when doing assertions on arrays: having this + * set to a reasonable large value makes the failure messages readily + * inspectable. + * + * chai.config.truncateThreshold = 0; // disable truncating + * + * @param {Number} + * @api public + */truncateThreshold:40,/** + * ### config.useProxy + * + * User configurable property, defines if chai will use a Proxy to throw + * an error when a non-existent property is read, which protects users + * from typos when using property-based assertions. + * + * Set it to false if you want to disable this feature. + * + * chai.config.useProxy = false; // disable use of Proxy + * + * This feature is automatically disabled regardless of this config value + * in environments that don't support proxies. + * + * @param {Boolean} + * @api public + */useProxy:true,/** + * ### config.proxyExcludedKeys + * + * User configurable property, defines which properties should be ignored + * instead of throwing an error if they do not exist on the assertion. + * This is only applied if the environment Chai is running in supports proxies and + * if the \`useProxy\` configuration setting is enabled. + * By default, \`then\` and \`inspect\` will not throw an error if they do not exist on the + * assertion object because the \`.inspect\` property is read by \`util.inspect\` (for example, when + * using \`console.log\` on the assertion object) and \`.then\` is necessary for promise type-checking. + * + * // By default these keys will not throw an error if they do not exist on the assertion object + * chai.config.proxyExcludedKeys = ['then', 'inspect']; + * + * @param {Array} + * @api public + */proxyExcludedKeys:['then','catch','inspect','toJSON'],/** + * ### config.deepEqual + * + * User configurable property, defines which a custom function to use for deepEqual + * comparisons. + * By default, the function used is the one from the \`deep-eql\` package without custom comparator. + * + * // use a custom comparator + * chai.config.deepEqual = (expected, actual) => { + * return chai.util.eql(expected, actual, { + * comparator: (expected, actual) => { + * // for non number comparison, use the default behavior + * if(typeof expected !== 'number') return null; + * // allow a difference of 10 between compared numbers + * return typeof actual === 'number' && Math.abs(actual - expected) < 10 + * } + * }) + * }; + * + * @param {Function} + * @api public + */deepEqual:null};var loupe=require$$1;var config$4=config$5;var inspect_1=inspect$2;/** + * ### .inspect(obj, [showHidden], [depth], [colors]) + * + * Echoes the value of a value. Tries to print the value out + * in the best way possible given the different types. + * + * @param {Object} obj The object to print out. + * @param {Boolean} showHidden Flag that shows hidden (not enumerable) + * properties of objects. Default is false. + * @param {Number} depth Depth in which to descend in object. Default is 2. + * @param {Boolean} colors Flag to turn on ANSI escape codes to color the + * output. Default is false (no coloring). + * @namespace Utils + * @name inspect + */function inspect$2(obj,showHidden,depth,colors){var options={colors:colors,depth:typeof depth==='undefined'?2:depth,showHidden:showHidden,truncate:config$4.truncateThreshold?config$4.truncateThreshold:Infinity};return loupe.inspect(obj,options);}/*! + * Chai - flag utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ /*! + * Module dependencies + */var inspect$1=inspect_1;var config$3=config$5;/** + * ### .objDisplay(object) + * + * Determines if an object or an array matches + * criteria to be inspected in-line for error + * messages or should be truncated. + * + * @param {Mixed} javascript object to inspect + * @returns {string} stringified object + * @name objDisplay + * @namespace Utils + * @api public + */var objDisplay$1=function objDisplay(obj){var str=inspect$1(obj),type=Object.prototype.toString.call(obj);if(config$3.truncateThreshold&&str.length>=config$3.truncateThreshold){if(type==='[object Function]'){return!obj.name||obj.name===''?'[Function]':'[Function: '+obj.name+']';}else if(type==='[object Array]'){return'[ Array('+obj.length+') ]';}else if(type==='[object Object]'){var keys=Object.keys(obj),kstr=keys.length>2?keys.splice(0,2).join(', ')+', ...':keys.join(', ');return'{ Object ('+kstr+') }';}else{return str;}}else{return str;}};/*! + * Chai - message composition utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ /*! + * Module dependencies + */var flag$2=flag$5,getActual=getActual$1,objDisplay=objDisplay$1;/** + * ### .getMessage(object, message, negateMessage) + * + * Construct the error message based on flags + * and template tags. Template tags will return + * a stringified inspection of the object referenced. + * + * Message template tags: + * - \`#{this}\` current asserted object + * - \`#{act}\` actual value + * - \`#{exp}\` expected value + * + * @param {Object} object (constructed Assertion) + * @param {Arguments} chai.Assertion.prototype.assert arguments + * @namespace Utils + * @name getMessage + * @api public + */var getMessage$1=function getMessage(obj,args){var negate=flag$2(obj,'negate'),val=flag$2(obj,'object'),expected=args[3],actual=getActual(obj,args),msg=negate?args[2]:args[1],flagMsg=flag$2(obj,'message');if(typeof msg==="function")msg=msg();msg=msg||'';msg=msg.replace(/#\\{this\\}/g,function(){return objDisplay(val);}).replace(/#\\{act\\}/g,function(){return objDisplay(actual);}).replace(/#\\{exp\\}/g,function(){return objDisplay(expected);});return flagMsg?flagMsg+': '+msg:msg;};/*! + * Chai - transferFlags utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ /** + * ### .transferFlags(assertion, object, includeAll = true) + * + * Transfer all the flags for \`assertion\` to \`object\`. If + * \`includeAll\` is set to \`false\`, then the base Chai + * assertion flags (namely \`object\`, \`ssfi\`, \`lockSsfi\`, + * and \`message\`) will not be transferred. + * + * + * var newAssertion = new Assertion(); + * utils.transferFlags(assertion, newAssertion); + * + * var anotherAssertion = new Assertion(myObj); + * utils.transferFlags(assertion, anotherAssertion, false); + * + * @param {Assertion} assertion the assertion to transfer the flags from + * @param {Object} object the object to transfer the flags to; usually a new assertion + * @param {Boolean} includeAll + * @namespace Utils + * @name transferFlags + * @api private + */var transferFlags=function transferFlags(assertion,object,includeAll){var flags=assertion.__flags||(assertion.__flags=Object.create(null));if(!object.__flags){object.__flags=Object.create(null);}includeAll=arguments.length===3?includeAll:true;for(var flag in flags){if(includeAll||flag!=='object'&&flag!=='ssfi'&&flag!=='lockSsfi'&&flag!='message'){object.__flags[flag]=flags[flag];}}};var deepEql={exports:{}};/* globals Symbol: false, Uint8Array: false, WeakMap: false */ /*! + * deep-eql + * Copyright(c) 2013 Jake Luer + * MIT Licensed + */var type$2=typeDetectExports$1;function FakeMap(){this._key='chai/deep-eql__'+Math.random()+Date.now();}FakeMap.prototype={get:function get(key){return key[this._key];},set:function set(key,value){if(Object.isExtensible(key)){Object.defineProperty(key,this._key,{value:value,configurable:true});}}};var MemoizeMap=typeof WeakMap==='function'?WeakMap:FakeMap;/*! + * Check to see if the MemoizeMap has recorded a result of the two operands + * + * @param {Mixed} leftHandOperand + * @param {Mixed} rightHandOperand + * @param {MemoizeMap} memoizeMap + * @returns {Boolean|null} result +*/function memoizeCompare(leftHandOperand,rightHandOperand,memoizeMap){// Technically, WeakMap keys can *only* be objects, not primitives. +if(!memoizeMap||isPrimitive$1(leftHandOperand)||isPrimitive$1(rightHandOperand)){return null;}var leftHandMap=memoizeMap.get(leftHandOperand);if(leftHandMap){var result=leftHandMap.get(rightHandOperand);if(typeof result==='boolean'){return result;}}return null;}/*! + * Set the result of the equality into the MemoizeMap + * + * @param {Mixed} leftHandOperand + * @param {Mixed} rightHandOperand + * @param {MemoizeMap} memoizeMap + * @param {Boolean} result +*/function memoizeSet(leftHandOperand,rightHandOperand,memoizeMap,result){// Technically, WeakMap keys can *only* be objects, not primitives. +if(!memoizeMap||isPrimitive$1(leftHandOperand)||isPrimitive$1(rightHandOperand)){return;}var leftHandMap=memoizeMap.get(leftHandOperand);if(leftHandMap){leftHandMap.set(rightHandOperand,result);}else{leftHandMap=new MemoizeMap();leftHandMap.set(rightHandOperand,result);memoizeMap.set(leftHandOperand,leftHandMap);}}/*! + * Primary Export + */deepEql.exports=deepEqual;deepEql.exports.MemoizeMap=MemoizeMap;/** + * Assert deeply nested sameValue equality between two objects of any type. + * + * @param {Mixed} leftHandOperand + * @param {Mixed} rightHandOperand + * @param {Object} [options] (optional) Additional options + * @param {Array} [options.comparator] (optional) Override default algorithm, determining custom equality. + * @param {Array} [options.memoize] (optional) Provide a custom memoization object which will cache the results of + complex objects for a speed boost. By passing \`false\` you can disable memoization, but this will cause circular + references to blow the stack. + * @return {Boolean} equal match + */function deepEqual(leftHandOperand,rightHandOperand,options){// If we have a comparator, we can't assume anything; so bail to its check first. +if(options&&options.comparator){return extensiveDeepEqual(leftHandOperand,rightHandOperand,options);}var simpleResult=simpleEqual(leftHandOperand,rightHandOperand);if(simpleResult!==null){return simpleResult;}// Deeper comparisons are pushed through to a larger function +return extensiveDeepEqual(leftHandOperand,rightHandOperand,options);}/** + * Many comparisons can be canceled out early via simple equality or primitive checks. + * @param {Mixed} leftHandOperand + * @param {Mixed} rightHandOperand + * @return {Boolean|null} equal match + */function simpleEqual(leftHandOperand,rightHandOperand){// Equal references (except for Numbers) can be returned early +if(leftHandOperand===rightHandOperand){// Handle +-0 cases +return leftHandOperand!==0||1/leftHandOperand===1/rightHandOperand;}// handle NaN cases +if(leftHandOperand!==leftHandOperand&&// eslint-disable-line no-self-compare +rightHandOperand!==rightHandOperand// eslint-disable-line no-self-compare +){return true;}// Anything that is not an 'object', i.e. symbols, functions, booleans, numbers, +// strings, and undefined, can be compared by reference. +if(isPrimitive$1(leftHandOperand)||isPrimitive$1(rightHandOperand)){// Easy out b/c it would have passed the first equality check +return false;}return null;}/*! + * The main logic of the \`deepEqual\` function. + * + * @param {Mixed} leftHandOperand + * @param {Mixed} rightHandOperand + * @param {Object} [options] (optional) Additional options + * @param {Array} [options.comparator] (optional) Override default algorithm, determining custom equality. + * @param {Array} [options.memoize] (optional) Provide a custom memoization object which will cache the results of + complex objects for a speed boost. By passing \`false\` you can disable memoization, but this will cause circular + references to blow the stack. + * @return {Boolean} equal match +*/function extensiveDeepEqual(leftHandOperand,rightHandOperand,options){options=options||{};options.memoize=options.memoize===false?false:options.memoize||new MemoizeMap();var comparator=options&&options.comparator;// Check if a memoized result exists. +var memoizeResultLeft=memoizeCompare(leftHandOperand,rightHandOperand,options.memoize);if(memoizeResultLeft!==null){return memoizeResultLeft;}var memoizeResultRight=memoizeCompare(rightHandOperand,leftHandOperand,options.memoize);if(memoizeResultRight!==null){return memoizeResultRight;}// If a comparator is present, use it. +if(comparator){var comparatorResult=comparator(leftHandOperand,rightHandOperand);// Comparators may return null, in which case we want to go back to default behavior. +if(comparatorResult===false||comparatorResult===true){memoizeSet(leftHandOperand,rightHandOperand,options.memoize,comparatorResult);return comparatorResult;}// To allow comparators to override *any* behavior, we ran them first. Since it didn't decide +// what to do, we need to make sure to return the basic tests first before we move on. +var simpleResult=simpleEqual(leftHandOperand,rightHandOperand);if(simpleResult!==null){// Don't memoize this, it takes longer to set/retrieve than to just compare. +return simpleResult;}}var leftHandType=type$2(leftHandOperand);if(leftHandType!==type$2(rightHandOperand)){memoizeSet(leftHandOperand,rightHandOperand,options.memoize,false);return false;}// Temporarily set the operands in the memoize object to prevent blowing the stack +memoizeSet(leftHandOperand,rightHandOperand,options.memoize,true);var result=extensiveDeepEqualByType(leftHandOperand,rightHandOperand,leftHandType,options);memoizeSet(leftHandOperand,rightHandOperand,options.memoize,result);return result;}function extensiveDeepEqualByType(leftHandOperand,rightHandOperand,leftHandType,options){switch(leftHandType){case'String':case'Number':case'Boolean':case'Date':// If these types are their instance types (e.g. \`new Number\`) then re-deepEqual against their values +return deepEqual(leftHandOperand.valueOf(),rightHandOperand.valueOf());case'Promise':case'Symbol':case'function':case'WeakMap':case'WeakSet':return leftHandOperand===rightHandOperand;case'Error':return keysEqual(leftHandOperand,rightHandOperand,['name','message','code'],options);case'Arguments':case'Int8Array':case'Uint8Array':case'Uint8ClampedArray':case'Int16Array':case'Uint16Array':case'Int32Array':case'Uint32Array':case'Float32Array':case'Float64Array':case'Array':return iterableEqual(leftHandOperand,rightHandOperand,options);case'RegExp':return regexpEqual(leftHandOperand,rightHandOperand);case'Generator':return generatorEqual(leftHandOperand,rightHandOperand,options);case'DataView':return iterableEqual(new Uint8Array(leftHandOperand.buffer),new Uint8Array(rightHandOperand.buffer),options);case'ArrayBuffer':return iterableEqual(new Uint8Array(leftHandOperand),new Uint8Array(rightHandOperand),options);case'Set':return entriesEqual(leftHandOperand,rightHandOperand,options);case'Map':return entriesEqual(leftHandOperand,rightHandOperand,options);case'Temporal.PlainDate':case'Temporal.PlainTime':case'Temporal.PlainDateTime':case'Temporal.Instant':case'Temporal.ZonedDateTime':case'Temporal.PlainYearMonth':case'Temporal.PlainMonthDay':return leftHandOperand.equals(rightHandOperand);case'Temporal.Duration':return leftHandOperand.total('nanoseconds')===rightHandOperand.total('nanoseconds');case'Temporal.TimeZone':case'Temporal.Calendar':return leftHandOperand.toString()===rightHandOperand.toString();default:return objectEqual(leftHandOperand,rightHandOperand,options);}}/*! + * Compare two Regular Expressions for equality. + * + * @param {RegExp} leftHandOperand + * @param {RegExp} rightHandOperand + * @return {Boolean} result + */function regexpEqual(leftHandOperand,rightHandOperand){return leftHandOperand.toString()===rightHandOperand.toString();}/*! + * Compare two Sets/Maps for equality. Faster than other equality functions. + * + * @param {Set} leftHandOperand + * @param {Set} rightHandOperand + * @param {Object} [options] (Optional) + * @return {Boolean} result + */function entriesEqual(leftHandOperand,rightHandOperand,options){// IE11 doesn't support Set#entries or Set#@@iterator, so we need manually populate using Set#forEach +if(leftHandOperand.size!==rightHandOperand.size){return false;}if(leftHandOperand.size===0){return true;}var leftHandItems=[];var rightHandItems=[];leftHandOperand.forEach(function gatherEntries(key,value){leftHandItems.push([key,value]);});rightHandOperand.forEach(function gatherEntries(key,value){rightHandItems.push([key,value]);});return iterableEqual(leftHandItems.sort(),rightHandItems.sort(),options);}/*! + * Simple equality for flat iterable objects such as Arrays, TypedArrays or Node.js buffers. + * + * @param {Iterable} leftHandOperand + * @param {Iterable} rightHandOperand + * @param {Object} [options] (Optional) + * @return {Boolean} result + */function iterableEqual(leftHandOperand,rightHandOperand,options){var length=leftHandOperand.length;if(length!==rightHandOperand.length){return false;}if(length===0){return true;}var index=-1;while(++index + * MIT Licensed + */ /** + * ### .isProxyEnabled() + * + * Helper function to check if Chai's proxy protection feature is enabled. If + * proxies are unsupported or disabled via the user's Chai config, then return + * false. Otherwise, return true. + * + * @namespace Utils + * @name isProxyEnabled + */var isProxyEnabled$1=function isProxyEnabled(){return config$2.useProxy&&typeof Proxy!=='undefined'&&typeof Reflect!=='undefined';};/*! + * Chai - addProperty utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */var addProperty;var hasRequiredAddProperty;function requireAddProperty(){if(hasRequiredAddProperty)return addProperty;hasRequiredAddProperty=1;var chai=requireChai();var flag=flag$5;var isProxyEnabled=isProxyEnabled$1;var transferFlags$1=transferFlags;/** + * ### .addProperty(ctx, name, getter) + * + * Adds a property to the prototype of an object. + * + * utils.addProperty(chai.Assertion.prototype, 'foo', function () { + * var obj = utils.flag(this, 'object'); + * new chai.Assertion(obj).to.be.instanceof(Foo); + * }); + * + * Can also be accessed directly from \`chai.Assertion\`. + * + * chai.Assertion.addProperty('foo', fn); + * + * Then can be used as any other assertion. + * + * expect(myFoo).to.be.foo; + * + * @param {Object} ctx object to which the property is added + * @param {String} name of property to add + * @param {Function} getter function to be used for name + * @namespace Utils + * @name addProperty + * @api public + */addProperty=function addProperty(ctx,name,getter){getter=getter===undefined?function(){}:getter;Object.defineProperty(ctx,name,{get:function propertyGetter(){// Setting the \`ssfi\` flag to \`propertyGetter\` causes this function to +// be the starting point for removing implementation frames from the +// stack trace of a failed assertion. +// +// However, we only want to use this function as the starting point if +// the \`lockSsfi\` flag isn't set and proxy protection is disabled. +// +// If the \`lockSsfi\` flag is set, then either this assertion has been +// overwritten by another assertion, or this assertion is being invoked +// from inside of another assertion. In the first case, the \`ssfi\` flag +// has already been set by the overwriting assertion. In the second +// case, the \`ssfi\` flag has already been set by the outer assertion. +// +// If proxy protection is enabled, then the \`ssfi\` flag has already been +// set by the proxy getter. +if(!isProxyEnabled()&&!flag(this,'lockSsfi')){flag(this,'ssfi',propertyGetter);}var result=getter.call(this);if(result!==undefined)return result;var newAssertion=new chai.Assertion();transferFlags$1(this,newAssertion);return newAssertion;},configurable:true});};return addProperty;}var fnLengthDesc=Object.getOwnPropertyDescriptor(function(){},'length');/*! + * Chai - addLengthGuard utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ /** + * ### .addLengthGuard(fn, assertionName, isChainable) + * + * Define \`length\` as a getter on the given uninvoked method assertion. The + * getter acts as a guard against chaining \`length\` directly off of an uninvoked + * method assertion, which is a problem because it references \`function\`'s + * built-in \`length\` property instead of Chai's \`length\` assertion. When the + * getter catches the user making this mistake, it throws an error with a + * helpful message. + * + * There are two ways in which this mistake can be made. The first way is by + * chaining the \`length\` assertion directly off of an uninvoked chainable + * method. In this case, Chai suggests that the user use \`lengthOf\` instead. The + * second way is by chaining the \`length\` assertion directly off of an uninvoked + * non-chainable method. Non-chainable methods must be invoked prior to + * chaining. In this case, Chai suggests that the user consult the docs for the + * given assertion. + * + * If the \`length\` property of functions is unconfigurable, then return \`fn\` + * without modification. + * + * Note that in ES6, the function's \`length\` property is configurable, so once + * support for legacy environments is dropped, Chai's \`length\` property can + * replace the built-in function's \`length\` property, and this length guard will + * no longer be necessary. In the mean time, maintaining consistency across all + * environments is the priority. + * + * @param {Function} fn + * @param {String} assertionName + * @param {Boolean} isChainable + * @namespace Utils + * @name addLengthGuard + */var addLengthGuard=function addLengthGuard(fn,assertionName,isChainable){if(!fnLengthDesc.configurable)return fn;Object.defineProperty(fn,'length',{get:function(){if(isChainable){throw Error('Invalid Chai property: '+assertionName+'.length. Due'+' to a compatibility issue, "length" cannot directly follow "'+assertionName+'". Use "'+assertionName+'.lengthOf" instead.');}throw Error('Invalid Chai property: '+assertionName+'.length. See'+' docs for proper usage of "'+assertionName+'".');}});return fn;};/*! + * Chai - getProperties utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ /** + * ### .getProperties(object) + * + * This allows the retrieval of property names of an object, enumerable or not, + * inherited or not. + * + * @param {Object} object + * @returns {Array} + * @namespace Utils + * @name getProperties + * @api public + */var getProperties$1=function getProperties(object){var result=Object.getOwnPropertyNames(object);function addProperty(property){if(result.indexOf(property)===-1){result.push(property);}}var proto=Object.getPrototypeOf(object);while(proto!==null){Object.getOwnPropertyNames(proto).forEach(addProperty);proto=Object.getPrototypeOf(proto);}return result;};var config$1=config$5;var flag$1=flag$5;var getProperties=getProperties$1;var isProxyEnabled=isProxyEnabled$1;/*! + * Chai - proxify utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ /** + * ### .proxify(object) + * + * Return a proxy of given object that throws an error when a non-existent + * property is read. By default, the root cause is assumed to be a misspelled + * property, and thus an attempt is made to offer a reasonable suggestion from + * the list of existing properties. However, if a nonChainableMethodName is + * provided, then the root cause is instead a failure to invoke a non-chainable + * method prior to reading the non-existent property. + * + * If proxies are unsupported or disabled via the user's Chai config, then + * return object without modification. + * + * @param {Object} obj + * @param {String} nonChainableMethodName + * @namespace Utils + * @name proxify + */var builtins=['__flags','__methods','_obj','assert'];var proxify=function proxify(obj,nonChainableMethodName){if(!isProxyEnabled())return obj;return new Proxy(obj,{get:function proxyGetter(target,property){// This check is here because we should not throw errors on Symbol properties +// such as \`Symbol.toStringTag\`. +// The values for which an error should be thrown can be configured using +// the \`config.proxyExcludedKeys\` setting. +if(typeof property==='string'&&config$1.proxyExcludedKeys.indexOf(property)===-1&&!Reflect.has(target,property)){// Special message for invalid property access of non-chainable methods. +if(nonChainableMethodName){throw Error('Invalid Chai property: '+nonChainableMethodName+'.'+property+'. See docs for proper usage of "'+nonChainableMethodName+'".');}// If the property is reasonably close to an existing Chai property, +// suggest that property to the user. Only suggest properties with a +// distance less than 4. +var suggestion=null;var suggestionDistance=4;getProperties(target).forEach(function(prop){if(!Object.prototype.hasOwnProperty(prop)&&builtins.indexOf(prop)===-1){var dist=stringDistanceCapped(property,prop,suggestionDistance);if(dist=cap){return cap;}var memo=[];// \`memo\` is a two-dimensional array containing distances. +// memo[i][j] is the distance between strA.slice(0, i) and +// strB.slice(0, j). +for(var i=0;i<=strA.length;i++){memo[i]=Array(strB.length+1).fill(0);memo[i][0]=i;}for(var j=0;j=cap){memo[i][j]=cap;continue;}memo[i][j]=Math.min(memo[i-1][j]+1,memo[i][j-1]+1,memo[i-1][j-1]+(ch===strB.charCodeAt(j-1)?0:1));}}return memo[strA.length][strB.length];}/*! + * Chai - addMethod utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */var addMethod;var hasRequiredAddMethod;function requireAddMethod(){if(hasRequiredAddMethod)return addMethod;hasRequiredAddMethod=1;var addLengthGuard$1=addLengthGuard;var chai=requireChai();var flag=flag$5;var proxify$1=proxify;var transferFlags$1=transferFlags;/** + * ### .addMethod(ctx, name, method) + * + * Adds a method to the prototype of an object. + * + * utils.addMethod(chai.Assertion.prototype, 'foo', function (str) { + * var obj = utils.flag(this, 'object'); + * new chai.Assertion(obj).to.be.equal(str); + * }); + * + * Can also be accessed directly from \`chai.Assertion\`. + * + * chai.Assertion.addMethod('foo', fn); + * + * Then can be used as any other assertion. + * + * expect(fooStr).to.be.foo('bar'); + * + * @param {Object} ctx object to which the method is added + * @param {String} name of method to add + * @param {Function} method function to be used for name + * @namespace Utils + * @name addMethod + * @api public + */addMethod=function addMethod(ctx,name,method){var methodWrapper=function(){// Setting the \`ssfi\` flag to \`methodWrapper\` causes this function to be the +// starting point for removing implementation frames from the stack trace of +// a failed assertion. +// +// However, we only want to use this function as the starting point if the +// \`lockSsfi\` flag isn't set. +// +// If the \`lockSsfi\` flag is set, then either this assertion has been +// overwritten by another assertion, or this assertion is being invoked from +// inside of another assertion. In the first case, the \`ssfi\` flag has +// already been set by the overwriting assertion. In the second case, the +// \`ssfi\` flag has already been set by the outer assertion. +if(!flag(this,'lockSsfi')){flag(this,'ssfi',methodWrapper);}var result=method.apply(this,arguments);if(result!==undefined)return result;var newAssertion=new chai.Assertion();transferFlags$1(this,newAssertion);return newAssertion;};addLengthGuard$1(methodWrapper,name,false);ctx[name]=proxify$1(methodWrapper,name);};return addMethod;}/*! + * Chai - overwriteProperty utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */var overwriteProperty;var hasRequiredOverwriteProperty;function requireOverwriteProperty(){if(hasRequiredOverwriteProperty)return overwriteProperty;hasRequiredOverwriteProperty=1;var chai=requireChai();var flag=flag$5;var isProxyEnabled=isProxyEnabled$1;var transferFlags$1=transferFlags;/** + * ### .overwriteProperty(ctx, name, fn) + * + * Overwrites an already existing property getter and provides + * access to previous value. Must return function to use as getter. + * + * utils.overwriteProperty(chai.Assertion.prototype, 'ok', function (_super) { + * return function () { + * var obj = utils.flag(this, 'object'); + * if (obj instanceof Foo) { + * new chai.Assertion(obj.name).to.equal('bar'); + * } else { + * _super.call(this); + * } + * } + * }); + * + * + * Can also be accessed directly from \`chai.Assertion\`. + * + * chai.Assertion.overwriteProperty('foo', fn); + * + * Then can be used as any other assertion. + * + * expect(myFoo).to.be.ok; + * + * @param {Object} ctx object whose property is to be overwritten + * @param {String} name of property to overwrite + * @param {Function} getter function that returns a getter function to be used for name + * @namespace Utils + * @name overwriteProperty + * @api public + */overwriteProperty=function overwriteProperty(ctx,name,getter){var _get=Object.getOwnPropertyDescriptor(ctx,name),_super=function(){};if(_get&&'function'===typeof _get.get)_super=_get.get;Object.defineProperty(ctx,name,{get:function overwritingPropertyGetter(){// Setting the \`ssfi\` flag to \`overwritingPropertyGetter\` causes this +// function to be the starting point for removing implementation frames +// from the stack trace of a failed assertion. +// +// However, we only want to use this function as the starting point if +// the \`lockSsfi\` flag isn't set and proxy protection is disabled. +// +// If the \`lockSsfi\` flag is set, then either this assertion has been +// overwritten by another assertion, or this assertion is being invoked +// from inside of another assertion. In the first case, the \`ssfi\` flag +// has already been set by the overwriting assertion. In the second +// case, the \`ssfi\` flag has already been set by the outer assertion. +// +// If proxy protection is enabled, then the \`ssfi\` flag has already been +// set by the proxy getter. +if(!isProxyEnabled()&&!flag(this,'lockSsfi')){flag(this,'ssfi',overwritingPropertyGetter);}// Setting the \`lockSsfi\` flag to \`true\` prevents the overwritten +// assertion from changing the \`ssfi\` flag. By this point, the \`ssfi\` +// flag is already set to the correct starting point for this assertion. +var origLockSsfi=flag(this,'lockSsfi');flag(this,'lockSsfi',true);var result=getter(_super).call(this);flag(this,'lockSsfi',origLockSsfi);if(result!==undefined){return result;}var newAssertion=new chai.Assertion();transferFlags$1(this,newAssertion);return newAssertion;},configurable:true});};return overwriteProperty;}/*! + * Chai - overwriteMethod utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */var overwriteMethod;var hasRequiredOverwriteMethod;function requireOverwriteMethod(){if(hasRequiredOverwriteMethod)return overwriteMethod;hasRequiredOverwriteMethod=1;var addLengthGuard$1=addLengthGuard;var chai=requireChai();var flag=flag$5;var proxify$1=proxify;var transferFlags$1=transferFlags;/** + * ### .overwriteMethod(ctx, name, fn) + * + * Overwrites an already existing method and provides + * access to previous function. Must return function + * to be used for name. + * + * utils.overwriteMethod(chai.Assertion.prototype, 'equal', function (_super) { + * return function (str) { + * var obj = utils.flag(this, 'object'); + * if (obj instanceof Foo) { + * new chai.Assertion(obj.value).to.equal(str); + * } else { + * _super.apply(this, arguments); + * } + * } + * }); + * + * Can also be accessed directly from \`chai.Assertion\`. + * + * chai.Assertion.overwriteMethod('foo', fn); + * + * Then can be used as any other assertion. + * + * expect(myFoo).to.equal('bar'); + * + * @param {Object} ctx object whose method is to be overwritten + * @param {String} name of method to overwrite + * @param {Function} method function that returns a function to be used for name + * @namespace Utils + * @name overwriteMethod + * @api public + */overwriteMethod=function overwriteMethod(ctx,name,method){var _method=ctx[name],_super=function(){throw new Error(name+' is not a function');};if(_method&&'function'===typeof _method)_super=_method;var overwritingMethodWrapper=function(){// Setting the \`ssfi\` flag to \`overwritingMethodWrapper\` causes this +// function to be the starting point for removing implementation frames from +// the stack trace of a failed assertion. +// +// However, we only want to use this function as the starting point if the +// \`lockSsfi\` flag isn't set. +// +// If the \`lockSsfi\` flag is set, then either this assertion has been +// overwritten by another assertion, or this assertion is being invoked from +// inside of another assertion. In the first case, the \`ssfi\` flag has +// already been set by the overwriting assertion. In the second case, the +// \`ssfi\` flag has already been set by the outer assertion. +if(!flag(this,'lockSsfi')){flag(this,'ssfi',overwritingMethodWrapper);}// Setting the \`lockSsfi\` flag to \`true\` prevents the overwritten assertion +// from changing the \`ssfi\` flag. By this point, the \`ssfi\` flag is already +// set to the correct starting point for this assertion. +var origLockSsfi=flag(this,'lockSsfi');flag(this,'lockSsfi',true);var result=method(_super).apply(this,arguments);flag(this,'lockSsfi',origLockSsfi);if(result!==undefined){return result;}var newAssertion=new chai.Assertion();transferFlags$1(this,newAssertion);return newAssertion;};addLengthGuard$1(overwritingMethodWrapper,name,false);ctx[name]=proxify$1(overwritingMethodWrapper,name);};return overwriteMethod;}/*! + * Chai - addChainingMethod utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */var addChainableMethod;var hasRequiredAddChainableMethod;function requireAddChainableMethod(){if(hasRequiredAddChainableMethod)return addChainableMethod;hasRequiredAddChainableMethod=1;/*! + * Module dependencies + */var addLengthGuard$1=addLengthGuard;var chai=requireChai();var flag=flag$5;var proxify$1=proxify;var transferFlags$1=transferFlags;/*! + * Module variables + */ // Check whether \`Object.setPrototypeOf\` is supported +var canSetPrototype=typeof Object.setPrototypeOf==='function';// Without \`Object.setPrototypeOf\` support, this module will need to add properties to a function. +// However, some of functions' own props are not configurable and should be skipped. +var testFn=function(){};var excludeNames=Object.getOwnPropertyNames(testFn).filter(function(name){var propDesc=Object.getOwnPropertyDescriptor(testFn,name);// Note: PhantomJS 1.x includes \`callee\` as one of \`testFn\`'s own properties, +// but then returns \`undefined\` as the property descriptor for \`callee\`. As a +// workaround, we perform an otherwise unnecessary type-check for \`propDesc\`, +// and then filter it out if it's not an object as it should be. +if(typeof propDesc!=='object')return true;return!propDesc.configurable;});// Cache \`Function\` properties +var call=Function.prototype.call,apply=Function.prototype.apply;/** + * ### .addChainableMethod(ctx, name, method, chainingBehavior) + * + * Adds a method to an object, such that the method can also be chained. + * + * utils.addChainableMethod(chai.Assertion.prototype, 'foo', function (str) { + * var obj = utils.flag(this, 'object'); + * new chai.Assertion(obj).to.be.equal(str); + * }); + * + * Can also be accessed directly from \`chai.Assertion\`. + * + * chai.Assertion.addChainableMethod('foo', fn, chainingBehavior); + * + * The result can then be used as both a method assertion, executing both \`method\` and + * \`chainingBehavior\`, or as a language chain, which only executes \`chainingBehavior\`. + * + * expect(fooStr).to.be.foo('bar'); + * expect(fooStr).to.be.foo.equal('foo'); + * + * @param {Object} ctx object to which the method is added + * @param {String} name of method to add + * @param {Function} method function to be used for \`name\`, when called + * @param {Function} chainingBehavior function to be called every time the property is accessed + * @namespace Utils + * @name addChainableMethod + * @api public + */addChainableMethod=function addChainableMethod(ctx,name,method,chainingBehavior){if(typeof chainingBehavior!=='function'){chainingBehavior=function(){};}var chainableBehavior={method:method,chainingBehavior:chainingBehavior};// save the methods so we can overwrite them later, if we need to. +if(!ctx.__methods){ctx.__methods={};}ctx.__methods[name]=chainableBehavior;Object.defineProperty(ctx,name,{get:function chainableMethodGetter(){chainableBehavior.chainingBehavior.call(this);var chainableMethodWrapper=function(){// Setting the \`ssfi\` flag to \`chainableMethodWrapper\` causes this +// function to be the starting point for removing implementation +// frames from the stack trace of a failed assertion. +// +// However, we only want to use this function as the starting point if +// the \`lockSsfi\` flag isn't set. +// +// If the \`lockSsfi\` flag is set, then this assertion is being +// invoked from inside of another assertion. In this case, the \`ssfi\` +// flag has already been set by the outer assertion. +// +// Note that overwriting a chainable method merely replaces the saved +// methods in \`ctx.__methods\` instead of completely replacing the +// overwritten assertion. Therefore, an overwriting assertion won't +// set the \`ssfi\` or \`lockSsfi\` flags. +if(!flag(this,'lockSsfi')){flag(this,'ssfi',chainableMethodWrapper);}var result=chainableBehavior.method.apply(this,arguments);if(result!==undefined){return result;}var newAssertion=new chai.Assertion();transferFlags$1(this,newAssertion);return newAssertion;};addLengthGuard$1(chainableMethodWrapper,name,true);// Use \`Object.setPrototypeOf\` if available +if(canSetPrototype){// Inherit all properties from the object by replacing the \`Function\` prototype +var prototype=Object.create(this);// Restore the \`call\` and \`apply\` methods from \`Function\` +prototype.call=call;prototype.apply=apply;Object.setPrototypeOf(chainableMethodWrapper,prototype);}// Otherwise, redefine all properties (slow!) +else{var asserterNames=Object.getOwnPropertyNames(ctx);asserterNames.forEach(function(asserterName){if(excludeNames.indexOf(asserterName)!==-1){return;}var pd=Object.getOwnPropertyDescriptor(ctx,asserterName);Object.defineProperty(chainableMethodWrapper,asserterName,pd);});}transferFlags$1(this,chainableMethodWrapper);return proxify$1(chainableMethodWrapper);},configurable:true});};return addChainableMethod;}/*! + * Chai - overwriteChainableMethod utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */var overwriteChainableMethod;var hasRequiredOverwriteChainableMethod;function requireOverwriteChainableMethod(){if(hasRequiredOverwriteChainableMethod)return overwriteChainableMethod;hasRequiredOverwriteChainableMethod=1;var chai=requireChai();var transferFlags$1=transferFlags;/** + * ### .overwriteChainableMethod(ctx, name, method, chainingBehavior) + * + * Overwrites an already existing chainable method + * and provides access to the previous function or + * property. Must return functions to be used for + * name. + * + * utils.overwriteChainableMethod(chai.Assertion.prototype, 'lengthOf', + * function (_super) { + * } + * , function (_super) { + * } + * ); + * + * Can also be accessed directly from \`chai.Assertion\`. + * + * chai.Assertion.overwriteChainableMethod('foo', fn, fn); + * + * Then can be used as any other assertion. + * + * expect(myFoo).to.have.lengthOf(3); + * expect(myFoo).to.have.lengthOf.above(3); + * + * @param {Object} ctx object whose method / property is to be overwritten + * @param {String} name of method / property to overwrite + * @param {Function} method function that returns a function to be used for name + * @param {Function} chainingBehavior function that returns a function to be used for property + * @namespace Utils + * @name overwriteChainableMethod + * @api public + */overwriteChainableMethod=function overwriteChainableMethod(ctx,name,method,chainingBehavior){var chainableBehavior=ctx.__methods[name];var _chainingBehavior=chainableBehavior.chainingBehavior;chainableBehavior.chainingBehavior=function overwritingChainableMethodGetter(){var result=chainingBehavior(_chainingBehavior).call(this);if(result!==undefined){return result;}var newAssertion=new chai.Assertion();transferFlags$1(this,newAssertion);return newAssertion;};var _method=chainableBehavior.method;chainableBehavior.method=function overwritingChainableMethodWrapper(){var result=method(_method).apply(this,arguments);if(result!==undefined){return result;}var newAssertion=new chai.Assertion();transferFlags$1(this,newAssertion);return newAssertion;};};return overwriteChainableMethod;}/*! + * Chai - compareByInspect utility + * Copyright(c) 2011-2016 Jake Luer + * MIT Licensed + */ /*! + * Module dependencies + */var inspect=inspect_1;/** + * ### .compareByInspect(mixed, mixed) + * + * To be used as a compareFunction with Array.prototype.sort. Compares elements + * using inspect instead of default behavior of using toString so that Symbols + * and objects with irregular/missing toString can still be sorted without a + * TypeError. + * + * @param {Mixed} first element to compare + * @param {Mixed} second element to compare + * @returns {Number} -1 if 'a' should come before 'b'; otherwise 1 + * @name compareByInspect + * @namespace Utils + * @api public + */var compareByInspect=function compareByInspect(a,b){return inspect(a) + * MIT Licensed + */ /** + * ### .getOwnEnumerablePropertySymbols(object) + * + * This allows the retrieval of directly-owned enumerable property symbols of an + * object. This function is necessary because Object.getOwnPropertySymbols + * returns both enumerable and non-enumerable property symbols. + * + * @param {Object} object + * @returns {Array} + * @namespace Utils + * @name getOwnEnumerablePropertySymbols + * @api public + */var getOwnEnumerablePropertySymbols$1=function getOwnEnumerablePropertySymbols(obj){if(typeof Object.getOwnPropertySymbols!=='function')return[];return Object.getOwnPropertySymbols(obj).filter(function(sym){return Object.getOwnPropertyDescriptor(obj,sym).enumerable;});};/*! + * Chai - getOwnEnumerableProperties utility + * Copyright(c) 2011-2016 Jake Luer + * MIT Licensed + */ /*! + * Module dependencies + */var getOwnEnumerablePropertySymbols=getOwnEnumerablePropertySymbols$1;/** + * ### .getOwnEnumerableProperties(object) + * + * This allows the retrieval of directly-owned enumerable property names and + * symbols of an object. This function is necessary because Object.keys only + * returns enumerable property names, not enumerable property symbols. + * + * @param {Object} object + * @returns {Array} + * @namespace Utils + * @name getOwnEnumerableProperties + * @api public + */var getOwnEnumerableProperties=function getOwnEnumerableProperties(obj){return Object.keys(obj).concat(getOwnEnumerablePropertySymbols(obj));};/* ! + * Chai - checkError utility + * Copyright(c) 2012-2016 Jake Luer + * MIT Licensed + */var getFunctionName=getFuncName_1;/** + * ### .checkError + * + * Checks that an error conforms to a given set of criteria and/or retrieves information about it. + * + * @api public + */ /** + * ### .compatibleInstance(thrown, errorLike) + * + * Checks if two instances are compatible (strict equal). + * Returns false if errorLike is not an instance of Error, because instances + * can only be compatible if they're both error instances. + * + * @name compatibleInstance + * @param {Error} thrown error + * @param {Error|ErrorConstructor} errorLike object to compare against + * @namespace Utils + * @api public + */function compatibleInstance(thrown,errorLike){return errorLike instanceof Error&&thrown===errorLike;}/** + * ### .compatibleConstructor(thrown, errorLike) + * + * Checks if two constructors are compatible. + * This function can receive either an error constructor or + * an error instance as the \`errorLike\` argument. + * Constructors are compatible if they're the same or if one is + * an instance of another. + * + * @name compatibleConstructor + * @param {Error} thrown error + * @param {Error|ErrorConstructor} errorLike object to compare against + * @namespace Utils + * @api public + */function compatibleConstructor(thrown,errorLike){if(errorLike instanceof Error){// If \`errorLike\` is an instance of any error we compare their constructors +return thrown.constructor===errorLike.constructor||thrown instanceof errorLike.constructor;}else if(errorLike.prototype instanceof Error||errorLike===Error){// If \`errorLike\` is a constructor that inherits from Error, we compare \`thrown\` to \`errorLike\` directly +return thrown.constructor===errorLike||thrown instanceof errorLike;}return false;}/** + * ### .compatibleMessage(thrown, errMatcher) + * + * Checks if an error's message is compatible with a matcher (String or RegExp). + * If the message contains the String or passes the RegExp test, + * it is considered compatible. + * + * @name compatibleMessage + * @param {Error} thrown error + * @param {String|RegExp} errMatcher to look for into the message + * @namespace Utils + * @api public + */function compatibleMessage(thrown,errMatcher){var comparisonString=typeof thrown==='string'?thrown:thrown.message;if(errMatcher instanceof RegExp){return errMatcher.test(comparisonString);}else if(typeof errMatcher==='string'){return comparisonString.indexOf(errMatcher)!==-1;// eslint-disable-line no-magic-numbers +}return false;}/** + * ### .getConstructorName(errorLike) + * + * Gets the constructor name for an Error instance or constructor itself. + * + * @name getConstructorName + * @param {Error|ErrorConstructor} errorLike + * @namespace Utils + * @api public + */function getConstructorName(errorLike){var constructorName=errorLike;if(errorLike instanceof Error){constructorName=getFunctionName(errorLike.constructor);}else if(typeof errorLike==='function'){// If \`err\` is not an instance of Error it is an error constructor itself or another function. +// If we've got a common function we get its name, otherwise we may need to create a new instance +// of the error just in case it's a poorly-constructed error. Please see chaijs/chai/issues/45 to know more. +constructorName=getFunctionName(errorLike);if(constructorName===''){var newConstructorName=getFunctionName(new errorLike());// eslint-disable-line new-cap +constructorName=newConstructorName||constructorName;}}return constructorName;}/** + * ### .getMessage(errorLike) + * + * Gets the error message from an error. + * If \`err\` is a String itself, we return it. + * If the error has no message, we return an empty string. + * + * @name getMessage + * @param {Error|String} errorLike + * @namespace Utils + * @api public + */function getMessage(errorLike){var msg='';if(errorLike&&errorLike.message){msg=errorLike.message;}else if(typeof errorLike==='string'){msg=errorLike;}return msg;}var checkError={compatibleInstance:compatibleInstance,compatibleConstructor:compatibleConstructor,compatibleMessage:compatibleMessage,getMessage:getMessage,getConstructorName:getConstructorName};/*! + * Chai - isNaN utility + * Copyright(c) 2012-2015 Sakthipriyan Vairamani + * MIT Licensed + */ /** + * ### .isNaN(value) + * + * Checks if the given value is NaN or not. + * + * utils.isNaN(NaN); // true + * + * @param {Value} The value which has to be checked if it is NaN + * @name isNaN + * @api private + */function isNaN$1(value){// Refer http://www.ecma-international.org/ecma-262/6.0/#sec-isnan-number +// section's NOTE. +return value!==value;}// If ECMAScript 6's Number.isNaN is present, prefer that. +var _isNaN=Number.isNaN||isNaN$1;var type$1=typeDetectExports$1;var flag=flag$5;function isObjectType(obj){var objectType=type$1(obj);var objectTypes=['Array','Object','function'];return objectTypes.indexOf(objectType)!==-1;}/** + * ### .getOperator(message) + * + * Extract the operator from error message. + * Operator defined is based on below link + * https://nodejs.org/api/assert.html#assert_assert. + * + * Returns the \`operator\` or \`undefined\` value for an Assertion. + * + * @param {Object} object (constructed Assertion) + * @param {Arguments} chai.Assertion.prototype.assert arguments + * @namespace Utils + * @name getOperator + * @api public + */var getOperator=function getOperator(obj,args){var operator=flag(obj,'operator');var negate=flag(obj,'negate');var expected=args[3];var msg=negate?args[2]:args[1];if(operator){return operator;}if(typeof msg==='function')msg=msg();msg=msg||'';if(!msg){return undefined;}if(/\\shave\\s/.test(msg)){return undefined;}var isObject=isObjectType(expected);if(/\\snot\\s/.test(msg)){return isObject?'notDeepStrictEqual':'notStrictEqual';}return isObject?'deepStrictEqual':'strictEqual';};/*! + * chai + * Copyright(c) 2011 Jake Luer + * MIT Licensed + */var hasRequiredUtils;function requireUtils(){if(hasRequiredUtils)return utils;hasRequiredUtils=1;/*! + * Dependencies that are used for multiple exports are required here only once + */var pathval$1=pathval;/*! + * test utility + */utils.test=test$1;/*! + * type utility + */utils.type=typeDetectExports$1;/*! + * expectTypes utility + */utils.expectTypes=expectTypes;/*! + * message utility + */utils.getMessage=getMessage$1;/*! + * actual utility + */utils.getActual=getActual$1;/*! + * Inspect util + */utils.inspect=inspect_1;/*! + * Object Display util + */utils.objDisplay=objDisplay$1;/*! + * Flag utility + */utils.flag=flag$5;/*! + * Flag transferring utility + */utils.transferFlags=transferFlags;/*! + * Deep equal utility + */utils.eql=deepEqlExports;/*! + * Deep path info + */utils.getPathInfo=pathval$1.getPathInfo;/*! + * Check if a property exists + */utils.hasProperty=pathval$1.hasProperty;/*! + * Function name + */utils.getName=getFuncName_1;/*! + * add Property + */utils.addProperty=requireAddProperty();/*! + * add Method + */utils.addMethod=requireAddMethod();/*! + * overwrite Property + */utils.overwriteProperty=requireOverwriteProperty();/*! + * overwrite Method + */utils.overwriteMethod=requireOverwriteMethod();/*! + * Add a chainable method + */utils.addChainableMethod=requireAddChainableMethod();/*! + * Overwrite chainable method + */utils.overwriteChainableMethod=requireOverwriteChainableMethod();/*! + * Compare by inspect method + */utils.compareByInspect=compareByInspect;/*! + * Get own enumerable property symbols method + */utils.getOwnEnumerablePropertySymbols=getOwnEnumerablePropertySymbols$1;/*! + * Get own enumerable properties method + */utils.getOwnEnumerableProperties=getOwnEnumerableProperties;/*! + * Checks error against a given set of criteria + */utils.checkError=checkError;/*! + * Proxify util + */utils.proxify=proxify;/*! + * addLengthGuard util + */utils.addLengthGuard=addLengthGuard;/*! + * isProxyEnabled helper + */utils.isProxyEnabled=isProxyEnabled$1;/*! + * isNaN method + */utils.isNaN=_isNaN;/*! + * getOperator method + */utils.getOperator=getOperator;return utils;}/*! + * chai + * http://chaijs.com + * Copyright(c) 2011-2014 Jake Luer + * MIT Licensed + */var config=config$5;var assertion=function(_chai,util){/*! + * Module dependencies. + */var AssertionError=_chai.AssertionError,flag=util.flag;/*! + * Module export. + */_chai.Assertion=Assertion;/*! + * Assertion Constructor + * + * Creates object for chaining. + * + * \`Assertion\` objects contain metadata in the form of flags. Three flags can + * be assigned during instantiation by passing arguments to this constructor: + * + * - \`object\`: This flag contains the target of the assertion. For example, in + * the assertion \`expect(numKittens).to.equal(7);\`, the \`object\` flag will + * contain \`numKittens\` so that the \`equal\` assertion can reference it when + * needed. + * + * - \`message\`: This flag contains an optional custom error message to be + * prepended to the error message that's generated by the assertion when it + * fails. + * + * - \`ssfi\`: This flag stands for "start stack function indicator". It + * contains a function reference that serves as the starting point for + * removing frames from the stack trace of the error that's created by the + * assertion when it fails. The goal is to provide a cleaner stack trace to + * end users by removing Chai's internal functions. Note that it only works + * in environments that support \`Error.captureStackTrace\`, and only when + * \`Chai.config.includeStack\` hasn't been set to \`false\`. + * + * - \`lockSsfi\`: This flag controls whether or not the given \`ssfi\` flag + * should retain its current value, even as assertions are chained off of + * this object. This is usually set to \`true\` when creating a new assertion + * from within another assertion. It's also temporarily set to \`true\` before + * an overwritten assertion gets called by the overwriting assertion. + * + * - \`eql\`: This flag contains the deepEqual function to be used by the assertion. + * + * @param {Mixed} obj target of the assertion + * @param {String} msg (optional) custom error message + * @param {Function} ssfi (optional) starting point for removing stack frames + * @param {Boolean} lockSsfi (optional) whether or not the ssfi flag is locked + * @api private + */function Assertion(obj,msg,ssfi,lockSsfi){flag(this,'ssfi',ssfi||Assertion);flag(this,'lockSsfi',lockSsfi);flag(this,'object',obj);flag(this,'message',msg);flag(this,'eql',config.deepEqual||util.eql);return util.proxify(this);}Object.defineProperty(Assertion,'includeStack',{get:function(){console.warn('Assertion.includeStack is deprecated, use chai.config.includeStack instead.');return config.includeStack;},set:function(value){console.warn('Assertion.includeStack is deprecated, use chai.config.includeStack instead.');config.includeStack=value;}});Object.defineProperty(Assertion,'showDiff',{get:function(){console.warn('Assertion.showDiff is deprecated, use chai.config.showDiff instead.');return config.showDiff;},set:function(value){console.warn('Assertion.showDiff is deprecated, use chai.config.showDiff instead.');config.showDiff=value;}});Assertion.addProperty=function(name,fn){util.addProperty(this.prototype,name,fn);};Assertion.addMethod=function(name,fn){util.addMethod(this.prototype,name,fn);};Assertion.addChainableMethod=function(name,fn,chainingBehavior){util.addChainableMethod(this.prototype,name,fn,chainingBehavior);};Assertion.overwriteProperty=function(name,fn){util.overwriteProperty(this.prototype,name,fn);};Assertion.overwriteMethod=function(name,fn){util.overwriteMethod(this.prototype,name,fn);};Assertion.overwriteChainableMethod=function(name,fn,chainingBehavior){util.overwriteChainableMethod(this.prototype,name,fn,chainingBehavior);};/** + * ### .assert(expression, message, negateMessage, expected, actual, showDiff) + * + * Executes an expression and check expectations. Throws AssertionError for reporting if test doesn't pass. + * + * @name assert + * @param {Philosophical} expression to be tested + * @param {String|Function} message or function that returns message to display if expression fails + * @param {String|Function} negatedMessage or function that returns negatedMessage to display if negated expression fails + * @param {Mixed} expected value (remember to check for negation) + * @param {Mixed} actual (optional) will default to \`this.obj\` + * @param {Boolean} showDiff (optional) when set to \`true\`, assert will display a diff in addition to the message if expression fails + * @api private + */Assertion.prototype.assert=function(expr,msg,negateMsg,expected,_actual,showDiff){var ok=util.test(this,arguments);if(false!==showDiff)showDiff=true;if(undefined===expected&&undefined===_actual)showDiff=false;if(true!==config.showDiff)showDiff=false;if(!ok){msg=util.getMessage(this,arguments);var actual=util.getActual(this,arguments);var assertionErrorObjectProperties={actual:actual,expected:expected,showDiff:showDiff};var operator=util.getOperator(this,arguments);if(operator){assertionErrorObjectProperties.operator=operator;}throw new AssertionError(msg,assertionErrorObjectProperties,config.includeStack?this.assert:flag(this,'ssfi'));}};/*! + * ### ._obj + * + * Quick reference to stored \`actual\` value for plugin developers. + * + * @api private + */Object.defineProperty(Assertion.prototype,'_obj',{get:function(){return flag(this,'object');},set:function(val){flag(this,'object',val);}});};/*! + * chai + * http://chaijs.com + * Copyright(c) 2011-2014 Jake Luer + * MIT Licensed + */var assertions=function(chai,_){var Assertion=chai.Assertion,AssertionError=chai.AssertionError,flag=_.flag;/** + * ### Language Chains + * + * The following are provided as chainable getters to improve the readability + * of your assertions. + * + * **Chains** + * + * - to + * - be + * - been + * - is + * - that + * - which + * - and + * - has + * - have + * - with + * - at + * - of + * - same + * - but + * - does + * - still + * - also + * + * @name language chains + * @namespace BDD + * @api public + */['to','be','been','is','and','has','have','with','that','which','at','of','same','but','does','still',"also"].forEach(function(chain){Assertion.addProperty(chain);});/** + * ### .not + * + * Negates all assertions that follow in the chain. + * + * expect(function () {}).to.not.throw(); + * expect({a: 1}).to.not.have.property('b'); + * expect([1, 2]).to.be.an('array').that.does.not.include(3); + * + * Just because you can negate any assertion with \`.not\` doesn't mean you + * should. With great power comes great responsibility. It's often best to + * assert that the one expected output was produced, rather than asserting + * that one of countless unexpected outputs wasn't produced. See individual + * assertions for specific guidance. + * + * expect(2).to.equal(2); // Recommended + * expect(2).to.not.equal(1); // Not recommended + * + * @name not + * @namespace BDD + * @api public + */Assertion.addProperty('not',function(){flag(this,'negate',true);});/** + * ### .deep + * + * Causes all \`.equal\`, \`.include\`, \`.members\`, \`.keys\`, and \`.property\` + * assertions that follow in the chain to use deep equality instead of strict + * (\`===\`) equality. See the \`deep-eql\` project page for info on the deep + * equality algorithm: https://github.com/chaijs/deep-eql. + * + * // Target object deeply (but not strictly) equals \`{a: 1}\` + * expect({a: 1}).to.deep.equal({a: 1}); + * expect({a: 1}).to.not.equal({a: 1}); + * + * // Target array deeply (but not strictly) includes \`{a: 1}\` + * expect([{a: 1}]).to.deep.include({a: 1}); + * expect([{a: 1}]).to.not.include({a: 1}); + * + * // Target object deeply (but not strictly) includes \`x: {a: 1}\` + * expect({x: {a: 1}}).to.deep.include({x: {a: 1}}); + * expect({x: {a: 1}}).to.not.include({x: {a: 1}}); + * + * // Target array deeply (but not strictly) has member \`{a: 1}\` + * expect([{a: 1}]).to.have.deep.members([{a: 1}]); + * expect([{a: 1}]).to.not.have.members([{a: 1}]); + * + * // Target set deeply (but not strictly) has key \`{a: 1}\` + * expect(new Set([{a: 1}])).to.have.deep.keys([{a: 1}]); + * expect(new Set([{a: 1}])).to.not.have.keys([{a: 1}]); + * + * // Target object deeply (but not strictly) has property \`x: {a: 1}\` + * expect({x: {a: 1}}).to.have.deep.property('x', {a: 1}); + * expect({x: {a: 1}}).to.not.have.property('x', {a: 1}); + * + * @name deep + * @namespace BDD + * @api public + */Assertion.addProperty('deep',function(){flag(this,'deep',true);});/** + * ### .nested + * + * Enables dot- and bracket-notation in all \`.property\` and \`.include\` + * assertions that follow in the chain. + * + * expect({a: {b: ['x', 'y']}}).to.have.nested.property('a.b[1]'); + * expect({a: {b: ['x', 'y']}}).to.nested.include({'a.b[1]': 'y'}); + * + * If \`.\` or \`[]\` are part of an actual property name, they can be escaped by + * adding two backslashes before them. + * + * expect({'.a': {'[b]': 'x'}}).to.have.nested.property('\\\\.a.\\\\[b\\\\]'); + * expect({'.a': {'[b]': 'x'}}).to.nested.include({'\\\\.a.\\\\[b\\\\]': 'x'}); + * + * \`.nested\` cannot be combined with \`.own\`. + * + * @name nested + * @namespace BDD + * @api public + */Assertion.addProperty('nested',function(){flag(this,'nested',true);});/** + * ### .own + * + * Causes all \`.property\` and \`.include\` assertions that follow in the chain + * to ignore inherited properties. + * + * Object.prototype.b = 2; + * + * expect({a: 1}).to.have.own.property('a'); + * expect({a: 1}).to.have.property('b'); + * expect({a: 1}).to.not.have.own.property('b'); + * + * expect({a: 1}).to.own.include({a: 1}); + * expect({a: 1}).to.include({b: 2}).but.not.own.include({b: 2}); + * + * \`.own\` cannot be combined with \`.nested\`. + * + * @name own + * @namespace BDD + * @api public + */Assertion.addProperty('own',function(){flag(this,'own',true);});/** + * ### .ordered + * + * Causes all \`.members\` assertions that follow in the chain to require that + * members be in the same order. + * + * expect([1, 2]).to.have.ordered.members([1, 2]) + * .but.not.have.ordered.members([2, 1]); + * + * When \`.include\` and \`.ordered\` are combined, the ordering begins at the + * start of both arrays. + * + * expect([1, 2, 3]).to.include.ordered.members([1, 2]) + * .but.not.include.ordered.members([2, 3]); + * + * @name ordered + * @namespace BDD + * @api public + */Assertion.addProperty('ordered',function(){flag(this,'ordered',true);});/** + * ### .any + * + * Causes all \`.keys\` assertions that follow in the chain to only require that + * the target have at least one of the given keys. This is the opposite of + * \`.all\`, which requires that the target have all of the given keys. + * + * expect({a: 1, b: 2}).to.not.have.any.keys('c', 'd'); + * + * See the \`.keys\` doc for guidance on when to use \`.any\` or \`.all\`. + * + * @name any + * @namespace BDD + * @api public + */Assertion.addProperty('any',function(){flag(this,'any',true);flag(this,'all',false);});/** + * ### .all + * + * Causes all \`.keys\` assertions that follow in the chain to require that the + * target have all of the given keys. This is the opposite of \`.any\`, which + * only requires that the target have at least one of the given keys. + * + * expect({a: 1, b: 2}).to.have.all.keys('a', 'b'); + * + * Note that \`.all\` is used by default when neither \`.all\` nor \`.any\` are + * added earlier in the chain. However, it's often best to add \`.all\` anyway + * because it improves readability. + * + * See the \`.keys\` doc for guidance on when to use \`.any\` or \`.all\`. + * + * @name all + * @namespace BDD + * @api public + */Assertion.addProperty('all',function(){flag(this,'all',true);flag(this,'any',false);});/** + * ### .a(type[, msg]) + * + * Asserts that the target's type is equal to the given string \`type\`. Types + * are case insensitive. See the \`type-detect\` project page for info on the + * type detection algorithm: https://github.com/chaijs/type-detect. + * + * expect('foo').to.be.a('string'); + * expect({a: 1}).to.be.an('object'); + * expect(null).to.be.a('null'); + * expect(undefined).to.be.an('undefined'); + * expect(new Error).to.be.an('error'); + * expect(Promise.resolve()).to.be.a('promise'); + * expect(new Float32Array).to.be.a('float32array'); + * expect(Symbol()).to.be.a('symbol'); + * + * \`.a\` supports objects that have a custom type set via \`Symbol.toStringTag\`. + * + * var myObj = { + * [Symbol.toStringTag]: 'myCustomType' + * }; + * + * expect(myObj).to.be.a('myCustomType').but.not.an('object'); + * + * It's often best to use \`.a\` to check a target's type before making more + * assertions on the same target. That way, you avoid unexpected behavior from + * any assertion that does different things based on the target's type. + * + * expect([1, 2, 3]).to.be.an('array').that.includes(2); + * expect([]).to.be.an('array').that.is.empty; + * + * Add \`.not\` earlier in the chain to negate \`.a\`. However, it's often best to + * assert that the target is the expected type, rather than asserting that it + * isn't one of many unexpected types. + * + * expect('foo').to.be.a('string'); // Recommended + * expect('foo').to.not.be.an('array'); // Not recommended + * + * \`.a\` accepts an optional \`msg\` argument which is a custom error message to + * show when the assertion fails. The message can also be given as the second + * argument to \`expect\`. + * + * expect(1).to.be.a('string', 'nooo why fail??'); + * expect(1, 'nooo why fail??').to.be.a('string'); + * + * \`.a\` can also be used as a language chain to improve the readability of + * your assertions. + * + * expect({b: 2}).to.have.a.property('b'); + * + * The alias \`.an\` can be used interchangeably with \`.a\`. + * + * @name a + * @alias an + * @param {String} type + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */function an(type,msg){if(msg)flag(this,'message',msg);type=type.toLowerCase();var obj=flag(this,'object'),article=~['a','e','i','o','u'].indexOf(type.charAt(0))?'an ':'a ';this.assert(type===_.type(obj).toLowerCase(),'expected #{this} to be '+article+type,'expected #{this} not to be '+article+type);}Assertion.addChainableMethod('an',an);Assertion.addChainableMethod('a',an);/** + * ### .include(val[, msg]) + * + * When the target is a string, \`.include\` asserts that the given string \`val\` + * is a substring of the target. + * + * expect('foobar').to.include('foo'); + * + * When the target is an array, \`.include\` asserts that the given \`val\` is a + * member of the target. + * + * expect([1, 2, 3]).to.include(2); + * + * When the target is an object, \`.include\` asserts that the given object + * \`val\`'s properties are a subset of the target's properties. + * + * expect({a: 1, b: 2, c: 3}).to.include({a: 1, b: 2}); + * + * When the target is a Set or WeakSet, \`.include\` asserts that the given \`val\` is a + * member of the target. SameValueZero equality algorithm is used. + * + * expect(new Set([1, 2])).to.include(2); + * + * When the target is a Map, \`.include\` asserts that the given \`val\` is one of + * the values of the target. SameValueZero equality algorithm is used. + * + * expect(new Map([['a', 1], ['b', 2]])).to.include(2); + * + * Because \`.include\` does different things based on the target's type, it's + * important to check the target's type before using \`.include\`. See the \`.a\` + * doc for info on testing a target's type. + * + * expect([1, 2, 3]).to.be.an('array').that.includes(2); + * + * By default, strict (\`===\`) equality is used to compare array members and + * object properties. Add \`.deep\` earlier in the chain to use deep equality + * instead (WeakSet targets are not supported). See the \`deep-eql\` project + * page for info on the deep equality algorithm: https://github.com/chaijs/deep-eql. + * + * // Target array deeply (but not strictly) includes \`{a: 1}\` + * expect([{a: 1}]).to.deep.include({a: 1}); + * expect([{a: 1}]).to.not.include({a: 1}); + * + * // Target object deeply (but not strictly) includes \`x: {a: 1}\` + * expect({x: {a: 1}}).to.deep.include({x: {a: 1}}); + * expect({x: {a: 1}}).to.not.include({x: {a: 1}}); + * + * By default, all of the target's properties are searched when working with + * objects. This includes properties that are inherited and/or non-enumerable. + * Add \`.own\` earlier in the chain to exclude the target's inherited + * properties from the search. + * + * Object.prototype.b = 2; + * + * expect({a: 1}).to.own.include({a: 1}); + * expect({a: 1}).to.include({b: 2}).but.not.own.include({b: 2}); + * + * Note that a target object is always only searched for \`val\`'s own + * enumerable properties. + * + * \`.deep\` and \`.own\` can be combined. + * + * expect({a: {b: 2}}).to.deep.own.include({a: {b: 2}}); + * + * Add \`.nested\` earlier in the chain to enable dot- and bracket-notation when + * referencing nested properties. + * + * expect({a: {b: ['x', 'y']}}).to.nested.include({'a.b[1]': 'y'}); + * + * If \`.\` or \`[]\` are part of an actual property name, they can be escaped by + * adding two backslashes before them. + * + * expect({'.a': {'[b]': 2}}).to.nested.include({'\\\\.a.\\\\[b\\\\]': 2}); + * + * \`.deep\` and \`.nested\` can be combined. + * + * expect({a: {b: [{c: 3}]}}).to.deep.nested.include({'a.b[0]': {c: 3}}); + * + * \`.own\` and \`.nested\` cannot be combined. + * + * Add \`.not\` earlier in the chain to negate \`.include\`. + * + * expect('foobar').to.not.include('taco'); + * expect([1, 2, 3]).to.not.include(4); + * + * However, it's dangerous to negate \`.include\` when the target is an object. + * The problem is that it creates uncertain expectations by asserting that the + * target object doesn't have all of \`val\`'s key/value pairs but may or may + * not have some of them. It's often best to identify the exact output that's + * expected, and then write an assertion that only accepts that exact output. + * + * When the target object isn't even expected to have \`val\`'s keys, it's + * often best to assert exactly that. + * + * expect({c: 3}).to.not.have.any.keys('a', 'b'); // Recommended + * expect({c: 3}).to.not.include({a: 1, b: 2}); // Not recommended + * + * When the target object is expected to have \`val\`'s keys, it's often best to + * assert that each of the properties has its expected value, rather than + * asserting that each property doesn't have one of many unexpected values. + * + * expect({a: 3, b: 4}).to.include({a: 3, b: 4}); // Recommended + * expect({a: 3, b: 4}).to.not.include({a: 1, b: 2}); // Not recommended + * + * \`.include\` accepts an optional \`msg\` argument which is a custom error + * message to show when the assertion fails. The message can also be given as + * the second argument to \`expect\`. + * + * expect([1, 2, 3]).to.include(4, 'nooo why fail??'); + * expect([1, 2, 3], 'nooo why fail??').to.include(4); + * + * \`.include\` can also be used as a language chain, causing all \`.members\` and + * \`.keys\` assertions that follow in the chain to require the target to be a + * superset of the expected set, rather than an identical set. Note that + * \`.members\` ignores duplicates in the subset when \`.include\` is added. + * + * // Target object's keys are a superset of ['a', 'b'] but not identical + * expect({a: 1, b: 2, c: 3}).to.include.all.keys('a', 'b'); + * expect({a: 1, b: 2, c: 3}).to.not.have.all.keys('a', 'b'); + * + * // Target array is a superset of [1, 2] but not identical + * expect([1, 2, 3]).to.include.members([1, 2]); + * expect([1, 2, 3]).to.not.have.members([1, 2]); + * + * // Duplicates in the subset are ignored + * expect([1, 2, 3]).to.include.members([1, 2, 2, 2]); + * + * Note that adding \`.any\` earlier in the chain causes the \`.keys\` assertion + * to ignore \`.include\`. + * + * // Both assertions are identical + * expect({a: 1}).to.include.any.keys('a', 'b'); + * expect({a: 1}).to.have.any.keys('a', 'b'); + * + * The aliases \`.includes\`, \`.contain\`, and \`.contains\` can be used + * interchangeably with \`.include\`. + * + * @name include + * @alias contain + * @alias includes + * @alias contains + * @param {Mixed} val + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */function SameValueZero(a,b){return _.isNaN(a)&&_.isNaN(b)||a===b;}function includeChainingBehavior(){flag(this,'contains',true);}function include(val,msg){if(msg)flag(this,'message',msg);var obj=flag(this,'object'),objType=_.type(obj).toLowerCase(),flagMsg=flag(this,'message'),negate=flag(this,'negate'),ssfi=flag(this,'ssfi'),isDeep=flag(this,'deep'),descriptor=isDeep?'deep ':'',isEql=isDeep?flag(this,'eql'):SameValueZero;flagMsg=flagMsg?flagMsg+': ':'';var included=false;switch(objType){case'string':included=obj.indexOf(val)!==-1;break;case'weakset':if(isDeep){throw new AssertionError(flagMsg+'unable to use .deep.include with WeakSet',undefined,ssfi);}included=obj.has(val);break;case'map':obj.forEach(function(item){included=included||isEql(item,val);});break;case'set':if(isDeep){obj.forEach(function(item){included=included||isEql(item,val);});}else{included=obj.has(val);}break;case'array':if(isDeep){included=obj.some(function(item){return isEql(item,val);});}else{included=obj.indexOf(val)!==-1;}break;default:// This block is for asserting a subset of properties in an object. +// \`_.expectTypes\` isn't used here because \`.include\` should work with +// objects with a custom \`@@toStringTag\`. +if(val!==Object(val)){throw new AssertionError(flagMsg+'the given combination of arguments ('+objType+' and '+_.type(val).toLowerCase()+')'+' is invalid for this assertion. '+'You can use an array, a map, an object, a set, a string, '+'or a weakset instead of a '+_.type(val).toLowerCase(),undefined,ssfi);}var props=Object.keys(val),firstErr=null,numErrs=0;props.forEach(function(prop){var propAssertion=new Assertion(obj);_.transferFlags(this,propAssertion,true);flag(propAssertion,'lockSsfi',true);if(!negate||props.length===1){propAssertion.property(prop,val[prop]);return;}try{propAssertion.property(prop,val[prop]);}catch(err){if(!_.checkError.compatibleConstructor(err,AssertionError)){throw err;}if(firstErr===null)firstErr=err;numErrs++;}},this);// When validating .not.include with multiple properties, we only want +// to throw an assertion error if all of the properties are included, +// in which case we throw the first property assertion error that we +// encountered. +if(negate&&props.length>1&&numErrs===props.length){throw firstErr;}return;}// Assert inclusion in collection or substring in a string. +this.assert(included,'expected #{this} to '+descriptor+'include '+_.inspect(val),'expected #{this} to not '+descriptor+'include '+_.inspect(val));}Assertion.addChainableMethod('include',include,includeChainingBehavior);Assertion.addChainableMethod('contain',include,includeChainingBehavior);Assertion.addChainableMethod('contains',include,includeChainingBehavior);Assertion.addChainableMethod('includes',include,includeChainingBehavior);/** + * ### .ok + * + * Asserts that the target is a truthy value (considered \`true\` in boolean context). + * However, it's often best to assert that the target is strictly (\`===\`) or + * deeply equal to its expected value. + * + * expect(1).to.equal(1); // Recommended + * expect(1).to.be.ok; // Not recommended + * + * expect(true).to.be.true; // Recommended + * expect(true).to.be.ok; // Not recommended + * + * Add \`.not\` earlier in the chain to negate \`.ok\`. + * + * expect(0).to.equal(0); // Recommended + * expect(0).to.not.be.ok; // Not recommended + * + * expect(false).to.be.false; // Recommended + * expect(false).to.not.be.ok; // Not recommended + * + * expect(null).to.be.null; // Recommended + * expect(null).to.not.be.ok; // Not recommended + * + * expect(undefined).to.be.undefined; // Recommended + * expect(undefined).to.not.be.ok; // Not recommended + * + * A custom error message can be given as the second argument to \`expect\`. + * + * expect(false, 'nooo why fail??').to.be.ok; + * + * @name ok + * @namespace BDD + * @api public + */Assertion.addProperty('ok',function(){this.assert(flag(this,'object'),'expected #{this} to be truthy','expected #{this} to be falsy');});/** + * ### .true + * + * Asserts that the target is strictly (\`===\`) equal to \`true\`. + * + * expect(true).to.be.true; + * + * Add \`.not\` earlier in the chain to negate \`.true\`. However, it's often best + * to assert that the target is equal to its expected value, rather than not + * equal to \`true\`. + * + * expect(false).to.be.false; // Recommended + * expect(false).to.not.be.true; // Not recommended + * + * expect(1).to.equal(1); // Recommended + * expect(1).to.not.be.true; // Not recommended + * + * A custom error message can be given as the second argument to \`expect\`. + * + * expect(false, 'nooo why fail??').to.be.true; + * + * @name true + * @namespace BDD + * @api public + */Assertion.addProperty('true',function(){this.assert(true===flag(this,'object'),'expected #{this} to be true','expected #{this} to be false',flag(this,'negate')?false:true);});/** + * ### .false + * + * Asserts that the target is strictly (\`===\`) equal to \`false\`. + * + * expect(false).to.be.false; + * + * Add \`.not\` earlier in the chain to negate \`.false\`. However, it's often + * best to assert that the target is equal to its expected value, rather than + * not equal to \`false\`. + * + * expect(true).to.be.true; // Recommended + * expect(true).to.not.be.false; // Not recommended + * + * expect(1).to.equal(1); // Recommended + * expect(1).to.not.be.false; // Not recommended + * + * A custom error message can be given as the second argument to \`expect\`. + * + * expect(true, 'nooo why fail??').to.be.false; + * + * @name false + * @namespace BDD + * @api public + */Assertion.addProperty('false',function(){this.assert(false===flag(this,'object'),'expected #{this} to be false','expected #{this} to be true',flag(this,'negate')?true:false);});/** + * ### .null + * + * Asserts that the target is strictly (\`===\`) equal to \`null\`. + * + * expect(null).to.be.null; + * + * Add \`.not\` earlier in the chain to negate \`.null\`. However, it's often best + * to assert that the target is equal to its expected value, rather than not + * equal to \`null\`. + * + * expect(1).to.equal(1); // Recommended + * expect(1).to.not.be.null; // Not recommended + * + * A custom error message can be given as the second argument to \`expect\`. + * + * expect(42, 'nooo why fail??').to.be.null; + * + * @name null + * @namespace BDD + * @api public + */Assertion.addProperty('null',function(){this.assert(null===flag(this,'object'),'expected #{this} to be null','expected #{this} not to be null');});/** + * ### .undefined + * + * Asserts that the target is strictly (\`===\`) equal to \`undefined\`. + * + * expect(undefined).to.be.undefined; + * + * Add \`.not\` earlier in the chain to negate \`.undefined\`. However, it's often + * best to assert that the target is equal to its expected value, rather than + * not equal to \`undefined\`. + * + * expect(1).to.equal(1); // Recommended + * expect(1).to.not.be.undefined; // Not recommended + * + * A custom error message can be given as the second argument to \`expect\`. + * + * expect(42, 'nooo why fail??').to.be.undefined; + * + * @name undefined + * @namespace BDD + * @api public + */Assertion.addProperty('undefined',function(){this.assert(undefined===flag(this,'object'),'expected #{this} to be undefined','expected #{this} not to be undefined');});/** + * ### .NaN + * + * Asserts that the target is exactly \`NaN\`. + * + * expect(NaN).to.be.NaN; + * + * Add \`.not\` earlier in the chain to negate \`.NaN\`. However, it's often best + * to assert that the target is equal to its expected value, rather than not + * equal to \`NaN\`. + * + * expect('foo').to.equal('foo'); // Recommended + * expect('foo').to.not.be.NaN; // Not recommended + * + * A custom error message can be given as the second argument to \`expect\`. + * + * expect(42, 'nooo why fail??').to.be.NaN; + * + * @name NaN + * @namespace BDD + * @api public + */Assertion.addProperty('NaN',function(){this.assert(_.isNaN(flag(this,'object')),'expected #{this} to be NaN','expected #{this} not to be NaN');});/** + * ### .exist + * + * Asserts that the target is not strictly (\`===\`) equal to either \`null\` or + * \`undefined\`. However, it's often best to assert that the target is equal to + * its expected value. + * + * expect(1).to.equal(1); // Recommended + * expect(1).to.exist; // Not recommended + * + * expect(0).to.equal(0); // Recommended + * expect(0).to.exist; // Not recommended + * + * Add \`.not\` earlier in the chain to negate \`.exist\`. + * + * expect(null).to.be.null; // Recommended + * expect(null).to.not.exist; // Not recommended + * + * expect(undefined).to.be.undefined; // Recommended + * expect(undefined).to.not.exist; // Not recommended + * + * A custom error message can be given as the second argument to \`expect\`. + * + * expect(null, 'nooo why fail??').to.exist; + * + * The alias \`.exists\` can be used interchangeably with \`.exist\`. + * + * @name exist + * @alias exists + * @namespace BDD + * @api public + */function assertExist(){var val=flag(this,'object');this.assert(val!==null&&val!==undefined,'expected #{this} to exist','expected #{this} to not exist');}Assertion.addProperty('exist',assertExist);Assertion.addProperty('exists',assertExist);/** + * ### .empty + * + * When the target is a string or array, \`.empty\` asserts that the target's + * \`length\` property is strictly (\`===\`) equal to \`0\`. + * + * expect([]).to.be.empty; + * expect('').to.be.empty; + * + * When the target is a map or set, \`.empty\` asserts that the target's \`size\` + * property is strictly equal to \`0\`. + * + * expect(new Set()).to.be.empty; + * expect(new Map()).to.be.empty; + * + * When the target is a non-function object, \`.empty\` asserts that the target + * doesn't have any own enumerable properties. Properties with Symbol-based + * keys are excluded from the count. + * + * expect({}).to.be.empty; + * + * Because \`.empty\` does different things based on the target's type, it's + * important to check the target's type before using \`.empty\`. See the \`.a\` + * doc for info on testing a target's type. + * + * expect([]).to.be.an('array').that.is.empty; + * + * Add \`.not\` earlier in the chain to negate \`.empty\`. However, it's often + * best to assert that the target contains its expected number of values, + * rather than asserting that it's not empty. + * + * expect([1, 2, 3]).to.have.lengthOf(3); // Recommended + * expect([1, 2, 3]).to.not.be.empty; // Not recommended + * + * expect(new Set([1, 2, 3])).to.have.property('size', 3); // Recommended + * expect(new Set([1, 2, 3])).to.not.be.empty; // Not recommended + * + * expect(Object.keys({a: 1})).to.have.lengthOf(1); // Recommended + * expect({a: 1}).to.not.be.empty; // Not recommended + * + * A custom error message can be given as the second argument to \`expect\`. + * + * expect([1, 2, 3], 'nooo why fail??').to.be.empty; + * + * @name empty + * @namespace BDD + * @api public + */Assertion.addProperty('empty',function(){var val=flag(this,'object'),ssfi=flag(this,'ssfi'),flagMsg=flag(this,'message'),itemsCount;flagMsg=flagMsg?flagMsg+': ':'';switch(_.type(val).toLowerCase()){case'array':case'string':itemsCount=val.length;break;case'map':case'set':itemsCount=val.size;break;case'weakmap':case'weakset':throw new AssertionError(flagMsg+'.empty was passed a weak collection',undefined,ssfi);case'function':var msg=flagMsg+'.empty was passed a function '+_.getName(val);throw new AssertionError(msg.trim(),undefined,ssfi);default:if(val!==Object(val)){throw new AssertionError(flagMsg+'.empty was passed non-string primitive '+_.inspect(val),undefined,ssfi);}itemsCount=Object.keys(val).length;}this.assert(0===itemsCount,'expected #{this} to be empty','expected #{this} not to be empty');});/** + * ### .arguments + * + * Asserts that the target is an \`arguments\` object. + * + * function test () { + * expect(arguments).to.be.arguments; + * } + * + * test(); + * + * Add \`.not\` earlier in the chain to negate \`.arguments\`. However, it's often + * best to assert which type the target is expected to be, rather than + * asserting that it’s not an \`arguments\` object. + * + * expect('foo').to.be.a('string'); // Recommended + * expect('foo').to.not.be.arguments; // Not recommended + * + * A custom error message can be given as the second argument to \`expect\`. + * + * expect({}, 'nooo why fail??').to.be.arguments; + * + * The alias \`.Arguments\` can be used interchangeably with \`.arguments\`. + * + * @name arguments + * @alias Arguments + * @namespace BDD + * @api public + */function checkArguments(){var obj=flag(this,'object'),type=_.type(obj);this.assert('Arguments'===type,'expected #{this} to be arguments but got '+type,'expected #{this} to not be arguments');}Assertion.addProperty('arguments',checkArguments);Assertion.addProperty('Arguments',checkArguments);/** + * ### .equal(val[, msg]) + * + * Asserts that the target is strictly (\`===\`) equal to the given \`val\`. + * + * expect(1).to.equal(1); + * expect('foo').to.equal('foo'); + * + * Add \`.deep\` earlier in the chain to use deep equality instead. See the + * \`deep-eql\` project page for info on the deep equality algorithm: + * https://github.com/chaijs/deep-eql. + * + * // Target object deeply (but not strictly) equals \`{a: 1}\` + * expect({a: 1}).to.deep.equal({a: 1}); + * expect({a: 1}).to.not.equal({a: 1}); + * + * // Target array deeply (but not strictly) equals \`[1, 2]\` + * expect([1, 2]).to.deep.equal([1, 2]); + * expect([1, 2]).to.not.equal([1, 2]); + * + * Add \`.not\` earlier in the chain to negate \`.equal\`. However, it's often + * best to assert that the target is equal to its expected value, rather than + * not equal to one of countless unexpected values. + * + * expect(1).to.equal(1); // Recommended + * expect(1).to.not.equal(2); // Not recommended + * + * \`.equal\` accepts an optional \`msg\` argument which is a custom error message + * to show when the assertion fails. The message can also be given as the + * second argument to \`expect\`. + * + * expect(1).to.equal(2, 'nooo why fail??'); + * expect(1, 'nooo why fail??').to.equal(2); + * + * The aliases \`.equals\` and \`eq\` can be used interchangeably with \`.equal\`. + * + * @name equal + * @alias equals + * @alias eq + * @param {Mixed} val + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */function assertEqual(val,msg){if(msg)flag(this,'message',msg);var obj=flag(this,'object');if(flag(this,'deep')){var prevLockSsfi=flag(this,'lockSsfi');flag(this,'lockSsfi',true);this.eql(val);flag(this,'lockSsfi',prevLockSsfi);}else{this.assert(val===obj,'expected #{this} to equal #{exp}','expected #{this} to not equal #{exp}',val,this._obj,true);}}Assertion.addMethod('equal',assertEqual);Assertion.addMethod('equals',assertEqual);Assertion.addMethod('eq',assertEqual);/** + * ### .eql(obj[, msg]) + * + * Asserts that the target is deeply equal to the given \`obj\`. See the + * \`deep-eql\` project page for info on the deep equality algorithm: + * https://github.com/chaijs/deep-eql. + * + * // Target object is deeply (but not strictly) equal to {a: 1} + * expect({a: 1}).to.eql({a: 1}).but.not.equal({a: 1}); + * + * // Target array is deeply (but not strictly) equal to [1, 2] + * expect([1, 2]).to.eql([1, 2]).but.not.equal([1, 2]); + * + * Add \`.not\` earlier in the chain to negate \`.eql\`. However, it's often best + * to assert that the target is deeply equal to its expected value, rather + * than not deeply equal to one of countless unexpected values. + * + * expect({a: 1}).to.eql({a: 1}); // Recommended + * expect({a: 1}).to.not.eql({b: 2}); // Not recommended + * + * \`.eql\` accepts an optional \`msg\` argument which is a custom error message + * to show when the assertion fails. The message can also be given as the + * second argument to \`expect\`. + * + * expect({a: 1}).to.eql({b: 2}, 'nooo why fail??'); + * expect({a: 1}, 'nooo why fail??').to.eql({b: 2}); + * + * The alias \`.eqls\` can be used interchangeably with \`.eql\`. + * + * The \`.deep.equal\` assertion is almost identical to \`.eql\` but with one + * difference: \`.deep.equal\` causes deep equality comparisons to also be used + * for any other assertions that follow in the chain. + * + * @name eql + * @alias eqls + * @param {Mixed} obj + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */function assertEql(obj,msg){if(msg)flag(this,'message',msg);var eql=flag(this,'eql');this.assert(eql(obj,flag(this,'object')),'expected #{this} to deeply equal #{exp}','expected #{this} to not deeply equal #{exp}',obj,this._obj,true);}Assertion.addMethod('eql',assertEql);Assertion.addMethod('eqls',assertEql);/** + * ### .above(n[, msg]) + * + * Asserts that the target is a number or a date greater than the given number or date \`n\` respectively. + * However, it's often best to assert that the target is equal to its expected + * value. + * + * expect(2).to.equal(2); // Recommended + * expect(2).to.be.above(1); // Not recommended + * + * Add \`.lengthOf\` earlier in the chain to assert that the target's \`length\` + * or \`size\` is greater than the given number \`n\`. + * + * expect('foo').to.have.lengthOf(3); // Recommended + * expect('foo').to.have.lengthOf.above(2); // Not recommended + * + * expect([1, 2, 3]).to.have.lengthOf(3); // Recommended + * expect([1, 2, 3]).to.have.lengthOf.above(2); // Not recommended + * + * Add \`.not\` earlier in the chain to negate \`.above\`. + * + * expect(2).to.equal(2); // Recommended + * expect(1).to.not.be.above(2); // Not recommended + * + * \`.above\` accepts an optional \`msg\` argument which is a custom error message + * to show when the assertion fails. The message can also be given as the + * second argument to \`expect\`. + * + * expect(1).to.be.above(2, 'nooo why fail??'); + * expect(1, 'nooo why fail??').to.be.above(2); + * + * The aliases \`.gt\` and \`.greaterThan\` can be used interchangeably with + * \`.above\`. + * + * @name above + * @alias gt + * @alias greaterThan + * @param {Number} n + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */function assertAbove(n,msg){if(msg)flag(this,'message',msg);var obj=flag(this,'object'),doLength=flag(this,'doLength'),flagMsg=flag(this,'message'),msgPrefix=flagMsg?flagMsg+': ':'',ssfi=flag(this,'ssfi'),objType=_.type(obj).toLowerCase(),nType=_.type(n).toLowerCase(),errorMessage,shouldThrow=true;if(doLength&&objType!=='map'&&objType!=='set'){new Assertion(obj,flagMsg,ssfi,true).to.have.property('length');}if(!doLength&&objType==='date'&&nType!=='date'){errorMessage=msgPrefix+'the argument to above must be a date';}else if(nType!=='number'&&(doLength||objType==='number')){errorMessage=msgPrefix+'the argument to above must be a number';}else if(!doLength&&objType!=='date'&&objType!=='number'){var printObj=objType==='string'?"'"+obj+"'":obj;errorMessage=msgPrefix+'expected '+printObj+' to be a number or a date';}else{shouldThrow=false;}if(shouldThrow){throw new AssertionError(errorMessage,undefined,ssfi);}if(doLength){var descriptor='length',itemsCount;if(objType==='map'||objType==='set'){descriptor='size';itemsCount=obj.size;}else{itemsCount=obj.length;}this.assert(itemsCount>n,'expected #{this} to have a '+descriptor+' above #{exp} but got #{act}','expected #{this} to not have a '+descriptor+' above #{exp}',n,itemsCount);}else{this.assert(obj>n,'expected #{this} to be above #{exp}','expected #{this} to be at most #{exp}',n);}}Assertion.addMethod('above',assertAbove);Assertion.addMethod('gt',assertAbove);Assertion.addMethod('greaterThan',assertAbove);/** + * ### .least(n[, msg]) + * + * Asserts that the target is a number or a date greater than or equal to the given + * number or date \`n\` respectively. However, it's often best to assert that the target is equal to + * its expected value. + * + * expect(2).to.equal(2); // Recommended + * expect(2).to.be.at.least(1); // Not recommended + * expect(2).to.be.at.least(2); // Not recommended + * + * Add \`.lengthOf\` earlier in the chain to assert that the target's \`length\` + * or \`size\` is greater than or equal to the given number \`n\`. + * + * expect('foo').to.have.lengthOf(3); // Recommended + * expect('foo').to.have.lengthOf.at.least(2); // Not recommended + * + * expect([1, 2, 3]).to.have.lengthOf(3); // Recommended + * expect([1, 2, 3]).to.have.lengthOf.at.least(2); // Not recommended + * + * Add \`.not\` earlier in the chain to negate \`.least\`. + * + * expect(1).to.equal(1); // Recommended + * expect(1).to.not.be.at.least(2); // Not recommended + * + * \`.least\` accepts an optional \`msg\` argument which is a custom error message + * to show when the assertion fails. The message can also be given as the + * second argument to \`expect\`. + * + * expect(1).to.be.at.least(2, 'nooo why fail??'); + * expect(1, 'nooo why fail??').to.be.at.least(2); + * + * The aliases \`.gte\` and \`.greaterThanOrEqual\` can be used interchangeably with + * \`.least\`. + * + * @name least + * @alias gte + * @alias greaterThanOrEqual + * @param {Number} n + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */function assertLeast(n,msg){if(msg)flag(this,'message',msg);var obj=flag(this,'object'),doLength=flag(this,'doLength'),flagMsg=flag(this,'message'),msgPrefix=flagMsg?flagMsg+': ':'',ssfi=flag(this,'ssfi'),objType=_.type(obj).toLowerCase(),nType=_.type(n).toLowerCase(),errorMessage,shouldThrow=true;if(doLength&&objType!=='map'&&objType!=='set'){new Assertion(obj,flagMsg,ssfi,true).to.have.property('length');}if(!doLength&&objType==='date'&&nType!=='date'){errorMessage=msgPrefix+'the argument to least must be a date';}else if(nType!=='number'&&(doLength||objType==='number')){errorMessage=msgPrefix+'the argument to least must be a number';}else if(!doLength&&objType!=='date'&&objType!=='number'){var printObj=objType==='string'?"'"+obj+"'":obj;errorMessage=msgPrefix+'expected '+printObj+' to be a number or a date';}else{shouldThrow=false;}if(shouldThrow){throw new AssertionError(errorMessage,undefined,ssfi);}if(doLength){var descriptor='length',itemsCount;if(objType==='map'||objType==='set'){descriptor='size';itemsCount=obj.size;}else{itemsCount=obj.length;}this.assert(itemsCount>=n,'expected #{this} to have a '+descriptor+' at least #{exp} but got #{act}','expected #{this} to have a '+descriptor+' below #{exp}',n,itemsCount);}else{this.assert(obj>=n,'expected #{this} to be at least #{exp}','expected #{this} to be below #{exp}',n);}}Assertion.addMethod('least',assertLeast);Assertion.addMethod('gte',assertLeast);Assertion.addMethod('greaterThanOrEqual',assertLeast);/** + * ### .below(n[, msg]) + * + * Asserts that the target is a number or a date less than the given number or date \`n\` respectively. + * However, it's often best to assert that the target is equal to its expected + * value. + * + * expect(1).to.equal(1); // Recommended + * expect(1).to.be.below(2); // Not recommended + * + * Add \`.lengthOf\` earlier in the chain to assert that the target's \`length\` + * or \`size\` is less than the given number \`n\`. + * + * expect('foo').to.have.lengthOf(3); // Recommended + * expect('foo').to.have.lengthOf.below(4); // Not recommended + * + * expect([1, 2, 3]).to.have.length(3); // Recommended + * expect([1, 2, 3]).to.have.lengthOf.below(4); // Not recommended + * + * Add \`.not\` earlier in the chain to negate \`.below\`. + * + * expect(2).to.equal(2); // Recommended + * expect(2).to.not.be.below(1); // Not recommended + * + * \`.below\` accepts an optional \`msg\` argument which is a custom error message + * to show when the assertion fails. The message can also be given as the + * second argument to \`expect\`. + * + * expect(2).to.be.below(1, 'nooo why fail??'); + * expect(2, 'nooo why fail??').to.be.below(1); + * + * The aliases \`.lt\` and \`.lessThan\` can be used interchangeably with + * \`.below\`. + * + * @name below + * @alias lt + * @alias lessThan + * @param {Number} n + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */function assertBelow(n,msg){if(msg)flag(this,'message',msg);var obj=flag(this,'object'),doLength=flag(this,'doLength'),flagMsg=flag(this,'message'),msgPrefix=flagMsg?flagMsg+': ':'',ssfi=flag(this,'ssfi'),objType=_.type(obj).toLowerCase(),nType=_.type(n).toLowerCase(),errorMessage,shouldThrow=true;if(doLength&&objType!=='map'&&objType!=='set'){new Assertion(obj,flagMsg,ssfi,true).to.have.property('length');}if(!doLength&&objType==='date'&&nType!=='date'){errorMessage=msgPrefix+'the argument to below must be a date';}else if(nType!=='number'&&(doLength||objType==='number')){errorMessage=msgPrefix+'the argument to below must be a number';}else if(!doLength&&objType!=='date'&&objType!=='number'){var printObj=objType==='string'?"'"+obj+"'":obj;errorMessage=msgPrefix+'expected '+printObj+' to be a number or a date';}else{shouldThrow=false;}if(shouldThrow){throw new AssertionError(errorMessage,undefined,ssfi);}if(doLength){var descriptor='length',itemsCount;if(objType==='map'||objType==='set'){descriptor='size';itemsCount=obj.size;}else{itemsCount=obj.length;}this.assert(itemsCount=start&&itemsCount<=finish,'expected #{this} to have a '+descriptor+' within '+range,'expected #{this} to not have a '+descriptor+' within '+range);}else{this.assert(obj>=start&&obj<=finish,'expected #{this} to be within '+range,'expected #{this} to not be within '+range);}});/** + * ### .instanceof(constructor[, msg]) + * + * Asserts that the target is an instance of the given \`constructor\`. + * + * function Cat () { } + * + * expect(new Cat()).to.be.an.instanceof(Cat); + * expect([1, 2]).to.be.an.instanceof(Array); + * + * Add \`.not\` earlier in the chain to negate \`.instanceof\`. + * + * expect({a: 1}).to.not.be.an.instanceof(Array); + * + * \`.instanceof\` accepts an optional \`msg\` argument which is a custom error + * message to show when the assertion fails. The message can also be given as + * the second argument to \`expect\`. + * + * expect(1).to.be.an.instanceof(Array, 'nooo why fail??'); + * expect(1, 'nooo why fail??').to.be.an.instanceof(Array); + * + * Due to limitations in ES5, \`.instanceof\` may not always work as expected + * when using a transpiler such as Babel or TypeScript. In particular, it may + * produce unexpected results when subclassing built-in object such as + * \`Array\`, \`Error\`, and \`Map\`. See your transpiler's docs for details: + * + * - ([Babel](https://babeljs.io/docs/usage/caveats/#classes)) + * - ([TypeScript](https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work)) + * + * The alias \`.instanceOf\` can be used interchangeably with \`.instanceof\`. + * + * @name instanceof + * @param {Constructor} constructor + * @param {String} msg _optional_ + * @alias instanceOf + * @namespace BDD + * @api public + */function assertInstanceOf(constructor,msg){if(msg)flag(this,'message',msg);var target=flag(this,'object');var ssfi=flag(this,'ssfi');var flagMsg=flag(this,'message');try{var isInstanceOf=target instanceof constructor;}catch(err){if(err instanceof TypeError){flagMsg=flagMsg?flagMsg+': ':'';throw new AssertionError(flagMsg+'The instanceof assertion needs a constructor but '+_.type(constructor)+' was given.',undefined,ssfi);}throw err;}var name=_.getName(constructor);if(name===null){name='an unnamed constructor';}this.assert(isInstanceOf,'expected #{this} to be an instance of '+name,'expected #{this} to not be an instance of '+name);}Assertion.addMethod('instanceof',assertInstanceOf);Assertion.addMethod('instanceOf',assertInstanceOf);/** + * ### .property(name[, val[, msg]]) + * + * Asserts that the target has a property with the given key \`name\`. + * + * expect({a: 1}).to.have.property('a'); + * + * When \`val\` is provided, \`.property\` also asserts that the property's value + * is equal to the given \`val\`. + * + * expect({a: 1}).to.have.property('a', 1); + * + * By default, strict (\`===\`) equality is used. Add \`.deep\` earlier in the + * chain to use deep equality instead. See the \`deep-eql\` project page for + * info on the deep equality algorithm: https://github.com/chaijs/deep-eql. + * + * // Target object deeply (but not strictly) has property \`x: {a: 1}\` + * expect({x: {a: 1}}).to.have.deep.property('x', {a: 1}); + * expect({x: {a: 1}}).to.not.have.property('x', {a: 1}); + * + * The target's enumerable and non-enumerable properties are always included + * in the search. By default, both own and inherited properties are included. + * Add \`.own\` earlier in the chain to exclude inherited properties from the + * search. + * + * Object.prototype.b = 2; + * + * expect({a: 1}).to.have.own.property('a'); + * expect({a: 1}).to.have.own.property('a', 1); + * expect({a: 1}).to.have.property('b'); + * expect({a: 1}).to.not.have.own.property('b'); + * + * \`.deep\` and \`.own\` can be combined. + * + * expect({x: {a: 1}}).to.have.deep.own.property('x', {a: 1}); + * + * Add \`.nested\` earlier in the chain to enable dot- and bracket-notation when + * referencing nested properties. + * + * expect({a: {b: ['x', 'y']}}).to.have.nested.property('a.b[1]'); + * expect({a: {b: ['x', 'y']}}).to.have.nested.property('a.b[1]', 'y'); + * + * If \`.\` or \`[]\` are part of an actual property name, they can be escaped by + * adding two backslashes before them. + * + * expect({'.a': {'[b]': 'x'}}).to.have.nested.property('\\\\.a.\\\\[b\\\\]'); + * + * \`.deep\` and \`.nested\` can be combined. + * + * expect({a: {b: [{c: 3}]}}) + * .to.have.deep.nested.property('a.b[0]', {c: 3}); + * + * \`.own\` and \`.nested\` cannot be combined. + * + * Add \`.not\` earlier in the chain to negate \`.property\`. + * + * expect({a: 1}).to.not.have.property('b'); + * + * However, it's dangerous to negate \`.property\` when providing \`val\`. The + * problem is that it creates uncertain expectations by asserting that the + * target either doesn't have a property with the given key \`name\`, or that it + * does have a property with the given key \`name\` but its value isn't equal to + * the given \`val\`. It's often best to identify the exact output that's + * expected, and then write an assertion that only accepts that exact output. + * + * When the target isn't expected to have a property with the given key + * \`name\`, it's often best to assert exactly that. + * + * expect({b: 2}).to.not.have.property('a'); // Recommended + * expect({b: 2}).to.not.have.property('a', 1); // Not recommended + * + * When the target is expected to have a property with the given key \`name\`, + * it's often best to assert that the property has its expected value, rather + * than asserting that it doesn't have one of many unexpected values. + * + * expect({a: 3}).to.have.property('a', 3); // Recommended + * expect({a: 3}).to.not.have.property('a', 1); // Not recommended + * + * \`.property\` changes the target of any assertions that follow in the chain + * to be the value of the property from the original target object. + * + * expect({a: 1}).to.have.property('a').that.is.a('number'); + * + * \`.property\` accepts an optional \`msg\` argument which is a custom error + * message to show when the assertion fails. The message can also be given as + * the second argument to \`expect\`. When not providing \`val\`, only use the + * second form. + * + * // Recommended + * expect({a: 1}).to.have.property('a', 2, 'nooo why fail??'); + * expect({a: 1}, 'nooo why fail??').to.have.property('a', 2); + * expect({a: 1}, 'nooo why fail??').to.have.property('b'); + * + * // Not recommended + * expect({a: 1}).to.have.property('b', undefined, 'nooo why fail??'); + * + * The above assertion isn't the same thing as not providing \`val\`. Instead, + * it's asserting that the target object has a \`b\` property that's equal to + * \`undefined\`. + * + * The assertions \`.ownProperty\` and \`.haveOwnProperty\` can be used + * interchangeably with \`.own.property\`. + * + * @name property + * @param {String} name + * @param {Mixed} val (optional) + * @param {String} msg _optional_ + * @returns value of property for chaining + * @namespace BDD + * @api public + */function assertProperty(name,val,msg){if(msg)flag(this,'message',msg);var isNested=flag(this,'nested'),isOwn=flag(this,'own'),flagMsg=flag(this,'message'),obj=flag(this,'object'),ssfi=flag(this,'ssfi'),nameType=typeof name;flagMsg=flagMsg?flagMsg+': ':'';if(isNested){if(nameType!=='string'){throw new AssertionError(flagMsg+'the argument to property must be a string when using nested syntax',undefined,ssfi);}}else{if(nameType!=='string'&&nameType!=='number'&&nameType!=='symbol'){throw new AssertionError(flagMsg+'the argument to property must be a string, number, or symbol',undefined,ssfi);}}if(isNested&&isOwn){throw new AssertionError(flagMsg+'The "nested" and "own" flags cannot be combined.',undefined,ssfi);}if(obj===null||obj===undefined){throw new AssertionError(flagMsg+'Target cannot be null or undefined.',undefined,ssfi);}var isDeep=flag(this,'deep'),negate=flag(this,'negate'),pathInfo=isNested?_.getPathInfo(obj,name):null,value=isNested?pathInfo.value:obj[name],isEql=isDeep?flag(this,'eql'):(val1,val2)=>val1===val2;var descriptor='';if(isDeep)descriptor+='deep ';if(isOwn)descriptor+='own ';if(isNested)descriptor+='nested ';descriptor+='property ';var hasProperty;if(isOwn)hasProperty=Object.prototype.hasOwnProperty.call(obj,name);else if(isNested)hasProperty=pathInfo.exists;else hasProperty=_.hasProperty(obj,name);// When performing a negated assertion for both name and val, merely having +// a property with the given name isn't enough to cause the assertion to +// fail. It must both have a property with the given name, and the value of +// that property must equal the given val. Therefore, skip this assertion in +// favor of the next. +if(!negate||arguments.length===1){this.assert(hasProperty,'expected #{this} to have '+descriptor+_.inspect(name),'expected #{this} to not have '+descriptor+_.inspect(name));}if(arguments.length>1){this.assert(hasProperty&&isEql(val,value),'expected #{this} to have '+descriptor+_.inspect(name)+' of #{exp}, but got #{act}','expected #{this} to not have '+descriptor+_.inspect(name)+' of #{act}',val,value);}flag(this,'object',value);}Assertion.addMethod('property',assertProperty);function assertOwnProperty(name,value,msg){flag(this,'own',true);assertProperty.apply(this,arguments);}Assertion.addMethod('ownProperty',assertOwnProperty);Assertion.addMethod('haveOwnProperty',assertOwnProperty);/** + * ### .ownPropertyDescriptor(name[, descriptor[, msg]]) + * + * Asserts that the target has its own property descriptor with the given key + * \`name\`. Enumerable and non-enumerable properties are included in the + * search. + * + * expect({a: 1}).to.have.ownPropertyDescriptor('a'); + * + * When \`descriptor\` is provided, \`.ownPropertyDescriptor\` also asserts that + * the property's descriptor is deeply equal to the given \`descriptor\`. See + * the \`deep-eql\` project page for info on the deep equality algorithm: + * https://github.com/chaijs/deep-eql. + * + * expect({a: 1}).to.have.ownPropertyDescriptor('a', { + * configurable: true, + * enumerable: true, + * writable: true, + * value: 1, + * }); + * + * Add \`.not\` earlier in the chain to negate \`.ownPropertyDescriptor\`. + * + * expect({a: 1}).to.not.have.ownPropertyDescriptor('b'); + * + * However, it's dangerous to negate \`.ownPropertyDescriptor\` when providing + * a \`descriptor\`. The problem is that it creates uncertain expectations by + * asserting that the target either doesn't have a property descriptor with + * the given key \`name\`, or that it does have a property descriptor with the + * given key \`name\` but it’s not deeply equal to the given \`descriptor\`. It's + * often best to identify the exact output that's expected, and then write an + * assertion that only accepts that exact output. + * + * When the target isn't expected to have a property descriptor with the given + * key \`name\`, it's often best to assert exactly that. + * + * // Recommended + * expect({b: 2}).to.not.have.ownPropertyDescriptor('a'); + * + * // Not recommended + * expect({b: 2}).to.not.have.ownPropertyDescriptor('a', { + * configurable: true, + * enumerable: true, + * writable: true, + * value: 1, + * }); + * + * When the target is expected to have a property descriptor with the given + * key \`name\`, it's often best to assert that the property has its expected + * descriptor, rather than asserting that it doesn't have one of many + * unexpected descriptors. + * + * // Recommended + * expect({a: 3}).to.have.ownPropertyDescriptor('a', { + * configurable: true, + * enumerable: true, + * writable: true, + * value: 3, + * }); + * + * // Not recommended + * expect({a: 3}).to.not.have.ownPropertyDescriptor('a', { + * configurable: true, + * enumerable: true, + * writable: true, + * value: 1, + * }); + * + * \`.ownPropertyDescriptor\` changes the target of any assertions that follow + * in the chain to be the value of the property descriptor from the original + * target object. + * + * expect({a: 1}).to.have.ownPropertyDescriptor('a') + * .that.has.property('enumerable', true); + * + * \`.ownPropertyDescriptor\` accepts an optional \`msg\` argument which is a + * custom error message to show when the assertion fails. The message can also + * be given as the second argument to \`expect\`. When not providing + * \`descriptor\`, only use the second form. + * + * // Recommended + * expect({a: 1}).to.have.ownPropertyDescriptor('a', { + * configurable: true, + * enumerable: true, + * writable: true, + * value: 2, + * }, 'nooo why fail??'); + * + * // Recommended + * expect({a: 1}, 'nooo why fail??').to.have.ownPropertyDescriptor('a', { + * configurable: true, + * enumerable: true, + * writable: true, + * value: 2, + * }); + * + * // Recommended + * expect({a: 1}, 'nooo why fail??').to.have.ownPropertyDescriptor('b'); + * + * // Not recommended + * expect({a: 1}) + * .to.have.ownPropertyDescriptor('b', undefined, 'nooo why fail??'); + * + * The above assertion isn't the same thing as not providing \`descriptor\`. + * Instead, it's asserting that the target object has a \`b\` property + * descriptor that's deeply equal to \`undefined\`. + * + * The alias \`.haveOwnPropertyDescriptor\` can be used interchangeably with + * \`.ownPropertyDescriptor\`. + * + * @name ownPropertyDescriptor + * @alias haveOwnPropertyDescriptor + * @param {String} name + * @param {Object} descriptor _optional_ + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */function assertOwnPropertyDescriptor(name,descriptor,msg){if(typeof descriptor==='string'){msg=descriptor;descriptor=null;}if(msg)flag(this,'message',msg);var obj=flag(this,'object');var actualDescriptor=Object.getOwnPropertyDescriptor(Object(obj),name);var eql=flag(this,'eql');if(actualDescriptor&&descriptor){this.assert(eql(descriptor,actualDescriptor),'expected the own property descriptor for '+_.inspect(name)+' on #{this} to match '+_.inspect(descriptor)+', got '+_.inspect(actualDescriptor),'expected the own property descriptor for '+_.inspect(name)+' on #{this} to not match '+_.inspect(descriptor),descriptor,actualDescriptor,true);}else{this.assert(actualDescriptor,'expected #{this} to have an own property descriptor for '+_.inspect(name),'expected #{this} to not have an own property descriptor for '+_.inspect(name));}flag(this,'object',actualDescriptor);}Assertion.addMethod('ownPropertyDescriptor',assertOwnPropertyDescriptor);Assertion.addMethod('haveOwnPropertyDescriptor',assertOwnPropertyDescriptor);/** + * ### .lengthOf(n[, msg]) + * + * Asserts that the target's \`length\` or \`size\` is equal to the given number + * \`n\`. + * + * expect([1, 2, 3]).to.have.lengthOf(3); + * expect('foo').to.have.lengthOf(3); + * expect(new Set([1, 2, 3])).to.have.lengthOf(3); + * expect(new Map([['a', 1], ['b', 2], ['c', 3]])).to.have.lengthOf(3); + * + * Add \`.not\` earlier in the chain to negate \`.lengthOf\`. However, it's often + * best to assert that the target's \`length\` property is equal to its expected + * value, rather than not equal to one of many unexpected values. + * + * expect('foo').to.have.lengthOf(3); // Recommended + * expect('foo').to.not.have.lengthOf(4); // Not recommended + * + * \`.lengthOf\` accepts an optional \`msg\` argument which is a custom error + * message to show when the assertion fails. The message can also be given as + * the second argument to \`expect\`. + * + * expect([1, 2, 3]).to.have.lengthOf(2, 'nooo why fail??'); + * expect([1, 2, 3], 'nooo why fail??').to.have.lengthOf(2); + * + * \`.lengthOf\` can also be used as a language chain, causing all \`.above\`, + * \`.below\`, \`.least\`, \`.most\`, and \`.within\` assertions that follow in the + * chain to use the target's \`length\` property as the target. However, it's + * often best to assert that the target's \`length\` property is equal to its + * expected length, rather than asserting that its \`length\` property falls + * within some range of values. + * + * // Recommended + * expect([1, 2, 3]).to.have.lengthOf(3); + * + * // Not recommended + * expect([1, 2, 3]).to.have.lengthOf.above(2); + * expect([1, 2, 3]).to.have.lengthOf.below(4); + * expect([1, 2, 3]).to.have.lengthOf.at.least(3); + * expect([1, 2, 3]).to.have.lengthOf.at.most(3); + * expect([1, 2, 3]).to.have.lengthOf.within(2,4); + * + * Due to a compatibility issue, the alias \`.length\` can't be chained directly + * off of an uninvoked method such as \`.a\`. Therefore, \`.length\` can't be used + * interchangeably with \`.lengthOf\` in every situation. It's recommended to + * always use \`.lengthOf\` instead of \`.length\`. + * + * expect([1, 2, 3]).to.have.a.length(3); // incompatible; throws error + * expect([1, 2, 3]).to.have.a.lengthOf(3); // passes as expected + * + * @name lengthOf + * @alias length + * @param {Number} n + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */function assertLengthChain(){flag(this,'doLength',true);}function assertLength(n,msg){if(msg)flag(this,'message',msg);var obj=flag(this,'object'),objType=_.type(obj).toLowerCase(),flagMsg=flag(this,'message'),ssfi=flag(this,'ssfi'),descriptor='length',itemsCount;switch(objType){case'map':case'set':descriptor='size';itemsCount=obj.size;break;default:new Assertion(obj,flagMsg,ssfi,true).to.have.property('length');itemsCount=obj.length;}this.assert(itemsCount==n,'expected #{this} to have a '+descriptor+' of #{exp} but got #{act}','expected #{this} to not have a '+descriptor+' of #{act}',n,itemsCount);}Assertion.addChainableMethod('length',assertLength,assertLengthChain);Assertion.addChainableMethod('lengthOf',assertLength,assertLengthChain);/** + * ### .match(re[, msg]) + * + * Asserts that the target matches the given regular expression \`re\`. + * + * expect('foobar').to.match(/^foo/); + * + * Add \`.not\` earlier in the chain to negate \`.match\`. + * + * expect('foobar').to.not.match(/taco/); + * + * \`.match\` accepts an optional \`msg\` argument which is a custom error message + * to show when the assertion fails. The message can also be given as the + * second argument to \`expect\`. + * + * expect('foobar').to.match(/taco/, 'nooo why fail??'); + * expect('foobar', 'nooo why fail??').to.match(/taco/); + * + * The alias \`.matches\` can be used interchangeably with \`.match\`. + * + * @name match + * @alias matches + * @param {RegExp} re + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */function assertMatch(re,msg){if(msg)flag(this,'message',msg);var obj=flag(this,'object');this.assert(re.exec(obj),'expected #{this} to match '+re,'expected #{this} not to match '+re);}Assertion.addMethod('match',assertMatch);Assertion.addMethod('matches',assertMatch);/** + * ### .string(str[, msg]) + * + * Asserts that the target string contains the given substring \`str\`. + * + * expect('foobar').to.have.string('bar'); + * + * Add \`.not\` earlier in the chain to negate \`.string\`. + * + * expect('foobar').to.not.have.string('taco'); + * + * \`.string\` accepts an optional \`msg\` argument which is a custom error + * message to show when the assertion fails. The message can also be given as + * the second argument to \`expect\`. + * + * expect('foobar').to.have.string('taco', 'nooo why fail??'); + * expect('foobar', 'nooo why fail??').to.have.string('taco'); + * + * @name string + * @param {String} str + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */Assertion.addMethod('string',function(str,msg){if(msg)flag(this,'message',msg);var obj=flag(this,'object'),flagMsg=flag(this,'message'),ssfi=flag(this,'ssfi');new Assertion(obj,flagMsg,ssfi,true).is.a('string');this.assert(~obj.indexOf(str),'expected #{this} to contain '+_.inspect(str),'expected #{this} to not contain '+_.inspect(str));});/** + * ### .keys(key1[, key2[, ...]]) + * + * Asserts that the target object, array, map, or set has the given keys. Only + * the target's own inherited properties are included in the search. + * + * When the target is an object or array, keys can be provided as one or more + * string arguments, a single array argument, or a single object argument. In + * the latter case, only the keys in the given object matter; the values are + * ignored. + * + * expect({a: 1, b: 2}).to.have.all.keys('a', 'b'); + * expect(['x', 'y']).to.have.all.keys(0, 1); + * + * expect({a: 1, b: 2}).to.have.all.keys(['a', 'b']); + * expect(['x', 'y']).to.have.all.keys([0, 1]); + * + * expect({a: 1, b: 2}).to.have.all.keys({a: 4, b: 5}); // ignore 4 and 5 + * expect(['x', 'y']).to.have.all.keys({0: 4, 1: 5}); // ignore 4 and 5 + * + * When the target is a map or set, each key must be provided as a separate + * argument. + * + * expect(new Map([['a', 1], ['b', 2]])).to.have.all.keys('a', 'b'); + * expect(new Set(['a', 'b'])).to.have.all.keys('a', 'b'); + * + * Because \`.keys\` does different things based on the target's type, it's + * important to check the target's type before using \`.keys\`. See the \`.a\` doc + * for info on testing a target's type. + * + * expect({a: 1, b: 2}).to.be.an('object').that.has.all.keys('a', 'b'); + * + * By default, strict (\`===\`) equality is used to compare keys of maps and + * sets. Add \`.deep\` earlier in the chain to use deep equality instead. See + * the \`deep-eql\` project page for info on the deep equality algorithm: + * https://github.com/chaijs/deep-eql. + * + * // Target set deeply (but not strictly) has key \`{a: 1}\` + * expect(new Set([{a: 1}])).to.have.all.deep.keys([{a: 1}]); + * expect(new Set([{a: 1}])).to.not.have.all.keys([{a: 1}]); + * + * By default, the target must have all of the given keys and no more. Add + * \`.any\` earlier in the chain to only require that the target have at least + * one of the given keys. Also, add \`.not\` earlier in the chain to negate + * \`.keys\`. It's often best to add \`.any\` when negating \`.keys\`, and to use + * \`.all\` when asserting \`.keys\` without negation. + * + * When negating \`.keys\`, \`.any\` is preferred because \`.not.any.keys\` asserts + * exactly what's expected of the output, whereas \`.not.all.keys\` creates + * uncertain expectations. + * + * // Recommended; asserts that target doesn't have any of the given keys + * expect({a: 1, b: 2}).to.not.have.any.keys('c', 'd'); + * + * // Not recommended; asserts that target doesn't have all of the given + * // keys but may or may not have some of them + * expect({a: 1, b: 2}).to.not.have.all.keys('c', 'd'); + * + * When asserting \`.keys\` without negation, \`.all\` is preferred because + * \`.all.keys\` asserts exactly what's expected of the output, whereas + * \`.any.keys\` creates uncertain expectations. + * + * // Recommended; asserts that target has all the given keys + * expect({a: 1, b: 2}).to.have.all.keys('a', 'b'); + * + * // Not recommended; asserts that target has at least one of the given + * // keys but may or may not have more of them + * expect({a: 1, b: 2}).to.have.any.keys('a', 'b'); + * + * Note that \`.all\` is used by default when neither \`.all\` nor \`.any\` appear + * earlier in the chain. However, it's often best to add \`.all\` anyway because + * it improves readability. + * + * // Both assertions are identical + * expect({a: 1, b: 2}).to.have.all.keys('a', 'b'); // Recommended + * expect({a: 1, b: 2}).to.have.keys('a', 'b'); // Not recommended + * + * Add \`.include\` earlier in the chain to require that the target's keys be a + * superset of the expected keys, rather than identical sets. + * + * // Target object's keys are a superset of ['a', 'b'] but not identical + * expect({a: 1, b: 2, c: 3}).to.include.all.keys('a', 'b'); + * expect({a: 1, b: 2, c: 3}).to.not.have.all.keys('a', 'b'); + * + * However, if \`.any\` and \`.include\` are combined, only the \`.any\` takes + * effect. The \`.include\` is ignored in this case. + * + * // Both assertions are identical + * expect({a: 1}).to.have.any.keys('a', 'b'); + * expect({a: 1}).to.include.any.keys('a', 'b'); + * + * A custom error message can be given as the second argument to \`expect\`. + * + * expect({a: 1}, 'nooo why fail??').to.have.key('b'); + * + * The alias \`.key\` can be used interchangeably with \`.keys\`. + * + * @name keys + * @alias key + * @param {...String|Array|Object} keys + * @namespace BDD + * @api public + */function assertKeys(keys){var obj=flag(this,'object'),objType=_.type(obj),keysType=_.type(keys),ssfi=flag(this,'ssfi'),isDeep=flag(this,'deep'),str,deepStr='',actual,ok=true,flagMsg=flag(this,'message');flagMsg=flagMsg?flagMsg+': ':'';var mixedArgsMsg=flagMsg+'when testing keys against an object or an array you must give a single Array|Object|String argument or multiple String arguments';if(objType==='Map'||objType==='Set'){deepStr=isDeep?'deeply ':'';actual=[];// Map and Set '.keys' aren't supported in IE 11. Therefore, use .forEach. +obj.forEach(function(val,key){actual.push(key);});if(keysType!=='Array'){keys=Array.prototype.slice.call(arguments);}}else{actual=_.getOwnEnumerableProperties(obj);switch(keysType){case'Array':if(arguments.length>1){throw new AssertionError(mixedArgsMsg,undefined,ssfi);}break;case'Object':if(arguments.length>1){throw new AssertionError(mixedArgsMsg,undefined,ssfi);}keys=Object.keys(keys);break;default:keys=Array.prototype.slice.call(arguments);}// Only stringify non-Symbols because Symbols would become "Symbol()" +keys=keys.map(function(val){return typeof val==='symbol'?val:String(val);});}if(!keys.length){throw new AssertionError(flagMsg+'keys required',undefined,ssfi);}var len=keys.length,any=flag(this,'any'),all=flag(this,'all'),expected=keys,isEql=isDeep?flag(this,'eql'):(val1,val2)=>val1===val2;if(!any&&!all){all=true;}// Has any +if(any){ok=expected.some(function(expectedKey){return actual.some(function(actualKey){return isEql(expectedKey,actualKey);});});}// Has all +if(all){ok=expected.every(function(expectedKey){return actual.some(function(actualKey){return isEql(expectedKey,actualKey);});});if(!flag(this,'contains')){ok=ok&&keys.length==actual.length;}}// Key string +if(len>1){keys=keys.map(function(key){return _.inspect(key);});var last=keys.pop();if(all){str=keys.join(', ')+', and '+last;}if(any){str=keys.join(', ')+', or '+last;}}else{str=_.inspect(keys[0]);}// Form +str=(len>1?'keys ':'key ')+str;// Have / include +str=(flag(this,'contains')?'contain ':'have ')+str;// Assertion +this.assert(ok,'expected #{this} to '+deepStr+str,'expected #{this} to not '+deepStr+str,expected.slice(0).sort(_.compareByInspect),actual.sort(_.compareByInspect),true);}Assertion.addMethod('keys',assertKeys);Assertion.addMethod('key',assertKeys);/** + * ### .throw([errorLike], [errMsgMatcher], [msg]) + * + * When no arguments are provided, \`.throw\` invokes the target function and + * asserts that an error is thrown. + * + * var badFn = function () { throw new TypeError('Illegal salmon!'); }; + * + * expect(badFn).to.throw(); + * + * When one argument is provided, and it's an error constructor, \`.throw\` + * invokes the target function and asserts that an error is thrown that's an + * instance of that error constructor. + * + * var badFn = function () { throw new TypeError('Illegal salmon!'); }; + * + * expect(badFn).to.throw(TypeError); + * + * When one argument is provided, and it's an error instance, \`.throw\` invokes + * the target function and asserts that an error is thrown that's strictly + * (\`===\`) equal to that error instance. + * + * var err = new TypeError('Illegal salmon!'); + * var badFn = function () { throw err; }; + * + * expect(badFn).to.throw(err); + * + * When one argument is provided, and it's a string, \`.throw\` invokes the + * target function and asserts that an error is thrown with a message that + * contains that string. + * + * var badFn = function () { throw new TypeError('Illegal salmon!'); }; + * + * expect(badFn).to.throw('salmon'); + * + * When one argument is provided, and it's a regular expression, \`.throw\` + * invokes the target function and asserts that an error is thrown with a + * message that matches that regular expression. + * + * var badFn = function () { throw new TypeError('Illegal salmon!'); }; + * + * expect(badFn).to.throw(/salmon/); + * + * When two arguments are provided, and the first is an error instance or + * constructor, and the second is a string or regular expression, \`.throw\` + * invokes the function and asserts that an error is thrown that fulfills both + * conditions as described above. + * + * var err = new TypeError('Illegal salmon!'); + * var badFn = function () { throw err; }; + * + * expect(badFn).to.throw(TypeError, 'salmon'); + * expect(badFn).to.throw(TypeError, /salmon/); + * expect(badFn).to.throw(err, 'salmon'); + * expect(badFn).to.throw(err, /salmon/); + * + * Add \`.not\` earlier in the chain to negate \`.throw\`. + * + * var goodFn = function () {}; + * + * expect(goodFn).to.not.throw(); + * + * However, it's dangerous to negate \`.throw\` when providing any arguments. + * The problem is that it creates uncertain expectations by asserting that the + * target either doesn't throw an error, or that it throws an error but of a + * different type than the given type, or that it throws an error of the given + * type but with a message that doesn't include the given string. It's often + * best to identify the exact output that's expected, and then write an + * assertion that only accepts that exact output. + * + * When the target isn't expected to throw an error, it's often best to assert + * exactly that. + * + * var goodFn = function () {}; + * + * expect(goodFn).to.not.throw(); // Recommended + * expect(goodFn).to.not.throw(ReferenceError, 'x'); // Not recommended + * + * When the target is expected to throw an error, it's often best to assert + * that the error is of its expected type, and has a message that includes an + * expected string, rather than asserting that it doesn't have one of many + * unexpected types, and doesn't have a message that includes some string. + * + * var badFn = function () { throw new TypeError('Illegal salmon!'); }; + * + * expect(badFn).to.throw(TypeError, 'salmon'); // Recommended + * expect(badFn).to.not.throw(ReferenceError, 'x'); // Not recommended + * + * \`.throw\` changes the target of any assertions that follow in the chain to + * be the error object that's thrown. + * + * var err = new TypeError('Illegal salmon!'); + * err.code = 42; + * var badFn = function () { throw err; }; + * + * expect(badFn).to.throw(TypeError).with.property('code', 42); + * + * \`.throw\` accepts an optional \`msg\` argument which is a custom error message + * to show when the assertion fails. The message can also be given as the + * second argument to \`expect\`. When not providing two arguments, always use + * the second form. + * + * var goodFn = function () {}; + * + * expect(goodFn).to.throw(TypeError, 'x', 'nooo why fail??'); + * expect(goodFn, 'nooo why fail??').to.throw(); + * + * Due to limitations in ES5, \`.throw\` may not always work as expected when + * using a transpiler such as Babel or TypeScript. In particular, it may + * produce unexpected results when subclassing the built-in \`Error\` object and + * then passing the subclassed constructor to \`.throw\`. See your transpiler's + * docs for details: + * + * - ([Babel](https://babeljs.io/docs/usage/caveats/#classes)) + * - ([TypeScript](https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work)) + * + * Beware of some common mistakes when using the \`throw\` assertion. One common + * mistake is to accidentally invoke the function yourself instead of letting + * the \`throw\` assertion invoke the function for you. For example, when + * testing if a function named \`fn\` throws, provide \`fn\` instead of \`fn()\` as + * the target for the assertion. + * + * expect(fn).to.throw(); // Good! Tests \`fn\` as desired + * expect(fn()).to.throw(); // Bad! Tests result of \`fn()\`, not \`fn\` + * + * If you need to assert that your function \`fn\` throws when passed certain + * arguments, then wrap a call to \`fn\` inside of another function. + * + * expect(function () { fn(42); }).to.throw(); // Function expression + * expect(() => fn(42)).to.throw(); // ES6 arrow function + * + * Another common mistake is to provide an object method (or any stand-alone + * function that relies on \`this\`) as the target of the assertion. Doing so is + * problematic because the \`this\` context will be lost when the function is + * invoked by \`.throw\`; there's no way for it to know what \`this\` is supposed + * to be. There are two ways around this problem. One solution is to wrap the + * method or function call inside of another function. Another solution is to + * use \`bind\`. + * + * expect(function () { cat.meow(); }).to.throw(); // Function expression + * expect(() => cat.meow()).to.throw(); // ES6 arrow function + * expect(cat.meow.bind(cat)).to.throw(); // Bind + * + * Finally, it's worth mentioning that it's a best practice in JavaScript to + * only throw \`Error\` and derivatives of \`Error\` such as \`ReferenceError\`, + * \`TypeError\`, and user-defined objects that extend \`Error\`. No other type of + * value will generate a stack trace when initialized. With that said, the + * \`throw\` assertion does technically support any type of value being thrown, + * not just \`Error\` and its derivatives. + * + * The aliases \`.throws\` and \`.Throw\` can be used interchangeably with + * \`.throw\`. + * + * @name throw + * @alias throws + * @alias Throw + * @param {Error|ErrorConstructor} errorLike + * @param {String|RegExp} errMsgMatcher error message + * @param {String} msg _optional_ + * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types + * @returns error for chaining (null if no error) + * @namespace BDD + * @api public + */function assertThrows(errorLike,errMsgMatcher,msg){if(msg)flag(this,'message',msg);var obj=flag(this,'object'),ssfi=flag(this,'ssfi'),flagMsg=flag(this,'message'),negate=flag(this,'negate')||false;new Assertion(obj,flagMsg,ssfi,true).is.a('function');if(errorLike instanceof RegExp||typeof errorLike==='string'){errMsgMatcher=errorLike;errorLike=null;}var caughtErr;try{obj();}catch(err){caughtErr=err;}// If we have the negate flag enabled and at least one valid argument it means we do expect an error +// but we want it to match a given set of criteria +var everyArgIsUndefined=errorLike===undefined&&errMsgMatcher===undefined;// If we've got the negate flag enabled and both args, we should only fail if both aren't compatible +// See Issue #551 and PR #683@GitHub +var everyArgIsDefined=Boolean(errorLike&&errMsgMatcher);var errorLikeFail=false;var errMsgMatcherFail=false;// Checking if error was thrown +if(everyArgIsUndefined||!everyArgIsUndefined&&!negate){// We need this to display results correctly according to their types +var errorLikeString='an error';if(errorLike instanceof Error){errorLikeString='#{exp}';}else if(errorLike){errorLikeString=_.checkError.getConstructorName(errorLike);}this.assert(caughtErr,'expected #{this} to throw '+errorLikeString,'expected #{this} to not throw an error but #{act} was thrown',errorLike&&errorLike.toString(),caughtErr instanceof Error?caughtErr.toString():typeof caughtErr==='string'?caughtErr:caughtErr&&_.checkError.getConstructorName(caughtErr));}if(errorLike&&caughtErr){// We should compare instances only if \`errorLike\` is an instance of \`Error\` +if(errorLike instanceof Error){var isCompatibleInstance=_.checkError.compatibleInstance(caughtErr,errorLike);if(isCompatibleInstance===negate){// These checks were created to ensure we won't fail too soon when we've got both args and a negate +// See Issue #551 and PR #683@GitHub +if(everyArgIsDefined&&negate){errorLikeFail=true;}else{this.assert(negate,'expected #{this} to throw #{exp} but #{act} was thrown','expected #{this} to not throw #{exp}'+(caughtErr&&!negate?' but #{act} was thrown':''),errorLike.toString(),caughtErr.toString());}}}var isCompatibleConstructor=_.checkError.compatibleConstructor(caughtErr,errorLike);if(isCompatibleConstructor===negate){if(everyArgIsDefined&&negate){errorLikeFail=true;}else{this.assert(negate,'expected #{this} to throw #{exp} but #{act} was thrown','expected #{this} to not throw #{exp}'+(caughtErr?' but #{act} was thrown':''),errorLike instanceof Error?errorLike.toString():errorLike&&_.checkError.getConstructorName(errorLike),caughtErr instanceof Error?caughtErr.toString():caughtErr&&_.checkError.getConstructorName(caughtErr));}}}if(caughtErr&&errMsgMatcher!==undefined&&errMsgMatcher!==null){// Here we check compatible messages +var placeholder='including';if(errMsgMatcher instanceof RegExp){placeholder='matching';}var isCompatibleMessage=_.checkError.compatibleMessage(caughtErr,errMsgMatcher);if(isCompatibleMessage===negate){if(everyArgIsDefined&&negate){errMsgMatcherFail=true;}else{this.assert(negate,'expected #{this} to throw error '+placeholder+' #{exp} but got #{act}','expected #{this} to throw error not '+placeholder+' #{exp}',errMsgMatcher,_.checkError.getMessage(caughtErr));}}}// If both assertions failed and both should've matched we throw an error +if(errorLikeFail&&errMsgMatcherFail){this.assert(negate,'expected #{this} to throw #{exp} but #{act} was thrown','expected #{this} to not throw #{exp}'+(caughtErr?' but #{act} was thrown':''),errorLike instanceof Error?errorLike.toString():errorLike&&_.checkError.getConstructorName(errorLike),caughtErr instanceof Error?caughtErr.toString():caughtErr&&_.checkError.getConstructorName(caughtErr));}flag(this,'object',caughtErr);}Assertion.addMethod('throw',assertThrows);Assertion.addMethod('throws',assertThrows);Assertion.addMethod('Throw',assertThrows);/** + * ### .respondTo(method[, msg]) + * + * When the target is a non-function object, \`.respondTo\` asserts that the + * target has a method with the given name \`method\`. The method can be own or + * inherited, and it can be enumerable or non-enumerable. + * + * function Cat () {} + * Cat.prototype.meow = function () {}; + * + * expect(new Cat()).to.respondTo('meow'); + * + * When the target is a function, \`.respondTo\` asserts that the target's + * \`prototype\` property has a method with the given name \`method\`. Again, the + * method can be own or inherited, and it can be enumerable or non-enumerable. + * + * function Cat () {} + * Cat.prototype.meow = function () {}; + * + * expect(Cat).to.respondTo('meow'); + * + * Add \`.itself\` earlier in the chain to force \`.respondTo\` to treat the + * target as a non-function object, even if it's a function. Thus, it asserts + * that the target has a method with the given name \`method\`, rather than + * asserting that the target's \`prototype\` property has a method with the + * given name \`method\`. + * + * function Cat () {} + * Cat.prototype.meow = function () {}; + * Cat.hiss = function () {}; + * + * expect(Cat).itself.to.respondTo('hiss').but.not.respondTo('meow'); + * + * When not adding \`.itself\`, it's important to check the target's type before + * using \`.respondTo\`. See the \`.a\` doc for info on checking a target's type. + * + * function Cat () {} + * Cat.prototype.meow = function () {}; + * + * expect(new Cat()).to.be.an('object').that.respondsTo('meow'); + * + * Add \`.not\` earlier in the chain to negate \`.respondTo\`. + * + * function Dog () {} + * Dog.prototype.bark = function () {}; + * + * expect(new Dog()).to.not.respondTo('meow'); + * + * \`.respondTo\` accepts an optional \`msg\` argument which is a custom error + * message to show when the assertion fails. The message can also be given as + * the second argument to \`expect\`. + * + * expect({}).to.respondTo('meow', 'nooo why fail??'); + * expect({}, 'nooo why fail??').to.respondTo('meow'); + * + * The alias \`.respondsTo\` can be used interchangeably with \`.respondTo\`. + * + * @name respondTo + * @alias respondsTo + * @param {String} method + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */function respondTo(method,msg){if(msg)flag(this,'message',msg);var obj=flag(this,'object'),itself=flag(this,'itself'),context='function'===typeof obj&&!itself?obj.prototype[method]:obj[method];this.assert('function'===typeof context,'expected #{this} to respond to '+_.inspect(method),'expected #{this} to not respond to '+_.inspect(method));}Assertion.addMethod('respondTo',respondTo);Assertion.addMethod('respondsTo',respondTo);/** + * ### .itself + * + * Forces all \`.respondTo\` assertions that follow in the chain to behave as if + * the target is a non-function object, even if it's a function. Thus, it + * causes \`.respondTo\` to assert that the target has a method with the given + * name, rather than asserting that the target's \`prototype\` property has a + * method with the given name. + * + * function Cat () {} + * Cat.prototype.meow = function () {}; + * Cat.hiss = function () {}; + * + * expect(Cat).itself.to.respondTo('hiss').but.not.respondTo('meow'); + * + * @name itself + * @namespace BDD + * @api public + */Assertion.addProperty('itself',function(){flag(this,'itself',true);});/** + * ### .satisfy(matcher[, msg]) + * + * Invokes the given \`matcher\` function with the target being passed as the + * first argument, and asserts that the value returned is truthy. + * + * expect(1).to.satisfy(function(num) { + * return num > 0; + * }); + * + * Add \`.not\` earlier in the chain to negate \`.satisfy\`. + * + * expect(1).to.not.satisfy(function(num) { + * return num > 2; + * }); + * + * \`.satisfy\` accepts an optional \`msg\` argument which is a custom error + * message to show when the assertion fails. The message can also be given as + * the second argument to \`expect\`. + * + * expect(1).to.satisfy(function(num) { + * return num > 2; + * }, 'nooo why fail??'); + * + * expect(1, 'nooo why fail??').to.satisfy(function(num) { + * return num > 2; + * }); + * + * The alias \`.satisfies\` can be used interchangeably with \`.satisfy\`. + * + * @name satisfy + * @alias satisfies + * @param {Function} matcher + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */function satisfy(matcher,msg){if(msg)flag(this,'message',msg);var obj=flag(this,'object');var result=matcher(obj);this.assert(result,'expected #{this} to satisfy '+_.objDisplay(matcher),'expected #{this} to not satisfy'+_.objDisplay(matcher),flag(this,'negate')?false:true,result);}Assertion.addMethod('satisfy',satisfy);Assertion.addMethod('satisfies',satisfy);/** + * ### .closeTo(expected, delta[, msg]) + * + * Asserts that the target is a number that's within a given +/- \`delta\` range + * of the given number \`expected\`. However, it's often best to assert that the + * target is equal to its expected value. + * + * // Recommended + * expect(1.5).to.equal(1.5); + * + * // Not recommended + * expect(1.5).to.be.closeTo(1, 0.5); + * expect(1.5).to.be.closeTo(2, 0.5); + * expect(1.5).to.be.closeTo(1, 1); + * + * Add \`.not\` earlier in the chain to negate \`.closeTo\`. + * + * expect(1.5).to.equal(1.5); // Recommended + * expect(1.5).to.not.be.closeTo(3, 1); // Not recommended + * + * \`.closeTo\` accepts an optional \`msg\` argument which is a custom error + * message to show when the assertion fails. The message can also be given as + * the second argument to \`expect\`. + * + * expect(1.5).to.be.closeTo(3, 1, 'nooo why fail??'); + * expect(1.5, 'nooo why fail??').to.be.closeTo(3, 1); + * + * The alias \`.approximately\` can be used interchangeably with \`.closeTo\`. + * + * @name closeTo + * @alias approximately + * @param {Number} expected + * @param {Number} delta + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */function closeTo(expected,delta,msg){if(msg)flag(this,'message',msg);var obj=flag(this,'object'),flagMsg=flag(this,'message'),ssfi=flag(this,'ssfi');new Assertion(obj,flagMsg,ssfi,true).is.a('number');if(typeof expected!=='number'||typeof delta!=='number'){flagMsg=flagMsg?flagMsg+': ':'';var deltaMessage=delta===undefined?", and a delta is required":"";throw new AssertionError(flagMsg+'the arguments to closeTo or approximately must be numbers'+deltaMessage,undefined,ssfi);}this.assert(Math.abs(obj-expected)<=delta,'expected #{this} to be close to '+expected+' +/- '+delta,'expected #{this} not to be close to '+expected+' +/- '+delta);}Assertion.addMethod('closeTo',closeTo);Assertion.addMethod('approximately',closeTo);// Note: Duplicates are ignored if testing for inclusion instead of sameness. +function isSubsetOf(subset,superset,cmp,contains,ordered){if(!contains){if(subset.length!==superset.length)return false;superset=superset.slice();}return subset.every(function(elem,idx){if(ordered)return cmp?cmp(elem,superset[idx]):elem===superset[idx];if(!cmp){var matchIdx=superset.indexOf(elem);if(matchIdx===-1)return false;// Remove match from superset so not counted twice if duplicate in subset. +if(!contains)superset.splice(matchIdx,1);return true;}return superset.some(function(elem2,matchIdx){if(!cmp(elem,elem2))return false;// Remove match from superset so not counted twice if duplicate in subset. +if(!contains)superset.splice(matchIdx,1);return true;});});}/** + * ### .members(set[, msg]) + * + * Asserts that the target array has the same members as the given array + * \`set\`. + * + * expect([1, 2, 3]).to.have.members([2, 1, 3]); + * expect([1, 2, 2]).to.have.members([2, 1, 2]); + * + * By default, members are compared using strict (\`===\`) equality. Add \`.deep\` + * earlier in the chain to use deep equality instead. See the \`deep-eql\` + * project page for info on the deep equality algorithm: + * https://github.com/chaijs/deep-eql. + * + * // Target array deeply (but not strictly) has member \`{a: 1}\` + * expect([{a: 1}]).to.have.deep.members([{a: 1}]); + * expect([{a: 1}]).to.not.have.members([{a: 1}]); + * + * By default, order doesn't matter. Add \`.ordered\` earlier in the chain to + * require that members appear in the same order. + * + * expect([1, 2, 3]).to.have.ordered.members([1, 2, 3]); + * expect([1, 2, 3]).to.have.members([2, 1, 3]) + * .but.not.ordered.members([2, 1, 3]); + * + * By default, both arrays must be the same size. Add \`.include\` earlier in + * the chain to require that the target's members be a superset of the + * expected members. Note that duplicates are ignored in the subset when + * \`.include\` is added. + * + * // Target array is a superset of [1, 2] but not identical + * expect([1, 2, 3]).to.include.members([1, 2]); + * expect([1, 2, 3]).to.not.have.members([1, 2]); + * + * // Duplicates in the subset are ignored + * expect([1, 2, 3]).to.include.members([1, 2, 2, 2]); + * + * \`.deep\`, \`.ordered\`, and \`.include\` can all be combined. However, if + * \`.include\` and \`.ordered\` are combined, the ordering begins at the start of + * both arrays. + * + * expect([{a: 1}, {b: 2}, {c: 3}]) + * .to.include.deep.ordered.members([{a: 1}, {b: 2}]) + * .but.not.include.deep.ordered.members([{b: 2}, {c: 3}]); + * + * Add \`.not\` earlier in the chain to negate \`.members\`. However, it's + * dangerous to do so. The problem is that it creates uncertain expectations + * by asserting that the target array doesn't have all of the same members as + * the given array \`set\` but may or may not have some of them. It's often best + * to identify the exact output that's expected, and then write an assertion + * that only accepts that exact output. + * + * expect([1, 2]).to.not.include(3).and.not.include(4); // Recommended + * expect([1, 2]).to.not.have.members([3, 4]); // Not recommended + * + * \`.members\` accepts an optional \`msg\` argument which is a custom error + * message to show when the assertion fails. The message can also be given as + * the second argument to \`expect\`. + * + * expect([1, 2]).to.have.members([1, 2, 3], 'nooo why fail??'); + * expect([1, 2], 'nooo why fail??').to.have.members([1, 2, 3]); + * + * @name members + * @param {Array} set + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */Assertion.addMethod('members',function(subset,msg){if(msg)flag(this,'message',msg);var obj=flag(this,'object'),flagMsg=flag(this,'message'),ssfi=flag(this,'ssfi');new Assertion(obj,flagMsg,ssfi,true).to.be.an('array');new Assertion(subset,flagMsg,ssfi,true).to.be.an('array');var contains=flag(this,'contains');var ordered=flag(this,'ordered');var subject,failMsg,failNegateMsg;if(contains){subject=ordered?'an ordered superset':'a superset';failMsg='expected #{this} to be '+subject+' of #{exp}';failNegateMsg='expected #{this} to not be '+subject+' of #{exp}';}else{subject=ordered?'ordered members':'members';failMsg='expected #{this} to have the same '+subject+' as #{exp}';failNegateMsg='expected #{this} to not have the same '+subject+' as #{exp}';}var cmp=flag(this,'deep')?flag(this,'eql'):undefined;this.assert(isSubsetOf(subset,obj,cmp,contains,ordered),failMsg,failNegateMsg,subset,obj,true);});/** + * ### .oneOf(list[, msg]) + * + * Asserts that the target is a member of the given array \`list\`. However, + * it's often best to assert that the target is equal to its expected value. + * + * expect(1).to.equal(1); // Recommended + * expect(1).to.be.oneOf([1, 2, 3]); // Not recommended + * + * Comparisons are performed using strict (\`===\`) equality. + * + * Add \`.not\` earlier in the chain to negate \`.oneOf\`. + * + * expect(1).to.equal(1); // Recommended + * expect(1).to.not.be.oneOf([2, 3, 4]); // Not recommended + * + * It can also be chained with \`.contain\` or \`.include\`, which will work with + * both arrays and strings: + * + * expect('Today is sunny').to.contain.oneOf(['sunny', 'cloudy']) + * expect('Today is rainy').to.not.contain.oneOf(['sunny', 'cloudy']) + * expect([1,2,3]).to.contain.oneOf([3,4,5]) + * expect([1,2,3]).to.not.contain.oneOf([4,5,6]) + * + * \`.oneOf\` accepts an optional \`msg\` argument which is a custom error message + * to show when the assertion fails. The message can also be given as the + * second argument to \`expect\`. + * + * expect(1).to.be.oneOf([2, 3, 4], 'nooo why fail??'); + * expect(1, 'nooo why fail??').to.be.oneOf([2, 3, 4]); + * + * @name oneOf + * @param {Array<*>} list + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */function oneOf(list,msg){if(msg)flag(this,'message',msg);var expected=flag(this,'object'),flagMsg=flag(this,'message'),ssfi=flag(this,'ssfi'),contains=flag(this,'contains'),isDeep=flag(this,'deep'),eql=flag(this,'eql');new Assertion(list,flagMsg,ssfi,true).to.be.an('array');if(contains){this.assert(list.some(function(possibility){return expected.indexOf(possibility)>-1;}),'expected #{this} to contain one of #{exp}','expected #{this} to not contain one of #{exp}',list,expected);}else{if(isDeep){this.assert(list.some(function(possibility){return eql(expected,possibility);}),'expected #{this} to deeply equal one of #{exp}','expected #{this} to deeply equal one of #{exp}',list,expected);}else{this.assert(list.indexOf(expected)>-1,'expected #{this} to be one of #{exp}','expected #{this} to not be one of #{exp}',list,expected);}}}Assertion.addMethod('oneOf',oneOf);/** + * ### .change(subject[, prop[, msg]]) + * + * When one argument is provided, \`.change\` asserts that the given function + * \`subject\` returns a different value when it's invoked before the target + * function compared to when it's invoked afterward. However, it's often best + * to assert that \`subject\` is equal to its expected value. + * + * var dots = '' + * , addDot = function () { dots += '.'; } + * , getDots = function () { return dots; }; + * + * // Recommended + * expect(getDots()).to.equal(''); + * addDot(); + * expect(getDots()).to.equal('.'); + * + * // Not recommended + * expect(addDot).to.change(getDots); + * + * When two arguments are provided, \`.change\` asserts that the value of the + * given object \`subject\`'s \`prop\` property is different before invoking the + * target function compared to afterward. + * + * var myObj = {dots: ''} + * , addDot = function () { myObj.dots += '.'; }; + * + * // Recommended + * expect(myObj).to.have.property('dots', ''); + * addDot(); + * expect(myObj).to.have.property('dots', '.'); + * + * // Not recommended + * expect(addDot).to.change(myObj, 'dots'); + * + * Strict (\`===\`) equality is used to compare before and after values. + * + * Add \`.not\` earlier in the chain to negate \`.change\`. + * + * var dots = '' + * , noop = function () {} + * , getDots = function () { return dots; }; + * + * expect(noop).to.not.change(getDots); + * + * var myObj = {dots: ''} + * , noop = function () {}; + * + * expect(noop).to.not.change(myObj, 'dots'); + * + * \`.change\` accepts an optional \`msg\` argument which is a custom error + * message to show when the assertion fails. The message can also be given as + * the second argument to \`expect\`. When not providing two arguments, always + * use the second form. + * + * var myObj = {dots: ''} + * , addDot = function () { myObj.dots += '.'; }; + * + * expect(addDot).to.not.change(myObj, 'dots', 'nooo why fail??'); + * + * var dots = '' + * , addDot = function () { dots += '.'; } + * , getDots = function () { return dots; }; + * + * expect(addDot, 'nooo why fail??').to.not.change(getDots); + * + * \`.change\` also causes all \`.by\` assertions that follow in the chain to + * assert how much a numeric subject was increased or decreased by. However, + * it's dangerous to use \`.change.by\`. The problem is that it creates + * uncertain expectations by asserting that the subject either increases by + * the given delta, or that it decreases by the given delta. It's often best + * to identify the exact output that's expected, and then write an assertion + * that only accepts that exact output. + * + * var myObj = {val: 1} + * , addTwo = function () { myObj.val += 2; } + * , subtractTwo = function () { myObj.val -= 2; }; + * + * expect(addTwo).to.increase(myObj, 'val').by(2); // Recommended + * expect(addTwo).to.change(myObj, 'val').by(2); // Not recommended + * + * expect(subtractTwo).to.decrease(myObj, 'val').by(2); // Recommended + * expect(subtractTwo).to.change(myObj, 'val').by(2); // Not recommended + * + * The alias \`.changes\` can be used interchangeably with \`.change\`. + * + * @name change + * @alias changes + * @param {String} subject + * @param {String} prop name _optional_ + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */function assertChanges(subject,prop,msg){if(msg)flag(this,'message',msg);var fn=flag(this,'object'),flagMsg=flag(this,'message'),ssfi=flag(this,'ssfi');new Assertion(fn,flagMsg,ssfi,true).is.a('function');var initial;if(!prop){new Assertion(subject,flagMsg,ssfi,true).is.a('function');initial=subject();}else{new Assertion(subject,flagMsg,ssfi,true).to.have.property(prop);initial=subject[prop];}fn();var final=prop===undefined||prop===null?subject():subject[prop];var msgObj=prop===undefined||prop===null?initial:'.'+prop;// This gets flagged because of the .by(delta) assertion +flag(this,'deltaMsgObj',msgObj);flag(this,'initialDeltaValue',initial);flag(this,'finalDeltaValue',final);flag(this,'deltaBehavior','change');flag(this,'realDelta',final!==initial);this.assert(initial!==final,'expected '+msgObj+' to change','expected '+msgObj+' to not change');}Assertion.addMethod('change',assertChanges);Assertion.addMethod('changes',assertChanges);/** + * ### .increase(subject[, prop[, msg]]) + * + * When one argument is provided, \`.increase\` asserts that the given function + * \`subject\` returns a greater number when it's invoked after invoking the + * target function compared to when it's invoked beforehand. \`.increase\` also + * causes all \`.by\` assertions that follow in the chain to assert how much + * greater of a number is returned. It's often best to assert that the return + * value increased by the expected amount, rather than asserting it increased + * by any amount. + * + * var val = 1 + * , addTwo = function () { val += 2; } + * , getVal = function () { return val; }; + * + * expect(addTwo).to.increase(getVal).by(2); // Recommended + * expect(addTwo).to.increase(getVal); // Not recommended + * + * When two arguments are provided, \`.increase\` asserts that the value of the + * given object \`subject\`'s \`prop\` property is greater after invoking the + * target function compared to beforehand. + * + * var myObj = {val: 1} + * , addTwo = function () { myObj.val += 2; }; + * + * expect(addTwo).to.increase(myObj, 'val').by(2); // Recommended + * expect(addTwo).to.increase(myObj, 'val'); // Not recommended + * + * Add \`.not\` earlier in the chain to negate \`.increase\`. However, it's + * dangerous to do so. The problem is that it creates uncertain expectations + * by asserting that the subject either decreases, or that it stays the same. + * It's often best to identify the exact output that's expected, and then + * write an assertion that only accepts that exact output. + * + * When the subject is expected to decrease, it's often best to assert that it + * decreased by the expected amount. + * + * var myObj = {val: 1} + * , subtractTwo = function () { myObj.val -= 2; }; + * + * expect(subtractTwo).to.decrease(myObj, 'val').by(2); // Recommended + * expect(subtractTwo).to.not.increase(myObj, 'val'); // Not recommended + * + * When the subject is expected to stay the same, it's often best to assert + * exactly that. + * + * var myObj = {val: 1} + * , noop = function () {}; + * + * expect(noop).to.not.change(myObj, 'val'); // Recommended + * expect(noop).to.not.increase(myObj, 'val'); // Not recommended + * + * \`.increase\` accepts an optional \`msg\` argument which is a custom error + * message to show when the assertion fails. The message can also be given as + * the second argument to \`expect\`. When not providing two arguments, always + * use the second form. + * + * var myObj = {val: 1} + * , noop = function () {}; + * + * expect(noop).to.increase(myObj, 'val', 'nooo why fail??'); + * + * var val = 1 + * , noop = function () {} + * , getVal = function () { return val; }; + * + * expect(noop, 'nooo why fail??').to.increase(getVal); + * + * The alias \`.increases\` can be used interchangeably with \`.increase\`. + * + * @name increase + * @alias increases + * @param {String|Function} subject + * @param {String} prop name _optional_ + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */function assertIncreases(subject,prop,msg){if(msg)flag(this,'message',msg);var fn=flag(this,'object'),flagMsg=flag(this,'message'),ssfi=flag(this,'ssfi');new Assertion(fn,flagMsg,ssfi,true).is.a('function');var initial;if(!prop){new Assertion(subject,flagMsg,ssfi,true).is.a('function');initial=subject();}else{new Assertion(subject,flagMsg,ssfi,true).to.have.property(prop);initial=subject[prop];}// Make sure that the target is a number +new Assertion(initial,flagMsg,ssfi,true).is.a('number');fn();var final=prop===undefined||prop===null?subject():subject[prop];var msgObj=prop===undefined||prop===null?initial:'.'+prop;flag(this,'deltaMsgObj',msgObj);flag(this,'initialDeltaValue',initial);flag(this,'finalDeltaValue',final);flag(this,'deltaBehavior','increase');flag(this,'realDelta',final-initial);this.assert(final-initial>0,'expected '+msgObj+' to increase','expected '+msgObj+' to not increase');}Assertion.addMethod('increase',assertIncreases);Assertion.addMethod('increases',assertIncreases);/** + * ### .decrease(subject[, prop[, msg]]) + * + * When one argument is provided, \`.decrease\` asserts that the given function + * \`subject\` returns a lesser number when it's invoked after invoking the + * target function compared to when it's invoked beforehand. \`.decrease\` also + * causes all \`.by\` assertions that follow in the chain to assert how much + * lesser of a number is returned. It's often best to assert that the return + * value decreased by the expected amount, rather than asserting it decreased + * by any amount. + * + * var val = 1 + * , subtractTwo = function () { val -= 2; } + * , getVal = function () { return val; }; + * + * expect(subtractTwo).to.decrease(getVal).by(2); // Recommended + * expect(subtractTwo).to.decrease(getVal); // Not recommended + * + * When two arguments are provided, \`.decrease\` asserts that the value of the + * given object \`subject\`'s \`prop\` property is lesser after invoking the + * target function compared to beforehand. + * + * var myObj = {val: 1} + * , subtractTwo = function () { myObj.val -= 2; }; + * + * expect(subtractTwo).to.decrease(myObj, 'val').by(2); // Recommended + * expect(subtractTwo).to.decrease(myObj, 'val'); // Not recommended + * + * Add \`.not\` earlier in the chain to negate \`.decrease\`. However, it's + * dangerous to do so. The problem is that it creates uncertain expectations + * by asserting that the subject either increases, or that it stays the same. + * It's often best to identify the exact output that's expected, and then + * write an assertion that only accepts that exact output. + * + * When the subject is expected to increase, it's often best to assert that it + * increased by the expected amount. + * + * var myObj = {val: 1} + * , addTwo = function () { myObj.val += 2; }; + * + * expect(addTwo).to.increase(myObj, 'val').by(2); // Recommended + * expect(addTwo).to.not.decrease(myObj, 'val'); // Not recommended + * + * When the subject is expected to stay the same, it's often best to assert + * exactly that. + * + * var myObj = {val: 1} + * , noop = function () {}; + * + * expect(noop).to.not.change(myObj, 'val'); // Recommended + * expect(noop).to.not.decrease(myObj, 'val'); // Not recommended + * + * \`.decrease\` accepts an optional \`msg\` argument which is a custom error + * message to show when the assertion fails. The message can also be given as + * the second argument to \`expect\`. When not providing two arguments, always + * use the second form. + * + * var myObj = {val: 1} + * , noop = function () {}; + * + * expect(noop).to.decrease(myObj, 'val', 'nooo why fail??'); + * + * var val = 1 + * , noop = function () {} + * , getVal = function () { return val; }; + * + * expect(noop, 'nooo why fail??').to.decrease(getVal); + * + * The alias \`.decreases\` can be used interchangeably with \`.decrease\`. + * + * @name decrease + * @alias decreases + * @param {String|Function} subject + * @param {String} prop name _optional_ + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */function assertDecreases(subject,prop,msg){if(msg)flag(this,'message',msg);var fn=flag(this,'object'),flagMsg=flag(this,'message'),ssfi=flag(this,'ssfi');new Assertion(fn,flagMsg,ssfi,true).is.a('function');var initial;if(!prop){new Assertion(subject,flagMsg,ssfi,true).is.a('function');initial=subject();}else{new Assertion(subject,flagMsg,ssfi,true).to.have.property(prop);initial=subject[prop];}// Make sure that the target is a number +new Assertion(initial,flagMsg,ssfi,true).is.a('number');fn();var final=prop===undefined||prop===null?subject():subject[prop];var msgObj=prop===undefined||prop===null?initial:'.'+prop;flag(this,'deltaMsgObj',msgObj);flag(this,'initialDeltaValue',initial);flag(this,'finalDeltaValue',final);flag(this,'deltaBehavior','decrease');flag(this,'realDelta',initial-final);this.assert(final-initial<0,'expected '+msgObj+' to decrease','expected '+msgObj+' to not decrease');}Assertion.addMethod('decrease',assertDecreases);Assertion.addMethod('decreases',assertDecreases);/** + * ### .by(delta[, msg]) + * + * When following an \`.increase\` assertion in the chain, \`.by\` asserts that + * the subject of the \`.increase\` assertion increased by the given \`delta\`. + * + * var myObj = {val: 1} + * , addTwo = function () { myObj.val += 2; }; + * + * expect(addTwo).to.increase(myObj, 'val').by(2); + * + * When following a \`.decrease\` assertion in the chain, \`.by\` asserts that the + * subject of the \`.decrease\` assertion decreased by the given \`delta\`. + * + * var myObj = {val: 1} + * , subtractTwo = function () { myObj.val -= 2; }; + * + * expect(subtractTwo).to.decrease(myObj, 'val').by(2); + * + * When following a \`.change\` assertion in the chain, \`.by\` asserts that the + * subject of the \`.change\` assertion either increased or decreased by the + * given \`delta\`. However, it's dangerous to use \`.change.by\`. The problem is + * that it creates uncertain expectations. It's often best to identify the + * exact output that's expected, and then write an assertion that only accepts + * that exact output. + * + * var myObj = {val: 1} + * , addTwo = function () { myObj.val += 2; } + * , subtractTwo = function () { myObj.val -= 2; }; + * + * expect(addTwo).to.increase(myObj, 'val').by(2); // Recommended + * expect(addTwo).to.change(myObj, 'val').by(2); // Not recommended + * + * expect(subtractTwo).to.decrease(myObj, 'val').by(2); // Recommended + * expect(subtractTwo).to.change(myObj, 'val').by(2); // Not recommended + * + * Add \`.not\` earlier in the chain to negate \`.by\`. However, it's often best + * to assert that the subject changed by its expected delta, rather than + * asserting that it didn't change by one of countless unexpected deltas. + * + * var myObj = {val: 1} + * , addTwo = function () { myObj.val += 2; }; + * + * // Recommended + * expect(addTwo).to.increase(myObj, 'val').by(2); + * + * // Not recommended + * expect(addTwo).to.increase(myObj, 'val').but.not.by(3); + * + * \`.by\` accepts an optional \`msg\` argument which is a custom error message to + * show when the assertion fails. The message can also be given as the second + * argument to \`expect\`. + * + * var myObj = {val: 1} + * , addTwo = function () { myObj.val += 2; }; + * + * expect(addTwo).to.increase(myObj, 'val').by(3, 'nooo why fail??'); + * expect(addTwo, 'nooo why fail??').to.increase(myObj, 'val').by(3); + * + * @name by + * @param {Number} delta + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */function assertDelta(delta,msg){if(msg)flag(this,'message',msg);var msgObj=flag(this,'deltaMsgObj');var initial=flag(this,'initialDeltaValue');var final=flag(this,'finalDeltaValue');var behavior=flag(this,'deltaBehavior');var realDelta=flag(this,'realDelta');var expression;if(behavior==='change'){expression=Math.abs(final-initial)===Math.abs(delta);}else{expression=realDelta===Math.abs(delta);}this.assert(expression,'expected '+msgObj+' to '+behavior+' by '+delta,'expected '+msgObj+' to not '+behavior+' by '+delta);}Assertion.addMethod('by',assertDelta);/** + * ### .extensible + * + * Asserts that the target is extensible, which means that new properties can + * be added to it. Primitives are never extensible. + * + * expect({a: 1}).to.be.extensible; + * + * Add \`.not\` earlier in the chain to negate \`.extensible\`. + * + * var nonExtensibleObject = Object.preventExtensions({}) + * , sealedObject = Object.seal({}) + * , frozenObject = Object.freeze({}); + * + * expect(nonExtensibleObject).to.not.be.extensible; + * expect(sealedObject).to.not.be.extensible; + * expect(frozenObject).to.not.be.extensible; + * expect(1).to.not.be.extensible; + * + * A custom error message can be given as the second argument to \`expect\`. + * + * expect(1, 'nooo why fail??').to.be.extensible; + * + * @name extensible + * @namespace BDD + * @api public + */Assertion.addProperty('extensible',function(){var obj=flag(this,'object');// In ES5, if the argument to this method is a primitive, then it will cause a TypeError. +// In ES6, a non-object argument will be treated as if it was a non-extensible ordinary object, simply return false. +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isExtensible +// The following provides ES6 behavior for ES5 environments. +var isExtensible=obj===Object(obj)&&Object.isExtensible(obj);this.assert(isExtensible,'expected #{this} to be extensible','expected #{this} to not be extensible');});/** + * ### .sealed + * + * Asserts that the target is sealed, which means that new properties can't be + * added to it, and its existing properties can't be reconfigured or deleted. + * However, it's possible that its existing properties can still be reassigned + * to different values. Primitives are always sealed. + * + * var sealedObject = Object.seal({}); + * var frozenObject = Object.freeze({}); + * + * expect(sealedObject).to.be.sealed; + * expect(frozenObject).to.be.sealed; + * expect(1).to.be.sealed; + * + * Add \`.not\` earlier in the chain to negate \`.sealed\`. + * + * expect({a: 1}).to.not.be.sealed; + * + * A custom error message can be given as the second argument to \`expect\`. + * + * expect({a: 1}, 'nooo why fail??').to.be.sealed; + * + * @name sealed + * @namespace BDD + * @api public + */Assertion.addProperty('sealed',function(){var obj=flag(this,'object');// In ES5, if the argument to this method is a primitive, then it will cause a TypeError. +// In ES6, a non-object argument will be treated as if it was a sealed ordinary object, simply return true. +// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isSealed +// The following provides ES6 behavior for ES5 environments. +var isSealed=obj===Object(obj)?Object.isSealed(obj):true;this.assert(isSealed,'expected #{this} to be sealed','expected #{this} to not be sealed');});/** + * ### .frozen + * + * Asserts that the target is frozen, which means that new properties can't be + * added to it, and its existing properties can't be reassigned to different + * values, reconfigured, or deleted. Primitives are always frozen. + * + * var frozenObject = Object.freeze({}); + * + * expect(frozenObject).to.be.frozen; + * expect(1).to.be.frozen; + * + * Add \`.not\` earlier in the chain to negate \`.frozen\`. + * + * expect({a: 1}).to.not.be.frozen; + * + * A custom error message can be given as the second argument to \`expect\`. + * + * expect({a: 1}, 'nooo why fail??').to.be.frozen; + * + * @name frozen + * @namespace BDD + * @api public + */Assertion.addProperty('frozen',function(){var obj=flag(this,'object');// In ES5, if the argument to this method is a primitive, then it will cause a TypeError. +// In ES6, a non-object argument will be treated as if it was a frozen ordinary object, simply return true. +// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isFrozen +// The following provides ES6 behavior for ES5 environments. +var isFrozen=obj===Object(obj)?Object.isFrozen(obj):true;this.assert(isFrozen,'expected #{this} to be frozen','expected #{this} to not be frozen');});/** + * ### .finite + * + * Asserts that the target is a number, and isn't \`NaN\` or positive/negative + * \`Infinity\`. + * + * expect(1).to.be.finite; + * + * Add \`.not\` earlier in the chain to negate \`.finite\`. However, it's + * dangerous to do so. The problem is that it creates uncertain expectations + * by asserting that the subject either isn't a number, or that it's \`NaN\`, or + * that it's positive \`Infinity\`, or that it's negative \`Infinity\`. It's often + * best to identify the exact output that's expected, and then write an + * assertion that only accepts that exact output. + * + * When the target isn't expected to be a number, it's often best to assert + * that it's the expected type, rather than asserting that it isn't one of + * many unexpected types. + * + * expect('foo').to.be.a('string'); // Recommended + * expect('foo').to.not.be.finite; // Not recommended + * + * When the target is expected to be \`NaN\`, it's often best to assert exactly + * that. + * + * expect(NaN).to.be.NaN; // Recommended + * expect(NaN).to.not.be.finite; // Not recommended + * + * When the target is expected to be positive infinity, it's often best to + * assert exactly that. + * + * expect(Infinity).to.equal(Infinity); // Recommended + * expect(Infinity).to.not.be.finite; // Not recommended + * + * When the target is expected to be negative infinity, it's often best to + * assert exactly that. + * + * expect(-Infinity).to.equal(-Infinity); // Recommended + * expect(-Infinity).to.not.be.finite; // Not recommended + * + * A custom error message can be given as the second argument to \`expect\`. + * + * expect('foo', 'nooo why fail??').to.be.finite; + * + * @name finite + * @namespace BDD + * @api public + */Assertion.addProperty('finite',function(msg){var obj=flag(this,'object');this.assert(typeof obj==='number'&&isFinite(obj),'expected #{this} to be a finite number','expected #{this} to not be a finite number');});};/*! + * chai + * Copyright(c) 2011-2014 Jake Luer + * MIT Licensed + */var expect$1=function(chai,util){chai.expect=function(val,message){return new chai.Assertion(val,message);};/** + * ### .fail([message]) + * ### .fail(actual, expected, [message], [operator]) + * + * Throw a failure. + * + * expect.fail(); + * expect.fail("custom error message"); + * expect.fail(1, 2); + * expect.fail(1, 2, "custom error message"); + * expect.fail(1, 2, "custom error message", ">"); + * expect.fail(1, 2, undefined, ">"); + * + * @name fail + * @param {Mixed} actual + * @param {Mixed} expected + * @param {String} message + * @param {String} operator + * @namespace BDD + * @api public + */chai.expect.fail=function(actual,expected,message,operator){if(arguments.length<2){message=actual;actual=undefined;}message=message||'expect.fail()';throw new chai.AssertionError(message,{actual:actual,expected:expected,operator:operator},chai.expect.fail);};};/*! + * chai + * Copyright(c) 2011-2014 Jake Luer + * MIT Licensed + */var should=function(chai,util){var Assertion=chai.Assertion;function loadShould(){// explicitly define this method as function as to have it's name to include as \`ssfi\` +function shouldGetter(){if(this instanceof String||this instanceof Number||this instanceof Boolean||typeof Symbol==='function'&&this instanceof Symbol||typeof BigInt==='function'&&this instanceof BigInt){return new Assertion(this.valueOf(),null,shouldGetter);}return new Assertion(this,null,shouldGetter);}function shouldSetter(value){// See https://github.com/chaijs/chai/issues/86: this makes +// \`whatever.should = someValue\` actually set \`someValue\`, which is +// especially useful for \`global.should = require('chai').should()\`. +// +// Note that we have to use [[DefineProperty]] instead of [[Put]] +// since otherwise we would trigger this very setter! +Object.defineProperty(this,'should',{value:value,enumerable:true,configurable:true,writable:true});}// modify Object.prototype to have \`should\` +Object.defineProperty(Object.prototype,'should',{set:shouldSetter,get:shouldGetter,configurable:true});var should={};/** + * ### .fail([message]) + * ### .fail(actual, expected, [message], [operator]) + * + * Throw a failure. + * + * should.fail(); + * should.fail("custom error message"); + * should.fail(1, 2); + * should.fail(1, 2, "custom error message"); + * should.fail(1, 2, "custom error message", ">"); + * should.fail(1, 2, undefined, ">"); + * + * + * @name fail + * @param {Mixed} actual + * @param {Mixed} expected + * @param {String} message + * @param {String} operator + * @namespace BDD + * @api public + */should.fail=function(actual,expected,message,operator){if(arguments.length<2){message=actual;actual=undefined;}message=message||'should.fail()';throw new chai.AssertionError(message,{actual:actual,expected:expected,operator:operator},should.fail);};/** + * ### .equal(actual, expected, [message]) + * + * Asserts non-strict equality (\`==\`) of \`actual\` and \`expected\`. + * + * should.equal(3, '3', '== coerces values to strings'); + * + * @name equal + * @param {Mixed} actual + * @param {Mixed} expected + * @param {String} message + * @namespace Should + * @api public + */should.equal=function(val1,val2,msg){new Assertion(val1,msg).to.equal(val2);};/** + * ### .throw(function, [constructor/string/regexp], [string/regexp], [message]) + * + * Asserts that \`function\` will throw an error that is an instance of + * \`constructor\`, or alternately that it will throw an error with message + * matching \`regexp\`. + * + * should.throw(fn, 'function throws a reference error'); + * should.throw(fn, /function throws a reference error/); + * should.throw(fn, ReferenceError); + * should.throw(fn, ReferenceError, 'function throws a reference error'); + * should.throw(fn, ReferenceError, /function throws a reference error/); + * + * @name throw + * @alias Throw + * @param {Function} function + * @param {ErrorConstructor} constructor + * @param {RegExp} regexp + * @param {String} message + * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types + * @namespace Should + * @api public + */should.Throw=function(fn,errt,errs,msg){new Assertion(fn,msg).to.Throw(errt,errs);};/** + * ### .exist + * + * Asserts that the target is neither \`null\` nor \`undefined\`. + * + * var foo = 'hi'; + * + * should.exist(foo, 'foo exists'); + * + * @name exist + * @namespace Should + * @api public + */should.exist=function(val,msg){new Assertion(val,msg).to.exist;};// negation +should.not={};/** + * ### .not.equal(actual, expected, [message]) + * + * Asserts non-strict inequality (\`!=\`) of \`actual\` and \`expected\`. + * + * should.not.equal(3, 4, 'these numbers are not equal'); + * + * @name not.equal + * @param {Mixed} actual + * @param {Mixed} expected + * @param {String} message + * @namespace Should + * @api public + */should.not.equal=function(val1,val2,msg){new Assertion(val1,msg).to.not.equal(val2);};/** + * ### .throw(function, [constructor/regexp], [message]) + * + * Asserts that \`function\` will _not_ throw an error that is an instance of + * \`constructor\`, or alternately that it will not throw an error with message + * matching \`regexp\`. + * + * should.not.throw(fn, Error, 'function does not throw'); + * + * @name not.throw + * @alias not.Throw + * @param {Function} function + * @param {ErrorConstructor} constructor + * @param {RegExp} regexp + * @param {String} message + * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types + * @namespace Should + * @api public + */should.not.Throw=function(fn,errt,errs,msg){new Assertion(fn,msg).to.not.Throw(errt,errs);};/** + * ### .not.exist + * + * Asserts that the target is neither \`null\` nor \`undefined\`. + * + * var bar = null; + * + * should.not.exist(bar, 'bar does not exist'); + * + * @name not.exist + * @namespace Should + * @api public + */should.not.exist=function(val,msg){new Assertion(val,msg).to.not.exist;};should['throw']=should['Throw'];should.not['throw']=should.not['Throw'];return should;}chai.should=loadShould;chai.Should=loadShould;};/*! + * chai + * Copyright(c) 2011-2014 Jake Luer + * MIT Licensed + */var assert$1=function(chai,util){/*! + * Chai dependencies. + */var Assertion=chai.Assertion,flag=util.flag;/*! + * Module export. + */ /** + * ### assert(expression, message) + * + * Write your own test expressions. + * + * assert('foo' !== 'bar', 'foo is not bar'); + * assert(Array.isArray([]), 'empty arrays are arrays'); + * + * @param {Mixed} expression to test for truthiness + * @param {String} message to display on error + * @name assert + * @namespace Assert + * @api public + */var assert=chai.assert=function(express,errmsg){var test=new Assertion(null,null,chai.assert,true);test.assert(express,errmsg,'[ negation message unavailable ]');};/** + * ### .fail([message]) + * ### .fail(actual, expected, [message], [operator]) + * + * Throw a failure. Node.js \`assert\` module-compatible. + * + * assert.fail(); + * assert.fail("custom error message"); + * assert.fail(1, 2); + * assert.fail(1, 2, "custom error message"); + * assert.fail(1, 2, "custom error message", ">"); + * assert.fail(1, 2, undefined, ">"); + * + * @name fail + * @param {Mixed} actual + * @param {Mixed} expected + * @param {String} message + * @param {String} operator + * @namespace Assert + * @api public + */assert.fail=function(actual,expected,message,operator){if(arguments.length<2){// Comply with Node's fail([message]) interface +message=actual;actual=undefined;}message=message||'assert.fail()';throw new chai.AssertionError(message,{actual:actual,expected:expected,operator:operator},assert.fail);};/** + * ### .isOk(object, [message]) + * + * Asserts that \`object\` is truthy. + * + * assert.isOk('everything', 'everything is ok'); + * assert.isOk(false, 'this will fail'); + * + * @name isOk + * @alias ok + * @param {Mixed} object to test + * @param {String} message + * @namespace Assert + * @api public + */assert.isOk=function(val,msg){new Assertion(val,msg,assert.isOk,true).is.ok;};/** + * ### .isNotOk(object, [message]) + * + * Asserts that \`object\` is falsy. + * + * assert.isNotOk('everything', 'this will fail'); + * assert.isNotOk(false, 'this will pass'); + * + * @name isNotOk + * @alias notOk + * @param {Mixed} object to test + * @param {String} message + * @namespace Assert + * @api public + */assert.isNotOk=function(val,msg){new Assertion(val,msg,assert.isNotOk,true).is.not.ok;};/** + * ### .equal(actual, expected, [message]) + * + * Asserts non-strict equality (\`==\`) of \`actual\` and \`expected\`. + * + * assert.equal(3, '3', '== coerces values to strings'); + * + * @name equal + * @param {Mixed} actual + * @param {Mixed} expected + * @param {String} message + * @namespace Assert + * @api public + */assert.equal=function(act,exp,msg){var test=new Assertion(act,msg,assert.equal,true);test.assert(exp==flag(test,'object'),'expected #{this} to equal #{exp}','expected #{this} to not equal #{act}',exp,act,true);};/** + * ### .notEqual(actual, expected, [message]) + * + * Asserts non-strict inequality (\`!=\`) of \`actual\` and \`expected\`. + * + * assert.notEqual(3, 4, 'these numbers are not equal'); + * + * @name notEqual + * @param {Mixed} actual + * @param {Mixed} expected + * @param {String} message + * @namespace Assert + * @api public + */assert.notEqual=function(act,exp,msg){var test=new Assertion(act,msg,assert.notEqual,true);test.assert(exp!=flag(test,'object'),'expected #{this} to not equal #{exp}','expected #{this} to equal #{act}',exp,act,true);};/** + * ### .strictEqual(actual, expected, [message]) + * + * Asserts strict equality (\`===\`) of \`actual\` and \`expected\`. + * + * assert.strictEqual(true, true, 'these booleans are strictly equal'); + * + * @name strictEqual + * @param {Mixed} actual + * @param {Mixed} expected + * @param {String} message + * @namespace Assert + * @api public + */assert.strictEqual=function(act,exp,msg){new Assertion(act,msg,assert.strictEqual,true).to.equal(exp);};/** + * ### .notStrictEqual(actual, expected, [message]) + * + * Asserts strict inequality (\`!==\`) of \`actual\` and \`expected\`. + * + * assert.notStrictEqual(3, '3', 'no coercion for strict equality'); + * + * @name notStrictEqual + * @param {Mixed} actual + * @param {Mixed} expected + * @param {String} message + * @namespace Assert + * @api public + */assert.notStrictEqual=function(act,exp,msg){new Assertion(act,msg,assert.notStrictEqual,true).to.not.equal(exp);};/** + * ### .deepEqual(actual, expected, [message]) + * + * Asserts that \`actual\` is deeply equal to \`expected\`. + * + * assert.deepEqual({ tea: 'green' }, { tea: 'green' }); + * + * @name deepEqual + * @param {Mixed} actual + * @param {Mixed} expected + * @param {String} message + * @alias deepStrictEqual + * @namespace Assert + * @api public + */assert.deepEqual=assert.deepStrictEqual=function(act,exp,msg){new Assertion(act,msg,assert.deepEqual,true).to.eql(exp);};/** + * ### .notDeepEqual(actual, expected, [message]) + * + * Assert that \`actual\` is not deeply equal to \`expected\`. + * + * assert.notDeepEqual({ tea: 'green' }, { tea: 'jasmine' }); + * + * @name notDeepEqual + * @param {Mixed} actual + * @param {Mixed} expected + * @param {String} message + * @namespace Assert + * @api public + */assert.notDeepEqual=function(act,exp,msg){new Assertion(act,msg,assert.notDeepEqual,true).to.not.eql(exp);};/** + * ### .isAbove(valueToCheck, valueToBeAbove, [message]) + * + * Asserts \`valueToCheck\` is strictly greater than (>) \`valueToBeAbove\`. + * + * assert.isAbove(5, 2, '5 is strictly greater than 2'); + * + * @name isAbove + * @param {Mixed} valueToCheck + * @param {Mixed} valueToBeAbove + * @param {String} message + * @namespace Assert + * @api public + */assert.isAbove=function(val,abv,msg){new Assertion(val,msg,assert.isAbove,true).to.be.above(abv);};/** + * ### .isAtLeast(valueToCheck, valueToBeAtLeast, [message]) + * + * Asserts \`valueToCheck\` is greater than or equal to (>=) \`valueToBeAtLeast\`. + * + * assert.isAtLeast(5, 2, '5 is greater or equal to 2'); + * assert.isAtLeast(3, 3, '3 is greater or equal to 3'); + * + * @name isAtLeast + * @param {Mixed} valueToCheck + * @param {Mixed} valueToBeAtLeast + * @param {String} message + * @namespace Assert + * @api public + */assert.isAtLeast=function(val,atlst,msg){new Assertion(val,msg,assert.isAtLeast,true).to.be.least(atlst);};/** + * ### .isBelow(valueToCheck, valueToBeBelow, [message]) + * + * Asserts \`valueToCheck\` is strictly less than (<) \`valueToBeBelow\`. + * + * assert.isBelow(3, 6, '3 is strictly less than 6'); + * + * @name isBelow + * @param {Mixed} valueToCheck + * @param {Mixed} valueToBeBelow + * @param {String} message + * @namespace Assert + * @api public + */assert.isBelow=function(val,blw,msg){new Assertion(val,msg,assert.isBelow,true).to.be.below(blw);};/** + * ### .isAtMost(valueToCheck, valueToBeAtMost, [message]) + * + * Asserts \`valueToCheck\` is less than or equal to (<=) \`valueToBeAtMost\`. + * + * assert.isAtMost(3, 6, '3 is less than or equal to 6'); + * assert.isAtMost(4, 4, '4 is less than or equal to 4'); + * + * @name isAtMost + * @param {Mixed} valueToCheck + * @param {Mixed} valueToBeAtMost + * @param {String} message + * @namespace Assert + * @api public + */assert.isAtMost=function(val,atmst,msg){new Assertion(val,msg,assert.isAtMost,true).to.be.most(atmst);};/** + * ### .isTrue(value, [message]) + * + * Asserts that \`value\` is true. + * + * var teaServed = true; + * assert.isTrue(teaServed, 'the tea has been served'); + * + * @name isTrue + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isTrue=function(val,msg){new Assertion(val,msg,assert.isTrue,true).is['true'];};/** + * ### .isNotTrue(value, [message]) + * + * Asserts that \`value\` is not true. + * + * var tea = 'tasty chai'; + * assert.isNotTrue(tea, 'great, time for tea!'); + * + * @name isNotTrue + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isNotTrue=function(val,msg){new Assertion(val,msg,assert.isNotTrue,true).to.not.equal(true);};/** + * ### .isFalse(value, [message]) + * + * Asserts that \`value\` is false. + * + * var teaServed = false; + * assert.isFalse(teaServed, 'no tea yet? hmm...'); + * + * @name isFalse + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isFalse=function(val,msg){new Assertion(val,msg,assert.isFalse,true).is['false'];};/** + * ### .isNotFalse(value, [message]) + * + * Asserts that \`value\` is not false. + * + * var tea = 'tasty chai'; + * assert.isNotFalse(tea, 'great, time for tea!'); + * + * @name isNotFalse + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isNotFalse=function(val,msg){new Assertion(val,msg,assert.isNotFalse,true).to.not.equal(false);};/** + * ### .isNull(value, [message]) + * + * Asserts that \`value\` is null. + * + * assert.isNull(err, 'there was no error'); + * + * @name isNull + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isNull=function(val,msg){new Assertion(val,msg,assert.isNull,true).to.equal(null);};/** + * ### .isNotNull(value, [message]) + * + * Asserts that \`value\` is not null. + * + * var tea = 'tasty chai'; + * assert.isNotNull(tea, 'great, time for tea!'); + * + * @name isNotNull + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isNotNull=function(val,msg){new Assertion(val,msg,assert.isNotNull,true).to.not.equal(null);};/** + * ### .isNaN + * + * Asserts that value is NaN. + * + * assert.isNaN(NaN, 'NaN is NaN'); + * + * @name isNaN + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isNaN=function(val,msg){new Assertion(val,msg,assert.isNaN,true).to.be.NaN;};/** + * ### .isNotNaN + * + * Asserts that value is not NaN. + * + * assert.isNotNaN(4, '4 is not NaN'); + * + * @name isNotNaN + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isNotNaN=function(val,msg){new Assertion(val,msg,assert.isNotNaN,true).not.to.be.NaN;};/** + * ### .exists + * + * Asserts that the target is neither \`null\` nor \`undefined\`. + * + * var foo = 'hi'; + * + * assert.exists(foo, 'foo is neither \`null\` nor \`undefined\`'); + * + * @name exists + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.exists=function(val,msg){new Assertion(val,msg,assert.exists,true).to.exist;};/** + * ### .notExists + * + * Asserts that the target is either \`null\` or \`undefined\`. + * + * var bar = null + * , baz; + * + * assert.notExists(bar); + * assert.notExists(baz, 'baz is either null or undefined'); + * + * @name notExists + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.notExists=function(val,msg){new Assertion(val,msg,assert.notExists,true).to.not.exist;};/** + * ### .isUndefined(value, [message]) + * + * Asserts that \`value\` is \`undefined\`. + * + * var tea; + * assert.isUndefined(tea, 'no tea defined'); + * + * @name isUndefined + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isUndefined=function(val,msg){new Assertion(val,msg,assert.isUndefined,true).to.equal(undefined);};/** + * ### .isDefined(value, [message]) + * + * Asserts that \`value\` is not \`undefined\`. + * + * var tea = 'cup of chai'; + * assert.isDefined(tea, 'tea has been defined'); + * + * @name isDefined + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isDefined=function(val,msg){new Assertion(val,msg,assert.isDefined,true).to.not.equal(undefined);};/** + * ### .isFunction(value, [message]) + * + * Asserts that \`value\` is a function. + * + * function serveTea() { return 'cup of tea'; }; + * assert.isFunction(serveTea, 'great, we can have tea now'); + * + * @name isFunction + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isFunction=function(val,msg){new Assertion(val,msg,assert.isFunction,true).to.be.a('function');};/** + * ### .isNotFunction(value, [message]) + * + * Asserts that \`value\` is _not_ a function. + * + * var serveTea = [ 'heat', 'pour', 'sip' ]; + * assert.isNotFunction(serveTea, 'great, we have listed the steps'); + * + * @name isNotFunction + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isNotFunction=function(val,msg){new Assertion(val,msg,assert.isNotFunction,true).to.not.be.a('function');};/** + * ### .isObject(value, [message]) + * + * Asserts that \`value\` is an object of type 'Object' (as revealed by \`Object.prototype.toString\`). + * _The assertion does not match subclassed objects._ + * + * var selection = { name: 'Chai', serve: 'with spices' }; + * assert.isObject(selection, 'tea selection is an object'); + * + * @name isObject + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isObject=function(val,msg){new Assertion(val,msg,assert.isObject,true).to.be.a('object');};/** + * ### .isNotObject(value, [message]) + * + * Asserts that \`value\` is _not_ an object of type 'Object' (as revealed by \`Object.prototype.toString\`). + * + * var selection = 'chai' + * assert.isNotObject(selection, 'tea selection is not an object'); + * assert.isNotObject(null, 'null is not an object'); + * + * @name isNotObject + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isNotObject=function(val,msg){new Assertion(val,msg,assert.isNotObject,true).to.not.be.a('object');};/** + * ### .isArray(value, [message]) + * + * Asserts that \`value\` is an array. + * + * var menu = [ 'green', 'chai', 'oolong' ]; + * assert.isArray(menu, 'what kind of tea do we want?'); + * + * @name isArray + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isArray=function(val,msg){new Assertion(val,msg,assert.isArray,true).to.be.an('array');};/** + * ### .isNotArray(value, [message]) + * + * Asserts that \`value\` is _not_ an array. + * + * var menu = 'green|chai|oolong'; + * assert.isNotArray(menu, 'what kind of tea do we want?'); + * + * @name isNotArray + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isNotArray=function(val,msg){new Assertion(val,msg,assert.isNotArray,true).to.not.be.an('array');};/** + * ### .isString(value, [message]) + * + * Asserts that \`value\` is a string. + * + * var teaOrder = 'chai'; + * assert.isString(teaOrder, 'order placed'); + * + * @name isString + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isString=function(val,msg){new Assertion(val,msg,assert.isString,true).to.be.a('string');};/** + * ### .isNotString(value, [message]) + * + * Asserts that \`value\` is _not_ a string. + * + * var teaOrder = 4; + * assert.isNotString(teaOrder, 'order placed'); + * + * @name isNotString + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isNotString=function(val,msg){new Assertion(val,msg,assert.isNotString,true).to.not.be.a('string');};/** + * ### .isNumber(value, [message]) + * + * Asserts that \`value\` is a number. + * + * var cups = 2; + * assert.isNumber(cups, 'how many cups'); + * + * @name isNumber + * @param {Number} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isNumber=function(val,msg){new Assertion(val,msg,assert.isNumber,true).to.be.a('number');};/** + * ### .isNotNumber(value, [message]) + * + * Asserts that \`value\` is _not_ a number. + * + * var cups = '2 cups please'; + * assert.isNotNumber(cups, 'how many cups'); + * + * @name isNotNumber + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isNotNumber=function(val,msg){new Assertion(val,msg,assert.isNotNumber,true).to.not.be.a('number');};/** + * ### .isFinite(value, [message]) + * + * Asserts that \`value\` is a finite number. Unlike \`.isNumber\`, this will fail for \`NaN\` and \`Infinity\`. + * + * var cups = 2; + * assert.isFinite(cups, 'how many cups'); + * + * assert.isFinite(NaN); // throws + * + * @name isFinite + * @param {Number} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isFinite=function(val,msg){new Assertion(val,msg,assert.isFinite,true).to.be.finite;};/** + * ### .isBoolean(value, [message]) + * + * Asserts that \`value\` is a boolean. + * + * var teaReady = true + * , teaServed = false; + * + * assert.isBoolean(teaReady, 'is the tea ready'); + * assert.isBoolean(teaServed, 'has tea been served'); + * + * @name isBoolean + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isBoolean=function(val,msg){new Assertion(val,msg,assert.isBoolean,true).to.be.a('boolean');};/** + * ### .isNotBoolean(value, [message]) + * + * Asserts that \`value\` is _not_ a boolean. + * + * var teaReady = 'yep' + * , teaServed = 'nope'; + * + * assert.isNotBoolean(teaReady, 'is the tea ready'); + * assert.isNotBoolean(teaServed, 'has tea been served'); + * + * @name isNotBoolean + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isNotBoolean=function(val,msg){new Assertion(val,msg,assert.isNotBoolean,true).to.not.be.a('boolean');};/** + * ### .typeOf(value, name, [message]) + * + * Asserts that \`value\`'s type is \`name\`, as determined by + * \`Object.prototype.toString\`. + * + * assert.typeOf({ tea: 'chai' }, 'object', 'we have an object'); + * assert.typeOf(['chai', 'jasmine'], 'array', 'we have an array'); + * assert.typeOf('tea', 'string', 'we have a string'); + * assert.typeOf(/tea/, 'regexp', 'we have a regular expression'); + * assert.typeOf(null, 'null', 'we have a null'); + * assert.typeOf(undefined, 'undefined', 'we have an undefined'); + * + * @name typeOf + * @param {Mixed} value + * @param {String} name + * @param {String} message + * @namespace Assert + * @api public + */assert.typeOf=function(val,type,msg){new Assertion(val,msg,assert.typeOf,true).to.be.a(type);};/** + * ### .notTypeOf(value, name, [message]) + * + * Asserts that \`value\`'s type is _not_ \`name\`, as determined by + * \`Object.prototype.toString\`. + * + * assert.notTypeOf('tea', 'number', 'strings are not numbers'); + * + * @name notTypeOf + * @param {Mixed} value + * @param {String} typeof name + * @param {String} message + * @namespace Assert + * @api public + */assert.notTypeOf=function(val,type,msg){new Assertion(val,msg,assert.notTypeOf,true).to.not.be.a(type);};/** + * ### .instanceOf(object, constructor, [message]) + * + * Asserts that \`value\` is an instance of \`constructor\`. + * + * var Tea = function (name) { this.name = name; } + * , chai = new Tea('chai'); + * + * assert.instanceOf(chai, Tea, 'chai is an instance of tea'); + * + * @name instanceOf + * @param {Object} object + * @param {Constructor} constructor + * @param {String} message + * @namespace Assert + * @api public + */assert.instanceOf=function(val,type,msg){new Assertion(val,msg,assert.instanceOf,true).to.be.instanceOf(type);};/** + * ### .notInstanceOf(object, constructor, [message]) + * + * Asserts \`value\` is not an instance of \`constructor\`. + * + * var Tea = function (name) { this.name = name; } + * , chai = new String('chai'); + * + * assert.notInstanceOf(chai, Tea, 'chai is not an instance of tea'); + * + * @name notInstanceOf + * @param {Object} object + * @param {Constructor} constructor + * @param {String} message + * @namespace Assert + * @api public + */assert.notInstanceOf=function(val,type,msg){new Assertion(val,msg,assert.notInstanceOf,true).to.not.be.instanceOf(type);};/** + * ### .include(haystack, needle, [message]) + * + * Asserts that \`haystack\` includes \`needle\`. Can be used to assert the + * inclusion of a value in an array, a substring in a string, or a subset of + * properties in an object. + * + * assert.include([1,2,3], 2, 'array contains value'); + * assert.include('foobar', 'foo', 'string contains substring'); + * assert.include({ foo: 'bar', hello: 'universe' }, { foo: 'bar' }, 'object contains property'); + * + * Strict equality (===) is used. When asserting the inclusion of a value in + * an array, the array is searched for an element that's strictly equal to the + * given value. When asserting a subset of properties in an object, the object + * is searched for the given property keys, checking that each one is present + * and strictly equal to the given property value. For instance: + * + * var obj1 = {a: 1} + * , obj2 = {b: 2}; + * assert.include([obj1, obj2], obj1); + * assert.include({foo: obj1, bar: obj2}, {foo: obj1}); + * assert.include({foo: obj1, bar: obj2}, {foo: obj1, bar: obj2}); + * + * @name include + * @param {Array|String} haystack + * @param {Mixed} needle + * @param {String} message + * @namespace Assert + * @api public + */assert.include=function(exp,inc,msg){new Assertion(exp,msg,assert.include,true).include(inc);};/** + * ### .notInclude(haystack, needle, [message]) + * + * Asserts that \`haystack\` does not include \`needle\`. Can be used to assert + * the absence of a value in an array, a substring in a string, or a subset of + * properties in an object. + * + * assert.notInclude([1,2,3], 4, "array doesn't contain value"); + * assert.notInclude('foobar', 'baz', "string doesn't contain substring"); + * assert.notInclude({ foo: 'bar', hello: 'universe' }, { foo: 'baz' }, 'object doesn't contain property'); + * + * Strict equality (===) is used. When asserting the absence of a value in an + * array, the array is searched to confirm the absence of an element that's + * strictly equal to the given value. When asserting a subset of properties in + * an object, the object is searched to confirm that at least one of the given + * property keys is either not present or not strictly equal to the given + * property value. For instance: + * + * var obj1 = {a: 1} + * , obj2 = {b: 2}; + * assert.notInclude([obj1, obj2], {a: 1}); + * assert.notInclude({foo: obj1, bar: obj2}, {foo: {a: 1}}); + * assert.notInclude({foo: obj1, bar: obj2}, {foo: obj1, bar: {b: 2}}); + * + * @name notInclude + * @param {Array|String} haystack + * @param {Mixed} needle + * @param {String} message + * @namespace Assert + * @api public + */assert.notInclude=function(exp,inc,msg){new Assertion(exp,msg,assert.notInclude,true).not.include(inc);};/** + * ### .deepInclude(haystack, needle, [message]) + * + * Asserts that \`haystack\` includes \`needle\`. Can be used to assert the + * inclusion of a value in an array or a subset of properties in an object. + * Deep equality is used. + * + * var obj1 = {a: 1} + * , obj2 = {b: 2}; + * assert.deepInclude([obj1, obj2], {a: 1}); + * assert.deepInclude({foo: obj1, bar: obj2}, {foo: {a: 1}}); + * assert.deepInclude({foo: obj1, bar: obj2}, {foo: {a: 1}, bar: {b: 2}}); + * + * @name deepInclude + * @param {Array|String} haystack + * @param {Mixed} needle + * @param {String} message + * @namespace Assert + * @api public + */assert.deepInclude=function(exp,inc,msg){new Assertion(exp,msg,assert.deepInclude,true).deep.include(inc);};/** + * ### .notDeepInclude(haystack, needle, [message]) + * + * Asserts that \`haystack\` does not include \`needle\`. Can be used to assert + * the absence of a value in an array or a subset of properties in an object. + * Deep equality is used. + * + * var obj1 = {a: 1} + * , obj2 = {b: 2}; + * assert.notDeepInclude([obj1, obj2], {a: 9}); + * assert.notDeepInclude({foo: obj1, bar: obj2}, {foo: {a: 9}}); + * assert.notDeepInclude({foo: obj1, bar: obj2}, {foo: {a: 1}, bar: {b: 9}}); + * + * @name notDeepInclude + * @param {Array|String} haystack + * @param {Mixed} needle + * @param {String} message + * @namespace Assert + * @api public + */assert.notDeepInclude=function(exp,inc,msg){new Assertion(exp,msg,assert.notDeepInclude,true).not.deep.include(inc);};/** + * ### .nestedInclude(haystack, needle, [message]) + * + * Asserts that 'haystack' includes 'needle'. + * Can be used to assert the inclusion of a subset of properties in an + * object. + * Enables the use of dot- and bracket-notation for referencing nested + * properties. + * '[]' and '.' in property names can be escaped using double backslashes. + * + * assert.nestedInclude({'.a': {'b': 'x'}}, {'\\\\.a.[b]': 'x'}); + * assert.nestedInclude({'a': {'[b]': 'x'}}, {'a.\\\\[b\\\\]': 'x'}); + * + * @name nestedInclude + * @param {Object} haystack + * @param {Object} needle + * @param {String} message + * @namespace Assert + * @api public + */assert.nestedInclude=function(exp,inc,msg){new Assertion(exp,msg,assert.nestedInclude,true).nested.include(inc);};/** + * ### .notNestedInclude(haystack, needle, [message]) + * + * Asserts that 'haystack' does not include 'needle'. + * Can be used to assert the absence of a subset of properties in an + * object. + * Enables the use of dot- and bracket-notation for referencing nested + * properties. + * '[]' and '.' in property names can be escaped using double backslashes. + * + * assert.notNestedInclude({'.a': {'b': 'x'}}, {'\\\\.a.b': 'y'}); + * assert.notNestedInclude({'a': {'[b]': 'x'}}, {'a.\\\\[b\\\\]': 'y'}); + * + * @name notNestedInclude + * @param {Object} haystack + * @param {Object} needle + * @param {String} message + * @namespace Assert + * @api public + */assert.notNestedInclude=function(exp,inc,msg){new Assertion(exp,msg,assert.notNestedInclude,true).not.nested.include(inc);};/** + * ### .deepNestedInclude(haystack, needle, [message]) + * + * Asserts that 'haystack' includes 'needle'. + * Can be used to assert the inclusion of a subset of properties in an + * object while checking for deep equality. + * Enables the use of dot- and bracket-notation for referencing nested + * properties. + * '[]' and '.' in property names can be escaped using double backslashes. + * + * assert.deepNestedInclude({a: {b: [{x: 1}]}}, {'a.b[0]': {x: 1}}); + * assert.deepNestedInclude({'.a': {'[b]': {x: 1}}}, {'\\\\.a.\\\\[b\\\\]': {x: 1}}); + * + * @name deepNestedInclude + * @param {Object} haystack + * @param {Object} needle + * @param {String} message + * @namespace Assert + * @api public + */assert.deepNestedInclude=function(exp,inc,msg){new Assertion(exp,msg,assert.deepNestedInclude,true).deep.nested.include(inc);};/** + * ### .notDeepNestedInclude(haystack, needle, [message]) + * + * Asserts that 'haystack' does not include 'needle'. + * Can be used to assert the absence of a subset of properties in an + * object while checking for deep equality. + * Enables the use of dot- and bracket-notation for referencing nested + * properties. + * '[]' and '.' in property names can be escaped using double backslashes. + * + * assert.notDeepNestedInclude({a: {b: [{x: 1}]}}, {'a.b[0]': {y: 1}}) + * assert.notDeepNestedInclude({'.a': {'[b]': {x: 1}}}, {'\\\\.a.\\\\[b\\\\]': {y: 2}}); + * + * @name notDeepNestedInclude + * @param {Object} haystack + * @param {Object} needle + * @param {String} message + * @namespace Assert + * @api public + */assert.notDeepNestedInclude=function(exp,inc,msg){new Assertion(exp,msg,assert.notDeepNestedInclude,true).not.deep.nested.include(inc);};/** + * ### .ownInclude(haystack, needle, [message]) + * + * Asserts that 'haystack' includes 'needle'. + * Can be used to assert the inclusion of a subset of properties in an + * object while ignoring inherited properties. + * + * assert.ownInclude({ a: 1 }, { a: 1 }); + * + * @name ownInclude + * @param {Object} haystack + * @param {Object} needle + * @param {String} message + * @namespace Assert + * @api public + */assert.ownInclude=function(exp,inc,msg){new Assertion(exp,msg,assert.ownInclude,true).own.include(inc);};/** + * ### .notOwnInclude(haystack, needle, [message]) + * + * Asserts that 'haystack' includes 'needle'. + * Can be used to assert the absence of a subset of properties in an + * object while ignoring inherited properties. + * + * Object.prototype.b = 2; + * + * assert.notOwnInclude({ a: 1 }, { b: 2 }); + * + * @name notOwnInclude + * @param {Object} haystack + * @param {Object} needle + * @param {String} message + * @namespace Assert + * @api public + */assert.notOwnInclude=function(exp,inc,msg){new Assertion(exp,msg,assert.notOwnInclude,true).not.own.include(inc);};/** + * ### .deepOwnInclude(haystack, needle, [message]) + * + * Asserts that 'haystack' includes 'needle'. + * Can be used to assert the inclusion of a subset of properties in an + * object while ignoring inherited properties and checking for deep equality. + * + * assert.deepOwnInclude({a: {b: 2}}, {a: {b: 2}}); + * + * @name deepOwnInclude + * @param {Object} haystack + * @param {Object} needle + * @param {String} message + * @namespace Assert + * @api public + */assert.deepOwnInclude=function(exp,inc,msg){new Assertion(exp,msg,assert.deepOwnInclude,true).deep.own.include(inc);};/** + * ### .notDeepOwnInclude(haystack, needle, [message]) + * + * Asserts that 'haystack' includes 'needle'. + * Can be used to assert the absence of a subset of properties in an + * object while ignoring inherited properties and checking for deep equality. + * + * assert.notDeepOwnInclude({a: {b: 2}}, {a: {c: 3}}); + * + * @name notDeepOwnInclude + * @param {Object} haystack + * @param {Object} needle + * @param {String} message + * @namespace Assert + * @api public + */assert.notDeepOwnInclude=function(exp,inc,msg){new Assertion(exp,msg,assert.notDeepOwnInclude,true).not.deep.own.include(inc);};/** + * ### .match(value, regexp, [message]) + * + * Asserts that \`value\` matches the regular expression \`regexp\`. + * + * assert.match('foobar', /^foo/, 'regexp matches'); + * + * @name match + * @param {Mixed} value + * @param {RegExp} regexp + * @param {String} message + * @namespace Assert + * @api public + */assert.match=function(exp,re,msg){new Assertion(exp,msg,assert.match,true).to.match(re);};/** + * ### .notMatch(value, regexp, [message]) + * + * Asserts that \`value\` does not match the regular expression \`regexp\`. + * + * assert.notMatch('foobar', /^foo/, 'regexp does not match'); + * + * @name notMatch + * @param {Mixed} value + * @param {RegExp} regexp + * @param {String} message + * @namespace Assert + * @api public + */assert.notMatch=function(exp,re,msg){new Assertion(exp,msg,assert.notMatch,true).to.not.match(re);};/** + * ### .property(object, property, [message]) + * + * Asserts that \`object\` has a direct or inherited property named by + * \`property\`. + * + * assert.property({ tea: { green: 'matcha' }}, 'tea'); + * assert.property({ tea: { green: 'matcha' }}, 'toString'); + * + * @name property + * @param {Object} object + * @param {String} property + * @param {String} message + * @namespace Assert + * @api public + */assert.property=function(obj,prop,msg){new Assertion(obj,msg,assert.property,true).to.have.property(prop);};/** + * ### .notProperty(object, property, [message]) + * + * Asserts that \`object\` does _not_ have a direct or inherited property named + * by \`property\`. + * + * assert.notProperty({ tea: { green: 'matcha' }}, 'coffee'); + * + * @name notProperty + * @param {Object} object + * @param {String} property + * @param {String} message + * @namespace Assert + * @api public + */assert.notProperty=function(obj,prop,msg){new Assertion(obj,msg,assert.notProperty,true).to.not.have.property(prop);};/** + * ### .propertyVal(object, property, value, [message]) + * + * Asserts that \`object\` has a direct or inherited property named by + * \`property\` with a value given by \`value\`. Uses a strict equality check + * (===). + * + * assert.propertyVal({ tea: 'is good' }, 'tea', 'is good'); + * + * @name propertyVal + * @param {Object} object + * @param {String} property + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.propertyVal=function(obj,prop,val,msg){new Assertion(obj,msg,assert.propertyVal,true).to.have.property(prop,val);};/** + * ### .notPropertyVal(object, property, value, [message]) + * + * Asserts that \`object\` does _not_ have a direct or inherited property named + * by \`property\` with value given by \`value\`. Uses a strict equality check + * (===). + * + * assert.notPropertyVal({ tea: 'is good' }, 'tea', 'is bad'); + * assert.notPropertyVal({ tea: 'is good' }, 'coffee', 'is good'); + * + * @name notPropertyVal + * @param {Object} object + * @param {String} property + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.notPropertyVal=function(obj,prop,val,msg){new Assertion(obj,msg,assert.notPropertyVal,true).to.not.have.property(prop,val);};/** + * ### .deepPropertyVal(object, property, value, [message]) + * + * Asserts that \`object\` has a direct or inherited property named by + * \`property\` with a value given by \`value\`. Uses a deep equality check. + * + * assert.deepPropertyVal({ tea: { green: 'matcha' } }, 'tea', { green: 'matcha' }); + * + * @name deepPropertyVal + * @param {Object} object + * @param {String} property + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.deepPropertyVal=function(obj,prop,val,msg){new Assertion(obj,msg,assert.deepPropertyVal,true).to.have.deep.property(prop,val);};/** + * ### .notDeepPropertyVal(object, property, value, [message]) + * + * Asserts that \`object\` does _not_ have a direct or inherited property named + * by \`property\` with value given by \`value\`. Uses a deep equality check. + * + * assert.notDeepPropertyVal({ tea: { green: 'matcha' } }, 'tea', { black: 'matcha' }); + * assert.notDeepPropertyVal({ tea: { green: 'matcha' } }, 'tea', { green: 'oolong' }); + * assert.notDeepPropertyVal({ tea: { green: 'matcha' } }, 'coffee', { green: 'matcha' }); + * + * @name notDeepPropertyVal + * @param {Object} object + * @param {String} property + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.notDeepPropertyVal=function(obj,prop,val,msg){new Assertion(obj,msg,assert.notDeepPropertyVal,true).to.not.have.deep.property(prop,val);};/** + * ### .ownProperty(object, property, [message]) + * + * Asserts that \`object\` has a direct property named by \`property\`. Inherited + * properties aren't checked. + * + * assert.ownProperty({ tea: { green: 'matcha' }}, 'tea'); + * + * @name ownProperty + * @param {Object} object + * @param {String} property + * @param {String} message + * @api public + */assert.ownProperty=function(obj,prop,msg){new Assertion(obj,msg,assert.ownProperty,true).to.have.own.property(prop);};/** + * ### .notOwnProperty(object, property, [message]) + * + * Asserts that \`object\` does _not_ have a direct property named by + * \`property\`. Inherited properties aren't checked. + * + * assert.notOwnProperty({ tea: { green: 'matcha' }}, 'coffee'); + * assert.notOwnProperty({}, 'toString'); + * + * @name notOwnProperty + * @param {Object} object + * @param {String} property + * @param {String} message + * @api public + */assert.notOwnProperty=function(obj,prop,msg){new Assertion(obj,msg,assert.notOwnProperty,true).to.not.have.own.property(prop);};/** + * ### .ownPropertyVal(object, property, value, [message]) + * + * Asserts that \`object\` has a direct property named by \`property\` and a value + * equal to the provided \`value\`. Uses a strict equality check (===). + * Inherited properties aren't checked. + * + * assert.ownPropertyVal({ coffee: 'is good'}, 'coffee', 'is good'); + * + * @name ownPropertyVal + * @param {Object} object + * @param {String} property + * @param {Mixed} value + * @param {String} message + * @api public + */assert.ownPropertyVal=function(obj,prop,value,msg){new Assertion(obj,msg,assert.ownPropertyVal,true).to.have.own.property(prop,value);};/** + * ### .notOwnPropertyVal(object, property, value, [message]) + * + * Asserts that \`object\` does _not_ have a direct property named by \`property\` + * with a value equal to the provided \`value\`. Uses a strict equality check + * (===). Inherited properties aren't checked. + * + * assert.notOwnPropertyVal({ tea: 'is better'}, 'tea', 'is worse'); + * assert.notOwnPropertyVal({}, 'toString', Object.prototype.toString); + * + * @name notOwnPropertyVal + * @param {Object} object + * @param {String} property + * @param {Mixed} value + * @param {String} message + * @api public + */assert.notOwnPropertyVal=function(obj,prop,value,msg){new Assertion(obj,msg,assert.notOwnPropertyVal,true).to.not.have.own.property(prop,value);};/** + * ### .deepOwnPropertyVal(object, property, value, [message]) + * + * Asserts that \`object\` has a direct property named by \`property\` and a value + * equal to the provided \`value\`. Uses a deep equality check. Inherited + * properties aren't checked. + * + * assert.deepOwnPropertyVal({ tea: { green: 'matcha' } }, 'tea', { green: 'matcha' }); + * + * @name deepOwnPropertyVal + * @param {Object} object + * @param {String} property + * @param {Mixed} value + * @param {String} message + * @api public + */assert.deepOwnPropertyVal=function(obj,prop,value,msg){new Assertion(obj,msg,assert.deepOwnPropertyVal,true).to.have.deep.own.property(prop,value);};/** + * ### .notDeepOwnPropertyVal(object, property, value, [message]) + * + * Asserts that \`object\` does _not_ have a direct property named by \`property\` + * with a value equal to the provided \`value\`. Uses a deep equality check. + * Inherited properties aren't checked. + * + * assert.notDeepOwnPropertyVal({ tea: { green: 'matcha' } }, 'tea', { black: 'matcha' }); + * assert.notDeepOwnPropertyVal({ tea: { green: 'matcha' } }, 'tea', { green: 'oolong' }); + * assert.notDeepOwnPropertyVal({ tea: { green: 'matcha' } }, 'coffee', { green: 'matcha' }); + * assert.notDeepOwnPropertyVal({}, 'toString', Object.prototype.toString); + * + * @name notDeepOwnPropertyVal + * @param {Object} object + * @param {String} property + * @param {Mixed} value + * @param {String} message + * @api public + */assert.notDeepOwnPropertyVal=function(obj,prop,value,msg){new Assertion(obj,msg,assert.notDeepOwnPropertyVal,true).to.not.have.deep.own.property(prop,value);};/** + * ### .nestedProperty(object, property, [message]) + * + * Asserts that \`object\` has a direct or inherited property named by + * \`property\`, which can be a string using dot- and bracket-notation for + * nested reference. + * + * assert.nestedProperty({ tea: { green: 'matcha' }}, 'tea.green'); + * + * @name nestedProperty + * @param {Object} object + * @param {String} property + * @param {String} message + * @namespace Assert + * @api public + */assert.nestedProperty=function(obj,prop,msg){new Assertion(obj,msg,assert.nestedProperty,true).to.have.nested.property(prop);};/** + * ### .notNestedProperty(object, property, [message]) + * + * Asserts that \`object\` does _not_ have a property named by \`property\`, which + * can be a string using dot- and bracket-notation for nested reference. The + * property cannot exist on the object nor anywhere in its prototype chain. + * + * assert.notNestedProperty({ tea: { green: 'matcha' }}, 'tea.oolong'); + * + * @name notNestedProperty + * @param {Object} object + * @param {String} property + * @param {String} message + * @namespace Assert + * @api public + */assert.notNestedProperty=function(obj,prop,msg){new Assertion(obj,msg,assert.notNestedProperty,true).to.not.have.nested.property(prop);};/** + * ### .nestedPropertyVal(object, property, value, [message]) + * + * Asserts that \`object\` has a property named by \`property\` with value given + * by \`value\`. \`property\` can use dot- and bracket-notation for nested + * reference. Uses a strict equality check (===). + * + * assert.nestedPropertyVal({ tea: { green: 'matcha' }}, 'tea.green', 'matcha'); + * + * @name nestedPropertyVal + * @param {Object} object + * @param {String} property + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.nestedPropertyVal=function(obj,prop,val,msg){new Assertion(obj,msg,assert.nestedPropertyVal,true).to.have.nested.property(prop,val);};/** + * ### .notNestedPropertyVal(object, property, value, [message]) + * + * Asserts that \`object\` does _not_ have a property named by \`property\` with + * value given by \`value\`. \`property\` can use dot- and bracket-notation for + * nested reference. Uses a strict equality check (===). + * + * assert.notNestedPropertyVal({ tea: { green: 'matcha' }}, 'tea.green', 'konacha'); + * assert.notNestedPropertyVal({ tea: { green: 'matcha' }}, 'coffee.green', 'matcha'); + * + * @name notNestedPropertyVal + * @param {Object} object + * @param {String} property + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.notNestedPropertyVal=function(obj,prop,val,msg){new Assertion(obj,msg,assert.notNestedPropertyVal,true).to.not.have.nested.property(prop,val);};/** + * ### .deepNestedPropertyVal(object, property, value, [message]) + * + * Asserts that \`object\` has a property named by \`property\` with a value given + * by \`value\`. \`property\` can use dot- and bracket-notation for nested + * reference. Uses a deep equality check. + * + * assert.deepNestedPropertyVal({ tea: { green: { matcha: 'yum' } } }, 'tea.green', { matcha: 'yum' }); + * + * @name deepNestedPropertyVal + * @param {Object} object + * @param {String} property + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.deepNestedPropertyVal=function(obj,prop,val,msg){new Assertion(obj,msg,assert.deepNestedPropertyVal,true).to.have.deep.nested.property(prop,val);};/** + * ### .notDeepNestedPropertyVal(object, property, value, [message]) + * + * Asserts that \`object\` does _not_ have a property named by \`property\` with + * value given by \`value\`. \`property\` can use dot- and bracket-notation for + * nested reference. Uses a deep equality check. + * + * assert.notDeepNestedPropertyVal({ tea: { green: { matcha: 'yum' } } }, 'tea.green', { oolong: 'yum' }); + * assert.notDeepNestedPropertyVal({ tea: { green: { matcha: 'yum' } } }, 'tea.green', { matcha: 'yuck' }); + * assert.notDeepNestedPropertyVal({ tea: { green: { matcha: 'yum' } } }, 'tea.black', { matcha: 'yum' }); + * + * @name notDeepNestedPropertyVal + * @param {Object} object + * @param {String} property + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.notDeepNestedPropertyVal=function(obj,prop,val,msg){new Assertion(obj,msg,assert.notDeepNestedPropertyVal,true).to.not.have.deep.nested.property(prop,val);};/** + * ### .lengthOf(object, length, [message]) + * + * Asserts that \`object\` has a \`length\` or \`size\` with the expected value. + * + * assert.lengthOf([1,2,3], 3, 'array has length of 3'); + * assert.lengthOf('foobar', 6, 'string has length of 6'); + * assert.lengthOf(new Set([1,2,3]), 3, 'set has size of 3'); + * assert.lengthOf(new Map([['a',1],['b',2],['c',3]]), 3, 'map has size of 3'); + * + * @name lengthOf + * @param {Mixed} object + * @param {Number} length + * @param {String} message + * @namespace Assert + * @api public + */assert.lengthOf=function(exp,len,msg){new Assertion(exp,msg,assert.lengthOf,true).to.have.lengthOf(len);};/** + * ### .hasAnyKeys(object, [keys], [message]) + * + * Asserts that \`object\` has at least one of the \`keys\` provided. + * You can also provide a single object instead of a \`keys\` array and its keys + * will be used as the expected set of keys. + * + * assert.hasAnyKeys({foo: 1, bar: 2, baz: 3}, ['foo', 'iDontExist', 'baz']); + * assert.hasAnyKeys({foo: 1, bar: 2, baz: 3}, {foo: 30, iDontExist: 99, baz: 1337}); + * assert.hasAnyKeys(new Map([[{foo: 1}, 'bar'], ['key', 'value']]), [{foo: 1}, 'key']); + * assert.hasAnyKeys(new Set([{foo: 'bar'}, 'anotherKey']), [{foo: 'bar'}, 'anotherKey']); + * + * @name hasAnyKeys + * @param {Mixed} object + * @param {Array|Object} keys + * @param {String} message + * @namespace Assert + * @api public + */assert.hasAnyKeys=function(obj,keys,msg){new Assertion(obj,msg,assert.hasAnyKeys,true).to.have.any.keys(keys);};/** + * ### .hasAllKeys(object, [keys], [message]) + * + * Asserts that \`object\` has all and only all of the \`keys\` provided. + * You can also provide a single object instead of a \`keys\` array and its keys + * will be used as the expected set of keys. + * + * assert.hasAllKeys({foo: 1, bar: 2, baz: 3}, ['foo', 'bar', 'baz']); + * assert.hasAllKeys({foo: 1, bar: 2, baz: 3}, {foo: 30, bar: 99, baz: 1337]); + * assert.hasAllKeys(new Map([[{foo: 1}, 'bar'], ['key', 'value']]), [{foo: 1}, 'key']); + * assert.hasAllKeys(new Set([{foo: 'bar'}, 'anotherKey'], [{foo: 'bar'}, 'anotherKey']); + * + * @name hasAllKeys + * @param {Mixed} object + * @param {String[]} keys + * @param {String} message + * @namespace Assert + * @api public + */assert.hasAllKeys=function(obj,keys,msg){new Assertion(obj,msg,assert.hasAllKeys,true).to.have.all.keys(keys);};/** + * ### .containsAllKeys(object, [keys], [message]) + * + * Asserts that \`object\` has all of the \`keys\` provided but may have more keys not listed. + * You can also provide a single object instead of a \`keys\` array and its keys + * will be used as the expected set of keys. + * + * assert.containsAllKeys({foo: 1, bar: 2, baz: 3}, ['foo', 'baz']); + * assert.containsAllKeys({foo: 1, bar: 2, baz: 3}, ['foo', 'bar', 'baz']); + * assert.containsAllKeys({foo: 1, bar: 2, baz: 3}, {foo: 30, baz: 1337}); + * assert.containsAllKeys({foo: 1, bar: 2, baz: 3}, {foo: 30, bar: 99, baz: 1337}); + * assert.containsAllKeys(new Map([[{foo: 1}, 'bar'], ['key', 'value']]), [{foo: 1}]); + * assert.containsAllKeys(new Map([[{foo: 1}, 'bar'], ['key', 'value']]), [{foo: 1}, 'key']); + * assert.containsAllKeys(new Set([{foo: 'bar'}, 'anotherKey'], [{foo: 'bar'}]); + * assert.containsAllKeys(new Set([{foo: 'bar'}, 'anotherKey'], [{foo: 'bar'}, 'anotherKey']); + * + * @name containsAllKeys + * @param {Mixed} object + * @param {String[]} keys + * @param {String} message + * @namespace Assert + * @api public + */assert.containsAllKeys=function(obj,keys,msg){new Assertion(obj,msg,assert.containsAllKeys,true).to.contain.all.keys(keys);};/** + * ### .doesNotHaveAnyKeys(object, [keys], [message]) + * + * Asserts that \`object\` has none of the \`keys\` provided. + * You can also provide a single object instead of a \`keys\` array and its keys + * will be used as the expected set of keys. + * + * assert.doesNotHaveAnyKeys({foo: 1, bar: 2, baz: 3}, ['one', 'two', 'example']); + * assert.doesNotHaveAnyKeys({foo: 1, bar: 2, baz: 3}, {one: 1, two: 2, example: 'foo'}); + * assert.doesNotHaveAnyKeys(new Map([[{foo: 1}, 'bar'], ['key', 'value']]), [{one: 'two'}, 'example']); + * assert.doesNotHaveAnyKeys(new Set([{foo: 'bar'}, 'anotherKey'], [{one: 'two'}, 'example']); + * + * @name doesNotHaveAnyKeys + * @param {Mixed} object + * @param {String[]} keys + * @param {String} message + * @namespace Assert + * @api public + */assert.doesNotHaveAnyKeys=function(obj,keys,msg){new Assertion(obj,msg,assert.doesNotHaveAnyKeys,true).to.not.have.any.keys(keys);};/** + * ### .doesNotHaveAllKeys(object, [keys], [message]) + * + * Asserts that \`object\` does not have at least one of the \`keys\` provided. + * You can also provide a single object instead of a \`keys\` array and its keys + * will be used as the expected set of keys. + * + * assert.doesNotHaveAllKeys({foo: 1, bar: 2, baz: 3}, ['one', 'two', 'example']); + * assert.doesNotHaveAllKeys({foo: 1, bar: 2, baz: 3}, {one: 1, two: 2, example: 'foo'}); + * assert.doesNotHaveAllKeys(new Map([[{foo: 1}, 'bar'], ['key', 'value']]), [{one: 'two'}, 'example']); + * assert.doesNotHaveAllKeys(new Set([{foo: 'bar'}, 'anotherKey'], [{one: 'two'}, 'example']); + * + * @name doesNotHaveAllKeys + * @param {Mixed} object + * @param {String[]} keys + * @param {String} message + * @namespace Assert + * @api public + */assert.doesNotHaveAllKeys=function(obj,keys,msg){new Assertion(obj,msg,assert.doesNotHaveAllKeys,true).to.not.have.all.keys(keys);};/** + * ### .hasAnyDeepKeys(object, [keys], [message]) + * + * Asserts that \`object\` has at least one of the \`keys\` provided. + * Since Sets and Maps can have objects as keys you can use this assertion to perform + * a deep comparison. + * You can also provide a single object instead of a \`keys\` array and its keys + * will be used as the expected set of keys. + * + * assert.hasAnyDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [1, 2]]), {one: 'one'}); + * assert.hasAnyDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [1, 2]]), [{one: 'one'}, {two: 'two'}]); + * assert.hasAnyDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [{two: 'two'}, 'valueTwo']]), [{one: 'one'}, {two: 'two'}]); + * assert.hasAnyDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), {one: 'one'}); + * assert.hasAnyDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {three: 'three'}]); + * assert.hasAnyDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {two: 'two'}]); + * + * @name hasAnyDeepKeys + * @param {Mixed} object + * @param {Array|Object} keys + * @param {String} message + * @namespace Assert + * @api public + */assert.hasAnyDeepKeys=function(obj,keys,msg){new Assertion(obj,msg,assert.hasAnyDeepKeys,true).to.have.any.deep.keys(keys);};/** + * ### .hasAllDeepKeys(object, [keys], [message]) + * + * Asserts that \`object\` has all and only all of the \`keys\` provided. + * Since Sets and Maps can have objects as keys you can use this assertion to perform + * a deep comparison. + * You can also provide a single object instead of a \`keys\` array and its keys + * will be used as the expected set of keys. + * + * assert.hasAllDeepKeys(new Map([[{one: 'one'}, 'valueOne']]), {one: 'one'}); + * assert.hasAllDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [{two: 'two'}, 'valueTwo']]), [{one: 'one'}, {two: 'two'}]); + * assert.hasAllDeepKeys(new Set([{one: 'one'}]), {one: 'one'}); + * assert.hasAllDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {two: 'two'}]); + * + * @name hasAllDeepKeys + * @param {Mixed} object + * @param {Array|Object} keys + * @param {String} message + * @namespace Assert + * @api public + */assert.hasAllDeepKeys=function(obj,keys,msg){new Assertion(obj,msg,assert.hasAllDeepKeys,true).to.have.all.deep.keys(keys);};/** + * ### .containsAllDeepKeys(object, [keys], [message]) + * + * Asserts that \`object\` contains all of the \`keys\` provided. + * Since Sets and Maps can have objects as keys you can use this assertion to perform + * a deep comparison. + * You can also provide a single object instead of a \`keys\` array and its keys + * will be used as the expected set of keys. + * + * assert.containsAllDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [1, 2]]), {one: 'one'}); + * assert.containsAllDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [{two: 'two'}, 'valueTwo']]), [{one: 'one'}, {two: 'two'}]); + * assert.containsAllDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), {one: 'one'}); + * assert.containsAllDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {two: 'two'}]); + * + * @name containsAllDeepKeys + * @param {Mixed} object + * @param {Array|Object} keys + * @param {String} message + * @namespace Assert + * @api public + */assert.containsAllDeepKeys=function(obj,keys,msg){new Assertion(obj,msg,assert.containsAllDeepKeys,true).to.contain.all.deep.keys(keys);};/** + * ### .doesNotHaveAnyDeepKeys(object, [keys], [message]) + * + * Asserts that \`object\` has none of the \`keys\` provided. + * Since Sets and Maps can have objects as keys you can use this assertion to perform + * a deep comparison. + * You can also provide a single object instead of a \`keys\` array and its keys + * will be used as the expected set of keys. + * + * assert.doesNotHaveAnyDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [1, 2]]), {thisDoesNot: 'exist'}); + * assert.doesNotHaveAnyDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [{two: 'two'}, 'valueTwo']]), [{twenty: 'twenty'}, {fifty: 'fifty'}]); + * assert.doesNotHaveAnyDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), {twenty: 'twenty'}); + * assert.doesNotHaveAnyDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{twenty: 'twenty'}, {fifty: 'fifty'}]); + * + * @name doesNotHaveAnyDeepKeys + * @param {Mixed} object + * @param {Array|Object} keys + * @param {String} message + * @namespace Assert + * @api public + */assert.doesNotHaveAnyDeepKeys=function(obj,keys,msg){new Assertion(obj,msg,assert.doesNotHaveAnyDeepKeys,true).to.not.have.any.deep.keys(keys);};/** + * ### .doesNotHaveAllDeepKeys(object, [keys], [message]) + * + * Asserts that \`object\` does not have at least one of the \`keys\` provided. + * Since Sets and Maps can have objects as keys you can use this assertion to perform + * a deep comparison. + * You can also provide a single object instead of a \`keys\` array and its keys + * will be used as the expected set of keys. + * + * assert.doesNotHaveAllDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [1, 2]]), {thisDoesNot: 'exist'}); + * assert.doesNotHaveAllDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [{two: 'two'}, 'valueTwo']]), [{twenty: 'twenty'}, {one: 'one'}]); + * assert.doesNotHaveAllDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), {twenty: 'twenty'}); + * assert.doesNotHaveAllDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {fifty: 'fifty'}]); + * + * @name doesNotHaveAllDeepKeys + * @param {Mixed} object + * @param {Array|Object} keys + * @param {String} message + * @namespace Assert + * @api public + */assert.doesNotHaveAllDeepKeys=function(obj,keys,msg){new Assertion(obj,msg,assert.doesNotHaveAllDeepKeys,true).to.not.have.all.deep.keys(keys);};/** + * ### .throws(fn, [errorLike/string/regexp], [string/regexp], [message]) + * + * If \`errorLike\` is an \`Error\` constructor, asserts that \`fn\` will throw an error that is an + * instance of \`errorLike\`. + * If \`errorLike\` is an \`Error\` instance, asserts that the error thrown is the same + * instance as \`errorLike\`. + * If \`errMsgMatcher\` is provided, it also asserts that the error thrown will have a + * message matching \`errMsgMatcher\`. + * + * assert.throws(fn, 'Error thrown must have this msg'); + * assert.throws(fn, /Error thrown must have a msg that matches this/); + * assert.throws(fn, ReferenceError); + * assert.throws(fn, errorInstance); + * assert.throws(fn, ReferenceError, 'Error thrown must be a ReferenceError and have this msg'); + * assert.throws(fn, errorInstance, 'Error thrown must be the same errorInstance and have this msg'); + * assert.throws(fn, ReferenceError, /Error thrown must be a ReferenceError and match this/); + * assert.throws(fn, errorInstance, /Error thrown must be the same errorInstance and match this/); + * + * @name throws + * @alias throw + * @alias Throw + * @param {Function} fn + * @param {ErrorConstructor|Error} errorLike + * @param {RegExp|String} errMsgMatcher + * @param {String} message + * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types + * @namespace Assert + * @api public + */assert.throws=function(fn,errorLike,errMsgMatcher,msg){if('string'===typeof errorLike||errorLike instanceof RegExp){errMsgMatcher=errorLike;errorLike=null;}var assertErr=new Assertion(fn,msg,assert.throws,true).to.throw(errorLike,errMsgMatcher);return flag(assertErr,'object');};/** + * ### .doesNotThrow(fn, [errorLike/string/regexp], [string/regexp], [message]) + * + * If \`errorLike\` is an \`Error\` constructor, asserts that \`fn\` will _not_ throw an error that is an + * instance of \`errorLike\`. + * If \`errorLike\` is an \`Error\` instance, asserts that the error thrown is _not_ the same + * instance as \`errorLike\`. + * If \`errMsgMatcher\` is provided, it also asserts that the error thrown will _not_ have a + * message matching \`errMsgMatcher\`. + * + * assert.doesNotThrow(fn, 'Any Error thrown must not have this message'); + * assert.doesNotThrow(fn, /Any Error thrown must not match this/); + * assert.doesNotThrow(fn, Error); + * assert.doesNotThrow(fn, errorInstance); + * assert.doesNotThrow(fn, Error, 'Error must not have this message'); + * assert.doesNotThrow(fn, errorInstance, 'Error must not have this message'); + * assert.doesNotThrow(fn, Error, /Error must not match this/); + * assert.doesNotThrow(fn, errorInstance, /Error must not match this/); + * + * @name doesNotThrow + * @param {Function} fn + * @param {ErrorConstructor} errorLike + * @param {RegExp|String} errMsgMatcher + * @param {String} message + * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types + * @namespace Assert + * @api public + */assert.doesNotThrow=function(fn,errorLike,errMsgMatcher,msg){if('string'===typeof errorLike||errorLike instanceof RegExp){errMsgMatcher=errorLike;errorLike=null;}new Assertion(fn,msg,assert.doesNotThrow,true).to.not.throw(errorLike,errMsgMatcher);};/** + * ### .operator(val1, operator, val2, [message]) + * + * Compares two values using \`operator\`. + * + * assert.operator(1, '<', 2, 'everything is ok'); + * assert.operator(1, '>', 2, 'this will fail'); + * + * @name operator + * @param {Mixed} val1 + * @param {String} operator + * @param {Mixed} val2 + * @param {String} message + * @namespace Assert + * @api public + */assert.operator=function(val,operator,val2,msg){var ok;switch(operator){case'==':ok=val==val2;break;case'===':ok=val===val2;break;case'>':ok=val>val2;break;case'>=':ok=val>=val2;break;case'<':ok=val} list + * @param {String} message + * @namespace Assert + * @api public + */assert.oneOf=function(inList,list,msg){new Assertion(inList,msg,assert.oneOf,true).to.be.oneOf(list);};/** + * ### .changes(function, object, property, [message]) + * + * Asserts that a function changes the value of a property. + * + * var obj = { val: 10 }; + * var fn = function() { obj.val = 22 }; + * assert.changes(fn, obj, 'val'); + * + * @name changes + * @param {Function} modifier function + * @param {Object} object or getter function + * @param {String} property name _optional_ + * @param {String} message _optional_ + * @namespace Assert + * @api public + */assert.changes=function(fn,obj,prop,msg){if(arguments.length===3&&typeof obj==='function'){msg=prop;prop=null;}new Assertion(fn,msg,assert.changes,true).to.change(obj,prop);};/** + * ### .changesBy(function, object, property, delta, [message]) + * + * Asserts that a function changes the value of a property by an amount (delta). + * + * var obj = { val: 10 }; + * var fn = function() { obj.val += 2 }; + * assert.changesBy(fn, obj, 'val', 2); + * + * @name changesBy + * @param {Function} modifier function + * @param {Object} object or getter function + * @param {String} property name _optional_ + * @param {Number} change amount (delta) + * @param {String} message _optional_ + * @namespace Assert + * @api public + */assert.changesBy=function(fn,obj,prop,delta,msg){if(arguments.length===4&&typeof obj==='function'){var tmpMsg=delta;delta=prop;msg=tmpMsg;}else if(arguments.length===3){delta=prop;prop=null;}new Assertion(fn,msg,assert.changesBy,true).to.change(obj,prop).by(delta);};/** + * ### .doesNotChange(function, object, property, [message]) + * + * Asserts that a function does not change the value of a property. + * + * var obj = { val: 10 }; + * var fn = function() { console.log('foo'); }; + * assert.doesNotChange(fn, obj, 'val'); + * + * @name doesNotChange + * @param {Function} modifier function + * @param {Object} object or getter function + * @param {String} property name _optional_ + * @param {String} message _optional_ + * @namespace Assert + * @api public + */assert.doesNotChange=function(fn,obj,prop,msg){if(arguments.length===3&&typeof obj==='function'){msg=prop;prop=null;}return new Assertion(fn,msg,assert.doesNotChange,true).to.not.change(obj,prop);};/** + * ### .changesButNotBy(function, object, property, delta, [message]) + * + * Asserts that a function does not change the value of a property or of a function's return value by an amount (delta) + * + * var obj = { val: 10 }; + * var fn = function() { obj.val += 10 }; + * assert.changesButNotBy(fn, obj, 'val', 5); + * + * @name changesButNotBy + * @param {Function} modifier function + * @param {Object} object or getter function + * @param {String} property name _optional_ + * @param {Number} change amount (delta) + * @param {String} message _optional_ + * @namespace Assert + * @api public + */assert.changesButNotBy=function(fn,obj,prop,delta,msg){if(arguments.length===4&&typeof obj==='function'){var tmpMsg=delta;delta=prop;msg=tmpMsg;}else if(arguments.length===3){delta=prop;prop=null;}new Assertion(fn,msg,assert.changesButNotBy,true).to.change(obj,prop).but.not.by(delta);};/** + * ### .increases(function, object, property, [message]) + * + * Asserts that a function increases a numeric object property. + * + * var obj = { val: 10 }; + * var fn = function() { obj.val = 13 }; + * assert.increases(fn, obj, 'val'); + * + * @name increases + * @param {Function} modifier function + * @param {Object} object or getter function + * @param {String} property name _optional_ + * @param {String} message _optional_ + * @namespace Assert + * @api public + */assert.increases=function(fn,obj,prop,msg){if(arguments.length===3&&typeof obj==='function'){msg=prop;prop=null;}return new Assertion(fn,msg,assert.increases,true).to.increase(obj,prop);};/** + * ### .increasesBy(function, object, property, delta, [message]) + * + * Asserts that a function increases a numeric object property or a function's return value by an amount (delta). + * + * var obj = { val: 10 }; + * var fn = function() { obj.val += 10 }; + * assert.increasesBy(fn, obj, 'val', 10); + * + * @name increasesBy + * @param {Function} modifier function + * @param {Object} object or getter function + * @param {String} property name _optional_ + * @param {Number} change amount (delta) + * @param {String} message _optional_ + * @namespace Assert + * @api public + */assert.increasesBy=function(fn,obj,prop,delta,msg){if(arguments.length===4&&typeof obj==='function'){var tmpMsg=delta;delta=prop;msg=tmpMsg;}else if(arguments.length===3){delta=prop;prop=null;}new Assertion(fn,msg,assert.increasesBy,true).to.increase(obj,prop).by(delta);};/** + * ### .doesNotIncrease(function, object, property, [message]) + * + * Asserts that a function does not increase a numeric object property. + * + * var obj = { val: 10 }; + * var fn = function() { obj.val = 8 }; + * assert.doesNotIncrease(fn, obj, 'val'); + * + * @name doesNotIncrease + * @param {Function} modifier function + * @param {Object} object or getter function + * @param {String} property name _optional_ + * @param {String} message _optional_ + * @namespace Assert + * @api public + */assert.doesNotIncrease=function(fn,obj,prop,msg){if(arguments.length===3&&typeof obj==='function'){msg=prop;prop=null;}return new Assertion(fn,msg,assert.doesNotIncrease,true).to.not.increase(obj,prop);};/** + * ### .increasesButNotBy(function, object, property, delta, [message]) + * + * Asserts that a function does not increase a numeric object property or function's return value by an amount (delta). + * + * var obj = { val: 10 }; + * var fn = function() { obj.val = 15 }; + * assert.increasesButNotBy(fn, obj, 'val', 10); + * + * @name increasesButNotBy + * @param {Function} modifier function + * @param {Object} object or getter function + * @param {String} property name _optional_ + * @param {Number} change amount (delta) + * @param {String} message _optional_ + * @namespace Assert + * @api public + */assert.increasesButNotBy=function(fn,obj,prop,delta,msg){if(arguments.length===4&&typeof obj==='function'){var tmpMsg=delta;delta=prop;msg=tmpMsg;}else if(arguments.length===3){delta=prop;prop=null;}new Assertion(fn,msg,assert.increasesButNotBy,true).to.increase(obj,prop).but.not.by(delta);};/** + * ### .decreases(function, object, property, [message]) + * + * Asserts that a function decreases a numeric object property. + * + * var obj = { val: 10 }; + * var fn = function() { obj.val = 5 }; + * assert.decreases(fn, obj, 'val'); + * + * @name decreases + * @param {Function} modifier function + * @param {Object} object or getter function + * @param {String} property name _optional_ + * @param {String} message _optional_ + * @namespace Assert + * @api public + */assert.decreases=function(fn,obj,prop,msg){if(arguments.length===3&&typeof obj==='function'){msg=prop;prop=null;}return new Assertion(fn,msg,assert.decreases,true).to.decrease(obj,prop);};/** + * ### .decreasesBy(function, object, property, delta, [message]) + * + * Asserts that a function decreases a numeric object property or a function's return value by an amount (delta) + * + * var obj = { val: 10 }; + * var fn = function() { obj.val -= 5 }; + * assert.decreasesBy(fn, obj, 'val', 5); + * + * @name decreasesBy + * @param {Function} modifier function + * @param {Object} object or getter function + * @param {String} property name _optional_ + * @param {Number} change amount (delta) + * @param {String} message _optional_ + * @namespace Assert + * @api public + */assert.decreasesBy=function(fn,obj,prop,delta,msg){if(arguments.length===4&&typeof obj==='function'){var tmpMsg=delta;delta=prop;msg=tmpMsg;}else if(arguments.length===3){delta=prop;prop=null;}new Assertion(fn,msg,assert.decreasesBy,true).to.decrease(obj,prop).by(delta);};/** + * ### .doesNotDecrease(function, object, property, [message]) + * + * Asserts that a function does not decreases a numeric object property. + * + * var obj = { val: 10 }; + * var fn = function() { obj.val = 15 }; + * assert.doesNotDecrease(fn, obj, 'val'); + * + * @name doesNotDecrease + * @param {Function} modifier function + * @param {Object} object or getter function + * @param {String} property name _optional_ + * @param {String} message _optional_ + * @namespace Assert + * @api public + */assert.doesNotDecrease=function(fn,obj,prop,msg){if(arguments.length===3&&typeof obj==='function'){msg=prop;prop=null;}return new Assertion(fn,msg,assert.doesNotDecrease,true).to.not.decrease(obj,prop);};/** + * ### .doesNotDecreaseBy(function, object, property, delta, [message]) + * + * Asserts that a function does not decreases a numeric object property or a function's return value by an amount (delta) + * + * var obj = { val: 10 }; + * var fn = function() { obj.val = 5 }; + * assert.doesNotDecreaseBy(fn, obj, 'val', 1); + * + * @name doesNotDecreaseBy + * @param {Function} modifier function + * @param {Object} object or getter function + * @param {String} property name _optional_ + * @param {Number} change amount (delta) + * @param {String} message _optional_ + * @namespace Assert + * @api public + */assert.doesNotDecreaseBy=function(fn,obj,prop,delta,msg){if(arguments.length===4&&typeof obj==='function'){var tmpMsg=delta;delta=prop;msg=tmpMsg;}else if(arguments.length===3){delta=prop;prop=null;}return new Assertion(fn,msg,assert.doesNotDecreaseBy,true).to.not.decrease(obj,prop).by(delta);};/** + * ### .decreasesButNotBy(function, object, property, delta, [message]) + * + * Asserts that a function does not decreases a numeric object property or a function's return value by an amount (delta) + * + * var obj = { val: 10 }; + * var fn = function() { obj.val = 5 }; + * assert.decreasesButNotBy(fn, obj, 'val', 1); + * + * @name decreasesButNotBy + * @param {Function} modifier function + * @param {Object} object or getter function + * @param {String} property name _optional_ + * @param {Number} change amount (delta) + * @param {String} message _optional_ + * @namespace Assert + * @api public + */assert.decreasesButNotBy=function(fn,obj,prop,delta,msg){if(arguments.length===4&&typeof obj==='function'){var tmpMsg=delta;delta=prop;msg=tmpMsg;}else if(arguments.length===3){delta=prop;prop=null;}new Assertion(fn,msg,assert.decreasesButNotBy,true).to.decrease(obj,prop).but.not.by(delta);};/*! + * ### .ifError(object) + * + * Asserts if value is not a false value, and throws if it is a true value. + * This is added to allow for chai to be a drop-in replacement for Node's + * assert class. + * + * var err = new Error('I am a custom error'); + * assert.ifError(err); // Rethrows err! + * + * @name ifError + * @param {Object} object + * @namespace Assert + * @api public + */assert.ifError=function(val){if(val){throw val;}};/** + * ### .isExtensible(object) + * + * Asserts that \`object\` is extensible (can have new properties added to it). + * + * assert.isExtensible({}); + * + * @name isExtensible + * @alias extensible + * @param {Object} object + * @param {String} message _optional_ + * @namespace Assert + * @api public + */assert.isExtensible=function(obj,msg){new Assertion(obj,msg,assert.isExtensible,true).to.be.extensible;};/** + * ### .isNotExtensible(object) + * + * Asserts that \`object\` is _not_ extensible. + * + * var nonExtensibleObject = Object.preventExtensions({}); + * var sealedObject = Object.seal({}); + * var frozenObject = Object.freeze({}); + * + * assert.isNotExtensible(nonExtensibleObject); + * assert.isNotExtensible(sealedObject); + * assert.isNotExtensible(frozenObject); + * + * @name isNotExtensible + * @alias notExtensible + * @param {Object} object + * @param {String} message _optional_ + * @namespace Assert + * @api public + */assert.isNotExtensible=function(obj,msg){new Assertion(obj,msg,assert.isNotExtensible,true).to.not.be.extensible;};/** + * ### .isSealed(object) + * + * Asserts that \`object\` is sealed (cannot have new properties added to it + * and its existing properties cannot be removed). + * + * var sealedObject = Object.seal({}); + * var frozenObject = Object.seal({}); + * + * assert.isSealed(sealedObject); + * assert.isSealed(frozenObject); + * + * @name isSealed + * @alias sealed + * @param {Object} object + * @param {String} message _optional_ + * @namespace Assert + * @api public + */assert.isSealed=function(obj,msg){new Assertion(obj,msg,assert.isSealed,true).to.be.sealed;};/** + * ### .isNotSealed(object) + * + * Asserts that \`object\` is _not_ sealed. + * + * assert.isNotSealed({}); + * + * @name isNotSealed + * @alias notSealed + * @param {Object} object + * @param {String} message _optional_ + * @namespace Assert + * @api public + */assert.isNotSealed=function(obj,msg){new Assertion(obj,msg,assert.isNotSealed,true).to.not.be.sealed;};/** + * ### .isFrozen(object) + * + * Asserts that \`object\` is frozen (cannot have new properties added to it + * and its existing properties cannot be modified). + * + * var frozenObject = Object.freeze({}); + * assert.frozen(frozenObject); + * + * @name isFrozen + * @alias frozen + * @param {Object} object + * @param {String} message _optional_ + * @namespace Assert + * @api public + */assert.isFrozen=function(obj,msg){new Assertion(obj,msg,assert.isFrozen,true).to.be.frozen;};/** + * ### .isNotFrozen(object) + * + * Asserts that \`object\` is _not_ frozen. + * + * assert.isNotFrozen({}); + * + * @name isNotFrozen + * @alias notFrozen + * @param {Object} object + * @param {String} message _optional_ + * @namespace Assert + * @api public + */assert.isNotFrozen=function(obj,msg){new Assertion(obj,msg,assert.isNotFrozen,true).to.not.be.frozen;};/** + * ### .isEmpty(target) + * + * Asserts that the target does not contain any values. + * For arrays and strings, it checks the \`length\` property. + * For \`Map\` and \`Set\` instances, it checks the \`size\` property. + * For non-function objects, it gets the count of own + * enumerable string keys. + * + * assert.isEmpty([]); + * assert.isEmpty(''); + * assert.isEmpty(new Map); + * assert.isEmpty({}); + * + * @name isEmpty + * @alias empty + * @param {Object|Array|String|Map|Set} target + * @param {String} message _optional_ + * @namespace Assert + * @api public + */assert.isEmpty=function(val,msg){new Assertion(val,msg,assert.isEmpty,true).to.be.empty;};/** + * ### .isNotEmpty(target) + * + * Asserts that the target contains values. + * For arrays and strings, it checks the \`length\` property. + * For \`Map\` and \`Set\` instances, it checks the \`size\` property. + * For non-function objects, it gets the count of own + * enumerable string keys. + * + * assert.isNotEmpty([1, 2]); + * assert.isNotEmpty('34'); + * assert.isNotEmpty(new Set([5, 6])); + * assert.isNotEmpty({ key: 7 }); + * + * @name isNotEmpty + * @alias notEmpty + * @param {Object|Array|String|Map|Set} target + * @param {String} message _optional_ + * @namespace Assert + * @api public + */assert.isNotEmpty=function(val,msg){new Assertion(val,msg,assert.isNotEmpty,true).to.not.be.empty;};/*! + * Aliases. + */(function alias(name,as){assert[as]=assert[name];return alias;})('isOk','ok')('isNotOk','notOk')('throws','throw')('throws','Throw')('isExtensible','extensible')('isNotExtensible','notExtensible')('isSealed','sealed')('isNotSealed','notSealed')('isFrozen','frozen')('isNotFrozen','notFrozen')('isEmpty','empty')('isNotEmpty','notEmpty');};/*! + * chai + * Copyright(c) 2011-2014 Jake Luer + * MIT Licensed + */var hasRequiredChai;function requireChai(){if(hasRequiredChai)return chai$3;hasRequiredChai=1;(function(exports){var used=[];/*! + * Chai version + */exports.version='4.3.8';/*! + * Assertion Error + */exports.AssertionError=assertionError;/*! + * Utils for plugins (not exported) + */var util=requireUtils();/** + * # .use(function) + * + * Provides a way to extend the internals of Chai. + * + * @param {Function} + * @returns {this} for chaining + * @api public + */exports.use=function(fn){if(!~used.indexOf(fn)){fn(exports,util);used.push(fn);}return exports;};/*! + * Utility Functions + */exports.util=util;/*! + * Configuration + */var config=config$5;exports.config=config;/*! + * Primary \`Assertion\` prototype + */var assertion$1=assertion;exports.use(assertion$1);/*! + * Core Assertions + */var core=assertions;exports.use(core);/*! + * Expect interface + */var expect=expect$1;exports.use(expect);/*! + * Should interface + */var should$1=should;exports.use(should$1);/*! + * Assert interface + */var assert=assert$1;exports.use(assert);})(chai$3);return chai$3;}var chai$1=requireChai();const chai$2=/*@__PURE__*/getDefaultExportFromCjs$2(chai$1);const expect=chai$2.expect;chai$2.version;chai$2.Assertion;chai$2.AssertionError;const util=chai$2.util;chai$2.config;const use=chai$2.use;chai$2.should;const assert=chai$2.assert;chai$2.core;var commonjsGlobal=typeof globalThis!=='undefined'?globalThis:typeof window!=='undefined'?window:typeof global!=='undefined'?global:typeof self!=='undefined'?self:{};function getDefaultExportFromCjs$1(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,'default')?x['default']:x;}// src/utils.ts +function R(e,t){if(!e)throw new Error(t);}function u(e,t){return typeof t===e;}function b(e){return e instanceof Promise;}function f(e,t,n){Object.defineProperty(e,t,n);}function i(e,t,n){Object.defineProperty(e,t,{value:n});}// src/constants.ts +var c=Symbol.for("tinyspy:spy");// src/internal.ts +var g=/* @__PURE__ */new Set(),C=e=>{e.called=!1,e.callCount=0,e.calls=[],e.results=[],e.next=[];},M=e=>(f(e,c,{value:{reset:()=>C(e[c])}}),e[c]),A=e=>e[c]||M(e);function I(e){R(u("function",e)||u("undefined",e),"cannot spy on a non-function value");let t=function(...s){let r=A(t);r.called=!0,r.callCount++,r.calls.push(s);let m=r.next.shift();if(m){r.results.push(m);let _m=_slicedToArray(m,2),l=_m[0],o=_m[1];if(l==="ok")return o;throw o;}let p,d="ok";if(r.impl)try{new.target?p=Reflect.construct(r.impl,s,new.target):p=r.impl.apply(this,s),d="ok";}catch(l){throw p=l,d="error",r.results.push([d,l]),l;}let a=[d,p];if(b(p)){let l=p.then(o=>a[1]=o).catch(o=>{throw a[0]="error",a[1]=o,o;});Object.assign(l,p),p=l;}return r.results.push(a),p;};i(t,"_isMockFunction",!0),i(t,"length",e?e.length:0),i(t,"name",e&&e.name||"spy");let n=A(t);return n.reset(),n.impl=e,t;}// src/spyOn.ts +var k=(e,t)=>Object.getOwnPropertyDescriptor(e,t),P=(e,t)=>{t!=null&&typeof t=="function"&&t.prototype!=null&&Object.setPrototypeOf(e.prototype,t.prototype);};function E(e,t,n){R(!u("undefined",e),"spyOn could not find an object to spy upon"),R(u("object",e)||u("function",e),"cannot spyOn on a primitive value");let _ref9=(()=>{if(!u("object",t))return[t,"value"];if("getter"in t&&"setter"in t)throw new Error("cannot spy on both getter and setter");if("getter"in t)return[t.getter,"get"];if("setter"in t)return[t.setter,"set"];throw new Error("specify getter or setter to spy on");})(),_ref10=_slicedToArray(_ref9,2),s=_ref10[0],r=_ref10[1],m=k(e,s),p=Object.getPrototypeOf(e),d=p&&k(p,s),a=m||d;R(a||s in e,\`\${String(s)} does not exist\`);let l=!1;r==="value"&&a&&!a.value&&a.get&&(r="get",l=!0,n=a.get());let o;a?o=a[r]:r!=="value"?o=()=>e[s]:o=e[s],n||(n=o);let y=I(n);r==="value"&&P(y,o);let O=h=>{let _ref11=a||{configurable:!0,writable:!0},G=_ref11.value,w=_objectWithoutProperties(_ref11,_excluded2);r!=="value"&&delete w.writable,w[r]=h,f(e,s,w);},K=()=>a?f(e,s,a):O(o),T=y[c];return i(T,"restore",K),i(T,"getOriginal",()=>l?o():o),i(T,"willCall",h=>(T.impl=h,y)),O(l?()=>(P(y,n),y):y),g.add(y),y;}const mocks=/* @__PURE__ */new Set();function isMockFunction(fn2){return typeof fn2==="function"&&"_isMockFunction"in fn2&&fn2._isMockFunction;}function spyOn(obj,method,accessType){const dictionary={get:"getter",set:"setter"};const objMethod=accessType?{[dictionary[accessType]]:method}:method;const stub=E(obj,objMethod);return enhanceSpy(stub);}let callOrder=0;function enhanceSpy(spy){const stub=spy;let implementation;let instances=[];let invocations=[];const state=A(spy);const mockContext={get calls(){return state.calls;},get instances(){return instances;},get invocationCallOrder(){return invocations;},get results(){return state.results.map(([callType,value])=>{const type=callType==="error"?"throw":"return";return{type,value};});},get lastCall(){return state.calls[state.calls.length-1];}};let onceImplementations=[];let implementationChangedTemporarily=false;function mockCall(...args){instances.push(this);invocations.push(++callOrder);const impl=implementationChangedTemporarily?implementation:onceImplementations.shift()||implementation||state.getOriginal()||(()=>{});return impl.apply(this,args);}let name=stub.name;stub.getMockName=()=>name||"vi.fn()";stub.mockName=n=>{name=n;return stub;};stub.mockClear=()=>{state.reset();instances=[];invocations=[];return stub;};stub.mockReset=()=>{stub.mockClear();implementation=()=>void 0;onceImplementations=[];return stub;};stub.mockRestore=()=>{stub.mockReset();state.restore();implementation=void 0;return stub;};stub.getMockImplementation=()=>implementation;stub.mockImplementation=fn2=>{implementation=fn2;state.willCall(mockCall);return stub;};stub.mockImplementationOnce=fn2=>{onceImplementations.push(fn2);return stub;};function withImplementation(fn2,cb){const originalImplementation=implementation;implementation=fn2;state.willCall(mockCall);implementationChangedTemporarily=true;const reset=()=>{implementation=originalImplementation;implementationChangedTemporarily=false;};const result=cb();if(result instanceof Promise){return result.then(()=>{reset();return stub;});}reset();return stub;}stub.withImplementation=withImplementation;stub.mockReturnThis=()=>stub.mockImplementation(function(){return this;});stub.mockReturnValue=val=>stub.mockImplementation(()=>val);stub.mockReturnValueOnce=val=>stub.mockImplementationOnce(()=>val);stub.mockResolvedValue=val=>stub.mockImplementation(()=>Promise.resolve(val));stub.mockResolvedValueOnce=val=>stub.mockImplementationOnce(()=>Promise.resolve(val));stub.mockRejectedValue=val=>stub.mockImplementation(()=>Promise.reject(val));stub.mockRejectedValueOnce=val=>stub.mockImplementationOnce(()=>Promise.reject(val));Object.defineProperty(stub,"mock",{get:()=>mockContext});state.willCall(mockCall);mocks.add(stub);return stub;}function fn(implementation){const enhancedSpy=enhanceSpy(E({spy:implementation||(()=>{})},"spy"));if(implementation)enhancedSpy.mockImplementation(implementation);return enhancedSpy;}const MATCHERS_OBJECT$1=Symbol.for("matchers-object");const JEST_MATCHERS_OBJECT$1=Symbol.for("$$jest-matchers-object");const GLOBAL_EXPECT$1=Symbol.for("expect-global");const ASYMMETRIC_MATCHERS_OBJECT$1=Symbol.for("asymmetric-matchers-object");if(!Object.prototype.hasOwnProperty.call(globalThis,MATCHERS_OBJECT$1)){const globalState=/* @__PURE__ */new WeakMap();const matchers=/* @__PURE__ */Object.create(null);const customEqualityTesters=[];const assymetricMatchers=/* @__PURE__ */Object.create(null);Object.defineProperty(globalThis,MATCHERS_OBJECT$1,{get:()=>globalState});Object.defineProperty(globalThis,JEST_MATCHERS_OBJECT$1,{configurable:true,get:()=>({state:globalState.get(globalThis[GLOBAL_EXPECT$1]),matchers,customEqualityTesters})});Object.defineProperty(globalThis,ASYMMETRIC_MATCHERS_OBJECT$1,{get:()=>assymetricMatchers});}function getState(expect){return globalThis[MATCHERS_OBJECT$1].get(expect);}function setState(state,expect){const map=globalThis[MATCHERS_OBJECT$1];const current=map.get(expect)||{};Object.assign(current,state);map.set(expect,current);}function getMatcherUtils(){const c=()=>getColors();const EXPECTED_COLOR=c().green;const RECEIVED_COLOR=c().red;const INVERTED_COLOR=c().inverse;const BOLD_WEIGHT=c().bold;const DIM_COLOR=c().dim;function matcherHint(matcherName,received="received",expected="expected",options={}){const _options$comment=options.comment,comment=_options$comment===void 0?"":_options$comment,_options$isDirectExpe=options.isDirectExpectCall,isDirectExpectCall=_options$isDirectExpe===void 0?false:_options$isDirectExpe,_options$isNot=options.isNot,isNot=_options$isNot===void 0?false:_options$isNot,_options$promise=options.promise,promise=_options$promise===void 0?"":_options$promise,_options$secondArgume=options.secondArgument,secondArgument=_options$secondArgume===void 0?"":_options$secondArgume,_options$expectedColo=options.expectedColor,expectedColor=_options$expectedColo===void 0?EXPECTED_COLOR:_options$expectedColo,_options$receivedColo=options.receivedColor,receivedColor=_options$receivedColo===void 0?RECEIVED_COLOR:_options$receivedColo,_options$secondArgume2=options.secondArgumentColor,secondArgumentColor=_options$secondArgume2===void 0?EXPECTED_COLOR:_options$secondArgume2;let hint="";let dimString="expect";if(!isDirectExpectCall&&received!==""){hint+=DIM_COLOR(\`\${dimString}(\`)+receivedColor(received);dimString=")";}if(promise!==""){hint+=DIM_COLOR(\`\${dimString}.\`)+promise;dimString="";}if(isNot){hint+=\`\${DIM_COLOR(\`\${dimString}.\`)}not\`;dimString="";}if(matcherName.includes(".")){dimString+=matcherName;}else{hint+=DIM_COLOR(\`\${dimString}.\`)+matcherName;dimString="";}if(expected===""){dimString+="()";}else{hint+=DIM_COLOR(\`\${dimString}(\`)+expectedColor(expected);if(secondArgument)hint+=DIM_COLOR(", ")+secondArgumentColor(secondArgument);dimString=")";}if(comment!=="")dimString+=\` // \${comment}\`;if(dimString!=="")hint+=DIM_COLOR(dimString);return hint;}const SPACE_SYMBOL="\\xB7";const replaceTrailingSpaces=text=>text.replace(/\\s+$/gm,spaces=>SPACE_SYMBOL.repeat(spaces.length));const printReceived=object=>RECEIVED_COLOR(replaceTrailingSpaces(stringify(object)));const printExpected=value=>EXPECTED_COLOR(replaceTrailingSpaces(stringify(value)));return{EXPECTED_COLOR,RECEIVED_COLOR,INVERTED_COLOR,BOLD_WEIGHT,DIM_COLOR,matcherHint,printReceived,printExpected};}function addCustomEqualityTesters(newTesters){if(!Array.isArray(newTesters)){throw new TypeError(\`expect.customEqualityTesters: Must be set to an array of Testers. Was given "\${getType$2(newTesters)}"\`);}globalThis[JEST_MATCHERS_OBJECT$1].customEqualityTesters.push(...newTesters);}function getCustomEqualityTesters(){return globalThis[JEST_MATCHERS_OBJECT$1].customEqualityTesters;}function equals(a,b,customTesters,strictCheck){customTesters=customTesters||[];return eq(a,b,[],[],customTesters,strictCheck?hasKey:hasDefinedKey);}function isAsymmetric(obj){return!!obj&&typeof obj==="object"&&"asymmetricMatch"in obj&&isA("Function",obj.asymmetricMatch);}function asymmetricMatch(a,b){const asymmetricA=isAsymmetric(a);const asymmetricB=isAsymmetric(b);if(asymmetricA&&asymmetricB)return void 0;if(asymmetricA)return a.asymmetricMatch(b);if(asymmetricB)return b.asymmetricMatch(a);}function eq(a,b,aStack,bStack,customTesters,hasKey2){let result=true;const asymmetricResult=asymmetricMatch(a,b);if(asymmetricResult!==void 0)return asymmetricResult;const testerContext={equals};for(let i=0;iObject.getOwnPropertyDescriptor(obj,symbol).enumerable));}function hasDefinedKey(obj,key){return hasKey(obj,key)&&obj[key]!==void 0;}function hasKey(obj,key){return Object.prototype.hasOwnProperty.call(obj,key);}function isA(typeName,value){return Object.prototype.toString.apply(value)===\`[object \${typeName}]\`;}function isDomNode(obj){return obj!==null&&typeof obj==="object"&&"nodeType"in obj&&typeof obj.nodeType==="number"&&"nodeName"in obj&&typeof obj.nodeName==="string"&&"isEqualNode"in obj&&typeof obj.isEqualNode==="function";}const IS_KEYED_SENTINEL="@@__IMMUTABLE_KEYED__@@";const IS_SET_SENTINEL="@@__IMMUTABLE_SET__@@";const IS_ORDERED_SENTINEL="@@__IMMUTABLE_ORDERED__@@";function isImmutableUnorderedKeyed(maybeKeyed){return!!(maybeKeyed&&maybeKeyed[IS_KEYED_SENTINEL]&&!maybeKeyed[IS_ORDERED_SENTINEL]);}function isImmutableUnorderedSet(maybeSet){return!!(maybeSet&&maybeSet[IS_SET_SENTINEL]&&!maybeSet[IS_ORDERED_SENTINEL]);}const IteratorSymbol=Symbol.iterator;function hasIterator(object){return!!(object!=null&&object[IteratorSymbol]);}function iterableEquality(a,b,customTesters=[],aStack=[],bStack=[]){if(typeof a!=="object"||typeof b!=="object"||Array.isArray(a)||Array.isArray(b)||!hasIterator(a)||!hasIterator(b))return void 0;if(a.constructor!==b.constructor)return false;let length=aStack.length;while(length--){if(aStack[length]===a)return bStack[length]===b;}aStack.push(a);bStack.push(b);const filteredCustomTesters=[...customTesters.filter(t=>t!==iterableEquality),iterableEqualityWithStack];function iterableEqualityWithStack(a2,b2){return iterableEquality(a2,b2,[...filteredCustomTesters],[...aStack],[...bStack]);}if(a.size!==void 0){if(a.size!==b.size){return false;}else if(isA("Set",a)||isImmutableUnorderedSet(a)){let allFound=true;for(const aValue of a){if(!b.has(aValue)){let has=false;for(const bValue of b){const isEqual=equals(aValue,bValue,filteredCustomTesters);if(isEqual===true)has=true;}if(has===false){allFound=false;break;}}}aStack.pop();bStack.pop();return allFound;}else if(isA("Map",a)||isImmutableUnorderedKeyed(a)){let allFound=true;for(const aEntry of a){if(!b.has(aEntry[0])||!equals(aEntry[1],b.get(aEntry[0]),filteredCustomTesters)){let has=false;for(const bEntry of b){const matchedKey=equals(aEntry[0],bEntry[0],filteredCustomTesters);let matchedValue=false;if(matchedKey===true)matchedValue=equals(aEntry[1],bEntry[1],filteredCustomTesters);if(matchedValue===true)has=true;}if(has===false){allFound=false;break;}}}aStack.pop();bStack.pop();return allFound;}}const bIterator=b[IteratorSymbol]();for(const aValue of a){const nextB=bIterator.next();if(nextB.done||!equals(aValue,nextB.value,filteredCustomTesters))return false;}if(!bIterator.next().done)return false;aStack.pop();bStack.pop();return true;}function hasPropertyInObject(object,key){const shouldTerminate=!object||typeof object!=="object"||object===Object.prototype;if(shouldTerminate)return false;return Object.prototype.hasOwnProperty.call(object,key)||hasPropertyInObject(Object.getPrototypeOf(object),key);}function isObjectWithKeys(a){return isObject$1(a)&&!(a instanceof Error)&&!Array.isArray(a)&&!(a instanceof Date);}function subsetEquality(object,subset,customTesters=[]){const filteredCustomTesters=customTesters.filter(t=>t!==subsetEquality);const subsetEqualityWithContext=(seenReferences=/* @__PURE__ */new WeakMap())=>(object2,subset2)=>{if(!isObjectWithKeys(subset2))return void 0;return Object.keys(subset2).every(key=>{if(isObjectWithKeys(subset2[key])){if(seenReferences.has(subset2[key]))return equals(object2[key],subset2[key],filteredCustomTesters);seenReferences.set(subset2[key],true);}const result=object2!=null&&hasPropertyInObject(object2,key)&&equals(object2[key],subset2[key],[...filteredCustomTesters,subsetEqualityWithContext(seenReferences)]);seenReferences.delete(subset2[key]);return result;});};return subsetEqualityWithContext()(object,subset);}function typeEquality(a,b){if(a==null||b==null||a.constructor===b.constructor)return void 0;return false;}function arrayBufferEquality(a,b){let dataViewA=a;let dataViewB=b;if(!(a instanceof DataView&&b instanceof DataView)){if(!(a instanceof ArrayBuffer)||!(b instanceof ArrayBuffer))return void 0;try{dataViewA=new DataView(a);dataViewB=new DataView(b);}catch{return void 0;}}if(dataViewA.byteLength!==dataViewB.byteLength)return false;for(let i=0;it!==sparseArrayEquality);return equals(a,b,filteredCustomTesters,true)&&equals(aKeys,bKeys);}function generateToBeMessage(deepEqualityName,expected="#{this}",actual="#{exp}"){const toBeMessage=\`expected \${expected} to be \${actual} // Object.is equality\`;if(["toStrictEqual","toEqual"].includes(deepEqualityName))return\`\${toBeMessage} + +If it should pass with deep equality, replace "toBe" with "\${deepEqualityName}" + +Expected: \${expected} +Received: serializes to the same string +\`;return toBeMessage;}function pluralize(word,count){return\`\${count} \${word}\${count===1?"":"s"}\`;}let AsymmetricMatcher$1=class AsymmetricMatcher{constructor(sample,inverse=false){this.sample=sample;this.inverse=inverse;}// should have "jest" to be compatible with its ecosystem +$$typeof=Symbol.for("jest.asymmetricMatcher");getMatcherContext(expect){return _objectSpread(_objectSpread({},getState(expect||globalThis[GLOBAL_EXPECT$1])),{},{equals,isNot:this.inverse,customTesters:getCustomEqualityTesters(),utils:_objectSpread(_objectSpread({},getMatcherUtils()),{},{diff,stringify,iterableEquality,subsetEquality})});}// implement custom chai/loupe inspect for better AssertionError.message formatting +// https://github.com/chaijs/loupe/blob/9b8a6deabcd50adc056a64fb705896194710c5c6/src/index.ts#L29 +[Symbol.for("chai/inspect")](options){const result=stringify(this,options.depth,{min:true});if(result.length<=options.truncate)return result;return\`\${this.toString()}{\\u2026}\`;}};class StringContaining extends AsymmetricMatcher$1{constructor(sample,inverse=false){if(!isA("String",sample))throw new Error("Expected is not a string");super(sample,inverse);}asymmetricMatch(other){const result=isA("String",other)&&other.includes(this.sample);return this.inverse?!result:result;}toString(){return\`String\${this.inverse?"Not":""}Containing\`;}getExpectedType(){return"string";}}class Anything extends AsymmetricMatcher$1{asymmetricMatch(other){return other!=null;}toString(){return"Anything";}toAsymmetricMatcher(){return"Anything";}}class ObjectContaining extends AsymmetricMatcher$1{constructor(sample,inverse=false){super(sample,inverse);}getPrototype(obj){if(Object.getPrototypeOf)return Object.getPrototypeOf(obj);if(obj.constructor.prototype===obj)return null;return obj.constructor.prototype;}hasProperty(obj,property){if(!obj)return false;if(Object.prototype.hasOwnProperty.call(obj,property))return true;return this.hasProperty(this.getPrototype(obj),property);}asymmetricMatch(other){if(typeof this.sample!=="object"){throw new TypeError(\`You must provide an object to \${this.toString()}, not '\${typeof this.sample}'.\`);}let result=true;const matcherContext=this.getMatcherContext();for(const property in this.sample){if(!this.hasProperty(other,property)||!equals(this.sample[property],other[property],matcherContext.customTesters)){result=false;break;}}return this.inverse?!result:result;}toString(){return\`Object\${this.inverse?"Not":""}Containing\`;}getExpectedType(){return"object";}}class ArrayContaining extends AsymmetricMatcher$1{constructor(sample,inverse=false){super(sample,inverse);}asymmetricMatch(other){if(!Array.isArray(this.sample)){throw new TypeError(\`You must provide an array to \${this.toString()}, not '\${typeof this.sample}'.\`);}const matcherContext=this.getMatcherContext();const result=this.sample.length===0||Array.isArray(other)&&this.sample.every(item=>other.some(another=>equals(item,another,matcherContext.customTesters)));return this.inverse?!result:result;}toString(){return\`Array\${this.inverse?"Not":""}Containing\`;}getExpectedType(){return"array";}}class Any extends AsymmetricMatcher$1{constructor(sample){if(typeof sample==="undefined"){throw new TypeError("any() expects to be passed a constructor function. Please pass one or use anything() to match any object.");}super(sample);}fnNameFor(func){if(func.name)return func.name;const functionToString=Function.prototype.toString;const matches=functionToString.call(func).match(/^(?:async)?\\s*function\\s*\\*?\\s*([\\w$]+)\\s*\\(/);return matches?matches[1]:"";}asymmetricMatch(other){if(this.sample===String)return typeof other=="string"||other instanceof String;if(this.sample===Number)return typeof other=="number"||other instanceof Number;if(this.sample===Function)return typeof other=="function"||other instanceof Function;if(this.sample===Boolean)return typeof other=="boolean"||other instanceof Boolean;if(this.sample===BigInt)return typeof other=="bigint"||other instanceof BigInt;if(this.sample===Symbol)return typeof other=="symbol"||other instanceof Symbol;if(this.sample===Object)return typeof other=="object";return other instanceof this.sample;}toString(){return"Any";}getExpectedType(){if(this.sample===String)return"string";if(this.sample===Number)return"number";if(this.sample===Function)return"function";if(this.sample===Object)return"object";if(this.sample===Boolean)return"boolean";return this.fnNameFor(this.sample);}toAsymmetricMatcher(){return\`Any<\${this.fnNameFor(this.sample)}>\`;}}class StringMatching extends AsymmetricMatcher$1{constructor(sample,inverse=false){if(!isA("String",sample)&&!isA("RegExp",sample))throw new Error("Expected is not a String or a RegExp");super(new RegExp(sample),inverse);}asymmetricMatch(other){const result=isA("String",other)&&this.sample.test(other);return this.inverse?!result:result;}toString(){return\`String\${this.inverse?"Not":""}Matching\`;}getExpectedType(){return"string";}}class CloseTo extends AsymmetricMatcher$1{precision;constructor(sample,precision=2,inverse=false){if(!isA("Number",sample))throw new Error("Expected is not a Number");if(!isA("Number",precision))throw new Error("Precision is not a Number");super(sample);this.inverse=inverse;this.precision=precision;}asymmetricMatch(other){if(!isA("Number",other))return false;let result=false;if(other===Number.POSITIVE_INFINITY&&this.sample===Number.POSITIVE_INFINITY){result=true;}else if(other===Number.NEGATIVE_INFINITY&&this.sample===Number.NEGATIVE_INFINITY){result=true;}else{result=Math.abs(this.sample-other)<10**-this.precision/2;}return this.inverse?!result:result;}toString(){return\`Number\${this.inverse?"Not":""}CloseTo\`;}getExpectedType(){return"number";}toAsymmetricMatcher(){return[this.toString(),this.sample,\`(\${pluralize("digit",this.precision)})\`].join(" ");}}const JestAsymmetricMatchers=(chai,utils)=>{utils.addMethod(chai.expect,"anything",()=>new Anything());utils.addMethod(chai.expect,"any",expected=>new Any(expected));utils.addMethod(chai.expect,"stringContaining",expected=>new StringContaining(expected));utils.addMethod(chai.expect,"objectContaining",expected=>new ObjectContaining(expected));utils.addMethod(chai.expect,"arrayContaining",expected=>new ArrayContaining(expected));utils.addMethod(chai.expect,"stringMatching",expected=>new StringMatching(expected));utils.addMethod(chai.expect,"closeTo",(expected,precision)=>new CloseTo(expected,precision));chai.expect.not={stringContaining:expected=>new StringContaining(expected,true),objectContaining:expected=>new ObjectContaining(expected,true),arrayContaining:expected=>new ArrayContaining(expected,true),stringMatching:expected=>new StringMatching(expected,true),closeTo:(expected,precision)=>new CloseTo(expected,precision,true)};};function recordAsyncExpect$1(test,promise){if(test&&promise instanceof Promise){promise=promise.finally(()=>{const index=test.promises.indexOf(promise);if(index!==-1)test.promises.splice(index,1);});if(!test.promises)test.promises=[];test.promises.push(promise);}return promise;}function wrapSoft(utils,fn){return function(...args){var _a;const test=utils.flag(this,"vitest-test");const state=(test==null?void 0:test.context._local)?test.context.expect.getState():getState(globalThis[GLOBAL_EXPECT$1]);if(!state.soft)return fn.apply(this,args);if(!test)throw new Error("expect.soft() can only be used inside a test");try{return fn.apply(this,args);}catch(err){test.result||(test.result={state:"fail"});test.result.state="fail";(_a=test.result).errors||(_a.errors=[]);test.result.errors.push(processError(err));}};}const JestChaiExpect=(chai,utils)=>{const AssertionError=chai.AssertionError;const c=()=>getColors();const customTesters=getCustomEqualityTesters();function def(name,fn){const addMethod=n=>{const softWrapper=wrapSoft(utils,fn);utils.addMethod(chai.Assertion.prototype,n,softWrapper);utils.addMethod(globalThis[JEST_MATCHERS_OBJECT$1].matchers,n,softWrapper);};if(Array.isArray(name))name.forEach(n=>addMethod(n));else addMethod(name);}["throw","throws","Throw"].forEach(m=>{utils.overwriteMethod(chai.Assertion.prototype,m,_super=>{return function(...args){const promise=utils.flag(this,"promise");const object=utils.flag(this,"object");const isNot=utils.flag(this,"negate");if(promise==="rejects"){utils.flag(this,"object",()=>{throw object;});}else if(promise==="resolves"&&typeof object!=="function"){if(!isNot){const message=utils.flag(this,"message")||"expected promise to throw an error, but it didn't";const error={showDiff:false};throw new AssertionError(message,error,utils.flag(this,"ssfi"));}else{return;}}_super.apply(this,args);};});});def("withTest",function(test){utils.flag(this,"vitest-test",test);return this;});def("toEqual",function(expected){const actual=utils.flag(this,"object");const equal=equals(actual,expected,[...customTesters,iterableEquality]);return this.assert(equal,"expected #{this} to deeply equal #{exp}","expected #{this} to not deeply equal #{exp}",expected,actual);});def("toStrictEqual",function(expected){const obj=utils.flag(this,"object");const equal=equals(obj,expected,[...customTesters,iterableEquality,typeEquality,sparseArrayEquality,arrayBufferEquality],true);return this.assert(equal,"expected #{this} to strictly equal #{exp}","expected #{this} to not strictly equal #{exp}",expected,obj);});def("toBe",function(expected){const actual=this._obj;const pass=Object.is(actual,expected);let deepEqualityName="";if(!pass){const toStrictEqualPass=equals(actual,expected,[...customTesters,iterableEquality,typeEquality,sparseArrayEquality,arrayBufferEquality],true);if(toStrictEqualPass){deepEqualityName="toStrictEqual";}else{const toEqualPass=equals(actual,expected,[...customTesters,iterableEquality]);if(toEqualPass)deepEqualityName="toEqual";}}return this.assert(pass,generateToBeMessage(deepEqualityName),"expected #{this} not to be #{exp} // Object.is equality",expected,actual);});def("toMatchObject",function(expected){const actual=this._obj;return this.assert(equals(actual,expected,[...customTesters,iterableEquality,subsetEquality]),"expected #{this} to match object #{exp}","expected #{this} to not match object #{exp}",expected,actual);});def("toMatch",function(expected){if(typeof expected==="string")return this.include(expected);else return this.match(expected);});def("toContain",function(item){const actual=this._obj;if(typeof Node!=="undefined"&&actual instanceof Node){if(!(item instanceof Node))throw new TypeError(\`toContain() expected a DOM node as the argument, but got \${typeof item}\`);return this.assert(actual.contains(item),"expected #{this} to contain element #{exp}","expected #{this} not to contain element #{exp}",item,actual);}if(typeof DOMTokenList!=="undefined"&&actual instanceof DOMTokenList){assertTypes(item,"class name",["string"]);const isNot=utils.flag(this,"negate");const expectedClassList=isNot?actual.value.replace(item,"").trim():\`\${actual.value} \${item}\`;return this.assert(actual.contains(item),\`expected "\${actual.value}" to contain "\${item}"\`,\`expected "\${actual.value}" not to contain "\${item}"\`,expectedClassList,actual.value);}if(actual!=null&&typeof actual!=="string")utils.flag(this,"object",Array.from(actual));return this.contain(item);});def("toContainEqual",function(expected){const obj=utils.flag(this,"object");const index=Array.from(obj).findIndex(item=>{return equals(item,expected,customTesters);});this.assert(index!==-1,"expected #{this} to deep equally contain #{exp}","expected #{this} to not deep equally contain #{exp}",expected);});def("toBeTruthy",function(){const obj=utils.flag(this,"object");this.assert(Boolean(obj),"expected #{this} to be truthy","expected #{this} to not be truthy",obj,false);});def("toBeFalsy",function(){const obj=utils.flag(this,"object");this.assert(!obj,"expected #{this} to be falsy","expected #{this} to not be falsy",obj,false);});def("toBeGreaterThan",function(expected){const actual=this._obj;assertTypes(actual,"actual",["number","bigint"]);assertTypes(expected,"expected",["number","bigint"]);return this.assert(actual>expected,\`expected \${actual} to be greater than \${expected}\`,\`expected \${actual} to be not greater than \${expected}\`,actual,expected,false);});def("toBeGreaterThanOrEqual",function(expected){const actual=this._obj;assertTypes(actual,"actual",["number","bigint"]);assertTypes(expected,"expected",["number","bigint"]);return this.assert(actual>=expected,\`expected \${actual} to be greater than or equal to \${expected}\`,\`expected \${actual} to be not greater than or equal to \${expected}\`,actual,expected,false);});def("toBeLessThan",function(expected){const actual=this._obj;assertTypes(actual,"actual",["number","bigint"]);assertTypes(expected,"expected",["number","bigint"]);return this.assert(actualString(key).replace(/([.[\\]])/g,"\\\\$1")).join(".");const actual=this._obj;const propertyName=args[0],expected=args[1];const getValue=()=>{const hasOwn=Object.prototype.hasOwnProperty.call(actual,propertyName);if(hasOwn)return{value:actual[propertyName],exists:true};return utils.getPathInfo(actual,propertyName);};const _getValue=getValue(),value=_getValue.value,exists=_getValue.exists;const pass=exists&&(args.length===1||equals(expected,value,customTesters));const valueString=args.length===1?"":\` with value \${utils.objDisplay(expected)}\`;return this.assert(pass,\`expected #{this} to have property "\${propertyName}"\${valueString}\`,\`expected #{this} to not have property "\${propertyName}"\${valueString}\`,expected,exists?value:void 0);});def("toBeCloseTo",function(received,precision=2){const expected=this._obj;let pass=false;let expectedDiff=0;let receivedDiff=0;if(received===Number.POSITIVE_INFINITY&&expected===Number.POSITIVE_INFINITY){pass=true;}else if(received===Number.NEGATIVE_INFINITY&&expected===Number.NEGATIVE_INFINITY){pass=true;}else{expectedDiff=10**-precision/2;receivedDiff=Math.abs(expected-received);pass=receivedDiff{if(!isMockFunction(assertion._obj))throw new TypeError(\`\${utils.inspect(assertion._obj)} is not a spy or a call to a spy!\`);};const getSpy=assertion=>{assertIsMock(assertion);return assertion._obj;};const ordinalOf=i=>{const j=i%10;const k=i%100;if(j===1&&k!==11)return\`\${i}st\`;if(j===2&&k!==12)return\`\${i}nd\`;if(j===3&&k!==13)return\`\${i}rd\`;return\`\${i}th\`;};const formatCalls=(spy,msg,actualCall)=>{if(spy.mock.calls){msg+=c().gray(\` + +Received: + +\${spy.mock.calls.map((callArg,i)=>{let methodCall=c().bold(\` \${ordinalOf(i+1)} \${spy.getMockName()} call: + +\`);if(actualCall)methodCall+=diff(actualCall,callArg,{omitAnnotationLines:true});else methodCall+=stringify(callArg).split("\\n").map(line=>\` \${line}\`).join("\\n");methodCall+="\\n";return methodCall;}).join("\\n")}\`);}msg+=c().gray(\` + +Number of calls: \${c().bold(spy.mock.calls.length)} +\`);return msg;};const formatReturns=(spy,msg,actualReturn)=>{msg+=c().gray(\` + +Received: + +\${spy.mock.results.map((callReturn,i)=>{let methodCall=c().bold(\` \${ordinalOf(i+1)} \${spy.getMockName()} call return: + +\`);if(actualReturn)methodCall+=diff(actualReturn,callReturn.value,{omitAnnotationLines:true});else methodCall+=stringify(callReturn).split("\\n").map(line=>\` \${line}\`).join("\\n");methodCall+="\\n";return methodCall;}).join("\\n")}\`);msg+=c().gray(\` + +Number of calls: \${c().bold(spy.mock.calls.length)} +\`);return msg;};def(["toHaveBeenCalledTimes","toBeCalledTimes"],function(number){const spy=getSpy(this);const spyName=spy.getMockName();const callCount=spy.mock.calls.length;return this.assert(callCount===number,\`expected "\${spyName}" to be called #{exp} times, but got \${callCount} times\`,\`expected "\${spyName}" to not be called #{exp} times\`,number,callCount,false);});def("toHaveBeenCalledOnce",function(){const spy=getSpy(this);const spyName=spy.getMockName();const callCount=spy.mock.calls.length;return this.assert(callCount===1,\`expected "\${spyName}" to be called once, but got \${callCount} times\`,\`expected "\${spyName}" to not be called once\`,1,callCount,false);});def(["toHaveBeenCalled","toBeCalled"],function(){const spy=getSpy(this);const spyName=spy.getMockName();const callCount=spy.mock.calls.length;const called=callCount>0;const isNot=utils.flag(this,"negate");let msg=utils.getMessage(this,[called,\`expected "\${spyName}" to be called at least once\`,\`expected "\${spyName}" to not be called at all, but actually been called \${callCount} times\`,true,called]);if(called&&isNot)msg=formatCalls(spy,msg);if(called&&isNot||!called&&!isNot)throw new AssertionError(msg);});def(["toHaveBeenCalledWith","toBeCalledWith"],function(...args){const spy=getSpy(this);const spyName=spy.getMockName();const pass=spy.mock.calls.some(callArg=>equals(callArg,args,[...customTesters,iterableEquality]));const isNot=utils.flag(this,"negate");const msg=utils.getMessage(this,[pass,\`expected "\${spyName}" to be called with arguments: #{exp}\`,\`expected "\${spyName}" to not be called with arguments: #{exp}\`,args]);if(pass&&isNot||!pass&&!isNot)throw new AssertionError(formatCalls(spy,msg,args));});def(["toHaveBeenNthCalledWith","nthCalledWith"],function(times,...args){const spy=getSpy(this);const spyName=spy.getMockName();const nthCall=spy.mock.calls[times-1];this.assert(equals(nthCall,args,[...customTesters,iterableEquality]),\`expected \${ordinalOf(times)} "\${spyName}" call to have been called with #{exp}\`,\`expected \${ordinalOf(times)} "\${spyName}" call to not have been called with #{exp}\`,args,nthCall);});def(["toHaveBeenLastCalledWith","lastCalledWith"],function(...args){const spy=getSpy(this);const spyName=spy.getMockName();const lastCall=spy.mock.calls[spy.mock.calls.length-1];this.assert(equals(lastCall,args,[...customTesters,iterableEquality]),\`expected last "\${spyName}" call to have been called with #{exp}\`,\`expected last "\${spyName}" call to not have been called with #{exp}\`,args,lastCall);});def(["toThrow","toThrowError"],function(expected){if(typeof expected==="string"||typeof expected==="undefined"||expected instanceof RegExp)return this.throws(expected);const obj=this._obj;const promise=utils.flag(this,"promise");const isNot=utils.flag(this,"negate");let thrown=null;if(promise==="rejects"){thrown=obj;}else if(promise==="resolves"&&typeof obj!=="function"){if(!isNot){const message=utils.flag(this,"message")||"expected promise to throw an error, but it didn't";const error={showDiff:false};throw new AssertionError(message,error,utils.flag(this,"ssfi"));}else{return;}}else{let isThrow=false;try{obj();}catch(err){isThrow=true;thrown=err;}if(!isThrow&&!isNot){const message=utils.flag(this,"message")||"expected function to throw an error, but it didn't";const error={showDiff:false};throw new AssertionError(message,error,utils.flag(this,"ssfi"));}}if(typeof expected==="function"){const name=expected.name||expected.prototype.constructor.name;return this.assert(thrown&&thrown instanceof expected,\`expected error to be instance of \${name}\`,\`expected error not to be instance of \${name}\`,expected,thrown);}if(expected instanceof Error){return this.assert(thrown&&expected.message===thrown.message,\`expected error to have message: \${expected.message}\`,\`expected error not to have message: \${expected.message}\`,expected.message,thrown&&thrown.message);}if(typeof expected==="object"&&"asymmetricMatch"in expected&&typeof expected.asymmetricMatch==="function"){const matcher=expected;return this.assert(thrown&&matcher.asymmetricMatch(thrown),"expected error to match asymmetric matcher","expected error not to match asymmetric matcher",matcher,thrown);}throw new Error(\`"toThrow" expects string, RegExp, function, Error instance or asymmetric matcher, got "\${typeof expected}"\`);});def(["toHaveReturned","toReturn"],function(){const spy=getSpy(this);const spyName=spy.getMockName();const calledAndNotThrew=spy.mock.calls.length>0&&spy.mock.results.some(({type})=>type!=="throw");this.assert(calledAndNotThrew,\`expected "\${spyName}" to be successfully called at least once\`,\`expected "\${spyName}" to not be successfully called\`,calledAndNotThrew,!calledAndNotThrew,false);});def(["toHaveReturnedTimes","toReturnTimes"],function(times){const spy=getSpy(this);const spyName=spy.getMockName();const successfulReturns=spy.mock.results.reduce((success,{type})=>type==="throw"?success:++success,0);this.assert(successfulReturns===times,\`expected "\${spyName}" to be successfully called \${times} times\`,\`expected "\${spyName}" to not be successfully called \${times} times\`,\`expected number of returns: \${times}\`,\`received number of returns: \${successfulReturns}\`,false);});def(["toHaveReturnedWith","toReturnWith"],function(value){const spy=getSpy(this);const spyName=spy.getMockName();const pass=spy.mock.results.some(({type,value:result})=>type==="return"&&equals(value,result));const isNot=utils.flag(this,"negate");const msg=utils.getMessage(this,[pass,\`expected "\${spyName}" to return with: #{exp} at least once\`,\`expected "\${spyName}" to not return with: #{exp}\`,value]);if(pass&&isNot||!pass&&!isNot)throw new AssertionError(formatReturns(spy,msg,value));});def(["toHaveLastReturnedWith","lastReturnedWith"],function(value){const spy=getSpy(this);const spyName=spy.getMockName();const lastResult=spy.mock.results[spy.mock.results.length-1].value;const pass=equals(lastResult,value);this.assert(pass,\`expected last "\${spyName}" call to return #{exp}\`,\`expected last "\${spyName}" call to not return #{exp}\`,value,lastResult);});def(["toHaveNthReturnedWith","nthReturnedWith"],function(nthCall,value){const spy=getSpy(this);const spyName=spy.getMockName();const isNot=utils.flag(this,"negate");const _spy$mock$results=spy.mock.results[nthCall-1],callType=_spy$mock$results.type,callResult=_spy$mock$results.value;const ordinalCall=\`\${ordinalOf(nthCall)} call\`;if(!isNot&&callType==="throw")chai.assert.fail(\`expected \${ordinalCall} to return #{exp}, but instead it threw an error\`);const nthCallReturn=equals(callResult,value);this.assert(nthCallReturn,\`expected \${ordinalCall} "\${spyName}" call to return #{exp}\`,\`expected \${ordinalCall} "\${spyName}" call to not return #{exp}\`,value,callResult);});def("toSatisfy",function(matcher,message){return this.be.satisfy(matcher,message);});utils.addProperty(chai.Assertion.prototype,"resolves",function __VITEST_RESOLVES__(){const error=new Error("resolves");utils.flag(this,"promise","resolves");utils.flag(this,"error",error);const test=utils.flag(this,"vitest-test");const obj=utils.flag(this,"object");if(typeof(obj==null?void 0:obj.then)!=="function")throw new TypeError(\`You must provide a Promise to expect() when using .resolves, not '\${typeof obj}'.\`);const proxy=new Proxy(this,{get:(target,key,receiver)=>{const result=Reflect.get(target,key,receiver);if(typeof result!=="function")return result instanceof chai.Assertion?proxy:result;return async(...args)=>{const promise=obj.then(value=>{utils.flag(this,"object",value);return result.call(this,...args);},err=>{const _error=new AssertionError(\`promise rejected "\${utils.inspect(err)}" instead of resolving\`,{showDiff:false});_error.cause=err;_error.stack=error.stack.replace(error.message,_error.message);throw _error;});return recordAsyncExpect$1(test,promise);};}});return proxy;});utils.addProperty(chai.Assertion.prototype,"rejects",function __VITEST_REJECTS__(){const error=new Error("rejects");utils.flag(this,"promise","rejects");utils.flag(this,"error",error);const test=utils.flag(this,"vitest-test");const obj=utils.flag(this,"object");const wrapper=typeof obj==="function"?obj():obj;if(typeof(wrapper==null?void 0:wrapper.then)!=="function")throw new TypeError(\`You must provide a Promise to expect() when using .rejects, not '\${typeof wrapper}'.\`);const proxy=new Proxy(this,{get:(target,key,receiver)=>{const result=Reflect.get(target,key,receiver);if(typeof result!=="function")return result instanceof chai.Assertion?proxy:result;return async(...args)=>{const promise=wrapper.then(value=>{const _error=new AssertionError(\`promise resolved "\${utils.inspect(value)}" instead of rejecting\`,{showDiff:true,expected:new Error("rejected promise"),actual:value});_error.stack=error.stack.replace(error.message,_error.message);throw _error;},err=>{utils.flag(this,"object",err);return result.call(this,...args);});return recordAsyncExpect$1(test,promise);};}});return proxy;});};function getMatcherState(assertion,expect){const obj=assertion._obj;const isNot=util.flag(assertion,"negate");const promise=util.flag(assertion,"promise")||"";const jestUtils=_objectSpread(_objectSpread({},getMatcherUtils()),{},{diff,stringify,iterableEquality,subsetEquality});const matcherState=_objectSpread(_objectSpread({},getState(expect)),{},{customTesters:getCustomEqualityTesters(),isNot,utils:jestUtils,promise,equals,// needed for built-in jest-snapshots, but we don't use it +suppressedErrors:[]});return{state:matcherState,isNot,obj};}class JestExtendError extends Error{constructor(message,actual,expected){super(message);this.actual=actual;this.expected=expected;}}function JestExtendPlugin(expect,matchers){return(c,utils)=>{Object.entries(matchers).forEach(([expectAssertionName,expectAssertion])=>{function expectWrapper(...args){const _getMatcherState=getMatcherState(this,expect),state=_getMatcherState.state,isNot=_getMatcherState.isNot,obj=_getMatcherState.obj;const result=expectAssertion.call(state,obj,...args);if(result&&typeof result==="object"&&result instanceof Promise){return result.then(({pass:pass2,message:message2,actual:actual2,expected:expected2})=>{if(pass2&&isNot||!pass2&&!isNot)throw new JestExtendError(message2(),actual2,expected2);});}const pass=result.pass,message=result.message,actual=result.actual,expected=result.expected;if(pass&&isNot||!pass&&!isNot)throw new JestExtendError(message(),actual,expected);}const softWrapper=wrapSoft(utils,expectWrapper);utils.addMethod(globalThis[JEST_MATCHERS_OBJECT$1].matchers,expectAssertionName,softWrapper);utils.addMethod(c.Assertion.prototype,expectAssertionName,softWrapper);class CustomMatcher extends AsymmetricMatcher$1{constructor(inverse=false,...sample){super(sample,inverse);}asymmetricMatch(other){const _expectAssertion$call=expectAssertion.call(this.getMatcherContext(expect),other,...this.sample),pass=_expectAssertion$call.pass;return this.inverse?!pass:pass;}toString(){return\`\${this.inverse?"not.":""}\${expectAssertionName}\`;}getExpectedType(){return"any";}toAsymmetricMatcher(){return\`\${this.toString()}<\${this.sample.map(String).join(", ")}>\`;}}const customMatcher=(...sample)=>new CustomMatcher(false,...sample);Object.defineProperty(expect,expectAssertionName,{configurable:true,enumerable:true,value:customMatcher,writable:true});Object.defineProperty(expect.not,expectAssertionName,{configurable:true,enumerable:true,value:(...sample)=>new CustomMatcher(true,...sample),writable:true});Object.defineProperty(globalThis[ASYMMETRIC_MATCHERS_OBJECT$1],expectAssertionName,{configurable:true,enumerable:true,value:customMatcher,writable:true});});};}const JestExtend=(chai,utils)=>{utils.addMethod(chai.expect,"extend",(expect,expects)=>{chai.use(JestExtendPlugin(expect,expects));});};function getDefaultExportFromCjs(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,'default')?x['default']:x;}var naturalCompare$2={exports:{}};/* + * @version 1.4.0 + * @date 2015-10-26 + * @stability 3 - Stable + * @author Lauri Rooden (https://github.com/litejs/natural-compare-lite) + * @license MIT License + */var naturalCompare=function(a,b){var i,codeA,codeB=1,posA=0,posB=0,alphabet=String.alphabet;function getCode(str,pos,code){if(code){for(i=pos;code=getCode(str,i),code<76&&code>65;)++i;return+str.slice(pos-1,i);}code=alphabet&&alphabet.indexOf(str.charAt(pos));return code>-1?code+76:(code=str.charCodeAt(pos)||0,code<45||code>127)?code:code<46?65// - +:code<48?code-1:code<58?code+18// 0-9 +:code<65?code-11:code<91?code+11// A-Z +:code<97?code-37:code<123?code+5// a-z +:code-63;}if((a+="")!=(b+=""))for(;codeB;){codeA=getCode(a,posA++);codeB=getCode(b,posB++);if(codeA<76&&codeB<76&&codeA>66&&codeB>66){codeA=getCode(a,posA,posA);codeB=getCode(b,posB,posA=i);posB=i;}if(codeA!=codeB)return codeA'Promise{…}';try{const _process$binding2=process.binding('util'),getPromiseDetails=_process$binding2.getPromiseDetails,kPending=_process$binding2.kPending,kRejected=_process$binding2.kRejected;if(Array.isArray(getPromiseDetails(Promise.resolve()))){getPromiseValue=(value,options)=>{const _getPromiseDetails3=getPromiseDetails(value),_getPromiseDetails4=_slicedToArray(_getPromiseDetails3,2),state=_getPromiseDetails4[0],innerValue=_getPromiseDetails4[1];if(state===kPending){return'Promise{}';}return\`Promise\${state===kRejected?'!':''}{\${options.inspect(innerValue,options)}}\`;};}}catch(notNode){/* ignore */}/* ! + * loupe + * Copyright(c) 2013 Jake Luer + * MIT Licensed + */let nodeInspect=false;try{// eslint-disable-next-line global-require +const nodeUtil=require('util');nodeInspect=nodeUtil.inspect?nodeUtil.inspect.custom:false;}catch(noNodeInspect){nodeInspect=false;}const lineSplitRE=/\\r?\\n/;function positionToOffset(source,lineNumber,columnNumber){const lines=source.split(lineSplitRE);const nl=/\\r\\n/.test(source)?2:1;let start=0;if(lineNumber>lines.length)return source.length;for(let i=0;isource.length){throw new Error(\`offset is longer than source length! offset \${offset} > length \${source.length}\`);}const lines=source.split(lineSplitRE);const nl=/\\r\\n/.test(source)?2:1;let counted=0;let line=0;for(;line=offset)break;counted+=lineLength;}return line+1;}// Copyright 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Simon Lydell +// License: MIT. +var LineTerminatorSequence;LineTerminatorSequence=/\\r?\\n|[\\r\\u2028\\u2029]/y;RegExp(LineTerminatorSequence.source);// src/index.ts +var reservedWords={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"]};new Set(reservedWords.keyword);new Set(reservedWords.strict);const serialize$1=(val,config,indentation,depth,refs,printer)=>{const name=val.getMockName();const nameString=name==="vi.fn()"?"":\` \${name}\`;let callsString="";if(val.mock.calls.length!==0){const indentationNext=indentation+config.indent;callsString=\` {\${config.spacingOuter}\${indentationNext}"calls": \${printer(val.mock.calls,config,indentationNext,depth,refs)}\${config.min?", ":","}\${config.spacingOuter}\${indentationNext}"results": \${printer(val.mock.results,config,indentationNext,depth,refs)}\${config.min?"":","}\${config.spacingOuter}\${indentation}}\`;}return\`[MockFunction\${nameString}]\${callsString}\`;};const test=val=>val&&!!val._isMockFunction;const plugin={serialize:serialize$1,test};const _plugins_3=plugins_1,DOMCollection=_plugins_3.DOMCollection,DOMElement=_plugins_3.DOMElement,Immutable=_plugins_3.Immutable,ReactElement=_plugins_3.ReactElement,ReactTestComponent=_plugins_3.ReactTestComponent,AsymmetricMatcher=_plugins_3.AsymmetricMatcher;let PLUGINS=[ReactTestComponent,ReactElement,DOMElement,DOMCollection,Immutable,AsymmetricMatcher,plugin];function addSerializer(plugin){PLUGINS=[plugin].concat(PLUGINS);}function getSerializers(){return PLUGINS;}function testNameToKey(testName,count){return\`\${testName} \${count}\`;}function keyToTestName(key){if(!/ \\d+$/.test(key))throw new Error("Snapshot keys must end with a number.");return key.replace(/ \\d+$/,"");}function getSnapshotData(content,options){const update=options.updateSnapshot;const data=/* @__PURE__ */Object.create(null);let snapshotContents="";let dirty=false;if(content!=null){try{snapshotContents=content;const populate=new Function("exports",snapshotContents);populate(data);}catch{}}const isInvalid=snapshotContents;if((update==="all"||update==="new")&&isInvalid)dirty=true;return{data,dirty};}function addExtraLineBreaks(string){return string.includes("\\n")?\` +\${string} +\`:string;}function removeExtraLineBreaks(string){return string.length>2&&string.startsWith("\\n")&&string.endsWith("\\n")?string.slice(1,-1):string;}const escapeRegex=true;const printFunctionName=false;function serialize(val,indent=2,formatOverrides={}){return normalizeNewlines(format_1(val,_objectSpread({escapeRegex,indent,plugins:getSerializers(),printFunctionName},formatOverrides)));}function escapeBacktickString(str){return str.replace(/\`|\\\\|\\\${/g,"\\\\$&");}function printBacktickString(str){return\`\\\`\${escapeBacktickString(str)}\\\`\`;}function normalizeNewlines(string){return string.replace(/\\r\\n|\\r/g,"\\n");}async function saveSnapshotFile(environment,snapshotData,snapshotPath){const snapshots=Object.keys(snapshotData).sort(naturalCompare$1).map(key=>\`exports[\${printBacktickString(key)}] = \${printBacktickString(normalizeNewlines(snapshotData[key]))};\`);const content=\`\${environment.getHeader()} + +\${snapshots.join("\\n\\n")} +\`;const oldContent=await environment.readSnapshotFile(snapshotPath);const skipWriting=oldContent!=null&&oldContent===content;if(skipWriting)return;await environment.saveSnapshotFile(snapshotPath,content);}function prepareExpected(expected){function findStartIndent(){var _a,_b;const matchObject=/^( +)}\\s+$/m.exec(expected||"");const objectIndent=(_a=matchObject==null?void 0:matchObject[1])==null?void 0:_a.length;if(objectIndent)return objectIndent;const matchText=/^\\n( +)"/.exec(expected||"");return((_b=matchText==null?void 0:matchText[1])==null?void 0:_b.length)||0;}const startIndent=findStartIndent();let expectedTrimmed=expected==null?void 0:expected.trim();if(startIndent){expectedTrimmed=expectedTrimmed==null?void 0:expectedTrimmed.replace(new RegExp(\`^\${" ".repeat(startIndent)}\`,"gm"),"").replace(/ +}$/,"}");}return expectedTrimmed;}function deepMergeArray(target=[],source=[]){const mergedOutput=Array.from(target);source.forEach((sourceElement,index)=>{const targetElement=mergedOutput[index];if(Array.isArray(target[index])){mergedOutput[index]=deepMergeArray(target[index],sourceElement);}else if(isObject(targetElement)){mergedOutput[index]=deepMergeSnapshot(target[index],sourceElement);}else{mergedOutput[index]=sourceElement;}});return mergedOutput;}function deepMergeSnapshot(target,source){if(isObject(target)&&isObject(source)){const mergedOutput=_objectSpread({},target);Object.keys(source).forEach(key=>{if(isObject(source[key])&&!source[key].$$typeof){if(!(key in target))Object.assign(mergedOutput,{[key]:source[key]});else mergedOutput[key]=deepMergeSnapshot(target[key],source[key]);}else if(Array.isArray(source[key])){mergedOutput[key]=deepMergeArray(target[key],source[key]);}else{Object.assign(mergedOutput,{[key]:source[key]});}});return mergedOutput;}else if(Array.isArray(target)&&Array.isArray(source)){return deepMergeArray(target,source);}return target;}const comma=','.charCodeAt(0);const chars$1='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';const intToChar$1=new Uint8Array(64);// 64 possible chars. +const charToInt$1=new Uint8Array(128);// z is 122 in ASCII +for(let i=0;i>>=1;if(shouldNegate){value=-0x80000000|-value;}state[j]+=value;return pos;}function hasMoreVlq(mappings,i,length){if(i>=length)return false;return mappings.charCodeAt(i)!==comma;}function sort$1(line){line.sort(sortComparator$1);}function sortComparator$1(a,b){return a[0]-b[0];}// Matches the scheme of a URL, eg "http://" +const schemeRegex=/^[\\w+.-]+:\\/\\//;/** + * Matches the parts of a URL: + * 1. Scheme, including ":", guaranteed. + * 2. User/password, including "@", optional. + * 3. Host, guaranteed. + * 4. Port, including ":", optional. + * 5. Path, including "/", optional. + * 6. Query, including "?", optional. + * 7. Hash, including "#", optional. + */const urlRegex=/^([\\w+.-]+:)\\/\\/([^@/#?]*@)?([^:/#?]*)(:\\d+)?(\\/[^#?]*)?(\\?[^#]*)?(#.*)?/;/** + * File URLs are weird. They dont' need the regular \`//\` in the scheme, they may or may not start + * with a leading \`/\`, they can have a domain (but only if they don't start with a Windows drive). + * + * 1. Host, optional. + * 2. Path, which may include "/", guaranteed. + * 3. Query, including "?", optional. + * 4. Hash, including "#", optional. + */const fileRegex=/^file:(?:\\/\\/((?![a-z]:)[^/#?]*)?)?(\\/?[^#?]*)(\\?[^#]*)?(#.*)?/i;var UrlType$1;(function(UrlType){UrlType[UrlType["Empty"]=1]="Empty";UrlType[UrlType["Hash"]=2]="Hash";UrlType[UrlType["Query"]=3]="Query";UrlType[UrlType["RelativePath"]=4]="RelativePath";UrlType[UrlType["AbsolutePath"]=5]="AbsolutePath";UrlType[UrlType["SchemeRelative"]=6]="SchemeRelative";UrlType[UrlType["Absolute"]=7]="Absolute";})(UrlType$1||(UrlType$1={}));function isAbsoluteUrl(input){return schemeRegex.test(input);}function isSchemeRelativeUrl(input){return input.startsWith('//');}function isAbsolutePath(input){return input.startsWith('/');}function isFileUrl(input){return input.startsWith('file:');}function isRelative(input){return /^[.?#]/.test(input);}function parseAbsoluteUrl(input){const match=urlRegex.exec(input);return makeUrl(match[1],match[2]||'',match[3],match[4]||'',match[5]||'/',match[6]||'',match[7]||'');}function parseFileUrl(input){const match=fileRegex.exec(input);const path=match[2];return makeUrl('file:','',match[1]||'','',isAbsolutePath(path)?path:'/'+path,match[3]||'',match[4]||'');}function makeUrl(scheme,user,host,port,path,query,hash){return{scheme,user,host,port,path,query,hash,type:UrlType$1.Absolute};}function parseUrl(input){if(isSchemeRelativeUrl(input)){const url=parseAbsoluteUrl('http:'+input);url.scheme='';url.type=UrlType$1.SchemeRelative;return url;}if(isAbsolutePath(input)){const url=parseAbsoluteUrl('http://foo.com'+input);url.scheme='';url.host='';url.type=UrlType$1.AbsolutePath;return url;}if(isFileUrl(input))return parseFileUrl(input);if(isAbsoluteUrl(input))return parseAbsoluteUrl(input);const url=parseAbsoluteUrl('http://foo.com/'+input);url.scheme='';url.host='';url.type=input?input.startsWith('?')?UrlType$1.Query:input.startsWith('#')?UrlType$1.Hash:UrlType$1.RelativePath:UrlType$1.Empty;return url;}function stripPathFilename(path){// If a path ends with a parent directory "..", then it's a relative path with excess parent +// paths. It's not a file, so we can't strip it. +if(path.endsWith('/..'))return path;const index=path.lastIndexOf('/');return path.slice(0,index+1);}function mergePaths(url,base){normalizePath(base,base.type);// If the path is just a "/", then it was an empty path to begin with (remember, we're a relative +// path). +if(url.path==='/'){url.path=base.path;}else{// Resolution happens relative to the base path's directory, not the file. +url.path=stripPathFilename(base.path)+url.path;}}/** + * The path can have empty directories "//", unneeded parents "foo/..", or current directory + * "foo/.". We need to normalize to a standard representation. + */function normalizePath(url,type){const rel=type<=UrlType$1.RelativePath;const pieces=url.path.split('/');// We need to preserve the first piece always, so that we output a leading slash. The item at +// pieces[0] is an empty string. +let pointer=1;// Positive is the number of real directories we've output, used for popping a parent directory. +// Eg, "foo/bar/.." will have a positive 2, and we can decrement to be left with just "foo". +let positive=0;// We need to keep a trailing slash if we encounter an empty directory (eg, splitting "foo/" will +// generate \`["foo", ""]\` pieces). And, if we pop a parent directory. But once we encounter a +// real directory, we won't need to append, unless the other conditions happen again. +let addTrailingSlash=false;for(let i=1;iinputType)inputType=baseType;}normalizePath(url,inputType);const queryHash=url.query+url.hash;switch(inputType){// This is impossible, because of the empty checks at the start of the function. +// case UrlType.Empty: +case UrlType$1.Hash:case UrlType$1.Query:return queryHash;case UrlType$1.RelativePath:{// The first char is always a "/", and we need it to be relative. +const path=url.path.slice(1);if(!path)return queryHash||'.';if(isRelative(base||input)&&!isRelative(path)){// If base started with a leading ".", or there is no base and input started with a ".", +// then we need to ensure that the relative path starts with a ".". We don't know if +// relative starts with a "..", though, so check before prepending. +return'./'+path+queryHash;}return path+queryHash;}case UrlType$1.AbsolutePath:return url.path+queryHash;default:return url.scheme+'//'+url.user+url.host+url.port+url.path+queryHash;}}function resolve(input,base){// The base is always treated as a directory, if it's not empty. +// https://github.com/mozilla/source-map/blob/8cb3ee57/lib/util.js#L327 +// https://github.com/chromium/chromium/blob/da4adbb3/third_party/blink/renderer/devtools/front_end/sdk/SourceMap.js#L400-L401 +if(base&&!base.endsWith('/'))base+='/';return resolve$1(input,base);}/** + * Removes everything after the last "/", but leaves the slash. + */function stripFilename(path){if(!path)return'';const index=path.lastIndexOf('/');return path.slice(0,index+1);}const COLUMN=0;const SOURCES_INDEX=1;const SOURCE_LINE=2;const SOURCE_COLUMN=3;const NAMES_INDEX=4;function maybeSort(mappings,owned){const unsortedIndex=nextUnsortedSegmentLine(mappings,0);if(unsortedIndex===mappings.length)return mappings;// If we own the array (meaning we parsed it from JSON), then we're free to directly mutate it. If +// not, we do not want to modify the consumer's input array. +if(!owned)mappings=mappings.slice();for(let i=unsortedIndex;i item - needle); + * + * assert.equal(index, 0); + * array.splice(index + 1, 0, needle); + * assert.deepEqual(array, [1, 2, 3]); + * \`\`\` + */function binarySearch(haystack,needle,low,high){while(low<=high){const mid=low+(high-low>>1);const cmp=haystack[mid][COLUMN]-needle;if(cmp===0){found=true;return mid;}if(cmp<0){low=mid+1;}else{high=mid-1;}}found=false;return low-1;}function upperBound(haystack,needle,index){for(let i=index+1;i=0;index=i--){if(haystack[i][COLUMN]!==needle)break;}return index;}function memoizedState(){return{lastKey:-1,lastNeedle:-1,lastIndex:-1};}/** + * This overly complicated beast is just to record the last tested line/column and the resulting + * index, allowing us to skip a few tests if mappings are monotonically increasing. + */function memoizedBinarySearch(haystack,needle,state,key){const lastKey=state.lastKey,lastNeedle=state.lastNeedle,lastIndex=state.lastIndex;let low=0;let high=haystack.length-1;if(key===lastKey){if(needle===lastNeedle){found=lastIndex!==-1&&haystack[lastIndex][COLUMN]===needle;return lastIndex;}if(needle>=lastNeedle){// lastIndex may be -1 if the previous needle was not found. +low=lastIndex===-1?0:lastIndex;}else{high=lastIndex;}}state.lastKey=key;state.lastNeedle=needle;return state.lastIndex=binarySearch(haystack,needle,low,high);}const LINE_GTR_ZERO='\`line\` must be greater than 0 (lines start at line 1)';const COL_GTR_EQ_ZERO='\`column\` must be greater than or equal to 0 (columns start at column 0)';const LEAST_UPPER_BOUND=-1;const GREATEST_LOWER_BOUND=1;/** + * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field. + */let decodedMappings;/** + * A higher-level API to find the source/line/column associated with a generated line/column + * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in + * \`source-map\` library. + */let originalPositionFor;class TraceMap{constructor(map,mapUrl){const isString=typeof map==='string';if(!isString&&map._decodedMemo)return map;const parsed=isString?JSON.parse(map):map;const version=parsed.version,file=parsed.file,names=parsed.names,sourceRoot=parsed.sourceRoot,sources=parsed.sources,sourcesContent=parsed.sourcesContent;this.version=version;this.file=file;this.names=names||[];this.sourceRoot=sourceRoot;this.sources=sources;this.sourcesContent=sourcesContent;const from=resolve(sourceRoot||'',stripFilename(mapUrl));this.resolvedSources=sources.map(s=>resolve(s||'',from));const mappings=parsed.mappings;if(typeof mappings==='string'){this._encoded=mappings;this._decoded=undefined;}else{this._encoded=undefined;this._decoded=maybeSort(mappings,isString);}this._decodedMemo=memoizedState();this._bySources=undefined;this._bySourceMemos=undefined;}}(()=>{decodedMappings=map=>{return map._decoded||(map._decoded=decode(map._encoded));};originalPositionFor=(map,{line,column,bias})=>{line--;if(line<0)throw new Error(LINE_GTR_ZERO);if(column<0)throw new Error(COL_GTR_EQ_ZERO);const decoded=decodedMappings(map);// It's common for parent source maps to have pointers to lines that have no +// mapping (like a "//# sourceMappingURL=") at the end of the child file. +if(line>=decoded.length)return OMapping(null,null,null,null);const segments=decoded[line];const index=traceSegmentInternal(segments,map._decodedMemo,line,column,bias||GREATEST_LOWER_BOUND);if(index===-1)return OMapping(null,null,null,null);const segment=segments[index];if(segment.length===1)return OMapping(null,null,null,null);const names=map.names,resolvedSources=map.resolvedSources;return OMapping(resolvedSources[segment[SOURCES_INDEX]],segment[SOURCE_LINE]+1,segment[SOURCE_COLUMN],segment.length===5?names[segment[NAMES_INDEX]]:null);};})();function OMapping(source,line,column,name){return{source,line,column,name};}function traceSegmentInternal(segments,memo,line,column,bias){let index=memoizedBinarySearch(segments,column,memo,line);if(found){index=(bias===LEAST_UPPER_BOUND?upperBound:lowerBound)(segments,column,index);}else if(bias===LEAST_UPPER_BOUND)index++;if(index===-1||index===segments.length)return-1;return index;}const CHROME_IE_STACK_REGEXP$1=/^\\s*at .*(\\S+:\\d+|\\(native\\))/m;const SAFARI_NATIVE_CODE_REGEXP$1=/^(eval@)?(\\[native code])?$/;const stackIgnorePatterns=["node:internal",/\\/packages\\/\\w+\\/dist\\//,/\\/@vitest\\/\\w+\\/dist\\//,"/vitest/dist/","/vitest/src/","/vite-node/dist/","/vite-node/src/","/node_modules/chai/","/node_modules/tinypool/","/node_modules/tinyspy/","/deps/chai.js",/__vitest_browser__/];function extractLocation$1(urlLike){if(!urlLike.includes(":"))return[urlLike];const regExp=/(.+?)(?::(\\d+))?(?::(\\d+))?$/;const parts=regExp.exec(urlLike.replace(/^\\(|\\)$/g,""));if(!parts)return[urlLike];let url=parts[1];if(url.startsWith("http:")||url.startsWith("https:")){const urlObj=new URL(url);url=urlObj.pathname;}if(url.startsWith("/@fs/")){url=url.slice(typeof process!=="undefined"&&process.platform==="win32"?5:4);}return[url,parts[2]||void 0,parts[3]||void 0];}function parseSingleFFOrSafariStack$1(raw){let line=raw.trim();if(SAFARI_NATIVE_CODE_REGEXP$1.test(line))return null;if(line.includes(" > eval"))line=line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval:\\d+:\\d+/g,":$1");if(!line.includes("@")&&!line.includes(":"))return null;const functionNameRegex=/((.*".+"[^@]*)?[^@]*)(?:@)/;const matches=line.match(functionNameRegex);const functionName=matches&&matches[1]?matches[1]:void 0;const _extractLocation$=extractLocation$1(line.replace(functionNameRegex,"")),_extractLocation$2=_slicedToArray(_extractLocation$,3),url=_extractLocation$2[0],lineNumber=_extractLocation$2[1],columnNumber=_extractLocation$2[2];if(!url||!lineNumber||!columnNumber)return null;return{file:url,method:functionName||"",line:Number.parseInt(lineNumber),column:Number.parseInt(columnNumber)};}function parseSingleV8Stack$1(raw){let line=raw.trim();if(!CHROME_IE_STACK_REGEXP$1.test(line))return null;if(line.includes("(eval "))line=line.replace(/eval code/g,"eval").replace(/(\\(eval at [^()]*)|(,.*$)/g,"");let sanitizedLine=line.replace(/^\\s+/,"").replace(/\\(eval code/g,"(").replace(/^.*?\\s+/,"");const location=sanitizedLine.match(/ (\\(.+\\)$)/);sanitizedLine=location?sanitizedLine.replace(location[0],""):sanitizedLine;const _extractLocation$3=extractLocation$1(location?location[1]:sanitizedLine),_extractLocation$4=_slicedToArray(_extractLocation$3,3),url=_extractLocation$4[0],lineNumber=_extractLocation$4[1],columnNumber=_extractLocation$4[2];let method=location&&sanitizedLine||"";let file=url&&["eval",""].includes(url)?void 0:url;if(!file||!lineNumber||!columnNumber)return null;if(method.startsWith("async "))method=method.slice(6);if(file.startsWith("file://"))file=file.slice(7);file=resolve$3(file);if(method)method=method.replace(/__vite_ssr_import_\\d+__\\./g,"");return{method,file,line:Number.parseInt(lineNumber),column:Number.parseInt(columnNumber)};}function parseStacktrace(stack,options={}){const _options$ignoreStackE=options.ignoreStackEntries,ignoreStackEntries=_options$ignoreStackE===void 0?stackIgnorePatterns:_options$ignoreStackE;let stacks=!CHROME_IE_STACK_REGEXP$1.test(stack)?parseFFOrSafariStackTrace(stack):parseV8Stacktrace(stack);if(ignoreStackEntries.length)stacks=stacks.filter(stack2=>!ignoreStackEntries.some(p=>stack2.file.match(p)));return stacks.map(stack2=>{var _a;const map=(_a=options.getSourceMap)==null?void 0:_a.call(options,stack2.file);if(!map||typeof map!=="object"||!map.version)return stack2;const traceMap=new TraceMap(map);const _originalPositionFor=originalPositionFor(traceMap,stack2),line=_originalPositionFor.line,column=_originalPositionFor.column;if(line!=null&&column!=null)return _objectSpread(_objectSpread({},stack2),{},{line,column});return stack2;});}function parseFFOrSafariStackTrace(stack){return stack.split("\\n").map(line=>parseSingleFFOrSafariStack$1(line)).filter(notNullish);}function parseV8Stacktrace(stack){return stack.split("\\n").map(line=>parseSingleV8Stack$1(line)).filter(notNullish);}function parseErrorStacktrace(e,options={}){if(!e||isPrimitive(e))return[];if(e.stacks)return e.stacks;const stackStr=e.stack||e.stackStr||"";let stackFrames=parseStacktrace(stackStr,options);if(options.frameFilter)stackFrames=stackFrames.filter(f=>options.frameFilter(e,f)!==false);e.stacks=stackFrames;return stackFrames;}async function saveInlineSnapshots(environment,snapshots){const MagicString=(await import('./bundle-ly9OXwfJ.js')).default;const files=new Set(snapshots.map(i=>i.file));await Promise.all(Array.from(files).map(async file=>{const snaps=snapshots.filter(i=>i.file===file);const code=await environment.readSnapshotFile(file);const s=new MagicString(code);for(const snap of snaps){const index=positionToOffset(code,snap.line,snap.column);replaceInlineSnap(code,s,index,snap.snapshot);}const transformed=s.toString();if(transformed!==code)await environment.saveSnapshotFile(file,transformed);}));}const startObjectRegex=/(?:toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot)\\s*\\(\\s*(?:\\/\\*[\\S\\s]*\\*\\/\\s*|\\/\\/.*\\s+)*\\s*({)/m;function replaceObjectSnap(code,s,index,newSnap){let _code=code.slice(index);const startMatch=startObjectRegex.exec(_code);if(!startMatch)return false;_code=_code.slice(startMatch.index);let callEnd=getCallLastIndex(_code);if(callEnd===null)return false;callEnd+=index+startMatch.index;const shapeStart=index+startMatch.index+startMatch[0].length;const shapeEnd=getObjectShapeEndIndex(code,shapeStart);const snap=\`, \${prepareSnapString(newSnap,code,index)}\`;if(shapeEnd===callEnd){s.appendLeft(callEnd,snap);}else{s.overwrite(shapeEnd,callEnd,snap);}return true;}function getObjectShapeEndIndex(code,index){let startBraces=1;let endBraces=0;while(startBraces!==endBraces&&indexi?indentNext+i:"").join("\\n").replace(/\`/g,"\\\\\`").replace(/\\\${/g,"\\\\\${")} +\${indent}\${quote}\`;}const startRegex=/(?:toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot)\\s*\\(\\s*(?:\\/\\*[\\S\\s]*\\*\\/\\s*|\\/\\/.*\\s+)*\\s*[\\w_$]*(['"\`\\)])/m;function replaceInlineSnap(code,s,index,newSnap){const codeStartingAtIndex=code.slice(index);const startMatch=startRegex.exec(codeStartingAtIndex);const firstKeywordMatch=/toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot/.exec(codeStartingAtIndex);if(!startMatch||startMatch.index!==(firstKeywordMatch==null?void 0:firstKeywordMatch.index))return replaceObjectSnap(code,s,index,newSnap);const quote=startMatch[1];const startIndex=index+startMatch.index+startMatch[0].length;const snapString=prepareSnapString(newSnap,code,index);if(quote===")"){s.appendRight(startIndex-1,snapString);return true;}const quoteEndRE=new RegExp(\`(?:^|[^\\\\\\\\])\${quote}\`);const endMatch=quoteEndRE.exec(code.slice(startIndex));if(!endMatch)return false;const endIndex=startIndex+endMatch.index+endMatch[0].length;s.overwrite(startIndex-1,endIndex,snapString);return true;}const INDENTATION_REGEX=/^([^\\S\\n]*)\\S/m;function stripSnapshotIndentation(inlineSnapshot){const match=inlineSnapshot.match(INDENTATION_REGEX);if(!match||!match[1]){return inlineSnapshot;}const indentation=match[1];const lines=inlineSnapshot.split(/\\n/g);if(lines.length<=2){return inlineSnapshot;}if(lines[0].trim()!==""||lines[lines.length-1].trim()!==""){return inlineSnapshot;}for(let i=1;i{if(!snap.readonly)await environment.saveSnapshotFile(snap.file,snap.snapshot);}));}class SnapshotState{constructor(testFilePath,snapshotPath,snapshotContent,options){this.testFilePath=testFilePath;this.snapshotPath=snapshotPath;const _getSnapshotData=getSnapshotData(snapshotContent,options),data=_getSnapshotData.data,dirty=_getSnapshotData.dirty;this._fileExists=snapshotContent!=null;this._initialData=data;this._snapshotData=data;this._dirty=dirty;this._inlineSnapshots=[];this._rawSnapshots=[];this._uncheckedKeys=new Set(Object.keys(this._snapshotData));this._counters=/* @__PURE__ */new Map();this.expand=options.expand||false;this.added=0;this.matched=0;this.unmatched=0;this._updateSnapshot=options.updateSnapshot;this.updated=0;this._snapshotFormat=_objectSpread({printBasicPrototype:false,escapeString:false},options.snapshotFormat);this._environment=options.snapshotEnvironment;}_counters;_dirty;_updateSnapshot;_snapshotData;_initialData;_inlineSnapshots;_rawSnapshots;_uncheckedKeys;_snapshotFormat;_environment;_fileExists;added;expand;matched;unmatched;updated;static async create(testFilePath,options){const snapshotPath=await options.snapshotEnvironment.resolvePath(testFilePath);const content=await options.snapshotEnvironment.readSnapshotFile(snapshotPath);return new SnapshotState(testFilePath,snapshotPath,content,options);}get environment(){return this._environment;}markSnapshotsAsCheckedForTest(testName){this._uncheckedKeys.forEach(uncheckedKey=>{if(keyToTestName(uncheckedKey)===testName)this._uncheckedKeys.delete(uncheckedKey);});}_inferInlineSnapshotStack(stacks){const promiseIndex=stacks.findIndex(i=>i.method.match(/__VITEST_(RESOLVES|REJECTS)__/));if(promiseIndex!==-1)return stacks[promiseIndex+3];const stackIndex=stacks.findIndex(i=>i.method.includes("__INLINE_SNAPSHOT__"));return stackIndex!==-1?stacks[stackIndex+2]:null;}_addSnapshot(key,receivedSerialized,options){this._dirty=true;if(options.isInline){const stacks=parseErrorStacktrace(options.error||new Error("snapshot"),{ignoreStackEntries:[]});const stack=this._inferInlineSnapshotStack(stacks);if(!stack){throw new Error(\`@vitest/snapshot: Couldn't infer stack frame for inline snapshot. +\${JSON.stringify(stacks)}\`);}stack.column--;this._inlineSnapshots.push(_objectSpread({snapshot:receivedSerialized},stack));}else if(options.rawSnapshot){this._rawSnapshots.push(_objectSpread(_objectSpread({},options.rawSnapshot),{},{snapshot:receivedSerialized}));}else{this._snapshotData[key]=receivedSerialized;}}clear(){this._snapshotData=this._initialData;this._counters=/* @__PURE__ */new Map();this.added=0;this.matched=0;this.unmatched=0;this.updated=0;this._dirty=false;}async save(){const hasExternalSnapshots=Object.keys(this._snapshotData).length;const hasInlineSnapshots=this._inlineSnapshots.length;const hasRawSnapshots=this._rawSnapshots.length;const isEmpty=!hasExternalSnapshots&&!hasInlineSnapshots&&!hasRawSnapshots;const status={deleted:false,saved:false};if((this._dirty||this._uncheckedKeys.size)&&!isEmpty){if(hasExternalSnapshots){await saveSnapshotFile(this._environment,this._snapshotData,this.snapshotPath);this._fileExists=true;}if(hasInlineSnapshots)await saveInlineSnapshots(this._environment,this._inlineSnapshots);if(hasRawSnapshots)await saveRawSnapshots(this._environment,this._rawSnapshots);status.saved=true;}else if(!hasExternalSnapshots&&this._fileExists){if(this._updateSnapshot==="all"){await this._environment.removeSnapshotFile(this.snapshotPath);this._fileExists=false;}status.deleted=true;}return status;}getUncheckedCount(){return this._uncheckedKeys.size||0;}getUncheckedKeys(){return Array.from(this._uncheckedKeys);}removeUncheckedKeys(){if(this._updateSnapshot==="all"&&this._uncheckedKeys.size){this._dirty=true;this._uncheckedKeys.forEach(key=>delete this._snapshotData[key]);this._uncheckedKeys.clear();}}match({testName,received,key,inlineSnapshot,isInline,error,rawSnapshot}){this._counters.set(testName,(this._counters.get(testName)||0)+1);const count=Number(this._counters.get(testName));if(!key)key=testNameToKey(testName,count);if(!(isInline&&this._snapshotData[key]!==void 0))this._uncheckedKeys.delete(key);let receivedSerialized=rawSnapshot&&typeof received==="string"?received:serialize(received,void 0,this._snapshotFormat);if(!rawSnapshot)receivedSerialized=addExtraLineBreaks(receivedSerialized);if(rawSnapshot){if(rawSnapshot.content&&rawSnapshot.content.match(/\\r\\n/)&&!receivedSerialized.match(/\\r\\n/))rawSnapshot.content=normalizeNewlines(rawSnapshot.content);}const expected=isInline?inlineSnapshot:rawSnapshot?rawSnapshot.content:this._snapshotData[key];const expectedTrimmed=prepareExpected(expected);const pass=expectedTrimmed===prepareExpected(receivedSerialized);const hasSnapshot=expected!==void 0;const snapshotIsPersisted=isInline||this._fileExists||rawSnapshot&&rawSnapshot.content!=null;if(pass&&!isInline&&!rawSnapshot){this._snapshotData[key]=receivedSerialized;}if(hasSnapshot&&this._updateSnapshot==="all"||(!hasSnapshot||!snapshotIsPersisted)&&(this._updateSnapshot==="new"||this._updateSnapshot==="all")){if(this._updateSnapshot==="all"){if(!pass){if(hasSnapshot)this.updated++;else this.added++;this._addSnapshot(key,receivedSerialized,{error,isInline,rawSnapshot});}else{this.matched++;}}else{this._addSnapshot(key,receivedSerialized,{error,isInline,rawSnapshot});this.added++;}return{actual:"",count,expected:"",key,pass:true};}else{if(!pass){this.unmatched++;return{actual:removeExtraLineBreaks(receivedSerialized),count,expected:expectedTrimmed!==void 0?removeExtraLineBreaks(expectedTrimmed):void 0,key,pass:false};}else{this.matched++;return{actual:"",count,expected:"",key,pass:true};}}}async pack(){const snapshot={filepath:this.testFilePath,added:0,fileDeleted:false,matched:0,unchecked:0,uncheckedKeys:[],unmatched:0,updated:0};const uncheckedCount=this.getUncheckedCount();const uncheckedKeys=this.getUncheckedKeys();if(uncheckedCount)this.removeUncheckedKeys();const status=await this.save();snapshot.fileDeleted=status.deleted;snapshot.added=this.added;snapshot.matched=this.matched;snapshot.unmatched=this.unmatched;snapshot.updated=this.updated;snapshot.unchecked=!status.deleted?uncheckedCount:0;snapshot.uncheckedKeys=Array.from(uncheckedKeys);return snapshot;}}function createMismatchError(message,expand,actual,expected){const error=new Error(message);Object.defineProperty(error,"actual",{value:actual,enumerable:true,configurable:true,writable:true});Object.defineProperty(error,"expected",{value:expected,enumerable:true,configurable:true,writable:true});Object.defineProperty(error,"diffOptions",{value:{expand}});return error;}class SnapshotClient{constructor(options={}){this.options=options;}filepath;name;snapshotState;snapshotStateMap=/* @__PURE__ */new Map();async startCurrentRun(filepath,name,options){var _a;this.filepath=filepath;this.name=name;if(((_a=this.snapshotState)==null?void 0:_a.testFilePath)!==filepath){await this.finishCurrentRun();if(!this.getSnapshotState(filepath)){this.snapshotStateMap.set(filepath,await SnapshotState.create(filepath,options));}this.snapshotState=this.getSnapshotState(filepath);}}getSnapshotState(filepath){return this.snapshotStateMap.get(filepath);}clearTest(){this.filepath=void 0;this.name=void 0;}skipTestSnapshots(name){var _a;(_a=this.snapshotState)==null?void 0:_a.markSnapshotsAsCheckedForTest(name);}assert(options){var _a,_b,_c,_d;const _options$filepath=options.filepath,filepath=_options$filepath===void 0?this.filepath:_options$filepath,_options$name=options.name,name=_options$name===void 0?this.name:_options$name,message=options.message,_options$isInline=options.isInline,isInline=_options$isInline===void 0?false:_options$isInline,properties=options.properties,inlineSnapshot=options.inlineSnapshot,error=options.error,errorMessage=options.errorMessage,rawSnapshot=options.rawSnapshot;let received=options.received;if(!filepath)throw new Error("Snapshot cannot be used outside of test");if(typeof properties==="object"){if(typeof received!=="object"||!received)throw new Error("Received value must be an object when the matcher has properties");try{const pass2=((_b=(_a=this.options).isEqual)==null?void 0:_b.call(_a,received,properties))??false;if(!pass2)throw createMismatchError("Snapshot properties mismatched",(_c=this.snapshotState)==null?void 0:_c.expand,received,properties);else received=deepMergeSnapshot(received,properties);}catch(err){err.message=errorMessage||"Snapshot mismatched";throw err;}}const testName=[name,...(message?[message]:[])].join(" > ");const snapshotState=this.getSnapshotState(filepath);const _snapshotState$match=snapshotState.match({testName,received,isInline,error,inlineSnapshot,rawSnapshot}),actual=_snapshotState$match.actual,expected=_snapshotState$match.expected,key=_snapshotState$match.key,pass=_snapshotState$match.pass;if(!pass)throw createMismatchError(\`Snapshot \\\`\${key||"unknown"}\\\` mismatched\`,(_d=this.snapshotState)==null?void 0:_d.expand,actual==null?void 0:actual.trim(),expected==null?void 0:expected.trim());}async assertRaw(options){if(!options.rawSnapshot)throw new Error("Raw snapshot is required");const _options$filepath2=options.filepath,filepath=_options$filepath2===void 0?this.filepath:_options$filepath2,rawSnapshot=options.rawSnapshot;if(rawSnapshot.content==null){if(!filepath)throw new Error("Snapshot cannot be used outside of test");const snapshotState=this.getSnapshotState(filepath);options.filepath||(options.filepath=filepath);rawSnapshot.file=await snapshotState.environment.resolveRawPath(filepath,rawSnapshot.file);rawSnapshot.content=(await snapshotState.environment.readSnapshotFile(rawSnapshot.file))||void 0;}return this.assert(options);}async finishCurrentRun(){if(!this.snapshotState)return null;const result=await this.snapshotState.pack();this.snapshotState=void 0;return result;}clear(){this.snapshotStateMap.clear();}}function getFullName(task,separator=" > "){return getNames(task).join(separator);}function normalizeWindowsPath(input=""){if(!input||!input.includes("\\\\")){return input;}return input.replace(/\\\\/g,"/");}const _IS_ABSOLUTE_RE=/^[/\\\\](?![/\\\\])|^[/\\\\]{2}(?!\\.)|^[A-Za-z]:[/\\\\]/;function cwd(){if(typeof process!=="undefined"){return process.cwd().replace(/\\\\/g,"/");}return"/";}const resolve$2=function(...arguments_){arguments_=arguments_.map(argument=>normalizeWindowsPath(argument));let resolvedPath="";let resolvedAbsolute=false;for(let index=arguments_.length-1;index>=-1&&!resolvedAbsolute;index--){const path=index>=0?arguments_[index]:cwd();if(!path||path.length===0){continue;}resolvedPath=\`\${path}/\${resolvedPath}\`;resolvedAbsolute=isAbsolute(path);}resolvedPath=normalizeString(resolvedPath,!resolvedAbsolute);if(resolvedAbsolute&&!isAbsolute(resolvedPath)){return\`/\${resolvedPath}\`;}return resolvedPath.length>0?resolvedPath:".";};function normalizeString(path,allowAboveRoot){let res="";let lastSegmentLength=0;let lastSlash=-1;let dots=0;let char=null;for(let index=0;index<=path.length;++index){if(index2){const lastSlashIndex=res.lastIndexOf("/");if(lastSlashIndex===-1){res="";lastSegmentLength=0;}else{res=res.slice(0,lastSlashIndex);lastSegmentLength=res.length-1-res.lastIndexOf("/");}lastSlash=index;dots=0;continue;}else if(res.length>0){res="";lastSegmentLength=0;lastSlash=index;dots=0;continue;}}if(allowAboveRoot){res+=res.length>0?"/..":"..";lastSegmentLength=2;}}else{if(res.length>0){res+=\`/\${path.slice(lastSlash+1,index)}\`;}else{res=path.slice(lastSlash+1,index);}lastSegmentLength=index-lastSlash-1;}lastSlash=index;dots=0;}else if(char==="."&&dots!==-1){++dots;}else{dots=-1;}}return res;}const isAbsolute=function(p){return _IS_ABSOLUTE_RE.test(p);};const chars='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';const intToChar=new Uint8Array(64);// 64 possible chars. +const charToInt=new Uint8Array(128);// z is 122 in ASCII +for(let i=0;i eval"))line=line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval:\\d+:\\d+/g,":$1");if(!line.includes("@")&&!line.includes(":"))return null;const functionNameRegex=/((.*".+"[^@]*)?[^@]*)(?:@)/;const matches=line.match(functionNameRegex);const functionName=matches&&matches[1]?matches[1]:void 0;const _extractLocation=extractLocation(line.replace(functionNameRegex,"")),_extractLocation2=_slicedToArray(_extractLocation,3),url=_extractLocation2[0],lineNumber=_extractLocation2[1],columnNumber=_extractLocation2[2];if(!url||!lineNumber||!columnNumber)return null;return{file:url,method:functionName||"",line:Number.parseInt(lineNumber),column:Number.parseInt(columnNumber)};}function parseSingleStack(raw){const line=raw.trim();if(!CHROME_IE_STACK_REGEXP.test(line))return parseSingleFFOrSafariStack(line);return parseSingleV8Stack(line);}function parseSingleV8Stack(raw){let line=raw.trim();if(!CHROME_IE_STACK_REGEXP.test(line))return null;if(line.includes("(eval "))line=line.replace(/eval code/g,"eval").replace(/(\\(eval at [^()]*)|(,.*$)/g,"");let sanitizedLine=line.replace(/^\\s+/,"").replace(/\\(eval code/g,"(").replace(/^.*?\\s+/,"");const location=sanitizedLine.match(/ (\\(.+\\)$)/);sanitizedLine=location?sanitizedLine.replace(location[0],""):sanitizedLine;const _extractLocation3=extractLocation(location?location[1]:sanitizedLine),_extractLocation4=_slicedToArray(_extractLocation3,3),url=_extractLocation4[0],lineNumber=_extractLocation4[1],columnNumber=_extractLocation4[2];let method=location&&sanitizedLine||"";let file=url&&["eval",""].includes(url)?void 0:url;if(!file||!lineNumber||!columnNumber)return null;if(method.startsWith("async "))method=method.slice(6);if(file.startsWith("file://"))file=file.slice(7);file=resolve$2(file);if(method)method=method.replace(/__vite_ssr_import_\\d+__\\./g,"");return{method,file,line:Number.parseInt(lineNumber),column:Number.parseInt(columnNumber)};}function isChildProcess(){return typeof process!=="undefined"&&!!process.send;}const RealDate=Date;let now=null;class MockDate extends RealDate{constructor(y,m,d,h,M,s,ms){super();let date;switch(arguments.length){case 0:if(now!==null)date=new RealDate(now.valueOf());else date=new RealDate();break;case 1:date=new RealDate(y);break;default:d=typeof d==="undefined"?1:d;h=h||0;M=M||0;s=s||0;ms=ms||0;date=new RealDate(y,m,d,h,M,s,ms);break;}Object.setPrototypeOf(date,MockDate.prototype);return date;}}MockDate.UTC=RealDate.UTC;MockDate.now=function(){return new MockDate().valueOf();};MockDate.parse=function(dateString){return RealDate.parse(dateString);};MockDate.toString=function(){return RealDate.toString();};function mockDate(date){const dateObj=new RealDate(date.valueOf());if(Number.isNaN(dateObj.getTime()))throw new TypeError(\`mockdate: The time set is an invalid date: \${date}\`);globalThis.Date=MockDate;now=dateObj.valueOf();}function resetDate(){globalThis.Date=RealDate;}function resetModules(modules,resetMocks=false){const skipPaths=[// Vitest +/\\/vitest\\/dist\\//,/\\/vite-node\\/dist\\//,// yarn's .store folder +/vitest-virtual-\\w+\\/dist/,// cnpm +/@vitest\\/dist/,// don't clear mocks +...(!resetMocks?[/^mock:/]:[])];modules.forEach((mod,path)=>{if(skipPaths.some(re=>re.test(path)))return;modules.invalidateModule(mod);});}function waitNextTick(){const _getSafeTimers2=getSafeTimers(),setTimeout=_getSafeTimers2.setTimeout;return new Promise(resolve=>setTimeout(resolve,0));}async function waitForImportsToResolve(){await waitNextTick();const state=getWorkerState();const promises=[];let resolvingCount=0;for(const mod of state.moduleCache.values()){if(mod.promise&&!mod.evaluated)promises.push(mod.promise);if(mod.resolving)resolvingCount++;}if(!promises.length&&!resolvingCount)return;await Promise.allSettled(promises);await waitForImportsToResolve();}function commonjsRequire(path){throw new Error('Could not dynamically require "'+path+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');}var chaiSubset={exports:{}};(function(module,exports){(function(){(function(chaiSubset){if(typeof commonjsRequire==='function'&&'object'==='object'&&'object'==='object'){return module.exports=chaiSubset;}else{return chai.use(chaiSubset);}})(function(chai,utils){var Assertion=chai.Assertion;var assertionPrototype=Assertion.prototype;Assertion.addMethod('containSubset',function(expected){var actual=utils.flag(this,'object');var showDiff=chai.config.showDiff;assertionPrototype.assert.call(this,compare(expected,actual),'expected #{act} to contain subset #{exp}','expected #{act} to not contain subset #{exp}',expected,actual,showDiff);});chai.assert.containSubset=function(val,exp,msg){new chai.Assertion(val,msg).to.be.containSubset(exp);};function compare(expected,actual){if(expected===actual){return true;}if(typeof actual!==typeof expected){return false;}if(typeof expected!=='object'||expected===null){return expected===actual;}if(!!expected&&!actual){return false;}if(Array.isArray(expected)){if(typeof actual.length!=='number'){return false;}var aa=Array.prototype.slice.call(actual);return expected.every(function(exp){return aa.some(function(act){return compare(exp,act);});});}if(expected instanceof Date){if(actual instanceof Date){return expected.getTime()===actual.getTime();}else{return false;}}return Object.keys(expected).every(function(key){var eo=expected[key];var ao=actual[key];if(typeof eo==='object'&&eo!==null&&ao!==null){return compare(eo,ao);}if(typeof eo==='function'){return eo(ao);}return ao===eo;});}});}).call(commonjsGlobal);})(chaiSubset);var chaiSubsetExports=chaiSubset.exports;var Subset=/*@__PURE__*/getDefaultExportFromCjs$1(chaiSubsetExports);const MATCHERS_OBJECT=Symbol.for("matchers-object");const JEST_MATCHERS_OBJECT=Symbol.for("$$jest-matchers-object");const GLOBAL_EXPECT=Symbol.for("expect-global");const ASYMMETRIC_MATCHERS_OBJECT=Symbol.for("asymmetric-matchers-object");if(!Object.prototype.hasOwnProperty.call(globalThis,MATCHERS_OBJECT)){const globalState=/* @__PURE__ */new WeakMap();const matchers=/* @__PURE__ */Object.create(null);const customEqualityTesters=[];const assymetricMatchers=/* @__PURE__ */Object.create(null);Object.defineProperty(globalThis,MATCHERS_OBJECT,{get:()=>globalState});Object.defineProperty(globalThis,JEST_MATCHERS_OBJECT,{configurable:true,get:()=>({state:globalState.get(globalThis[GLOBAL_EXPECT]),matchers,customEqualityTesters})});Object.defineProperty(globalThis,ASYMMETRIC_MATCHERS_OBJECT,{get:()=>assymetricMatchers});}function recordAsyncExpect(test,promise){if(test&&promise instanceof Promise){promise=promise.finally(()=>{const index=test.promises.indexOf(promise);if(index!==-1)test.promises.splice(index,1);});if(!test.promises)test.promises=[];test.promises.push(promise);}return promise;}let _client;function getSnapshotClient(){if(!_client){_client=new SnapshotClient({isEqual:(received,expected)=>{return equals(received,expected,[iterableEquality,subsetEquality]);}});}return _client;}function getError(expected,promise){if(typeof expected!=="function"){if(!promise)throw new Error(\`expected must be a function, received \${typeof expected}\`);return expected;}try{expected();}catch(e){return e;}throw new Error("snapshot function didn't throw");}const SnapshotPlugin=(chai,utils)=>{const getTestNames=test=>{var _a;if(!test)return{};return{filepath:(_a=test.file)==null?void 0:_a.filepath,name:getNames(test).slice(1).join(" > ")};};for(const key of["matchSnapshot","toMatchSnapshot"]){utils.addMethod(chai.Assertion.prototype,key,function(properties,message){const expected=utils.flag(this,"object");const test=utils.flag(this,"vitest-test");if(typeof properties==="string"&&typeof message==="undefined"){message=properties;properties=void 0;}const errorMessage=utils.flag(this,"message");getSnapshotClient().assert(_objectSpread({received:expected,message,isInline:false,properties,errorMessage},getTestNames(test)));});}utils.addMethod(chai.Assertion.prototype,"toMatchFileSnapshot",function(file,message){const expected=utils.flag(this,"object");const test=utils.flag(this,"vitest-test");const errorMessage=utils.flag(this,"message");const promise=getSnapshotClient().assertRaw(_objectSpread({received:expected,message,isInline:false,rawSnapshot:{file},errorMessage},getTestNames(test)));return recordAsyncExpect(test,promise);});utils.addMethod(chai.Assertion.prototype,"toMatchInlineSnapshot",function __INLINE_SNAPSHOT__(properties,inlineSnapshot,message){var _a;const test=utils.flag(this,"vitest-test");const isInsideEach=test&&(test.each||((_a=test.suite)==null?void 0:_a.each));if(isInsideEach)throw new Error("InlineSnapshot cannot be used inside of test.each or describe.each");const expected=utils.flag(this,"object");const error=utils.flag(this,"error");if(typeof properties==="string"){message=inlineSnapshot;inlineSnapshot=properties;properties=void 0;}if(inlineSnapshot)inlineSnapshot=stripSnapshotIndentation(inlineSnapshot);const errorMessage=utils.flag(this,"message");getSnapshotClient().assert(_objectSpread({received:expected,message,isInline:true,properties,inlineSnapshot,error,errorMessage},getTestNames(test)));});utils.addMethod(chai.Assertion.prototype,"toThrowErrorMatchingSnapshot",function(message){const expected=utils.flag(this,"object");const test=utils.flag(this,"vitest-test");const promise=utils.flag(this,"promise");const errorMessage=utils.flag(this,"message");getSnapshotClient().assert(_objectSpread({received:getError(expected,promise),message,errorMessage},getTestNames(test)));});utils.addMethod(chai.Assertion.prototype,"toThrowErrorMatchingInlineSnapshot",function __INLINE_SNAPSHOT__(inlineSnapshot,message){var _a;const test=utils.flag(this,"vitest-test");const isInsideEach=test&&(test.each||((_a=test.suite)==null?void 0:_a.each));if(isInsideEach)throw new Error("InlineSnapshot cannot be used inside of test.each or describe.each");const expected=utils.flag(this,"object");const error=utils.flag(this,"error");const promise=utils.flag(this,"promise");const errorMessage=utils.flag(this,"message");if(inlineSnapshot)inlineSnapshot=stripSnapshotIndentation(inlineSnapshot);getSnapshotClient().assert(_objectSpread({received:getError(expected,promise),message,inlineSnapshot,isInline:true,error,errorMessage},getTestNames(test)));});utils.addMethod(chai.expect,"addSnapshotSerializer",addSerializer);};use(JestExtend);use(JestChaiExpect);use(Subset);use(SnapshotPlugin);use(JestAsymmetricMatchers);function createExpect(test){var _a;const expect$1=(value,message)=>{const _getState=getState(expect$1),assertionCalls=_getState.assertionCalls;setState({assertionCalls:assertionCalls+1,soft:false},expect$1);const assert2=expect(value,message);const _test=test||getCurrentTest();if(_test)return assert2.withTest(_test);else return assert2;};Object.assign(expect$1,expect);Object.assign(expect$1,globalThis[ASYMMETRIC_MATCHERS_OBJECT$1]);expect$1.getState=()=>getState(expect$1);expect$1.setState=state=>setState(state,expect$1);const globalState=getState(globalThis[GLOBAL_EXPECT$1])||{};setState(_objectSpread(_objectSpread({},globalState),{},{assertionCalls:0,isExpectingAssertions:false,isExpectingAssertionsError:null,expectedAssertionsNumber:null,expectedAssertionsNumberErrorGen:null,environment:getCurrentEnvironment(),testPath:test?(_a=test.suite.file)==null?void 0:_a.filepath:globalState.testPath,currentTestName:test?getFullName(test):globalState.currentTestName}),expect$1);expect$1.extend=matchers=>expect.extend(expect$1,matchers);expect$1.addEqualityTesters=customTesters=>addCustomEqualityTesters(customTesters);expect$1.soft=(...args)=>{const assert2=expect$1(...args);expect$1.setState({soft:true});return assert2;};expect$1.unreachable=message=>{assert.fail(\`expected\${message?\` "\${message}" \`:" "}not to be reached\`);};function assertions(expected){const errorGen=()=>new Error(\`expected number of assertions to be \${expected}, but got \${expect$1.getState().assertionCalls}\`);if(Error.captureStackTrace)Error.captureStackTrace(errorGen(),assertions);expect$1.setState({expectedAssertionsNumber:expected,expectedAssertionsNumberErrorGen:errorGen});}function hasAssertions(){const error=new Error("expected any number of assertion, but got none");if(Error.captureStackTrace)Error.captureStackTrace(error,hasAssertions);expect$1.setState({isExpectingAssertions:true,isExpectingAssertionsError:error});}util.addMethod(expect$1,"assertions",assertions);util.addMethod(expect$1,"hasAssertions",hasAssertions);return expect$1;}const globalExpect=createExpect();Object.defineProperty(globalThis,GLOBAL_EXPECT$1,{value:globalExpect,writable:true,configurable:true});/** + * A reference to the global object + * + * @type {object} globalObject + */var globalObject$1;/* istanbul ignore else */if(typeof commonjsGlobal!=="undefined"){// Node +globalObject$1=commonjsGlobal;}else if(typeof window!=="undefined"){// Browser +globalObject$1=window;}else{// WebWorker +globalObject$1=self;}var global$1=globalObject$1;/** + * Is true when the environment causes an error to be thrown for accessing the + * __proto__ property. + * + * This is necessary in order to support \`node --disable-proto=throw\`. + * + * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/proto + * + * @type {boolean} + */let throwsOnProto$1;try{const object={};// eslint-disable-next-line no-proto, no-unused-expressions +object.__proto__;throwsOnProto$1=false;}catch(_){// This branch is covered when tests are run with \`--disable-proto=throw\`, +// however we can test both branches at the same time, so this is ignored +/* istanbul ignore next */throwsOnProto$1=true;}var throwsOnProto_1=throwsOnProto$1;var call=Function.call;var throwsOnProto=throwsOnProto_1;var disallowedProperties=[// ignore size because it throws from Map +"size","caller","callee","arguments"];// This branch is covered when tests are run with \`--disable-proto=throw\`, +// however we can test both branches at the same time, so this is ignored +/* istanbul ignore next */if(throwsOnProto){disallowedProperties.push("__proto__");}var copyPrototypeMethods=function copyPrototypeMethods(prototype){// eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods +return Object.getOwnPropertyNames(prototype).reduce(function(result,name){if(disallowedProperties.includes(name)){return result;}if(typeof prototype[name]!=="function"){return result;}result[name]=call.bind(prototype[name]);return result;},Object.create(null));};var copyPrototype$5=copyPrototypeMethods;var array=copyPrototype$5(Array.prototype);var every$1=array.every;/** + * @private + */function hasCallsLeft(callMap,spy){if(callMap[spy.id]===undefined){callMap[spy.id]=0;}return callMap[spy.id]1?arguments:spies;return every$1(_spies,checkAdjacentCalls.bind(null,callMap));}var calledInOrder_1=calledInOrder;/** + * Returns a display name for a function + * + * @param {Function} func + * @returns {string} + */var functionName$1=function functionName(func){if(!func){return"";}try{return func.displayName||func.name||// Use function decomposition as a last resort to get function +// name. Does not rely on function decomposition to work - if it +// doesn't debugging will be slightly less informative +// (i.e. toString will say 'spy' rather than 'myFunc'). +(String(func).match(/function ([^\\s(]+)/)||[])[1];}catch(e){// Stringify may fail and we might get an exception, as a last-last +// resort fall back to empty string. +return"";}};var functionName=functionName$1;/** + * Returns a display name for a value from a constructor + * + * @param {object} value A value to examine + * @returns {(string|null)} A string or null + */function className(value){return value.constructor&&value.constructor.name||// The next branch is for IE11 support only: +// Because the name property is not set on the prototype +// of the Function object, we finally try to grab the +// name from its definition. This will never be reached +// in node, so we are not able to test this properly. +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name +typeof value.constructor==="function"&&/* istanbul ignore next */functionName(value.constructor)||null;}var className_1=className;var deprecated={};/* eslint-disable no-console */(function(exports){/** + * Returns a function that will invoke the supplied function and print a + * deprecation warning to the console each time it is called. + * + * @param {Function} func + * @param {string} msg + * @returns {Function} + */exports.wrap=function(func,msg){var wrapped=function(){exports.printWarning(msg);return func.apply(this,arguments);};if(func.prototype){wrapped.prototype=func.prototype;}return wrapped;};/** + * Returns a string which can be supplied to \`wrap()\` to notify the user that a + * particular part of the sinon API has been deprecated. + * + * @param {string} packageName + * @param {string} funcName + * @returns {string} + */exports.defaultMsg=function(packageName,funcName){return\`\${packageName}.\${funcName} is deprecated and will be removed from the public API in a future version of \${packageName}.\`;};/** + * Prints a warning on the console, when it exists + * + * @param {string} msg + * @returns {undefined} + */exports.printWarning=function(msg){/* istanbul ignore next */if(typeof process==="object"&&process.emitWarning){// Emit Warnings in Node +process.emitWarning(msg);}else if(console.info){console.info(msg);}else{console.log(msg);}};})(deprecated);/** + * Returns true when fn returns true for all members of obj. + * This is an every implementation that works for all iterables + * + * @param {object} obj + * @param {Function} fn + * @returns {boolean} + */var every=function every(obj,fn){var pass=true;try{// eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods +obj.forEach(function(){if(!fn.apply(this,arguments)){// Throwing an error is the only way to break \`forEach\` +throw new Error();}});}catch(e){pass=false;}return pass;};var sort=array.sort;var slice=array.slice;/** + * @private + */function comparator(a,b){// uuid, won't ever be equal +var aCall=a.getCall(0);var bCall=b.getCall(0);var aId=aCall&&aCall.callId||-1;var bId=bCall&&bCall.callId||-1;return aId + * MIT Licensed + */var promiseExists=typeof Promise==='function';/* eslint-disable no-undef */var globalObject=typeof self==='object'?self:commonjsGlobal;// eslint-disable-line id-blacklist +var symbolExists=typeof Symbol!=='undefined';var mapExists=typeof Map!=='undefined';var setExists=typeof Set!=='undefined';var weakMapExists=typeof WeakMap!=='undefined';var weakSetExists=typeof WeakSet!=='undefined';var dataViewExists=typeof DataView!=='undefined';var symbolIteratorExists=symbolExists&&typeof Symbol.iterator!=='undefined';var symbolToStringTagExists=symbolExists&&typeof Symbol.toStringTag!=='undefined';var setEntriesExists=setExists&&typeof Set.prototype.entries==='function';var mapEntriesExists=mapExists&&typeof Map.prototype.entries==='function';var setIteratorPrototype=setEntriesExists&&Object.getPrototypeOf(new Set().entries());var mapIteratorPrototype=mapEntriesExists&&Object.getPrototypeOf(new Map().entries());var arrayIteratorExists=symbolIteratorExists&&typeof Array.prototype[Symbol.iterator]==='function';var arrayIteratorPrototype=arrayIteratorExists&&Object.getPrototypeOf([][Symbol.iterator]());var stringIteratorExists=symbolIteratorExists&&typeof String.prototype[Symbol.iterator]==='function';var stringIteratorPrototype=stringIteratorExists&&Object.getPrototypeOf(''[Symbol.iterator]());var toStringLeftSliceLength=8;var toStringRightSliceLength=-1;/** + * ### typeOf (obj) + * + * Uses \`Object.prototype.toString\` to determine the type of an object, + * normalising behaviour across engine versions & well optimised. + * + * @param {Mixed} object + * @return {String} object type + * @api public + */function typeDetect(obj){/* ! Speed optimisation + * Pre: + * string literal x 3,039,035 ops/sec ±1.62% (78 runs sampled) + * boolean literal x 1,424,138 ops/sec ±4.54% (75 runs sampled) + * number literal x 1,653,153 ops/sec ±1.91% (82 runs sampled) + * undefined x 9,978,660 ops/sec ±1.92% (75 runs sampled) + * function x 2,556,769 ops/sec ±1.73% (77 runs sampled) + * Post: + * string literal x 38,564,796 ops/sec ±1.15% (79 runs sampled) + * boolean literal x 31,148,940 ops/sec ±1.10% (79 runs sampled) + * number literal x 32,679,330 ops/sec ±1.90% (78 runs sampled) + * undefined x 32,363,368 ops/sec ±1.07% (82 runs sampled) + * function x 31,296,870 ops/sec ±0.96% (83 runs sampled) + */var typeofObj=typeof obj;if(typeofObj!=='object'){return typeofObj;}/* ! Speed optimisation + * Pre: + * null x 28,645,765 ops/sec ±1.17% (82 runs sampled) + * Post: + * null x 36,428,962 ops/sec ±1.37% (84 runs sampled) + */if(obj===null){return'null';}/* ! Spec Conformance + * Test: \`Object.prototype.toString.call(window)\`\` + * - Node === "[object global]" + * - Chrome === "[object global]" + * - Firefox === "[object Window]" + * - PhantomJS === "[object Window]" + * - Safari === "[object Window]" + * - IE 11 === "[object Window]" + * - IE Edge === "[object Window]" + * Test: \`Object.prototype.toString.call(this)\`\` + * - Chrome Worker === "[object global]" + * - Firefox Worker === "[object DedicatedWorkerGlobalScope]" + * - Safari Worker === "[object DedicatedWorkerGlobalScope]" + * - IE 11 Worker === "[object WorkerGlobalScope]" + * - IE Edge Worker === "[object WorkerGlobalScope]" + */if(obj===globalObject){return'global';}/* ! Speed optimisation + * Pre: + * array literal x 2,888,352 ops/sec ±0.67% (82 runs sampled) + * Post: + * array literal x 22,479,650 ops/sec ±0.96% (81 runs sampled) + */if(Array.isArray(obj)&&(symbolToStringTagExists===false||!(Symbol.toStringTag in obj))){return'Array';}// Not caching existence of \`window\` and related properties due to potential +// for \`window\` to be unset before tests in quasi-browser environments. +if(typeof window==='object'&&window!==null){/* ! Spec Conformance + * (https://html.spec.whatwg.org/multipage/browsers.html#location) + * WhatWG HTML$7.7.3 - The \`Location\` interface + * Test: \`Object.prototype.toString.call(window.location)\`\` + * - IE <=11 === "[object Object]" + * - IE Edge <=13 === "[object Object]" + */if(typeof window.location==='object'&&obj===window.location){return'Location';}/* ! Spec Conformance + * (https://html.spec.whatwg.org/#document) + * WhatWG HTML$3.1.1 - The \`Document\` object + * Note: Most browsers currently adher to the W3C DOM Level 2 spec + * (https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26809268) + * which suggests that browsers should use HTMLTableCellElement for + * both TD and TH elements. WhatWG separates these. + * WhatWG HTML states: + * > For historical reasons, Window objects must also have a + * > writable, configurable, non-enumerable property named + * > HTMLDocument whose value is the Document interface object. + * Test: \`Object.prototype.toString.call(document)\`\` + * - Chrome === "[object HTMLDocument]" + * - Firefox === "[object HTMLDocument]" + * - Safari === "[object HTMLDocument]" + * - IE <=10 === "[object Document]" + * - IE 11 === "[object HTMLDocument]" + * - IE Edge <=13 === "[object HTMLDocument]" + */if(typeof window.document==='object'&&obj===window.document){return'Document';}if(typeof window.navigator==='object'){/* ! Spec Conformance + * (https://html.spec.whatwg.org/multipage/webappapis.html#mimetypearray) + * WhatWG HTML$8.6.1.5 - Plugins - Interface MimeTypeArray + * Test: \`Object.prototype.toString.call(navigator.mimeTypes)\`\` + * - IE <=10 === "[object MSMimeTypesCollection]" + */if(typeof window.navigator.mimeTypes==='object'&&obj===window.navigator.mimeTypes){return'MimeTypeArray';}/* ! Spec Conformance + * (https://html.spec.whatwg.org/multipage/webappapis.html#pluginarray) + * WhatWG HTML$8.6.1.5 - Plugins - Interface PluginArray + * Test: \`Object.prototype.toString.call(navigator.plugins)\`\` + * - IE <=10 === "[object MSPluginsCollection]" + */if(typeof window.navigator.plugins==='object'&&obj===window.navigator.plugins){return'PluginArray';}}if((typeof window.HTMLElement==='function'||typeof window.HTMLElement==='object')&&obj instanceof window.HTMLElement){/* ! Spec Conformance + * (https://html.spec.whatwg.org/multipage/webappapis.html#pluginarray) + * WhatWG HTML$4.4.4 - The \`blockquote\` element - Interface \`HTMLQuoteElement\` + * Test: \`Object.prototype.toString.call(document.createElement('blockquote'))\`\` + * - IE <=10 === "[object HTMLBlockElement]" + */if(obj.tagName==='BLOCKQUOTE'){return'HTMLQuoteElement';}/* ! Spec Conformance + * (https://html.spec.whatwg.org/#htmltabledatacellelement) + * WhatWG HTML$4.9.9 - The \`td\` element - Interface \`HTMLTableDataCellElement\` + * Note: Most browsers currently adher to the W3C DOM Level 2 spec + * (https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-82915075) + * which suggests that browsers should use HTMLTableCellElement for + * both TD and TH elements. WhatWG separates these. + * Test: Object.prototype.toString.call(document.createElement('td')) + * - Chrome === "[object HTMLTableCellElement]" + * - Firefox === "[object HTMLTableCellElement]" + * - Safari === "[object HTMLTableCellElement]" + */if(obj.tagName==='TD'){return'HTMLTableDataCellElement';}/* ! Spec Conformance + * (https://html.spec.whatwg.org/#htmltableheadercellelement) + * WhatWG HTML$4.9.9 - The \`td\` element - Interface \`HTMLTableHeaderCellElement\` + * Note: Most browsers currently adher to the W3C DOM Level 2 spec + * (https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-82915075) + * which suggests that browsers should use HTMLTableCellElement for + * both TD and TH elements. WhatWG separates these. + * Test: Object.prototype.toString.call(document.createElement('th')) + * - Chrome === "[object HTMLTableCellElement]" + * - Firefox === "[object HTMLTableCellElement]" + * - Safari === "[object HTMLTableCellElement]" + */if(obj.tagName==='TH'){return'HTMLTableHeaderCellElement';}}}/* ! Speed optimisation + * Pre: + * Float64Array x 625,644 ops/sec ±1.58% (80 runs sampled) + * Float32Array x 1,279,852 ops/sec ±2.91% (77 runs sampled) + * Uint32Array x 1,178,185 ops/sec ±1.95% (83 runs sampled) + * Uint16Array x 1,008,380 ops/sec ±2.25% (80 runs sampled) + * Uint8Array x 1,128,040 ops/sec ±2.11% (81 runs sampled) + * Int32Array x 1,170,119 ops/sec ±2.88% (80 runs sampled) + * Int16Array x 1,176,348 ops/sec ±5.79% (86 runs sampled) + * Int8Array x 1,058,707 ops/sec ±4.94% (77 runs sampled) + * Uint8ClampedArray x 1,110,633 ops/sec ±4.20% (80 runs sampled) + * Post: + * Float64Array x 7,105,671 ops/sec ±13.47% (64 runs sampled) + * Float32Array x 5,887,912 ops/sec ±1.46% (82 runs sampled) + * Uint32Array x 6,491,661 ops/sec ±1.76% (79 runs sampled) + * Uint16Array x 6,559,795 ops/sec ±1.67% (82 runs sampled) + * Uint8Array x 6,463,966 ops/sec ±1.43% (85 runs sampled) + * Int32Array x 5,641,841 ops/sec ±3.49% (81 runs sampled) + * Int16Array x 6,583,511 ops/sec ±1.98% (80 runs sampled) + * Int8Array x 6,606,078 ops/sec ±1.74% (81 runs sampled) + * Uint8ClampedArray x 6,602,224 ops/sec ±1.77% (83 runs sampled) + */var stringTag=symbolToStringTagExists&&obj[Symbol.toStringTag];if(typeof stringTag==='string'){return stringTag;}var objPrototype=Object.getPrototypeOf(obj);/* ! Speed optimisation + * Pre: + * regex literal x 1,772,385 ops/sec ±1.85% (77 runs sampled) + * regex constructor x 2,143,634 ops/sec ±2.46% (78 runs sampled) + * Post: + * regex literal x 3,928,009 ops/sec ±0.65% (78 runs sampled) + * regex constructor x 3,931,108 ops/sec ±0.58% (84 runs sampled) + */if(objPrototype===RegExp.prototype){return'RegExp';}/* ! Speed optimisation + * Pre: + * date x 2,130,074 ops/sec ±4.42% (68 runs sampled) + * Post: + * date x 3,953,779 ops/sec ±1.35% (77 runs sampled) + */if(objPrototype===Date.prototype){return'Date';}/* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-promise.prototype-@@tostringtag) + * ES6$25.4.5.4 - Promise.prototype[@@toStringTag] should be "Promise": + * Test: \`Object.prototype.toString.call(Promise.resolve())\`\` + * - Chrome <=47 === "[object Object]" + * - Edge <=20 === "[object Object]" + * - Firefox 29-Latest === "[object Promise]" + * - Safari 7.1-Latest === "[object Promise]" + */if(promiseExists&&objPrototype===Promise.prototype){return'Promise';}/* ! Speed optimisation + * Pre: + * set x 2,222,186 ops/sec ±1.31% (82 runs sampled) + * Post: + * set x 4,545,879 ops/sec ±1.13% (83 runs sampled) + */if(setExists&&objPrototype===Set.prototype){return'Set';}/* ! Speed optimisation + * Pre: + * map x 2,396,842 ops/sec ±1.59% (81 runs sampled) + * Post: + * map x 4,183,945 ops/sec ±6.59% (82 runs sampled) + */if(mapExists&&objPrototype===Map.prototype){return'Map';}/* ! Speed optimisation + * Pre: + * weakset x 1,323,220 ops/sec ±2.17% (76 runs sampled) + * Post: + * weakset x 4,237,510 ops/sec ±2.01% (77 runs sampled) + */if(weakSetExists&&objPrototype===WeakSet.prototype){return'WeakSet';}/* ! Speed optimisation + * Pre: + * weakmap x 1,500,260 ops/sec ±2.02% (78 runs sampled) + * Post: + * weakmap x 3,881,384 ops/sec ±1.45% (82 runs sampled) + */if(weakMapExists&&objPrototype===WeakMap.prototype){return'WeakMap';}/* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-dataview.prototype-@@tostringtag) + * ES6$24.2.4.21 - DataView.prototype[@@toStringTag] should be "DataView": + * Test: \`Object.prototype.toString.call(new DataView(new ArrayBuffer(1)))\`\` + * - Edge <=13 === "[object Object]" + */if(dataViewExists&&objPrototype===DataView.prototype){return'DataView';}/* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%mapiteratorprototype%-@@tostringtag) + * ES6$23.1.5.2.2 - %MapIteratorPrototype%[@@toStringTag] should be "Map Iterator": + * Test: \`Object.prototype.toString.call(new Map().entries())\`\` + * - Edge <=13 === "[object Object]" + */if(mapExists&&objPrototype===mapIteratorPrototype){return'Map Iterator';}/* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%setiteratorprototype%-@@tostringtag) + * ES6$23.2.5.2.2 - %SetIteratorPrototype%[@@toStringTag] should be "Set Iterator": + * Test: \`Object.prototype.toString.call(new Set().entries())\`\` + * - Edge <=13 === "[object Object]" + */if(setExists&&objPrototype===setIteratorPrototype){return'Set Iterator';}/* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%arrayiteratorprototype%-@@tostringtag) + * ES6$22.1.5.2.2 - %ArrayIteratorPrototype%[@@toStringTag] should be "Array Iterator": + * Test: \`Object.prototype.toString.call([][Symbol.iterator]())\`\` + * - Edge <=13 === "[object Object]" + */if(arrayIteratorExists&&objPrototype===arrayIteratorPrototype){return'Array Iterator';}/* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%stringiteratorprototype%-@@tostringtag) + * ES6$21.1.5.2.2 - %StringIteratorPrototype%[@@toStringTag] should be "String Iterator": + * Test: \`Object.prototype.toString.call(''[Symbol.iterator]())\`\` + * - Edge <=13 === "[object Object]" + */if(stringIteratorExists&&objPrototype===stringIteratorPrototype){return'String Iterator';}/* ! Speed optimisation + * Pre: + * object from null x 2,424,320 ops/sec ±1.67% (76 runs sampled) + * Post: + * object from null x 5,838,000 ops/sec ±0.99% (84 runs sampled) + */if(objPrototype===null){return'Object';}return Object.prototype.toString.call(obj).slice(toStringLeftSliceLength,toStringRightSliceLength);}return typeDetect;});})(typeDetect);var typeDetectExports=typeDetect.exports;var type=typeDetectExports;/** + * Returns the lower-case result of running type from type-detect on the value + * + * @param {*} value + * @returns {string} + */var typeOf=function typeOf(value){return type(value).toLowerCase();};/** + * Returns a string representation of the value + * + * @param {*} value + * @returns {string} + */function valueToString(value){if(value&&value.toString){// eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods +return value.toString();}return String(value);}var valueToString_1=valueToString;var lib={global:global$1,calledInOrder:calledInOrder_1,className:className_1,deprecated:deprecated,every:every,functionName:functionName$1,orderByFirstCall:orderByFirstCall_1,prototypes:prototypes,typeOf:typeOf,valueToString:valueToString_1};const globalObject=lib.global;let timersModule;if(typeof __vitest_required__!=='undefined'){try{timersModule=__vitest_required__.timers;}catch(e){// ignored +}}/** + * @typedef {object} IdleDeadline + * @property {boolean} didTimeout - whether or not the callback was called before reaching the optional timeout + * @property {function():number} timeRemaining - a floating-point value providing an estimate of the number of milliseconds remaining in the current idle period + */ /** + * Queues a function to be called during a browser's idle periods + * + * @callback RequestIdleCallback + * @param {function(IdleDeadline)} callback + * @param {{timeout: number}} options - an options object + * @returns {number} the id + */ /** + * @callback NextTick + * @param {VoidVarArgsFunc} callback - the callback to run + * @param {...*} arguments - optional arguments to call the callback with + * @returns {void} + */ /** + * @callback SetImmediate + * @param {VoidVarArgsFunc} callback - the callback to run + * @param {...*} arguments - optional arguments to call the callback with + * @returns {NodeImmediate} + */ /** + * @callback VoidVarArgsFunc + * @param {...*} callback - the callback to run + * @returns {void} + */ /** + * @typedef RequestAnimationFrame + * @property {function(number):void} requestAnimationFrame + * @returns {number} - the id + */ /** + * @typedef Performance + * @property {function(): number} now + */ /* eslint-disable jsdoc/require-property-description */ /** + * @typedef {object} Clock + * @property {number} now - the current time + * @property {Date} Date - the Date constructor + * @property {number} loopLimit - the maximum number of timers before assuming an infinite loop + * @property {RequestIdleCallback} requestIdleCallback + * @property {function(number):void} cancelIdleCallback + * @property {setTimeout} setTimeout + * @property {clearTimeout} clearTimeout + * @property {NextTick} nextTick + * @property {queueMicrotask} queueMicrotask + * @property {setInterval} setInterval + * @property {clearInterval} clearInterval + * @property {SetImmediate} setImmediate + * @property {function(NodeImmediate):void} clearImmediate + * @property {function():number} countTimers + * @property {RequestAnimationFrame} requestAnimationFrame + * @property {function(number):void} cancelAnimationFrame + * @property {function():void} runMicrotasks + * @property {function(string | number): number} tick + * @property {function(string | number): Promise} tickAsync + * @property {function(): number} next + * @property {function(): Promise} nextAsync + * @property {function(): number} runAll + * @property {function(): number} runToFrame + * @property {function(): Promise} runAllAsync + * @property {function(): number} runToLast + * @property {function(): Promise} runToLastAsync + * @property {function(): void} reset + * @property {function(number | Date): void} setSystemTime + * @property {function(number): void} jump + * @property {Performance} performance + * @property {function(number[]): number[]} hrtime - process.hrtime (legacy) + * @property {function(): void} uninstall Uninstall the clock. + * @property {Function[]} methods - the methods that are faked + * @property {boolean} [shouldClearNativeTimers] inherited from config + * @property {{methodName:string, original:any}[] | undefined} timersModuleMethods + */ /* eslint-enable jsdoc/require-property-description */ /** + * Configuration object for the \`install\` method. + * + * @typedef {object} Config + * @property {number|Date} [now] a number (in milliseconds) or a Date object (default epoch) + * @property {string[]} [toFake] names of the methods that should be faked. + * @property {number} [loopLimit] the maximum number of timers that will be run when calling runAll() + * @property {boolean} [shouldAdvanceTime] tells FakeTimers to increment mocked time automatically (default false) + * @property {number} [advanceTimeDelta] increment mocked time every <> ms (default: 20ms) + * @property {boolean} [shouldClearNativeTimers] forwards clear timer calls to native functions if they are not fakes (default: false) + */ /* eslint-disable jsdoc/require-property-description */ /** + * The internal structure to describe a scheduled fake timer + * + * @typedef {object} Timer + * @property {Function} func + * @property {*[]} args + * @property {number} delay + * @property {number} callAt + * @property {number} createdAt + * @property {boolean} immediate + * @property {number} id + * @property {Error} [error] + */ /** + * A Node timer + * + * @typedef {object} NodeImmediate + * @property {function(): boolean} hasRef + * @property {function(): NodeImmediate} ref + * @property {function(): NodeImmediate} unref + */ /* eslint-enable jsdoc/require-property-description */ /* eslint-disable complexity */ /** + * Mocks available features in the specified global namespace. + * + * @param {*} _global Namespace to mock (e.g. \`window\`) + * @returns {FakeTimers} + */function withGlobal(_global){const maxTimeout=Math.pow(2,31)-1;//see https://heycam.github.io/webidl/#abstract-opdef-converttoint +const idCounterStart=1e12;// arbitrarily large number to avoid collisions with native timer IDs +const NOOP=function(){return undefined;};const NOOP_ARRAY=function(){return[];};const timeoutResult=_global.setTimeout(NOOP,0);const addTimerReturnsObject=typeof timeoutResult==="object";const hrtimePresent=_global.process&&typeof _global.process.hrtime==="function";const hrtimeBigintPresent=hrtimePresent&&typeof _global.process.hrtime.bigint==="function";const nextTickPresent=_global.process&&typeof _global.process.nextTick==="function";const utilPromisify=_global.process&&_global.__vitest_required__&&_global.__vitest_required__.util.promisify;const performancePresent=_global.performance&&typeof _global.performance.now==="function";const hasPerformancePrototype=_global.Performance&&(typeof _global.Performance).match(/^(function|object)$/);const hasPerformanceConstructorPrototype=_global.performance&&_global.performance.constructor&&_global.performance.constructor.prototype;const queueMicrotaskPresent=_global.hasOwnProperty("queueMicrotask");const requestAnimationFramePresent=_global.requestAnimationFrame&&typeof _global.requestAnimationFrame==="function";const cancelAnimationFramePresent=_global.cancelAnimationFrame&&typeof _global.cancelAnimationFrame==="function";const requestIdleCallbackPresent=_global.requestIdleCallback&&typeof _global.requestIdleCallback==="function";const cancelIdleCallbackPresent=_global.cancelIdleCallback&&typeof _global.cancelIdleCallback==="function";const setImmediatePresent=_global.setImmediate&&typeof _global.setImmediate==="function";const intlPresent=_global.Intl&&typeof _global.Intl==="object";_global.clearTimeout(timeoutResult);const NativeDate=_global.Date;const NativeIntl=_global.Intl;let uniqueTimerId=idCounterStart;/** + * @param {number} num + * @returns {boolean} + */function isNumberFinite(num){if(Number.isFinite){return Number.isFinite(num);}return isFinite(num);}let isNearInfiniteLimit=false;/** + * @param {Clock} clock + * @param {number} i + */function checkIsNearInfiniteLimit(clock,i){if(clock.loopLimit&&i===clock.loopLimit-1){isNearInfiniteLimit=true;}}/** + * + */function resetIsNearInfiniteLimit(){isNearInfiniteLimit=false;}/** + * Parse strings like "01:10:00" (meaning 1 hour, 10 minutes, 0 seconds) into + * number of milliseconds. This is used to support human-readable strings passed + * to clock.tick() + * + * @param {string} str + * @returns {number} + */function parseTime(str){if(!str){return 0;}const strings=str.split(":");const l=strings.length;let i=l;let ms=0;let parsed;if(l>3||!/^(\\d\\d:){0,2}\\d\\d?$/.test(str)){throw new Error("tick only understands numbers, 'm:s' and 'h:m:s'. Each part must be two digits");}while(i--){parsed=parseInt(strings[i],10);if(parsed>=60){throw new Error(\`Invalid time \${str}\`);}ms+=parsed*Math.pow(60,l-i-1);}return ms*1000;}/** + * Get the decimal part of the millisecond value as nanoseconds + * + * @param {number} msFloat the number of milliseconds + * @returns {number} an integer number of nanoseconds in the range [0,1e6) + * + * Example: nanoRemainer(123.456789) -> 456789 + */function nanoRemainder(msFloat){const modulo=1e6;const remainder=msFloat*1e6%modulo;const positiveRemainder=remainder<0?remainder+modulo:remainder;return Math.floor(positiveRemainder);}/** + * Used to grok the \`now\` parameter to createClock. + * + * @param {Date|number} epoch the system time + * @returns {number} + */function getEpoch(epoch){if(!epoch){return 0;}if(typeof epoch.getTime==="function"){return epoch.getTime();}if(typeof epoch==="number"){return epoch;}throw new TypeError("now should be milliseconds since UNIX epoch");}/** + * @param {number} from + * @param {number} to + * @param {Timer} timer + * @returns {boolean} + */function inRange(from,to,timer){return timer&&timer.callAt>=from&&timer.callAt<=to;}/** + * @param {Clock} clock + * @param {Timer} job + */function getInfiniteLoopError(clock,job){const infiniteLoopError=new Error(\`Aborting after running \${clock.loopLimit} timers, assuming an infinite loop!\`);if(!job.error){return infiniteLoopError;}// pattern never matched in Node +const computedTargetPattern=/target\\.*[<|(|[].*?[>|\\]|)]\\s*/;let clockMethodPattern=new RegExp(String(Object.keys(clock).join("|")));if(addTimerReturnsObject){// node.js environment +clockMethodPattern=new RegExp(\`\\\\s+at (Object\\\\.)?(?:\${Object.keys(clock).join("|")})\\\\s+\`);}let matchedLineIndex=-1;job.error.stack.split("\\n").some(function(line,i){// If we've matched a computed target line (e.g. setTimeout) then we +// don't need to look any further. Return true to stop iterating. +const matchedComputedTarget=line.match(computedTargetPattern);/* istanbul ignore if */if(matchedComputedTarget){matchedLineIndex=i;return true;}// If we've matched a clock method line, then there may still be +// others further down the trace. Return false to keep iterating. +const matchedClockMethod=line.match(clockMethodPattern);if(matchedClockMethod){matchedLineIndex=i;return false;}// If we haven't matched anything on this line, but we matched +// previously and set the matched line index, then we can stop. +// If we haven't matched previously, then we should keep iterating. +return matchedLineIndex>=0;});const stack=\`\${infiniteLoopError}\\n\${job.type||"Microtask"} - \${job.func.name||"anonymous"}\\n\${job.error.stack.split("\\n").slice(matchedLineIndex+1).join("\\n")}\`;try{Object.defineProperty(infiniteLoopError,"stack",{value:stack});}catch(e){// noop +}return infiniteLoopError;}/** + * @param {Date} target + * @param {Date} source + * @returns {Date} the target after modifications + */function mirrorDateProperties(target,source){let prop;for(prop in source){if(source.hasOwnProperty(prop)){target[prop]=source[prop];}}// set special now implementation +if(source.now){target.now=function now(){return target.clock.now;};}else{delete target.now;}// set special toSource implementation +if(source.toSource){target.toSource=function toSource(){return source.toSource();};}else{delete target.toSource;}// set special toString implementation +target.toString=function toString(){return source.toString();};target.prototype=source.prototype;target.parse=source.parse;target.UTC=source.UTC;target.prototype.toUTCString=source.prototype.toUTCString;target.isFake=true;return target;}//eslint-disable-next-line jsdoc/require-jsdoc +function createDate(){/** + * @param {number} year + * @param {number} month + * @param {number} date + * @param {number} hour + * @param {number} minute + * @param {number} second + * @param {number} ms + * @returns {Date} + */function ClockDate(year,month,date,hour,minute,second,ms){// the Date constructor called as a function, ref Ecma-262 Edition 5.1, section 15.9.2. +// This remains so in the 10th edition of 2019 as well. +if(!(this instanceof ClockDate)){return new NativeDate(ClockDate.clock.now).toString();}// if Date is called as a constructor with 'new' keyword +// Defensive and verbose to avoid potential harm in passing +// explicit undefined when user does not pass argument +switch(arguments.length){case 0:return new NativeDate(ClockDate.clock.now);case 1:return new NativeDate(year);case 2:return new NativeDate(year,month);case 3:return new NativeDate(year,month,date);case 4:return new NativeDate(year,month,date,hour);case 5:return new NativeDate(year,month,date,hour,minute);case 6:return new NativeDate(year,month,date,hour,minute,second);default:return new NativeDate(year,month,date,hour,minute,second,ms);}}return mirrorDateProperties(ClockDate,NativeDate);}//eslint-disable-next-line jsdoc/require-jsdoc +function createIntl(){const ClockIntl=_objectSpread({},NativeIntl);ClockIntl.DateTimeFormat=function(...args){const realFormatter=new NativeIntl.DateTimeFormat(...args);const formatter={};["formatRange","formatRangeToParts","resolvedOptions"].forEach(method=>{formatter[method]=realFormatter[method].bind(realFormatter);});["format","formatToParts"].forEach(method=>{formatter[method]=function(date){return realFormatter[method](date||ClockIntl.clock.now);};});return formatter;};ClockIntl.DateTimeFormat.prototype=Object.create(NativeIntl.DateTimeFormat.prototype);ClockIntl.DateTimeFormat.supportedLocalesOf=NativeIntl.DateTimeFormat.supportedLocalesOf;return ClockIntl;}//eslint-disable-next-line jsdoc/require-jsdoc +function enqueueJob(clock,job){// enqueues a microtick-deferred task - ecma262/#sec-enqueuejob +if(!clock.jobs){clock.jobs=[];}clock.jobs.push(job);}//eslint-disable-next-line jsdoc/require-jsdoc +function runJobs(clock){// runs all microtick-deferred tasks - ecma262/#sec-runjobs +if(!clock.jobs){return;}for(let i=0;iclock.loopLimit){throw getInfiniteLoopError(clock,job);}}resetIsNearInfiniteLimit();clock.jobs=[];}/** + * @param {Clock} clock + * @param {Timer} timer + * @returns {number} id of the created timer + */function addTimer(clock,timer){if(timer.func===undefined){throw new Error("Callback must be provided to timer calls");}if(addTimerReturnsObject){// Node.js environment +if(typeof timer.func!=="function"){throw new TypeError(\`[ERR_INVALID_CALLBACK]: Callback must be a function. Received \${timer.func} of type \${typeof timer.func}\`);}}if(isNearInfiniteLimit){timer.error=new Error();}timer.type=timer.immediate?"Immediate":"Timeout";if(timer.hasOwnProperty("delay")){if(typeof timer.delay!=="number"){timer.delay=parseInt(timer.delay,10);}if(!isNumberFinite(timer.delay)){timer.delay=0;}timer.delay=timer.delay>maxTimeout?1:timer.delay;timer.delay=Math.max(0,timer.delay);}if(timer.hasOwnProperty("interval")){timer.type="Interval";timer.interval=timer.interval>maxTimeout?1:timer.interval;}if(timer.hasOwnProperty("animation")){timer.type="AnimationFrame";timer.animation=true;}if(timer.hasOwnProperty("idleCallback")){timer.type="IdleCallback";timer.idleCallback=true;}if(!clock.timers){clock.timers={};}timer.id=uniqueTimerId++;timer.createdAt=clock.now;timer.callAt=clock.now+(parseInt(timer.delay)||(clock.duringTick?1:0));clock.timers[timer.id]=timer;if(addTimerReturnsObject){const res={refed:true,ref:function(){this.refed=true;return res;},unref:function(){this.refed=false;return res;},hasRef:function(){return this.refed;},refresh:function(){timer.callAt=clock.now+(parseInt(timer.delay)||(clock.duringTick?1:0));// it _might_ have been removed, but if not the assignment is perfectly fine +clock.timers[timer.id]=timer;return res;},[Symbol.toPrimitive]:function(){return timer.id;}};return res;}return timer.id;}/* eslint consistent-return: "off" */ /** + * Timer comparitor + * + * @param {Timer} a + * @param {Timer} b + * @returns {number} + */function compareTimers(a,b){// Sort first by absolute timing +if(a.callAtb.callAt){return 1;}// Sort next by immediate, immediate timers take precedence +if(a.immediate&&!b.immediate){return-1;}if(!a.immediate&&b.immediate){return 1;}// Sort next by creation time, earlier-created timers take precedence +if(a.createdAtb.createdAt){return 1;}// Sort next by id, lower-id timers take precedence +if(a.idb.id){return 1;}// As timer ids are unique, no fallback \`0\` is necessary +}/** + * @param {Clock} clock + * @param {number} from + * @param {number} to + * @returns {Timer} + */function firstTimerInRange(clock,from,to){const timers=clock.timers;let timer=null;let id,isInRange;for(id in timers){if(timers.hasOwnProperty(id)){isInRange=inRange(from,to,timers[id]);if(isInRange&&(!timer||compareTimers(timer,timers[id])===1)){timer=timers[id];}}}return timer;}/** + * @param {Clock} clock + * @returns {Timer} + */function firstTimer(clock){const timers=clock.timers;let timer=null;let id;for(id in timers){if(timers.hasOwnProperty(id)){if(!timer||compareTimers(timer,timers[id])===1){timer=timers[id];}}}return timer;}/** + * @param {Clock} clock + * @returns {Timer} + */function lastTimer(clock){const timers=clock.timers;let timer=null;let id;for(id in timers){if(timers.hasOwnProperty(id)){if(!timer||compareTimers(timer,timers[id])===-1){timer=timers[id];}}}return timer;}/** + * @param {Clock} clock + * @param {Timer} timer + */function callTimer(clock,timer){if(typeof timer.interval==="number"){clock.timers[timer.id].callAt+=timer.interval;}else{delete clock.timers[timer.id];}if(typeof timer.func==="function"){timer.func.apply(null,timer.args);}else{/* eslint no-eval: "off" */const eval2=eval;(function(){eval2(timer.func);})();}}/** + * Gets clear handler name for a given timer type + * + * @param {string} ttype + */function getClearHandler(ttype){if(ttype==="IdleCallback"||ttype==="AnimationFrame"){return\`cancel\${ttype}\`;}return\`clear\${ttype}\`;}/** + * Gets schedule handler name for a given timer type + * + * @param {string} ttype + */function getScheduleHandler(ttype){if(ttype==="IdleCallback"||ttype==="AnimationFrame"){return\`request\${ttype}\`;}return\`set\${ttype}\`;}/** + * Creates an anonymous function to warn only once + */function createWarnOnce(){let calls=0;return function(msg){// eslint-disable-next-line +!calls++&&console.warn(msg);};}const warnOnce=createWarnOnce();/** + * @param {Clock} clock + * @param {number} timerId + * @param {string} ttype + */function clearTimer(clock,timerId,ttype){if(!timerId){// null appears to be allowed in most browsers, and appears to be +// relied upon by some libraries, like Bootstrap carousel +return;}if(!clock.timers){clock.timers={};}// in Node, the ID is stored as the primitive value for \`Timeout\` objects +// for \`Immediate\` objects, no ID exists, so it gets coerced to NaN +const id=Number(timerId);if(Number.isNaN(id)||id1e9){throw new TypeError("Number of nanoseconds can't exceed a billion");}const oldSecs=prev[0];let nanoDiff=remainderInNanos-prev[1];let secDiff=secsSinceStart-oldSecs;if(nanoDiff<0){nanoDiff+=1e9;secDiff-=1;}return[secDiff,nanoDiff];}return[secsSinceStart,remainderInNanos];}function fakePerformanceNow(){const hrt=hrtime();const millis=hrt[0]*1000+hrt[1]/1e6;return millis;}if(hrtimeBigintPresent){hrtime.bigint=function(){const parts=hrtime();return BigInt(parts[0])*BigInt(1e9)+BigInt(parts[1]);// eslint-disable-line +};}if(intlPresent){clock.Intl=createIntl();clock.Intl.clock=clock;}clock.requestIdleCallback=function requestIdleCallback(func,timeout){let timeToNextIdlePeriod=0;if(clock.countTimers()>0){timeToNextIdlePeriod=50;// const for now +}const result=addTimer(clock,{func:func,args:Array.prototype.slice.call(arguments,2),delay:typeof timeout==="undefined"?timeToNextIdlePeriod:Math.min(timeout,timeToNextIdlePeriod),idleCallback:true});return Number(result);};clock.cancelIdleCallback=function cancelIdleCallback(timerId){return clearTimer(clock,timerId,"IdleCallback");};clock.setTimeout=function setTimeout(func,timeout){return addTimer(clock,{func:func,args:Array.prototype.slice.call(arguments,2),delay:timeout});};if(typeof _global.Promise!=="undefined"&&utilPromisify){clock.setTimeout[utilPromisify.custom]=function promisifiedSetTimeout(timeout,arg){return new _global.Promise(function setTimeoutExecutor(resolve){addTimer(clock,{func:resolve,args:[arg],delay:timeout});});};}clock.clearTimeout=function clearTimeout(timerId){return clearTimer(clock,timerId,"Timeout");};clock.nextTick=function nextTick(func){return enqueueJob(clock,{func:func,args:Array.prototype.slice.call(arguments,1),error:isNearInfiniteLimit?new Error():null});};clock.queueMicrotask=function queueMicrotask(func){return clock.nextTick(func);// explicitly drop additional arguments +};clock.setInterval=function setInterval(func,timeout){// eslint-disable-next-line no-param-reassign +timeout=parseInt(timeout,10);return addTimer(clock,{func:func,args:Array.prototype.slice.call(arguments,2),delay:timeout,interval:timeout});};clock.clearInterval=function clearInterval(timerId){return clearTimer(clock,timerId,"Interval");};if(setImmediatePresent){clock.setImmediate=function setImmediate(func){return addTimer(clock,{func:func,args:Array.prototype.slice.call(arguments,1),immediate:true});};if(typeof _global.Promise!=="undefined"&&utilPromisify){clock.setImmediate[utilPromisify.custom]=function promisifiedSetImmediate(arg){return new _global.Promise(function setImmediateExecutor(resolve){addTimer(clock,{func:resolve,args:[arg],immediate:true});});};}clock.clearImmediate=function clearImmediate(timerId){return clearTimer(clock,timerId,"Immediate");};}clock.countTimers=function countTimers(){return Object.keys(clock.timers||{}).length+(clock.jobs||[]).length;};clock.requestAnimationFrame=function requestAnimationFrame(func){const result=addTimer(clock,{func:func,delay:getTimeToNextFrame(),get args(){return[fakePerformanceNow()];},animation:true});return Number(result);};clock.cancelAnimationFrame=function cancelAnimationFrame(timerId){return clearTimer(clock,timerId,"AnimationFrame");};clock.runMicrotasks=function runMicrotasks(){runJobs(clock);};/** + * @param {number|string} tickValue milliseconds or a string parseable by parseTime + * @param {boolean} isAsync + * @param {Function} resolve + * @param {Function} reject + * @returns {number|undefined} will return the new \`now\` value or nothing for async + */function doTick(tickValue,isAsync,resolve,reject){const msFloat=typeof tickValue==="number"?tickValue:parseTime(tickValue);const ms=Math.floor(msFloat);const remainder=nanoRemainder(msFloat);let nanosTotal=nanos+remainder;let tickTo=clock.now+ms;if(msFloat<0){throw new TypeError("Negative ticks are not supported");}// adjust for positive overflow +if(nanosTotal>=1e6){tickTo+=1;nanosTotal-=1e6;}nanos=nanosTotal;let tickFrom=clock.now;let previous=clock.now;// ESLint fails to detect this correctly +/* eslint-disable prefer-const */let timer,firstException,oldNow,nextPromiseTick,compensationCheck,postTimerCall;/* eslint-enable prefer-const */clock.duringTick=true;// perform microtasks +oldNow=clock.now;runJobs(clock);if(oldNow!==clock.now){// compensate for any setSystemTime() call during microtask callback +tickFrom+=clock.now-oldNow;tickTo+=clock.now-oldNow;}//eslint-disable-next-line jsdoc/require-jsdoc +function doTickInner(){// perform each timer in the requested range +timer=firstTimerInRange(clock,tickFrom,tickTo);// eslint-disable-next-line no-unmodified-loop-condition +while(timer&&tickFrom<=tickTo){if(clock.timers[timer.id]){tickFrom=timer.callAt;clock.now=timer.callAt;oldNow=clock.now;try{runJobs(clock);callTimer(clock,timer);}catch(e){firstException=firstException||e;}if(isAsync){// finish up after native setImmediate callback to allow +// all native es6 promises to process their callbacks after +// each timer fires. +originalSetTimeout(nextPromiseTick);return;}compensationCheck();}postTimerCall();}// perform process.nextTick()s again +oldNow=clock.now;runJobs(clock);if(oldNow!==clock.now){// compensate for any setSystemTime() call during process.nextTick() callback +tickFrom+=clock.now-oldNow;tickTo+=clock.now-oldNow;}clock.duringTick=false;// corner case: during runJobs new timers were scheduled which could be in the range [clock.now, tickTo] +timer=firstTimerInRange(clock,tickFrom,tickTo);if(timer){try{clock.tick(tickTo-clock.now);// do it all again - for the remainder of the requested range +}catch(e){firstException=firstException||e;}}else{// no timers remaining in the requested range: move the clock all the way to the end +clock.now=tickTo;// update nanos +nanos=nanosTotal;}if(firstException){throw firstException;}if(isAsync){resolve(clock.now);}else{return clock.now;}}nextPromiseTick=isAsync&&function(){try{compensationCheck();postTimerCall();doTickInner();}catch(e){reject(e);}};compensationCheck=function(){// compensate for any setSystemTime() call during timer callback +if(oldNow!==clock.now){tickFrom+=clock.now-oldNow;tickTo+=clock.now-oldNow;previous+=clock.now-oldNow;}};postTimerCall=function(){timer=firstTimerInRange(clock,previous,tickTo);previous=tickFrom;};return doTickInner();}/** + * @param {string|number} tickValue number of milliseconds or a human-readable value like "01:11:15" + * @returns {number} will return the new \`now\` value + */clock.tick=function tick(tickValue){return doTick(tickValue,false);};if(typeof _global.Promise!=="undefined"){/** + * @param {string|number} tickValue number of milliseconds or a human-readable value like "01:11:15" + * @returns {Promise} + */clock.tickAsync=function tickAsync(tickValue){return new _global.Promise(function(resolve,reject){originalSetTimeout(function(){try{doTick(tickValue,true,resolve,reject);}catch(e){reject(e);}});});};}clock.next=function next(){runJobs(clock);const timer=firstTimer(clock);if(!timer){return clock.now;}clock.duringTick=true;try{clock.now=timer.callAt;callTimer(clock,timer);runJobs(clock);return clock.now;}finally{clock.duringTick=false;}};if(typeof _global.Promise!=="undefined"){clock.nextAsync=function nextAsync(){return new _global.Promise(function(resolve,reject){originalSetTimeout(function(){try{const timer=firstTimer(clock);if(!timer){resolve(clock.now);return;}let err;clock.duringTick=true;clock.now=timer.callAt;try{callTimer(clock,timer);}catch(e){err=e;}clock.duringTick=false;originalSetTimeout(function(){if(err){reject(err);}else{resolve(clock.now);}});}catch(e){reject(e);}});});};}clock.runAll=function runAll(){let numTimers,i;runJobs(clock);for(i=0;itimer.callAt){timer.callAt=clock.now+ms;}}clock.tick(ms);};if(performancePresent){clock.performance=Object.create(null);clock.performance.now=fakePerformanceNow;}if(hrtimePresent){clock.hrtime=hrtime;}return clock;}/* eslint-disable complexity */ /** + * @param {Config=} [config] Optional config + * @returns {Clock} + */function install(config){if(arguments.length>1||config instanceof Date||Array.isArray(config)||typeof config==="number"){throw new TypeError(\`FakeTimers.install called with \${String(config)} install requires an object parameter\`);}if(_global.Date.isFake===true){// Timers are already faked; this is a problem. +// Make the user reset timers before continuing. +throw new TypeError("Can't install fake timers twice on the same global object.");}// eslint-disable-next-line no-param-reassign +config=typeof config!=="undefined"?config:{};config.shouldAdvanceTime=config.shouldAdvanceTime||false;config.advanceTimeDelta=config.advanceTimeDelta||20;config.shouldClearNativeTimers=config.shouldClearNativeTimers||false;if(config.target){throw new TypeError("config.target is no longer supported. Use \`withGlobal(target)\` instead.");}let i,l;const clock=createClock(config.now,config.loopLimit);clock.shouldClearNativeTimers=config.shouldClearNativeTimers;clock.uninstall=function(){return uninstall(clock,config);};clock.methods=config.toFake||[];if(clock.methods.length===0){// do not fake nextTick by default - GitHub#126 +clock.methods=Object.keys(timers).filter(function(key){return key!=="nextTick"&&key!=="queueMicrotask";});}if(config.shouldAdvanceTime===true){const intervalTick=doIntervalTick.bind(null,clock,config.advanceTimeDelta);const intervalId=_global.setInterval(intervalTick,config.advanceTimeDelta);clock.attachedInterval=intervalId;}if(clock.methods.includes("performance")){const proto=(()=>{if(hasPerformanceConstructorPrototype){return _global.performance.constructor.prototype;}if(hasPerformancePrototype){return _global.Performance.prototype;}})();if(proto){Object.getOwnPropertyNames(proto).forEach(function(name){if(name!=="now"){clock.performance[name]=name.indexOf("getEntries")===0?NOOP_ARRAY:NOOP;}});}else if((config.toFake||[]).includes("performance")){// user explicitly tried to fake performance when not present +throw new ReferenceError("non-existent performance object cannot be faked");}}if(_global===globalObject&&timersModule){clock.timersModuleMethods=[];}for(i=0,l=clock.methods.length;i0;i--){this._clock.next();this._clock.tick(0);if(this._clock.countTimers()===0)break;}}}async advanceTimersToNextTimerAsync(steps=1){if(this._checkFakeTimers()){for(let i=steps;i>0;i--){await this._clock.nextAsync();this._clock.tick(0);if(this._clock.countTimers()===0)break;}}}advanceTimersByTime(msToRun){if(this._checkFakeTimers())this._clock.tick(msToRun);}async advanceTimersByTimeAsync(msToRun){if(this._checkFakeTimers())await this._clock.tickAsync(msToRun);}runAllTicks(){if(this._checkFakeTimers()){this._clock.runMicrotasks();}}useRealTimers(){if(this._fakingDate){resetDate();this._fakingDate=false;}if(this._fakingTime){this._clock.uninstall();this._fakingTime=false;}}useFakeTimers(){var _a,_b,_c;if(this._fakingDate){throw new Error('"setSystemTime" was called already and date was mocked. Reset timers using \`vi.useRealTimers()\` if you want to use fake timers again.');}if(!this._fakingTime){const toFake=Object.keys(this._fakeTimers.timers).filter(timer=>timer!=="nextTick");if(((_b=(_a=this._userConfig)==null?void 0:_a.toFake)==null?void 0:_b.includes("nextTick"))&&isChildProcess())throw new Error("process.nextTick cannot be mocked inside child_process");const existingFakedMethods=(((_c=this._userConfig)==null?void 0:_c.toFake)||toFake).filter(method=>{switch(method){case"setImmediate":case"clearImmediate":return method in this._global&&this._global[method];default:return true;}});this._clock=this._fakeTimers.install(_objectSpread(_objectSpread({now:Date.now()},this._userConfig),{},{toFake:existingFakedMethods}));this._fakingTime=true;}}reset(){if(this._checkFakeTimers()){const now=this._clock.now;this._clock.reset();this._clock.setSystemTime(now);}}setSystemTime(now){if(this._fakingTime){this._clock.setSystemTime(now);}else{mockDate(now??this.getRealSystemTime());this._fakingDate=true;}}getRealSystemTime(){return this._now();}getTimerCount(){if(this._checkFakeTimers())return this._clock.countTimers();return 0;}configure(config){this._userConfig=config;}isFakeTimers(){return this._fakingTime;}_checkFakeTimers(){if(!this._fakingTime){throw new Error('Timers are not mocked. Try calling "vi.useFakeTimers()" first.');}return this._fakingTime;}}function copyStackTrace(target,source){if(source.stack!==void 0)target.stack=source.stack.replace(source.message,target.message);return target;}function waitFor(callback,options={}){const _getSafeTimers3=getSafeTimers(),setTimeout=_getSafeTimers3.setTimeout,setInterval=_getSafeTimers3.setInterval,clearTimeout=_getSafeTimers3.clearTimeout,clearInterval=_getSafeTimers3.clearInterval;const _ref12=typeof options==="number"?{timeout:options}:options,_ref12$interval=_ref12.interval,interval=_ref12$interval===void 0?50:_ref12$interval,_ref12$timeout=_ref12.timeout,timeout=_ref12$timeout===void 0?1e3:_ref12$timeout;const STACK_TRACE_ERROR=new Error("STACK_TRACE_ERROR");return new Promise((resolve,reject)=>{let lastError;let promiseStatus="idle";let timeoutId;let intervalId;const onResolve=result=>{if(timeoutId)clearTimeout(timeoutId);if(intervalId)clearInterval(intervalId);resolve(result);};const handleTimeout=()=>{let error=lastError;if(!error)error=copyStackTrace(new Error("Timed out in waitFor!"),STACK_TRACE_ERROR);reject(error);};const checkCallback=()=>{if(vi.isFakeTimers())vi.advanceTimersByTime(interval);if(promiseStatus==="pending")return;try{const result=callback();if(result!==null&&typeof result==="object"&&typeof result.then==="function"){const thenable=result;promiseStatus="pending";thenable.then(resolvedValue=>{promiseStatus="resolved";onResolve(resolvedValue);},rejectedValue=>{promiseStatus="rejected";lastError=rejectedValue;});}else{onResolve(result);return true;}}catch(error){lastError=error;}};if(checkCallback()===true)return;timeoutId=setTimeout(handleTimeout,timeout);intervalId=setInterval(checkCallback,interval);});}function waitUntil(callback,options={}){const _getSafeTimers4=getSafeTimers(),setTimeout=_getSafeTimers4.setTimeout,setInterval=_getSafeTimers4.setInterval,clearTimeout=_getSafeTimers4.clearTimeout,clearInterval=_getSafeTimers4.clearInterval;const _ref13=typeof options==="number"?{timeout:options}:options,_ref13$interval=_ref13.interval,interval=_ref13$interval===void 0?50:_ref13$interval,_ref13$timeout=_ref13.timeout,timeout=_ref13$timeout===void 0?1e3:_ref13$timeout;const STACK_TRACE_ERROR=new Error("STACK_TRACE_ERROR");return new Promise((resolve,reject)=>{let promiseStatus="idle";let timeoutId;let intervalId;const onReject=error=>{if(!error)error=copyStackTrace(new Error("Timed out in waitUntil!"),STACK_TRACE_ERROR);reject(error);};const onResolve=result=>{if(!result)return;if(timeoutId)clearTimeout(timeoutId);if(intervalId)clearInterval(intervalId);resolve(result);return true;};const checkCallback=()=>{if(vi.isFakeTimers())vi.advanceTimersByTime(interval);if(promiseStatus==="pending")return;try{const result=callback();if(result!==null&&typeof result==="object"&&typeof result.then==="function"){const thenable=result;promiseStatus="pending";thenable.then(resolvedValue=>{promiseStatus="resolved";onResolve(resolvedValue);},rejectedValue=>{promiseStatus="rejected";onReject(rejectedValue);});}else{return onResolve(result);}}catch(error){onReject(error);}};if(checkCallback()===true)return;timeoutId=setTimeout(onReject,timeout);intervalId=setInterval(checkCallback,interval);});}function createVitest(){const _mocker=typeof __vitest_mocker__!=="undefined"?__vitest_mocker__:new Proxy({},{get(_,name){throw new Error(\`Vitest mocker was not initialized in this environment. vi.\${String(name)}() is forbidden.\`);}});let _mockedDate=null;let _config=null;const workerState=getWorkerState();const _timers=new FakeTimers({global:globalThis,config:workerState.config.fakeTimers});const _stubsGlobal=/* @__PURE__ */new Map();const _stubsEnv=/* @__PURE__ */new Map();const getImporter=()=>{const stackTrace=createSimpleStackTrace({stackTraceLimit:4});const importerStack=stackTrace.split("\\n")[4];const stack=parseSingleStack(importerStack);return(stack==null?void 0:stack.file)||"";};const utils={useFakeTimers(config){var _a,_b,_c,_d;if(isChildProcess()){if(((_a=config==null?void 0:config.toFake)==null?void 0:_a.includes("nextTick"))||((_d=(_c=(_b=workerState.config)==null?void 0:_b.fakeTimers)==null?void 0:_c.toFake)==null?void 0:_d.includes("nextTick"))){throw new Error('vi.useFakeTimers({ toFake: ["nextTick"] }) is not supported in node:child_process. Use --pool=threads if mocking nextTick is required.');}}if(config)_timers.configure(_objectSpread(_objectSpread({},workerState.config.fakeTimers),config));else _timers.configure(workerState.config.fakeTimers);_timers.useFakeTimers();return utils;},isFakeTimers(){return _timers.isFakeTimers();},useRealTimers(){_timers.useRealTimers();_mockedDate=null;return utils;},runOnlyPendingTimers(){_timers.runOnlyPendingTimers();return utils;},async runOnlyPendingTimersAsync(){await _timers.runOnlyPendingTimersAsync();return utils;},runAllTimers(){_timers.runAllTimers();return utils;},async runAllTimersAsync(){await _timers.runAllTimersAsync();return utils;},runAllTicks(){_timers.runAllTicks();return utils;},advanceTimersByTime(ms){_timers.advanceTimersByTime(ms);return utils;},async advanceTimersByTimeAsync(ms){await _timers.advanceTimersByTimeAsync(ms);return utils;},advanceTimersToNextTimer(){_timers.advanceTimersToNextTimer();return utils;},async advanceTimersToNextTimerAsync(){await _timers.advanceTimersToNextTimerAsync();return utils;},getTimerCount(){return _timers.getTimerCount();},setSystemTime(time){const date=time instanceof Date?time:new Date(time);_mockedDate=date;_timers.setSystemTime(date);return utils;},getMockedSystemTime(){return _mockedDate;},getRealSystemTime(){return _timers.getRealSystemTime();},clearAllTimers(){_timers.clearAllTimers();return utils;},// mocks +spyOn,fn,waitFor,waitUntil,hoisted(factory){assertTypes(factory,'"vi.hoisted" factory',["function"]);return factory();},mock(path,factory){const importer=getImporter();_mocker.queueMock(path,importer,factory?()=>factory(()=>_mocker.importActual(path,importer,_mocker.getMockContext().callstack)):void 0,true);},unmock(path){_mocker.queueUnmock(path,getImporter());},doMock(path,factory){const importer=getImporter();_mocker.queueMock(path,importer,factory?()=>factory(()=>_mocker.importActual(path,importer,_mocker.getMockContext().callstack)):void 0,false);},doUnmock(path){_mocker.queueUnmock(path,getImporter());},async importActual(path){return _mocker.importActual(path,getImporter(),_mocker.getMockContext().callstack);},async importMock(path){return _mocker.importMock(path,getImporter());},// this is typed in the interface so it's not necessary to type it here +mocked(item,_options={}){return item;},isMockFunction(fn2){return isMockFunction(fn2);},clearAllMocks(){mocks.forEach(spy=>spy.mockClear());return utils;},resetAllMocks(){mocks.forEach(spy=>spy.mockReset());return utils;},restoreAllMocks(){mocks.forEach(spy=>spy.mockRestore());return utils;},stubGlobal(name,value){if(!_stubsGlobal.has(name))_stubsGlobal.set(name,Object.getOwnPropertyDescriptor(globalThis,name));Object.defineProperty(globalThis,name,{value,writable:true,configurable:true,enumerable:true});return utils;},stubEnv(name,value){if(!_stubsEnv.has(name))_stubsEnv.set(name,process.env[name]);process.env[name]=value;return utils;},unstubAllGlobals(){_stubsGlobal.forEach((original,name)=>{if(!original)Reflect.deleteProperty(globalThis,name);else Object.defineProperty(globalThis,name,original);});_stubsGlobal.clear();return utils;},unstubAllEnvs(){_stubsEnv.forEach((original,name)=>{if(original===void 0)delete process.env[name];else process.env[name]=original;});_stubsEnv.clear();return utils;},resetModules(){resetModules(workerState.moduleCache);return utils;},async dynamicImportSettled(){return waitForImportsToResolve();},setConfig(config){if(!_config)_config=_objectSpread({},workerState.config);Object.assign(workerState.config,config);},resetConfig(){if(_config)Object.assign(workerState.config,_config);}};return utils;}const vitest=createVitest();const vi=vitest;class Spy{called=false;mock=()=>{};method(){}}function spy(){const inst=new Spy();return vi.fn(inst.mock);}async function wait(){}exports.spy=spy;exports.wait=wait; //# sourceMappingURL=test.js.map -", -] +" `; -exports[`Outputs (babel) artifacts builds all the artifacts with rollup 6`] = ` -[ - "package.json", - { - "browser": "./umd/client.js", - "dependencies": { - "typescript": "*", - }, - "main": "./lib/index.js", - "module": "./esm/client.js", - "name": "project-rollup", - "packemon": { - "inputs": { - "client": "src/client.ts", - "index": "src/index.ts", - "server": "src/server/core.ts", - "test": "src/test-utils/base.ts", - }, - }, - }, -] -`; - -exports[`Outputs (babel) artifacts builds all the artifacts with rollup 7`] = ` -[ - "umd/client.js", - "(function (global, factory) { +exports[`Outputs (babel) > artifacts > builds all the artifacts with rollup > umd/client.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define("Packemon", ["exports"], factory); } else if (typeof exports !== "undefined") { @@ -482,11 +8826,10 @@ exports[`Outputs (babel) artifacts builds all the artifacts with rollup 7`] = ` } }); //# sourceMappingURL=client.js.map -", -] +" `; -exports[`Outputs (babel) artifacts builds all the artifacts with rollup 8`] = ` +exports[`Outputs (babel) > artifacts > builds all the artifacts with rollup 1`] = ` [ { "format": "lib", @@ -497,10 +8840,8 @@ exports[`Outputs (babel) artifacts builds all the artifacts with rollup 8`] = ` ] `; -exports[`Outputs (babel) bundle bundles all files into a single file with rollup 1`] = ` -[ - "lib/index.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Outputs (babel) > bundle > bundles all files into a single file with rollup > lib/index.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: lib 'use strict'; @@ -510,28 +8851,29 @@ function bar() {} exports.bar = bar; exports.foo = foo; //# sourceMappingURL=index.js.map -", -] +" `; -exports[`Outputs (babel) bundle bundles all files into a single file with rollup 2`] = ` -[ - "package.json", - { - "main": "./lib/index.js", - "name": "project-bundle", - "packemon": { - "bundle": true, - "platform": "node", - }, - }, -] +exports[`Outputs (babel) > bundle with assets > bundles all files and references assets (browser, esm) > ../assets/fonts-4e5dc96c.css 1`] = ` +"@font-face { +} +" `; -exports[`Outputs (babel) bundle with assets bundles all files and references assets (browser, esm) 1`] = ` -[ - "esm/index.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Outputs (babel) > bundle with assets > bundles all files and references assets (browser, esm) > ../assets/globals-107ab52e.css 1`] = ` +"html { +} +" +`; + +exports[`Outputs (babel) > bundle with assets > bundles all files and references assets (browser, esm) > ../assets/styles-b11c3a83.css 1`] = ` +".button { +} +" +`; + +exports[`Outputs (babel) > bundle with assets > bundles all files and references assets (browser, esm) > esm/index.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: esm import '../assets/globals-107ab52e.css'; @@ -540,50 +8882,29 @@ import '../assets/styles-b11c3a83.css'; function button() {} export { button }; //# sourceMappingURL=index.js.map -", -] -`; - -exports[`Outputs (babel) bundle with assets bundles all files and references assets (browser, esm) 2`] = ` -[ - "package.json", - { - "main": "./esm/index.js", - "module": "./esm/index.js", - "name": "project-assets", - "packemon": { - "bundle": true, - "platform": "node", - }, - }, -] +" `; -exports[`Outputs (babel) bundle with assets bundles all files and references assets (browser, esm) 3`] = ` -[ - "src/button/styles.css", - "assets/styles-b11c3a83.css", -] +exports[`Outputs (babel) > bundle with assets > bundles all files and references assets (browser, lib) > ../assets/fonts-4e5dc96c.css 1`] = ` +"@font-face { +} +" `; -exports[`Outputs (babel) bundle with assets bundles all files and references assets (browser, esm) 4`] = ` -[ - "src/globals.css", - "assets/globals-107ab52e.css", -] +exports[`Outputs (babel) > bundle with assets > bundles all files and references assets (browser, lib) > ../assets/globals-107ab52e.css 1`] = ` +"html { +} +" `; -exports[`Outputs (babel) bundle with assets bundles all files and references assets (browser, esm) 5`] = ` -[ - "src/shared/fonts.css", - "assets/fonts-4e5dc96c.css", -] +exports[`Outputs (babel) > bundle with assets > bundles all files and references assets (browser, lib) > ../assets/styles-b11c3a83.css 1`] = ` +".button { +} +" `; -exports[`Outputs (babel) bundle with assets bundles all files and references assets (browser, lib) 1`] = ` -[ - "lib/index.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Outputs (babel) > bundle with assets > bundles all files and references assets (browser, lib) > lib/index.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: lib 'use strict'; @@ -594,85 +8915,29 @@ require('../assets/styles-b11c3a83.css'); function button() {} exports.button = button; //# sourceMappingURL=index.js.map -", -] -`; - -exports[`Outputs (babel) bundle with assets bundles all files and references assets (browser, lib) 2`] = ` -[ - "package.json", - { - "main": "./lib/index.js", - "name": "project-assets", - "packemon": { - "bundle": true, - "platform": "node", - }, - }, -] -`; - -exports[`Outputs (babel) bundle with assets bundles all files and references assets (browser, lib) 3`] = ` -[ - "src/button/styles.css", - "assets/styles-b11c3a83.css", -] +" `; -exports[`Outputs (babel) bundle with assets bundles all files and references assets (browser, lib) 4`] = ` -[ - "src/globals.css", - "assets/globals-107ab52e.css", -] -`; - -exports[`Outputs (babel) bundle with assets bundles all files and references assets (browser, lib) 5`] = ` -[ - "src/shared/fonts.css", - "assets/fonts-4e5dc96c.css", -] -`; - -exports[`Outputs (babel) bundle with assets bundles all files and references assets (browser, umd) 1`] = ` -[ - "package.json", - { - "browser": "./umd/index.js", - "main": "./lib/index.js", - "name": "project-assets", - "packemon": { - "bundle": true, - "platform": "node", - }, - }, -] -`; - -exports[`Outputs (babel) bundle with assets bundles all files and references assets (browser, umd) 2`] = ` -[ - "src/button/styles.css", - "assets/styles-b11c3a83.css", -] +exports[`Outputs (babel) > bundle with assets > bundles all files and references assets (browser, umd) > ../assets/fonts-4e5dc96c.css 1`] = ` +"@font-face { +} +" `; -exports[`Outputs (babel) bundle with assets bundles all files and references assets (browser, umd) 3`] = ` -[ - "src/globals.css", - "assets/globals-107ab52e.css", -] +exports[`Outputs (babel) > bundle with assets > bundles all files and references assets (browser, umd) > ../assets/globals-107ab52e.css 1`] = ` +"html { +} +" `; -exports[`Outputs (babel) bundle with assets bundles all files and references assets (browser, umd) 4`] = ` -[ - "src/shared/fonts.css", - "assets/fonts-4e5dc96c.css", -] +exports[`Outputs (babel) > bundle with assets > bundles all files and references assets (browser, umd) > ../assets/styles-b11c3a83.css 1`] = ` +".button { +} +" `; -exports[`Outputs (babel) bundle with assets bundles all files and references assets (browser, umd) 5`] = ` -[ - "umd/index.js", - "(function (global, factory) { +exports[`Outputs (babel) > bundle with assets > bundles all files and references assets (browser, umd) > umd/index.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports", "../assets/globals-107ab52e.css", "../assets/fonts-4e5dc96c.css", "../assets/styles-b11c3a83.css"], factory); } else if (typeof exports !== "undefined") { @@ -697,14 +8962,29 @@ exports[`Outputs (babel) bundle with assets bundles all files and references ass function button() {} }); //# sourceMappingURL=index.js.map -", -] +" `; -exports[`Outputs (babel) bundle with assets bundles all files and references assets (electron, esm) 1`] = ` -[ - "esm/index.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Outputs (babel) > bundle with assets > bundles all files and references assets (electron, esm) > ../assets/fonts-4e5dc96c.css 1`] = ` +"@font-face { +} +" +`; + +exports[`Outputs (babel) > bundle with assets > bundles all files and references assets (electron, esm) > ../assets/globals-107ab52e.css 1`] = ` +"html { +} +" +`; + +exports[`Outputs (babel) > bundle with assets > bundles all files and references assets (electron, esm) > ../assets/styles-b11c3a83.css 1`] = ` +".button { +} +" +`; + +exports[`Outputs (babel) > bundle with assets > bundles all files and references assets (electron, esm) > esm/index.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: esm import '../assets/globals-107ab52e.css'; @@ -713,50 +8993,29 @@ import '../assets/styles-b11c3a83.css'; function button() {} export { button }; //# sourceMappingURL=index.js.map -", -] -`; - -exports[`Outputs (babel) bundle with assets bundles all files and references assets (electron, esm) 2`] = ` -[ - "package.json", - { - "main": "./esm/index.js", - "module": "./esm/index.js", - "name": "project-assets", - "packemon": { - "bundle": true, - "platform": "node", - }, - }, -] +" `; -exports[`Outputs (babel) bundle with assets bundles all files and references assets (electron, esm) 3`] = ` -[ - "src/button/styles.css", - "assets/styles-b11c3a83.css", -] +exports[`Outputs (babel) > bundle with assets > bundles all files and references assets (electron, lib) > ../assets/fonts-4e5dc96c.css 1`] = ` +"@font-face { +} +" `; -exports[`Outputs (babel) bundle with assets bundles all files and references assets (electron, esm) 4`] = ` -[ - "src/globals.css", - "assets/globals-107ab52e.css", -] +exports[`Outputs (babel) > bundle with assets > bundles all files and references assets (electron, lib) > ../assets/globals-107ab52e.css 1`] = ` +"html { +} +" `; -exports[`Outputs (babel) bundle with assets bundles all files and references assets (electron, esm) 5`] = ` -[ - "src/shared/fonts.css", - "assets/fonts-4e5dc96c.css", -] +exports[`Outputs (babel) > bundle with assets > bundles all files and references assets (electron, lib) > ../assets/styles-b11c3a83.css 1`] = ` +".button { +} +" `; -exports[`Outputs (babel) bundle with assets bundles all files and references assets (electron, lib) 1`] = ` -[ - "lib/index.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Outputs (babel) > bundle with assets > bundles all files and references assets (electron, lib) > lib/index.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: lib 'use strict'; @@ -767,49 +9026,29 @@ require('../assets/styles-b11c3a83.css'); function button() {} exports.button = button; //# sourceMappingURL=index.js.map -", -] -`; - -exports[`Outputs (babel) bundle with assets bundles all files and references assets (electron, lib) 2`] = ` -[ - "package.json", - { - "main": "./lib/index.js", - "name": "project-assets", - "packemon": { - "bundle": true, - "platform": "node", - }, - }, -] +" `; -exports[`Outputs (babel) bundle with assets bundles all files and references assets (electron, lib) 3`] = ` -[ - "src/button/styles.css", - "assets/styles-b11c3a83.css", -] +exports[`Outputs (babel) > bundle with assets > bundles all files and references assets (native, lib) > ../assets/fonts-4e5dc96c.css 1`] = ` +"@font-face { +} +" `; -exports[`Outputs (babel) bundle with assets bundles all files and references assets (electron, lib) 4`] = ` -[ - "src/globals.css", - "assets/globals-107ab52e.css", -] +exports[`Outputs (babel) > bundle with assets > bundles all files and references assets (native, lib) > ../assets/globals-107ab52e.css 1`] = ` +"html { +} +" `; -exports[`Outputs (babel) bundle with assets bundles all files and references assets (electron, lib) 5`] = ` -[ - "src/shared/fonts.css", - "assets/fonts-4e5dc96c.css", -] +exports[`Outputs (babel) > bundle with assets > bundles all files and references assets (native, lib) > ../assets/styles-b11c3a83.css 1`] = ` +".button { +} +" `; -exports[`Outputs (babel) bundle with assets bundles all files and references assets (native, lib) 1`] = ` -[ - "lib/index.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Outputs (babel) > bundle with assets > bundles all files and references assets (native, lib) > lib/index.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: stable, Format: lib 'use strict'; @@ -820,49 +9059,29 @@ require('../assets/styles-b11c3a83.css'); function button() {} exports.button = button; //# sourceMappingURL=index.js.map -", -] -`; - -exports[`Outputs (babel) bundle with assets bundles all files and references assets (native, lib) 2`] = ` -[ - "package.json", - { - "main": "./lib/index.js", - "name": "project-assets", - "packemon": { - "bundle": true, - "platform": "node", - }, - }, -] +" `; -exports[`Outputs (babel) bundle with assets bundles all files and references assets (native, lib) 3`] = ` -[ - "src/button/styles.css", - "assets/styles-b11c3a83.css", -] +exports[`Outputs (babel) > bundle with assets > bundles all files and references assets (node, cjs) > ../assets/fonts-4e5dc96c.css 1`] = ` +"@font-face { +} +" `; -exports[`Outputs (babel) bundle with assets bundles all files and references assets (native, lib) 4`] = ` -[ - "src/globals.css", - "assets/globals-107ab52e.css", -] +exports[`Outputs (babel) > bundle with assets > bundles all files and references assets (node, cjs) > ../assets/globals-107ab52e.css 1`] = ` +"html { +} +" `; -exports[`Outputs (babel) bundle with assets bundles all files and references assets (native, lib) 5`] = ` -[ - "src/shared/fonts.css", - "assets/fonts-4e5dc96c.css", -] +exports[`Outputs (babel) > bundle with assets > bundles all files and references assets (node, cjs) > ../assets/styles-b11c3a83.css 1`] = ` +".button { +} +" `; -exports[`Outputs (babel) bundle with assets bundles all files and references assets (node, cjs) 1`] = ` -[ - "cjs/index.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Outputs (babel) > bundle with assets > bundles all files and references assets (node, cjs) > cjs/index.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: cjs 'use strict'; @@ -873,49 +9092,38 @@ require('../assets/styles-b11c3a83.css'); function button() {} exports.button = button; //# sourceMappingURL=index.cjs.map -", -] +" `; -exports[`Outputs (babel) bundle with assets bundles all files and references assets (node, cjs) 2`] = ` -[ - "package.json", - { - "main": "./cjs/index.cjs", - "name": "project-assets", - "packemon": { - "bundle": true, - "platform": "node", - }, - }, -] +exports[`Outputs (babel) > bundle with assets > bundles all files and references assets (node, cjs) > cjs/index-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index.cjs'; + +export const { button } = data;" `; -exports[`Outputs (babel) bundle with assets bundles all files and references assets (node, cjs) 3`] = ` -[ - "src/button/styles.css", - "assets/styles-b11c3a83.css", -] +exports[`Outputs (babel) > bundle with assets > bundles all files and references assets (node, lib) > ../assets/fonts-4e5dc96c.css 1`] = ` +"@font-face { +} +" `; -exports[`Outputs (babel) bundle with assets bundles all files and references assets (node, cjs) 4`] = ` -[ - "src/globals.css", - "assets/globals-107ab52e.css", -] +exports[`Outputs (babel) > bundle with assets > bundles all files and references assets (node, lib) > ../assets/globals-107ab52e.css 1`] = ` +"html { +} +" `; -exports[`Outputs (babel) bundle with assets bundles all files and references assets (node, cjs) 5`] = ` -[ - "src/shared/fonts.css", - "assets/fonts-4e5dc96c.css", -] +exports[`Outputs (babel) > bundle with assets > bundles all files and references assets (node, lib) > ../assets/styles-b11c3a83.css 1`] = ` +".button { +} +" `; -exports[`Outputs (babel) bundle with assets bundles all files and references assets (node, lib) 1`] = ` -[ - "lib/index.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Outputs (babel) > bundle with assets > bundles all files and references assets (node, lib) > lib/index.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: lib 'use strict'; @@ -926,49 +9134,29 @@ require('../assets/styles-b11c3a83.css'); function button() {} exports.button = button; //# sourceMappingURL=index.js.map -", -] -`; - -exports[`Outputs (babel) bundle with assets bundles all files and references assets (node, lib) 2`] = ` -[ - "package.json", - { - "main": "./lib/index.js", - "name": "project-assets", - "packemon": { - "bundle": true, - "platform": "node", - }, - }, -] +" `; -exports[`Outputs (babel) bundle with assets bundles all files and references assets (node, lib) 3`] = ` -[ - "src/button/styles.css", - "assets/styles-b11c3a83.css", -] +exports[`Outputs (babel) > bundle with assets > bundles all files and references assets (node, mjs) > ../assets/fonts-4e5dc96c.css 1`] = ` +"@font-face { +} +" `; -exports[`Outputs (babel) bundle with assets bundles all files and references assets (node, lib) 4`] = ` -[ - "src/globals.css", - "assets/globals-107ab52e.css", -] +exports[`Outputs (babel) > bundle with assets > bundles all files and references assets (node, mjs) > ../assets/globals-107ab52e.css 1`] = ` +"html { +} +" `; -exports[`Outputs (babel) bundle with assets bundles all files and references assets (node, lib) 5`] = ` -[ - "src/shared/fonts.css", - "assets/fonts-4e5dc96c.css", -] +exports[`Outputs (babel) > bundle with assets > bundles all files and references assets (node, mjs) > ../assets/styles-b11c3a83.css 1`] = ` +".button { +} +" `; -exports[`Outputs (babel) bundle with assets bundles all files and references assets (node, mjs) 1`] = ` -[ - "mjs/index.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Outputs (babel) > bundle with assets > bundles all files and references assets (node, mjs) > mjs/index.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: mjs import '../assets/globals-107ab52e.css'; @@ -977,49 +9165,65 @@ import '../assets/styles-b11c3a83.css'; function button() {} export { button }; //# sourceMappingURL=index.mjs.map -", -] +" `; -exports[`Outputs (babel) bundle with assets bundles all files and references assets (node, mjs) 2`] = ` -[ - "package.json", - { - "main": "./mjs/index.mjs", - "name": "project-assets", - "packemon": { - "bundle": true, - "platform": "node", - }, - }, -] +exports[`Outputs (babel) > bundle with assets > uses same assets across multiple formats > ../assets/fonts-4e5dc96c.css 1`] = ` +"@font-face { +} +" `; -exports[`Outputs (babel) bundle with assets bundles all files and references assets (node, mjs) 3`] = ` -[ - "src/button/styles.css", - "assets/styles-b11c3a83.css", -] +exports[`Outputs (babel) > bundle with assets > uses same assets across multiple formats > ../assets/fonts-4e5dc96c.css 2`] = ` +"@font-face { +} +" `; -exports[`Outputs (babel) bundle with assets bundles all files and references assets (node, mjs) 4`] = ` -[ - "src/globals.css", - "assets/globals-107ab52e.css", -] +exports[`Outputs (babel) > bundle with assets > uses same assets across multiple formats > ../assets/fonts-4e5dc96c.css 3`] = ` +"@font-face { +} +" `; -exports[`Outputs (babel) bundle with assets bundles all files and references assets (node, mjs) 5`] = ` -[ - "src/shared/fonts.css", - "assets/fonts-4e5dc96c.css", -] +exports[`Outputs (babel) > bundle with assets > uses same assets across multiple formats > ../assets/globals-107ab52e.css 1`] = ` +"html { +} +" `; -exports[`Outputs (babel) bundle with assets uses same assets across multiple formats 1`] = ` -[ - "cjs/index.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Outputs (babel) > bundle with assets > uses same assets across multiple formats > ../assets/globals-107ab52e.css 2`] = ` +"html { +} +" +`; + +exports[`Outputs (babel) > bundle with assets > uses same assets across multiple formats > ../assets/globals-107ab52e.css 3`] = ` +"html { +} +" +`; + +exports[`Outputs (babel) > bundle with assets > uses same assets across multiple formats > ../assets/styles-b11c3a83.css 1`] = ` +".button { +} +" +`; + +exports[`Outputs (babel) > bundle with assets > uses same assets across multiple formats > ../assets/styles-b11c3a83.css 2`] = ` +".button { +} +" +`; + +exports[`Outputs (babel) > bundle with assets > uses same assets across multiple formats > ../assets/styles-b11c3a83.css 3`] = ` +".button { +} +" +`; + +exports[`Outputs (babel) > bundle with assets > uses same assets across multiple formats > cjs/index.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: cjs 'use strict'; @@ -1030,14 +9234,20 @@ require('../assets/styles-b11c3a83.css'); function button() {} exports.button = button; //# sourceMappingURL=index.cjs.map -", -] +" `; -exports[`Outputs (babel) bundle with assets uses same assets across multiple formats 2`] = ` -[ - "esm/index.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Outputs (babel) > bundle with assets > uses same assets across multiple formats > cjs/index-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index.cjs'; + +export const { button } = data;" +`; + +exports[`Outputs (babel) > bundle with assets > uses same assets across multiple formats > esm/index.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: esm import '../assets/globals-107ab52e.css'; @@ -1046,14 +9256,20 @@ import '../assets/styles-b11c3a83.css'; function button() {} export { button }; //# sourceMappingURL=index.js.map -", -] +" `; -exports[`Outputs (babel) bundle with assets uses same assets across multiple formats 3`] = ` -[ - "lib/index.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Outputs (babel) > bundle with assets > uses same assets across multiple formats > esm/index-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index.cjs'; + +export const { button } = data;" +`; + +exports[`Outputs (babel) > bundle with assets > uses same assets across multiple formats > lib/index.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: lib 'use strict'; @@ -1064,300 +9280,140 @@ require('../assets/styles-b11c3a83.css'); function button() {} exports.button = button; //# sourceMappingURL=index.js.map -", -] +" `; -exports[`Outputs (babel) bundle with assets uses same assets across multiple formats 4`] = ` -[ - "package.json", - { - "main": "./lib/index.js", - "module": "./esm/index.js", - "name": "project-assets", - "packemon": { - "bundle": true, - "platform": "node", - }, - }, -] -`; +exports[`Outputs (babel) > bundle with assets > uses same assets across multiple formats > lib/index-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file -exports[`Outputs (babel) bundle with assets uses same assets across multiple formats 5`] = ` -[ - "src/button/styles.css", - "assets/styles-b11c3a83.css", -] -`; +import data from './index.cjs'; -exports[`Outputs (babel) bundle with assets uses same assets across multiple formats 6`] = ` -[ - "src/button/styles.css", - "assets/styles-b11c3a83.css", -] +export const { button } = data;" `; -exports[`Outputs (babel) bundle with assets uses same assets across multiple formats 7`] = ` -[ - "src/button/styles.css", - "assets/styles-b11c3a83.css", -] +exports[`Outputs (babel) > no bundle > creates individual files for every source file > lib/index.js 1`] = ` +"'use strict'; + +const other = require('./other.js'); +function bar() {} +exports.foo = other.foo; +exports.bar = bar; +//# sourceMappingURL=index.js.map +" `; -exports[`Outputs (babel) bundle with assets uses same assets across multiple formats 8`] = ` -[ - "src/globals.css", - "assets/globals-107ab52e.css", -] +exports[`Outputs (babel) > no bundle > creates individual files for every source file > lib/not-imported.js 1`] = ` +"'use strict'; + +function baz() {} +exports.baz = baz; +//# sourceMappingURL=not-imported.js.map +" `; -exports[`Outputs (babel) bundle with assets uses same assets across multiple formats 9`] = ` -[ - "src/globals.css", - "assets/globals-107ab52e.css", -] +exports[`Outputs (babel) > no bundle > creates individual files for every source file > lib/other.js 1`] = ` +"'use strict'; + +function foo() {} +exports.foo = foo; +//# sourceMappingURL=other.js.map +" `; -exports[`Outputs (babel) bundle with assets uses same assets across multiple formats 10`] = ` -[ - "src/globals.css", - "assets/globals-107ab52e.css", -] +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (browser, esm) > ../assets/fonts-4e5dc96c.css 1`] = ` +"@font-face { +} +" `; -exports[`Outputs (babel) bundle with assets uses same assets across multiple formats 11`] = ` -[ - "src/shared/fonts.css", - "assets/fonts-4e5dc96c.css", -] +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (browser, esm) > ../assets/globals-107ab52e.css 1`] = ` +"html { +} +" `; -exports[`Outputs (babel) bundle with assets uses same assets across multiple formats 12`] = ` -[ - "src/shared/fonts.css", - "assets/fonts-4e5dc96c.css", -] -`; - -exports[`Outputs (babel) bundle with assets uses same assets across multiple formats 13`] = ` -[ - "src/shared/fonts.css", - "assets/fonts-4e5dc96c.css", -] -`; - -exports[`Outputs (babel) no bundle creates individual files for every source file 1`] = ` -[ - "lib/index.js", - "'use strict'; - -const other = require('./other.js'); -function bar() {} -exports.foo = other.foo; -exports.bar = bar; -//# sourceMappingURL=index.js.map -", -] -`; - -exports[`Outputs (babel) no bundle creates individual files for every source file 2`] = ` -[ - "lib/not-imported.js", - "'use strict'; - -function baz() {} -exports.baz = baz; -//# sourceMappingURL=not-imported.js.map -", -] -`; - -exports[`Outputs (babel) no bundle creates individual files for every source file 3`] = ` -[ - "lib/other.js", - "'use strict'; - -function foo() {} -exports.foo = foo; -//# sourceMappingURL=other.js.map -", -] -`; - -exports[`Outputs (babel) no bundle creates individual files for every source file 4`] = ` -[ - "package.json", - { - "main": "./lib/index.js", - "name": "project-bundle", - "packemon": { - "bundle": true, - "platform": "node", - }, - }, -] +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (browser, esm) > ../assets/styles-b11c3a83.css 1`] = ` +".button { +} +" `; -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (browser, esm) 1`] = ` -[ - "esm/button/index.js", - "import '../../assets/styles-b11c3a83.css'; +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (browser, esm) > esm/button/index.js 1`] = ` +"import '../../assets/styles-b11c3a83.css'; function button() {} export { button }; //# sourceMappingURL=index.js.map -", -] +" `; -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (browser, esm) 2`] = ` -[ - "esm/index.js", - "import '../assets/globals-107ab52e.css'; +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (browser, esm) > esm/index.js 1`] = ` +"import '../assets/globals-107ab52e.css'; import '../assets/fonts-4e5dc96c.css'; export { button } from './button/index.js'; //# sourceMappingURL=index.js.map -", -] -`; - -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (browser, esm) 3`] = ` -[ - "package.json", - { - "main": "./esm/index.js", - "module": "./esm/index.js", - "name": "project-assets", - "packemon": { - "bundle": true, - "platform": "node", - }, - }, -] +" `; -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (browser, esm) 4`] = ` -[ - "src/button/styles.css", - "assets/styles-b11c3a83.css", -] +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (browser, lib) > ../assets/fonts-4e5dc96c.css 1`] = ` +"@font-face { +} +" `; -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (browser, esm) 5`] = ` -[ - "src/globals.css", - "assets/globals-107ab52e.css", -] +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (browser, lib) > ../assets/globals-107ab52e.css 1`] = ` +"html { +} +" `; -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (browser, esm) 6`] = ` -[ - "src/shared/fonts.css", - "assets/fonts-4e5dc96c.css", -] +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (browser, lib) > ../assets/styles-b11c3a83.css 1`] = ` +".button { +} +" `; -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (browser, lib) 1`] = ` -[ - "lib/button/index.js", - "'use strict'; +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (browser, lib) > lib/button/index.js 1`] = ` +"'use strict'; require('../../assets/styles-b11c3a83.css'); function button() {} exports.button = button; //# sourceMappingURL=index.js.map -", -] +" `; -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (browser, lib) 2`] = ` -[ - "lib/index.js", - "'use strict'; +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (browser, lib) > lib/index.js 1`] = ` +"'use strict'; require('../assets/globals-107ab52e.css'); require('../assets/fonts-4e5dc96c.css'); const index = require('./button/index.js'); exports.button = index.button; //# sourceMappingURL=index.js.map -", -] -`; - -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (browser, lib) 3`] = ` -[ - "package.json", - { - "main": "./lib/index.js", - "name": "project-assets", - "packemon": { - "bundle": true, - "platform": "node", - }, - }, -] -`; - -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (browser, lib) 4`] = ` -[ - "src/button/styles.css", - "assets/styles-b11c3a83.css", -] +" `; -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (browser, lib) 5`] = ` -[ - "src/globals.css", - "assets/globals-107ab52e.css", -] -`; - -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (browser, lib) 6`] = ` -[ - "src/shared/fonts.css", - "assets/fonts-4e5dc96c.css", -] -`; - -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (browser, umd) 1`] = ` -[ - "package.json", - { - "browser": "./umd/index.js", - "main": "./lib/index.js", - "name": "project-assets", - "packemon": { - "bundle": true, - "platform": "node", - }, - }, -] -`; - -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (browser, umd) 2`] = ` -[ - "src/button/styles.css", - "assets/styles-b11c3a83.css", -] +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (browser, umd) > ../assets/fonts-4e5dc96c.css 1`] = ` +"@font-face { +} +" `; -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (browser, umd) 3`] = ` -[ - "src/globals.css", - "assets/globals-107ab52e.css", -] +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (browser, umd) > ../assets/globals-107ab52e.css 1`] = ` +"html { +} +" `; -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (browser, umd) 4`] = ` -[ - "src/shared/fonts.css", - "assets/fonts-4e5dc96c.css", -] +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (browser, umd) > ../assets/styles-b11c3a83.css 1`] = ` +".button { +} +" `; -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (browser, umd) 5`] = ` -[ - "umd/button/index.js", - "(function (global, factory) { +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (browser, umd) > umd/button/index.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports", "../../assets/styles-b11c3a83.css"], factory); } else if (typeof exports !== "undefined") { @@ -1379,14 +9435,11 @@ exports[`Outputs (babel) no bundle with assets creates individual files and refe function button() {} }); //# sourceMappingURL=index.js.map -", -] +" `; -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (browser, umd) 6`] = ` -[ - "umd/index.js", - "(function (global, factory) { +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (browser, umd) > umd/index.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports", "../assets/globals-107ab52e.css", "../assets/fonts-4e5dc96c.css", "./button/index.js"], factory); } else if (typeof exports !== "undefined") { @@ -1412,377 +9465,244 @@ exports[`Outputs (babel) no bundle with assets creates individual files and refe }); }); //# sourceMappingURL=index.js.map -", -] +" `; -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (electron, esm) 1`] = ` -[ - "esm/button/index.js", - "import '../../assets/styles-b11c3a83.css'; +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (electron, esm) > ../assets/fonts-4e5dc96c.css 1`] = ` +"@font-face { +} +" +`; + +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (electron, esm) > ../assets/globals-107ab52e.css 1`] = ` +"html { +} +" +`; + +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (electron, esm) > ../assets/styles-b11c3a83.css 1`] = ` +".button { +} +" +`; + +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (electron, esm) > esm/button/index.js 1`] = ` +"import '../../assets/styles-b11c3a83.css'; function button() {} export { button }; //# sourceMappingURL=index.js.map -", -] +" `; -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (electron, esm) 2`] = ` -[ - "esm/index.js", - "import '../assets/globals-107ab52e.css'; +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (electron, esm) > esm/index.js 1`] = ` +"import '../assets/globals-107ab52e.css'; import '../assets/fonts-4e5dc96c.css'; export { button } from './button/index.js'; //# sourceMappingURL=index.js.map -", -] -`; - -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (electron, esm) 3`] = ` -[ - "package.json", - { - "main": "./esm/index.js", - "module": "./esm/index.js", - "name": "project-assets", - "packemon": { - "bundle": true, - "platform": "node", - }, - }, -] +" `; -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (electron, esm) 4`] = ` -[ - "src/button/styles.css", - "assets/styles-b11c3a83.css", -] +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (electron, lib) > ../assets/fonts-4e5dc96c.css 1`] = ` +"@font-face { +} +" `; -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (electron, esm) 5`] = ` -[ - "src/globals.css", - "assets/globals-107ab52e.css", -] +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (electron, lib) > ../assets/globals-107ab52e.css 1`] = ` +"html { +} +" `; -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (electron, esm) 6`] = ` -[ - "src/shared/fonts.css", - "assets/fonts-4e5dc96c.css", -] +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (electron, lib) > ../assets/styles-b11c3a83.css 1`] = ` +".button { +} +" `; -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (electron, lib) 1`] = ` -[ - "lib/button/index.js", - "'use strict'; +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (electron, lib) > lib/button/index.js 1`] = ` +"'use strict'; require('../../assets/styles-b11c3a83.css'); function button() {} exports.button = button; //# sourceMappingURL=index.js.map -", -] +" `; -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (electron, lib) 2`] = ` -[ - "lib/index.js", - "'use strict'; +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (electron, lib) > lib/index.js 1`] = ` +"'use strict'; require('../assets/globals-107ab52e.css'); require('../assets/fonts-4e5dc96c.css'); const index = require('./button/index.js'); exports.button = index.button; //# sourceMappingURL=index.js.map -", -] +" `; -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (electron, lib) 3`] = ` -[ - "package.json", - { - "main": "./lib/index.js", - "name": "project-assets", - "packemon": { - "bundle": true, - "platform": "node", - }, - }, -] -`; - -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (electron, lib) 4`] = ` -[ - "src/button/styles.css", - "assets/styles-b11c3a83.css", -] +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (native, lib) > ../assets/fonts-4e5dc96c.css 1`] = ` +"@font-face { +} +" `; -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (electron, lib) 5`] = ` -[ - "src/globals.css", - "assets/globals-107ab52e.css", -] +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (native, lib) > ../assets/globals-107ab52e.css 1`] = ` +"html { +} +" `; -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (electron, lib) 6`] = ` -[ - "src/shared/fonts.css", - "assets/fonts-4e5dc96c.css", -] +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (native, lib) > ../assets/styles-b11c3a83.css 1`] = ` +".button { +} +" `; -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (native, lib) 1`] = ` -[ - "lib/button/index.js", - "'use strict'; +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (native, lib) > lib/button/index.js 1`] = ` +"'use strict'; require('../../assets/styles-b11c3a83.css'); function button() {} exports.button = button; //# sourceMappingURL=index.js.map -", -] +" `; -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (native, lib) 2`] = ` -[ - "lib/index.js", - "'use strict'; +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (native, lib) > lib/index.js 1`] = ` +"'use strict'; require('../assets/globals-107ab52e.css'); require('../assets/fonts-4e5dc96c.css'); const index = require('./button/index.js'); exports.button = index.button; //# sourceMappingURL=index.js.map -", -] +" `; -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (native, lib) 3`] = ` -[ - "package.json", - { - "main": "./lib/index.js", - "name": "project-assets", - "packemon": { - "bundle": true, - "platform": "node", - }, - }, -] -`; - -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (native, lib) 4`] = ` -[ - "src/button/styles.css", - "assets/styles-b11c3a83.css", -] +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (node, cjs) > ../assets/fonts-4e5dc96c.css 1`] = ` +"@font-face { +} +" `; -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (native, lib) 5`] = ` -[ - "src/globals.css", - "assets/globals-107ab52e.css", -] +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (node, cjs) > ../assets/globals-107ab52e.css 1`] = ` +"html { +} +" `; -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (native, lib) 6`] = ` -[ - "src/shared/fonts.css", - "assets/fonts-4e5dc96c.css", -] +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (node, cjs) > ../assets/styles-b11c3a83.css 1`] = ` +".button { +} +" `; -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (node, cjs) 1`] = ` -[ - "cjs/button/index.cjs", - "'use strict'; +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (node, cjs) > cjs/button/index.cjs 1`] = ` +"'use strict'; require('../../assets/styles-b11c3a83.css'); function button() {} exports.button = button; //# sourceMappingURL=index.cjs.map -", -] +" `; -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (node, cjs) 2`] = ` -[ - "cjs/index.cjs", - "'use strict'; +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (node, cjs) > cjs/index.cjs 1`] = ` +"'use strict'; require('../assets/globals-107ab52e.css'); require('../assets/fonts-4e5dc96c.css'); const index = require('./button/index.cjs'); exports.button = index.button; //# sourceMappingURL=index.cjs.map -", -] +" `; -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (node, cjs) 3`] = ` -[ - "package.json", - { - "main": "./cjs/index.cjs", - "name": "project-assets", - "packemon": { - "bundle": true, - "platform": "node", - }, - }, -] +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (node, cjs) > cjs/index-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index.cjs'; + +export const { button } = data;" `; -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (node, cjs) 4`] = ` -[ - "src/button/styles.css", - "assets/styles-b11c3a83.css", -] +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (node, lib) > ../assets/fonts-4e5dc96c.css 1`] = ` +"@font-face { +} +" `; -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (node, cjs) 5`] = ` -[ - "src/globals.css", - "assets/globals-107ab52e.css", -] +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (node, lib) > ../assets/globals-107ab52e.css 1`] = ` +"html { +} +" `; -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (node, cjs) 6`] = ` -[ - "src/shared/fonts.css", - "assets/fonts-4e5dc96c.css", -] +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (node, lib) > ../assets/styles-b11c3a83.css 1`] = ` +".button { +} +" `; -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (node, lib) 1`] = ` -[ - "lib/button/index.js", - "'use strict'; +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (node, lib) > lib/button/index.js 1`] = ` +"'use strict'; require('../../assets/styles-b11c3a83.css'); function button() {} exports.button = button; //# sourceMappingURL=index.js.map -", -] +" `; -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (node, lib) 2`] = ` -[ - "lib/index.js", - "'use strict'; +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (node, lib) > lib/index.js 1`] = ` +"'use strict'; require('../assets/globals-107ab52e.css'); require('../assets/fonts-4e5dc96c.css'); const index = require('./button/index.js'); exports.button = index.button; //# sourceMappingURL=index.js.map -", -] +" `; -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (node, lib) 3`] = ` -[ - "package.json", - { - "main": "./lib/index.js", - "name": "project-assets", - "packemon": { - "bundle": true, - "platform": "node", - }, - }, -] -`; - -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (node, lib) 4`] = ` -[ - "src/button/styles.css", - "assets/styles-b11c3a83.css", -] +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (node, mjs) > ../assets/fonts-4e5dc96c.css 1`] = ` +"@font-face { +} +" `; -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (node, lib) 5`] = ` -[ - "src/globals.css", - "assets/globals-107ab52e.css", -] +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (node, mjs) > ../assets/globals-107ab52e.css 1`] = ` +"html { +} +" `; -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (node, lib) 6`] = ` -[ - "src/shared/fonts.css", - "assets/fonts-4e5dc96c.css", -] +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (node, mjs) > ../assets/styles-b11c3a83.css 1`] = ` +".button { +} +" `; -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (node, mjs) 1`] = ` -[ - "mjs/button/index.mjs", - "import '../../assets/styles-b11c3a83.css'; +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (node, mjs) > mjs/button/index.mjs 1`] = ` +"import '../../assets/styles-b11c3a83.css'; function button() {} export { button }; //# sourceMappingURL=index.mjs.map -", -] +" `; -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (node, mjs) 2`] = ` -[ - "mjs/index.mjs", - "import '../assets/globals-107ab52e.css'; +exports[`Outputs (babel) > no bundle with assets > creates individual files and references assets (node, mjs) > mjs/index.mjs 1`] = ` +"import '../assets/globals-107ab52e.css'; import '../assets/fonts-4e5dc96c.css'; export { button } from './button/index.mjs'; //# sourceMappingURL=index.mjs.map -", -] -`; - -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (node, mjs) 3`] = ` -[ - "package.json", - { - "main": "./mjs/index.mjs", - "name": "project-assets", - "packemon": { - "bundle": true, - "platform": "node", - }, - }, -] -`; - -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (node, mjs) 4`] = ` -[ - "src/button/styles.css", - "assets/styles-b11c3a83.css", -] -`; - -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (node, mjs) 5`] = ` -[ - "src/globals.css", - "assets/globals-107ab52e.css", -] -`; - -exports[`Outputs (babel) no bundle with assets creates individual files and references assets (node, mjs) 6`] = ` -[ - "src/shared/fonts.css", - "assets/fonts-4e5dc96c.css", -] +" `; -exports[`Outputs (swc) artifacts builds all the artifacts with rollup 1`] = ` -[ - "cjs/server.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Outputs (swc) > artifacts > builds all the artifacts with rollup > cjs/server.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: cjs 'use strict'; @@ -1800,14 +9720,18 @@ https__default.default.createServer((req, res) => { res.end(); }).listen(8080); //# sourceMappingURL=server.cjs.map -", -] +" `; -exports[`Outputs (swc) artifacts builds all the artifacts with rollup 2`] = ` -[ - "esm/client.js", - "function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } +exports[`Outputs (swc) > artifacts > builds all the artifacts with rollup > cjs/server-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './server.cjs';" +`; + +exports[`Outputs (swc) > artifacts > builds all the artifacts with rollup > esm/client.js 1`] = ` +"function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } @@ -1842,14 +9766,1102 @@ async function createClient() { } export { createClient }; //# sourceMappingURL=client.js.map -", -] +" `; -exports[`Outputs (swc) artifacts builds all the artifacts with rollup 3`] = ` -[ - "lib/client.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Outputs (swc) > artifacts > builds all the artifacts with rollup > lib/bundle-ly9OXwfJ.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: native, Support: experimental, Format: lib + +'use strict'; + +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } +function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); } +function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } +const comma = ','.charCodeAt(0); +const semicolon = ';'.charCodeAt(0); +const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; +const intToChar = new Uint8Array(64); // 64 possible chars. +const charToInt = new Uint8Array(128); // z is 122 in ASCII +for (let i = 0; i < chars.length; i++) { + const c = chars.charCodeAt(i); + intToChar[i] = c; + charToInt[c] = i; +} +// Provide a fallback for older environments. +const td = typeof TextDecoder !== 'undefined' ? /* #__PURE__ */new TextDecoder() : typeof Buffer !== 'undefined' ? { + decode(buf) { + const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength); + return out.toString(); + } +} : { + decode(buf) { + let out = ''; + for (let i = 0; i < buf.length; i++) { + out += String.fromCharCode(buf[i]); + } + return out; + } +}; +function encode(decoded) { + const state = new Int32Array(5); + const bufLength = 1024 * 16; + const subLength = bufLength - 36; + const buf = new Uint8Array(bufLength); + const sub = buf.subarray(0, subLength); + let pos = 0; + let out = ''; + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + if (i > 0) { + if (pos === bufLength) { + out += td.decode(buf); + pos = 0; + } + buf[pos++] = semicolon; + } + if (line.length === 0) continue; + state[0] = 0; + for (let j = 0; j < line.length; j++) { + const segment = line[j]; + // We can push up to 5 ints, each int can take at most 7 chars, and we + // may push a comma. + if (pos > subLength) { + out += td.decode(sub); + buf.copyWithin(0, subLength, pos); + pos -= subLength; + } + if (j > 0) buf[pos++] = comma; + pos = encodeInteger(buf, pos, state, segment, 0); // genColumn + if (segment.length === 1) continue; + pos = encodeInteger(buf, pos, state, segment, 1); // sourcesIndex + pos = encodeInteger(buf, pos, state, segment, 2); // sourceLine + pos = encodeInteger(buf, pos, state, segment, 3); // sourceColumn + if (segment.length === 4) continue; + pos = encodeInteger(buf, pos, state, segment, 4); // namesIndex + } + } + return out + td.decode(buf.subarray(0, pos)); +} +function encodeInteger(buf, pos, state, segment, j) { + const next = segment[j]; + let num = next - state[j]; + state[j] = next; + num = num < 0 ? -num << 1 | 1 : num << 1; + do { + let clamped = num & 0b011111; + num >>>= 5; + if (num > 0) clamped |= 0b100000; + buf[pos++] = intToChar[clamped]; + } while (num > 0); + return pos; +} +class BitSet { + constructor(arg) { + this.bits = arg instanceof BitSet ? arg.bits.slice() : []; + } + add(n) { + this.bits[n >> 5] |= 1 << (n & 31); + } + has(n) { + return !!(this.bits[n >> 5] & 1 << (n & 31)); + } +} +class Chunk { + constructor(start, end, content) { + this.start = start; + this.end = end; + this.original = content; + this.intro = ''; + this.outro = ''; + this.content = content; + this.storeName = false; + this.edited = false; + { + this.previous = null; + this.next = null; + } + } + appendLeft(content) { + this.outro += content; + } + appendRight(content) { + this.intro = this.intro + content; + } + clone() { + const chunk = new Chunk(this.start, this.end, this.original); + chunk.intro = this.intro; + chunk.outro = this.outro; + chunk.content = this.content; + chunk.storeName = this.storeName; + chunk.edited = this.edited; + return chunk; + } + contains(index) { + return this.start < index && index < this.end; + } + eachNext(fn) { + let chunk = this; + while (chunk) { + fn(chunk); + chunk = chunk.next; + } + } + eachPrevious(fn) { + let chunk = this; + while (chunk) { + fn(chunk); + chunk = chunk.previous; + } + } + edit(content, storeName, contentOnly) { + this.content = content; + if (!contentOnly) { + this.intro = ''; + this.outro = ''; + } + this.storeName = storeName; + this.edited = true; + return this; + } + prependLeft(content) { + this.outro = content + this.outro; + } + prependRight(content) { + this.intro = content + this.intro; + } + reset() { + this.intro = ''; + this.outro = ''; + if (this.edited) { + this.content = this.original; + this.storeName = false; + this.edited = false; + } + } + split(index) { + const sliceIndex = index - this.start; + const originalBefore = this.original.slice(0, sliceIndex); + const originalAfter = this.original.slice(sliceIndex); + this.original = originalBefore; + const newChunk = new Chunk(index, this.end, originalAfter); + newChunk.outro = this.outro; + this.outro = ''; + this.end = index; + if (this.edited) { + // after split we should save the edit content record into the correct chunk + // to make sure sourcemap correct + // For example: + // ' test'.trim() + // split -> ' ' + 'test' + // ✔️ edit -> '' + 'test' + // ✖️ edit -> 'test' + '' + // TODO is this block necessary?... + newChunk.edit('', false); + this.content = ''; + } else { + this.content = originalBefore; + } + newChunk.next = this.next; + if (newChunk.next) newChunk.next.previous = newChunk; + newChunk.previous = this; + this.next = newChunk; + return newChunk; + } + toString() { + return this.intro + this.content + this.outro; + } + trimEnd(rx) { + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + const trimmed = this.content.replace(rx, ''); + if (trimmed.length) { + if (trimmed !== this.content) { + this.split(this.start + trimmed.length).edit('', undefined, true); + if (this.edited) { + // save the change, if it has been edited + this.edit(trimmed, this.storeName, true); + } + } + return true; + } else { + this.edit('', undefined, true); + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + } + } + trimStart(rx) { + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + const trimmed = this.content.replace(rx, ''); + if (trimmed.length) { + if (trimmed !== this.content) { + const newChunk = this.split(this.end - trimmed.length); + if (this.edited) { + // save the change, if it has been edited + newChunk.edit(trimmed, this.storeName, true); + } + this.edit('', undefined, true); + } + return true; + } else { + this.edit('', undefined, true); + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + } + } +} +function getBtoa() { + if (typeof globalThis !== 'undefined' && typeof globalThis.btoa === 'function') { + return str => globalThis.btoa(unescape(encodeURIComponent(str))); + } else if (typeof Buffer === 'function') { + return str => Buffer.from(str, 'utf-8').toString('base64'); + } else { + return () => { + throw new Error('Unsupported environment: \`window.btoa\` or \`Buffer\` should be supported.'); + }; + } +} +const btoa = /*#__PURE__*/getBtoa(); +class SourceMap { + constructor(properties) { + this.version = 3; + this.file = properties.file; + this.sources = properties.sources; + this.sourcesContent = properties.sourcesContent; + this.names = properties.names; + this.mappings = encode(properties.mappings); + if (typeof properties.x_google_ignoreList !== 'undefined') { + this.x_google_ignoreList = properties.x_google_ignoreList; + } + } + toString() { + return JSON.stringify(this); + } + toUrl() { + return 'data:application/json;charset=utf-8;base64,' + btoa(this.toString()); + } +} +function guessIndent(code) { + const lines = code.split('\\n'); + const tabbed = lines.filter(line => /^\\t+/.test(line)); + const spaced = lines.filter(line => /^ {2,}/.test(line)); + if (tabbed.length === 0 && spaced.length === 0) { + return null; + } + + // More lines tabbed than spaced? Assume tabs, and + // default to tabs in the case of a tie (or nothing + // to go on) + if (tabbed.length >= spaced.length) { + return '\\t'; + } + + // Otherwise, we need to guess the multiple + const min = spaced.reduce((previous, current) => { + const numSpaces = /^ +/.exec(current)[0].length; + return Math.min(numSpaces, previous); + }, Infinity); + return new Array(min + 1).join(' '); +} +function getRelativePath(from, to) { + const fromParts = from.split(/[/\\\\]/); + const toParts = to.split(/[/\\\\]/); + fromParts.pop(); // get dirname + + while (fromParts[0] === toParts[0]) { + fromParts.shift(); + toParts.shift(); + } + if (fromParts.length) { + let i = fromParts.length; + while (i--) fromParts[i] = '..'; + } + return fromParts.concat(toParts).join('/'); +} +const toString = Object.prototype.toString; +function isObject(thing) { + return toString.call(thing) === '[object Object]'; +} +function getLocator(source) { + const originalLines = source.split('\\n'); + const lineOffsets = []; + for (let i = 0, pos = 0; i < originalLines.length; i++) { + lineOffsets.push(pos); + pos += originalLines[i].length + 1; + } + return function locate(index) { + let i = 0; + let j = lineOffsets.length; + while (i < j) { + const m = i + j >> 1; + if (index < lineOffsets[m]) { + j = m; + } else { + i = m + 1; + } + } + const line = i - 1; + const column = index - lineOffsets[line]; + return { + line, + column + }; + }; +} +const wordRegex = /\\w/; +class Mappings { + constructor(hires) { + this.hires = hires; + this.generatedCodeLine = 0; + this.generatedCodeColumn = 0; + this.raw = []; + this.rawSegments = this.raw[this.generatedCodeLine] = []; + this.pending = null; + } + addEdit(sourceIndex, content, loc, nameIndex) { + if (content.length) { + let contentLineEnd = content.indexOf('\\n', 0); + let previousContentLineEnd = -1; + while (contentLineEnd >= 0) { + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + if (nameIndex >= 0) { + segment.push(nameIndex); + } + this.rawSegments.push(segment); + this.generatedCodeLine += 1; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + this.generatedCodeColumn = 0; + previousContentLineEnd = contentLineEnd; + contentLineEnd = content.indexOf('\\n', contentLineEnd + 1); + } + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + if (nameIndex >= 0) { + segment.push(nameIndex); + } + this.rawSegments.push(segment); + this.advance(content.slice(previousContentLineEnd + 1)); + } else if (this.pending) { + this.rawSegments.push(this.pending); + this.advance(content); + } + this.pending = null; + } + addUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) { + let originalCharIndex = chunk.start; + let first = true; + // when iterating each char, check if it's in a word boundary + let charInHiresBoundary = false; + while (originalCharIndex < chunk.end) { + if (this.hires || first || sourcemapLocations.has(originalCharIndex)) { + const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; + if (this.hires === 'boundary') { + // in hires "boundary", group segments per word boundary than per char + if (wordRegex.test(original[originalCharIndex])) { + // for first char in the boundary found, start the boundary by pushing a segment + if (!charInHiresBoundary) { + this.rawSegments.push(segment); + charInHiresBoundary = true; + } + } else { + // for non-word char, end the boundary by pushing a segment + this.rawSegments.push(segment); + charInHiresBoundary = false; + } + } else { + this.rawSegments.push(segment); + } + } + if (original[originalCharIndex] === '\\n') { + loc.line += 1; + loc.column = 0; + this.generatedCodeLine += 1; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + this.generatedCodeColumn = 0; + first = true; + } else { + loc.column += 1; + this.generatedCodeColumn += 1; + first = false; + } + originalCharIndex += 1; + } + this.pending = null; + } + advance(str) { + if (!str) return; + const lines = str.split('\\n'); + if (lines.length > 1) { + for (let i = 0; i < lines.length - 1; i++) { + this.generatedCodeLine++; + this.raw[this.generatedCodeLine] = this.rawSegments = []; + } + this.generatedCodeColumn = 0; + } + this.generatedCodeColumn += lines[lines.length - 1].length; + } +} +const n = '\\n'; +const warned = { + insertLeft: false, + insertRight: false, + storeName: false +}; +class MagicString { + constructor(string, options = {}) { + const chunk = new Chunk(0, string.length, string); + Object.defineProperties(this, { + original: { + writable: true, + value: string + }, + outro: { + writable: true, + value: '' + }, + intro: { + writable: true, + value: '' + }, + firstChunk: { + writable: true, + value: chunk + }, + lastChunk: { + writable: true, + value: chunk + }, + lastSearchedChunk: { + writable: true, + value: chunk + }, + byStart: { + writable: true, + value: {} + }, + byEnd: { + writable: true, + value: {} + }, + filename: { + writable: true, + value: options.filename + }, + indentExclusionRanges: { + writable: true, + value: options.indentExclusionRanges + }, + sourcemapLocations: { + writable: true, + value: new BitSet() + }, + storedNames: { + writable: true, + value: {} + }, + indentStr: { + writable: true, + value: undefined + }, + ignoreList: { + writable: true, + value: options.ignoreList + } + }); + this.byStart[0] = chunk; + this.byEnd[string.length] = chunk; + } + addSourcemapLocation(char) { + this.sourcemapLocations.add(char); + } + append(content) { + if (typeof content !== 'string') throw new TypeError('outro content must be a string'); + this.outro += content; + return this; + } + appendLeft(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + this._split(index); + const chunk = this.byEnd[index]; + if (chunk) { + chunk.appendLeft(content); + } else { + this.intro += content; + } + return this; + } + appendRight(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + this._split(index); + const chunk = this.byStart[index]; + if (chunk) { + chunk.appendRight(content); + } else { + this.outro += content; + } + return this; + } + clone() { + const cloned = new MagicString(this.original, { + filename: this.filename + }); + let originalChunk = this.firstChunk; + let clonedChunk = cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone(); + while (originalChunk) { + cloned.byStart[clonedChunk.start] = clonedChunk; + cloned.byEnd[clonedChunk.end] = clonedChunk; + const nextOriginalChunk = originalChunk.next; + const nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone(); + if (nextClonedChunk) { + clonedChunk.next = nextClonedChunk; + nextClonedChunk.previous = clonedChunk; + clonedChunk = nextClonedChunk; + } + originalChunk = nextOriginalChunk; + } + cloned.lastChunk = clonedChunk; + if (this.indentExclusionRanges) { + cloned.indentExclusionRanges = this.indentExclusionRanges.slice(); + } + cloned.sourcemapLocations = new BitSet(this.sourcemapLocations); + cloned.intro = this.intro; + cloned.outro = this.outro; + return cloned; + } + generateDecodedMap(options) { + options = options || {}; + const sourceIndex = 0; + const names = Object.keys(this.storedNames); + const mappings = new Mappings(options.hires); + const locate = getLocator(this.original); + if (this.intro) { + mappings.advance(this.intro); + } + this.firstChunk.eachNext(chunk => { + const loc = locate(chunk.start); + if (chunk.intro.length) mappings.advance(chunk.intro); + if (chunk.edited) { + mappings.addEdit(sourceIndex, chunk.content, loc, chunk.storeName ? names.indexOf(chunk.original) : -1); + } else { + mappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations); + } + if (chunk.outro.length) mappings.advance(chunk.outro); + }); + return { + file: options.file ? options.file.split(/[/\\\\]/).pop() : undefined, + sources: [options.source ? getRelativePath(options.file || '', options.source) : options.file || ''], + sourcesContent: options.includeContent ? [this.original] : undefined, + names, + mappings: mappings.raw, + x_google_ignoreList: this.ignoreList ? [sourceIndex] : undefined + }; + } + generateMap(options) { + return new SourceMap(this.generateDecodedMap(options)); + } + _ensureindentStr() { + if (this.indentStr === undefined) { + this.indentStr = guessIndent(this.original); + } + } + _getRawIndentString() { + this._ensureindentStr(); + return this.indentStr; + } + getIndentString() { + this._ensureindentStr(); + return this.indentStr === null ? '\\t' : this.indentStr; + } + indent(indentStr, options) { + const pattern = /^[^\\r\\n]/gm; + if (isObject(indentStr)) { + options = indentStr; + indentStr = undefined; + } + if (indentStr === undefined) { + this._ensureindentStr(); + indentStr = this.indentStr || '\\t'; + } + if (indentStr === '') return this; // noop + + options = options || {}; + + // Process exclusion ranges + const isExcluded = {}; + if (options.exclude) { + const exclusions = typeof options.exclude[0] === 'number' ? [options.exclude] : options.exclude; + exclusions.forEach(exclusion => { + for (let i = exclusion[0]; i < exclusion[1]; i += 1) { + isExcluded[i] = true; + } + }); + } + let shouldIndentNextCharacter = options.indentStart !== false; + const replacer = match => { + if (shouldIndentNextCharacter) return \`\${indentStr}\${match}\`; + shouldIndentNextCharacter = true; + return match; + }; + this.intro = this.intro.replace(pattern, replacer); + let charIndex = 0; + let chunk = this.firstChunk; + while (chunk) { + const end = chunk.end; + if (chunk.edited) { + if (!isExcluded[charIndex]) { + chunk.content = chunk.content.replace(pattern, replacer); + if (chunk.content.length) { + shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === '\\n'; + } + } + } else { + charIndex = chunk.start; + while (charIndex < end) { + if (!isExcluded[charIndex]) { + const char = this.original[charIndex]; + if (char === '\\n') { + shouldIndentNextCharacter = true; + } else if (char !== '\\r' && shouldIndentNextCharacter) { + shouldIndentNextCharacter = false; + if (charIndex === chunk.start) { + chunk.prependRight(indentStr); + } else { + this._splitChunk(chunk, charIndex); + chunk = chunk.next; + chunk.prependRight(indentStr); + } + } + } + charIndex += 1; + } + } + charIndex = chunk.end; + chunk = chunk.next; + } + this.outro = this.outro.replace(pattern, replacer); + return this; + } + insert() { + throw new Error('magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)'); + } + insertLeft(index, content) { + if (!warned.insertLeft) { + console.warn('magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead'); // eslint-disable-line no-console + warned.insertLeft = true; + } + return this.appendLeft(index, content); + } + insertRight(index, content) { + if (!warned.insertRight) { + console.warn('magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead'); // eslint-disable-line no-console + warned.insertRight = true; + } + return this.prependRight(index, content); + } + move(start, end, index) { + if (index >= start && index <= end) throw new Error('Cannot move a selection inside itself'); + this._split(start); + this._split(end); + this._split(index); + const first = this.byStart[start]; + const last = this.byEnd[end]; + const oldLeft = first.previous; + const oldRight = last.next; + const newRight = this.byStart[index]; + if (!newRight && last === this.lastChunk) return this; + const newLeft = newRight ? newRight.previous : this.lastChunk; + if (oldLeft) oldLeft.next = oldRight; + if (oldRight) oldRight.previous = oldLeft; + if (newLeft) newLeft.next = first; + if (newRight) newRight.previous = last; + if (!first.previous) this.firstChunk = last.next; + if (!last.next) { + this.lastChunk = first.previous; + this.lastChunk.next = null; + } + first.previous = newLeft; + last.next = newRight || null; + if (!newLeft) this.firstChunk = first; + if (!newRight) this.lastChunk = last; + return this; + } + overwrite(start, end, content, options) { + options = options || {}; + return this.update(start, end, content, _objectSpread(_objectSpread({}, options), {}, { + overwrite: !options.contentOnly + })); + } + update(start, end, content, options) { + if (typeof content !== 'string') throw new TypeError('replacement content must be a string'); + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + if (end > this.original.length) throw new Error('end is out of bounds'); + if (start === end) throw new Error('Cannot overwrite a zero-length range – use appendLeft or prependRight instead'); + this._split(start); + this._split(end); + if (options === true) { + if (!warned.storeName) { + console.warn('The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string'); // eslint-disable-line no-console + warned.storeName = true; + } + options = { + storeName: true + }; + } + const storeName = options !== undefined ? options.storeName : false; + const overwrite = options !== undefined ? options.overwrite : false; + if (storeName) { + const original = this.original.slice(start, end); + Object.defineProperty(this.storedNames, original, { + writable: true, + value: true, + enumerable: true + }); + } + const first = this.byStart[start]; + const last = this.byEnd[end]; + if (first) { + let chunk = first; + while (chunk !== last) { + if (chunk.next !== this.byStart[chunk.end]) { + throw new Error('Cannot overwrite across a split point'); + } + chunk = chunk.next; + chunk.edit('', false); + } + first.edit(content, storeName, !overwrite); + } else { + // must be inserting at the end + const newChunk = new Chunk(start, end, '').edit(content, storeName); + + // TODO last chunk in the array may not be the last chunk, if it's moved... + last.next = newChunk; + newChunk.previous = last; + } + return this; + } + prepend(content) { + if (typeof content !== 'string') throw new TypeError('outro content must be a string'); + this.intro = content + this.intro; + return this; + } + prependLeft(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + this._split(index); + const chunk = this.byEnd[index]; + if (chunk) { + chunk.prependLeft(content); + } else { + this.intro = content + this.intro; + } + return this; + } + prependRight(index, content) { + if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); + this._split(index); + const chunk = this.byStart[index]; + if (chunk) { + chunk.prependRight(content); + } else { + this.outro = content + this.outro; + } + return this; + } + remove(start, end) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + if (start === end) return this; + if (start < 0 || end > this.original.length) throw new Error('Character is out of bounds'); + if (start > end) throw new Error('end must be greater than start'); + this._split(start); + this._split(end); + let chunk = this.byStart[start]; + while (chunk) { + chunk.intro = ''; + chunk.outro = ''; + chunk.edit(''); + chunk = end > chunk.end ? this.byStart[chunk.end] : null; + } + return this; + } + reset(start, end) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + if (start === end) return this; + if (start < 0 || end > this.original.length) throw new Error('Character is out of bounds'); + if (start > end) throw new Error('end must be greater than start'); + this._split(start); + this._split(end); + let chunk = this.byStart[start]; + while (chunk) { + chunk.reset(); + chunk = end > chunk.end ? this.byStart[chunk.end] : null; + } + return this; + } + lastChar() { + if (this.outro.length) return this.outro[this.outro.length - 1]; + let chunk = this.lastChunk; + do { + if (chunk.outro.length) return chunk.outro[chunk.outro.length - 1]; + if (chunk.content.length) return chunk.content[chunk.content.length - 1]; + if (chunk.intro.length) return chunk.intro[chunk.intro.length - 1]; + } while (chunk = chunk.previous); + if (this.intro.length) return this.intro[this.intro.length - 1]; + return ''; + } + lastLine() { + let lineIndex = this.outro.lastIndexOf(n); + if (lineIndex !== -1) return this.outro.substr(lineIndex + 1); + let lineStr = this.outro; + let chunk = this.lastChunk; + do { + if (chunk.outro.length > 0) { + lineIndex = chunk.outro.lastIndexOf(n); + if (lineIndex !== -1) return chunk.outro.substr(lineIndex + 1) + lineStr; + lineStr = chunk.outro + lineStr; + } + if (chunk.content.length > 0) { + lineIndex = chunk.content.lastIndexOf(n); + if (lineIndex !== -1) return chunk.content.substr(lineIndex + 1) + lineStr; + lineStr = chunk.content + lineStr; + } + if (chunk.intro.length > 0) { + lineIndex = chunk.intro.lastIndexOf(n); + if (lineIndex !== -1) return chunk.intro.substr(lineIndex + 1) + lineStr; + lineStr = chunk.intro + lineStr; + } + } while (chunk = chunk.previous); + lineIndex = this.intro.lastIndexOf(n); + if (lineIndex !== -1) return this.intro.substr(lineIndex + 1) + lineStr; + return this.intro + lineStr; + } + slice(start = 0, end = this.original.length) { + while (start < 0) start += this.original.length; + while (end < 0) end += this.original.length; + let result = ''; + + // find start chunk + let chunk = this.firstChunk; + while (chunk && (chunk.start > start || chunk.end <= start)) { + // found end chunk before start + if (chunk.start < end && chunk.end >= end) { + return result; + } + chunk = chunk.next; + } + if (chunk && chunk.edited && chunk.start !== start) throw new Error(\`Cannot use replaced character \${start} as slice start anchor.\`); + const startChunk = chunk; + while (chunk) { + if (chunk.intro && (startChunk !== chunk || chunk.start === start)) { + result += chunk.intro; + } + const containsEnd = chunk.start < end && chunk.end >= end; + if (containsEnd && chunk.edited && chunk.end !== end) throw new Error(\`Cannot use replaced character \${end} as slice end anchor.\`); + const sliceStart = startChunk === chunk ? start - chunk.start : 0; + const sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length; + result += chunk.content.slice(sliceStart, sliceEnd); + if (chunk.outro && (!containsEnd || chunk.end === end)) { + result += chunk.outro; + } + if (containsEnd) { + break; + } + chunk = chunk.next; + } + return result; + } + + // TODO deprecate this? not really very useful + snip(start, end) { + const clone = this.clone(); + clone.remove(0, start); + clone.remove(end, clone.original.length); + return clone; + } + _split(index) { + if (this.byStart[index] || this.byEnd[index]) return; + let chunk = this.lastSearchedChunk; + const searchForward = index > chunk.end; + while (chunk) { + if (chunk.contains(index)) return this._splitChunk(chunk, index); + chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start]; + } + } + _splitChunk(chunk, index) { + if (chunk.edited && chunk.content.length) { + // zero-length edited chunks are a special case (overlapping replacements) + const loc = getLocator(this.original)(index); + throw new Error(\`Cannot split a chunk that has already been edited (\${loc.line}:\${loc.column} – "\${chunk.original}")\`); + } + const newChunk = chunk.split(index); + this.byEnd[index] = chunk; + this.byStart[index] = newChunk; + this.byEnd[newChunk.end] = newChunk; + if (chunk === this.lastChunk) this.lastChunk = newChunk; + this.lastSearchedChunk = chunk; + return true; + } + toString() { + let str = this.intro; + let chunk = this.firstChunk; + while (chunk) { + str += chunk.toString(); + chunk = chunk.next; + } + return str + this.outro; + } + isEmpty() { + let chunk = this.firstChunk; + do { + if (chunk.intro.length && chunk.intro.trim() || chunk.content.length && chunk.content.trim() || chunk.outro.length && chunk.outro.trim()) return false; + } while (chunk = chunk.next); + return true; + } + length() { + let chunk = this.firstChunk; + let length = 0; + do { + length += chunk.intro.length + chunk.content.length + chunk.outro.length; + } while (chunk = chunk.next); + return length; + } + trimLines() { + return this.trim('[\\\\r\\\\n]'); + } + trim(charType) { + return this.trimStart(charType).trimEnd(charType); + } + trimEndAborted(charType) { + const rx = new RegExp((charType || '\\\\s') + '+$'); + this.outro = this.outro.replace(rx, ''); + if (this.outro.length) return true; + let chunk = this.lastChunk; + do { + const end = chunk.end; + const aborted = chunk.trimEnd(rx); + + // if chunk was trimmed, we have a new lastChunk + if (chunk.end !== end) { + if (this.lastChunk === chunk) { + this.lastChunk = chunk.next; + } + this.byEnd[chunk.end] = chunk; + this.byStart[chunk.next.start] = chunk.next; + this.byEnd[chunk.next.end] = chunk.next; + } + if (aborted) return true; + chunk = chunk.previous; + } while (chunk); + return false; + } + trimEnd(charType) { + this.trimEndAborted(charType); + return this; + } + trimStartAborted(charType) { + const rx = new RegExp('^' + (charType || '\\\\s') + '+'); + this.intro = this.intro.replace(rx, ''); + if (this.intro.length) return true; + let chunk = this.firstChunk; + do { + const end = chunk.end; + const aborted = chunk.trimStart(rx); + if (chunk.end !== end) { + // special case... + if (chunk === this.lastChunk) this.lastChunk = chunk.next; + this.byEnd[chunk.end] = chunk; + this.byStart[chunk.next.start] = chunk.next; + this.byEnd[chunk.next.end] = chunk.next; + } + if (aborted) return true; + chunk = chunk.next; + } while (chunk); + return false; + } + trimStart(charType) { + this.trimStartAborted(charType); + return this; + } + hasChanged() { + return this.original !== this.toString(); + } + _replaceRegexp(searchValue, replacement) { + function getReplacement(match, str) { + if (typeof replacement === 'string') { + return replacement.replace(/\\$(\\$|&|\\d+)/g, (_, i) => { + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_string_as_a_parameter + if (i === '$') return '$'; + if (i === '&') return match[0]; + const num = +i; + if (num < match.length) return match[+i]; + return \`$\${i}\`; + }); + } else { + return replacement(...match, match.index, str, match.groups); + } + } + function matchAll(re, str) { + let match; + const matches = []; + while (match = re.exec(str)) { + matches.push(match); + } + return matches; + } + if (searchValue.global) { + const matches = matchAll(searchValue, this.original); + matches.forEach(match => { + if (match.index != null) this.overwrite(match.index, match.index + match[0].length, getReplacement(match, this.original)); + }); + } else { + const match = this.original.match(searchValue); + if (match && match.index != null) this.overwrite(match.index, match.index + match[0].length, getReplacement(match, this.original)); + } + return this; + } + _replaceString(string, replacement) { + const original = this.original; + const index = original.indexOf(string); + if (index !== -1) { + this.overwrite(index, index + string.length, replacement); + } + return this; + } + replace(searchValue, replacement) { + if (typeof searchValue === 'string') { + return this._replaceString(searchValue, replacement); + } + return this._replaceRegexp(searchValue, replacement); + } + _replaceAllString(string, replacement) { + const original = this.original; + const stringLength = string.length; + for (let index = original.indexOf(string); index !== -1; index = original.indexOf(string, index + stringLength)) { + this.overwrite(index, index + stringLength, replacement); + } + return this; + } + replaceAll(searchValue, replacement) { + if (typeof searchValue === 'string') { + return this._replaceAllString(searchValue, replacement); + } + if (!searchValue.global) { + throw new TypeError('MagicString.prototype.replaceAll called with a non-global RegExp argument'); + } + return this._replaceRegexp(searchValue, replacement); + } +} +exports.SourceMap = SourceMap; +exports.default = MagicString; +//# sourceMappingURL=bundle-ly9OXwfJ.js.map +" +`; + +exports[`Outputs (swc) > artifacts > builds all the artifacts with rollup > lib/client.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: lib 'use strict'; @@ -1887,14 +10899,11 @@ async function createClient() { } exports.createClient = createClient; //# sourceMappingURL=client.js.map -", -] +" `; -exports[`Outputs (swc) artifacts builds all the artifacts with rollup 4`] = ` -[ - "lib/index.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Outputs (swc) > artifacts > builds all the artifacts with rollup > lib/index.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: lib 'use strict'; @@ -1902,62 +10911,7331 @@ exports[`Outputs (swc) artifacts builds all the artifacts with rollup 4`] = ` const EXAMPLE = 'foo'; exports.EXAMPLE = EXAMPLE; //# sourceMappingURL=index.js.map -", -] -`; - -exports[`Outputs (swc) artifacts builds all the artifacts with rollup 5`] = ` -[ - "lib/test.js", - "// Bundled with Packemon: https://packemon.dev -// Platform: native, Support: experimental, Format: lib - -'use strict'; - -class Spy { - called = false; - mock = () => {}; - method() {} -} -function spy() { - const inst = new Spy(); - return jest.fn(inst.mock); -} -async function wait() {} -exports.spy = spy; -exports.wait = wait; -//# sourceMappingURL=test.js.map -", -] +" `; - -exports[`Outputs (swc) artifacts builds all the artifacts with rollup 6`] = ` -[ - "package.json", - { - "browser": "./umd/client.js", - "dependencies": { - "typescript": "*", - }, - "main": "./lib/index.js", - "module": "./esm/client.js", - "name": "project-rollup", - "packemon": { - "inputs": { - "client": "src/client.ts", - "index": "src/index.ts", - "server": "src/server/core.ts", - "test": "src/test-utils/base.ts", - }, - }, - }, -] + +exports[`Outputs (swc) > artifacts > builds all the artifacts with rollup > lib/test.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: native, Support: experimental, Format: lib +'use strict';const _excluded=["maxLength"],_excluded2=["value"];function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key];}}return target;}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i=0)continue;target[key]=source[key];}return target;}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);icollector.add(key);Object.getOwnPropertyNames(obj).forEach(collect);Object.getOwnPropertySymbols(obj).forEach(collect);}function getOwnProperties(obj){const ownProps=/* @__PURE__ */new Set();if(isFinalObj(obj))return[];collectOwnProperties(obj,ownProps);return Array.from(ownProps);}const defaultCloneOptions={forceWritable:false};function deepClone(val,options=defaultCloneOptions){const seen=/* @__PURE__ */new WeakMap();return clone(val,seen,options);}function clone(val,seen,options=defaultCloneOptions){let k,out;if(seen.has(val))return seen.get(val);if(Array.isArray(val)){out=Array(k=val.length);seen.set(val,out);while(k--)out[k]=clone(val[k],seen,options);return out;}if(Object.prototype.toString.call(val)==="[object Object]"){out=Object.create(Object.getPrototypeOf(val));seen.set(val,out);const props=getOwnProperties(val);for(const k2 of props){const descriptor=Object.getOwnPropertyDescriptor(val,k2);if(!descriptor)continue;const cloned=clone(val[k2],seen,options);if("get"in descriptor){Object.defineProperty(out,k2,_objectSpread(_objectSpread({},descriptor),{},{get(){return cloned;}}));}else{Object.defineProperty(out,k2,_objectSpread(_objectSpread({},descriptor),{},{writable:options.forceWritable?true:descriptor.writable,value:cloned}));}}return out;}return val;}function objectAttr(source,path,defaultValue=void 0){const paths=path.replace(/\\[(\\d+)\\]/g,".$1").split(".");let result=source;for(const p of paths){result=Object(result)[p];if(result===void 0)return defaultValue;}return result;}function createDefer(){let resolve=null;let reject=null;const p=new Promise((_resolve,_reject)=>{resolve=_resolve;reject=_reject;});p.resolve=resolve;p.reject=reject;return p;}var commonjsGlobal$1=typeof globalThis!=='undefined'?globalThis:typeof window!=='undefined'?window:typeof global!=='undefined'?global:typeof self!=='undefined'?self:{};function getDefaultExportFromCjs$2(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,'default')?x['default']:x;}function getAugmentedNamespace(n){if(n.__esModule)return n;var f=n.default;if(typeof f=="function"){var a=function a(){if(this instanceof a){return Reflect.construct(f,arguments,this.constructor);}return f.apply(this,arguments);};a.prototype=f.prototype;}else a={};Object.defineProperty(a,'__esModule',{value:true});Object.keys(n).forEach(function(k){var d=Object.getOwnPropertyDescriptor(n,k);Object.defineProperty(a,k,d.get?d:{enumerable:true,get:function(){return n[k];}});});return a;}var build$1={};var ansiStyles={exports:{}};ansiStyles.exports;(function(module){const ANSI_BACKGROUND_OFFSET=10;const wrapAnsi256=(offset=0)=>code=>\`\\u001B[\${38+offset};5;\${code}m\`;const wrapAnsi16m=(offset=0)=>(red,green,blue)=>\`\\u001B[\${38+offset};2;\${red};\${green};\${blue}m\`;function assembleStyles(){const codes=new Map();const styles={modifier:{reset:[0,0],// 21 isn't widely supported and 22 does the same thing +bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],// Bright color +blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],// Bright color +bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};// Alias bright black as gray (and grey) +styles.color.gray=styles.color.blackBright;styles.bgColor.bgGray=styles.bgColor.bgBlackBright;styles.color.grey=styles.color.blackBright;styles.bgColor.bgGrey=styles.bgColor.bgBlackBright;for(const _ref of Object.entries(styles)){var _ref2=_slicedToArray(_ref,2);const groupName=_ref2[0];const group=_ref2[1];for(const _ref3 of Object.entries(group)){var _ref4=_slicedToArray(_ref3,2);const styleName=_ref4[0];const style=_ref4[1];styles[styleName]={open:\`\\u001B[\${style[0]}m\`,close:\`\\u001B[\${style[1]}m\`};group[styleName]=styles[styleName];codes.set(style[0],style[1]);}Object.defineProperty(styles,groupName,{value:group,enumerable:false});}Object.defineProperty(styles,'codes',{value:codes,enumerable:false});styles.color.close='\\u001B[39m';styles.bgColor.close='\\u001B[49m';styles.color.ansi256=wrapAnsi256();styles.color.ansi16m=wrapAnsi16m();styles.bgColor.ansi256=wrapAnsi256(ANSI_BACKGROUND_OFFSET);styles.bgColor.ansi16m=wrapAnsi16m(ANSI_BACKGROUND_OFFSET);// From https://github.com/Qix-/color-convert/blob/3f0e0d4e92e235796ccb17f6e85c72094a651f49/conversions.js +Object.defineProperties(styles,{rgbToAnsi256:{value:(red,green,blue)=>{// We use the extended greyscale palette here, with the exception of +// black and white. normal palette only has 4 greyscale shades. +if(red===green&&green===blue){if(red<8){return 16;}if(red>248){return 231;}return Math.round((red-8)/247*24)+232;}return 16+36*Math.round(red/255*5)+6*Math.round(green/255*5)+Math.round(blue/255*5);},enumerable:false},hexToRgb:{value:hex=>{const matches=/(?[a-f\\d]{6}|[a-f\\d]{3})/i.exec(hex.toString(16));if(!matches){return[0,0,0];}let colorString=matches.groups.colorString;if(colorString.length===3){colorString=colorString.split('').map(character=>character+character).join('');}const integer=Number.parseInt(colorString,16);return[integer>>16&0xFF,integer>>8&0xFF,integer&0xFF];},enumerable:false},hexToAnsi256:{value:hex=>styles.rgbToAnsi256(...styles.hexToRgb(hex)),enumerable:false}});return styles;}// Make the export immutable +Object.defineProperty(module,'exports',{enumerable:true,get:assembleStyles});})(ansiStyles);var ansiStylesExports=ansiStyles.exports;var collections={};Object.defineProperty(collections,'__esModule',{value:true});collections.printIteratorEntries=printIteratorEntries;collections.printIteratorValues=printIteratorValues;collections.printListItems=printListItems;collections.printObjectProperties=printObjectProperties;/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */const getKeysOfEnumerableProperties=(object,compareKeys)=>{const rawKeys=Object.keys(object);const keys=compareKeys!==null?rawKeys.sort(compareKeys):rawKeys;if(Object.getOwnPropertySymbols){Object.getOwnPropertySymbols(object).forEach(symbol=>{if(Object.getOwnPropertyDescriptor(object,symbol).enumerable){keys.push(symbol);}});}return keys;};/** + * Return entries (for example, of a map) + * with spacing, indentation, and comma + * without surrounding punctuation (for example, braces) + */function printIteratorEntries(iterator,config,indentation,depth,refs,printer,// Too bad, so sad that separator for ECMAScript Map has been ' => ' +// What a distracting diff if you change a data structure to/from +// ECMAScript Object or Immutable.Map/OrderedMap which use the default. +separator=': '){let result='';let width=0;let current=iterator.next();if(!current.done){result+=config.spacingOuter;const indentationNext=indentation+config.indent;while(!current.done){result+=indentationNext;if(width++===config.maxWidth){result+='…';break;}const name=printer(current.value[0],config,indentationNext,depth,refs);const value=printer(current.value[1],config,indentationNext,depth,refs);result+=name+separator+value;current=iterator.next();if(!current.done){result+=\`,\${config.spacingInner}\`;}else if(!config.min){result+=',';}}result+=config.spacingOuter+indentation;}return result;}/** + * Return values (for example, of a set) + * with spacing, indentation, and comma + * without surrounding punctuation (braces or brackets) + */function printIteratorValues(iterator,config,indentation,depth,refs,printer){let result='';let width=0;let current=iterator.next();if(!current.done){result+=config.spacingOuter;const indentationNext=indentation+config.indent;while(!current.done){result+=indentationNext;if(width++===config.maxWidth){result+='…';break;}result+=printer(current.value,config,indentationNext,depth,refs);current=iterator.next();if(!current.done){result+=\`,\${config.spacingInner}\`;}else if(!config.min){result+=',';}}result+=config.spacingOuter+indentation;}return result;}/** + * Return items (for example, of an array) + * with spacing, indentation, and comma + * without surrounding punctuation (for example, brackets) + **/function printListItems(list,config,indentation,depth,refs,printer){let result='';if(list.length){result+=config.spacingOuter;const indentationNext=indentation+config.indent;for(let i=0;i{const stringedValue=val.toString();if(stringedValue==='ArrayContaining'||stringedValue==='ArrayNotContaining'){if(++depth>config.maxDepth){return\`[\${stringedValue}]\`;}return\`\${stringedValue+SPACE$2}[\${(0,_collections$3.printListItems)(val.sample,config,indentation,depth,refs,printer)}]\`;}if(stringedValue==='ObjectContaining'||stringedValue==='ObjectNotContaining'){if(++depth>config.maxDepth){return\`[\${stringedValue}]\`;}return\`\${stringedValue+SPACE$2}{\${(0,_collections$3.printObjectProperties)(val.sample,config,indentation,depth,refs,printer)}}\`;}if(stringedValue==='StringMatching'||stringedValue==='StringNotMatching'){return stringedValue+SPACE$2+printer(val.sample,config,indentation,depth,refs);}if(stringedValue==='StringContaining'||stringedValue==='StringNotContaining'){return stringedValue+SPACE$2+printer(val.sample,config,indentation,depth,refs);}if(typeof val.toAsymmetricMatcher!=='function'){throw new Error(\`Asymmetric matcher \${val.constructor.name} does not implement toAsymmetricMatcher()\`);}return val.toAsymmetricMatcher();};AsymmetricMatcher$4.serialize=serialize$7;const test$7=val=>val&&val.$$typeof===asymmetricMatcher;AsymmetricMatcher$4.test=test$7;const plugin$6={serialize:serialize$7,test:test$7};var _default$7=plugin$6;AsymmetricMatcher$4.default=_default$7;var DOMCollection$3={};Object.defineProperty(DOMCollection$3,'__esModule',{value:true});DOMCollection$3.test=DOMCollection$3.serialize=DOMCollection$3.default=void 0;var _collections$2=collections;/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */const SPACE$1=' ';const OBJECT_NAMES=['DOMStringMap','NamedNodeMap'];const ARRAY_REGEXP=/^(HTML\\w*Collection|NodeList)$/;const testName=name=>OBJECT_NAMES.indexOf(name)!==-1||ARRAY_REGEXP.test(name);const test$6=val=>val&&val.constructor&&!!val.constructor.name&&testName(val.constructor.name);DOMCollection$3.test=test$6;const isNamedNodeMap=collection=>collection.constructor.name==='NamedNodeMap';const serialize$6=(collection,config,indentation,depth,refs,printer)=>{const name=collection.constructor.name;if(++depth>config.maxDepth){return\`[\${name}]\`;}return(config.min?'':name+SPACE$1)+(OBJECT_NAMES.indexOf(name)!==-1?\`{\${(0,_collections$2.printObjectProperties)(isNamedNodeMap(collection)?Array.from(collection).reduce((props,attribute)=>{props[attribute.name]=attribute.value;return props;},{}):_objectSpread({},collection),config,indentation,depth,refs,printer)}}\`:\`[\${(0,_collections$2.printListItems)(Array.from(collection),config,indentation,depth,refs,printer)}]\`);};DOMCollection$3.serialize=serialize$6;const plugin$5={serialize:serialize$6,test:test$6};var _default$6=plugin$5;DOMCollection$3.default=_default$6;var DOMElement$3={};var markup={};var escapeHTML$1={};Object.defineProperty(escapeHTML$1,'__esModule',{value:true});escapeHTML$1.default=escapeHTML;/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */function escapeHTML(str){return str.replace(//g,'>');}Object.defineProperty(markup,'__esModule',{value:true});markup.printText=markup.printProps=markup.printElementAsLeaf=markup.printElement=markup.printComment=markup.printChildren=void 0;var _escapeHTML=_interopRequireDefault$1(escapeHTML$1);function _interopRequireDefault$1(obj){return obj&&obj.__esModule?obj:{default:obj};}/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ // Return empty string if keys is empty. +const printProps=(keys,props,config,indentation,depth,refs,printer)=>{const indentationNext=indentation+config.indent;const colors=config.colors;return keys.map(key=>{const value=props[key];let printed=printer(value,config,indentationNext,depth,refs);if(typeof value!=='string'){if(printed.indexOf('\\n')!==-1){printed=config.spacingOuter+indentationNext+printed+config.spacingOuter+indentation;}printed=\`{\${printed}}\`;}return\`\${config.spacingInner+indentation+colors.prop.open+key+colors.prop.close}=\${colors.value.open}\${printed}\${colors.value.close}\`;}).join('');};// Return empty string if children is empty. +markup.printProps=printProps;const printChildren=(children,config,indentation,depth,refs,printer)=>children.map(child=>config.spacingOuter+indentation+(typeof child==='string'?printText(child,config):printer(child,config,indentation,depth,refs))).join('');markup.printChildren=printChildren;const printText=(text,config)=>{const contentColor=config.colors.content;return contentColor.open+(0,_escapeHTML.default)(text)+contentColor.close;};markup.printText=printText;const printComment=(comment,config)=>{const commentColor=config.colors.comment;return\`\${commentColor.open}\${commentColor.close}\`;};// Separate the functions to format props, children, and element, +// so a plugin could override a particular function, if needed. +// Too bad, so sad: the traditional (but unnecessary) space +// in a self-closing tagColor requires a second test of printedProps. +markup.printComment=printComment;const printElement=(type,printedProps,printedChildren,config,indentation)=>{const tagColor=config.colors.tag;return\`\${tagColor.open}<\${type}\${printedProps&&tagColor.close+printedProps+config.spacingOuter+indentation+tagColor.open}\${printedChildren?\`>\${tagColor.close}\${printedChildren}\${config.spacingOuter}\${indentation}\${tagColor.open}\${tagColor.close}\`;};markup.printElement=printElement;const printElementAsLeaf=(type,config)=>{const tagColor=config.colors.tag;return\`\${tagColor.open}<\${type}\${tagColor.close} …\${tagColor.open} />\${tagColor.close}\`;};markup.printElementAsLeaf=printElementAsLeaf;Object.defineProperty(DOMElement$3,'__esModule',{value:true});DOMElement$3.test=DOMElement$3.serialize=DOMElement$3.default=void 0;var _markup$2=markup;/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */const ELEMENT_NODE=1;const TEXT_NODE=3;const COMMENT_NODE=8;const FRAGMENT_NODE=11;const ELEMENT_REGEXP=/^((HTML|SVG)\\w*)?Element$/;const testHasAttribute=val=>{try{return typeof val.hasAttribute==='function'&&val.hasAttribute('is');}catch{return false;}};const testNode=val=>{const constructorName=val.constructor.name;const nodeType=val.nodeType,tagName=val.tagName;const isCustomElement=typeof tagName==='string'&&tagName.includes('-')||testHasAttribute(val);return nodeType===ELEMENT_NODE&&(ELEMENT_REGEXP.test(constructorName)||isCustomElement)||nodeType===TEXT_NODE&&constructorName==='Text'||nodeType===COMMENT_NODE&&constructorName==='Comment'||nodeType===FRAGMENT_NODE&&constructorName==='DocumentFragment';};const test$5=val=>val?.constructor?.name&&testNode(val);DOMElement$3.test=test$5;function nodeIsText(node){return node.nodeType===TEXT_NODE;}function nodeIsComment(node){return node.nodeType===COMMENT_NODE;}function nodeIsFragment(node){return node.nodeType===FRAGMENT_NODE;}const serialize$5=(node,config,indentation,depth,refs,printer)=>{if(nodeIsText(node)){return(0,_markup$2.printText)(node.data,config);}if(nodeIsComment(node)){return(0,_markup$2.printComment)(node.data,config);}const type=nodeIsFragment(node)?'DocumentFragment':node.tagName.toLowerCase();if(++depth>config.maxDepth){return(0,_markup$2.printElementAsLeaf)(type,config);}return(0,_markup$2.printElement)(type,(0,_markup$2.printProps)(nodeIsFragment(node)?[]:Array.from(node.attributes,attr=>attr.name).sort(),nodeIsFragment(node)?{}:Array.from(node.attributes).reduce((props,attribute)=>{props[attribute.name]=attribute.value;return props;},{}),config,indentation+config.indent,depth,refs,printer),(0,_markup$2.printChildren)(Array.prototype.slice.call(node.childNodes||node.children),config,indentation+config.indent,depth,refs,printer),config,indentation);};DOMElement$3.serialize=serialize$5;const plugin$4={serialize:serialize$5,test:test$5};var _default$5=plugin$4;DOMElement$3.default=_default$5;var Immutable$3={};Object.defineProperty(Immutable$3,'__esModule',{value:true});Immutable$3.test=Immutable$3.serialize=Immutable$3.default=void 0;var _collections$1=collections;/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ // SENTINEL constants are from https://github.com/facebook/immutable-js +const IS_ITERABLE_SENTINEL='@@__IMMUTABLE_ITERABLE__@@';const IS_LIST_SENTINEL='@@__IMMUTABLE_LIST__@@';const IS_KEYED_SENTINEL$1='@@__IMMUTABLE_KEYED__@@';const IS_MAP_SENTINEL='@@__IMMUTABLE_MAP__@@';const IS_ORDERED_SENTINEL$1='@@__IMMUTABLE_ORDERED__@@';const IS_RECORD_SENTINEL='@@__IMMUTABLE_RECORD__@@';// immutable v4 +const IS_SEQ_SENTINEL='@@__IMMUTABLE_SEQ__@@';const IS_SET_SENTINEL$1='@@__IMMUTABLE_SET__@@';const IS_STACK_SENTINEL='@@__IMMUTABLE_STACK__@@';const getImmutableName=name=>\`Immutable.\${name}\`;const printAsLeaf=name=>\`[\${name}]\`;const SPACE=' ';const LAZY='…';// Seq is lazy if it calls a method like filter +const printImmutableEntries=(val,config,indentation,depth,refs,printer,type)=>++depth>config.maxDepth?printAsLeaf(getImmutableName(type)):\`\${getImmutableName(type)+SPACE}{\${(0,_collections$1.printIteratorEntries)(val.entries(),config,indentation,depth,refs,printer)}}\`;// Record has an entries method because it is a collection in immutable v3. +// Return an iterator for Immutable Record from version v3 or v4. +function getRecordEntries(val){let i=0;return{next(){if(i{// _name property is defined only for an Immutable Record instance +// which was constructed with a second optional descriptive name arg +const name=getImmutableName(val._name||'Record');return++depth>config.maxDepth?printAsLeaf(name):\`\${name+SPACE}{\${(0,_collections$1.printIteratorEntries)(getRecordEntries(val),config,indentation,depth,refs,printer)}}\`;};const printImmutableSeq=(val,config,indentation,depth,refs,printer)=>{const name=getImmutableName('Seq');if(++depth>config.maxDepth){return printAsLeaf(name);}if(val[IS_KEYED_SENTINEL$1]){return\`\${name+SPACE}{\${// from Immutable collection of entries or from ECMAScript object +val._iter||val._object?(0,_collections$1.printIteratorEntries)(val.entries(),config,indentation,depth,refs,printer):LAZY}}\`;}return\`\${name+SPACE}[\${val._iter||// from Immutable collection of values +val._array||// from ECMAScript array +val._collection||// from ECMAScript collection in immutable v4 +val._iterable// from ECMAScript collection in immutable v3 +?(0,_collections$1.printIteratorValues)(val.values(),config,indentation,depth,refs,printer):LAZY}]\`;};const printImmutableValues=(val,config,indentation,depth,refs,printer,type)=>++depth>config.maxDepth?printAsLeaf(getImmutableName(type)):\`\${getImmutableName(type)+SPACE}[\${(0,_collections$1.printIteratorValues)(val.values(),config,indentation,depth,refs,printer)}]\`;const serialize$4=(val,config,indentation,depth,refs,printer)=>{if(val[IS_MAP_SENTINEL]){return printImmutableEntries(val,config,indentation,depth,refs,printer,val[IS_ORDERED_SENTINEL$1]?'OrderedMap':'Map');}if(val[IS_LIST_SENTINEL]){return printImmutableValues(val,config,indentation,depth,refs,printer,'List');}if(val[IS_SET_SENTINEL$1]){return printImmutableValues(val,config,indentation,depth,refs,printer,val[IS_ORDERED_SENTINEL$1]?'OrderedSet':'Set');}if(val[IS_STACK_SENTINEL]){return printImmutableValues(val,config,indentation,depth,refs,printer,'Stack');}if(val[IS_SEQ_SENTINEL]){return printImmutableSeq(val,config,indentation,depth,refs,printer);}// For compatibility with immutable v3 and v4, let record be the default. +return printImmutableRecord(val,config,indentation,depth,refs,printer);};// Explicitly comparing sentinel properties to true avoids false positive +// when mock identity-obj-proxy returns the key as the value for any key. +Immutable$3.serialize=serialize$4;const test$4=val=>val&&(val[IS_ITERABLE_SENTINEL]===true||val[IS_RECORD_SENTINEL]===true);Immutable$3.test=test$4;const plugin$3={serialize:serialize$4,test:test$4};var _default$4=plugin$3;Immutable$3.default=_default$4;var ReactElement$3={};var reactIs={exports:{}};var reactIs_production_min={};/** + * @license React + * react-is.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var hasRequiredReactIs_production_min;function requireReactIs_production_min(){if(hasRequiredReactIs_production_min)return reactIs_production_min;hasRequiredReactIs_production_min=1;var b=Symbol.for("react.element"),c=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),e=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),g=Symbol.for("react.provider"),h=Symbol.for("react.context"),k=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),n=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),t=Symbol.for("react.offscreen"),u;u=Symbol.for("react.module.reference");function v(a){if("object"===typeof a&&null!==a){var r=a.$$typeof;switch(r){case b:switch(a=a.type,a){case d:case f:case e:case m:case n:return a;default:switch(a=a&&a.$$typeof,a){case k:case h:case l:case q:case p:case g:return a;default:return r;}}case c:return r;}}}reactIs_production_min.ContextConsumer=h;reactIs_production_min.ContextProvider=g;reactIs_production_min.Element=b;reactIs_production_min.ForwardRef=l;reactIs_production_min.Fragment=d;reactIs_production_min.Lazy=q;reactIs_production_min.Memo=p;reactIs_production_min.Portal=c;reactIs_production_min.Profiler=f;reactIs_production_min.StrictMode=e;reactIs_production_min.Suspense=m;reactIs_production_min.SuspenseList=n;reactIs_production_min.isAsyncMode=function(){return!1;};reactIs_production_min.isConcurrentMode=function(){return!1;};reactIs_production_min.isContextConsumer=function(a){return v(a)===h;};reactIs_production_min.isContextProvider=function(a){return v(a)===g;};reactIs_production_min.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===b;};reactIs_production_min.isForwardRef=function(a){return v(a)===l;};reactIs_production_min.isFragment=function(a){return v(a)===d;};reactIs_production_min.isLazy=function(a){return v(a)===q;};reactIs_production_min.isMemo=function(a){return v(a)===p;};reactIs_production_min.isPortal=function(a){return v(a)===c;};reactIs_production_min.isProfiler=function(a){return v(a)===f;};reactIs_production_min.isStrictMode=function(a){return v(a)===e;};reactIs_production_min.isSuspense=function(a){return v(a)===m;};reactIs_production_min.isSuspenseList=function(a){return v(a)===n;};reactIs_production_min.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===d||a===f||a===e||a===m||a===n||a===t||"object"===typeof a&&null!==a&&(a.$$typeof===q||a.$$typeof===p||a.$$typeof===g||a.$$typeof===h||a.$$typeof===l||a.$$typeof===u||void 0!==a.getModuleId)?!0:!1;};reactIs_production_min.typeOf=v;return reactIs_production_min;}var reactIs_development={};/** + * @license React + * react-is.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var hasRequiredReactIs_development;function requireReactIs_development(){if(hasRequiredReactIs_development)return reactIs_development;hasRequiredReactIs_development=1;if(process.env.NODE_ENV!=="production"){(function(){// ----------------------------------------------------------------------------- +var enableScopeAPI=false;// Experimental Create Event Handle API. +var enableCacheElement=false;var enableTransitionTracing=false;// No known bugs, but needs performance testing +var enableLegacyHidden=false;// Enables unstable_avoidThisFallback feature in Fiber +// stuff. Intended to enable React core members to more easily debug scheduling +// issues in DEV builds. +var enableDebugTracing=false;// Track which Fiber(s) schedule render work. +// ATTENTION +var REACT_ELEMENT_TYPE=Symbol.for('react.element');var REACT_PORTAL_TYPE=Symbol.for('react.portal');var REACT_FRAGMENT_TYPE=Symbol.for('react.fragment');var REACT_STRICT_MODE_TYPE=Symbol.for('react.strict_mode');var REACT_PROFILER_TYPE=Symbol.for('react.profiler');var REACT_PROVIDER_TYPE=Symbol.for('react.provider');var REACT_CONTEXT_TYPE=Symbol.for('react.context');var REACT_SERVER_CONTEXT_TYPE=Symbol.for('react.server_context');var REACT_FORWARD_REF_TYPE=Symbol.for('react.forward_ref');var REACT_SUSPENSE_TYPE=Symbol.for('react.suspense');var REACT_SUSPENSE_LIST_TYPE=Symbol.for('react.suspense_list');var REACT_MEMO_TYPE=Symbol.for('react.memo');var REACT_LAZY_TYPE=Symbol.for('react.lazy');var REACT_OFFSCREEN_TYPE=Symbol.for('react.offscreen');var REACT_MODULE_REFERENCE;{REACT_MODULE_REFERENCE=Symbol.for('react.module.reference');}function isValidElementType(type){if(typeof type==='string'||typeof type==='function'){return true;}// Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill). +if(type===REACT_FRAGMENT_TYPE||type===REACT_PROFILER_TYPE||enableDebugTracing||type===REACT_STRICT_MODE_TYPE||type===REACT_SUSPENSE_TYPE||type===REACT_SUSPENSE_LIST_TYPE||enableLegacyHidden||type===REACT_OFFSCREEN_TYPE||enableScopeAPI||enableCacheElement||enableTransitionTracing){return true;}if(typeof type==='object'&&type!==null){if(type.$$typeof===REACT_LAZY_TYPE||type.$$typeof===REACT_MEMO_TYPE||type.$$typeof===REACT_PROVIDER_TYPE||type.$$typeof===REACT_CONTEXT_TYPE||type.$$typeof===REACT_FORWARD_REF_TYPE||// This needs to include all possible module reference object +// types supported by any Flight configuration anywhere since +// we don't know which Flight build this will end up being used +// with. +type.$$typeof===REACT_MODULE_REFERENCE||type.getModuleId!==undefined){return true;}}return false;}function typeOf(object){if(typeof object==='object'&&object!==null){var $$typeof=object.$$typeof;switch($$typeof){case REACT_ELEMENT_TYPE:var type=object.type;switch(type){case REACT_FRAGMENT_TYPE:case REACT_PROFILER_TYPE:case REACT_STRICT_MODE_TYPE:case REACT_SUSPENSE_TYPE:case REACT_SUSPENSE_LIST_TYPE:return type;default:var $$typeofType=type&&type.$$typeof;switch($$typeofType){case REACT_SERVER_CONTEXT_TYPE:case REACT_CONTEXT_TYPE:case REACT_FORWARD_REF_TYPE:case REACT_LAZY_TYPE:case REACT_MEMO_TYPE:case REACT_PROVIDER_TYPE:return $$typeofType;default:return $$typeof;}}case REACT_PORTAL_TYPE:return $$typeof;}}return undefined;}var ContextConsumer=REACT_CONTEXT_TYPE;var ContextProvider=REACT_PROVIDER_TYPE;var Element=REACT_ELEMENT_TYPE;var ForwardRef=REACT_FORWARD_REF_TYPE;var Fragment=REACT_FRAGMENT_TYPE;var Lazy=REACT_LAZY_TYPE;var Memo=REACT_MEMO_TYPE;var Portal=REACT_PORTAL_TYPE;var Profiler=REACT_PROFILER_TYPE;var StrictMode=REACT_STRICT_MODE_TYPE;var Suspense=REACT_SUSPENSE_TYPE;var SuspenseList=REACT_SUSPENSE_LIST_TYPE;var hasWarnedAboutDeprecatedIsAsyncMode=false;var hasWarnedAboutDeprecatedIsConcurrentMode=false;// AsyncMode should be deprecated +function isAsyncMode(object){{if(!hasWarnedAboutDeprecatedIsAsyncMode){hasWarnedAboutDeprecatedIsAsyncMode=true;// Using console['warn'] to evade Babel and ESLint +console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, '+'and will be removed in React 18+.');}}return false;}function isConcurrentMode(object){{if(!hasWarnedAboutDeprecatedIsConcurrentMode){hasWarnedAboutDeprecatedIsConcurrentMode=true;// Using console['warn'] to evade Babel and ESLint +console['warn']('The ReactIs.isConcurrentMode() alias has been deprecated, '+'and will be removed in React 18+.');}}return false;}function isContextConsumer(object){return typeOf(object)===REACT_CONTEXT_TYPE;}function isContextProvider(object){return typeOf(object)===REACT_PROVIDER_TYPE;}function isElement(object){return typeof object==='object'&&object!==null&&object.$$typeof===REACT_ELEMENT_TYPE;}function isForwardRef(object){return typeOf(object)===REACT_FORWARD_REF_TYPE;}function isFragment(object){return typeOf(object)===REACT_FRAGMENT_TYPE;}function isLazy(object){return typeOf(object)===REACT_LAZY_TYPE;}function isMemo(object){return typeOf(object)===REACT_MEMO_TYPE;}function isPortal(object){return typeOf(object)===REACT_PORTAL_TYPE;}function isProfiler(object){return typeOf(object)===REACT_PROFILER_TYPE;}function isStrictMode(object){return typeOf(object)===REACT_STRICT_MODE_TYPE;}function isSuspense(object){return typeOf(object)===REACT_SUSPENSE_TYPE;}function isSuspenseList(object){return typeOf(object)===REACT_SUSPENSE_LIST_TYPE;}reactIs_development.ContextConsumer=ContextConsumer;reactIs_development.ContextProvider=ContextProvider;reactIs_development.Element=Element;reactIs_development.ForwardRef=ForwardRef;reactIs_development.Fragment=Fragment;reactIs_development.Lazy=Lazy;reactIs_development.Memo=Memo;reactIs_development.Portal=Portal;reactIs_development.Profiler=Profiler;reactIs_development.StrictMode=StrictMode;reactIs_development.Suspense=Suspense;reactIs_development.SuspenseList=SuspenseList;reactIs_development.isAsyncMode=isAsyncMode;reactIs_development.isConcurrentMode=isConcurrentMode;reactIs_development.isContextConsumer=isContextConsumer;reactIs_development.isContextProvider=isContextProvider;reactIs_development.isElement=isElement;reactIs_development.isForwardRef=isForwardRef;reactIs_development.isFragment=isFragment;reactIs_development.isLazy=isLazy;reactIs_development.isMemo=isMemo;reactIs_development.isPortal=isPortal;reactIs_development.isProfiler=isProfiler;reactIs_development.isStrictMode=isStrictMode;reactIs_development.isSuspense=isSuspense;reactIs_development.isSuspenseList=isSuspenseList;reactIs_development.isValidElementType=isValidElementType;reactIs_development.typeOf=typeOf;})();}return reactIs_development;}if(process.env.NODE_ENV==='production'){reactIs.exports=requireReactIs_production_min();}else{reactIs.exports=requireReactIs_development();}var reactIsExports=reactIs.exports;Object.defineProperty(ReactElement$3,'__esModule',{value:true});ReactElement$3.test=ReactElement$3.serialize=ReactElement$3.default=void 0;var ReactIs=_interopRequireWildcard(reactIsExports);var _markup$1=markup;function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=='function')return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=='object'&&typeof obj!=='function'){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=='default'&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ // Given element.props.children, or subtree during recursive traversal, +// return flattened array of children. +const getChildren=(arg,children=[])=>{if(Array.isArray(arg)){arg.forEach(item=>{getChildren(item,children);});}else if(arg!=null&&arg!==false){children.push(arg);}return children;};const getType$1=element=>{const type=element.type;if(typeof type==='string'){return type;}if(typeof type==='function'){return type.displayName||type.name||'Unknown';}if(ReactIs.isFragment(element)){return'React.Fragment';}if(ReactIs.isSuspense(element)){return'React.Suspense';}if(typeof type==='object'&&type!==null){if(ReactIs.isContextProvider(element)){return'Context.Provider';}if(ReactIs.isContextConsumer(element)){return'Context.Consumer';}if(ReactIs.isForwardRef(element)){if(type.displayName){return type.displayName;}const functionName=type.render.displayName||type.render.name||'';return functionName!==''?\`ForwardRef(\${functionName})\`:'ForwardRef';}if(ReactIs.isMemo(element)){const functionName=type.displayName||type.type.displayName||type.type.name||'';return functionName!==''?\`Memo(\${functionName})\`:'Memo';}}return'UNDEFINED';};const getPropKeys$1=element=>{const props=element.props;return Object.keys(props).filter(key=>key!=='children'&&props[key]!==undefined).sort();};const serialize$3=(element,config,indentation,depth,refs,printer)=>++depth>config.maxDepth?(0,_markup$1.printElementAsLeaf)(getType$1(element),config):(0,_markup$1.printElement)(getType$1(element),(0,_markup$1.printProps)(getPropKeys$1(element),element.props,config,indentation+config.indent,depth,refs,printer),(0,_markup$1.printChildren)(getChildren(element.props.children),config,indentation+config.indent,depth,refs,printer),config,indentation);ReactElement$3.serialize=serialize$3;const test$3=val=>val!=null&&ReactIs.isElement(val);ReactElement$3.test=test$3;const plugin$2={serialize:serialize$3,test:test$3};var _default$3=plugin$2;ReactElement$3.default=_default$3;var ReactTestComponent$3={};Object.defineProperty(ReactTestComponent$3,'__esModule',{value:true});ReactTestComponent$3.test=ReactTestComponent$3.serialize=ReactTestComponent$3.default=void 0;var _markup=markup;var Symbol$1=globalThis['jest-symbol-do-not-touch']||globalThis.Symbol;/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ // Child can be \`number\` in Stack renderer but not in Fiber renderer. +const testSymbol=typeof Symbol$1==='function'&&Symbol$1.for?Symbol$1.for('react.test.json'):0xea71357;const getPropKeys=object=>{const props=object.props;return props?Object.keys(props).filter(key=>props[key]!==undefined).sort():[];};const serialize$2=(object,config,indentation,depth,refs,printer)=>++depth>config.maxDepth?(0,_markup.printElementAsLeaf)(object.type,config):(0,_markup.printElement)(object.type,object.props?(0,_markup.printProps)(getPropKeys(object),object.props,config,indentation+config.indent,depth,refs,printer):'',object.children?(0,_markup.printChildren)(object.children,config,indentation+config.indent,depth,refs,printer):'',config,indentation);ReactTestComponent$3.serialize=serialize$2;const test$2=val=>val&&val.$$typeof===testSymbol;ReactTestComponent$3.test=test$2;const plugin$1={serialize:serialize$2,test:test$2};var _default$2=plugin$1;ReactTestComponent$3.default=_default$2;Object.defineProperty(build$1,'__esModule',{value:true});build$1.default=build$1.DEFAULT_OPTIONS=void 0;var format_1=build$1.format=format$1;var plugins_1=build$1.plugins=void 0;var _ansiStyles=_interopRequireDefault(ansiStylesExports);var _collections=collections;var _AsymmetricMatcher=_interopRequireDefault(AsymmetricMatcher$4);var _DOMCollection=_interopRequireDefault(DOMCollection$3);var _DOMElement=_interopRequireDefault(DOMElement$3);var _Immutable=_interopRequireDefault(Immutable$3);var _ReactElement=_interopRequireDefault(ReactElement$3);var _ReactTestComponent=_interopRequireDefault(ReactTestComponent$3);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ /* eslint-disable local/ban-types-eventually */const toString$2=Object.prototype.toString;const toISOString=Date.prototype.toISOString;const errorToString=Error.prototype.toString;const regExpToString=RegExp.prototype.toString;/** + * Explicitly comparing typeof constructor to function avoids undefined as name + * when mock identity-obj-proxy returns the key as the value for any key. + */const getConstructorName$1=val=>typeof val.constructor==='function'&&val.constructor.name||'Object';/* global window */ /** Is val is equal to global window object? Works even if it does not exist :) */const isWindow=val=>typeof window!=='undefined'&&val===window;const SYMBOL_REGEXP=/^Symbol\\((.*)\\)(.*)$/;const NEWLINE_REGEXP=/\\n/gi;class PrettyFormatPluginError extends Error{constructor(message,stack){super(message);this.stack=stack;this.name=this.constructor.name;}}function isToStringedArrayType(toStringed){return toStringed==='[object Array]'||toStringed==='[object ArrayBuffer]'||toStringed==='[object DataView]'||toStringed==='[object Float32Array]'||toStringed==='[object Float64Array]'||toStringed==='[object Int8Array]'||toStringed==='[object Int16Array]'||toStringed==='[object Int32Array]'||toStringed==='[object Uint8Array]'||toStringed==='[object Uint8ClampedArray]'||toStringed==='[object Uint16Array]'||toStringed==='[object Uint32Array]';}function printNumber(val){return Object.is(val,-0)?'-0':String(val);}function printBigInt(val){return String(\`\${val}n\`);}function printFunction(val,printFunctionName){if(!printFunctionName){return'[Function]';}return\`[Function \${val.name||'anonymous'}]\`;}function printSymbol(val){return String(val).replace(SYMBOL_REGEXP,'Symbol($1)');}function printError(val){return\`[\${errorToString.call(val)}]\`;}/** + * The first port of call for printing an object, handles most of the + * data-types in JS. + */function printBasicValue(val,printFunctionName,escapeRegex,escapeString){if(val===true||val===false){return\`\${val}\`;}if(val===undefined){return'undefined';}if(val===null){return'null';}const typeOf=typeof val;if(typeOf==='number'){return printNumber(val);}if(typeOf==='bigint'){return printBigInt(val);}if(typeOf==='string'){if(escapeString){return\`"\${val.replace(/"|\\\\/g,'\\\\$&')}"\`;}return\`"\${val}"\`;}if(typeOf==='function'){return printFunction(val,printFunctionName);}if(typeOf==='symbol'){return printSymbol(val);}const toStringed=toString$2.call(val);if(toStringed==='[object WeakMap]'){return'WeakMap {}';}if(toStringed==='[object WeakSet]'){return'WeakSet {}';}if(toStringed==='[object Function]'||toStringed==='[object GeneratorFunction]'){return printFunction(val,printFunctionName);}if(toStringed==='[object Symbol]'){return printSymbol(val);}if(toStringed==='[object Date]'){return isNaN(+val)?'Date { NaN }':toISOString.call(val);}if(toStringed==='[object Error]'){return printError(val);}if(toStringed==='[object RegExp]'){if(escapeRegex){// https://github.com/benjamingr/RegExp.escape/blob/main/polyfill.js +return regExpToString.call(val).replace(/[\\\\^$*+?.()|[\\]{}]/g,'\\\\$&');}return regExpToString.call(val);}if(val instanceof Error){return printError(val);}return null;}/** + * Handles more complex objects ( such as objects with circular references. + * maps and sets etc ) + */function printComplexValue(val,config,indentation,depth,refs,hasCalledToJSON){if(refs.indexOf(val)!==-1){return'[Circular]';}refs=refs.slice();refs.push(val);const hitMaxDepth=++depth>config.maxDepth;const min=config.min;if(config.callToJSON&&!hitMaxDepth&&val.toJSON&&typeof val.toJSON==='function'&&!hasCalledToJSON){return printer(val.toJSON(),config,indentation,depth,refs,true);}const toStringed=toString$2.call(val);if(toStringed==='[object Arguments]'){return hitMaxDepth?'[Arguments]':\`\${min?'':'Arguments '}[\${(0,_collections.printListItems)(val,config,indentation,depth,refs,printer)}]\`;}if(isToStringedArrayType(toStringed)){return hitMaxDepth?\`[\${val.constructor.name}]\`:\`\${min?'':!config.printBasicPrototype&&val.constructor.name==='Array'?'':\`\${val.constructor.name} \`}[\${(0,_collections.printListItems)(val,config,indentation,depth,refs,printer)}]\`;}if(toStringed==='[object Map]'){return hitMaxDepth?'[Map]':\`Map {\${(0,_collections.printIteratorEntries)(val.entries(),config,indentation,depth,refs,printer,' => ')}}\`;}if(toStringed==='[object Set]'){return hitMaxDepth?'[Set]':\`Set {\${(0,_collections.printIteratorValues)(val.values(),config,indentation,depth,refs,printer)}}\`;}// Avoid failure to serialize global window object in jsdom test environment. +// For example, not even relevant if window is prop of React element. +return hitMaxDepth||isWindow(val)?\`[\${getConstructorName$1(val)}]\`:\`\${min?'':!config.printBasicPrototype&&getConstructorName$1(val)==='Object'?'':\`\${getConstructorName$1(val)} \`}{\${(0,_collections.printObjectProperties)(val,config,indentation,depth,refs,printer)}}\`;}function isNewPlugin(plugin){return plugin.serialize!=null;}function printPlugin(plugin,val,config,indentation,depth,refs){let printed;try{printed=isNewPlugin(plugin)?plugin.serialize(val,config,indentation,depth,refs,printer):plugin.print(val,valChild=>printer(valChild,config,indentation,depth,refs),str=>{const indentationNext=indentation+config.indent;return indentationNext+str.replace(NEWLINE_REGEXP,\`\\n\${indentationNext}\`);},{edgeSpacing:config.spacingOuter,min:config.min,spacing:config.spacingInner},config.colors);}catch(error){throw new PrettyFormatPluginError(error.message,error.stack);}if(typeof printed!=='string'){throw new Error(\`pretty-format: Plugin must return type "string" but instead returned "\${typeof printed}".\`);}return printed;}function findPlugin(plugins,val){for(let p=0;poptions;const DEFAULT_OPTIONS=toOptionsSubtype({callToJSON:true,compareKeys:undefined,escapeRegex:false,escapeString:true,highlight:false,indent:2,maxDepth:Infinity,maxWidth:Infinity,min:false,plugins:[],printBasicPrototype:true,printFunctionName:true,theme:DEFAULT_THEME});build$1.DEFAULT_OPTIONS=DEFAULT_OPTIONS;function validateOptions(options){Object.keys(options).forEach(key=>{if(!Object.prototype.hasOwnProperty.call(DEFAULT_OPTIONS,key)){throw new Error(\`pretty-format: Unknown option "\${key}".\`);}});if(options.min&&options.indent!==undefined&&options.indent!==0){throw new Error('pretty-format: Options "min" and "indent" cannot be used together.');}if(options.theme!==undefined){if(options.theme===null){throw new Error('pretty-format: Option "theme" must not be null.');}if(typeof options.theme!=='object'){throw new Error(\`pretty-format: Option "theme" must be of type "object" but instead received "\${typeof options.theme}".\`);}}}const getColorsHighlight=options=>DEFAULT_THEME_KEYS.reduce((colors,key)=>{const value=options.theme&&options.theme[key]!==undefined?options.theme[key]:DEFAULT_THEME[key];const color=value&&_ansiStyles.default[value];if(color&&typeof color.close==='string'&&typeof color.open==='string'){colors[key]=color;}else{throw new Error(\`pretty-format: Option "theme" has a key "\${key}" whose value "\${value}" is undefined in ansi-styles.\`);}return colors;},Object.create(null));const getColorsEmpty=()=>DEFAULT_THEME_KEYS.reduce((colors,key)=>{colors[key]={close:'',open:''};return colors;},Object.create(null));const getPrintFunctionName=options=>options?.printFunctionName??DEFAULT_OPTIONS.printFunctionName;const getEscapeRegex=options=>options?.escapeRegex??DEFAULT_OPTIONS.escapeRegex;const getEscapeString=options=>options?.escapeString??DEFAULT_OPTIONS.escapeString;const getConfig=options=>({callToJSON:options?.callToJSON??DEFAULT_OPTIONS.callToJSON,colors:options?.highlight?getColorsHighlight(options):getColorsEmpty(),compareKeys:typeof options?.compareKeys==='function'||options?.compareKeys===null?options.compareKeys:DEFAULT_OPTIONS.compareKeys,escapeRegex:getEscapeRegex(options),escapeString:getEscapeString(options),indent:options?.min?'':createIndent(options?.indent??DEFAULT_OPTIONS.indent),maxDepth:options?.maxDepth??DEFAULT_OPTIONS.maxDepth,maxWidth:options?.maxWidth??DEFAULT_OPTIONS.maxWidth,min:options?.min??DEFAULT_OPTIONS.min,plugins:options?.plugins??DEFAULT_OPTIONS.plugins,printBasicPrototype:options?.printBasicPrototype??true,printFunctionName:getPrintFunctionName(options),spacingInner:options?.min?' ':'\\n',spacingOuter:options?.min?'':'\\n'});function createIndent(indent){return new Array(indent+1).join(' ');}/** + * Returns a presentation string of your \`val\` object + * @param val any potential JavaScript object + * @param options Custom settings + */function format$1(val,options){if(options){validateOptions(options);if(options.plugins){const plugin=findPlugin(options.plugins,val);if(plugin!==null){return printPlugin(plugin,val,getConfig(options),'',0,[]);}}}const basicResult=printBasicValue(val,getPrintFunctionName(options),getEscapeRegex(options),getEscapeString(options));if(basicResult!==null){return basicResult;}return printComplexValue(val,getConfig(options),'',0,[]);}const plugins={AsymmetricMatcher:_AsymmetricMatcher.default,DOMCollection:_DOMCollection.default,DOMElement:_DOMElement.default,Immutable:_Immutable.default,ReactElement:_ReactElement.default,ReactTestComponent:_ReactTestComponent.default};plugins_1=build$1.plugins=plugins;var _default$1=format$1;build$1.default=_default$1;const ansiColors={bold:['1','22'],dim:['2','22'],italic:['3','23'],underline:['4','24'],// 5 & 6 are blinking +inverse:['7','27'],hidden:['8','28'],strike:['9','29'],// 10-20 are fonts +// 21-29 are resets for 1-9 +black:['30','39'],red:['31','39'],green:['32','39'],yellow:['33','39'],blue:['34','39'],magenta:['35','39'],cyan:['36','39'],white:['37','39'],brightblack:['30;1','39'],brightred:['31;1','39'],brightgreen:['32;1','39'],brightyellow:['33;1','39'],brightblue:['34;1','39'],brightmagenta:['35;1','39'],brightcyan:['36;1','39'],brightwhite:['37;1','39'],grey:['90','39']};const styles={special:'cyan',number:'yellow',bigint:'yellow',boolean:'yellow',undefined:'grey',null:'bold',string:'green',symbol:'green',date:'magenta',regexp:'red'};const truncator='…';function colorise(value,styleType){const color=ansiColors[styles[styleType]]||ansiColors[styleType];if(!color){return String(value);}return\`\\u001b[\${color[0]}m\${String(value)}\\u001b[\${color[1]}m\`;}function normaliseOptions({showHidden=false,depth=2,colors=false,customInspect=true,showProxy=false,maxArrayLength=Infinity,breakLength=Infinity,seen=[],// eslint-disable-next-line no-shadow +truncate=Infinity,stylize=String}={}){const options={showHidden:Boolean(showHidden),depth:Number(depth),colors:Boolean(colors),customInspect:Boolean(customInspect),showProxy:Boolean(showProxy),maxArrayLength:Number(maxArrayLength),breakLength:Number(breakLength),truncate:Number(truncate),seen,stylize};if(options.colors){options.stylize=colorise;}return options;}function truncate(string,length,tail=truncator){string=String(string);const tailLength=tail.length;const stringLength=string.length;if(tailLength>length&&stringLength>tailLength){return tail;}if(stringLength>length&&stringLength>tailLength){return\`\${string.slice(0,length-tailLength)}\${tail}\`;}return string;}// eslint-disable-next-line complexity +function inspectList(list,options,inspectItem,separator=', '){inspectItem=inspectItem||options.inspect;const size=list.length;if(size===0)return'';const originalLength=options.truncate;let output='';let peek='';let truncated='';for(let i=0;ioriginalLength&&output.length+truncated.length<=originalLength){break;}// If this isn't the last or second to last element to scan, +// but the string is already over length then break here +if(!last&&!secondToLast&&truncatedLength>originalLength){break;}// Peek at the next string to determine if we should +// break early before adding this item to the output +peek=last?'':inspectItem(list[i+1],options)+(secondToLast?'':separator);// If we have one element left, but this element and +// the next takes over length, the break early +if(!last&&secondToLast&&truncatedLength>originalLength&&nextLength+peek.length>originalLength){break;}output+=string;// If the next element takes us to length - +// but there are more after that, then we should truncate now +if(!last&&!secondToLast&&nextLength+peek.length>=originalLength){truncated=\`\${truncator}(\${list.length-i-1})\`;break;}truncated='';}return\`\${output}\${truncated}\`;}function quoteComplexKey(key){if(key.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/)){return key;}return JSON.stringify(key).replace(/'/g,"\\\\'").replace(/\\\\"/g,'"').replace(/(^"|"$)/g,"'");}function inspectProperty([key,value],options){options.truncate-=2;if(typeof key==='string'){key=quoteComplexKey(key);}else if(typeof key!=='number'){key=\`[\${options.inspect(key,options)}]\`;}options.truncate-=key.length;value=options.inspect(value,options);return\`\${key}: \${value}\`;}function inspectArray(array,options){// Object.keys will always output the Array indices first, so we can slice by +// \`array.length\` to get non-index properties +const nonIndexProperties=Object.keys(array).slice(array.length);if(!array.length&&!nonIndexProperties.length)return'[]';options.truncate-=4;const listContents=inspectList(array,options);options.truncate-=listContents.length;let propertyContents='';if(nonIndexProperties.length){propertyContents=inspectList(nonIndexProperties.map(key=>[key,array[key]]),options,inspectProperty);}return\`[ \${listContents}\${propertyContents?\`, \${propertyContents}\`:''} ]\`;}/* ! + * Chai - getFuncName utility + * Copyright(c) 2012-2016 Jake Luer + * MIT Licensed + */ /** + * ### .getFuncName(constructorFn) + * + * Returns the name of a function. + * When a non-function instance is passed, returns \`null\`. + * This also includes a polyfill function if \`aFunc.name\` is not defined. + * + * @name getFuncName + * @param {Function} funct + * @namespace Utils + * @api public + */var toString$1=Function.prototype.toString;var functionNameMatch=/\\s*function(?:\\s|\\s*\\/\\*[^(?:*\\/)]+\\*\\/\\s*)*([^\\s\\(\\/]+)/;var maxFunctionSourceLength=512;function getFuncName(aFunc){if(typeof aFunc!=='function'){return null;}var name='';if(typeof Function.prototype.name==='undefined'&&typeof aFunc.name==='undefined'){// eslint-disable-next-line prefer-reflect +var functionSource=toString$1.call(aFunc);// To avoid unconstrained resource consumption due to pathalogically large function names, +// we limit the available return value to be less than 512 characters. +if(functionSource.indexOf('(')>maxFunctionSourceLength){return name;}// Here we run a polyfill if Function does not support the \`name\` property and if aFunc.name is not defined +var match=functionSource.match(functionNameMatch);if(match){name=match[1];}}else{// If we've got a \`name\` property we just use it +name=aFunc.name;}return name;}var getFuncName_1=getFuncName;const getFuncName$1=/*@__PURE__*/getDefaultExportFromCjs$2(getFuncName_1);const getArrayName=array=>{// We need to special case Node.js' Buffers, which report to be Uint8Array +if(typeof Buffer==='function'&&array instanceof Buffer){return'Buffer';}if(array[Symbol.toStringTag]){return array[Symbol.toStringTag];}return getFuncName$1(array.constructor);};function inspectTypedArray(array,options){const name=getArrayName(array);options.truncate-=name.length+4;// Object.keys will always output the Array indices first, so we can slice by +// \`array.length\` to get non-index properties +const nonIndexProperties=Object.keys(array).slice(array.length);if(!array.length&&!nonIndexProperties.length)return\`\${name}[]\`;// As we know TypedArrays only contain Unsigned Integers, we can skip inspecting each one and simply +// stylise the toString() value of them +let output='';for(let i=0;i[key,array[key]]),options,inspectProperty);}return\`\${name}[ \${output}\${propertyContents?\`, \${propertyContents}\`:''} ]\`;}function inspectDate(dateObject,options){const stringRepresentation=dateObject.toJSON();if(stringRepresentation===null){return'Invalid Date';}const split=stringRepresentation.split('T');const date=split[0];// If we need to - truncate the time portion, but never the date +return options.stylize(\`\${date}T\${truncate(split[1],options.truncate-date.length-1)}\`,'date');}function inspectFunction(func,options){const name=getFuncName$1(func);if(!name){return options.stylize('[Function]','special');}return options.stylize(\`[Function \${truncate(name,options.truncate-11)}]\`,'special');}function inspectMapEntry([key,value],options){options.truncate-=4;key=options.inspect(key,options);options.truncate-=key.length;value=options.inspect(value,options);return\`\${key} => \${value}\`;}// IE11 doesn't support \`map.entries()\` +function mapToEntries(map){const entries=[];map.forEach((value,key)=>{entries.push([key,value]);});return entries;}function inspectMap(map,options){const size=map.size-1;if(size<=0){return'Map{}';}options.truncate-=7;return\`Map{ \${inspectList(mapToEntries(map),options,inspectMapEntry)} }\`;}const isNaN$2=Number.isNaN||(i=>i!==i);// eslint-disable-line no-self-compare +function inspectNumber(number,options){if(isNaN$2(number)){return options.stylize('NaN','number');}if(number===Infinity){return options.stylize('Infinity','number');}if(number===-Infinity){return options.stylize('-Infinity','number');}if(number===0){return options.stylize(1/number===Infinity?'+0':'-0','number');}return options.stylize(truncate(number,options.truncate),'number');}function inspectBigInt(number,options){let nums=truncate(number.toString(),options.truncate-1);if(nums!==truncator)nums+='n';return options.stylize(nums,'bigint');}function inspectRegExp(value,options){const flags=value.toString().split('/')[2];const sourceLength=options.truncate-(2+flags.length);const source=value.source;return options.stylize(\`/\${truncate(source,sourceLength)}/\${flags}\`,'regexp');}// IE11 doesn't support \`Array.from(set)\` +function arrayFromSet(set){const values=[];set.forEach(value=>{values.push(value);});return values;}function inspectSet(set,options){if(set.size===0)return'Set{}';options.truncate-=7;return\`Set{ \${inspectList(arrayFromSet(set),options)} }\`;}const stringEscapeChars=new RegExp("['\\\\u0000-\\\\u001f\\\\u007f-\\\\u009f\\\\u00ad\\\\u0600-\\\\u0604\\\\u070f\\\\u17b4\\\\u17b5"+'\\\\u200c-\\\\u200f\\\\u2028-\\\\u202f\\\\u2060-\\\\u206f\\\\ufeff\\\\ufff0-\\\\uffff]','g');const escapeCharacters={'\\b':'\\\\b','\\t':'\\\\t','\\n':'\\\\n','\\f':'\\\\f','\\r':'\\\\r',"'":"\\\\'",'\\\\':'\\\\\\\\'};const hex=16;const unicodeLength=4;function escape(char){return escapeCharacters[char]||\`\\\\u\${\`0000\${char.charCodeAt(0).toString(hex)}\`.slice(-unicodeLength)}\`;}function inspectString(string,options){if(stringEscapeChars.test(string)){string=string.replace(stringEscapeChars,escape);}return options.stylize(\`'\${truncate(string,options.truncate-2)}'\`,'string');}function inspectSymbol(value){if('description'in Symbol.prototype){return value.description?\`Symbol(\${value.description})\`:'Symbol()';}return value.toString();}let getPromiseValue$1=()=>'Promise{…}';try{const _process$binding=process.binding('util'),getPromiseDetails=_process$binding.getPromiseDetails,kPending=_process$binding.kPending,kRejected=_process$binding.kRejected;if(Array.isArray(getPromiseDetails(Promise.resolve()))){getPromiseValue$1=(value,options)=>{const _getPromiseDetails=getPromiseDetails(value),_getPromiseDetails2=_slicedToArray(_getPromiseDetails,2),state=_getPromiseDetails2[0],innerValue=_getPromiseDetails2[1];if(state===kPending){return'Promise{}';}return\`Promise\${state===kRejected?'!':''}{\${options.inspect(innerValue,options)}}\`;};}}catch(notNode){/* ignore */}const inspectPromise=getPromiseValue$1;function inspectObject$1(object,options){const properties=Object.getOwnPropertyNames(object);const symbols=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(object):[];if(properties.length===0&&symbols.length===0){return'{}';}options.truncate-=4;options.seen=options.seen||[];if(options.seen.indexOf(object)>=0){return'[Circular]';}options.seen.push(object);const propertyContents=inspectList(properties.map(key=>[key,object[key]]),options,inspectProperty);const symbolContents=inspectList(symbols.map(key=>[key,object[key]]),options,inspectProperty);options.seen.pop();let sep='';if(propertyContents&&symbolContents){sep=', ';}return\`{ \${propertyContents}\${sep}\${symbolContents} }\`;}const toStringTag=typeof Symbol!=='undefined'&&Symbol.toStringTag?Symbol.toStringTag:false;function inspectClass(value,options){let name='';if(toStringTag&&toStringTag in value){name=value[toStringTag];}name=name||getFuncName$1(value.constructor);// Babel transforms anonymous classes to the name \`_class\` +if(!name||name==='_class'){name='';}options.truncate-=name.length;return\`\${name}\${inspectObject$1(value,options)}\`;}function inspectArguments(args,options){if(args.length===0)return'Arguments[]';options.truncate-=13;return\`Arguments[ \${inspectList(args,options)} ]\`;}const errorKeys=['stack','line','column','name','message','fileName','lineNumber','columnNumber','number','description'];function inspectObject(error,options){const properties=Object.getOwnPropertyNames(error).filter(key=>errorKeys.indexOf(key)===-1);const name=error.name;options.truncate-=name.length;let message='';if(typeof error.message==='string'){message=truncate(error.message,options.truncate);}else{properties.unshift('message');}message=message?\`: \${message}\`:'';options.truncate-=message.length+5;const propertyContents=inspectList(properties.map(key=>[key,error[key]]),options,inspectProperty);return\`\${name}\${message}\${propertyContents?\` { \${propertyContents} }\`:''}\`;}function inspectAttribute([key,value],options){options.truncate-=3;if(!value){return\`\${options.stylize(key,'yellow')}\`;}return\`\${options.stylize(key,'yellow')}=\${options.stylize(\`"\${value}"\`,'string')}\`;}function inspectHTMLCollection(collection,options){// eslint-disable-next-line no-use-before-define +return inspectList(collection,options,inspectHTML,'\\n');}function inspectHTML(element,options){const properties=element.getAttributeNames();const name=element.tagName.toLowerCase();const head=options.stylize(\`<\${name}\`,'special');const headClose=options.stylize(\`>\`,'special');const tail=options.stylize(\`\`,'special');options.truncate-=name.length*2+5;let propertyContents='';if(properties.length>0){propertyContents+=' ';propertyContents+=inspectList(properties.map(key=>[key,element.getAttribute(key)]),options,inspectAttribute,' ');}options.truncate-=propertyContents.length;const truncate=options.truncate;let children=inspectHTMLCollection(element.children,options);if(children&&children.length>truncate){children=\`\${truncator}(\${element.children.length})\`;}return\`\${head}\${propertyContents}\${headClose}\${children}\${tail}\`;}/* ! + * loupe + * Copyright(c) 2013 Jake Luer + * MIT Licensed + */const symbolsSupported=typeof Symbol==='function'&&typeof Symbol.for==='function';const chaiInspect=symbolsSupported?Symbol.for('chai/inspect'):'@@chai/inspect';let nodeInspect$1=false;try{// eslint-disable-next-line global-require +const nodeUtil=require('util');nodeInspect$1=nodeUtil.inspect?nodeUtil.inspect.custom:false;}catch(noNodeInspect){nodeInspect$1=false;}function FakeMap$1(){// eslint-disable-next-line prefer-template +this.key='chai/loupe__'+Math.random()+Date.now();}FakeMap$1.prototype={// eslint-disable-next-line object-shorthand +get:function get(key){return key[this.key];},// eslint-disable-next-line object-shorthand +has:function has(key){return this.key in key;},// eslint-disable-next-line object-shorthand +set:function set(key,value){if(Object.isExtensible(key)){Object.defineProperty(key,this.key,{// eslint-disable-next-line object-shorthand +value:value,configurable:true});}}};const constructorMap=new(typeof WeakMap==='function'?WeakMap:FakeMap$1)();const stringTagMap={};const baseTypesMap={undefined:(value,options)=>options.stylize('undefined','undefined'),null:(value,options)=>options.stylize(null,'null'),boolean:(value,options)=>options.stylize(value,'boolean'),Boolean:(value,options)=>options.stylize(value,'boolean'),number:inspectNumber,Number:inspectNumber,bigint:inspectBigInt,BigInt:inspectBigInt,string:inspectString,String:inspectString,function:inspectFunction,Function:inspectFunction,symbol:inspectSymbol,// A Symbol polyfill will return \`Symbol\` not \`symbol\` from typedetect +Symbol:inspectSymbol,Array:inspectArray,Date:inspectDate,Map:inspectMap,Set:inspectSet,RegExp:inspectRegExp,Promise:inspectPromise,// WeakSet, WeakMap are totally opaque to us +WeakSet:(value,options)=>options.stylize('WeakSet{…}','special'),WeakMap:(value,options)=>options.stylize('WeakMap{…}','special'),Arguments:inspectArguments,Int8Array:inspectTypedArray,Uint8Array:inspectTypedArray,Uint8ClampedArray:inspectTypedArray,Int16Array:inspectTypedArray,Uint16Array:inspectTypedArray,Int32Array:inspectTypedArray,Uint32Array:inspectTypedArray,Float32Array:inspectTypedArray,Float64Array:inspectTypedArray,Generator:()=>'',DataView:()=>'',ArrayBuffer:()=>'',Error:inspectObject,HTMLCollection:inspectHTMLCollection,NodeList:inspectHTMLCollection};// eslint-disable-next-line complexity +const inspectCustom=(value,options,type)=>{if(chaiInspect in value&&typeof value[chaiInspect]==='function'){return value[chaiInspect](options);}if(nodeInspect$1&&nodeInspect$1 in value&&typeof value[nodeInspect$1]==='function'){return value[nodeInspect$1](options.depth,options);}if('inspect'in value&&typeof value.inspect==='function'){return value.inspect(options.depth,options);}if('constructor'in value&&constructorMap.has(value.constructor)){return constructorMap.get(value.constructor)(value,options);}if(stringTagMap[type]){return stringTagMap[type](value,options);}return'';};const toString=Object.prototype.toString;// eslint-disable-next-line complexity +function inspect$4(value,options){options=normaliseOptions(options);options.inspect=inspect$4;const _options2=options,customInspect=_options2.customInspect;let type=value===null?'null':typeof value;if(type==='object'){type=toString.call(value).slice(8,-1);}// If it is a base value that we already support, then use Loupe's inspector +if(baseTypesMap[type]){return baseTypesMap[type](value,options);}// If \`options.customInspect\` is set to true then try to use the custom inspector +if(customInspect&&value){const output=inspectCustom(value,options,type);if(output){if(typeof output==='string')return output;return inspect$4(output,options);}}const proto=value?Object.getPrototypeOf(value):false;// If it's a plain Object then use Loupe's inspector +if(proto===Object.prototype||proto===null){return inspectObject$1(value,options);}// Specifically account for HTMLElements +// eslint-disable-next-line no-undef +if(value&&typeof HTMLElement==='function'&&value instanceof HTMLElement){return inspectHTML(value,options);}if('constructor'in value){// If it is a class, inspect it like an object but add the constructor name +if(value.constructor!==Object){return inspectClass(value,options);}// If it is an object with an anonymous prototype, display it as an object. +return inspectObject$1(value,options);}// last chance to check if it's an object +if(value===Object(value)){return inspectObject$1(value,options);}// We have run out of options! Just stringify the value +return options.stylize(String(value),type);}function registerConstructor(constructor,inspector){if(constructorMap.has(constructor)){return false;}constructorMap.set(constructor,inspector);return true;}function registerStringTag(stringTag,inspector){if(stringTag in stringTagMap){return false;}stringTagMap[stringTag]=inspector;return true;}const custom=chaiInspect;const loupe$1=/*#__PURE__*/Object.freeze({__proto__:null,custom,default:inspect$4,inspect:inspect$4,registerConstructor,registerStringTag});const _plugins_=plugins_1,AsymmetricMatcher$3=_plugins_.AsymmetricMatcher,DOMCollection$2=_plugins_.DOMCollection,DOMElement$2=_plugins_.DOMElement,Immutable$2=_plugins_.Immutable,ReactElement$2=_plugins_.ReactElement,ReactTestComponent$2=_plugins_.ReactTestComponent;const PLUGINS$2=[ReactTestComponent$2,ReactElement$2,DOMElement$2,DOMCollection$2,Immutable$2,AsymmetricMatcher$3];function stringify(object,maxDepth=10,_ref5={}){let maxLength=_ref5.maxLength,options=_objectWithoutProperties(_ref5,_excluded);const MAX_LENGTH=maxLength??1e4;let result;try{result=format_1(object,_objectSpread({maxDepth,escapeString:false,// min: true, +plugins:PLUGINS$2},options));}catch{result=format_1(object,_objectSpread({callToJSON:false,maxDepth,escapeString:false,// min: true, +plugins:PLUGINS$2},options));}return result.length>=MAX_LENGTH&&maxDepth>1?stringify(object,Math.floor(maxDepth/2)):result;}const formatRegExp=/%[sdjifoOcj%]/g;function format(...args){if(typeof args[0]!=="string"){const objects=[];for(let i2=0;i2{if(x==="%%")return"%";if(i>=len)return x;switch(x){case"%s":{const value=args[i++];if(typeof value==="bigint")return\`\${value.toString()}n\`;if(typeof value==="number"&&value===0&&1/value<0)return"-0";if(typeof value==="object"&&value!==null)return inspect$3(value,{depth:0,colors:false,compact:3});return String(value);}case"%d":{const value=args[i++];if(typeof value==="bigint")return\`\${value.toString()}n\`;return Number(value).toString();}case"%i":{const value=args[i++];if(typeof value==="bigint")return\`\${value.toString()}n\`;return Number.parseInt(String(value)).toString();}case"%f":return Number.parseFloat(String(args[i++])).toString();case"%o":return inspect$3(args[i++],{showHidden:true,showProxy:true});case"%O":return inspect$3(args[i++]);case"%c":{i++;return"";}case"%j":try{return JSON.stringify(args[i++]);}catch(err){const m=err.message;if(// chromium +m.includes("circular structure")||m.includes("cyclic structures")||m.includes("cyclic object"))return"[Circular]";throw err;}default:return x;}});for(let x=args[i];i=options.truncate){if(type==="[object Function]"){const fn=obj;return!fn.name||fn.name===""?"[Function]":\`[Function: \${fn.name}]\`;}else if(type==="[object Array]"){return\`[ Array(\${obj.length}) ]\`;}else if(type==="[object Object]"){const keys=Object.keys(obj);const kstr=keys.length>2?\`\${keys.splice(0,2).join(", ")}, ...\`:keys.join(", ");return\`{ Object (\${kstr}) }\`;}else{return str;}}return str;}const SAFE_TIMERS_SYMBOL=Symbol("vitest:SAFE_TIMERS");const SAFE_COLORS_SYMBOL=Symbol("vitest:SAFE_COLORS");const colorsMap={bold:["\\x1B[1m","\\x1B[22m","\\x1B[22m\\x1B[1m"],dim:["\\x1B[2m","\\x1B[22m","\\x1B[22m\\x1B[2m"],italic:["\\x1B[3m","\\x1B[23m"],underline:["\\x1B[4m","\\x1B[24m"],inverse:["\\x1B[7m","\\x1B[27m"],hidden:["\\x1B[8m","\\x1B[28m"],strikethrough:["\\x1B[9m","\\x1B[29m"],black:["\\x1B[30m","\\x1B[39m"],red:["\\x1B[31m","\\x1B[39m"],green:["\\x1B[32m","\\x1B[39m"],yellow:["\\x1B[33m","\\x1B[39m"],blue:["\\x1B[34m","\\x1B[39m"],magenta:["\\x1B[35m","\\x1B[39m"],cyan:["\\x1B[36m","\\x1B[39m"],white:["\\x1B[37m","\\x1B[39m"],gray:["\\x1B[90m","\\x1B[39m"],bgBlack:["\\x1B[40m","\\x1B[49m"],bgRed:["\\x1B[41m","\\x1B[49m"],bgGreen:["\\x1B[42m","\\x1B[49m"],bgYellow:["\\x1B[43m","\\x1B[49m"],bgBlue:["\\x1B[44m","\\x1B[49m"],bgMagenta:["\\x1B[45m","\\x1B[49m"],bgCyan:["\\x1B[46m","\\x1B[49m"],bgWhite:["\\x1B[47m","\\x1B[49m"]};const colorsEntries=Object.entries(colorsMap);function string$1(str){return String(str);}string$1.open="";string$1.close="";const defaultColors=/* @__PURE__ */colorsEntries.reduce((acc,[key])=>{acc[key]=string$1;return acc;},{isColorSupported:false});function getColors(){return globalThis[SAFE_COLORS_SYMBOL]||defaultColors;}function getSafeTimers(){const _ref6=globalThis[SAFE_TIMERS_SYMBOL]||globalThis,safeSetTimeout=_ref6.setTimeout,safeSetInterval=_ref6.setInterval,safeClearInterval=_ref6.clearInterval,safeClearTimeout=_ref6.clearTimeout,safeSetImmediate=_ref6.setImmediate,safeClearImmediate=_ref6.clearImmediate;const _ref7=globalThis[SAFE_TIMERS_SYMBOL]||globalThis.process||{nextTick:cb=>cb()},safeNextTick=_ref7.nextTick;return{nextTick:safeNextTick,setTimeout:safeSetTimeout,setInterval:safeSetInterval,clearInterval:safeClearInterval,clearTimeout:safeClearTimeout,setImmediate:safeSetImmediate,clearImmediate:safeClearImmediate};}function createSimpleStackTrace(options){const _ref8=options||{},_ref8$message=_ref8.message,message=_ref8$message===void 0?"error":_ref8$message,_ref8$stackTraceLimit=_ref8.stackTraceLimit,stackTraceLimit=_ref8$stackTraceLimit===void 0?1:_ref8$stackTraceLimit;const limit=Error.stackTraceLimit;const prepareStackTrace=Error.prepareStackTrace;Error.stackTraceLimit=stackTraceLimit;Error.prepareStackTrace=e=>e.stack;const err=new Error(message);const stackTrace=err.stack||"";Error.prepareStackTrace=prepareStackTrace;Error.stackTraceLimit=limit;return stackTrace;}// Copyright 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Simon Lydell +// License: MIT. +var LineTerminatorSequence$1;LineTerminatorSequence$1=/\\r?\\n|[\\r\\u2028\\u2029]/y;RegExp(LineTerminatorSequence$1.source);// src/index.ts +var reservedWords$1={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"]};new Set(reservedWords$1.keyword);new Set(reservedWords$1.strict);var build={};Object.defineProperty(build,'__esModule',{value:true});var _default=build.default=diffSequence;/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ // This diff-sequences package implements the linear space variation in +// An O(ND) Difference Algorithm and Its Variations by Eugene W. Myers +// Relationship in notation between Myers paper and this package: +// A is a +// N is aLength, aEnd - aStart, and so on +// x is aIndex, aFirst, aLast, and so on +// B is b +// M is bLength, bEnd - bStart, and so on +// y is bIndex, bFirst, bLast, and so on +// Δ = N - M is negative of baDeltaLength = bLength - aLength +// D is d +// k is kF +// k + Δ is kF = kR - baDeltaLength +// V is aIndexesF or aIndexesR (see comment below about Indexes type) +// index intervals [1, N] and [1, M] are [0, aLength) and [0, bLength) +// starting point in forward direction (0, 0) is (-1, -1) +// starting point in reverse direction (N + 1, M + 1) is (aLength, bLength) +// The “edit graph” for sequences a and b corresponds to items: +// in a on the horizontal axis +// in b on the vertical axis +// +// Given a-coordinate of a point in a diagonal, you can compute b-coordinate. +// +// Forward diagonals kF: +// zero diagonal intersects top left corner +// positive diagonals intersect top edge +// negative diagonals insersect left edge +// +// Reverse diagonals kR: +// zero diagonal intersects bottom right corner +// positive diagonals intersect right edge +// negative diagonals intersect bottom edge +// The graph contains a directed acyclic graph of edges: +// horizontal: delete an item from a +// vertical: insert an item from b +// diagonal: common item in a and b +// +// The algorithm solves dual problems in the graph analogy: +// Find longest common subsequence: path with maximum number of diagonal edges +// Find shortest edit script: path with minimum number of non-diagonal edges +// Input callback function compares items at indexes in the sequences. +// Output callback function receives the number of adjacent items +// and starting indexes of each common subsequence. +// Either original functions or wrapped to swap indexes if graph is transposed. +// Indexes in sequence a of last point of forward or reverse paths in graph. +// Myers algorithm indexes by diagonal k which for negative is bad deopt in V8. +// This package indexes by iF and iR which are greater than or equal to zero. +// and also updates the index arrays in place to cut memory in half. +// kF = 2 * iF - d +// kR = d - 2 * iR +// Division of index intervals in sequences a and b at the middle change. +// Invariant: intervals do not have common items at the start or end. +const pkg='diff-sequences';// for error messages +const NOT_YET_SET=0;// small int instead of undefined to avoid deopt in V8 +// Return the number of common items that follow in forward direction. +// The length of what Myers paper calls a “snake” in a forward path. +const countCommonItemsF=(aIndex,aEnd,bIndex,bEnd,isCommon)=>{let nCommon=0;while(aIndex{let nCommon=0;while(aStart<=aIndex&&bStart<=bIndex&&isCommon(aIndex,bIndex)){aIndex-=1;bIndex-=1;nCommon+=1;}return nCommon;};// A simple function to extend forward paths from (d - 1) to d changes +// when forward and reverse paths cannot yet overlap. +const extendPathsF=(d,aEnd,bEnd,bF,isCommon,aIndexesF,iMaxF// return the value because optimization might decrease it +)=>{// Unroll the first iteration. +let iF=0;let kF=-d;// kF = 2 * iF - d +let aFirst=aIndexesF[iF];// in first iteration always insert +let aIndexPrev1=aFirst;// prev value of [iF - 1] in next iteration +aIndexesF[iF]+=countCommonItemsF(aFirst+1,aEnd,bF+aFirst-kF+1,bEnd,isCommon);// Optimization: skip diagonals in which paths cannot ever overlap. +const nF=d{// Unroll the first iteration. +let iR=0;let kR=d;// kR = d - 2 * iR +let aFirst=aIndexesR[iR];// in first iteration always insert +let aIndexPrev1=aFirst;// prev value of [iR - 1] in next iteration +aIndexesR[iR]-=countCommonItemsR(aStart,aFirst-1,bStart,bR+aFirst-kR-1,isCommon);// Optimization: skip diagonals in which paths cannot ever overlap. +const nR=d{const bF=bStart-aStart;// bIndex = bF + aIndex - kF +const aLength=aEnd-aStart;const bLength=bEnd-bStart;const baDeltaLength=bLength-aLength;// kF = kR - baDeltaLength +// Range of diagonals in which forward and reverse paths might overlap. +const kMinOverlapF=-baDeltaLength-(d-1);// -(d - 1) <= kR +const kMaxOverlapF=-baDeltaLength+(d-1);// kR <= (d - 1) +let aIndexPrev1=NOT_YET_SET;// prev value of [iF - 1] in next iteration +// Optimization: skip diagonals in which paths cannot ever overlap. +const nF=d{const bR=bEnd-aEnd;// bIndex = bR + aIndex - kR +const aLength=aEnd-aStart;const bLength=bEnd-bStart;const baDeltaLength=bLength-aLength;// kR = kF + baDeltaLength +// Range of diagonals in which forward and reverse paths might overlap. +const kMinOverlapR=baDeltaLength-d;// -d <= kF +const kMaxOverlapR=baDeltaLength+d;// kF <= d +let aIndexPrev1=NOT_YET_SET;// prev value of [iR - 1] in next iteration +// Optimization: skip diagonals in which paths cannot ever overlap. +const nR=d{const bF=bStart-aStart;// bIndex = bF + aIndex - kF +const bR=bEnd-aEnd;// bIndex = bR + aIndex - kR +const aLength=aEnd-aStart;const bLength=bEnd-bStart;// Because graph has square or portrait orientation, +// length difference is minimum number of items to insert from b. +// Corresponding forward and reverse diagonals in graph +// depend on length difference of the sequences: +// kF = kR - baDeltaLength +// kR = kF + baDeltaLength +const baDeltaLength=bLength-aLength;// Optimization: max diagonal in graph intersects corner of shorter side. +let iMaxF=aLength;let iMaxR=aLength;// Initialize no changes yet in forward or reverse direction: +aIndexesF[0]=aStart-1;// at open start of interval, outside closed start +aIndexesR[0]=aEnd;// at open end of interval +if(baDeltaLength%2===0){// The number of changes in paths is 2 * d if length difference is even. +const dMin=(nChange||baDeltaLength)/2;const dMax=(aLength+bLength)/2;for(let d=1;d<=dMax;d+=1){iMaxF=extendPathsF(d,aEnd,bEnd,bF,isCommon,aIndexesF,iMaxF);if(d{if(bEnd-bStart{foundSubsequence(nCommon,aCommon,bCommon);},isCommon:(bIndex,aIndex)=>isCommon(aIndex,bIndex)};}const tStart=aStart;const tEnd=aEnd;aStart=bStart;aEnd=bEnd;bStart=tStart;bEnd=tEnd;}const _callbacks=callbacks[transposed?1:0],foundSubsequence=_callbacks.foundSubsequence,isCommon=_callbacks.isCommon;// Divide the index intervals at the middle change. +divide(nChange,aStart,aEnd,bStart,bEnd,isCommon,aIndexesF,aIndexesR,division);const nChangePreceding=division.nChangePreceding,aEndPreceding=division.aEndPreceding,bEndPreceding=division.bEndPreceding,nCommonPreceding=division.nCommonPreceding,aCommonPreceding=division.aCommonPreceding,bCommonPreceding=division.bCommonPreceding,nCommonFollowing=division.nCommonFollowing,aCommonFollowing=division.aCommonFollowing,bCommonFollowing=division.bCommonFollowing,nChangeFollowing=division.nChangeFollowing,aStartFollowing=division.aStartFollowing,bStartFollowing=division.bStartFollowing;// Unless either index interval is empty, they might contain common items. +if(aStart{if(typeof arg!=='number'){throw new TypeError(\`\${pkg}: \${name} typeof \${typeof arg} is not a number\`);}if(!Number.isSafeInteger(arg)){throw new RangeError(\`\${pkg}: \${name} value \${arg} is not a safe integer\`);}if(arg<0){throw new RangeError(\`\${pkg}: \${name} value \${arg} is a negative integer\`);}};const validateCallback=(name,arg)=>{const type=typeof arg;if(type!=='function'){throw new TypeError(\`\${pkg}: \${name} typeof \${type} is not a function\`);}};// Compare items in two sequences to find a longest common subsequence. +// Given lengths of sequences and input function to compare items at indexes, +// return by output function the number of adjacent items and starting indexes +// of each common subsequence. +function diffSequence(aLength,bLength,isCommon,foundSubsequence){validateLength('aLength',aLength);validateLength('bLength',bLength);validateCallback('isCommon',isCommon);validateCallback('foundSubsequence',foundSubsequence);// Count common items from the start in the forward direction. +const nCommonF=countCommonItemsF(0,aLength,0,bLength,isCommon);if(nCommonF!==0){foundSubsequence(nCommonF,0,0);}// Unless both sequences consist of common items only, +// find common items in the half-trimmed index intervals. +if(aLength!==nCommonF||bLength!==nCommonF){// Invariant: intervals do not have common items at the start. +// The start of an index interval is closed like array slice method. +const aStart=nCommonF;const bStart=nCommonF;// Count common items from the end in the reverse direction. +const nCommonR=countCommonItemsR(aStart,aLength-1,bStart,bLength-1,isCommon);// Invariant: intervals do not have common items at the end. +// The end of an index interval is open like array slice method. +const aEnd=aLength-nCommonR;const bEnd=bLength-nCommonR;// Unless one sequence consists of common items only, +// therefore the other trimmed index interval consists of changes only, +// find common items in the trimmed index intervals. +const nCommonFR=nCommonF+nCommonR;if(aLength!==nCommonFR&&bLength!==nCommonFR){const nChange=0;// number of change items is not yet known +const transposed=false;// call the original unwrapped functions +const callbacks=[{foundSubsequence,isCommon}];// Indexes in sequence a of last points in furthest reaching paths +// from outside the start at top left in the forward direction: +const aIndexesF=[NOT_YET_SET];// from the end at bottom right in the reverse direction: +const aIndexesR=[NOT_YET_SET];// Initialize one object as output of all calls to divide function. +const division={aCommonFollowing:NOT_YET_SET,aCommonPreceding:NOT_YET_SET,aEndPreceding:NOT_YET_SET,aStartFollowing:NOT_YET_SET,bCommonFollowing:NOT_YET_SET,bCommonPreceding:NOT_YET_SET,bEndPreceding:NOT_YET_SET,bStartFollowing:NOT_YET_SET,nChangeFollowing:NOT_YET_SET,nChangePreceding:NOT_YET_SET,nCommonFollowing:NOT_YET_SET,nCommonPreceding:NOT_YET_SET};// Find and return common subsequences in the trimmed index intervals. +findSubsequences(nChange,aStart,aEnd,bStart,bEnd,transposed,callbacks,aIndexesF,aIndexesR,division);}if(nCommonR!==0){foundSubsequence(nCommonR,aEnd,bEnd);}}}function getType(value){if(value===void 0){return"undefined";}else if(value===null){return"null";}else if(Array.isArray(value)){return"array";}else if(typeof value==="boolean"){return"boolean";}else if(typeof value==="function"){return"function";}else if(typeof value==="number"){return"number";}else if(typeof value==="string"){return"string";}else if(typeof value==="bigint"){return"bigint";}else if(typeof value==="object"){if(value!=null){if(value.constructor===RegExp)return"regexp";else if(value.constructor===Map)return"map";else if(value.constructor===Set)return"set";else if(value.constructor===Date)return"date";}return"object";}else if(typeof value==="symbol"){return"symbol";}throw new Error(\`value of unknown type: \${value}\`);}const DIFF_DELETE=-1;const DIFF_INSERT=1;const DIFF_EQUAL=0;class Diff{0;1;constructor(op,text){this[0]=op;this[1]=text;}}const NO_DIFF_MESSAGE="Compared values have no visual difference.";const SIMILAR_MESSAGE="Compared values serialize to the same structure.\\nPrinting internal object structure without calling \`toJSON\` instead.";function formatTrailingSpaces(line,trailingSpaceFormatter){return line.replace(/\\s+$/,match=>trailingSpaceFormatter(match));}function printDiffLine(line,isFirstOrLast,color,indicator,trailingSpaceFormatter,emptyFirstOrLastLinePlaceholder){return line.length!==0?color(\`\${indicator} \${formatTrailingSpaces(line,trailingSpaceFormatter)}\`):indicator!==" "?color(indicator):isFirstOrLast&&emptyFirstOrLastLinePlaceholder.length!==0?color(\`\${indicator} \${emptyFirstOrLastLinePlaceholder}\`):"";}function printDeleteLine(line,isFirstOrLast,{aColor,aIndicator,changeLineTrailingSpaceColor,emptyFirstOrLastLinePlaceholder}){return printDiffLine(line,isFirstOrLast,aColor,aIndicator,changeLineTrailingSpaceColor,emptyFirstOrLastLinePlaceholder);}function printInsertLine(line,isFirstOrLast,{bColor,bIndicator,changeLineTrailingSpaceColor,emptyFirstOrLastLinePlaceholder}){return printDiffLine(line,isFirstOrLast,bColor,bIndicator,changeLineTrailingSpaceColor,emptyFirstOrLastLinePlaceholder);}function printCommonLine(line,isFirstOrLast,{commonColor,commonIndicator,commonLineTrailingSpaceColor,emptyFirstOrLastLinePlaceholder}){return printDiffLine(line,isFirstOrLast,commonColor,commonIndicator,commonLineTrailingSpaceColor,emptyFirstOrLastLinePlaceholder);}function createPatchMark(aStart,aEnd,bStart,bEnd,{patchColor}){return patchColor(\`@@ -\${aStart+1},\${aEnd-aStart} +\${bStart+1},\${bEnd-bStart} @@\`);}function joinAlignedDiffsNoExpand(diffs,options){const iLength=diffs.length;const nContextLines=options.contextLines;const nContextLines2=nContextLines+nContextLines;let jLength=iLength;let hasExcessAtStartOrEnd=false;let nExcessesBetweenChanges=0;let i=0;while(i!==iLength){const iStart=i;while(i!==iLength&&diffs[i][0]===DIFF_EQUAL)i+=1;if(iStart!==i){if(iStart===0){if(i>nContextLines){jLength-=i-nContextLines;hasExcessAtStartOrEnd=true;}}else if(i===iLength){const n=i-iStart;if(n>nContextLines){jLength-=n-nContextLines;hasExcessAtStartOrEnd=true;}}else{const n=i-iStart;if(n>nContextLines2){jLength-=n-nContextLines2;nExcessesBetweenChanges+=1;}}}while(i!==iLength&&diffs[i][0]!==DIFF_EQUAL)i+=1;}const hasPatch=nExcessesBetweenChanges!==0||hasExcessAtStartOrEnd;if(nExcessesBetweenChanges!==0)jLength+=nExcessesBetweenChanges+1;else if(hasExcessAtStartOrEnd)jLength+=1;const jLast=jLength-1;const lines=[];let jPatchMark=0;if(hasPatch)lines.push("");let aStart=0;let bStart=0;let aEnd=0;let bEnd=0;const pushCommonLine=line=>{const j=lines.length;lines.push(printCommonLine(line,j===0||j===jLast,options));aEnd+=1;bEnd+=1;};const pushDeleteLine=line=>{const j=lines.length;lines.push(printDeleteLine(line,j===0||j===jLast,options));aEnd+=1;};const pushInsertLine=line=>{const j=lines.length;lines.push(printInsertLine(line,j===0||j===jLast,options));bEnd+=1;};i=0;while(i!==iLength){let iStart=i;while(i!==iLength&&diffs[i][0]===DIFF_EQUAL)i+=1;if(iStart!==i){if(iStart===0){if(i>nContextLines){iStart=i-nContextLines;aStart=iStart;bStart=iStart;aEnd=aStart;bEnd=bStart;}for(let iCommon=iStart;iCommon!==i;iCommon+=1)pushCommonLine(diffs[iCommon][1]);}else if(i===iLength){const iEnd=i-iStart>nContextLines?iStart+nContextLines:i;for(let iCommon=iStart;iCommon!==iEnd;iCommon+=1)pushCommonLine(diffs[iCommon][1]);}else{const nCommon=i-iStart;if(nCommon>nContextLines2){const iEnd=iStart+nContextLines;for(let iCommon=iStart;iCommon!==iEnd;iCommon+=1)pushCommonLine(diffs[iCommon][1]);lines[jPatchMark]=createPatchMark(aStart,aEnd,bStart,bEnd,options);jPatchMark=lines.length;lines.push("");const nOmit=nCommon-nContextLines2;aStart=aEnd+nOmit;bStart=bEnd+nOmit;aEnd=aStart;bEnd=bStart;for(let iCommon=i-nContextLines;iCommon!==i;iCommon+=1)pushCommonLine(diffs[iCommon][1]);}else{for(let iCommon=iStart;iCommon!==i;iCommon+=1)pushCommonLine(diffs[iCommon][1]);}}}while(i!==iLength&&diffs[i][0]===DIFF_DELETE){pushDeleteLine(diffs[i][1]);i+=1;}while(i!==iLength&&diffs[i][0]===DIFF_INSERT){pushInsertLine(diffs[i][1]);i+=1;}}if(hasPatch)lines[jPatchMark]=createPatchMark(aStart,aEnd,bStart,bEnd,options);return lines.join("\\n");}function joinAlignedDiffsExpand(diffs,options){return diffs.map((diff,i,diffs2)=>{const line=diff[1];const isFirstOrLast=i===0||i===diffs2.length-1;switch(diff[0]){case DIFF_DELETE:return printDeleteLine(line,isFirstOrLast,options);case DIFF_INSERT:return printInsertLine(line,isFirstOrLast,options);default:return printCommonLine(line,isFirstOrLast,options);}}).join("\\n");}const noColor=string=>string;const DIFF_CONTEXT_DEFAULT=5;function getDefaultOptions(){const c=getColors();return{aAnnotation:"Expected",aColor:c.green,aIndicator:"-",bAnnotation:"Received",bColor:c.red,bIndicator:"+",changeColor:c.inverse,changeLineTrailingSpaceColor:noColor,commonColor:c.dim,commonIndicator:" ",commonLineTrailingSpaceColor:noColor,compareKeys:void 0,contextLines:DIFF_CONTEXT_DEFAULT,emptyFirstOrLastLinePlaceholder:"",expand:true,includeChangeCounts:false,omitAnnotationLines:false,patchColor:c.yellow};}function getCompareKeys(compareKeys){return compareKeys&&typeof compareKeys==="function"?compareKeys:void 0;}function getContextLines(contextLines){return typeof contextLines==="number"&&Number.isSafeInteger(contextLines)&&contextLines>=0?contextLines:DIFF_CONTEXT_DEFAULT;}function normalizeDiffOptions(options={}){return _objectSpread(_objectSpread(_objectSpread({},getDefaultOptions()),options),{},{compareKeys:getCompareKeys(options.compareKeys),contextLines:getContextLines(options.contextLines)});}function isEmptyString(lines){return lines.length===1&&lines[0].length===0;}function countChanges(diffs){let a=0;let b=0;diffs.forEach(diff2=>{switch(diff2[0]){case DIFF_DELETE:a+=1;break;case DIFF_INSERT:b+=1;break;}});return{a,b};}function printAnnotation({aAnnotation,aColor,aIndicator,bAnnotation,bColor,bIndicator,includeChangeCounts,omitAnnotationLines},changeCounts){if(omitAnnotationLines)return"";let aRest="";let bRest="";if(includeChangeCounts){const aCount=String(changeCounts.a);const bCount=String(changeCounts.b);const baAnnotationLengthDiff=bAnnotation.length-aAnnotation.length;const aAnnotationPadding=" ".repeat(Math.max(0,baAnnotationLengthDiff));const bAnnotationPadding=" ".repeat(Math.max(0,-baAnnotationLengthDiff));const baCountLengthDiff=bCount.length-aCount.length;const aCountPadding=" ".repeat(Math.max(0,baCountLengthDiff));const bCountPadding=" ".repeat(Math.max(0,-baCountLengthDiff));aRest=\`\${aAnnotationPadding} \${aIndicator} \${aCountPadding}\${aCount}\`;bRest=\`\${bAnnotationPadding} \${bIndicator} \${bCountPadding}\${bCount}\`;}const a=\`\${aIndicator} \${aAnnotation}\${aRest}\`;const b=\`\${bIndicator} \${bAnnotation}\${bRest}\`;return\`\${aColor(a)} +\${bColor(b)} + +\`;}function printDiffLines(diffs,options){return printAnnotation(options,countChanges(diffs))+(options.expand?joinAlignedDiffsExpand(diffs,options):joinAlignedDiffsNoExpand(diffs,options));}function diffLinesUnified(aLines,bLines,options){return printDiffLines(diffLinesRaw(isEmptyString(aLines)?[]:aLines,isEmptyString(bLines)?[]:bLines),normalizeDiffOptions(options));}function diffLinesUnified2(aLinesDisplay,bLinesDisplay,aLinesCompare,bLinesCompare,options){if(isEmptyString(aLinesDisplay)&&isEmptyString(aLinesCompare)){aLinesDisplay=[];aLinesCompare=[];}if(isEmptyString(bLinesDisplay)&&isEmptyString(bLinesCompare)){bLinesDisplay=[];bLinesCompare=[];}if(aLinesDisplay.length!==aLinesCompare.length||bLinesDisplay.length!==bLinesCompare.length){return diffLinesUnified(aLinesDisplay,bLinesDisplay,options);}const diffs=diffLinesRaw(aLinesCompare,bLinesCompare);let aIndex=0;let bIndex=0;diffs.forEach(diff2=>{switch(diff2[0]){case DIFF_DELETE:diff2[1]=aLinesDisplay[aIndex];aIndex+=1;break;case DIFF_INSERT:diff2[1]=bLinesDisplay[bIndex];bIndex+=1;break;default:diff2[1]=bLinesDisplay[bIndex];aIndex+=1;bIndex+=1;}});return printDiffLines(diffs,normalizeDiffOptions(options));}function diffLinesRaw(aLines,bLines){const aLength=aLines.length;const bLength=bLines.length;const isCommon=(aIndex2,bIndex2)=>aLines[aIndex2]===bLines[bIndex2];const diffs=[];let aIndex=0;let bIndex=0;const foundSubsequence=(nCommon,aCommon,bCommon)=>{for(;aIndex!==aCommon;aIndex+=1)diffs.push(new Diff(DIFF_DELETE,aLines[aIndex]));for(;bIndex!==bCommon;bIndex+=1)diffs.push(new Diff(DIFF_INSERT,bLines[bIndex]));for(;nCommon!==0;nCommon-=1,aIndex+=1,bIndex+=1)diffs.push(new Diff(DIFF_EQUAL,bLines[bIndex]));};const diffSequences=_default.default||_default;diffSequences(aLength,bLength,isCommon,foundSubsequence);for(;aIndex!==aLength;aIndex+=1)diffs.push(new Diff(DIFF_DELETE,aLines[aIndex]));for(;bIndex!==bLength;bIndex+=1)diffs.push(new Diff(DIFF_INSERT,bLines[bIndex]));return diffs;}function getCommonMessage(message,options){const _normalizeDiffOptions=normalizeDiffOptions(options),commonColor=_normalizeDiffOptions.commonColor;return commonColor(message);}const _plugins_2=plugins_1,AsymmetricMatcher$2=_plugins_2.AsymmetricMatcher,DOMCollection$1=_plugins_2.DOMCollection,DOMElement$1=_plugins_2.DOMElement,Immutable$1=_plugins_2.Immutable,ReactElement$1=_plugins_2.ReactElement,ReactTestComponent$1=_plugins_2.ReactTestComponent;const PLUGINS$1=[ReactTestComponent$1,ReactElement$1,DOMElement$1,DOMCollection$1,Immutable$1,AsymmetricMatcher$2];const FORMAT_OPTIONS={plugins:PLUGINS$1};const FALLBACK_FORMAT_OPTIONS={callToJSON:false,maxDepth:10,plugins:PLUGINS$1};function diff(a,b,options){if(Object.is(a,b))return"";const aType=getType(a);let expectedType=aType;let omitDifference=false;if(aType==="object"&&typeof a.asymmetricMatch==="function"){if(a.$$typeof!==Symbol.for("jest.asymmetricMatcher")){return null;}if(typeof a.getExpectedType!=="function"){return null;}expectedType=a.getExpectedType();omitDifference=expectedType==="string";}if(expectedType!==getType(b)){const _normalizeDiffOptions2=normalizeDiffOptions(options),aAnnotation=_normalizeDiffOptions2.aAnnotation,aColor=_normalizeDiffOptions2.aColor,aIndicator=_normalizeDiffOptions2.aIndicator,bAnnotation=_normalizeDiffOptions2.bAnnotation,bColor=_normalizeDiffOptions2.bColor,bIndicator=_normalizeDiffOptions2.bIndicator;const formatOptions=getFormatOptions(FALLBACK_FORMAT_OPTIONS,options);const aDisplay=format_1(a,formatOptions);const bDisplay=format_1(b,formatOptions);const aDiff=\`\${aColor(\`\${aIndicator} \${aAnnotation}:\`)} +\${aDisplay}\`;const bDiff=\`\${bColor(\`\${bIndicator} \${bAnnotation}:\`)} +\${bDisplay}\`;return\`\${aDiff} + +\${bDiff}\`;}if(omitDifference)return null;switch(aType){case"string":return diffLinesUnified(a.split("\\n"),b.split("\\n"),options);case"boolean":case"number":return comparePrimitive(a,b,options);case"map":return compareObjects(sortMap(a),sortMap(b),options);case"set":return compareObjects(sortSet(a),sortSet(b),options);default:return compareObjects(a,b,options);}}function comparePrimitive(a,b,options){const aFormat=format_1(a,FORMAT_OPTIONS);const bFormat=format_1(b,FORMAT_OPTIONS);return aFormat===bFormat?"":diffLinesUnified(aFormat.split("\\n"),bFormat.split("\\n"),options);}function sortMap(map){return new Map(Array.from(map.entries()).sort());}function sortSet(set){return new Set(Array.from(set.values()).sort());}function compareObjects(a,b,options){let difference;let hasThrown=false;try{const formatOptions=getFormatOptions(FORMAT_OPTIONS,options);difference=getObjectsDifference(a,b,formatOptions,options);}catch{hasThrown=true;}const noDiffMessage=getCommonMessage(NO_DIFF_MESSAGE,options);if(difference===void 0||difference===noDiffMessage){const formatOptions=getFormatOptions(FALLBACK_FORMAT_OPTIONS,options);difference=getObjectsDifference(a,b,formatOptions,options);if(difference!==noDiffMessage&&!hasThrown){difference=\`\${getCommonMessage(SIMILAR_MESSAGE,options)} + +\${difference}\`;}}return difference;}function getFormatOptions(formatOptions,options){const _normalizeDiffOptions3=normalizeDiffOptions(options),compareKeys=_normalizeDiffOptions3.compareKeys;return _objectSpread(_objectSpread({},formatOptions),{},{compareKeys});}function getObjectsDifference(a,b,formatOptions,options){const formatOptionsZeroIndent=_objectSpread(_objectSpread({},formatOptions),{},{indent:0});const aCompare=format_1(a,formatOptionsZeroIndent);const bCompare=format_1(b,formatOptionsZeroIndent);if(aCompare===bCompare){return getCommonMessage(NO_DIFF_MESSAGE,options);}else{const aDisplay=format_1(a,formatOptions);const bDisplay=format_1(b,formatOptions);return diffLinesUnified2(aDisplay.split("\\n"),bDisplay.split("\\n"),aCompare.split("\\n"),bCompare.split("\\n"),options);}}const IS_RECORD_SYMBOL="@@__IMMUTABLE_RECORD__@@";const IS_COLLECTION_SYMBOL="@@__IMMUTABLE_ITERABLE__@@";function isImmutable(v){return v&&(v[IS_COLLECTION_SYMBOL]||v[IS_RECORD_SYMBOL]);}const OBJECT_PROTO=Object.getPrototypeOf({});function getUnserializableMessage(err){if(err instanceof Error)return\`: \${err.message}\`;if(typeof err==="string")return\`: \${err}\`;return"";}function serializeError(val,seen=/* @__PURE__ */new WeakMap()){if(!val||typeof val==="string")return val;if(typeof val==="function")return\`Function<\${val.name||"anonymous"}>\`;if(typeof val==="symbol")return val.toString();if(typeof val!=="object")return val;if(isImmutable(val))return serializeError(val.toJSON(),seen);if(val instanceof Promise||val.constructor&&val.constructor.prototype==="AsyncFunction")return"Promise";if(typeof Element!=="undefined"&&val instanceof Element)return val.tagName;if(typeof val.asymmetricMatch==="function")return\`\${val.toString()} \${format(val.sample)}\`;if(seen.has(val))return seen.get(val);if(Array.isArray(val)){const clone=new Array(val.length);seen.set(val,clone);val.forEach((e,i)=>{try{clone[i]=serializeError(e,seen);}catch(err){clone[i]=getUnserializableMessage(err);}});return clone;}else{const clone=/* @__PURE__ */Object.create(null);seen.set(val,clone);let obj=val;while(obj&&obj!==OBJECT_PROTO){Object.getOwnPropertyNames(obj).forEach(key=>{if(key in clone)return;try{clone[key]=serializeError(val[key],seen);}catch(err){delete clone[key];clone[key]=getUnserializableMessage(err);}});obj=Object.getPrototypeOf(obj);}return clone;}}function normalizeErrorMessage(message){return message.replace(/__(vite_ssr_import|vi_import)_\\d+__\\./g,"");}function processError(err,diffOptions){if(!err||typeof err!=="object")return{message:err};if(err.stack)err.stackStr=String(err.stack);if(err.name)err.nameStr=String(err.name);if(err.showDiff||err.showDiff===void 0&&err.expected!==void 0&&err.actual!==void 0){const clonedActual=deepClone(err.actual,{forceWritable:true});const clonedExpected=deepClone(err.expected,{forceWritable:true});const _replaceAsymmetricMat=replaceAsymmetricMatcher(clonedActual,clonedExpected),replacedActual=_replaceAsymmetricMat.replacedActual,replacedExpected=_replaceAsymmetricMat.replacedExpected;err.diff=diff(replacedExpected,replacedActual,_objectSpread(_objectSpread({},diffOptions),err.diffOptions));}if(typeof err.expected!=="string")err.expected=stringify(err.expected,10);if(typeof err.actual!=="string")err.actual=stringify(err.actual,10);try{if(typeof err.message==="string")err.message=normalizeErrorMessage(err.message);if(typeof err.cause==="object"&&typeof err.cause.message==="string")err.cause.message=normalizeErrorMessage(err.cause.message);}catch{}try{return serializeError(err);}catch(e){return serializeError(new Error(\`Failed to fully serialize error: \${e==null?void 0:e.message} +Inner error message: \${err==null?void 0:err.message}\`));}}function isAsymmetricMatcher(data){const type=getType$2(data);return type==="Object"&&typeof data.asymmetricMatch==="function";}function isReplaceable(obj1,obj2){const obj1Type=getType$2(obj1);const obj2Type=getType$2(obj2);return obj1Type===obj2Type&&(obj1Type==="Object"||obj1Type==="Array");}function replaceAsymmetricMatcher(actual,expected,actualReplaced=/* @__PURE__ */new WeakSet(),expectedReplaced=/* @__PURE__ */new WeakSet()){if(!isReplaceable(actual,expected))return{replacedActual:actual,replacedExpected:expected};if(actualReplaced.has(actual)||expectedReplaced.has(expected))return{replacedActual:actual,replacedExpected:expected};actualReplaced.add(actual);expectedReplaced.add(expected);getOwnProperties(expected).forEach(key=>{const expectedValue=expected[key];const actualValue=actual[key];if(isAsymmetricMatcher(expectedValue)){if(expectedValue.asymmetricMatch(actualValue))actual[key]=expectedValue;}else if(isAsymmetricMatcher(actualValue)){if(actualValue.asymmetricMatch(expectedValue))expected[key]=actualValue;}else if(isReplaceable(actualValue,expectedValue)){const replaced=replaceAsymmetricMatcher(actualValue,expectedValue,actualReplaced,expectedReplaced);actual[key]=replaced.replacedActual;expected[key]=replaced.replacedExpected;}});return{replacedActual:actual,replacedExpected:expected};}function createChainable(keys,fn){function create(context){const chain2=function(...args){return fn.apply(context,args);};Object.assign(chain2,fn);chain2.withContext=()=>chain2.bind(context);chain2.setContext=(key,value)=>{context[key]=value;};chain2.mergeContext=ctx=>{Object.assign(context,ctx);};for(const key of keys){Object.defineProperty(chain2,key,{get(){return create(_objectSpread(_objectSpread({},context),{},{[key]:true}));}});}return chain2;}const chain=create({});chain.fn=fn;return chain;}function getNames(task){const names=[task.name];let current=task;while((current==null?void 0:current.suite)||(current==null?void 0:current.file)){current=current.suite||current.file;if(current==null?void 0:current.name)names.unshift(current.name);}return names;}const _DRIVE_LETTER_START_RE=/^[A-Za-z]:\\//;function normalizeWindowsPath$1(input=""){if(!input){return input;}return input.replace(/\\\\/g,"/").replace(_DRIVE_LETTER_START_RE,r=>r.toUpperCase());}const _IS_ABSOLUTE_RE$1=/^[/\\\\](?![/\\\\])|^[/\\\\]{2}(?!\\.)|^[A-Za-z]:[/\\\\]/;function cwd$1(){if(typeof process!=="undefined"&&typeof process.cwd==="function"){return process.cwd().replace(/\\\\/g,"/");}return"/";}const resolve$3=function(...arguments_){arguments_=arguments_.map(argument=>normalizeWindowsPath$1(argument));let resolvedPath="";let resolvedAbsolute=false;for(let index=arguments_.length-1;index>=-1&&!resolvedAbsolute;index--){const path=index>=0?arguments_[index]:cwd$1();if(!path||path.length===0){continue;}resolvedPath=\`\${path}/\${resolvedPath}\`;resolvedAbsolute=isAbsolute$1(path);}resolvedPath=normalizeString$1(resolvedPath,!resolvedAbsolute);if(resolvedAbsolute&&!isAbsolute$1(resolvedPath)){return\`/\${resolvedPath}\`;}return resolvedPath.length>0?resolvedPath:".";};function normalizeString$1(path,allowAboveRoot){let res="";let lastSegmentLength=0;let lastSlash=-1;let dots=0;let char=null;for(let index=0;index<=path.length;++index){if(index2){const lastSlashIndex=res.lastIndexOf("/");if(lastSlashIndex===-1){res="";lastSegmentLength=0;}else{res=res.slice(0,lastSlashIndex);lastSegmentLength=res.length-1-res.lastIndexOf("/");}lastSlash=index;dots=0;continue;}else if(res.length>0){res="";lastSegmentLength=0;lastSlash=index;dots=0;continue;}}if(allowAboveRoot){res+=res.length>0?"/..":"..";lastSegmentLength=2;}}else{if(res.length>0){res+=\`/\${path.slice(lastSlash+1,index)}\`;}else{res=path.slice(lastSlash+1,index);}lastSegmentLength=index-lastSlash-1;}lastSlash=index;dots=0;}else if(char==="."&&dots!==-1){++dots;}else{dots=-1;}}return res;}const isAbsolute$1=function(p){return _IS_ABSOLUTE_RE$1.test(p);};const fnMap=/* @__PURE__ */new WeakMap();const fixtureMap=/* @__PURE__ */new WeakMap();const hooksMap=/* @__PURE__ */new WeakMap();function setFn(key,fn){fnMap.set(key,fn);}function setFixture(key,fixture){fixtureMap.set(key,fixture);}function getFixture(key){return fixtureMap.get(key);}function setHooks(key,hooks){hooksMap.set(key,hooks);}function getHooks(key){return hooksMap.get(key);}class PendingError extends Error{constructor(message,task){super(message);this.message=message;this.taskId=task.id;}code="VITEST_PENDING";taskId;}const collectorContext={tasks:[],currentSuite:null};function collectTask(task){var _a;(_a=collectorContext.currentSuite)==null?void 0:_a.tasks.push(task);}async function runWithSuite(suite,fn){const prev=collectorContext.currentSuite;collectorContext.currentSuite=suite;await fn();collectorContext.currentSuite=prev;}function withTimeout(fn,timeout,isHook=false){if(timeout<=0||timeout===Number.POSITIVE_INFINITY)return fn;const _getSafeTimers=getSafeTimers(),setTimeout=_getSafeTimers.setTimeout,clearTimeout=_getSafeTimers.clearTimeout;return(...args)=>{return Promise.race([fn(...args),new Promise((resolve,reject)=>{var _a;const timer=setTimeout(()=>{clearTimeout(timer);reject(new Error(makeTimeoutMsg(isHook,timeout)));},timeout);(_a=timer.unref)==null?void 0:_a.call(timer);})]);};}function createTestContext(test,runner){var _a;const context=function(){throw new Error("done() callback is deprecated, use promise instead");};context.task=test;context.skip=()=>{test.pending=true;throw new PendingError("test is skipped; abort execution",test);};context.onTestFailed=fn=>{test.onFailed||(test.onFailed=[]);test.onFailed.push(fn);};context.onTestFinished=fn=>{test.onFinished||(test.onFinished=[]);test.onFinished.push(fn);};return((_a=runner.extendTaskContext)==null?void 0:_a.call(runner,context))||context;}function makeTimeoutMsg(isHook,timeout){return\`\${isHook?"Hook":"Test"} timed out in \${timeout}ms. +If this is a long-running \${isHook?"hook":"test"}, pass a timeout value as the last argument or configure it globally with "\${isHook?"hookTimeout":"testTimeout"}".\`;}function mergeContextFixtures(fixtures,context={}){const fixtureOptionKeys=["auto"];const fixtureArray=Object.entries(fixtures).map(([prop,value])=>{const fixtureItem={value};if(Array.isArray(value)&&value.length>=2&&isObject$1(value[1])&&Object.keys(value[1]).some(key=>fixtureOptionKeys.includes(key))){Object.assign(fixtureItem,value[1]);fixtureItem.value=value[0];}fixtureItem.prop=prop;fixtureItem.isFn=typeof fixtureItem.value==="function";return fixtureItem;});if(Array.isArray(context.fixtures))context.fixtures=context.fixtures.concat(fixtureArray);else context.fixtures=fixtureArray;fixtureArray.forEach(fixture=>{if(fixture.isFn){const usedProps=getUsedProps(fixture.value);if(usedProps.length)fixture.deps=context.fixtures.filter(({prop})=>prop!==fixture.prop&&usedProps.includes(prop));}});return context;}const fixtureValueMaps=/* @__PURE__ */new Map();const cleanupFnArrayMap=/* @__PURE__ */new Map();function withFixtures(fn,testContext){return hookContext=>{const context=hookContext||testContext;if(!context)return fn({});const fixtures=getFixture(context);if(!(fixtures==null?void 0:fixtures.length))return fn(context);const usedProps=getUsedProps(fn);const hasAutoFixture=fixtures.some(({auto})=>auto);if(!usedProps.length&&!hasAutoFixture)return fn(context);if(!fixtureValueMaps.get(context))fixtureValueMaps.set(context,/* @__PURE__ */new Map());const fixtureValueMap=fixtureValueMaps.get(context);if(!cleanupFnArrayMap.has(context))cleanupFnArrayMap.set(context,[]);const cleanupFnArray=cleanupFnArrayMap.get(context);const usedFixtures=fixtures.filter(({prop,auto})=>auto||usedProps.includes(prop));const pendingFixtures=resolveDeps(usedFixtures);if(!pendingFixtures.length)return fn(context);async function resolveFixtures(){for(const fixture of pendingFixtures){if(fixtureValueMap.has(fixture))continue;const resolvedValue=fixture.isFn?await resolveFixtureFunction(fixture.value,context,cleanupFnArray):fixture.value;context[fixture.prop]=resolvedValue;fixtureValueMap.set(fixture,resolvedValue);cleanupFnArray.unshift(()=>{fixtureValueMap.delete(fixture);});}}return resolveFixtures().then(()=>fn(context));};}async function resolveFixtureFunction(fixtureFn,context,cleanupFnArray){const useFnArgPromise=createDefer();let isUseFnArgResolved=false;const fixtureReturn=fixtureFn(context,async useFnArg=>{isUseFnArgResolved=true;useFnArgPromise.resolve(useFnArg);const useReturnPromise=createDefer();cleanupFnArray.push(async()=>{useReturnPromise.resolve();await fixtureReturn;});await useReturnPromise;}).catch(e=>{if(!isUseFnArgResolved){useFnArgPromise.reject(e);return;}throw e;});return useFnArgPromise;}function resolveDeps(fixtures,depSet=/* @__PURE__ */new Set(),pendingFixtures=[]){fixtures.forEach(fixture=>{if(pendingFixtures.includes(fixture))return;if(!fixture.isFn||!fixture.deps){pendingFixtures.push(fixture);return;}if(depSet.has(fixture))throw new Error(\`Circular fixture dependency detected: \${fixture.prop} <- \${[...depSet].reverse().map(d=>d.prop).join(" <- ")}\`);depSet.add(fixture);resolveDeps(fixture.deps,depSet,pendingFixtures);pendingFixtures.push(fixture);depSet.clear();});return pendingFixtures;}function getUsedProps(fn){const match=fn.toString().match(/[^(]*\\(([^)]*)/);if(!match)return[];const args=splitByComma(match[1]);if(!args.length)return[];const first=args[0];if(!(first.startsWith("{")&&first.endsWith("}")))throw new Error(\`The first argument inside a fixture must use object destructuring pattern, e.g. ({ test } => {}). Instead, received "\${first}".\`);const _first=first.slice(1,-1).replace(/\\s/g,"");const props=splitByComma(_first).map(prop=>{return prop.replace(/\\:.*|\\=.*/g,"");});const last=props.at(-1);if(last&&last.startsWith("..."))throw new Error(\`Rest parameters are not supported in fixtures, received "\${last}".\`);return props;}function splitByComma(s){const result=[];const stack=[];let start=0;for(let i=0;i{};if(typeof optionsOrTest==="object"){if(typeof optionsOrFn==="object")throw new TypeError("Cannot use two objects as arguments. Please provide options and a function callback in that order.");options=optionsOrTest;}else if(typeof optionsOrTest==="number"){options={timeout:optionsOrTest};}else if(typeof optionsOrFn==="object"){options=optionsOrFn;}if(typeof optionsOrFn==="function"){if(typeof optionsOrTest==="function")throw new TypeError("Cannot use two functions as arguments. Please use the second argument for options.");fn=optionsOrFn;}else if(typeof optionsOrTest==="function"){fn=optionsOrTest;}return{options,handler:fn};}function createSuiteCollector(name,factory=()=>{},mode,shuffle,each,suiteOptions){const tasks=[];const factoryQueue=[];let suite2;initSuite();const task=function(name2="",options={}){const task2={id:"",name:name2,suite:void 0,each:options.each,fails:options.fails,context:void 0,type:"custom",retry:options.retry??runner.config.retry,repeats:options.repeats,mode:options.only?"only":options.skip?"skip":options.todo?"todo":"run",meta:options.meta??/* @__PURE__ */Object.create(null)};const handler=options.handler;if(options.concurrent||!options.sequential&&runner.config.sequence.concurrent)task2.concurrent=true;if(shuffle)task2.shuffle=true;const context=createTestContext(task2,runner);Object.defineProperty(task2,"context",{value:context,enumerable:false});setFixture(context,options.fixtures);if(handler){setFn(task2,withTimeout(withFixtures(handler,context),(options==null?void 0:options.timeout)??runner.config.testTimeout));}tasks.push(task2);return task2;};const test2=createTest(function(name2,optionsOrFn,optionsOrTest){let _parseArguments=parseArguments(optionsOrFn,optionsOrTest),options=_parseArguments.options,handler=_parseArguments.handler;if(typeof suiteOptions==="object")options=Object.assign({},suiteOptions,options);options.concurrent=this.concurrent||!this.sequential&&(options==null?void 0:options.concurrent);options.sequential=this.sequential||!this.concurrent&&(options==null?void 0:options.sequential);const test3=task(formatName(name2),_objectSpread(_objectSpread(_objectSpread({},this),options),{},{handler}));test3.type="test";});const collector={type:"collector",name,mode,options:suiteOptions,test:test2,tasks,collect,task,clear,on:addHook};function addHook(name2,...fn){getHooks(suite2)[name2].push(...fn);}function initSuite(){if(typeof suiteOptions==="number")suiteOptions={timeout:suiteOptions};suite2={id:"",type:"suite",name,mode,each,shuffle,tasks:[],meta:/* @__PURE__ */Object.create(null),projectName:""};setHooks(suite2,createSuiteHooks());}function clear(){tasks.length=0;factoryQueue.length=0;initSuite();}async function collect(file){factoryQueue.length=0;if(factory)await runWithSuite(collector,()=>factory(test2));const allChildren=[];for(const i of[...factoryQueue,...tasks])allChildren.push(i.type==="collector"?await i.collect(file):i);suite2.file=file;suite2.tasks=allChildren;allChildren.forEach(task2=>{task2.suite=suite2;if(file)task2.file=file;});return suite2;}collectTask(collector);return collector;}function createSuite(){function suiteFn(name,factoryOrOptions,optionsOrFactory={}){const mode=this.only?"only":this.skip?"skip":this.todo?"todo":"run";const currentSuite=getCurrentSuite();let _parseArguments2=parseArguments(factoryOrOptions,optionsOrFactory),options=_parseArguments2.options,factory=_parseArguments2.handler;if(currentSuite==null?void 0:currentSuite.options)options=_objectSpread(_objectSpread({},currentSuite.options),options);options.concurrent=this.concurrent||!this.sequential&&(options==null?void 0:options.concurrent);options.sequential=this.sequential||!this.concurrent&&(options==null?void 0:options.sequential);return createSuiteCollector(formatName(name),factory,mode,this.shuffle,this.each,options);}suiteFn.each=function(cases,...args){const suite2=this.withContext();this.setContext("each",true);if(Array.isArray(cases)&&args.length)cases=formatTemplateString(cases,args);return(name,optionsOrFn,fnOrOptions)=>{const _name=formatName(name);const arrayOnlyCases=cases.every(Array.isArray);const _parseArguments3=parseArguments(optionsOrFn,fnOrOptions),options=_parseArguments3.options,handler=_parseArguments3.handler;cases.forEach((i,idx)=>{const items=Array.isArray(i)?i:[i];arrayOnlyCases?suite2(formatTitle(_name,items,idx),options,()=>handler(...items)):suite2(formatTitle(_name,items,idx),options,()=>handler(i));});this.setContext("each",void 0);};};suiteFn.skipIf=condition=>condition?suite.skip:suite;suiteFn.runIf=condition=>condition?suite:suite.skip;return createChainable(["concurrent","sequential","shuffle","skip","only","todo"],suiteFn);}function createTaskCollector(fn,context){const taskFn=fn;taskFn.each=function(cases,...args){const test2=this.withContext();this.setContext("each",true);if(Array.isArray(cases)&&args.length)cases=formatTemplateString(cases,args);return(name,optionsOrFn,fnOrOptions)=>{const _name=formatName(name);const arrayOnlyCases=cases.every(Array.isArray);const _parseArguments4=parseArguments(optionsOrFn,fnOrOptions),options=_parseArguments4.options,handler=_parseArguments4.handler;cases.forEach((i,idx)=>{const items=Array.isArray(i)?i:[i];arrayOnlyCases?test2(formatTitle(_name,items,idx),options,()=>handler(...items)):test2(formatTitle(_name,items,idx),options,()=>handler(i));});this.setContext("each",void 0);};};taskFn.skipIf=function(condition){return condition?this.skip:this;};taskFn.runIf=function(condition){return condition?this:this.skip;};taskFn.extend=function(fixtures){const _context=mergeContextFixtures(fixtures,context);return createTest(function fn2(name,optionsOrFn,optionsOrTest){getCurrentSuite().test.fn.call(this,formatName(name),optionsOrFn,optionsOrTest);},_context);};const _test=createChainable(["concurrent","sequential","skip","only","todo","fails"],taskFn);if(context)_test.mergeContext(context);return _test;}function createTest(fn,context){return createTaskCollector(fn,context);}function formatName(name){return typeof name==="string"?name:name instanceof Function?name.name||"":String(name);}function formatTitle(template,items,idx){if(template.includes("%#")){template=template.replace(/%%/g,"__vitest_escaped_%__").replace(/%#/g,\`\${idx}\`).replace(/__vitest_escaped_%__/g,"%%");}const count=template.split("%").length-1;let formatted=format(template,...items.slice(0,count));if(isObject$1(items[0])){formatted=formatted.replace(/\\$([$\\w_.]+)/g,// https://github.com/chaijs/chai/pull/1490 +(_,key)=>{var _a,_b;return objDisplay$2(objectAttr(items[0],key),{truncate:(_b=(_a=void 0)==null?void 0:_a.chaiConfig)==null?void 0:_b.truncateThreshold});});}return formatted;}function formatTemplateString(cases,args){const header=cases.join("").trim().replace(/ /g,"").split("\\n").map(i=>i.split("|"))[0];const res=[];for(let i=0;i + * MIT Licensed + */ /*! + * Return a function that will copy properties from + * one object to another excluding any originally + * listed. Returned function will create a new \`{}\`. + * + * @param {String} excluded properties ... + * @return {Function} + */function exclude(){var excludes=[].slice.call(arguments);function excludeProps(res,obj){Object.keys(obj).forEach(function(key){if(!~excludes.indexOf(key))res[key]=obj[key];});}return function extendExclude(){var args=[].slice.call(arguments),i=0,res={};for(;i + * @see https://github.com/logicalparadox/filtr + * MIT Licensed + */ /** + * ### .hasProperty(object, name) + * + * This allows checking whether an object has own + * or inherited from prototype chain named property. + * + * Basically does the same thing as the \`in\` + * operator but works properly with null/undefined values + * and other primitives. + * + * var obj = { + * arr: ['a', 'b', 'c'] + * , str: 'Hello' + * } + * + * The following would be the results. + * + * hasProperty(obj, 'str'); // true + * hasProperty(obj, 'constructor'); // true + * hasProperty(obj, 'bar'); // false + * + * hasProperty(obj.str, 'length'); // true + * hasProperty(obj.str, 1); // true + * hasProperty(obj.str, 5); // false + * + * hasProperty(obj.arr, 'length'); // true + * hasProperty(obj.arr, 2); // true + * hasProperty(obj.arr, 3); // false + * + * @param {Object} object + * @param {String|Symbol} name + * @returns {Boolean} whether it exists + * @namespace Utils + * @name hasProperty + * @api public + */function hasProperty(obj,name){if(typeof obj==='undefined'||obj===null){return false;}// The \`in\` operator does not work with primitives. +return name in Object(obj);}/* ! + * ## parsePath(path) + * + * Helper function used to parse string object + * paths. Use in conjunction with \`internalGetPathValue\`. + * + * var parsed = parsePath('myobject.property.subprop'); + * + * ### Paths: + * + * * Can be infinitely deep and nested. + * * Arrays are also valid using the formal \`myobject.document[3].property\`. + * * Literal dots and brackets (not delimiter) must be backslash-escaped. + * + * @param {String} path + * @returns {Object} parsed + * @api private + */function parsePath(path){var str=path.replace(/([^\\\\])\\[/g,'$1.[');var parts=str.match(/(\\\\\\.|[^.]+?)+/g);return parts.map(function mapMatches(value){if(value==='constructor'||value==='__proto__'||value==='prototype'){return{};}var regexp=/^\\[(\\d+)\\]$/;var mArr=regexp.exec(value);var parsed=null;if(mArr){parsed={i:parseFloat(mArr[1])};}else{parsed={p:value.replace(/\\\\([.[\\]])/g,'$1')};}return parsed;});}/* ! + * ## internalGetPathValue(obj, parsed[, pathDepth]) + * + * Helper companion function for \`.parsePath\` that returns + * the value located at the parsed address. + * + * var value = getPathValue(obj, parsed); + * + * @param {Object} object to search against + * @param {Object} parsed definition from \`parsePath\`. + * @param {Number} depth (nesting level) of the property we want to retrieve + * @returns {Object|Undefined} value + * @api private + */function internalGetPathValue(obj,parsed,pathDepth){var temporaryValue=obj;var res=null;pathDepth=typeof pathDepth==='undefined'?parsed.length:pathDepth;for(var i=0;i1?internalGetPathValue(obj,parsed,parsed.length-1):obj,name:last.p||last.i,value:internalGetPathValue(obj,parsed)};info.exists=hasProperty(info.parent,info.name);return info;}/** + * ### .getPathValue(object, path) + * + * This allows the retrieval of values in an + * object given a string path. + * + * var obj = { + * prop1: { + * arr: ['a', 'b', 'c'] + * , str: 'Hello' + * } + * , prop2: { + * arr: [ { nested: 'Universe' } ] + * , str: 'Hello again!' + * } + * } + * + * The following would be the results. + * + * getPathValue(obj, 'prop1.str'); // Hello + * getPathValue(obj, 'prop1.att[2]'); // b + * getPathValue(obj, 'prop2.arr[0].nested'); // Universe + * + * @param {Object} object + * @param {String} path + * @returns {Object} value or \`undefined\` + * @namespace Utils + * @name getPathValue + * @api public + */function getPathValue(obj,path){var info=getPathInfo(obj,path);return info.value;}/** + * ### .setPathValue(object, path, value) + * + * Define the value in an object at a given string path. + * + * \`\`\`js + * var obj = { + * prop1: { + * arr: ['a', 'b', 'c'] + * , str: 'Hello' + * } + * , prop2: { + * arr: [ { nested: 'Universe' } ] + * , str: 'Hello again!' + * } + * }; + * \`\`\` + * + * The following would be acceptable. + * + * \`\`\`js + * var properties = require('tea-properties'); + * properties.set(obj, 'prop1.str', 'Hello Universe!'); + * properties.set(obj, 'prop1.arr[2]', 'B'); + * properties.set(obj, 'prop2.arr[0].nested.value', { hello: 'universe' }); + * \`\`\` + * + * @param {Object} object + * @param {String} path + * @param {Mixed} value + * @api private + */function setPathValue(obj,path,val){var parsed=parsePath(path);internalSetPathValue(obj,val,parsed);return obj;}var pathval={hasProperty:hasProperty,getPathInfo:getPathInfo,getPathValue:getPathValue,setPathValue:setPathValue};/*! + * Chai - flag utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ /** + * ### .flag(object, key, [value]) + * + * Get or set a flag value on an object. If a + * value is provided it will be set, else it will + * return the currently set value or \`undefined\` if + * the value is not set. + * + * utils.flag(this, 'foo', 'bar'); // setter + * utils.flag(this, 'foo'); // getter, returns \`bar\` + * + * @param {Object} object constructed Assertion + * @param {String} key + * @param {Mixed} value (optional) + * @namespace Utils + * @name flag + * @api private + */var flag$5=function flag(obj,key,value){var flags=obj.__flags||(obj.__flags=Object.create(null));if(arguments.length===3){flags[key]=value;}else{return flags[key];}};/*! + * Chai - test utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ /*! + * Module dependencies + */var flag$4=flag$5;/** + * ### .test(object, expression) + * + * Test an object for expression. + * + * @param {Object} object (constructed Assertion) + * @param {Arguments} chai.Assertion.prototype.assert arguments + * @namespace Utils + * @name test + */var test$1=function test(obj,args){var negate=flag$4(obj,'negate'),expr=args[0];return negate?!expr:expr;};var typeDetect$1={exports:{}};(function(module,exports){(function(global,factory){module.exports=factory();})(commonjsGlobal$1,function(){/* ! + * type-detect + * Copyright(c) 2013 jake luer + * MIT Licensed + */var promiseExists=typeof Promise==='function';/* eslint-disable no-undef */var globalObject=typeof self==='object'?self:commonjsGlobal$1;// eslint-disable-line id-blacklist +var symbolExists=typeof Symbol!=='undefined';var mapExists=typeof Map!=='undefined';var setExists=typeof Set!=='undefined';var weakMapExists=typeof WeakMap!=='undefined';var weakSetExists=typeof WeakSet!=='undefined';var dataViewExists=typeof DataView!=='undefined';var symbolIteratorExists=symbolExists&&typeof Symbol.iterator!=='undefined';var symbolToStringTagExists=symbolExists&&typeof Symbol.toStringTag!=='undefined';var setEntriesExists=setExists&&typeof Set.prototype.entries==='function';var mapEntriesExists=mapExists&&typeof Map.prototype.entries==='function';var setIteratorPrototype=setEntriesExists&&Object.getPrototypeOf(new Set().entries());var mapIteratorPrototype=mapEntriesExists&&Object.getPrototypeOf(new Map().entries());var arrayIteratorExists=symbolIteratorExists&&typeof Array.prototype[Symbol.iterator]==='function';var arrayIteratorPrototype=arrayIteratorExists&&Object.getPrototypeOf([][Symbol.iterator]());var stringIteratorExists=symbolIteratorExists&&typeof String.prototype[Symbol.iterator]==='function';var stringIteratorPrototype=stringIteratorExists&&Object.getPrototypeOf(''[Symbol.iterator]());var toStringLeftSliceLength=8;var toStringRightSliceLength=-1;/** + * ### typeOf (obj) + * + * Uses \`Object.prototype.toString\` to determine the type of an object, + * normalising behaviour across engine versions & well optimised. + * + * @param {Mixed} object + * @return {String} object type + * @api public + */function typeDetect(obj){/* ! Speed optimisation + * Pre: + * string literal x 3,039,035 ops/sec ±1.62% (78 runs sampled) + * boolean literal x 1,424,138 ops/sec ±4.54% (75 runs sampled) + * number literal x 1,653,153 ops/sec ±1.91% (82 runs sampled) + * undefined x 9,978,660 ops/sec ±1.92% (75 runs sampled) + * function x 2,556,769 ops/sec ±1.73% (77 runs sampled) + * Post: + * string literal x 38,564,796 ops/sec ±1.15% (79 runs sampled) + * boolean literal x 31,148,940 ops/sec ±1.10% (79 runs sampled) + * number literal x 32,679,330 ops/sec ±1.90% (78 runs sampled) + * undefined x 32,363,368 ops/sec ±1.07% (82 runs sampled) + * function x 31,296,870 ops/sec ±0.96% (83 runs sampled) + */var typeofObj=typeof obj;if(typeofObj!=='object'){return typeofObj;}/* ! Speed optimisation + * Pre: + * null x 28,645,765 ops/sec ±1.17% (82 runs sampled) + * Post: + * null x 36,428,962 ops/sec ±1.37% (84 runs sampled) + */if(obj===null){return'null';}/* ! Spec Conformance + * Test: \`Object.prototype.toString.call(window)\`\` + * - Node === "[object global]" + * - Chrome === "[object global]" + * - Firefox === "[object Window]" + * - PhantomJS === "[object Window]" + * - Safari === "[object Window]" + * - IE 11 === "[object Window]" + * - IE Edge === "[object Window]" + * Test: \`Object.prototype.toString.call(this)\`\` + * - Chrome Worker === "[object global]" + * - Firefox Worker === "[object DedicatedWorkerGlobalScope]" + * - Safari Worker === "[object DedicatedWorkerGlobalScope]" + * - IE 11 Worker === "[object WorkerGlobalScope]" + * - IE Edge Worker === "[object WorkerGlobalScope]" + */if(obj===globalObject){return'global';}/* ! Speed optimisation + * Pre: + * array literal x 2,888,352 ops/sec ±0.67% (82 runs sampled) + * Post: + * array literal x 22,479,650 ops/sec ±0.96% (81 runs sampled) + */if(Array.isArray(obj)&&(symbolToStringTagExists===false||!(Symbol.toStringTag in obj))){return'Array';}// Not caching existence of \`window\` and related properties due to potential +// for \`window\` to be unset before tests in quasi-browser environments. +if(typeof window==='object'&&window!==null){/* ! Spec Conformance + * (https://html.spec.whatwg.org/multipage/browsers.html#location) + * WhatWG HTML$7.7.3 - The \`Location\` interface + * Test: \`Object.prototype.toString.call(window.location)\`\` + * - IE <=11 === "[object Object]" + * - IE Edge <=13 === "[object Object]" + */if(typeof window.location==='object'&&obj===window.location){return'Location';}/* ! Spec Conformance + * (https://html.spec.whatwg.org/#document) + * WhatWG HTML$3.1.1 - The \`Document\` object + * Note: Most browsers currently adher to the W3C DOM Level 2 spec + * (https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26809268) + * which suggests that browsers should use HTMLTableCellElement for + * both TD and TH elements. WhatWG separates these. + * WhatWG HTML states: + * > For historical reasons, Window objects must also have a + * > writable, configurable, non-enumerable property named + * > HTMLDocument whose value is the Document interface object. + * Test: \`Object.prototype.toString.call(document)\`\` + * - Chrome === "[object HTMLDocument]" + * - Firefox === "[object HTMLDocument]" + * - Safari === "[object HTMLDocument]" + * - IE <=10 === "[object Document]" + * - IE 11 === "[object HTMLDocument]" + * - IE Edge <=13 === "[object HTMLDocument]" + */if(typeof window.document==='object'&&obj===window.document){return'Document';}if(typeof window.navigator==='object'){/* ! Spec Conformance + * (https://html.spec.whatwg.org/multipage/webappapis.html#mimetypearray) + * WhatWG HTML$8.6.1.5 - Plugins - Interface MimeTypeArray + * Test: \`Object.prototype.toString.call(navigator.mimeTypes)\`\` + * - IE <=10 === "[object MSMimeTypesCollection]" + */if(typeof window.navigator.mimeTypes==='object'&&obj===window.navigator.mimeTypes){return'MimeTypeArray';}/* ! Spec Conformance + * (https://html.spec.whatwg.org/multipage/webappapis.html#pluginarray) + * WhatWG HTML$8.6.1.5 - Plugins - Interface PluginArray + * Test: \`Object.prototype.toString.call(navigator.plugins)\`\` + * - IE <=10 === "[object MSPluginsCollection]" + */if(typeof window.navigator.plugins==='object'&&obj===window.navigator.plugins){return'PluginArray';}}if((typeof window.HTMLElement==='function'||typeof window.HTMLElement==='object')&&obj instanceof window.HTMLElement){/* ! Spec Conformance + * (https://html.spec.whatwg.org/multipage/webappapis.html#pluginarray) + * WhatWG HTML$4.4.4 - The \`blockquote\` element - Interface \`HTMLQuoteElement\` + * Test: \`Object.prototype.toString.call(document.createElement('blockquote'))\`\` + * - IE <=10 === "[object HTMLBlockElement]" + */if(obj.tagName==='BLOCKQUOTE'){return'HTMLQuoteElement';}/* ! Spec Conformance + * (https://html.spec.whatwg.org/#htmltabledatacellelement) + * WhatWG HTML$4.9.9 - The \`td\` element - Interface \`HTMLTableDataCellElement\` + * Note: Most browsers currently adher to the W3C DOM Level 2 spec + * (https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-82915075) + * which suggests that browsers should use HTMLTableCellElement for + * both TD and TH elements. WhatWG separates these. + * Test: Object.prototype.toString.call(document.createElement('td')) + * - Chrome === "[object HTMLTableCellElement]" + * - Firefox === "[object HTMLTableCellElement]" + * - Safari === "[object HTMLTableCellElement]" + */if(obj.tagName==='TD'){return'HTMLTableDataCellElement';}/* ! Spec Conformance + * (https://html.spec.whatwg.org/#htmltableheadercellelement) + * WhatWG HTML$4.9.9 - The \`td\` element - Interface \`HTMLTableHeaderCellElement\` + * Note: Most browsers currently adher to the W3C DOM Level 2 spec + * (https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-82915075) + * which suggests that browsers should use HTMLTableCellElement for + * both TD and TH elements. WhatWG separates these. + * Test: Object.prototype.toString.call(document.createElement('th')) + * - Chrome === "[object HTMLTableCellElement]" + * - Firefox === "[object HTMLTableCellElement]" + * - Safari === "[object HTMLTableCellElement]" + */if(obj.tagName==='TH'){return'HTMLTableHeaderCellElement';}}}/* ! Speed optimisation + * Pre: + * Float64Array x 625,644 ops/sec ±1.58% (80 runs sampled) + * Float32Array x 1,279,852 ops/sec ±2.91% (77 runs sampled) + * Uint32Array x 1,178,185 ops/sec ±1.95% (83 runs sampled) + * Uint16Array x 1,008,380 ops/sec ±2.25% (80 runs sampled) + * Uint8Array x 1,128,040 ops/sec ±2.11% (81 runs sampled) + * Int32Array x 1,170,119 ops/sec ±2.88% (80 runs sampled) + * Int16Array x 1,176,348 ops/sec ±5.79% (86 runs sampled) + * Int8Array x 1,058,707 ops/sec ±4.94% (77 runs sampled) + * Uint8ClampedArray x 1,110,633 ops/sec ±4.20% (80 runs sampled) + * Post: + * Float64Array x 7,105,671 ops/sec ±13.47% (64 runs sampled) + * Float32Array x 5,887,912 ops/sec ±1.46% (82 runs sampled) + * Uint32Array x 6,491,661 ops/sec ±1.76% (79 runs sampled) + * Uint16Array x 6,559,795 ops/sec ±1.67% (82 runs sampled) + * Uint8Array x 6,463,966 ops/sec ±1.43% (85 runs sampled) + * Int32Array x 5,641,841 ops/sec ±3.49% (81 runs sampled) + * Int16Array x 6,583,511 ops/sec ±1.98% (80 runs sampled) + * Int8Array x 6,606,078 ops/sec ±1.74% (81 runs sampled) + * Uint8ClampedArray x 6,602,224 ops/sec ±1.77% (83 runs sampled) + */var stringTag=symbolToStringTagExists&&obj[Symbol.toStringTag];if(typeof stringTag==='string'){return stringTag;}var objPrototype=Object.getPrototypeOf(obj);/* ! Speed optimisation + * Pre: + * regex literal x 1,772,385 ops/sec ±1.85% (77 runs sampled) + * regex constructor x 2,143,634 ops/sec ±2.46% (78 runs sampled) + * Post: + * regex literal x 3,928,009 ops/sec ±0.65% (78 runs sampled) + * regex constructor x 3,931,108 ops/sec ±0.58% (84 runs sampled) + */if(objPrototype===RegExp.prototype){return'RegExp';}/* ! Speed optimisation + * Pre: + * date x 2,130,074 ops/sec ±4.42% (68 runs sampled) + * Post: + * date x 3,953,779 ops/sec ±1.35% (77 runs sampled) + */if(objPrototype===Date.prototype){return'Date';}/* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-promise.prototype-@@tostringtag) + * ES6$25.4.5.4 - Promise.prototype[@@toStringTag] should be "Promise": + * Test: \`Object.prototype.toString.call(Promise.resolve())\`\` + * - Chrome <=47 === "[object Object]" + * - Edge <=20 === "[object Object]" + * - Firefox 29-Latest === "[object Promise]" + * - Safari 7.1-Latest === "[object Promise]" + */if(promiseExists&&objPrototype===Promise.prototype){return'Promise';}/* ! Speed optimisation + * Pre: + * set x 2,222,186 ops/sec ±1.31% (82 runs sampled) + * Post: + * set x 4,545,879 ops/sec ±1.13% (83 runs sampled) + */if(setExists&&objPrototype===Set.prototype){return'Set';}/* ! Speed optimisation + * Pre: + * map x 2,396,842 ops/sec ±1.59% (81 runs sampled) + * Post: + * map x 4,183,945 ops/sec ±6.59% (82 runs sampled) + */if(mapExists&&objPrototype===Map.prototype){return'Map';}/* ! Speed optimisation + * Pre: + * weakset x 1,323,220 ops/sec ±2.17% (76 runs sampled) + * Post: + * weakset x 4,237,510 ops/sec ±2.01% (77 runs sampled) + */if(weakSetExists&&objPrototype===WeakSet.prototype){return'WeakSet';}/* ! Speed optimisation + * Pre: + * weakmap x 1,500,260 ops/sec ±2.02% (78 runs sampled) + * Post: + * weakmap x 3,881,384 ops/sec ±1.45% (82 runs sampled) + */if(weakMapExists&&objPrototype===WeakMap.prototype){return'WeakMap';}/* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-dataview.prototype-@@tostringtag) + * ES6$24.2.4.21 - DataView.prototype[@@toStringTag] should be "DataView": + * Test: \`Object.prototype.toString.call(new DataView(new ArrayBuffer(1)))\`\` + * - Edge <=13 === "[object Object]" + */if(dataViewExists&&objPrototype===DataView.prototype){return'DataView';}/* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%mapiteratorprototype%-@@tostringtag) + * ES6$23.1.5.2.2 - %MapIteratorPrototype%[@@toStringTag] should be "Map Iterator": + * Test: \`Object.prototype.toString.call(new Map().entries())\`\` + * - Edge <=13 === "[object Object]" + */if(mapExists&&objPrototype===mapIteratorPrototype){return'Map Iterator';}/* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%setiteratorprototype%-@@tostringtag) + * ES6$23.2.5.2.2 - %SetIteratorPrototype%[@@toStringTag] should be "Set Iterator": + * Test: \`Object.prototype.toString.call(new Set().entries())\`\` + * - Edge <=13 === "[object Object]" + */if(setExists&&objPrototype===setIteratorPrototype){return'Set Iterator';}/* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%arrayiteratorprototype%-@@tostringtag) + * ES6$22.1.5.2.2 - %ArrayIteratorPrototype%[@@toStringTag] should be "Array Iterator": + * Test: \`Object.prototype.toString.call([][Symbol.iterator]())\`\` + * - Edge <=13 === "[object Object]" + */if(arrayIteratorExists&&objPrototype===arrayIteratorPrototype){return'Array Iterator';}/* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%stringiteratorprototype%-@@tostringtag) + * ES6$21.1.5.2.2 - %StringIteratorPrototype%[@@toStringTag] should be "String Iterator": + * Test: \`Object.prototype.toString.call(''[Symbol.iterator]())\`\` + * - Edge <=13 === "[object Object]" + */if(stringIteratorExists&&objPrototype===stringIteratorPrototype){return'String Iterator';}/* ! Speed optimisation + * Pre: + * object from null x 2,424,320 ops/sec ±1.67% (76 runs sampled) + * Post: + * object from null x 5,838,000 ops/sec ±0.99% (84 runs sampled) + */if(objPrototype===null){return'Object';}return Object.prototype.toString.call(obj).slice(toStringLeftSliceLength,toStringRightSliceLength);}return typeDetect;});})(typeDetect$1);var typeDetectExports$1=typeDetect$1.exports;/*! + * Chai - expectTypes utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ /** + * ### .expectTypes(obj, types) + * + * Ensures that the object being tested against is of a valid type. + * + * utils.expectTypes(this, ['array', 'object', 'string']); + * + * @param {Mixed} obj constructed Assertion + * @param {Array} type A list of allowed types for this assertion + * @namespace Utils + * @name expectTypes + * @api public + */var AssertionError=assertionError;var flag$3=flag$5;var type$3=typeDetectExports$1;var expectTypes=function expectTypes(obj,types){var flagMsg=flag$3(obj,'message');var ssfi=flag$3(obj,'ssfi');flagMsg=flagMsg?flagMsg+': ':'';obj=flag$3(obj,'object');types=types.map(function(t){return t.toLowerCase();});types.sort();// Transforms ['lorem', 'ipsum'] into 'a lorem, or an ipsum' +var str=types.map(function(t,index){var art=~['a','e','i','o','u'].indexOf(t.charAt(0))?'an':'a';var or=types.length>1&&index===types.length-1?'or ':'';return or+art+' '+t;}).join(', ');var objType=type$3(obj).toLowerCase();if(!types.some(function(expected){return objType===expected;})){throw new AssertionError(flagMsg+'object tested must be '+str+', but '+objType+' given',undefined,ssfi);}};/*! + * Chai - getActual utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ /** + * ### .getActual(object, [actual]) + * + * Returns the \`actual\` value for an Assertion. + * + * @param {Object} object (constructed Assertion) + * @param {Arguments} chai.Assertion.prototype.assert arguments + * @namespace Utils + * @name getActual + */var getActual$1=function getActual(obj,args){return args.length>4?args[4]:obj._obj;};const require$$1=/*@__PURE__*/getAugmentedNamespace(loupe$1);var config$5={/** + * ### config.includeStack + * + * User configurable property, influences whether stack trace + * is included in Assertion error message. Default of false + * suppresses stack trace in the error message. + * + * chai.config.includeStack = true; // enable stack on error + * + * @param {Boolean} + * @api public + */includeStack:false,/** + * ### config.showDiff + * + * User configurable property, influences whether or not + * the \`showDiff\` flag should be included in the thrown + * AssertionErrors. \`false\` will always be \`false\`; \`true\` + * will be true when the assertion has requested a diff + * be shown. + * + * @param {Boolean} + * @api public + */showDiff:true,/** + * ### config.truncateThreshold + * + * User configurable property, sets length threshold for actual and + * expected values in assertion errors. If this threshold is exceeded, for + * example for large data structures, the value is replaced with something + * like \`[ Array(3) ]\` or \`{ Object (prop1, prop2) }\`. + * + * Set it to zero if you want to disable truncating altogether. + * + * This is especially userful when doing assertions on arrays: having this + * set to a reasonable large value makes the failure messages readily + * inspectable. + * + * chai.config.truncateThreshold = 0; // disable truncating + * + * @param {Number} + * @api public + */truncateThreshold:40,/** + * ### config.useProxy + * + * User configurable property, defines if chai will use a Proxy to throw + * an error when a non-existent property is read, which protects users + * from typos when using property-based assertions. + * + * Set it to false if you want to disable this feature. + * + * chai.config.useProxy = false; // disable use of Proxy + * + * This feature is automatically disabled regardless of this config value + * in environments that don't support proxies. + * + * @param {Boolean} + * @api public + */useProxy:true,/** + * ### config.proxyExcludedKeys + * + * User configurable property, defines which properties should be ignored + * instead of throwing an error if they do not exist on the assertion. + * This is only applied if the environment Chai is running in supports proxies and + * if the \`useProxy\` configuration setting is enabled. + * By default, \`then\` and \`inspect\` will not throw an error if they do not exist on the + * assertion object because the \`.inspect\` property is read by \`util.inspect\` (for example, when + * using \`console.log\` on the assertion object) and \`.then\` is necessary for promise type-checking. + * + * // By default these keys will not throw an error if they do not exist on the assertion object + * chai.config.proxyExcludedKeys = ['then', 'inspect']; + * + * @param {Array} + * @api public + */proxyExcludedKeys:['then','catch','inspect','toJSON'],/** + * ### config.deepEqual + * + * User configurable property, defines which a custom function to use for deepEqual + * comparisons. + * By default, the function used is the one from the \`deep-eql\` package without custom comparator. + * + * // use a custom comparator + * chai.config.deepEqual = (expected, actual) => { + * return chai.util.eql(expected, actual, { + * comparator: (expected, actual) => { + * // for non number comparison, use the default behavior + * if(typeof expected !== 'number') return null; + * // allow a difference of 10 between compared numbers + * return typeof actual === 'number' && Math.abs(actual - expected) < 10 + * } + * }) + * }; + * + * @param {Function} + * @api public + */deepEqual:null};var loupe=require$$1;var config$4=config$5;var inspect_1=inspect$2;/** + * ### .inspect(obj, [showHidden], [depth], [colors]) + * + * Echoes the value of a value. Tries to print the value out + * in the best way possible given the different types. + * + * @param {Object} obj The object to print out. + * @param {Boolean} showHidden Flag that shows hidden (not enumerable) + * properties of objects. Default is false. + * @param {Number} depth Depth in which to descend in object. Default is 2. + * @param {Boolean} colors Flag to turn on ANSI escape codes to color the + * output. Default is false (no coloring). + * @namespace Utils + * @name inspect + */function inspect$2(obj,showHidden,depth,colors){var options={colors:colors,depth:typeof depth==='undefined'?2:depth,showHidden:showHidden,truncate:config$4.truncateThreshold?config$4.truncateThreshold:Infinity};return loupe.inspect(obj,options);}/*! + * Chai - flag utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ /*! + * Module dependencies + */var inspect$1=inspect_1;var config$3=config$5;/** + * ### .objDisplay(object) + * + * Determines if an object or an array matches + * criteria to be inspected in-line for error + * messages or should be truncated. + * + * @param {Mixed} javascript object to inspect + * @returns {string} stringified object + * @name objDisplay + * @namespace Utils + * @api public + */var objDisplay$1=function objDisplay(obj){var str=inspect$1(obj),type=Object.prototype.toString.call(obj);if(config$3.truncateThreshold&&str.length>=config$3.truncateThreshold){if(type==='[object Function]'){return!obj.name||obj.name===''?'[Function]':'[Function: '+obj.name+']';}else if(type==='[object Array]'){return'[ Array('+obj.length+') ]';}else if(type==='[object Object]'){var keys=Object.keys(obj),kstr=keys.length>2?keys.splice(0,2).join(', ')+', ...':keys.join(', ');return'{ Object ('+kstr+') }';}else{return str;}}else{return str;}};/*! + * Chai - message composition utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ /*! + * Module dependencies + */var flag$2=flag$5,getActual=getActual$1,objDisplay=objDisplay$1;/** + * ### .getMessage(object, message, negateMessage) + * + * Construct the error message based on flags + * and template tags. Template tags will return + * a stringified inspection of the object referenced. + * + * Message template tags: + * - \`#{this}\` current asserted object + * - \`#{act}\` actual value + * - \`#{exp}\` expected value + * + * @param {Object} object (constructed Assertion) + * @param {Arguments} chai.Assertion.prototype.assert arguments + * @namespace Utils + * @name getMessage + * @api public + */var getMessage$1=function getMessage(obj,args){var negate=flag$2(obj,'negate'),val=flag$2(obj,'object'),expected=args[3],actual=getActual(obj,args),msg=negate?args[2]:args[1],flagMsg=flag$2(obj,'message');if(typeof msg==="function")msg=msg();msg=msg||'';msg=msg.replace(/#\\{this\\}/g,function(){return objDisplay(val);}).replace(/#\\{act\\}/g,function(){return objDisplay(actual);}).replace(/#\\{exp\\}/g,function(){return objDisplay(expected);});return flagMsg?flagMsg+': '+msg:msg;};/*! + * Chai - transferFlags utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ /** + * ### .transferFlags(assertion, object, includeAll = true) + * + * Transfer all the flags for \`assertion\` to \`object\`. If + * \`includeAll\` is set to \`false\`, then the base Chai + * assertion flags (namely \`object\`, \`ssfi\`, \`lockSsfi\`, + * and \`message\`) will not be transferred. + * + * + * var newAssertion = new Assertion(); + * utils.transferFlags(assertion, newAssertion); + * + * var anotherAssertion = new Assertion(myObj); + * utils.transferFlags(assertion, anotherAssertion, false); + * + * @param {Assertion} assertion the assertion to transfer the flags from + * @param {Object} object the object to transfer the flags to; usually a new assertion + * @param {Boolean} includeAll + * @namespace Utils + * @name transferFlags + * @api private + */var transferFlags=function transferFlags(assertion,object,includeAll){var flags=assertion.__flags||(assertion.__flags=Object.create(null));if(!object.__flags){object.__flags=Object.create(null);}includeAll=arguments.length===3?includeAll:true;for(var flag in flags){if(includeAll||flag!=='object'&&flag!=='ssfi'&&flag!=='lockSsfi'&&flag!='message'){object.__flags[flag]=flags[flag];}}};var deepEql={exports:{}};/* globals Symbol: false, Uint8Array: false, WeakMap: false */ /*! + * deep-eql + * Copyright(c) 2013 Jake Luer + * MIT Licensed + */var type$2=typeDetectExports$1;function FakeMap(){this._key='chai/deep-eql__'+Math.random()+Date.now();}FakeMap.prototype={get:function get(key){return key[this._key];},set:function set(key,value){if(Object.isExtensible(key)){Object.defineProperty(key,this._key,{value:value,configurable:true});}}};var MemoizeMap=typeof WeakMap==='function'?WeakMap:FakeMap;/*! + * Check to see if the MemoizeMap has recorded a result of the two operands + * + * @param {Mixed} leftHandOperand + * @param {Mixed} rightHandOperand + * @param {MemoizeMap} memoizeMap + * @returns {Boolean|null} result +*/function memoizeCompare(leftHandOperand,rightHandOperand,memoizeMap){// Technically, WeakMap keys can *only* be objects, not primitives. +if(!memoizeMap||isPrimitive$1(leftHandOperand)||isPrimitive$1(rightHandOperand)){return null;}var leftHandMap=memoizeMap.get(leftHandOperand);if(leftHandMap){var result=leftHandMap.get(rightHandOperand);if(typeof result==='boolean'){return result;}}return null;}/*! + * Set the result of the equality into the MemoizeMap + * + * @param {Mixed} leftHandOperand + * @param {Mixed} rightHandOperand + * @param {MemoizeMap} memoizeMap + * @param {Boolean} result +*/function memoizeSet(leftHandOperand,rightHandOperand,memoizeMap,result){// Technically, WeakMap keys can *only* be objects, not primitives. +if(!memoizeMap||isPrimitive$1(leftHandOperand)||isPrimitive$1(rightHandOperand)){return;}var leftHandMap=memoizeMap.get(leftHandOperand);if(leftHandMap){leftHandMap.set(rightHandOperand,result);}else{leftHandMap=new MemoizeMap();leftHandMap.set(rightHandOperand,result);memoizeMap.set(leftHandOperand,leftHandMap);}}/*! + * Primary Export + */deepEql.exports=deepEqual;deepEql.exports.MemoizeMap=MemoizeMap;/** + * Assert deeply nested sameValue equality between two objects of any type. + * + * @param {Mixed} leftHandOperand + * @param {Mixed} rightHandOperand + * @param {Object} [options] (optional) Additional options + * @param {Array} [options.comparator] (optional) Override default algorithm, determining custom equality. + * @param {Array} [options.memoize] (optional) Provide a custom memoization object which will cache the results of + complex objects for a speed boost. By passing \`false\` you can disable memoization, but this will cause circular + references to blow the stack. + * @return {Boolean} equal match + */function deepEqual(leftHandOperand,rightHandOperand,options){// If we have a comparator, we can't assume anything; so bail to its check first. +if(options&&options.comparator){return extensiveDeepEqual(leftHandOperand,rightHandOperand,options);}var simpleResult=simpleEqual(leftHandOperand,rightHandOperand);if(simpleResult!==null){return simpleResult;}// Deeper comparisons are pushed through to a larger function +return extensiveDeepEqual(leftHandOperand,rightHandOperand,options);}/** + * Many comparisons can be canceled out early via simple equality or primitive checks. + * @param {Mixed} leftHandOperand + * @param {Mixed} rightHandOperand + * @return {Boolean|null} equal match + */function simpleEqual(leftHandOperand,rightHandOperand){// Equal references (except for Numbers) can be returned early +if(leftHandOperand===rightHandOperand){// Handle +-0 cases +return leftHandOperand!==0||1/leftHandOperand===1/rightHandOperand;}// handle NaN cases +if(leftHandOperand!==leftHandOperand&&// eslint-disable-line no-self-compare +rightHandOperand!==rightHandOperand// eslint-disable-line no-self-compare +){return true;}// Anything that is not an 'object', i.e. symbols, functions, booleans, numbers, +// strings, and undefined, can be compared by reference. +if(isPrimitive$1(leftHandOperand)||isPrimitive$1(rightHandOperand)){// Easy out b/c it would have passed the first equality check +return false;}return null;}/*! + * The main logic of the \`deepEqual\` function. + * + * @param {Mixed} leftHandOperand + * @param {Mixed} rightHandOperand + * @param {Object} [options] (optional) Additional options + * @param {Array} [options.comparator] (optional) Override default algorithm, determining custom equality. + * @param {Array} [options.memoize] (optional) Provide a custom memoization object which will cache the results of + complex objects for a speed boost. By passing \`false\` you can disable memoization, but this will cause circular + references to blow the stack. + * @return {Boolean} equal match +*/function extensiveDeepEqual(leftHandOperand,rightHandOperand,options){options=options||{};options.memoize=options.memoize===false?false:options.memoize||new MemoizeMap();var comparator=options&&options.comparator;// Check if a memoized result exists. +var memoizeResultLeft=memoizeCompare(leftHandOperand,rightHandOperand,options.memoize);if(memoizeResultLeft!==null){return memoizeResultLeft;}var memoizeResultRight=memoizeCompare(rightHandOperand,leftHandOperand,options.memoize);if(memoizeResultRight!==null){return memoizeResultRight;}// If a comparator is present, use it. +if(comparator){var comparatorResult=comparator(leftHandOperand,rightHandOperand);// Comparators may return null, in which case we want to go back to default behavior. +if(comparatorResult===false||comparatorResult===true){memoizeSet(leftHandOperand,rightHandOperand,options.memoize,comparatorResult);return comparatorResult;}// To allow comparators to override *any* behavior, we ran them first. Since it didn't decide +// what to do, we need to make sure to return the basic tests first before we move on. +var simpleResult=simpleEqual(leftHandOperand,rightHandOperand);if(simpleResult!==null){// Don't memoize this, it takes longer to set/retrieve than to just compare. +return simpleResult;}}var leftHandType=type$2(leftHandOperand);if(leftHandType!==type$2(rightHandOperand)){memoizeSet(leftHandOperand,rightHandOperand,options.memoize,false);return false;}// Temporarily set the operands in the memoize object to prevent blowing the stack +memoizeSet(leftHandOperand,rightHandOperand,options.memoize,true);var result=extensiveDeepEqualByType(leftHandOperand,rightHandOperand,leftHandType,options);memoizeSet(leftHandOperand,rightHandOperand,options.memoize,result);return result;}function extensiveDeepEqualByType(leftHandOperand,rightHandOperand,leftHandType,options){switch(leftHandType){case'String':case'Number':case'Boolean':case'Date':// If these types are their instance types (e.g. \`new Number\`) then re-deepEqual against their values +return deepEqual(leftHandOperand.valueOf(),rightHandOperand.valueOf());case'Promise':case'Symbol':case'function':case'WeakMap':case'WeakSet':return leftHandOperand===rightHandOperand;case'Error':return keysEqual(leftHandOperand,rightHandOperand,['name','message','code'],options);case'Arguments':case'Int8Array':case'Uint8Array':case'Uint8ClampedArray':case'Int16Array':case'Uint16Array':case'Int32Array':case'Uint32Array':case'Float32Array':case'Float64Array':case'Array':return iterableEqual(leftHandOperand,rightHandOperand,options);case'RegExp':return regexpEqual(leftHandOperand,rightHandOperand);case'Generator':return generatorEqual(leftHandOperand,rightHandOperand,options);case'DataView':return iterableEqual(new Uint8Array(leftHandOperand.buffer),new Uint8Array(rightHandOperand.buffer),options);case'ArrayBuffer':return iterableEqual(new Uint8Array(leftHandOperand),new Uint8Array(rightHandOperand),options);case'Set':return entriesEqual(leftHandOperand,rightHandOperand,options);case'Map':return entriesEqual(leftHandOperand,rightHandOperand,options);case'Temporal.PlainDate':case'Temporal.PlainTime':case'Temporal.PlainDateTime':case'Temporal.Instant':case'Temporal.ZonedDateTime':case'Temporal.PlainYearMonth':case'Temporal.PlainMonthDay':return leftHandOperand.equals(rightHandOperand);case'Temporal.Duration':return leftHandOperand.total('nanoseconds')===rightHandOperand.total('nanoseconds');case'Temporal.TimeZone':case'Temporal.Calendar':return leftHandOperand.toString()===rightHandOperand.toString();default:return objectEqual(leftHandOperand,rightHandOperand,options);}}/*! + * Compare two Regular Expressions for equality. + * + * @param {RegExp} leftHandOperand + * @param {RegExp} rightHandOperand + * @return {Boolean} result + */function regexpEqual(leftHandOperand,rightHandOperand){return leftHandOperand.toString()===rightHandOperand.toString();}/*! + * Compare two Sets/Maps for equality. Faster than other equality functions. + * + * @param {Set} leftHandOperand + * @param {Set} rightHandOperand + * @param {Object} [options] (Optional) + * @return {Boolean} result + */function entriesEqual(leftHandOperand,rightHandOperand,options){// IE11 doesn't support Set#entries or Set#@@iterator, so we need manually populate using Set#forEach +if(leftHandOperand.size!==rightHandOperand.size){return false;}if(leftHandOperand.size===0){return true;}var leftHandItems=[];var rightHandItems=[];leftHandOperand.forEach(function gatherEntries(key,value){leftHandItems.push([key,value]);});rightHandOperand.forEach(function gatherEntries(key,value){rightHandItems.push([key,value]);});return iterableEqual(leftHandItems.sort(),rightHandItems.sort(),options);}/*! + * Simple equality for flat iterable objects such as Arrays, TypedArrays or Node.js buffers. + * + * @param {Iterable} leftHandOperand + * @param {Iterable} rightHandOperand + * @param {Object} [options] (Optional) + * @return {Boolean} result + */function iterableEqual(leftHandOperand,rightHandOperand,options){var length=leftHandOperand.length;if(length!==rightHandOperand.length){return false;}if(length===0){return true;}var index=-1;while(++index + * MIT Licensed + */ /** + * ### .isProxyEnabled() + * + * Helper function to check if Chai's proxy protection feature is enabled. If + * proxies are unsupported or disabled via the user's Chai config, then return + * false. Otherwise, return true. + * + * @namespace Utils + * @name isProxyEnabled + */var isProxyEnabled$1=function isProxyEnabled(){return config$2.useProxy&&typeof Proxy!=='undefined'&&typeof Reflect!=='undefined';};/*! + * Chai - addProperty utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */var addProperty;var hasRequiredAddProperty;function requireAddProperty(){if(hasRequiredAddProperty)return addProperty;hasRequiredAddProperty=1;var chai=requireChai();var flag=flag$5;var isProxyEnabled=isProxyEnabled$1;var transferFlags$1=transferFlags;/** + * ### .addProperty(ctx, name, getter) + * + * Adds a property to the prototype of an object. + * + * utils.addProperty(chai.Assertion.prototype, 'foo', function () { + * var obj = utils.flag(this, 'object'); + * new chai.Assertion(obj).to.be.instanceof(Foo); + * }); + * + * Can also be accessed directly from \`chai.Assertion\`. + * + * chai.Assertion.addProperty('foo', fn); + * + * Then can be used as any other assertion. + * + * expect(myFoo).to.be.foo; + * + * @param {Object} ctx object to which the property is added + * @param {String} name of property to add + * @param {Function} getter function to be used for name + * @namespace Utils + * @name addProperty + * @api public + */addProperty=function addProperty(ctx,name,getter){getter=getter===undefined?function(){}:getter;Object.defineProperty(ctx,name,{get:function propertyGetter(){// Setting the \`ssfi\` flag to \`propertyGetter\` causes this function to +// be the starting point for removing implementation frames from the +// stack trace of a failed assertion. +// +// However, we only want to use this function as the starting point if +// the \`lockSsfi\` flag isn't set and proxy protection is disabled. +// +// If the \`lockSsfi\` flag is set, then either this assertion has been +// overwritten by another assertion, or this assertion is being invoked +// from inside of another assertion. In the first case, the \`ssfi\` flag +// has already been set by the overwriting assertion. In the second +// case, the \`ssfi\` flag has already been set by the outer assertion. +// +// If proxy protection is enabled, then the \`ssfi\` flag has already been +// set by the proxy getter. +if(!isProxyEnabled()&&!flag(this,'lockSsfi')){flag(this,'ssfi',propertyGetter);}var result=getter.call(this);if(result!==undefined)return result;var newAssertion=new chai.Assertion();transferFlags$1(this,newAssertion);return newAssertion;},configurable:true});};return addProperty;}var fnLengthDesc=Object.getOwnPropertyDescriptor(function(){},'length');/*! + * Chai - addLengthGuard utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ /** + * ### .addLengthGuard(fn, assertionName, isChainable) + * + * Define \`length\` as a getter on the given uninvoked method assertion. The + * getter acts as a guard against chaining \`length\` directly off of an uninvoked + * method assertion, which is a problem because it references \`function\`'s + * built-in \`length\` property instead of Chai's \`length\` assertion. When the + * getter catches the user making this mistake, it throws an error with a + * helpful message. + * + * There are two ways in which this mistake can be made. The first way is by + * chaining the \`length\` assertion directly off of an uninvoked chainable + * method. In this case, Chai suggests that the user use \`lengthOf\` instead. The + * second way is by chaining the \`length\` assertion directly off of an uninvoked + * non-chainable method. Non-chainable methods must be invoked prior to + * chaining. In this case, Chai suggests that the user consult the docs for the + * given assertion. + * + * If the \`length\` property of functions is unconfigurable, then return \`fn\` + * without modification. + * + * Note that in ES6, the function's \`length\` property is configurable, so once + * support for legacy environments is dropped, Chai's \`length\` property can + * replace the built-in function's \`length\` property, and this length guard will + * no longer be necessary. In the mean time, maintaining consistency across all + * environments is the priority. + * + * @param {Function} fn + * @param {String} assertionName + * @param {Boolean} isChainable + * @namespace Utils + * @name addLengthGuard + */var addLengthGuard=function addLengthGuard(fn,assertionName,isChainable){if(!fnLengthDesc.configurable)return fn;Object.defineProperty(fn,'length',{get:function(){if(isChainable){throw Error('Invalid Chai property: '+assertionName+'.length. Due'+' to a compatibility issue, "length" cannot directly follow "'+assertionName+'". Use "'+assertionName+'.lengthOf" instead.');}throw Error('Invalid Chai property: '+assertionName+'.length. See'+' docs for proper usage of "'+assertionName+'".');}});return fn;};/*! + * Chai - getProperties utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ /** + * ### .getProperties(object) + * + * This allows the retrieval of property names of an object, enumerable or not, + * inherited or not. + * + * @param {Object} object + * @returns {Array} + * @namespace Utils + * @name getProperties + * @api public + */var getProperties$1=function getProperties(object){var result=Object.getOwnPropertyNames(object);function addProperty(property){if(result.indexOf(property)===-1){result.push(property);}}var proto=Object.getPrototypeOf(object);while(proto!==null){Object.getOwnPropertyNames(proto).forEach(addProperty);proto=Object.getPrototypeOf(proto);}return result;};var config$1=config$5;var flag$1=flag$5;var getProperties=getProperties$1;var isProxyEnabled=isProxyEnabled$1;/*! + * Chai - proxify utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */ /** + * ### .proxify(object) + * + * Return a proxy of given object that throws an error when a non-existent + * property is read. By default, the root cause is assumed to be a misspelled + * property, and thus an attempt is made to offer a reasonable suggestion from + * the list of existing properties. However, if a nonChainableMethodName is + * provided, then the root cause is instead a failure to invoke a non-chainable + * method prior to reading the non-existent property. + * + * If proxies are unsupported or disabled via the user's Chai config, then + * return object without modification. + * + * @param {Object} obj + * @param {String} nonChainableMethodName + * @namespace Utils + * @name proxify + */var builtins=['__flags','__methods','_obj','assert'];var proxify=function proxify(obj,nonChainableMethodName){if(!isProxyEnabled())return obj;return new Proxy(obj,{get:function proxyGetter(target,property){// This check is here because we should not throw errors on Symbol properties +// such as \`Symbol.toStringTag\`. +// The values for which an error should be thrown can be configured using +// the \`config.proxyExcludedKeys\` setting. +if(typeof property==='string'&&config$1.proxyExcludedKeys.indexOf(property)===-1&&!Reflect.has(target,property)){// Special message for invalid property access of non-chainable methods. +if(nonChainableMethodName){throw Error('Invalid Chai property: '+nonChainableMethodName+'.'+property+'. See docs for proper usage of "'+nonChainableMethodName+'".');}// If the property is reasonably close to an existing Chai property, +// suggest that property to the user. Only suggest properties with a +// distance less than 4. +var suggestion=null;var suggestionDistance=4;getProperties(target).forEach(function(prop){if(!Object.prototype.hasOwnProperty(prop)&&builtins.indexOf(prop)===-1){var dist=stringDistanceCapped(property,prop,suggestionDistance);if(dist=cap){return cap;}var memo=[];// \`memo\` is a two-dimensional array containing distances. +// memo[i][j] is the distance between strA.slice(0, i) and +// strB.slice(0, j). +for(var i=0;i<=strA.length;i++){memo[i]=Array(strB.length+1).fill(0);memo[i][0]=i;}for(var j=0;j=cap){memo[i][j]=cap;continue;}memo[i][j]=Math.min(memo[i-1][j]+1,memo[i][j-1]+1,memo[i-1][j-1]+(ch===strB.charCodeAt(j-1)?0:1));}}return memo[strA.length][strB.length];}/*! + * Chai - addMethod utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */var addMethod;var hasRequiredAddMethod;function requireAddMethod(){if(hasRequiredAddMethod)return addMethod;hasRequiredAddMethod=1;var addLengthGuard$1=addLengthGuard;var chai=requireChai();var flag=flag$5;var proxify$1=proxify;var transferFlags$1=transferFlags;/** + * ### .addMethod(ctx, name, method) + * + * Adds a method to the prototype of an object. + * + * utils.addMethod(chai.Assertion.prototype, 'foo', function (str) { + * var obj = utils.flag(this, 'object'); + * new chai.Assertion(obj).to.be.equal(str); + * }); + * + * Can also be accessed directly from \`chai.Assertion\`. + * + * chai.Assertion.addMethod('foo', fn); + * + * Then can be used as any other assertion. + * + * expect(fooStr).to.be.foo('bar'); + * + * @param {Object} ctx object to which the method is added + * @param {String} name of method to add + * @param {Function} method function to be used for name + * @namespace Utils + * @name addMethod + * @api public + */addMethod=function addMethod(ctx,name,method){var methodWrapper=function(){// Setting the \`ssfi\` flag to \`methodWrapper\` causes this function to be the +// starting point for removing implementation frames from the stack trace of +// a failed assertion. +// +// However, we only want to use this function as the starting point if the +// \`lockSsfi\` flag isn't set. +// +// If the \`lockSsfi\` flag is set, then either this assertion has been +// overwritten by another assertion, or this assertion is being invoked from +// inside of another assertion. In the first case, the \`ssfi\` flag has +// already been set by the overwriting assertion. In the second case, the +// \`ssfi\` flag has already been set by the outer assertion. +if(!flag(this,'lockSsfi')){flag(this,'ssfi',methodWrapper);}var result=method.apply(this,arguments);if(result!==undefined)return result;var newAssertion=new chai.Assertion();transferFlags$1(this,newAssertion);return newAssertion;};addLengthGuard$1(methodWrapper,name,false);ctx[name]=proxify$1(methodWrapper,name);};return addMethod;}/*! + * Chai - overwriteProperty utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */var overwriteProperty;var hasRequiredOverwriteProperty;function requireOverwriteProperty(){if(hasRequiredOverwriteProperty)return overwriteProperty;hasRequiredOverwriteProperty=1;var chai=requireChai();var flag=flag$5;var isProxyEnabled=isProxyEnabled$1;var transferFlags$1=transferFlags;/** + * ### .overwriteProperty(ctx, name, fn) + * + * Overwrites an already existing property getter and provides + * access to previous value. Must return function to use as getter. + * + * utils.overwriteProperty(chai.Assertion.prototype, 'ok', function (_super) { + * return function () { + * var obj = utils.flag(this, 'object'); + * if (obj instanceof Foo) { + * new chai.Assertion(obj.name).to.equal('bar'); + * } else { + * _super.call(this); + * } + * } + * }); + * + * + * Can also be accessed directly from \`chai.Assertion\`. + * + * chai.Assertion.overwriteProperty('foo', fn); + * + * Then can be used as any other assertion. + * + * expect(myFoo).to.be.ok; + * + * @param {Object} ctx object whose property is to be overwritten + * @param {String} name of property to overwrite + * @param {Function} getter function that returns a getter function to be used for name + * @namespace Utils + * @name overwriteProperty + * @api public + */overwriteProperty=function overwriteProperty(ctx,name,getter){var _get=Object.getOwnPropertyDescriptor(ctx,name),_super=function(){};if(_get&&'function'===typeof _get.get)_super=_get.get;Object.defineProperty(ctx,name,{get:function overwritingPropertyGetter(){// Setting the \`ssfi\` flag to \`overwritingPropertyGetter\` causes this +// function to be the starting point for removing implementation frames +// from the stack trace of a failed assertion. +// +// However, we only want to use this function as the starting point if +// the \`lockSsfi\` flag isn't set and proxy protection is disabled. +// +// If the \`lockSsfi\` flag is set, then either this assertion has been +// overwritten by another assertion, or this assertion is being invoked +// from inside of another assertion. In the first case, the \`ssfi\` flag +// has already been set by the overwriting assertion. In the second +// case, the \`ssfi\` flag has already been set by the outer assertion. +// +// If proxy protection is enabled, then the \`ssfi\` flag has already been +// set by the proxy getter. +if(!isProxyEnabled()&&!flag(this,'lockSsfi')){flag(this,'ssfi',overwritingPropertyGetter);}// Setting the \`lockSsfi\` flag to \`true\` prevents the overwritten +// assertion from changing the \`ssfi\` flag. By this point, the \`ssfi\` +// flag is already set to the correct starting point for this assertion. +var origLockSsfi=flag(this,'lockSsfi');flag(this,'lockSsfi',true);var result=getter(_super).call(this);flag(this,'lockSsfi',origLockSsfi);if(result!==undefined){return result;}var newAssertion=new chai.Assertion();transferFlags$1(this,newAssertion);return newAssertion;},configurable:true});};return overwriteProperty;}/*! + * Chai - overwriteMethod utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */var overwriteMethod;var hasRequiredOverwriteMethod;function requireOverwriteMethod(){if(hasRequiredOverwriteMethod)return overwriteMethod;hasRequiredOverwriteMethod=1;var addLengthGuard$1=addLengthGuard;var chai=requireChai();var flag=flag$5;var proxify$1=proxify;var transferFlags$1=transferFlags;/** + * ### .overwriteMethod(ctx, name, fn) + * + * Overwrites an already existing method and provides + * access to previous function. Must return function + * to be used for name. + * + * utils.overwriteMethod(chai.Assertion.prototype, 'equal', function (_super) { + * return function (str) { + * var obj = utils.flag(this, 'object'); + * if (obj instanceof Foo) { + * new chai.Assertion(obj.value).to.equal(str); + * } else { + * _super.apply(this, arguments); + * } + * } + * }); + * + * Can also be accessed directly from \`chai.Assertion\`. + * + * chai.Assertion.overwriteMethod('foo', fn); + * + * Then can be used as any other assertion. + * + * expect(myFoo).to.equal('bar'); + * + * @param {Object} ctx object whose method is to be overwritten + * @param {String} name of method to overwrite + * @param {Function} method function that returns a function to be used for name + * @namespace Utils + * @name overwriteMethod + * @api public + */overwriteMethod=function overwriteMethod(ctx,name,method){var _method=ctx[name],_super=function(){throw new Error(name+' is not a function');};if(_method&&'function'===typeof _method)_super=_method;var overwritingMethodWrapper=function(){// Setting the \`ssfi\` flag to \`overwritingMethodWrapper\` causes this +// function to be the starting point for removing implementation frames from +// the stack trace of a failed assertion. +// +// However, we only want to use this function as the starting point if the +// \`lockSsfi\` flag isn't set. +// +// If the \`lockSsfi\` flag is set, then either this assertion has been +// overwritten by another assertion, or this assertion is being invoked from +// inside of another assertion. In the first case, the \`ssfi\` flag has +// already been set by the overwriting assertion. In the second case, the +// \`ssfi\` flag has already been set by the outer assertion. +if(!flag(this,'lockSsfi')){flag(this,'ssfi',overwritingMethodWrapper);}// Setting the \`lockSsfi\` flag to \`true\` prevents the overwritten assertion +// from changing the \`ssfi\` flag. By this point, the \`ssfi\` flag is already +// set to the correct starting point for this assertion. +var origLockSsfi=flag(this,'lockSsfi');flag(this,'lockSsfi',true);var result=method(_super).apply(this,arguments);flag(this,'lockSsfi',origLockSsfi);if(result!==undefined){return result;}var newAssertion=new chai.Assertion();transferFlags$1(this,newAssertion);return newAssertion;};addLengthGuard$1(overwritingMethodWrapper,name,false);ctx[name]=proxify$1(overwritingMethodWrapper,name);};return overwriteMethod;}/*! + * Chai - addChainingMethod utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */var addChainableMethod;var hasRequiredAddChainableMethod;function requireAddChainableMethod(){if(hasRequiredAddChainableMethod)return addChainableMethod;hasRequiredAddChainableMethod=1;/*! + * Module dependencies + */var addLengthGuard$1=addLengthGuard;var chai=requireChai();var flag=flag$5;var proxify$1=proxify;var transferFlags$1=transferFlags;/*! + * Module variables + */ // Check whether \`Object.setPrototypeOf\` is supported +var canSetPrototype=typeof Object.setPrototypeOf==='function';// Without \`Object.setPrototypeOf\` support, this module will need to add properties to a function. +// However, some of functions' own props are not configurable and should be skipped. +var testFn=function(){};var excludeNames=Object.getOwnPropertyNames(testFn).filter(function(name){var propDesc=Object.getOwnPropertyDescriptor(testFn,name);// Note: PhantomJS 1.x includes \`callee\` as one of \`testFn\`'s own properties, +// but then returns \`undefined\` as the property descriptor for \`callee\`. As a +// workaround, we perform an otherwise unnecessary type-check for \`propDesc\`, +// and then filter it out if it's not an object as it should be. +if(typeof propDesc!=='object')return true;return!propDesc.configurable;});// Cache \`Function\` properties +var call=Function.prototype.call,apply=Function.prototype.apply;/** + * ### .addChainableMethod(ctx, name, method, chainingBehavior) + * + * Adds a method to an object, such that the method can also be chained. + * + * utils.addChainableMethod(chai.Assertion.prototype, 'foo', function (str) { + * var obj = utils.flag(this, 'object'); + * new chai.Assertion(obj).to.be.equal(str); + * }); + * + * Can also be accessed directly from \`chai.Assertion\`. + * + * chai.Assertion.addChainableMethod('foo', fn, chainingBehavior); + * + * The result can then be used as both a method assertion, executing both \`method\` and + * \`chainingBehavior\`, or as a language chain, which only executes \`chainingBehavior\`. + * + * expect(fooStr).to.be.foo('bar'); + * expect(fooStr).to.be.foo.equal('foo'); + * + * @param {Object} ctx object to which the method is added + * @param {String} name of method to add + * @param {Function} method function to be used for \`name\`, when called + * @param {Function} chainingBehavior function to be called every time the property is accessed + * @namespace Utils + * @name addChainableMethod + * @api public + */addChainableMethod=function addChainableMethod(ctx,name,method,chainingBehavior){if(typeof chainingBehavior!=='function'){chainingBehavior=function(){};}var chainableBehavior={method:method,chainingBehavior:chainingBehavior};// save the methods so we can overwrite them later, if we need to. +if(!ctx.__methods){ctx.__methods={};}ctx.__methods[name]=chainableBehavior;Object.defineProperty(ctx,name,{get:function chainableMethodGetter(){chainableBehavior.chainingBehavior.call(this);var chainableMethodWrapper=function(){// Setting the \`ssfi\` flag to \`chainableMethodWrapper\` causes this +// function to be the starting point for removing implementation +// frames from the stack trace of a failed assertion. +// +// However, we only want to use this function as the starting point if +// the \`lockSsfi\` flag isn't set. +// +// If the \`lockSsfi\` flag is set, then this assertion is being +// invoked from inside of another assertion. In this case, the \`ssfi\` +// flag has already been set by the outer assertion. +// +// Note that overwriting a chainable method merely replaces the saved +// methods in \`ctx.__methods\` instead of completely replacing the +// overwritten assertion. Therefore, an overwriting assertion won't +// set the \`ssfi\` or \`lockSsfi\` flags. +if(!flag(this,'lockSsfi')){flag(this,'ssfi',chainableMethodWrapper);}var result=chainableBehavior.method.apply(this,arguments);if(result!==undefined){return result;}var newAssertion=new chai.Assertion();transferFlags$1(this,newAssertion);return newAssertion;};addLengthGuard$1(chainableMethodWrapper,name,true);// Use \`Object.setPrototypeOf\` if available +if(canSetPrototype){// Inherit all properties from the object by replacing the \`Function\` prototype +var prototype=Object.create(this);// Restore the \`call\` and \`apply\` methods from \`Function\` +prototype.call=call;prototype.apply=apply;Object.setPrototypeOf(chainableMethodWrapper,prototype);}// Otherwise, redefine all properties (slow!) +else{var asserterNames=Object.getOwnPropertyNames(ctx);asserterNames.forEach(function(asserterName){if(excludeNames.indexOf(asserterName)!==-1){return;}var pd=Object.getOwnPropertyDescriptor(ctx,asserterName);Object.defineProperty(chainableMethodWrapper,asserterName,pd);});}transferFlags$1(this,chainableMethodWrapper);return proxify$1(chainableMethodWrapper);},configurable:true});};return addChainableMethod;}/*! + * Chai - overwriteChainableMethod utility + * Copyright(c) 2012-2014 Jake Luer + * MIT Licensed + */var overwriteChainableMethod;var hasRequiredOverwriteChainableMethod;function requireOverwriteChainableMethod(){if(hasRequiredOverwriteChainableMethod)return overwriteChainableMethod;hasRequiredOverwriteChainableMethod=1;var chai=requireChai();var transferFlags$1=transferFlags;/** + * ### .overwriteChainableMethod(ctx, name, method, chainingBehavior) + * + * Overwrites an already existing chainable method + * and provides access to the previous function or + * property. Must return functions to be used for + * name. + * + * utils.overwriteChainableMethod(chai.Assertion.prototype, 'lengthOf', + * function (_super) { + * } + * , function (_super) { + * } + * ); + * + * Can also be accessed directly from \`chai.Assertion\`. + * + * chai.Assertion.overwriteChainableMethod('foo', fn, fn); + * + * Then can be used as any other assertion. + * + * expect(myFoo).to.have.lengthOf(3); + * expect(myFoo).to.have.lengthOf.above(3); + * + * @param {Object} ctx object whose method / property is to be overwritten + * @param {String} name of method / property to overwrite + * @param {Function} method function that returns a function to be used for name + * @param {Function} chainingBehavior function that returns a function to be used for property + * @namespace Utils + * @name overwriteChainableMethod + * @api public + */overwriteChainableMethod=function overwriteChainableMethod(ctx,name,method,chainingBehavior){var chainableBehavior=ctx.__methods[name];var _chainingBehavior=chainableBehavior.chainingBehavior;chainableBehavior.chainingBehavior=function overwritingChainableMethodGetter(){var result=chainingBehavior(_chainingBehavior).call(this);if(result!==undefined){return result;}var newAssertion=new chai.Assertion();transferFlags$1(this,newAssertion);return newAssertion;};var _method=chainableBehavior.method;chainableBehavior.method=function overwritingChainableMethodWrapper(){var result=method(_method).apply(this,arguments);if(result!==undefined){return result;}var newAssertion=new chai.Assertion();transferFlags$1(this,newAssertion);return newAssertion;};};return overwriteChainableMethod;}/*! + * Chai - compareByInspect utility + * Copyright(c) 2011-2016 Jake Luer + * MIT Licensed + */ /*! + * Module dependencies + */var inspect=inspect_1;/** + * ### .compareByInspect(mixed, mixed) + * + * To be used as a compareFunction with Array.prototype.sort. Compares elements + * using inspect instead of default behavior of using toString so that Symbols + * and objects with irregular/missing toString can still be sorted without a + * TypeError. + * + * @param {Mixed} first element to compare + * @param {Mixed} second element to compare + * @returns {Number} -1 if 'a' should come before 'b'; otherwise 1 + * @name compareByInspect + * @namespace Utils + * @api public + */var compareByInspect=function compareByInspect(a,b){return inspect(a) + * MIT Licensed + */ /** + * ### .getOwnEnumerablePropertySymbols(object) + * + * This allows the retrieval of directly-owned enumerable property symbols of an + * object. This function is necessary because Object.getOwnPropertySymbols + * returns both enumerable and non-enumerable property symbols. + * + * @param {Object} object + * @returns {Array} + * @namespace Utils + * @name getOwnEnumerablePropertySymbols + * @api public + */var getOwnEnumerablePropertySymbols$1=function getOwnEnumerablePropertySymbols(obj){if(typeof Object.getOwnPropertySymbols!=='function')return[];return Object.getOwnPropertySymbols(obj).filter(function(sym){return Object.getOwnPropertyDescriptor(obj,sym).enumerable;});};/*! + * Chai - getOwnEnumerableProperties utility + * Copyright(c) 2011-2016 Jake Luer + * MIT Licensed + */ /*! + * Module dependencies + */var getOwnEnumerablePropertySymbols=getOwnEnumerablePropertySymbols$1;/** + * ### .getOwnEnumerableProperties(object) + * + * This allows the retrieval of directly-owned enumerable property names and + * symbols of an object. This function is necessary because Object.keys only + * returns enumerable property names, not enumerable property symbols. + * + * @param {Object} object + * @returns {Array} + * @namespace Utils + * @name getOwnEnumerableProperties + * @api public + */var getOwnEnumerableProperties=function getOwnEnumerableProperties(obj){return Object.keys(obj).concat(getOwnEnumerablePropertySymbols(obj));};/* ! + * Chai - checkError utility + * Copyright(c) 2012-2016 Jake Luer + * MIT Licensed + */var getFunctionName=getFuncName_1;/** + * ### .checkError + * + * Checks that an error conforms to a given set of criteria and/or retrieves information about it. + * + * @api public + */ /** + * ### .compatibleInstance(thrown, errorLike) + * + * Checks if two instances are compatible (strict equal). + * Returns false if errorLike is not an instance of Error, because instances + * can only be compatible if they're both error instances. + * + * @name compatibleInstance + * @param {Error} thrown error + * @param {Error|ErrorConstructor} errorLike object to compare against + * @namespace Utils + * @api public + */function compatibleInstance(thrown,errorLike){return errorLike instanceof Error&&thrown===errorLike;}/** + * ### .compatibleConstructor(thrown, errorLike) + * + * Checks if two constructors are compatible. + * This function can receive either an error constructor or + * an error instance as the \`errorLike\` argument. + * Constructors are compatible if they're the same or if one is + * an instance of another. + * + * @name compatibleConstructor + * @param {Error} thrown error + * @param {Error|ErrorConstructor} errorLike object to compare against + * @namespace Utils + * @api public + */function compatibleConstructor(thrown,errorLike){if(errorLike instanceof Error){// If \`errorLike\` is an instance of any error we compare their constructors +return thrown.constructor===errorLike.constructor||thrown instanceof errorLike.constructor;}else if(errorLike.prototype instanceof Error||errorLike===Error){// If \`errorLike\` is a constructor that inherits from Error, we compare \`thrown\` to \`errorLike\` directly +return thrown.constructor===errorLike||thrown instanceof errorLike;}return false;}/** + * ### .compatibleMessage(thrown, errMatcher) + * + * Checks if an error's message is compatible with a matcher (String or RegExp). + * If the message contains the String or passes the RegExp test, + * it is considered compatible. + * + * @name compatibleMessage + * @param {Error} thrown error + * @param {String|RegExp} errMatcher to look for into the message + * @namespace Utils + * @api public + */function compatibleMessage(thrown,errMatcher){var comparisonString=typeof thrown==='string'?thrown:thrown.message;if(errMatcher instanceof RegExp){return errMatcher.test(comparisonString);}else if(typeof errMatcher==='string'){return comparisonString.indexOf(errMatcher)!==-1;// eslint-disable-line no-magic-numbers +}return false;}/** + * ### .getConstructorName(errorLike) + * + * Gets the constructor name for an Error instance or constructor itself. + * + * @name getConstructorName + * @param {Error|ErrorConstructor} errorLike + * @namespace Utils + * @api public + */function getConstructorName(errorLike){var constructorName=errorLike;if(errorLike instanceof Error){constructorName=getFunctionName(errorLike.constructor);}else if(typeof errorLike==='function'){// If \`err\` is not an instance of Error it is an error constructor itself or another function. +// If we've got a common function we get its name, otherwise we may need to create a new instance +// of the error just in case it's a poorly-constructed error. Please see chaijs/chai/issues/45 to know more. +constructorName=getFunctionName(errorLike);if(constructorName===''){var newConstructorName=getFunctionName(new errorLike());// eslint-disable-line new-cap +constructorName=newConstructorName||constructorName;}}return constructorName;}/** + * ### .getMessage(errorLike) + * + * Gets the error message from an error. + * If \`err\` is a String itself, we return it. + * If the error has no message, we return an empty string. + * + * @name getMessage + * @param {Error|String} errorLike + * @namespace Utils + * @api public + */function getMessage(errorLike){var msg='';if(errorLike&&errorLike.message){msg=errorLike.message;}else if(typeof errorLike==='string'){msg=errorLike;}return msg;}var checkError={compatibleInstance:compatibleInstance,compatibleConstructor:compatibleConstructor,compatibleMessage:compatibleMessage,getMessage:getMessage,getConstructorName:getConstructorName};/*! + * Chai - isNaN utility + * Copyright(c) 2012-2015 Sakthipriyan Vairamani + * MIT Licensed + */ /** + * ### .isNaN(value) + * + * Checks if the given value is NaN or not. + * + * utils.isNaN(NaN); // true + * + * @param {Value} The value which has to be checked if it is NaN + * @name isNaN + * @api private + */function isNaN$1(value){// Refer http://www.ecma-international.org/ecma-262/6.0/#sec-isnan-number +// section's NOTE. +return value!==value;}// If ECMAScript 6's Number.isNaN is present, prefer that. +var _isNaN=Number.isNaN||isNaN$1;var type$1=typeDetectExports$1;var flag=flag$5;function isObjectType(obj){var objectType=type$1(obj);var objectTypes=['Array','Object','function'];return objectTypes.indexOf(objectType)!==-1;}/** + * ### .getOperator(message) + * + * Extract the operator from error message. + * Operator defined is based on below link + * https://nodejs.org/api/assert.html#assert_assert. + * + * Returns the \`operator\` or \`undefined\` value for an Assertion. + * + * @param {Object} object (constructed Assertion) + * @param {Arguments} chai.Assertion.prototype.assert arguments + * @namespace Utils + * @name getOperator + * @api public + */var getOperator=function getOperator(obj,args){var operator=flag(obj,'operator');var negate=flag(obj,'negate');var expected=args[3];var msg=negate?args[2]:args[1];if(operator){return operator;}if(typeof msg==='function')msg=msg();msg=msg||'';if(!msg){return undefined;}if(/\\shave\\s/.test(msg)){return undefined;}var isObject=isObjectType(expected);if(/\\snot\\s/.test(msg)){return isObject?'notDeepStrictEqual':'notStrictEqual';}return isObject?'deepStrictEqual':'strictEqual';};/*! + * chai + * Copyright(c) 2011 Jake Luer + * MIT Licensed + */var hasRequiredUtils;function requireUtils(){if(hasRequiredUtils)return utils;hasRequiredUtils=1;/*! + * Dependencies that are used for multiple exports are required here only once + */var pathval$1=pathval;/*! + * test utility + */utils.test=test$1;/*! + * type utility + */utils.type=typeDetectExports$1;/*! + * expectTypes utility + */utils.expectTypes=expectTypes;/*! + * message utility + */utils.getMessage=getMessage$1;/*! + * actual utility + */utils.getActual=getActual$1;/*! + * Inspect util + */utils.inspect=inspect_1;/*! + * Object Display util + */utils.objDisplay=objDisplay$1;/*! + * Flag utility + */utils.flag=flag$5;/*! + * Flag transferring utility + */utils.transferFlags=transferFlags;/*! + * Deep equal utility + */utils.eql=deepEqlExports;/*! + * Deep path info + */utils.getPathInfo=pathval$1.getPathInfo;/*! + * Check if a property exists + */utils.hasProperty=pathval$1.hasProperty;/*! + * Function name + */utils.getName=getFuncName_1;/*! + * add Property + */utils.addProperty=requireAddProperty();/*! + * add Method + */utils.addMethod=requireAddMethod();/*! + * overwrite Property + */utils.overwriteProperty=requireOverwriteProperty();/*! + * overwrite Method + */utils.overwriteMethod=requireOverwriteMethod();/*! + * Add a chainable method + */utils.addChainableMethod=requireAddChainableMethod();/*! + * Overwrite chainable method + */utils.overwriteChainableMethod=requireOverwriteChainableMethod();/*! + * Compare by inspect method + */utils.compareByInspect=compareByInspect;/*! + * Get own enumerable property symbols method + */utils.getOwnEnumerablePropertySymbols=getOwnEnumerablePropertySymbols$1;/*! + * Get own enumerable properties method + */utils.getOwnEnumerableProperties=getOwnEnumerableProperties;/*! + * Checks error against a given set of criteria + */utils.checkError=checkError;/*! + * Proxify util + */utils.proxify=proxify;/*! + * addLengthGuard util + */utils.addLengthGuard=addLengthGuard;/*! + * isProxyEnabled helper + */utils.isProxyEnabled=isProxyEnabled$1;/*! + * isNaN method + */utils.isNaN=_isNaN;/*! + * getOperator method + */utils.getOperator=getOperator;return utils;}/*! + * chai + * http://chaijs.com + * Copyright(c) 2011-2014 Jake Luer + * MIT Licensed + */var config=config$5;var assertion=function(_chai,util){/*! + * Module dependencies. + */var AssertionError=_chai.AssertionError,flag=util.flag;/*! + * Module export. + */_chai.Assertion=Assertion;/*! + * Assertion Constructor + * + * Creates object for chaining. + * + * \`Assertion\` objects contain metadata in the form of flags. Three flags can + * be assigned during instantiation by passing arguments to this constructor: + * + * - \`object\`: This flag contains the target of the assertion. For example, in + * the assertion \`expect(numKittens).to.equal(7);\`, the \`object\` flag will + * contain \`numKittens\` so that the \`equal\` assertion can reference it when + * needed. + * + * - \`message\`: This flag contains an optional custom error message to be + * prepended to the error message that's generated by the assertion when it + * fails. + * + * - \`ssfi\`: This flag stands for "start stack function indicator". It + * contains a function reference that serves as the starting point for + * removing frames from the stack trace of the error that's created by the + * assertion when it fails. The goal is to provide a cleaner stack trace to + * end users by removing Chai's internal functions. Note that it only works + * in environments that support \`Error.captureStackTrace\`, and only when + * \`Chai.config.includeStack\` hasn't been set to \`false\`. + * + * - \`lockSsfi\`: This flag controls whether or not the given \`ssfi\` flag + * should retain its current value, even as assertions are chained off of + * this object. This is usually set to \`true\` when creating a new assertion + * from within another assertion. It's also temporarily set to \`true\` before + * an overwritten assertion gets called by the overwriting assertion. + * + * - \`eql\`: This flag contains the deepEqual function to be used by the assertion. + * + * @param {Mixed} obj target of the assertion + * @param {String} msg (optional) custom error message + * @param {Function} ssfi (optional) starting point for removing stack frames + * @param {Boolean} lockSsfi (optional) whether or not the ssfi flag is locked + * @api private + */function Assertion(obj,msg,ssfi,lockSsfi){flag(this,'ssfi',ssfi||Assertion);flag(this,'lockSsfi',lockSsfi);flag(this,'object',obj);flag(this,'message',msg);flag(this,'eql',config.deepEqual||util.eql);return util.proxify(this);}Object.defineProperty(Assertion,'includeStack',{get:function(){console.warn('Assertion.includeStack is deprecated, use chai.config.includeStack instead.');return config.includeStack;},set:function(value){console.warn('Assertion.includeStack is deprecated, use chai.config.includeStack instead.');config.includeStack=value;}});Object.defineProperty(Assertion,'showDiff',{get:function(){console.warn('Assertion.showDiff is deprecated, use chai.config.showDiff instead.');return config.showDiff;},set:function(value){console.warn('Assertion.showDiff is deprecated, use chai.config.showDiff instead.');config.showDiff=value;}});Assertion.addProperty=function(name,fn){util.addProperty(this.prototype,name,fn);};Assertion.addMethod=function(name,fn){util.addMethod(this.prototype,name,fn);};Assertion.addChainableMethod=function(name,fn,chainingBehavior){util.addChainableMethod(this.prototype,name,fn,chainingBehavior);};Assertion.overwriteProperty=function(name,fn){util.overwriteProperty(this.prototype,name,fn);};Assertion.overwriteMethod=function(name,fn){util.overwriteMethod(this.prototype,name,fn);};Assertion.overwriteChainableMethod=function(name,fn,chainingBehavior){util.overwriteChainableMethod(this.prototype,name,fn,chainingBehavior);};/** + * ### .assert(expression, message, negateMessage, expected, actual, showDiff) + * + * Executes an expression and check expectations. Throws AssertionError for reporting if test doesn't pass. + * + * @name assert + * @param {Philosophical} expression to be tested + * @param {String|Function} message or function that returns message to display if expression fails + * @param {String|Function} negatedMessage or function that returns negatedMessage to display if negated expression fails + * @param {Mixed} expected value (remember to check for negation) + * @param {Mixed} actual (optional) will default to \`this.obj\` + * @param {Boolean} showDiff (optional) when set to \`true\`, assert will display a diff in addition to the message if expression fails + * @api private + */Assertion.prototype.assert=function(expr,msg,negateMsg,expected,_actual,showDiff){var ok=util.test(this,arguments);if(false!==showDiff)showDiff=true;if(undefined===expected&&undefined===_actual)showDiff=false;if(true!==config.showDiff)showDiff=false;if(!ok){msg=util.getMessage(this,arguments);var actual=util.getActual(this,arguments);var assertionErrorObjectProperties={actual:actual,expected:expected,showDiff:showDiff};var operator=util.getOperator(this,arguments);if(operator){assertionErrorObjectProperties.operator=operator;}throw new AssertionError(msg,assertionErrorObjectProperties,config.includeStack?this.assert:flag(this,'ssfi'));}};/*! + * ### ._obj + * + * Quick reference to stored \`actual\` value for plugin developers. + * + * @api private + */Object.defineProperty(Assertion.prototype,'_obj',{get:function(){return flag(this,'object');},set:function(val){flag(this,'object',val);}});};/*! + * chai + * http://chaijs.com + * Copyright(c) 2011-2014 Jake Luer + * MIT Licensed + */var assertions=function(chai,_){var Assertion=chai.Assertion,AssertionError=chai.AssertionError,flag=_.flag;/** + * ### Language Chains + * + * The following are provided as chainable getters to improve the readability + * of your assertions. + * + * **Chains** + * + * - to + * - be + * - been + * - is + * - that + * - which + * - and + * - has + * - have + * - with + * - at + * - of + * - same + * - but + * - does + * - still + * - also + * + * @name language chains + * @namespace BDD + * @api public + */['to','be','been','is','and','has','have','with','that','which','at','of','same','but','does','still',"also"].forEach(function(chain){Assertion.addProperty(chain);});/** + * ### .not + * + * Negates all assertions that follow in the chain. + * + * expect(function () {}).to.not.throw(); + * expect({a: 1}).to.not.have.property('b'); + * expect([1, 2]).to.be.an('array').that.does.not.include(3); + * + * Just because you can negate any assertion with \`.not\` doesn't mean you + * should. With great power comes great responsibility. It's often best to + * assert that the one expected output was produced, rather than asserting + * that one of countless unexpected outputs wasn't produced. See individual + * assertions for specific guidance. + * + * expect(2).to.equal(2); // Recommended + * expect(2).to.not.equal(1); // Not recommended + * + * @name not + * @namespace BDD + * @api public + */Assertion.addProperty('not',function(){flag(this,'negate',true);});/** + * ### .deep + * + * Causes all \`.equal\`, \`.include\`, \`.members\`, \`.keys\`, and \`.property\` + * assertions that follow in the chain to use deep equality instead of strict + * (\`===\`) equality. See the \`deep-eql\` project page for info on the deep + * equality algorithm: https://github.com/chaijs/deep-eql. + * + * // Target object deeply (but not strictly) equals \`{a: 1}\` + * expect({a: 1}).to.deep.equal({a: 1}); + * expect({a: 1}).to.not.equal({a: 1}); + * + * // Target array deeply (but not strictly) includes \`{a: 1}\` + * expect([{a: 1}]).to.deep.include({a: 1}); + * expect([{a: 1}]).to.not.include({a: 1}); + * + * // Target object deeply (but not strictly) includes \`x: {a: 1}\` + * expect({x: {a: 1}}).to.deep.include({x: {a: 1}}); + * expect({x: {a: 1}}).to.not.include({x: {a: 1}}); + * + * // Target array deeply (but not strictly) has member \`{a: 1}\` + * expect([{a: 1}]).to.have.deep.members([{a: 1}]); + * expect([{a: 1}]).to.not.have.members([{a: 1}]); + * + * // Target set deeply (but not strictly) has key \`{a: 1}\` + * expect(new Set([{a: 1}])).to.have.deep.keys([{a: 1}]); + * expect(new Set([{a: 1}])).to.not.have.keys([{a: 1}]); + * + * // Target object deeply (but not strictly) has property \`x: {a: 1}\` + * expect({x: {a: 1}}).to.have.deep.property('x', {a: 1}); + * expect({x: {a: 1}}).to.not.have.property('x', {a: 1}); + * + * @name deep + * @namespace BDD + * @api public + */Assertion.addProperty('deep',function(){flag(this,'deep',true);});/** + * ### .nested + * + * Enables dot- and bracket-notation in all \`.property\` and \`.include\` + * assertions that follow in the chain. + * + * expect({a: {b: ['x', 'y']}}).to.have.nested.property('a.b[1]'); + * expect({a: {b: ['x', 'y']}}).to.nested.include({'a.b[1]': 'y'}); + * + * If \`.\` or \`[]\` are part of an actual property name, they can be escaped by + * adding two backslashes before them. + * + * expect({'.a': {'[b]': 'x'}}).to.have.nested.property('\\\\.a.\\\\[b\\\\]'); + * expect({'.a': {'[b]': 'x'}}).to.nested.include({'\\\\.a.\\\\[b\\\\]': 'x'}); + * + * \`.nested\` cannot be combined with \`.own\`. + * + * @name nested + * @namespace BDD + * @api public + */Assertion.addProperty('nested',function(){flag(this,'nested',true);});/** + * ### .own + * + * Causes all \`.property\` and \`.include\` assertions that follow in the chain + * to ignore inherited properties. + * + * Object.prototype.b = 2; + * + * expect({a: 1}).to.have.own.property('a'); + * expect({a: 1}).to.have.property('b'); + * expect({a: 1}).to.not.have.own.property('b'); + * + * expect({a: 1}).to.own.include({a: 1}); + * expect({a: 1}).to.include({b: 2}).but.not.own.include({b: 2}); + * + * \`.own\` cannot be combined with \`.nested\`. + * + * @name own + * @namespace BDD + * @api public + */Assertion.addProperty('own',function(){flag(this,'own',true);});/** + * ### .ordered + * + * Causes all \`.members\` assertions that follow in the chain to require that + * members be in the same order. + * + * expect([1, 2]).to.have.ordered.members([1, 2]) + * .but.not.have.ordered.members([2, 1]); + * + * When \`.include\` and \`.ordered\` are combined, the ordering begins at the + * start of both arrays. + * + * expect([1, 2, 3]).to.include.ordered.members([1, 2]) + * .but.not.include.ordered.members([2, 3]); + * + * @name ordered + * @namespace BDD + * @api public + */Assertion.addProperty('ordered',function(){flag(this,'ordered',true);});/** + * ### .any + * + * Causes all \`.keys\` assertions that follow in the chain to only require that + * the target have at least one of the given keys. This is the opposite of + * \`.all\`, which requires that the target have all of the given keys. + * + * expect({a: 1, b: 2}).to.not.have.any.keys('c', 'd'); + * + * See the \`.keys\` doc for guidance on when to use \`.any\` or \`.all\`. + * + * @name any + * @namespace BDD + * @api public + */Assertion.addProperty('any',function(){flag(this,'any',true);flag(this,'all',false);});/** + * ### .all + * + * Causes all \`.keys\` assertions that follow in the chain to require that the + * target have all of the given keys. This is the opposite of \`.any\`, which + * only requires that the target have at least one of the given keys. + * + * expect({a: 1, b: 2}).to.have.all.keys('a', 'b'); + * + * Note that \`.all\` is used by default when neither \`.all\` nor \`.any\` are + * added earlier in the chain. However, it's often best to add \`.all\` anyway + * because it improves readability. + * + * See the \`.keys\` doc for guidance on when to use \`.any\` or \`.all\`. + * + * @name all + * @namespace BDD + * @api public + */Assertion.addProperty('all',function(){flag(this,'all',true);flag(this,'any',false);});/** + * ### .a(type[, msg]) + * + * Asserts that the target's type is equal to the given string \`type\`. Types + * are case insensitive. See the \`type-detect\` project page for info on the + * type detection algorithm: https://github.com/chaijs/type-detect. + * + * expect('foo').to.be.a('string'); + * expect({a: 1}).to.be.an('object'); + * expect(null).to.be.a('null'); + * expect(undefined).to.be.an('undefined'); + * expect(new Error).to.be.an('error'); + * expect(Promise.resolve()).to.be.a('promise'); + * expect(new Float32Array).to.be.a('float32array'); + * expect(Symbol()).to.be.a('symbol'); + * + * \`.a\` supports objects that have a custom type set via \`Symbol.toStringTag\`. + * + * var myObj = { + * [Symbol.toStringTag]: 'myCustomType' + * }; + * + * expect(myObj).to.be.a('myCustomType').but.not.an('object'); + * + * It's often best to use \`.a\` to check a target's type before making more + * assertions on the same target. That way, you avoid unexpected behavior from + * any assertion that does different things based on the target's type. + * + * expect([1, 2, 3]).to.be.an('array').that.includes(2); + * expect([]).to.be.an('array').that.is.empty; + * + * Add \`.not\` earlier in the chain to negate \`.a\`. However, it's often best to + * assert that the target is the expected type, rather than asserting that it + * isn't one of many unexpected types. + * + * expect('foo').to.be.a('string'); // Recommended + * expect('foo').to.not.be.an('array'); // Not recommended + * + * \`.a\` accepts an optional \`msg\` argument which is a custom error message to + * show when the assertion fails. The message can also be given as the second + * argument to \`expect\`. + * + * expect(1).to.be.a('string', 'nooo why fail??'); + * expect(1, 'nooo why fail??').to.be.a('string'); + * + * \`.a\` can also be used as a language chain to improve the readability of + * your assertions. + * + * expect({b: 2}).to.have.a.property('b'); + * + * The alias \`.an\` can be used interchangeably with \`.a\`. + * + * @name a + * @alias an + * @param {String} type + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */function an(type,msg){if(msg)flag(this,'message',msg);type=type.toLowerCase();var obj=flag(this,'object'),article=~['a','e','i','o','u'].indexOf(type.charAt(0))?'an ':'a ';this.assert(type===_.type(obj).toLowerCase(),'expected #{this} to be '+article+type,'expected #{this} not to be '+article+type);}Assertion.addChainableMethod('an',an);Assertion.addChainableMethod('a',an);/** + * ### .include(val[, msg]) + * + * When the target is a string, \`.include\` asserts that the given string \`val\` + * is a substring of the target. + * + * expect('foobar').to.include('foo'); + * + * When the target is an array, \`.include\` asserts that the given \`val\` is a + * member of the target. + * + * expect([1, 2, 3]).to.include(2); + * + * When the target is an object, \`.include\` asserts that the given object + * \`val\`'s properties are a subset of the target's properties. + * + * expect({a: 1, b: 2, c: 3}).to.include({a: 1, b: 2}); + * + * When the target is a Set or WeakSet, \`.include\` asserts that the given \`val\` is a + * member of the target. SameValueZero equality algorithm is used. + * + * expect(new Set([1, 2])).to.include(2); + * + * When the target is a Map, \`.include\` asserts that the given \`val\` is one of + * the values of the target. SameValueZero equality algorithm is used. + * + * expect(new Map([['a', 1], ['b', 2]])).to.include(2); + * + * Because \`.include\` does different things based on the target's type, it's + * important to check the target's type before using \`.include\`. See the \`.a\` + * doc for info on testing a target's type. + * + * expect([1, 2, 3]).to.be.an('array').that.includes(2); + * + * By default, strict (\`===\`) equality is used to compare array members and + * object properties. Add \`.deep\` earlier in the chain to use deep equality + * instead (WeakSet targets are not supported). See the \`deep-eql\` project + * page for info on the deep equality algorithm: https://github.com/chaijs/deep-eql. + * + * // Target array deeply (but not strictly) includes \`{a: 1}\` + * expect([{a: 1}]).to.deep.include({a: 1}); + * expect([{a: 1}]).to.not.include({a: 1}); + * + * // Target object deeply (but not strictly) includes \`x: {a: 1}\` + * expect({x: {a: 1}}).to.deep.include({x: {a: 1}}); + * expect({x: {a: 1}}).to.not.include({x: {a: 1}}); + * + * By default, all of the target's properties are searched when working with + * objects. This includes properties that are inherited and/or non-enumerable. + * Add \`.own\` earlier in the chain to exclude the target's inherited + * properties from the search. + * + * Object.prototype.b = 2; + * + * expect({a: 1}).to.own.include({a: 1}); + * expect({a: 1}).to.include({b: 2}).but.not.own.include({b: 2}); + * + * Note that a target object is always only searched for \`val\`'s own + * enumerable properties. + * + * \`.deep\` and \`.own\` can be combined. + * + * expect({a: {b: 2}}).to.deep.own.include({a: {b: 2}}); + * + * Add \`.nested\` earlier in the chain to enable dot- and bracket-notation when + * referencing nested properties. + * + * expect({a: {b: ['x', 'y']}}).to.nested.include({'a.b[1]': 'y'}); + * + * If \`.\` or \`[]\` are part of an actual property name, they can be escaped by + * adding two backslashes before them. + * + * expect({'.a': {'[b]': 2}}).to.nested.include({'\\\\.a.\\\\[b\\\\]': 2}); + * + * \`.deep\` and \`.nested\` can be combined. + * + * expect({a: {b: [{c: 3}]}}).to.deep.nested.include({'a.b[0]': {c: 3}}); + * + * \`.own\` and \`.nested\` cannot be combined. + * + * Add \`.not\` earlier in the chain to negate \`.include\`. + * + * expect('foobar').to.not.include('taco'); + * expect([1, 2, 3]).to.not.include(4); + * + * However, it's dangerous to negate \`.include\` when the target is an object. + * The problem is that it creates uncertain expectations by asserting that the + * target object doesn't have all of \`val\`'s key/value pairs but may or may + * not have some of them. It's often best to identify the exact output that's + * expected, and then write an assertion that only accepts that exact output. + * + * When the target object isn't even expected to have \`val\`'s keys, it's + * often best to assert exactly that. + * + * expect({c: 3}).to.not.have.any.keys('a', 'b'); // Recommended + * expect({c: 3}).to.not.include({a: 1, b: 2}); // Not recommended + * + * When the target object is expected to have \`val\`'s keys, it's often best to + * assert that each of the properties has its expected value, rather than + * asserting that each property doesn't have one of many unexpected values. + * + * expect({a: 3, b: 4}).to.include({a: 3, b: 4}); // Recommended + * expect({a: 3, b: 4}).to.not.include({a: 1, b: 2}); // Not recommended + * + * \`.include\` accepts an optional \`msg\` argument which is a custom error + * message to show when the assertion fails. The message can also be given as + * the second argument to \`expect\`. + * + * expect([1, 2, 3]).to.include(4, 'nooo why fail??'); + * expect([1, 2, 3], 'nooo why fail??').to.include(4); + * + * \`.include\` can also be used as a language chain, causing all \`.members\` and + * \`.keys\` assertions that follow in the chain to require the target to be a + * superset of the expected set, rather than an identical set. Note that + * \`.members\` ignores duplicates in the subset when \`.include\` is added. + * + * // Target object's keys are a superset of ['a', 'b'] but not identical + * expect({a: 1, b: 2, c: 3}).to.include.all.keys('a', 'b'); + * expect({a: 1, b: 2, c: 3}).to.not.have.all.keys('a', 'b'); + * + * // Target array is a superset of [1, 2] but not identical + * expect([1, 2, 3]).to.include.members([1, 2]); + * expect([1, 2, 3]).to.not.have.members([1, 2]); + * + * // Duplicates in the subset are ignored + * expect([1, 2, 3]).to.include.members([1, 2, 2, 2]); + * + * Note that adding \`.any\` earlier in the chain causes the \`.keys\` assertion + * to ignore \`.include\`. + * + * // Both assertions are identical + * expect({a: 1}).to.include.any.keys('a', 'b'); + * expect({a: 1}).to.have.any.keys('a', 'b'); + * + * The aliases \`.includes\`, \`.contain\`, and \`.contains\` can be used + * interchangeably with \`.include\`. + * + * @name include + * @alias contain + * @alias includes + * @alias contains + * @param {Mixed} val + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */function SameValueZero(a,b){return _.isNaN(a)&&_.isNaN(b)||a===b;}function includeChainingBehavior(){flag(this,'contains',true);}function include(val,msg){if(msg)flag(this,'message',msg);var obj=flag(this,'object'),objType=_.type(obj).toLowerCase(),flagMsg=flag(this,'message'),negate=flag(this,'negate'),ssfi=flag(this,'ssfi'),isDeep=flag(this,'deep'),descriptor=isDeep?'deep ':'',isEql=isDeep?flag(this,'eql'):SameValueZero;flagMsg=flagMsg?flagMsg+': ':'';var included=false;switch(objType){case'string':included=obj.indexOf(val)!==-1;break;case'weakset':if(isDeep){throw new AssertionError(flagMsg+'unable to use .deep.include with WeakSet',undefined,ssfi);}included=obj.has(val);break;case'map':obj.forEach(function(item){included=included||isEql(item,val);});break;case'set':if(isDeep){obj.forEach(function(item){included=included||isEql(item,val);});}else{included=obj.has(val);}break;case'array':if(isDeep){included=obj.some(function(item){return isEql(item,val);});}else{included=obj.indexOf(val)!==-1;}break;default:// This block is for asserting a subset of properties in an object. +// \`_.expectTypes\` isn't used here because \`.include\` should work with +// objects with a custom \`@@toStringTag\`. +if(val!==Object(val)){throw new AssertionError(flagMsg+'the given combination of arguments ('+objType+' and '+_.type(val).toLowerCase()+')'+' is invalid for this assertion. '+'You can use an array, a map, an object, a set, a string, '+'or a weakset instead of a '+_.type(val).toLowerCase(),undefined,ssfi);}var props=Object.keys(val),firstErr=null,numErrs=0;props.forEach(function(prop){var propAssertion=new Assertion(obj);_.transferFlags(this,propAssertion,true);flag(propAssertion,'lockSsfi',true);if(!negate||props.length===1){propAssertion.property(prop,val[prop]);return;}try{propAssertion.property(prop,val[prop]);}catch(err){if(!_.checkError.compatibleConstructor(err,AssertionError)){throw err;}if(firstErr===null)firstErr=err;numErrs++;}},this);// When validating .not.include with multiple properties, we only want +// to throw an assertion error if all of the properties are included, +// in which case we throw the first property assertion error that we +// encountered. +if(negate&&props.length>1&&numErrs===props.length){throw firstErr;}return;}// Assert inclusion in collection or substring in a string. +this.assert(included,'expected #{this} to '+descriptor+'include '+_.inspect(val),'expected #{this} to not '+descriptor+'include '+_.inspect(val));}Assertion.addChainableMethod('include',include,includeChainingBehavior);Assertion.addChainableMethod('contain',include,includeChainingBehavior);Assertion.addChainableMethod('contains',include,includeChainingBehavior);Assertion.addChainableMethod('includes',include,includeChainingBehavior);/** + * ### .ok + * + * Asserts that the target is a truthy value (considered \`true\` in boolean context). + * However, it's often best to assert that the target is strictly (\`===\`) or + * deeply equal to its expected value. + * + * expect(1).to.equal(1); // Recommended + * expect(1).to.be.ok; // Not recommended + * + * expect(true).to.be.true; // Recommended + * expect(true).to.be.ok; // Not recommended + * + * Add \`.not\` earlier in the chain to negate \`.ok\`. + * + * expect(0).to.equal(0); // Recommended + * expect(0).to.not.be.ok; // Not recommended + * + * expect(false).to.be.false; // Recommended + * expect(false).to.not.be.ok; // Not recommended + * + * expect(null).to.be.null; // Recommended + * expect(null).to.not.be.ok; // Not recommended + * + * expect(undefined).to.be.undefined; // Recommended + * expect(undefined).to.not.be.ok; // Not recommended + * + * A custom error message can be given as the second argument to \`expect\`. + * + * expect(false, 'nooo why fail??').to.be.ok; + * + * @name ok + * @namespace BDD + * @api public + */Assertion.addProperty('ok',function(){this.assert(flag(this,'object'),'expected #{this} to be truthy','expected #{this} to be falsy');});/** + * ### .true + * + * Asserts that the target is strictly (\`===\`) equal to \`true\`. + * + * expect(true).to.be.true; + * + * Add \`.not\` earlier in the chain to negate \`.true\`. However, it's often best + * to assert that the target is equal to its expected value, rather than not + * equal to \`true\`. + * + * expect(false).to.be.false; // Recommended + * expect(false).to.not.be.true; // Not recommended + * + * expect(1).to.equal(1); // Recommended + * expect(1).to.not.be.true; // Not recommended + * + * A custom error message can be given as the second argument to \`expect\`. + * + * expect(false, 'nooo why fail??').to.be.true; + * + * @name true + * @namespace BDD + * @api public + */Assertion.addProperty('true',function(){this.assert(true===flag(this,'object'),'expected #{this} to be true','expected #{this} to be false',flag(this,'negate')?false:true);});/** + * ### .false + * + * Asserts that the target is strictly (\`===\`) equal to \`false\`. + * + * expect(false).to.be.false; + * + * Add \`.not\` earlier in the chain to negate \`.false\`. However, it's often + * best to assert that the target is equal to its expected value, rather than + * not equal to \`false\`. + * + * expect(true).to.be.true; // Recommended + * expect(true).to.not.be.false; // Not recommended + * + * expect(1).to.equal(1); // Recommended + * expect(1).to.not.be.false; // Not recommended + * + * A custom error message can be given as the second argument to \`expect\`. + * + * expect(true, 'nooo why fail??').to.be.false; + * + * @name false + * @namespace BDD + * @api public + */Assertion.addProperty('false',function(){this.assert(false===flag(this,'object'),'expected #{this} to be false','expected #{this} to be true',flag(this,'negate')?true:false);});/** + * ### .null + * + * Asserts that the target is strictly (\`===\`) equal to \`null\`. + * + * expect(null).to.be.null; + * + * Add \`.not\` earlier in the chain to negate \`.null\`. However, it's often best + * to assert that the target is equal to its expected value, rather than not + * equal to \`null\`. + * + * expect(1).to.equal(1); // Recommended + * expect(1).to.not.be.null; // Not recommended + * + * A custom error message can be given as the second argument to \`expect\`. + * + * expect(42, 'nooo why fail??').to.be.null; + * + * @name null + * @namespace BDD + * @api public + */Assertion.addProperty('null',function(){this.assert(null===flag(this,'object'),'expected #{this} to be null','expected #{this} not to be null');});/** + * ### .undefined + * + * Asserts that the target is strictly (\`===\`) equal to \`undefined\`. + * + * expect(undefined).to.be.undefined; + * + * Add \`.not\` earlier in the chain to negate \`.undefined\`. However, it's often + * best to assert that the target is equal to its expected value, rather than + * not equal to \`undefined\`. + * + * expect(1).to.equal(1); // Recommended + * expect(1).to.not.be.undefined; // Not recommended + * + * A custom error message can be given as the second argument to \`expect\`. + * + * expect(42, 'nooo why fail??').to.be.undefined; + * + * @name undefined + * @namespace BDD + * @api public + */Assertion.addProperty('undefined',function(){this.assert(undefined===flag(this,'object'),'expected #{this} to be undefined','expected #{this} not to be undefined');});/** + * ### .NaN + * + * Asserts that the target is exactly \`NaN\`. + * + * expect(NaN).to.be.NaN; + * + * Add \`.not\` earlier in the chain to negate \`.NaN\`. However, it's often best + * to assert that the target is equal to its expected value, rather than not + * equal to \`NaN\`. + * + * expect('foo').to.equal('foo'); // Recommended + * expect('foo').to.not.be.NaN; // Not recommended + * + * A custom error message can be given as the second argument to \`expect\`. + * + * expect(42, 'nooo why fail??').to.be.NaN; + * + * @name NaN + * @namespace BDD + * @api public + */Assertion.addProperty('NaN',function(){this.assert(_.isNaN(flag(this,'object')),'expected #{this} to be NaN','expected #{this} not to be NaN');});/** + * ### .exist + * + * Asserts that the target is not strictly (\`===\`) equal to either \`null\` or + * \`undefined\`. However, it's often best to assert that the target is equal to + * its expected value. + * + * expect(1).to.equal(1); // Recommended + * expect(1).to.exist; // Not recommended + * + * expect(0).to.equal(0); // Recommended + * expect(0).to.exist; // Not recommended + * + * Add \`.not\` earlier in the chain to negate \`.exist\`. + * + * expect(null).to.be.null; // Recommended + * expect(null).to.not.exist; // Not recommended + * + * expect(undefined).to.be.undefined; // Recommended + * expect(undefined).to.not.exist; // Not recommended + * + * A custom error message can be given as the second argument to \`expect\`. + * + * expect(null, 'nooo why fail??').to.exist; + * + * The alias \`.exists\` can be used interchangeably with \`.exist\`. + * + * @name exist + * @alias exists + * @namespace BDD + * @api public + */function assertExist(){var val=flag(this,'object');this.assert(val!==null&&val!==undefined,'expected #{this} to exist','expected #{this} to not exist');}Assertion.addProperty('exist',assertExist);Assertion.addProperty('exists',assertExist);/** + * ### .empty + * + * When the target is a string or array, \`.empty\` asserts that the target's + * \`length\` property is strictly (\`===\`) equal to \`0\`. + * + * expect([]).to.be.empty; + * expect('').to.be.empty; + * + * When the target is a map or set, \`.empty\` asserts that the target's \`size\` + * property is strictly equal to \`0\`. + * + * expect(new Set()).to.be.empty; + * expect(new Map()).to.be.empty; + * + * When the target is a non-function object, \`.empty\` asserts that the target + * doesn't have any own enumerable properties. Properties with Symbol-based + * keys are excluded from the count. + * + * expect({}).to.be.empty; + * + * Because \`.empty\` does different things based on the target's type, it's + * important to check the target's type before using \`.empty\`. See the \`.a\` + * doc for info on testing a target's type. + * + * expect([]).to.be.an('array').that.is.empty; + * + * Add \`.not\` earlier in the chain to negate \`.empty\`. However, it's often + * best to assert that the target contains its expected number of values, + * rather than asserting that it's not empty. + * + * expect([1, 2, 3]).to.have.lengthOf(3); // Recommended + * expect([1, 2, 3]).to.not.be.empty; // Not recommended + * + * expect(new Set([1, 2, 3])).to.have.property('size', 3); // Recommended + * expect(new Set([1, 2, 3])).to.not.be.empty; // Not recommended + * + * expect(Object.keys({a: 1})).to.have.lengthOf(1); // Recommended + * expect({a: 1}).to.not.be.empty; // Not recommended + * + * A custom error message can be given as the second argument to \`expect\`. + * + * expect([1, 2, 3], 'nooo why fail??').to.be.empty; + * + * @name empty + * @namespace BDD + * @api public + */Assertion.addProperty('empty',function(){var val=flag(this,'object'),ssfi=flag(this,'ssfi'),flagMsg=flag(this,'message'),itemsCount;flagMsg=flagMsg?flagMsg+': ':'';switch(_.type(val).toLowerCase()){case'array':case'string':itemsCount=val.length;break;case'map':case'set':itemsCount=val.size;break;case'weakmap':case'weakset':throw new AssertionError(flagMsg+'.empty was passed a weak collection',undefined,ssfi);case'function':var msg=flagMsg+'.empty was passed a function '+_.getName(val);throw new AssertionError(msg.trim(),undefined,ssfi);default:if(val!==Object(val)){throw new AssertionError(flagMsg+'.empty was passed non-string primitive '+_.inspect(val),undefined,ssfi);}itemsCount=Object.keys(val).length;}this.assert(0===itemsCount,'expected #{this} to be empty','expected #{this} not to be empty');});/** + * ### .arguments + * + * Asserts that the target is an \`arguments\` object. + * + * function test () { + * expect(arguments).to.be.arguments; + * } + * + * test(); + * + * Add \`.not\` earlier in the chain to negate \`.arguments\`. However, it's often + * best to assert which type the target is expected to be, rather than + * asserting that it’s not an \`arguments\` object. + * + * expect('foo').to.be.a('string'); // Recommended + * expect('foo').to.not.be.arguments; // Not recommended + * + * A custom error message can be given as the second argument to \`expect\`. + * + * expect({}, 'nooo why fail??').to.be.arguments; + * + * The alias \`.Arguments\` can be used interchangeably with \`.arguments\`. + * + * @name arguments + * @alias Arguments + * @namespace BDD + * @api public + */function checkArguments(){var obj=flag(this,'object'),type=_.type(obj);this.assert('Arguments'===type,'expected #{this} to be arguments but got '+type,'expected #{this} to not be arguments');}Assertion.addProperty('arguments',checkArguments);Assertion.addProperty('Arguments',checkArguments);/** + * ### .equal(val[, msg]) + * + * Asserts that the target is strictly (\`===\`) equal to the given \`val\`. + * + * expect(1).to.equal(1); + * expect('foo').to.equal('foo'); + * + * Add \`.deep\` earlier in the chain to use deep equality instead. See the + * \`deep-eql\` project page for info on the deep equality algorithm: + * https://github.com/chaijs/deep-eql. + * + * // Target object deeply (but not strictly) equals \`{a: 1}\` + * expect({a: 1}).to.deep.equal({a: 1}); + * expect({a: 1}).to.not.equal({a: 1}); + * + * // Target array deeply (but not strictly) equals \`[1, 2]\` + * expect([1, 2]).to.deep.equal([1, 2]); + * expect([1, 2]).to.not.equal([1, 2]); + * + * Add \`.not\` earlier in the chain to negate \`.equal\`. However, it's often + * best to assert that the target is equal to its expected value, rather than + * not equal to one of countless unexpected values. + * + * expect(1).to.equal(1); // Recommended + * expect(1).to.not.equal(2); // Not recommended + * + * \`.equal\` accepts an optional \`msg\` argument which is a custom error message + * to show when the assertion fails. The message can also be given as the + * second argument to \`expect\`. + * + * expect(1).to.equal(2, 'nooo why fail??'); + * expect(1, 'nooo why fail??').to.equal(2); + * + * The aliases \`.equals\` and \`eq\` can be used interchangeably with \`.equal\`. + * + * @name equal + * @alias equals + * @alias eq + * @param {Mixed} val + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */function assertEqual(val,msg){if(msg)flag(this,'message',msg);var obj=flag(this,'object');if(flag(this,'deep')){var prevLockSsfi=flag(this,'lockSsfi');flag(this,'lockSsfi',true);this.eql(val);flag(this,'lockSsfi',prevLockSsfi);}else{this.assert(val===obj,'expected #{this} to equal #{exp}','expected #{this} to not equal #{exp}',val,this._obj,true);}}Assertion.addMethod('equal',assertEqual);Assertion.addMethod('equals',assertEqual);Assertion.addMethod('eq',assertEqual);/** + * ### .eql(obj[, msg]) + * + * Asserts that the target is deeply equal to the given \`obj\`. See the + * \`deep-eql\` project page for info on the deep equality algorithm: + * https://github.com/chaijs/deep-eql. + * + * // Target object is deeply (but not strictly) equal to {a: 1} + * expect({a: 1}).to.eql({a: 1}).but.not.equal({a: 1}); + * + * // Target array is deeply (but not strictly) equal to [1, 2] + * expect([1, 2]).to.eql([1, 2]).but.not.equal([1, 2]); + * + * Add \`.not\` earlier in the chain to negate \`.eql\`. However, it's often best + * to assert that the target is deeply equal to its expected value, rather + * than not deeply equal to one of countless unexpected values. + * + * expect({a: 1}).to.eql({a: 1}); // Recommended + * expect({a: 1}).to.not.eql({b: 2}); // Not recommended + * + * \`.eql\` accepts an optional \`msg\` argument which is a custom error message + * to show when the assertion fails. The message can also be given as the + * second argument to \`expect\`. + * + * expect({a: 1}).to.eql({b: 2}, 'nooo why fail??'); + * expect({a: 1}, 'nooo why fail??').to.eql({b: 2}); + * + * The alias \`.eqls\` can be used interchangeably with \`.eql\`. + * + * The \`.deep.equal\` assertion is almost identical to \`.eql\` but with one + * difference: \`.deep.equal\` causes deep equality comparisons to also be used + * for any other assertions that follow in the chain. + * + * @name eql + * @alias eqls + * @param {Mixed} obj + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */function assertEql(obj,msg){if(msg)flag(this,'message',msg);var eql=flag(this,'eql');this.assert(eql(obj,flag(this,'object')),'expected #{this} to deeply equal #{exp}','expected #{this} to not deeply equal #{exp}',obj,this._obj,true);}Assertion.addMethod('eql',assertEql);Assertion.addMethod('eqls',assertEql);/** + * ### .above(n[, msg]) + * + * Asserts that the target is a number or a date greater than the given number or date \`n\` respectively. + * However, it's often best to assert that the target is equal to its expected + * value. + * + * expect(2).to.equal(2); // Recommended + * expect(2).to.be.above(1); // Not recommended + * + * Add \`.lengthOf\` earlier in the chain to assert that the target's \`length\` + * or \`size\` is greater than the given number \`n\`. + * + * expect('foo').to.have.lengthOf(3); // Recommended + * expect('foo').to.have.lengthOf.above(2); // Not recommended + * + * expect([1, 2, 3]).to.have.lengthOf(3); // Recommended + * expect([1, 2, 3]).to.have.lengthOf.above(2); // Not recommended + * + * Add \`.not\` earlier in the chain to negate \`.above\`. + * + * expect(2).to.equal(2); // Recommended + * expect(1).to.not.be.above(2); // Not recommended + * + * \`.above\` accepts an optional \`msg\` argument which is a custom error message + * to show when the assertion fails. The message can also be given as the + * second argument to \`expect\`. + * + * expect(1).to.be.above(2, 'nooo why fail??'); + * expect(1, 'nooo why fail??').to.be.above(2); + * + * The aliases \`.gt\` and \`.greaterThan\` can be used interchangeably with + * \`.above\`. + * + * @name above + * @alias gt + * @alias greaterThan + * @param {Number} n + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */function assertAbove(n,msg){if(msg)flag(this,'message',msg);var obj=flag(this,'object'),doLength=flag(this,'doLength'),flagMsg=flag(this,'message'),msgPrefix=flagMsg?flagMsg+': ':'',ssfi=flag(this,'ssfi'),objType=_.type(obj).toLowerCase(),nType=_.type(n).toLowerCase(),errorMessage,shouldThrow=true;if(doLength&&objType!=='map'&&objType!=='set'){new Assertion(obj,flagMsg,ssfi,true).to.have.property('length');}if(!doLength&&objType==='date'&&nType!=='date'){errorMessage=msgPrefix+'the argument to above must be a date';}else if(nType!=='number'&&(doLength||objType==='number')){errorMessage=msgPrefix+'the argument to above must be a number';}else if(!doLength&&objType!=='date'&&objType!=='number'){var printObj=objType==='string'?"'"+obj+"'":obj;errorMessage=msgPrefix+'expected '+printObj+' to be a number or a date';}else{shouldThrow=false;}if(shouldThrow){throw new AssertionError(errorMessage,undefined,ssfi);}if(doLength){var descriptor='length',itemsCount;if(objType==='map'||objType==='set'){descriptor='size';itemsCount=obj.size;}else{itemsCount=obj.length;}this.assert(itemsCount>n,'expected #{this} to have a '+descriptor+' above #{exp} but got #{act}','expected #{this} to not have a '+descriptor+' above #{exp}',n,itemsCount);}else{this.assert(obj>n,'expected #{this} to be above #{exp}','expected #{this} to be at most #{exp}',n);}}Assertion.addMethod('above',assertAbove);Assertion.addMethod('gt',assertAbove);Assertion.addMethod('greaterThan',assertAbove);/** + * ### .least(n[, msg]) + * + * Asserts that the target is a number or a date greater than or equal to the given + * number or date \`n\` respectively. However, it's often best to assert that the target is equal to + * its expected value. + * + * expect(2).to.equal(2); // Recommended + * expect(2).to.be.at.least(1); // Not recommended + * expect(2).to.be.at.least(2); // Not recommended + * + * Add \`.lengthOf\` earlier in the chain to assert that the target's \`length\` + * or \`size\` is greater than or equal to the given number \`n\`. + * + * expect('foo').to.have.lengthOf(3); // Recommended + * expect('foo').to.have.lengthOf.at.least(2); // Not recommended + * + * expect([1, 2, 3]).to.have.lengthOf(3); // Recommended + * expect([1, 2, 3]).to.have.lengthOf.at.least(2); // Not recommended + * + * Add \`.not\` earlier in the chain to negate \`.least\`. + * + * expect(1).to.equal(1); // Recommended + * expect(1).to.not.be.at.least(2); // Not recommended + * + * \`.least\` accepts an optional \`msg\` argument which is a custom error message + * to show when the assertion fails. The message can also be given as the + * second argument to \`expect\`. + * + * expect(1).to.be.at.least(2, 'nooo why fail??'); + * expect(1, 'nooo why fail??').to.be.at.least(2); + * + * The aliases \`.gte\` and \`.greaterThanOrEqual\` can be used interchangeably with + * \`.least\`. + * + * @name least + * @alias gte + * @alias greaterThanOrEqual + * @param {Number} n + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */function assertLeast(n,msg){if(msg)flag(this,'message',msg);var obj=flag(this,'object'),doLength=flag(this,'doLength'),flagMsg=flag(this,'message'),msgPrefix=flagMsg?flagMsg+': ':'',ssfi=flag(this,'ssfi'),objType=_.type(obj).toLowerCase(),nType=_.type(n).toLowerCase(),errorMessage,shouldThrow=true;if(doLength&&objType!=='map'&&objType!=='set'){new Assertion(obj,flagMsg,ssfi,true).to.have.property('length');}if(!doLength&&objType==='date'&&nType!=='date'){errorMessage=msgPrefix+'the argument to least must be a date';}else if(nType!=='number'&&(doLength||objType==='number')){errorMessage=msgPrefix+'the argument to least must be a number';}else if(!doLength&&objType!=='date'&&objType!=='number'){var printObj=objType==='string'?"'"+obj+"'":obj;errorMessage=msgPrefix+'expected '+printObj+' to be a number or a date';}else{shouldThrow=false;}if(shouldThrow){throw new AssertionError(errorMessage,undefined,ssfi);}if(doLength){var descriptor='length',itemsCount;if(objType==='map'||objType==='set'){descriptor='size';itemsCount=obj.size;}else{itemsCount=obj.length;}this.assert(itemsCount>=n,'expected #{this} to have a '+descriptor+' at least #{exp} but got #{act}','expected #{this} to have a '+descriptor+' below #{exp}',n,itemsCount);}else{this.assert(obj>=n,'expected #{this} to be at least #{exp}','expected #{this} to be below #{exp}',n);}}Assertion.addMethod('least',assertLeast);Assertion.addMethod('gte',assertLeast);Assertion.addMethod('greaterThanOrEqual',assertLeast);/** + * ### .below(n[, msg]) + * + * Asserts that the target is a number or a date less than the given number or date \`n\` respectively. + * However, it's often best to assert that the target is equal to its expected + * value. + * + * expect(1).to.equal(1); // Recommended + * expect(1).to.be.below(2); // Not recommended + * + * Add \`.lengthOf\` earlier in the chain to assert that the target's \`length\` + * or \`size\` is less than the given number \`n\`. + * + * expect('foo').to.have.lengthOf(3); // Recommended + * expect('foo').to.have.lengthOf.below(4); // Not recommended + * + * expect([1, 2, 3]).to.have.length(3); // Recommended + * expect([1, 2, 3]).to.have.lengthOf.below(4); // Not recommended + * + * Add \`.not\` earlier in the chain to negate \`.below\`. + * + * expect(2).to.equal(2); // Recommended + * expect(2).to.not.be.below(1); // Not recommended + * + * \`.below\` accepts an optional \`msg\` argument which is a custom error message + * to show when the assertion fails. The message can also be given as the + * second argument to \`expect\`. + * + * expect(2).to.be.below(1, 'nooo why fail??'); + * expect(2, 'nooo why fail??').to.be.below(1); + * + * The aliases \`.lt\` and \`.lessThan\` can be used interchangeably with + * \`.below\`. + * + * @name below + * @alias lt + * @alias lessThan + * @param {Number} n + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */function assertBelow(n,msg){if(msg)flag(this,'message',msg);var obj=flag(this,'object'),doLength=flag(this,'doLength'),flagMsg=flag(this,'message'),msgPrefix=flagMsg?flagMsg+': ':'',ssfi=flag(this,'ssfi'),objType=_.type(obj).toLowerCase(),nType=_.type(n).toLowerCase(),errorMessage,shouldThrow=true;if(doLength&&objType!=='map'&&objType!=='set'){new Assertion(obj,flagMsg,ssfi,true).to.have.property('length');}if(!doLength&&objType==='date'&&nType!=='date'){errorMessage=msgPrefix+'the argument to below must be a date';}else if(nType!=='number'&&(doLength||objType==='number')){errorMessage=msgPrefix+'the argument to below must be a number';}else if(!doLength&&objType!=='date'&&objType!=='number'){var printObj=objType==='string'?"'"+obj+"'":obj;errorMessage=msgPrefix+'expected '+printObj+' to be a number or a date';}else{shouldThrow=false;}if(shouldThrow){throw new AssertionError(errorMessage,undefined,ssfi);}if(doLength){var descriptor='length',itemsCount;if(objType==='map'||objType==='set'){descriptor='size';itemsCount=obj.size;}else{itemsCount=obj.length;}this.assert(itemsCount=start&&itemsCount<=finish,'expected #{this} to have a '+descriptor+' within '+range,'expected #{this} to not have a '+descriptor+' within '+range);}else{this.assert(obj>=start&&obj<=finish,'expected #{this} to be within '+range,'expected #{this} to not be within '+range);}});/** + * ### .instanceof(constructor[, msg]) + * + * Asserts that the target is an instance of the given \`constructor\`. + * + * function Cat () { } + * + * expect(new Cat()).to.be.an.instanceof(Cat); + * expect([1, 2]).to.be.an.instanceof(Array); + * + * Add \`.not\` earlier in the chain to negate \`.instanceof\`. + * + * expect({a: 1}).to.not.be.an.instanceof(Array); + * + * \`.instanceof\` accepts an optional \`msg\` argument which is a custom error + * message to show when the assertion fails. The message can also be given as + * the second argument to \`expect\`. + * + * expect(1).to.be.an.instanceof(Array, 'nooo why fail??'); + * expect(1, 'nooo why fail??').to.be.an.instanceof(Array); + * + * Due to limitations in ES5, \`.instanceof\` may not always work as expected + * when using a transpiler such as Babel or TypeScript. In particular, it may + * produce unexpected results when subclassing built-in object such as + * \`Array\`, \`Error\`, and \`Map\`. See your transpiler's docs for details: + * + * - ([Babel](https://babeljs.io/docs/usage/caveats/#classes)) + * - ([TypeScript](https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work)) + * + * The alias \`.instanceOf\` can be used interchangeably with \`.instanceof\`. + * + * @name instanceof + * @param {Constructor} constructor + * @param {String} msg _optional_ + * @alias instanceOf + * @namespace BDD + * @api public + */function assertInstanceOf(constructor,msg){if(msg)flag(this,'message',msg);var target=flag(this,'object');var ssfi=flag(this,'ssfi');var flagMsg=flag(this,'message');try{var isInstanceOf=target instanceof constructor;}catch(err){if(err instanceof TypeError){flagMsg=flagMsg?flagMsg+': ':'';throw new AssertionError(flagMsg+'The instanceof assertion needs a constructor but '+_.type(constructor)+' was given.',undefined,ssfi);}throw err;}var name=_.getName(constructor);if(name===null){name='an unnamed constructor';}this.assert(isInstanceOf,'expected #{this} to be an instance of '+name,'expected #{this} to not be an instance of '+name);}Assertion.addMethod('instanceof',assertInstanceOf);Assertion.addMethod('instanceOf',assertInstanceOf);/** + * ### .property(name[, val[, msg]]) + * + * Asserts that the target has a property with the given key \`name\`. + * + * expect({a: 1}).to.have.property('a'); + * + * When \`val\` is provided, \`.property\` also asserts that the property's value + * is equal to the given \`val\`. + * + * expect({a: 1}).to.have.property('a', 1); + * + * By default, strict (\`===\`) equality is used. Add \`.deep\` earlier in the + * chain to use deep equality instead. See the \`deep-eql\` project page for + * info on the deep equality algorithm: https://github.com/chaijs/deep-eql. + * + * // Target object deeply (but not strictly) has property \`x: {a: 1}\` + * expect({x: {a: 1}}).to.have.deep.property('x', {a: 1}); + * expect({x: {a: 1}}).to.not.have.property('x', {a: 1}); + * + * The target's enumerable and non-enumerable properties are always included + * in the search. By default, both own and inherited properties are included. + * Add \`.own\` earlier in the chain to exclude inherited properties from the + * search. + * + * Object.prototype.b = 2; + * + * expect({a: 1}).to.have.own.property('a'); + * expect({a: 1}).to.have.own.property('a', 1); + * expect({a: 1}).to.have.property('b'); + * expect({a: 1}).to.not.have.own.property('b'); + * + * \`.deep\` and \`.own\` can be combined. + * + * expect({x: {a: 1}}).to.have.deep.own.property('x', {a: 1}); + * + * Add \`.nested\` earlier in the chain to enable dot- and bracket-notation when + * referencing nested properties. + * + * expect({a: {b: ['x', 'y']}}).to.have.nested.property('a.b[1]'); + * expect({a: {b: ['x', 'y']}}).to.have.nested.property('a.b[1]', 'y'); + * + * If \`.\` or \`[]\` are part of an actual property name, they can be escaped by + * adding two backslashes before them. + * + * expect({'.a': {'[b]': 'x'}}).to.have.nested.property('\\\\.a.\\\\[b\\\\]'); + * + * \`.deep\` and \`.nested\` can be combined. + * + * expect({a: {b: [{c: 3}]}}) + * .to.have.deep.nested.property('a.b[0]', {c: 3}); + * + * \`.own\` and \`.nested\` cannot be combined. + * + * Add \`.not\` earlier in the chain to negate \`.property\`. + * + * expect({a: 1}).to.not.have.property('b'); + * + * However, it's dangerous to negate \`.property\` when providing \`val\`. The + * problem is that it creates uncertain expectations by asserting that the + * target either doesn't have a property with the given key \`name\`, or that it + * does have a property with the given key \`name\` but its value isn't equal to + * the given \`val\`. It's often best to identify the exact output that's + * expected, and then write an assertion that only accepts that exact output. + * + * When the target isn't expected to have a property with the given key + * \`name\`, it's often best to assert exactly that. + * + * expect({b: 2}).to.not.have.property('a'); // Recommended + * expect({b: 2}).to.not.have.property('a', 1); // Not recommended + * + * When the target is expected to have a property with the given key \`name\`, + * it's often best to assert that the property has its expected value, rather + * than asserting that it doesn't have one of many unexpected values. + * + * expect({a: 3}).to.have.property('a', 3); // Recommended + * expect({a: 3}).to.not.have.property('a', 1); // Not recommended + * + * \`.property\` changes the target of any assertions that follow in the chain + * to be the value of the property from the original target object. + * + * expect({a: 1}).to.have.property('a').that.is.a('number'); + * + * \`.property\` accepts an optional \`msg\` argument which is a custom error + * message to show when the assertion fails. The message can also be given as + * the second argument to \`expect\`. When not providing \`val\`, only use the + * second form. + * + * // Recommended + * expect({a: 1}).to.have.property('a', 2, 'nooo why fail??'); + * expect({a: 1}, 'nooo why fail??').to.have.property('a', 2); + * expect({a: 1}, 'nooo why fail??').to.have.property('b'); + * + * // Not recommended + * expect({a: 1}).to.have.property('b', undefined, 'nooo why fail??'); + * + * The above assertion isn't the same thing as not providing \`val\`. Instead, + * it's asserting that the target object has a \`b\` property that's equal to + * \`undefined\`. + * + * The assertions \`.ownProperty\` and \`.haveOwnProperty\` can be used + * interchangeably with \`.own.property\`. + * + * @name property + * @param {String} name + * @param {Mixed} val (optional) + * @param {String} msg _optional_ + * @returns value of property for chaining + * @namespace BDD + * @api public + */function assertProperty(name,val,msg){if(msg)flag(this,'message',msg);var isNested=flag(this,'nested'),isOwn=flag(this,'own'),flagMsg=flag(this,'message'),obj=flag(this,'object'),ssfi=flag(this,'ssfi'),nameType=typeof name;flagMsg=flagMsg?flagMsg+': ':'';if(isNested){if(nameType!=='string'){throw new AssertionError(flagMsg+'the argument to property must be a string when using nested syntax',undefined,ssfi);}}else{if(nameType!=='string'&&nameType!=='number'&&nameType!=='symbol'){throw new AssertionError(flagMsg+'the argument to property must be a string, number, or symbol',undefined,ssfi);}}if(isNested&&isOwn){throw new AssertionError(flagMsg+'The "nested" and "own" flags cannot be combined.',undefined,ssfi);}if(obj===null||obj===undefined){throw new AssertionError(flagMsg+'Target cannot be null or undefined.',undefined,ssfi);}var isDeep=flag(this,'deep'),negate=flag(this,'negate'),pathInfo=isNested?_.getPathInfo(obj,name):null,value=isNested?pathInfo.value:obj[name],isEql=isDeep?flag(this,'eql'):(val1,val2)=>val1===val2;var descriptor='';if(isDeep)descriptor+='deep ';if(isOwn)descriptor+='own ';if(isNested)descriptor+='nested ';descriptor+='property ';var hasProperty;if(isOwn)hasProperty=Object.prototype.hasOwnProperty.call(obj,name);else if(isNested)hasProperty=pathInfo.exists;else hasProperty=_.hasProperty(obj,name);// When performing a negated assertion for both name and val, merely having +// a property with the given name isn't enough to cause the assertion to +// fail. It must both have a property with the given name, and the value of +// that property must equal the given val. Therefore, skip this assertion in +// favor of the next. +if(!negate||arguments.length===1){this.assert(hasProperty,'expected #{this} to have '+descriptor+_.inspect(name),'expected #{this} to not have '+descriptor+_.inspect(name));}if(arguments.length>1){this.assert(hasProperty&&isEql(val,value),'expected #{this} to have '+descriptor+_.inspect(name)+' of #{exp}, but got #{act}','expected #{this} to not have '+descriptor+_.inspect(name)+' of #{act}',val,value);}flag(this,'object',value);}Assertion.addMethod('property',assertProperty);function assertOwnProperty(name,value,msg){flag(this,'own',true);assertProperty.apply(this,arguments);}Assertion.addMethod('ownProperty',assertOwnProperty);Assertion.addMethod('haveOwnProperty',assertOwnProperty);/** + * ### .ownPropertyDescriptor(name[, descriptor[, msg]]) + * + * Asserts that the target has its own property descriptor with the given key + * \`name\`. Enumerable and non-enumerable properties are included in the + * search. + * + * expect({a: 1}).to.have.ownPropertyDescriptor('a'); + * + * When \`descriptor\` is provided, \`.ownPropertyDescriptor\` also asserts that + * the property's descriptor is deeply equal to the given \`descriptor\`. See + * the \`deep-eql\` project page for info on the deep equality algorithm: + * https://github.com/chaijs/deep-eql. + * + * expect({a: 1}).to.have.ownPropertyDescriptor('a', { + * configurable: true, + * enumerable: true, + * writable: true, + * value: 1, + * }); + * + * Add \`.not\` earlier in the chain to negate \`.ownPropertyDescriptor\`. + * + * expect({a: 1}).to.not.have.ownPropertyDescriptor('b'); + * + * However, it's dangerous to negate \`.ownPropertyDescriptor\` when providing + * a \`descriptor\`. The problem is that it creates uncertain expectations by + * asserting that the target either doesn't have a property descriptor with + * the given key \`name\`, or that it does have a property descriptor with the + * given key \`name\` but it’s not deeply equal to the given \`descriptor\`. It's + * often best to identify the exact output that's expected, and then write an + * assertion that only accepts that exact output. + * + * When the target isn't expected to have a property descriptor with the given + * key \`name\`, it's often best to assert exactly that. + * + * // Recommended + * expect({b: 2}).to.not.have.ownPropertyDescriptor('a'); + * + * // Not recommended + * expect({b: 2}).to.not.have.ownPropertyDescriptor('a', { + * configurable: true, + * enumerable: true, + * writable: true, + * value: 1, + * }); + * + * When the target is expected to have a property descriptor with the given + * key \`name\`, it's often best to assert that the property has its expected + * descriptor, rather than asserting that it doesn't have one of many + * unexpected descriptors. + * + * // Recommended + * expect({a: 3}).to.have.ownPropertyDescriptor('a', { + * configurable: true, + * enumerable: true, + * writable: true, + * value: 3, + * }); + * + * // Not recommended + * expect({a: 3}).to.not.have.ownPropertyDescriptor('a', { + * configurable: true, + * enumerable: true, + * writable: true, + * value: 1, + * }); + * + * \`.ownPropertyDescriptor\` changes the target of any assertions that follow + * in the chain to be the value of the property descriptor from the original + * target object. + * + * expect({a: 1}).to.have.ownPropertyDescriptor('a') + * .that.has.property('enumerable', true); + * + * \`.ownPropertyDescriptor\` accepts an optional \`msg\` argument which is a + * custom error message to show when the assertion fails. The message can also + * be given as the second argument to \`expect\`. When not providing + * \`descriptor\`, only use the second form. + * + * // Recommended + * expect({a: 1}).to.have.ownPropertyDescriptor('a', { + * configurable: true, + * enumerable: true, + * writable: true, + * value: 2, + * }, 'nooo why fail??'); + * + * // Recommended + * expect({a: 1}, 'nooo why fail??').to.have.ownPropertyDescriptor('a', { + * configurable: true, + * enumerable: true, + * writable: true, + * value: 2, + * }); + * + * // Recommended + * expect({a: 1}, 'nooo why fail??').to.have.ownPropertyDescriptor('b'); + * + * // Not recommended + * expect({a: 1}) + * .to.have.ownPropertyDescriptor('b', undefined, 'nooo why fail??'); + * + * The above assertion isn't the same thing as not providing \`descriptor\`. + * Instead, it's asserting that the target object has a \`b\` property + * descriptor that's deeply equal to \`undefined\`. + * + * The alias \`.haveOwnPropertyDescriptor\` can be used interchangeably with + * \`.ownPropertyDescriptor\`. + * + * @name ownPropertyDescriptor + * @alias haveOwnPropertyDescriptor + * @param {String} name + * @param {Object} descriptor _optional_ + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */function assertOwnPropertyDescriptor(name,descriptor,msg){if(typeof descriptor==='string'){msg=descriptor;descriptor=null;}if(msg)flag(this,'message',msg);var obj=flag(this,'object');var actualDescriptor=Object.getOwnPropertyDescriptor(Object(obj),name);var eql=flag(this,'eql');if(actualDescriptor&&descriptor){this.assert(eql(descriptor,actualDescriptor),'expected the own property descriptor for '+_.inspect(name)+' on #{this} to match '+_.inspect(descriptor)+', got '+_.inspect(actualDescriptor),'expected the own property descriptor for '+_.inspect(name)+' on #{this} to not match '+_.inspect(descriptor),descriptor,actualDescriptor,true);}else{this.assert(actualDescriptor,'expected #{this} to have an own property descriptor for '+_.inspect(name),'expected #{this} to not have an own property descriptor for '+_.inspect(name));}flag(this,'object',actualDescriptor);}Assertion.addMethod('ownPropertyDescriptor',assertOwnPropertyDescriptor);Assertion.addMethod('haveOwnPropertyDescriptor',assertOwnPropertyDescriptor);/** + * ### .lengthOf(n[, msg]) + * + * Asserts that the target's \`length\` or \`size\` is equal to the given number + * \`n\`. + * + * expect([1, 2, 3]).to.have.lengthOf(3); + * expect('foo').to.have.lengthOf(3); + * expect(new Set([1, 2, 3])).to.have.lengthOf(3); + * expect(new Map([['a', 1], ['b', 2], ['c', 3]])).to.have.lengthOf(3); + * + * Add \`.not\` earlier in the chain to negate \`.lengthOf\`. However, it's often + * best to assert that the target's \`length\` property is equal to its expected + * value, rather than not equal to one of many unexpected values. + * + * expect('foo').to.have.lengthOf(3); // Recommended + * expect('foo').to.not.have.lengthOf(4); // Not recommended + * + * \`.lengthOf\` accepts an optional \`msg\` argument which is a custom error + * message to show when the assertion fails. The message can also be given as + * the second argument to \`expect\`. + * + * expect([1, 2, 3]).to.have.lengthOf(2, 'nooo why fail??'); + * expect([1, 2, 3], 'nooo why fail??').to.have.lengthOf(2); + * + * \`.lengthOf\` can also be used as a language chain, causing all \`.above\`, + * \`.below\`, \`.least\`, \`.most\`, and \`.within\` assertions that follow in the + * chain to use the target's \`length\` property as the target. However, it's + * often best to assert that the target's \`length\` property is equal to its + * expected length, rather than asserting that its \`length\` property falls + * within some range of values. + * + * // Recommended + * expect([1, 2, 3]).to.have.lengthOf(3); + * + * // Not recommended + * expect([1, 2, 3]).to.have.lengthOf.above(2); + * expect([1, 2, 3]).to.have.lengthOf.below(4); + * expect([1, 2, 3]).to.have.lengthOf.at.least(3); + * expect([1, 2, 3]).to.have.lengthOf.at.most(3); + * expect([1, 2, 3]).to.have.lengthOf.within(2,4); + * + * Due to a compatibility issue, the alias \`.length\` can't be chained directly + * off of an uninvoked method such as \`.a\`. Therefore, \`.length\` can't be used + * interchangeably with \`.lengthOf\` in every situation. It's recommended to + * always use \`.lengthOf\` instead of \`.length\`. + * + * expect([1, 2, 3]).to.have.a.length(3); // incompatible; throws error + * expect([1, 2, 3]).to.have.a.lengthOf(3); // passes as expected + * + * @name lengthOf + * @alias length + * @param {Number} n + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */function assertLengthChain(){flag(this,'doLength',true);}function assertLength(n,msg){if(msg)flag(this,'message',msg);var obj=flag(this,'object'),objType=_.type(obj).toLowerCase(),flagMsg=flag(this,'message'),ssfi=flag(this,'ssfi'),descriptor='length',itemsCount;switch(objType){case'map':case'set':descriptor='size';itemsCount=obj.size;break;default:new Assertion(obj,flagMsg,ssfi,true).to.have.property('length');itemsCount=obj.length;}this.assert(itemsCount==n,'expected #{this} to have a '+descriptor+' of #{exp} but got #{act}','expected #{this} to not have a '+descriptor+' of #{act}',n,itemsCount);}Assertion.addChainableMethod('length',assertLength,assertLengthChain);Assertion.addChainableMethod('lengthOf',assertLength,assertLengthChain);/** + * ### .match(re[, msg]) + * + * Asserts that the target matches the given regular expression \`re\`. + * + * expect('foobar').to.match(/^foo/); + * + * Add \`.not\` earlier in the chain to negate \`.match\`. + * + * expect('foobar').to.not.match(/taco/); + * + * \`.match\` accepts an optional \`msg\` argument which is a custom error message + * to show when the assertion fails. The message can also be given as the + * second argument to \`expect\`. + * + * expect('foobar').to.match(/taco/, 'nooo why fail??'); + * expect('foobar', 'nooo why fail??').to.match(/taco/); + * + * The alias \`.matches\` can be used interchangeably with \`.match\`. + * + * @name match + * @alias matches + * @param {RegExp} re + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */function assertMatch(re,msg){if(msg)flag(this,'message',msg);var obj=flag(this,'object');this.assert(re.exec(obj),'expected #{this} to match '+re,'expected #{this} not to match '+re);}Assertion.addMethod('match',assertMatch);Assertion.addMethod('matches',assertMatch);/** + * ### .string(str[, msg]) + * + * Asserts that the target string contains the given substring \`str\`. + * + * expect('foobar').to.have.string('bar'); + * + * Add \`.not\` earlier in the chain to negate \`.string\`. + * + * expect('foobar').to.not.have.string('taco'); + * + * \`.string\` accepts an optional \`msg\` argument which is a custom error + * message to show when the assertion fails. The message can also be given as + * the second argument to \`expect\`. + * + * expect('foobar').to.have.string('taco', 'nooo why fail??'); + * expect('foobar', 'nooo why fail??').to.have.string('taco'); + * + * @name string + * @param {String} str + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */Assertion.addMethod('string',function(str,msg){if(msg)flag(this,'message',msg);var obj=flag(this,'object'),flagMsg=flag(this,'message'),ssfi=flag(this,'ssfi');new Assertion(obj,flagMsg,ssfi,true).is.a('string');this.assert(~obj.indexOf(str),'expected #{this} to contain '+_.inspect(str),'expected #{this} to not contain '+_.inspect(str));});/** + * ### .keys(key1[, key2[, ...]]) + * + * Asserts that the target object, array, map, or set has the given keys. Only + * the target's own inherited properties are included in the search. + * + * When the target is an object or array, keys can be provided as one or more + * string arguments, a single array argument, or a single object argument. In + * the latter case, only the keys in the given object matter; the values are + * ignored. + * + * expect({a: 1, b: 2}).to.have.all.keys('a', 'b'); + * expect(['x', 'y']).to.have.all.keys(0, 1); + * + * expect({a: 1, b: 2}).to.have.all.keys(['a', 'b']); + * expect(['x', 'y']).to.have.all.keys([0, 1]); + * + * expect({a: 1, b: 2}).to.have.all.keys({a: 4, b: 5}); // ignore 4 and 5 + * expect(['x', 'y']).to.have.all.keys({0: 4, 1: 5}); // ignore 4 and 5 + * + * When the target is a map or set, each key must be provided as a separate + * argument. + * + * expect(new Map([['a', 1], ['b', 2]])).to.have.all.keys('a', 'b'); + * expect(new Set(['a', 'b'])).to.have.all.keys('a', 'b'); + * + * Because \`.keys\` does different things based on the target's type, it's + * important to check the target's type before using \`.keys\`. See the \`.a\` doc + * for info on testing a target's type. + * + * expect({a: 1, b: 2}).to.be.an('object').that.has.all.keys('a', 'b'); + * + * By default, strict (\`===\`) equality is used to compare keys of maps and + * sets. Add \`.deep\` earlier in the chain to use deep equality instead. See + * the \`deep-eql\` project page for info on the deep equality algorithm: + * https://github.com/chaijs/deep-eql. + * + * // Target set deeply (but not strictly) has key \`{a: 1}\` + * expect(new Set([{a: 1}])).to.have.all.deep.keys([{a: 1}]); + * expect(new Set([{a: 1}])).to.not.have.all.keys([{a: 1}]); + * + * By default, the target must have all of the given keys and no more. Add + * \`.any\` earlier in the chain to only require that the target have at least + * one of the given keys. Also, add \`.not\` earlier in the chain to negate + * \`.keys\`. It's often best to add \`.any\` when negating \`.keys\`, and to use + * \`.all\` when asserting \`.keys\` without negation. + * + * When negating \`.keys\`, \`.any\` is preferred because \`.not.any.keys\` asserts + * exactly what's expected of the output, whereas \`.not.all.keys\` creates + * uncertain expectations. + * + * // Recommended; asserts that target doesn't have any of the given keys + * expect({a: 1, b: 2}).to.not.have.any.keys('c', 'd'); + * + * // Not recommended; asserts that target doesn't have all of the given + * // keys but may or may not have some of them + * expect({a: 1, b: 2}).to.not.have.all.keys('c', 'd'); + * + * When asserting \`.keys\` without negation, \`.all\` is preferred because + * \`.all.keys\` asserts exactly what's expected of the output, whereas + * \`.any.keys\` creates uncertain expectations. + * + * // Recommended; asserts that target has all the given keys + * expect({a: 1, b: 2}).to.have.all.keys('a', 'b'); + * + * // Not recommended; asserts that target has at least one of the given + * // keys but may or may not have more of them + * expect({a: 1, b: 2}).to.have.any.keys('a', 'b'); + * + * Note that \`.all\` is used by default when neither \`.all\` nor \`.any\` appear + * earlier in the chain. However, it's often best to add \`.all\` anyway because + * it improves readability. + * + * // Both assertions are identical + * expect({a: 1, b: 2}).to.have.all.keys('a', 'b'); // Recommended + * expect({a: 1, b: 2}).to.have.keys('a', 'b'); // Not recommended + * + * Add \`.include\` earlier in the chain to require that the target's keys be a + * superset of the expected keys, rather than identical sets. + * + * // Target object's keys are a superset of ['a', 'b'] but not identical + * expect({a: 1, b: 2, c: 3}).to.include.all.keys('a', 'b'); + * expect({a: 1, b: 2, c: 3}).to.not.have.all.keys('a', 'b'); + * + * However, if \`.any\` and \`.include\` are combined, only the \`.any\` takes + * effect. The \`.include\` is ignored in this case. + * + * // Both assertions are identical + * expect({a: 1}).to.have.any.keys('a', 'b'); + * expect({a: 1}).to.include.any.keys('a', 'b'); + * + * A custom error message can be given as the second argument to \`expect\`. + * + * expect({a: 1}, 'nooo why fail??').to.have.key('b'); + * + * The alias \`.key\` can be used interchangeably with \`.keys\`. + * + * @name keys + * @alias key + * @param {...String|Array|Object} keys + * @namespace BDD + * @api public + */function assertKeys(keys){var obj=flag(this,'object'),objType=_.type(obj),keysType=_.type(keys),ssfi=flag(this,'ssfi'),isDeep=flag(this,'deep'),str,deepStr='',actual,ok=true,flagMsg=flag(this,'message');flagMsg=flagMsg?flagMsg+': ':'';var mixedArgsMsg=flagMsg+'when testing keys against an object or an array you must give a single Array|Object|String argument or multiple String arguments';if(objType==='Map'||objType==='Set'){deepStr=isDeep?'deeply ':'';actual=[];// Map and Set '.keys' aren't supported in IE 11. Therefore, use .forEach. +obj.forEach(function(val,key){actual.push(key);});if(keysType!=='Array'){keys=Array.prototype.slice.call(arguments);}}else{actual=_.getOwnEnumerableProperties(obj);switch(keysType){case'Array':if(arguments.length>1){throw new AssertionError(mixedArgsMsg,undefined,ssfi);}break;case'Object':if(arguments.length>1){throw new AssertionError(mixedArgsMsg,undefined,ssfi);}keys=Object.keys(keys);break;default:keys=Array.prototype.slice.call(arguments);}// Only stringify non-Symbols because Symbols would become "Symbol()" +keys=keys.map(function(val){return typeof val==='symbol'?val:String(val);});}if(!keys.length){throw new AssertionError(flagMsg+'keys required',undefined,ssfi);}var len=keys.length,any=flag(this,'any'),all=flag(this,'all'),expected=keys,isEql=isDeep?flag(this,'eql'):(val1,val2)=>val1===val2;if(!any&&!all){all=true;}// Has any +if(any){ok=expected.some(function(expectedKey){return actual.some(function(actualKey){return isEql(expectedKey,actualKey);});});}// Has all +if(all){ok=expected.every(function(expectedKey){return actual.some(function(actualKey){return isEql(expectedKey,actualKey);});});if(!flag(this,'contains')){ok=ok&&keys.length==actual.length;}}// Key string +if(len>1){keys=keys.map(function(key){return _.inspect(key);});var last=keys.pop();if(all){str=keys.join(', ')+', and '+last;}if(any){str=keys.join(', ')+', or '+last;}}else{str=_.inspect(keys[0]);}// Form +str=(len>1?'keys ':'key ')+str;// Have / include +str=(flag(this,'contains')?'contain ':'have ')+str;// Assertion +this.assert(ok,'expected #{this} to '+deepStr+str,'expected #{this} to not '+deepStr+str,expected.slice(0).sort(_.compareByInspect),actual.sort(_.compareByInspect),true);}Assertion.addMethod('keys',assertKeys);Assertion.addMethod('key',assertKeys);/** + * ### .throw([errorLike], [errMsgMatcher], [msg]) + * + * When no arguments are provided, \`.throw\` invokes the target function and + * asserts that an error is thrown. + * + * var badFn = function () { throw new TypeError('Illegal salmon!'); }; + * + * expect(badFn).to.throw(); + * + * When one argument is provided, and it's an error constructor, \`.throw\` + * invokes the target function and asserts that an error is thrown that's an + * instance of that error constructor. + * + * var badFn = function () { throw new TypeError('Illegal salmon!'); }; + * + * expect(badFn).to.throw(TypeError); + * + * When one argument is provided, and it's an error instance, \`.throw\` invokes + * the target function and asserts that an error is thrown that's strictly + * (\`===\`) equal to that error instance. + * + * var err = new TypeError('Illegal salmon!'); + * var badFn = function () { throw err; }; + * + * expect(badFn).to.throw(err); + * + * When one argument is provided, and it's a string, \`.throw\` invokes the + * target function and asserts that an error is thrown with a message that + * contains that string. + * + * var badFn = function () { throw new TypeError('Illegal salmon!'); }; + * + * expect(badFn).to.throw('salmon'); + * + * When one argument is provided, and it's a regular expression, \`.throw\` + * invokes the target function and asserts that an error is thrown with a + * message that matches that regular expression. + * + * var badFn = function () { throw new TypeError('Illegal salmon!'); }; + * + * expect(badFn).to.throw(/salmon/); + * + * When two arguments are provided, and the first is an error instance or + * constructor, and the second is a string or regular expression, \`.throw\` + * invokes the function and asserts that an error is thrown that fulfills both + * conditions as described above. + * + * var err = new TypeError('Illegal salmon!'); + * var badFn = function () { throw err; }; + * + * expect(badFn).to.throw(TypeError, 'salmon'); + * expect(badFn).to.throw(TypeError, /salmon/); + * expect(badFn).to.throw(err, 'salmon'); + * expect(badFn).to.throw(err, /salmon/); + * + * Add \`.not\` earlier in the chain to negate \`.throw\`. + * + * var goodFn = function () {}; + * + * expect(goodFn).to.not.throw(); + * + * However, it's dangerous to negate \`.throw\` when providing any arguments. + * The problem is that it creates uncertain expectations by asserting that the + * target either doesn't throw an error, or that it throws an error but of a + * different type than the given type, or that it throws an error of the given + * type but with a message that doesn't include the given string. It's often + * best to identify the exact output that's expected, and then write an + * assertion that only accepts that exact output. + * + * When the target isn't expected to throw an error, it's often best to assert + * exactly that. + * + * var goodFn = function () {}; + * + * expect(goodFn).to.not.throw(); // Recommended + * expect(goodFn).to.not.throw(ReferenceError, 'x'); // Not recommended + * + * When the target is expected to throw an error, it's often best to assert + * that the error is of its expected type, and has a message that includes an + * expected string, rather than asserting that it doesn't have one of many + * unexpected types, and doesn't have a message that includes some string. + * + * var badFn = function () { throw new TypeError('Illegal salmon!'); }; + * + * expect(badFn).to.throw(TypeError, 'salmon'); // Recommended + * expect(badFn).to.not.throw(ReferenceError, 'x'); // Not recommended + * + * \`.throw\` changes the target of any assertions that follow in the chain to + * be the error object that's thrown. + * + * var err = new TypeError('Illegal salmon!'); + * err.code = 42; + * var badFn = function () { throw err; }; + * + * expect(badFn).to.throw(TypeError).with.property('code', 42); + * + * \`.throw\` accepts an optional \`msg\` argument which is a custom error message + * to show when the assertion fails. The message can also be given as the + * second argument to \`expect\`. When not providing two arguments, always use + * the second form. + * + * var goodFn = function () {}; + * + * expect(goodFn).to.throw(TypeError, 'x', 'nooo why fail??'); + * expect(goodFn, 'nooo why fail??').to.throw(); + * + * Due to limitations in ES5, \`.throw\` may not always work as expected when + * using a transpiler such as Babel or TypeScript. In particular, it may + * produce unexpected results when subclassing the built-in \`Error\` object and + * then passing the subclassed constructor to \`.throw\`. See your transpiler's + * docs for details: + * + * - ([Babel](https://babeljs.io/docs/usage/caveats/#classes)) + * - ([TypeScript](https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work)) + * + * Beware of some common mistakes when using the \`throw\` assertion. One common + * mistake is to accidentally invoke the function yourself instead of letting + * the \`throw\` assertion invoke the function for you. For example, when + * testing if a function named \`fn\` throws, provide \`fn\` instead of \`fn()\` as + * the target for the assertion. + * + * expect(fn).to.throw(); // Good! Tests \`fn\` as desired + * expect(fn()).to.throw(); // Bad! Tests result of \`fn()\`, not \`fn\` + * + * If you need to assert that your function \`fn\` throws when passed certain + * arguments, then wrap a call to \`fn\` inside of another function. + * + * expect(function () { fn(42); }).to.throw(); // Function expression + * expect(() => fn(42)).to.throw(); // ES6 arrow function + * + * Another common mistake is to provide an object method (or any stand-alone + * function that relies on \`this\`) as the target of the assertion. Doing so is + * problematic because the \`this\` context will be lost when the function is + * invoked by \`.throw\`; there's no way for it to know what \`this\` is supposed + * to be. There are two ways around this problem. One solution is to wrap the + * method or function call inside of another function. Another solution is to + * use \`bind\`. + * + * expect(function () { cat.meow(); }).to.throw(); // Function expression + * expect(() => cat.meow()).to.throw(); // ES6 arrow function + * expect(cat.meow.bind(cat)).to.throw(); // Bind + * + * Finally, it's worth mentioning that it's a best practice in JavaScript to + * only throw \`Error\` and derivatives of \`Error\` such as \`ReferenceError\`, + * \`TypeError\`, and user-defined objects that extend \`Error\`. No other type of + * value will generate a stack trace when initialized. With that said, the + * \`throw\` assertion does technically support any type of value being thrown, + * not just \`Error\` and its derivatives. + * + * The aliases \`.throws\` and \`.Throw\` can be used interchangeably with + * \`.throw\`. + * + * @name throw + * @alias throws + * @alias Throw + * @param {Error|ErrorConstructor} errorLike + * @param {String|RegExp} errMsgMatcher error message + * @param {String} msg _optional_ + * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types + * @returns error for chaining (null if no error) + * @namespace BDD + * @api public + */function assertThrows(errorLike,errMsgMatcher,msg){if(msg)flag(this,'message',msg);var obj=flag(this,'object'),ssfi=flag(this,'ssfi'),flagMsg=flag(this,'message'),negate=flag(this,'negate')||false;new Assertion(obj,flagMsg,ssfi,true).is.a('function');if(errorLike instanceof RegExp||typeof errorLike==='string'){errMsgMatcher=errorLike;errorLike=null;}var caughtErr;try{obj();}catch(err){caughtErr=err;}// If we have the negate flag enabled and at least one valid argument it means we do expect an error +// but we want it to match a given set of criteria +var everyArgIsUndefined=errorLike===undefined&&errMsgMatcher===undefined;// If we've got the negate flag enabled and both args, we should only fail if both aren't compatible +// See Issue #551 and PR #683@GitHub +var everyArgIsDefined=Boolean(errorLike&&errMsgMatcher);var errorLikeFail=false;var errMsgMatcherFail=false;// Checking if error was thrown +if(everyArgIsUndefined||!everyArgIsUndefined&&!negate){// We need this to display results correctly according to their types +var errorLikeString='an error';if(errorLike instanceof Error){errorLikeString='#{exp}';}else if(errorLike){errorLikeString=_.checkError.getConstructorName(errorLike);}this.assert(caughtErr,'expected #{this} to throw '+errorLikeString,'expected #{this} to not throw an error but #{act} was thrown',errorLike&&errorLike.toString(),caughtErr instanceof Error?caughtErr.toString():typeof caughtErr==='string'?caughtErr:caughtErr&&_.checkError.getConstructorName(caughtErr));}if(errorLike&&caughtErr){// We should compare instances only if \`errorLike\` is an instance of \`Error\` +if(errorLike instanceof Error){var isCompatibleInstance=_.checkError.compatibleInstance(caughtErr,errorLike);if(isCompatibleInstance===negate){// These checks were created to ensure we won't fail too soon when we've got both args and a negate +// See Issue #551 and PR #683@GitHub +if(everyArgIsDefined&&negate){errorLikeFail=true;}else{this.assert(negate,'expected #{this} to throw #{exp} but #{act} was thrown','expected #{this} to not throw #{exp}'+(caughtErr&&!negate?' but #{act} was thrown':''),errorLike.toString(),caughtErr.toString());}}}var isCompatibleConstructor=_.checkError.compatibleConstructor(caughtErr,errorLike);if(isCompatibleConstructor===negate){if(everyArgIsDefined&&negate){errorLikeFail=true;}else{this.assert(negate,'expected #{this} to throw #{exp} but #{act} was thrown','expected #{this} to not throw #{exp}'+(caughtErr?' but #{act} was thrown':''),errorLike instanceof Error?errorLike.toString():errorLike&&_.checkError.getConstructorName(errorLike),caughtErr instanceof Error?caughtErr.toString():caughtErr&&_.checkError.getConstructorName(caughtErr));}}}if(caughtErr&&errMsgMatcher!==undefined&&errMsgMatcher!==null){// Here we check compatible messages +var placeholder='including';if(errMsgMatcher instanceof RegExp){placeholder='matching';}var isCompatibleMessage=_.checkError.compatibleMessage(caughtErr,errMsgMatcher);if(isCompatibleMessage===negate){if(everyArgIsDefined&&negate){errMsgMatcherFail=true;}else{this.assert(negate,'expected #{this} to throw error '+placeholder+' #{exp} but got #{act}','expected #{this} to throw error not '+placeholder+' #{exp}',errMsgMatcher,_.checkError.getMessage(caughtErr));}}}// If both assertions failed and both should've matched we throw an error +if(errorLikeFail&&errMsgMatcherFail){this.assert(negate,'expected #{this} to throw #{exp} but #{act} was thrown','expected #{this} to not throw #{exp}'+(caughtErr?' but #{act} was thrown':''),errorLike instanceof Error?errorLike.toString():errorLike&&_.checkError.getConstructorName(errorLike),caughtErr instanceof Error?caughtErr.toString():caughtErr&&_.checkError.getConstructorName(caughtErr));}flag(this,'object',caughtErr);}Assertion.addMethod('throw',assertThrows);Assertion.addMethod('throws',assertThrows);Assertion.addMethod('Throw',assertThrows);/** + * ### .respondTo(method[, msg]) + * + * When the target is a non-function object, \`.respondTo\` asserts that the + * target has a method with the given name \`method\`. The method can be own or + * inherited, and it can be enumerable or non-enumerable. + * + * function Cat () {} + * Cat.prototype.meow = function () {}; + * + * expect(new Cat()).to.respondTo('meow'); + * + * When the target is a function, \`.respondTo\` asserts that the target's + * \`prototype\` property has a method with the given name \`method\`. Again, the + * method can be own or inherited, and it can be enumerable or non-enumerable. + * + * function Cat () {} + * Cat.prototype.meow = function () {}; + * + * expect(Cat).to.respondTo('meow'); + * + * Add \`.itself\` earlier in the chain to force \`.respondTo\` to treat the + * target as a non-function object, even if it's a function. Thus, it asserts + * that the target has a method with the given name \`method\`, rather than + * asserting that the target's \`prototype\` property has a method with the + * given name \`method\`. + * + * function Cat () {} + * Cat.prototype.meow = function () {}; + * Cat.hiss = function () {}; + * + * expect(Cat).itself.to.respondTo('hiss').but.not.respondTo('meow'); + * + * When not adding \`.itself\`, it's important to check the target's type before + * using \`.respondTo\`. See the \`.a\` doc for info on checking a target's type. + * + * function Cat () {} + * Cat.prototype.meow = function () {}; + * + * expect(new Cat()).to.be.an('object').that.respondsTo('meow'); + * + * Add \`.not\` earlier in the chain to negate \`.respondTo\`. + * + * function Dog () {} + * Dog.prototype.bark = function () {}; + * + * expect(new Dog()).to.not.respondTo('meow'); + * + * \`.respondTo\` accepts an optional \`msg\` argument which is a custom error + * message to show when the assertion fails. The message can also be given as + * the second argument to \`expect\`. + * + * expect({}).to.respondTo('meow', 'nooo why fail??'); + * expect({}, 'nooo why fail??').to.respondTo('meow'); + * + * The alias \`.respondsTo\` can be used interchangeably with \`.respondTo\`. + * + * @name respondTo + * @alias respondsTo + * @param {String} method + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */function respondTo(method,msg){if(msg)flag(this,'message',msg);var obj=flag(this,'object'),itself=flag(this,'itself'),context='function'===typeof obj&&!itself?obj.prototype[method]:obj[method];this.assert('function'===typeof context,'expected #{this} to respond to '+_.inspect(method),'expected #{this} to not respond to '+_.inspect(method));}Assertion.addMethod('respondTo',respondTo);Assertion.addMethod('respondsTo',respondTo);/** + * ### .itself + * + * Forces all \`.respondTo\` assertions that follow in the chain to behave as if + * the target is a non-function object, even if it's a function. Thus, it + * causes \`.respondTo\` to assert that the target has a method with the given + * name, rather than asserting that the target's \`prototype\` property has a + * method with the given name. + * + * function Cat () {} + * Cat.prototype.meow = function () {}; + * Cat.hiss = function () {}; + * + * expect(Cat).itself.to.respondTo('hiss').but.not.respondTo('meow'); + * + * @name itself + * @namespace BDD + * @api public + */Assertion.addProperty('itself',function(){flag(this,'itself',true);});/** + * ### .satisfy(matcher[, msg]) + * + * Invokes the given \`matcher\` function with the target being passed as the + * first argument, and asserts that the value returned is truthy. + * + * expect(1).to.satisfy(function(num) { + * return num > 0; + * }); + * + * Add \`.not\` earlier in the chain to negate \`.satisfy\`. + * + * expect(1).to.not.satisfy(function(num) { + * return num > 2; + * }); + * + * \`.satisfy\` accepts an optional \`msg\` argument which is a custom error + * message to show when the assertion fails. The message can also be given as + * the second argument to \`expect\`. + * + * expect(1).to.satisfy(function(num) { + * return num > 2; + * }, 'nooo why fail??'); + * + * expect(1, 'nooo why fail??').to.satisfy(function(num) { + * return num > 2; + * }); + * + * The alias \`.satisfies\` can be used interchangeably with \`.satisfy\`. + * + * @name satisfy + * @alias satisfies + * @param {Function} matcher + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */function satisfy(matcher,msg){if(msg)flag(this,'message',msg);var obj=flag(this,'object');var result=matcher(obj);this.assert(result,'expected #{this} to satisfy '+_.objDisplay(matcher),'expected #{this} to not satisfy'+_.objDisplay(matcher),flag(this,'negate')?false:true,result);}Assertion.addMethod('satisfy',satisfy);Assertion.addMethod('satisfies',satisfy);/** + * ### .closeTo(expected, delta[, msg]) + * + * Asserts that the target is a number that's within a given +/- \`delta\` range + * of the given number \`expected\`. However, it's often best to assert that the + * target is equal to its expected value. + * + * // Recommended + * expect(1.5).to.equal(1.5); + * + * // Not recommended + * expect(1.5).to.be.closeTo(1, 0.5); + * expect(1.5).to.be.closeTo(2, 0.5); + * expect(1.5).to.be.closeTo(1, 1); + * + * Add \`.not\` earlier in the chain to negate \`.closeTo\`. + * + * expect(1.5).to.equal(1.5); // Recommended + * expect(1.5).to.not.be.closeTo(3, 1); // Not recommended + * + * \`.closeTo\` accepts an optional \`msg\` argument which is a custom error + * message to show when the assertion fails. The message can also be given as + * the second argument to \`expect\`. + * + * expect(1.5).to.be.closeTo(3, 1, 'nooo why fail??'); + * expect(1.5, 'nooo why fail??').to.be.closeTo(3, 1); + * + * The alias \`.approximately\` can be used interchangeably with \`.closeTo\`. + * + * @name closeTo + * @alias approximately + * @param {Number} expected + * @param {Number} delta + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */function closeTo(expected,delta,msg){if(msg)flag(this,'message',msg);var obj=flag(this,'object'),flagMsg=flag(this,'message'),ssfi=flag(this,'ssfi');new Assertion(obj,flagMsg,ssfi,true).is.a('number');if(typeof expected!=='number'||typeof delta!=='number'){flagMsg=flagMsg?flagMsg+': ':'';var deltaMessage=delta===undefined?", and a delta is required":"";throw new AssertionError(flagMsg+'the arguments to closeTo or approximately must be numbers'+deltaMessage,undefined,ssfi);}this.assert(Math.abs(obj-expected)<=delta,'expected #{this} to be close to '+expected+' +/- '+delta,'expected #{this} not to be close to '+expected+' +/- '+delta);}Assertion.addMethod('closeTo',closeTo);Assertion.addMethod('approximately',closeTo);// Note: Duplicates are ignored if testing for inclusion instead of sameness. +function isSubsetOf(subset,superset,cmp,contains,ordered){if(!contains){if(subset.length!==superset.length)return false;superset=superset.slice();}return subset.every(function(elem,idx){if(ordered)return cmp?cmp(elem,superset[idx]):elem===superset[idx];if(!cmp){var matchIdx=superset.indexOf(elem);if(matchIdx===-1)return false;// Remove match from superset so not counted twice if duplicate in subset. +if(!contains)superset.splice(matchIdx,1);return true;}return superset.some(function(elem2,matchIdx){if(!cmp(elem,elem2))return false;// Remove match from superset so not counted twice if duplicate in subset. +if(!contains)superset.splice(matchIdx,1);return true;});});}/** + * ### .members(set[, msg]) + * + * Asserts that the target array has the same members as the given array + * \`set\`. + * + * expect([1, 2, 3]).to.have.members([2, 1, 3]); + * expect([1, 2, 2]).to.have.members([2, 1, 2]); + * + * By default, members are compared using strict (\`===\`) equality. Add \`.deep\` + * earlier in the chain to use deep equality instead. See the \`deep-eql\` + * project page for info on the deep equality algorithm: + * https://github.com/chaijs/deep-eql. + * + * // Target array deeply (but not strictly) has member \`{a: 1}\` + * expect([{a: 1}]).to.have.deep.members([{a: 1}]); + * expect([{a: 1}]).to.not.have.members([{a: 1}]); + * + * By default, order doesn't matter. Add \`.ordered\` earlier in the chain to + * require that members appear in the same order. + * + * expect([1, 2, 3]).to.have.ordered.members([1, 2, 3]); + * expect([1, 2, 3]).to.have.members([2, 1, 3]) + * .but.not.ordered.members([2, 1, 3]); + * + * By default, both arrays must be the same size. Add \`.include\` earlier in + * the chain to require that the target's members be a superset of the + * expected members. Note that duplicates are ignored in the subset when + * \`.include\` is added. + * + * // Target array is a superset of [1, 2] but not identical + * expect([1, 2, 3]).to.include.members([1, 2]); + * expect([1, 2, 3]).to.not.have.members([1, 2]); + * + * // Duplicates in the subset are ignored + * expect([1, 2, 3]).to.include.members([1, 2, 2, 2]); + * + * \`.deep\`, \`.ordered\`, and \`.include\` can all be combined. However, if + * \`.include\` and \`.ordered\` are combined, the ordering begins at the start of + * both arrays. + * + * expect([{a: 1}, {b: 2}, {c: 3}]) + * .to.include.deep.ordered.members([{a: 1}, {b: 2}]) + * .but.not.include.deep.ordered.members([{b: 2}, {c: 3}]); + * + * Add \`.not\` earlier in the chain to negate \`.members\`. However, it's + * dangerous to do so. The problem is that it creates uncertain expectations + * by asserting that the target array doesn't have all of the same members as + * the given array \`set\` but may or may not have some of them. It's often best + * to identify the exact output that's expected, and then write an assertion + * that only accepts that exact output. + * + * expect([1, 2]).to.not.include(3).and.not.include(4); // Recommended + * expect([1, 2]).to.not.have.members([3, 4]); // Not recommended + * + * \`.members\` accepts an optional \`msg\` argument which is a custom error + * message to show when the assertion fails. The message can also be given as + * the second argument to \`expect\`. + * + * expect([1, 2]).to.have.members([1, 2, 3], 'nooo why fail??'); + * expect([1, 2], 'nooo why fail??').to.have.members([1, 2, 3]); + * + * @name members + * @param {Array} set + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */Assertion.addMethod('members',function(subset,msg){if(msg)flag(this,'message',msg);var obj=flag(this,'object'),flagMsg=flag(this,'message'),ssfi=flag(this,'ssfi');new Assertion(obj,flagMsg,ssfi,true).to.be.an('array');new Assertion(subset,flagMsg,ssfi,true).to.be.an('array');var contains=flag(this,'contains');var ordered=flag(this,'ordered');var subject,failMsg,failNegateMsg;if(contains){subject=ordered?'an ordered superset':'a superset';failMsg='expected #{this} to be '+subject+' of #{exp}';failNegateMsg='expected #{this} to not be '+subject+' of #{exp}';}else{subject=ordered?'ordered members':'members';failMsg='expected #{this} to have the same '+subject+' as #{exp}';failNegateMsg='expected #{this} to not have the same '+subject+' as #{exp}';}var cmp=flag(this,'deep')?flag(this,'eql'):undefined;this.assert(isSubsetOf(subset,obj,cmp,contains,ordered),failMsg,failNegateMsg,subset,obj,true);});/** + * ### .oneOf(list[, msg]) + * + * Asserts that the target is a member of the given array \`list\`. However, + * it's often best to assert that the target is equal to its expected value. + * + * expect(1).to.equal(1); // Recommended + * expect(1).to.be.oneOf([1, 2, 3]); // Not recommended + * + * Comparisons are performed using strict (\`===\`) equality. + * + * Add \`.not\` earlier in the chain to negate \`.oneOf\`. + * + * expect(1).to.equal(1); // Recommended + * expect(1).to.not.be.oneOf([2, 3, 4]); // Not recommended + * + * It can also be chained with \`.contain\` or \`.include\`, which will work with + * both arrays and strings: + * + * expect('Today is sunny').to.contain.oneOf(['sunny', 'cloudy']) + * expect('Today is rainy').to.not.contain.oneOf(['sunny', 'cloudy']) + * expect([1,2,3]).to.contain.oneOf([3,4,5]) + * expect([1,2,3]).to.not.contain.oneOf([4,5,6]) + * + * \`.oneOf\` accepts an optional \`msg\` argument which is a custom error message + * to show when the assertion fails. The message can also be given as the + * second argument to \`expect\`. + * + * expect(1).to.be.oneOf([2, 3, 4], 'nooo why fail??'); + * expect(1, 'nooo why fail??').to.be.oneOf([2, 3, 4]); + * + * @name oneOf + * @param {Array<*>} list + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */function oneOf(list,msg){if(msg)flag(this,'message',msg);var expected=flag(this,'object'),flagMsg=flag(this,'message'),ssfi=flag(this,'ssfi'),contains=flag(this,'contains'),isDeep=flag(this,'deep'),eql=flag(this,'eql');new Assertion(list,flagMsg,ssfi,true).to.be.an('array');if(contains){this.assert(list.some(function(possibility){return expected.indexOf(possibility)>-1;}),'expected #{this} to contain one of #{exp}','expected #{this} to not contain one of #{exp}',list,expected);}else{if(isDeep){this.assert(list.some(function(possibility){return eql(expected,possibility);}),'expected #{this} to deeply equal one of #{exp}','expected #{this} to deeply equal one of #{exp}',list,expected);}else{this.assert(list.indexOf(expected)>-1,'expected #{this} to be one of #{exp}','expected #{this} to not be one of #{exp}',list,expected);}}}Assertion.addMethod('oneOf',oneOf);/** + * ### .change(subject[, prop[, msg]]) + * + * When one argument is provided, \`.change\` asserts that the given function + * \`subject\` returns a different value when it's invoked before the target + * function compared to when it's invoked afterward. However, it's often best + * to assert that \`subject\` is equal to its expected value. + * + * var dots = '' + * , addDot = function () { dots += '.'; } + * , getDots = function () { return dots; }; + * + * // Recommended + * expect(getDots()).to.equal(''); + * addDot(); + * expect(getDots()).to.equal('.'); + * + * // Not recommended + * expect(addDot).to.change(getDots); + * + * When two arguments are provided, \`.change\` asserts that the value of the + * given object \`subject\`'s \`prop\` property is different before invoking the + * target function compared to afterward. + * + * var myObj = {dots: ''} + * , addDot = function () { myObj.dots += '.'; }; + * + * // Recommended + * expect(myObj).to.have.property('dots', ''); + * addDot(); + * expect(myObj).to.have.property('dots', '.'); + * + * // Not recommended + * expect(addDot).to.change(myObj, 'dots'); + * + * Strict (\`===\`) equality is used to compare before and after values. + * + * Add \`.not\` earlier in the chain to negate \`.change\`. + * + * var dots = '' + * , noop = function () {} + * , getDots = function () { return dots; }; + * + * expect(noop).to.not.change(getDots); + * + * var myObj = {dots: ''} + * , noop = function () {}; + * + * expect(noop).to.not.change(myObj, 'dots'); + * + * \`.change\` accepts an optional \`msg\` argument which is a custom error + * message to show when the assertion fails. The message can also be given as + * the second argument to \`expect\`. When not providing two arguments, always + * use the second form. + * + * var myObj = {dots: ''} + * , addDot = function () { myObj.dots += '.'; }; + * + * expect(addDot).to.not.change(myObj, 'dots', 'nooo why fail??'); + * + * var dots = '' + * , addDot = function () { dots += '.'; } + * , getDots = function () { return dots; }; + * + * expect(addDot, 'nooo why fail??').to.not.change(getDots); + * + * \`.change\` also causes all \`.by\` assertions that follow in the chain to + * assert how much a numeric subject was increased or decreased by. However, + * it's dangerous to use \`.change.by\`. The problem is that it creates + * uncertain expectations by asserting that the subject either increases by + * the given delta, or that it decreases by the given delta. It's often best + * to identify the exact output that's expected, and then write an assertion + * that only accepts that exact output. + * + * var myObj = {val: 1} + * , addTwo = function () { myObj.val += 2; } + * , subtractTwo = function () { myObj.val -= 2; }; + * + * expect(addTwo).to.increase(myObj, 'val').by(2); // Recommended + * expect(addTwo).to.change(myObj, 'val').by(2); // Not recommended + * + * expect(subtractTwo).to.decrease(myObj, 'val').by(2); // Recommended + * expect(subtractTwo).to.change(myObj, 'val').by(2); // Not recommended + * + * The alias \`.changes\` can be used interchangeably with \`.change\`. + * + * @name change + * @alias changes + * @param {String} subject + * @param {String} prop name _optional_ + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */function assertChanges(subject,prop,msg){if(msg)flag(this,'message',msg);var fn=flag(this,'object'),flagMsg=flag(this,'message'),ssfi=flag(this,'ssfi');new Assertion(fn,flagMsg,ssfi,true).is.a('function');var initial;if(!prop){new Assertion(subject,flagMsg,ssfi,true).is.a('function');initial=subject();}else{new Assertion(subject,flagMsg,ssfi,true).to.have.property(prop);initial=subject[prop];}fn();var final=prop===undefined||prop===null?subject():subject[prop];var msgObj=prop===undefined||prop===null?initial:'.'+prop;// This gets flagged because of the .by(delta) assertion +flag(this,'deltaMsgObj',msgObj);flag(this,'initialDeltaValue',initial);flag(this,'finalDeltaValue',final);flag(this,'deltaBehavior','change');flag(this,'realDelta',final!==initial);this.assert(initial!==final,'expected '+msgObj+' to change','expected '+msgObj+' to not change');}Assertion.addMethod('change',assertChanges);Assertion.addMethod('changes',assertChanges);/** + * ### .increase(subject[, prop[, msg]]) + * + * When one argument is provided, \`.increase\` asserts that the given function + * \`subject\` returns a greater number when it's invoked after invoking the + * target function compared to when it's invoked beforehand. \`.increase\` also + * causes all \`.by\` assertions that follow in the chain to assert how much + * greater of a number is returned. It's often best to assert that the return + * value increased by the expected amount, rather than asserting it increased + * by any amount. + * + * var val = 1 + * , addTwo = function () { val += 2; } + * , getVal = function () { return val; }; + * + * expect(addTwo).to.increase(getVal).by(2); // Recommended + * expect(addTwo).to.increase(getVal); // Not recommended + * + * When two arguments are provided, \`.increase\` asserts that the value of the + * given object \`subject\`'s \`prop\` property is greater after invoking the + * target function compared to beforehand. + * + * var myObj = {val: 1} + * , addTwo = function () { myObj.val += 2; }; + * + * expect(addTwo).to.increase(myObj, 'val').by(2); // Recommended + * expect(addTwo).to.increase(myObj, 'val'); // Not recommended + * + * Add \`.not\` earlier in the chain to negate \`.increase\`. However, it's + * dangerous to do so. The problem is that it creates uncertain expectations + * by asserting that the subject either decreases, or that it stays the same. + * It's often best to identify the exact output that's expected, and then + * write an assertion that only accepts that exact output. + * + * When the subject is expected to decrease, it's often best to assert that it + * decreased by the expected amount. + * + * var myObj = {val: 1} + * , subtractTwo = function () { myObj.val -= 2; }; + * + * expect(subtractTwo).to.decrease(myObj, 'val').by(2); // Recommended + * expect(subtractTwo).to.not.increase(myObj, 'val'); // Not recommended + * + * When the subject is expected to stay the same, it's often best to assert + * exactly that. + * + * var myObj = {val: 1} + * , noop = function () {}; + * + * expect(noop).to.not.change(myObj, 'val'); // Recommended + * expect(noop).to.not.increase(myObj, 'val'); // Not recommended + * + * \`.increase\` accepts an optional \`msg\` argument which is a custom error + * message to show when the assertion fails. The message can also be given as + * the second argument to \`expect\`. When not providing two arguments, always + * use the second form. + * + * var myObj = {val: 1} + * , noop = function () {}; + * + * expect(noop).to.increase(myObj, 'val', 'nooo why fail??'); + * + * var val = 1 + * , noop = function () {} + * , getVal = function () { return val; }; + * + * expect(noop, 'nooo why fail??').to.increase(getVal); + * + * The alias \`.increases\` can be used interchangeably with \`.increase\`. + * + * @name increase + * @alias increases + * @param {String|Function} subject + * @param {String} prop name _optional_ + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */function assertIncreases(subject,prop,msg){if(msg)flag(this,'message',msg);var fn=flag(this,'object'),flagMsg=flag(this,'message'),ssfi=flag(this,'ssfi');new Assertion(fn,flagMsg,ssfi,true).is.a('function');var initial;if(!prop){new Assertion(subject,flagMsg,ssfi,true).is.a('function');initial=subject();}else{new Assertion(subject,flagMsg,ssfi,true).to.have.property(prop);initial=subject[prop];}// Make sure that the target is a number +new Assertion(initial,flagMsg,ssfi,true).is.a('number');fn();var final=prop===undefined||prop===null?subject():subject[prop];var msgObj=prop===undefined||prop===null?initial:'.'+prop;flag(this,'deltaMsgObj',msgObj);flag(this,'initialDeltaValue',initial);flag(this,'finalDeltaValue',final);flag(this,'deltaBehavior','increase');flag(this,'realDelta',final-initial);this.assert(final-initial>0,'expected '+msgObj+' to increase','expected '+msgObj+' to not increase');}Assertion.addMethod('increase',assertIncreases);Assertion.addMethod('increases',assertIncreases);/** + * ### .decrease(subject[, prop[, msg]]) + * + * When one argument is provided, \`.decrease\` asserts that the given function + * \`subject\` returns a lesser number when it's invoked after invoking the + * target function compared to when it's invoked beforehand. \`.decrease\` also + * causes all \`.by\` assertions that follow in the chain to assert how much + * lesser of a number is returned. It's often best to assert that the return + * value decreased by the expected amount, rather than asserting it decreased + * by any amount. + * + * var val = 1 + * , subtractTwo = function () { val -= 2; } + * , getVal = function () { return val; }; + * + * expect(subtractTwo).to.decrease(getVal).by(2); // Recommended + * expect(subtractTwo).to.decrease(getVal); // Not recommended + * + * When two arguments are provided, \`.decrease\` asserts that the value of the + * given object \`subject\`'s \`prop\` property is lesser after invoking the + * target function compared to beforehand. + * + * var myObj = {val: 1} + * , subtractTwo = function () { myObj.val -= 2; }; + * + * expect(subtractTwo).to.decrease(myObj, 'val').by(2); // Recommended + * expect(subtractTwo).to.decrease(myObj, 'val'); // Not recommended + * + * Add \`.not\` earlier in the chain to negate \`.decrease\`. However, it's + * dangerous to do so. The problem is that it creates uncertain expectations + * by asserting that the subject either increases, or that it stays the same. + * It's often best to identify the exact output that's expected, and then + * write an assertion that only accepts that exact output. + * + * When the subject is expected to increase, it's often best to assert that it + * increased by the expected amount. + * + * var myObj = {val: 1} + * , addTwo = function () { myObj.val += 2; }; + * + * expect(addTwo).to.increase(myObj, 'val').by(2); // Recommended + * expect(addTwo).to.not.decrease(myObj, 'val'); // Not recommended + * + * When the subject is expected to stay the same, it's often best to assert + * exactly that. + * + * var myObj = {val: 1} + * , noop = function () {}; + * + * expect(noop).to.not.change(myObj, 'val'); // Recommended + * expect(noop).to.not.decrease(myObj, 'val'); // Not recommended + * + * \`.decrease\` accepts an optional \`msg\` argument which is a custom error + * message to show when the assertion fails. The message can also be given as + * the second argument to \`expect\`. When not providing two arguments, always + * use the second form. + * + * var myObj = {val: 1} + * , noop = function () {}; + * + * expect(noop).to.decrease(myObj, 'val', 'nooo why fail??'); + * + * var val = 1 + * , noop = function () {} + * , getVal = function () { return val; }; + * + * expect(noop, 'nooo why fail??').to.decrease(getVal); + * + * The alias \`.decreases\` can be used interchangeably with \`.decrease\`. + * + * @name decrease + * @alias decreases + * @param {String|Function} subject + * @param {String} prop name _optional_ + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */function assertDecreases(subject,prop,msg){if(msg)flag(this,'message',msg);var fn=flag(this,'object'),flagMsg=flag(this,'message'),ssfi=flag(this,'ssfi');new Assertion(fn,flagMsg,ssfi,true).is.a('function');var initial;if(!prop){new Assertion(subject,flagMsg,ssfi,true).is.a('function');initial=subject();}else{new Assertion(subject,flagMsg,ssfi,true).to.have.property(prop);initial=subject[prop];}// Make sure that the target is a number +new Assertion(initial,flagMsg,ssfi,true).is.a('number');fn();var final=prop===undefined||prop===null?subject():subject[prop];var msgObj=prop===undefined||prop===null?initial:'.'+prop;flag(this,'deltaMsgObj',msgObj);flag(this,'initialDeltaValue',initial);flag(this,'finalDeltaValue',final);flag(this,'deltaBehavior','decrease');flag(this,'realDelta',initial-final);this.assert(final-initial<0,'expected '+msgObj+' to decrease','expected '+msgObj+' to not decrease');}Assertion.addMethod('decrease',assertDecreases);Assertion.addMethod('decreases',assertDecreases);/** + * ### .by(delta[, msg]) + * + * When following an \`.increase\` assertion in the chain, \`.by\` asserts that + * the subject of the \`.increase\` assertion increased by the given \`delta\`. + * + * var myObj = {val: 1} + * , addTwo = function () { myObj.val += 2; }; + * + * expect(addTwo).to.increase(myObj, 'val').by(2); + * + * When following a \`.decrease\` assertion in the chain, \`.by\` asserts that the + * subject of the \`.decrease\` assertion decreased by the given \`delta\`. + * + * var myObj = {val: 1} + * , subtractTwo = function () { myObj.val -= 2; }; + * + * expect(subtractTwo).to.decrease(myObj, 'val').by(2); + * + * When following a \`.change\` assertion in the chain, \`.by\` asserts that the + * subject of the \`.change\` assertion either increased or decreased by the + * given \`delta\`. However, it's dangerous to use \`.change.by\`. The problem is + * that it creates uncertain expectations. It's often best to identify the + * exact output that's expected, and then write an assertion that only accepts + * that exact output. + * + * var myObj = {val: 1} + * , addTwo = function () { myObj.val += 2; } + * , subtractTwo = function () { myObj.val -= 2; }; + * + * expect(addTwo).to.increase(myObj, 'val').by(2); // Recommended + * expect(addTwo).to.change(myObj, 'val').by(2); // Not recommended + * + * expect(subtractTwo).to.decrease(myObj, 'val').by(2); // Recommended + * expect(subtractTwo).to.change(myObj, 'val').by(2); // Not recommended + * + * Add \`.not\` earlier in the chain to negate \`.by\`. However, it's often best + * to assert that the subject changed by its expected delta, rather than + * asserting that it didn't change by one of countless unexpected deltas. + * + * var myObj = {val: 1} + * , addTwo = function () { myObj.val += 2; }; + * + * // Recommended + * expect(addTwo).to.increase(myObj, 'val').by(2); + * + * // Not recommended + * expect(addTwo).to.increase(myObj, 'val').but.not.by(3); + * + * \`.by\` accepts an optional \`msg\` argument which is a custom error message to + * show when the assertion fails. The message can also be given as the second + * argument to \`expect\`. + * + * var myObj = {val: 1} + * , addTwo = function () { myObj.val += 2; }; + * + * expect(addTwo).to.increase(myObj, 'val').by(3, 'nooo why fail??'); + * expect(addTwo, 'nooo why fail??').to.increase(myObj, 'val').by(3); + * + * @name by + * @param {Number} delta + * @param {String} msg _optional_ + * @namespace BDD + * @api public + */function assertDelta(delta,msg){if(msg)flag(this,'message',msg);var msgObj=flag(this,'deltaMsgObj');var initial=flag(this,'initialDeltaValue');var final=flag(this,'finalDeltaValue');var behavior=flag(this,'deltaBehavior');var realDelta=flag(this,'realDelta');var expression;if(behavior==='change'){expression=Math.abs(final-initial)===Math.abs(delta);}else{expression=realDelta===Math.abs(delta);}this.assert(expression,'expected '+msgObj+' to '+behavior+' by '+delta,'expected '+msgObj+' to not '+behavior+' by '+delta);}Assertion.addMethod('by',assertDelta);/** + * ### .extensible + * + * Asserts that the target is extensible, which means that new properties can + * be added to it. Primitives are never extensible. + * + * expect({a: 1}).to.be.extensible; + * + * Add \`.not\` earlier in the chain to negate \`.extensible\`. + * + * var nonExtensibleObject = Object.preventExtensions({}) + * , sealedObject = Object.seal({}) + * , frozenObject = Object.freeze({}); + * + * expect(nonExtensibleObject).to.not.be.extensible; + * expect(sealedObject).to.not.be.extensible; + * expect(frozenObject).to.not.be.extensible; + * expect(1).to.not.be.extensible; + * + * A custom error message can be given as the second argument to \`expect\`. + * + * expect(1, 'nooo why fail??').to.be.extensible; + * + * @name extensible + * @namespace BDD + * @api public + */Assertion.addProperty('extensible',function(){var obj=flag(this,'object');// In ES5, if the argument to this method is a primitive, then it will cause a TypeError. +// In ES6, a non-object argument will be treated as if it was a non-extensible ordinary object, simply return false. +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isExtensible +// The following provides ES6 behavior for ES5 environments. +var isExtensible=obj===Object(obj)&&Object.isExtensible(obj);this.assert(isExtensible,'expected #{this} to be extensible','expected #{this} to not be extensible');});/** + * ### .sealed + * + * Asserts that the target is sealed, which means that new properties can't be + * added to it, and its existing properties can't be reconfigured or deleted. + * However, it's possible that its existing properties can still be reassigned + * to different values. Primitives are always sealed. + * + * var sealedObject = Object.seal({}); + * var frozenObject = Object.freeze({}); + * + * expect(sealedObject).to.be.sealed; + * expect(frozenObject).to.be.sealed; + * expect(1).to.be.sealed; + * + * Add \`.not\` earlier in the chain to negate \`.sealed\`. + * + * expect({a: 1}).to.not.be.sealed; + * + * A custom error message can be given as the second argument to \`expect\`. + * + * expect({a: 1}, 'nooo why fail??').to.be.sealed; + * + * @name sealed + * @namespace BDD + * @api public + */Assertion.addProperty('sealed',function(){var obj=flag(this,'object');// In ES5, if the argument to this method is a primitive, then it will cause a TypeError. +// In ES6, a non-object argument will be treated as if it was a sealed ordinary object, simply return true. +// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isSealed +// The following provides ES6 behavior for ES5 environments. +var isSealed=obj===Object(obj)?Object.isSealed(obj):true;this.assert(isSealed,'expected #{this} to be sealed','expected #{this} to not be sealed');});/** + * ### .frozen + * + * Asserts that the target is frozen, which means that new properties can't be + * added to it, and its existing properties can't be reassigned to different + * values, reconfigured, or deleted. Primitives are always frozen. + * + * var frozenObject = Object.freeze({}); + * + * expect(frozenObject).to.be.frozen; + * expect(1).to.be.frozen; + * + * Add \`.not\` earlier in the chain to negate \`.frozen\`. + * + * expect({a: 1}).to.not.be.frozen; + * + * A custom error message can be given as the second argument to \`expect\`. + * + * expect({a: 1}, 'nooo why fail??').to.be.frozen; + * + * @name frozen + * @namespace BDD + * @api public + */Assertion.addProperty('frozen',function(){var obj=flag(this,'object');// In ES5, if the argument to this method is a primitive, then it will cause a TypeError. +// In ES6, a non-object argument will be treated as if it was a frozen ordinary object, simply return true. +// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isFrozen +// The following provides ES6 behavior for ES5 environments. +var isFrozen=obj===Object(obj)?Object.isFrozen(obj):true;this.assert(isFrozen,'expected #{this} to be frozen','expected #{this} to not be frozen');});/** + * ### .finite + * + * Asserts that the target is a number, and isn't \`NaN\` or positive/negative + * \`Infinity\`. + * + * expect(1).to.be.finite; + * + * Add \`.not\` earlier in the chain to negate \`.finite\`. However, it's + * dangerous to do so. The problem is that it creates uncertain expectations + * by asserting that the subject either isn't a number, or that it's \`NaN\`, or + * that it's positive \`Infinity\`, or that it's negative \`Infinity\`. It's often + * best to identify the exact output that's expected, and then write an + * assertion that only accepts that exact output. + * + * When the target isn't expected to be a number, it's often best to assert + * that it's the expected type, rather than asserting that it isn't one of + * many unexpected types. + * + * expect('foo').to.be.a('string'); // Recommended + * expect('foo').to.not.be.finite; // Not recommended + * + * When the target is expected to be \`NaN\`, it's often best to assert exactly + * that. + * + * expect(NaN).to.be.NaN; // Recommended + * expect(NaN).to.not.be.finite; // Not recommended + * + * When the target is expected to be positive infinity, it's often best to + * assert exactly that. + * + * expect(Infinity).to.equal(Infinity); // Recommended + * expect(Infinity).to.not.be.finite; // Not recommended + * + * When the target is expected to be negative infinity, it's often best to + * assert exactly that. + * + * expect(-Infinity).to.equal(-Infinity); // Recommended + * expect(-Infinity).to.not.be.finite; // Not recommended + * + * A custom error message can be given as the second argument to \`expect\`. + * + * expect('foo', 'nooo why fail??').to.be.finite; + * + * @name finite + * @namespace BDD + * @api public + */Assertion.addProperty('finite',function(msg){var obj=flag(this,'object');this.assert(typeof obj==='number'&&isFinite(obj),'expected #{this} to be a finite number','expected #{this} to not be a finite number');});};/*! + * chai + * Copyright(c) 2011-2014 Jake Luer + * MIT Licensed + */var expect$1=function(chai,util){chai.expect=function(val,message){return new chai.Assertion(val,message);};/** + * ### .fail([message]) + * ### .fail(actual, expected, [message], [operator]) + * + * Throw a failure. + * + * expect.fail(); + * expect.fail("custom error message"); + * expect.fail(1, 2); + * expect.fail(1, 2, "custom error message"); + * expect.fail(1, 2, "custom error message", ">"); + * expect.fail(1, 2, undefined, ">"); + * + * @name fail + * @param {Mixed} actual + * @param {Mixed} expected + * @param {String} message + * @param {String} operator + * @namespace BDD + * @api public + */chai.expect.fail=function(actual,expected,message,operator){if(arguments.length<2){message=actual;actual=undefined;}message=message||'expect.fail()';throw new chai.AssertionError(message,{actual:actual,expected:expected,operator:operator},chai.expect.fail);};};/*! + * chai + * Copyright(c) 2011-2014 Jake Luer + * MIT Licensed + */var should=function(chai,util){var Assertion=chai.Assertion;function loadShould(){// explicitly define this method as function as to have it's name to include as \`ssfi\` +function shouldGetter(){if(this instanceof String||this instanceof Number||this instanceof Boolean||typeof Symbol==='function'&&this instanceof Symbol||typeof BigInt==='function'&&this instanceof BigInt){return new Assertion(this.valueOf(),null,shouldGetter);}return new Assertion(this,null,shouldGetter);}function shouldSetter(value){// See https://github.com/chaijs/chai/issues/86: this makes +// \`whatever.should = someValue\` actually set \`someValue\`, which is +// especially useful for \`global.should = require('chai').should()\`. +// +// Note that we have to use [[DefineProperty]] instead of [[Put]] +// since otherwise we would trigger this very setter! +Object.defineProperty(this,'should',{value:value,enumerable:true,configurable:true,writable:true});}// modify Object.prototype to have \`should\` +Object.defineProperty(Object.prototype,'should',{set:shouldSetter,get:shouldGetter,configurable:true});var should={};/** + * ### .fail([message]) + * ### .fail(actual, expected, [message], [operator]) + * + * Throw a failure. + * + * should.fail(); + * should.fail("custom error message"); + * should.fail(1, 2); + * should.fail(1, 2, "custom error message"); + * should.fail(1, 2, "custom error message", ">"); + * should.fail(1, 2, undefined, ">"); + * + * + * @name fail + * @param {Mixed} actual + * @param {Mixed} expected + * @param {String} message + * @param {String} operator + * @namespace BDD + * @api public + */should.fail=function(actual,expected,message,operator){if(arguments.length<2){message=actual;actual=undefined;}message=message||'should.fail()';throw new chai.AssertionError(message,{actual:actual,expected:expected,operator:operator},should.fail);};/** + * ### .equal(actual, expected, [message]) + * + * Asserts non-strict equality (\`==\`) of \`actual\` and \`expected\`. + * + * should.equal(3, '3', '== coerces values to strings'); + * + * @name equal + * @param {Mixed} actual + * @param {Mixed} expected + * @param {String} message + * @namespace Should + * @api public + */should.equal=function(val1,val2,msg){new Assertion(val1,msg).to.equal(val2);};/** + * ### .throw(function, [constructor/string/regexp], [string/regexp], [message]) + * + * Asserts that \`function\` will throw an error that is an instance of + * \`constructor\`, or alternately that it will throw an error with message + * matching \`regexp\`. + * + * should.throw(fn, 'function throws a reference error'); + * should.throw(fn, /function throws a reference error/); + * should.throw(fn, ReferenceError); + * should.throw(fn, ReferenceError, 'function throws a reference error'); + * should.throw(fn, ReferenceError, /function throws a reference error/); + * + * @name throw + * @alias Throw + * @param {Function} function + * @param {ErrorConstructor} constructor + * @param {RegExp} regexp + * @param {String} message + * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types + * @namespace Should + * @api public + */should.Throw=function(fn,errt,errs,msg){new Assertion(fn,msg).to.Throw(errt,errs);};/** + * ### .exist + * + * Asserts that the target is neither \`null\` nor \`undefined\`. + * + * var foo = 'hi'; + * + * should.exist(foo, 'foo exists'); + * + * @name exist + * @namespace Should + * @api public + */should.exist=function(val,msg){new Assertion(val,msg).to.exist;};// negation +should.not={};/** + * ### .not.equal(actual, expected, [message]) + * + * Asserts non-strict inequality (\`!=\`) of \`actual\` and \`expected\`. + * + * should.not.equal(3, 4, 'these numbers are not equal'); + * + * @name not.equal + * @param {Mixed} actual + * @param {Mixed} expected + * @param {String} message + * @namespace Should + * @api public + */should.not.equal=function(val1,val2,msg){new Assertion(val1,msg).to.not.equal(val2);};/** + * ### .throw(function, [constructor/regexp], [message]) + * + * Asserts that \`function\` will _not_ throw an error that is an instance of + * \`constructor\`, or alternately that it will not throw an error with message + * matching \`regexp\`. + * + * should.not.throw(fn, Error, 'function does not throw'); + * + * @name not.throw + * @alias not.Throw + * @param {Function} function + * @param {ErrorConstructor} constructor + * @param {RegExp} regexp + * @param {String} message + * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types + * @namespace Should + * @api public + */should.not.Throw=function(fn,errt,errs,msg){new Assertion(fn,msg).to.not.Throw(errt,errs);};/** + * ### .not.exist + * + * Asserts that the target is neither \`null\` nor \`undefined\`. + * + * var bar = null; + * + * should.not.exist(bar, 'bar does not exist'); + * + * @name not.exist + * @namespace Should + * @api public + */should.not.exist=function(val,msg){new Assertion(val,msg).to.not.exist;};should['throw']=should['Throw'];should.not['throw']=should.not['Throw'];return should;}chai.should=loadShould;chai.Should=loadShould;};/*! + * chai + * Copyright(c) 2011-2014 Jake Luer + * MIT Licensed + */var assert$1=function(chai,util){/*! + * Chai dependencies. + */var Assertion=chai.Assertion,flag=util.flag;/*! + * Module export. + */ /** + * ### assert(expression, message) + * + * Write your own test expressions. + * + * assert('foo' !== 'bar', 'foo is not bar'); + * assert(Array.isArray([]), 'empty arrays are arrays'); + * + * @param {Mixed} expression to test for truthiness + * @param {String} message to display on error + * @name assert + * @namespace Assert + * @api public + */var assert=chai.assert=function(express,errmsg){var test=new Assertion(null,null,chai.assert,true);test.assert(express,errmsg,'[ negation message unavailable ]');};/** + * ### .fail([message]) + * ### .fail(actual, expected, [message], [operator]) + * + * Throw a failure. Node.js \`assert\` module-compatible. + * + * assert.fail(); + * assert.fail("custom error message"); + * assert.fail(1, 2); + * assert.fail(1, 2, "custom error message"); + * assert.fail(1, 2, "custom error message", ">"); + * assert.fail(1, 2, undefined, ">"); + * + * @name fail + * @param {Mixed} actual + * @param {Mixed} expected + * @param {String} message + * @param {String} operator + * @namespace Assert + * @api public + */assert.fail=function(actual,expected,message,operator){if(arguments.length<2){// Comply with Node's fail([message]) interface +message=actual;actual=undefined;}message=message||'assert.fail()';throw new chai.AssertionError(message,{actual:actual,expected:expected,operator:operator},assert.fail);};/** + * ### .isOk(object, [message]) + * + * Asserts that \`object\` is truthy. + * + * assert.isOk('everything', 'everything is ok'); + * assert.isOk(false, 'this will fail'); + * + * @name isOk + * @alias ok + * @param {Mixed} object to test + * @param {String} message + * @namespace Assert + * @api public + */assert.isOk=function(val,msg){new Assertion(val,msg,assert.isOk,true).is.ok;};/** + * ### .isNotOk(object, [message]) + * + * Asserts that \`object\` is falsy. + * + * assert.isNotOk('everything', 'this will fail'); + * assert.isNotOk(false, 'this will pass'); + * + * @name isNotOk + * @alias notOk + * @param {Mixed} object to test + * @param {String} message + * @namespace Assert + * @api public + */assert.isNotOk=function(val,msg){new Assertion(val,msg,assert.isNotOk,true).is.not.ok;};/** + * ### .equal(actual, expected, [message]) + * + * Asserts non-strict equality (\`==\`) of \`actual\` and \`expected\`. + * + * assert.equal(3, '3', '== coerces values to strings'); + * + * @name equal + * @param {Mixed} actual + * @param {Mixed} expected + * @param {String} message + * @namespace Assert + * @api public + */assert.equal=function(act,exp,msg){var test=new Assertion(act,msg,assert.equal,true);test.assert(exp==flag(test,'object'),'expected #{this} to equal #{exp}','expected #{this} to not equal #{act}',exp,act,true);};/** + * ### .notEqual(actual, expected, [message]) + * + * Asserts non-strict inequality (\`!=\`) of \`actual\` and \`expected\`. + * + * assert.notEqual(3, 4, 'these numbers are not equal'); + * + * @name notEqual + * @param {Mixed} actual + * @param {Mixed} expected + * @param {String} message + * @namespace Assert + * @api public + */assert.notEqual=function(act,exp,msg){var test=new Assertion(act,msg,assert.notEqual,true);test.assert(exp!=flag(test,'object'),'expected #{this} to not equal #{exp}','expected #{this} to equal #{act}',exp,act,true);};/** + * ### .strictEqual(actual, expected, [message]) + * + * Asserts strict equality (\`===\`) of \`actual\` and \`expected\`. + * + * assert.strictEqual(true, true, 'these booleans are strictly equal'); + * + * @name strictEqual + * @param {Mixed} actual + * @param {Mixed} expected + * @param {String} message + * @namespace Assert + * @api public + */assert.strictEqual=function(act,exp,msg){new Assertion(act,msg,assert.strictEqual,true).to.equal(exp);};/** + * ### .notStrictEqual(actual, expected, [message]) + * + * Asserts strict inequality (\`!==\`) of \`actual\` and \`expected\`. + * + * assert.notStrictEqual(3, '3', 'no coercion for strict equality'); + * + * @name notStrictEqual + * @param {Mixed} actual + * @param {Mixed} expected + * @param {String} message + * @namespace Assert + * @api public + */assert.notStrictEqual=function(act,exp,msg){new Assertion(act,msg,assert.notStrictEqual,true).to.not.equal(exp);};/** + * ### .deepEqual(actual, expected, [message]) + * + * Asserts that \`actual\` is deeply equal to \`expected\`. + * + * assert.deepEqual({ tea: 'green' }, { tea: 'green' }); + * + * @name deepEqual + * @param {Mixed} actual + * @param {Mixed} expected + * @param {String} message + * @alias deepStrictEqual + * @namespace Assert + * @api public + */assert.deepEqual=assert.deepStrictEqual=function(act,exp,msg){new Assertion(act,msg,assert.deepEqual,true).to.eql(exp);};/** + * ### .notDeepEqual(actual, expected, [message]) + * + * Assert that \`actual\` is not deeply equal to \`expected\`. + * + * assert.notDeepEqual({ tea: 'green' }, { tea: 'jasmine' }); + * + * @name notDeepEqual + * @param {Mixed} actual + * @param {Mixed} expected + * @param {String} message + * @namespace Assert + * @api public + */assert.notDeepEqual=function(act,exp,msg){new Assertion(act,msg,assert.notDeepEqual,true).to.not.eql(exp);};/** + * ### .isAbove(valueToCheck, valueToBeAbove, [message]) + * + * Asserts \`valueToCheck\` is strictly greater than (>) \`valueToBeAbove\`. + * + * assert.isAbove(5, 2, '5 is strictly greater than 2'); + * + * @name isAbove + * @param {Mixed} valueToCheck + * @param {Mixed} valueToBeAbove + * @param {String} message + * @namespace Assert + * @api public + */assert.isAbove=function(val,abv,msg){new Assertion(val,msg,assert.isAbove,true).to.be.above(abv);};/** + * ### .isAtLeast(valueToCheck, valueToBeAtLeast, [message]) + * + * Asserts \`valueToCheck\` is greater than or equal to (>=) \`valueToBeAtLeast\`. + * + * assert.isAtLeast(5, 2, '5 is greater or equal to 2'); + * assert.isAtLeast(3, 3, '3 is greater or equal to 3'); + * + * @name isAtLeast + * @param {Mixed} valueToCheck + * @param {Mixed} valueToBeAtLeast + * @param {String} message + * @namespace Assert + * @api public + */assert.isAtLeast=function(val,atlst,msg){new Assertion(val,msg,assert.isAtLeast,true).to.be.least(atlst);};/** + * ### .isBelow(valueToCheck, valueToBeBelow, [message]) + * + * Asserts \`valueToCheck\` is strictly less than (<) \`valueToBeBelow\`. + * + * assert.isBelow(3, 6, '3 is strictly less than 6'); + * + * @name isBelow + * @param {Mixed} valueToCheck + * @param {Mixed} valueToBeBelow + * @param {String} message + * @namespace Assert + * @api public + */assert.isBelow=function(val,blw,msg){new Assertion(val,msg,assert.isBelow,true).to.be.below(blw);};/** + * ### .isAtMost(valueToCheck, valueToBeAtMost, [message]) + * + * Asserts \`valueToCheck\` is less than or equal to (<=) \`valueToBeAtMost\`. + * + * assert.isAtMost(3, 6, '3 is less than or equal to 6'); + * assert.isAtMost(4, 4, '4 is less than or equal to 4'); + * + * @name isAtMost + * @param {Mixed} valueToCheck + * @param {Mixed} valueToBeAtMost + * @param {String} message + * @namespace Assert + * @api public + */assert.isAtMost=function(val,atmst,msg){new Assertion(val,msg,assert.isAtMost,true).to.be.most(atmst);};/** + * ### .isTrue(value, [message]) + * + * Asserts that \`value\` is true. + * + * var teaServed = true; + * assert.isTrue(teaServed, 'the tea has been served'); + * + * @name isTrue + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isTrue=function(val,msg){new Assertion(val,msg,assert.isTrue,true).is['true'];};/** + * ### .isNotTrue(value, [message]) + * + * Asserts that \`value\` is not true. + * + * var tea = 'tasty chai'; + * assert.isNotTrue(tea, 'great, time for tea!'); + * + * @name isNotTrue + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isNotTrue=function(val,msg){new Assertion(val,msg,assert.isNotTrue,true).to.not.equal(true);};/** + * ### .isFalse(value, [message]) + * + * Asserts that \`value\` is false. + * + * var teaServed = false; + * assert.isFalse(teaServed, 'no tea yet? hmm...'); + * + * @name isFalse + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isFalse=function(val,msg){new Assertion(val,msg,assert.isFalse,true).is['false'];};/** + * ### .isNotFalse(value, [message]) + * + * Asserts that \`value\` is not false. + * + * var tea = 'tasty chai'; + * assert.isNotFalse(tea, 'great, time for tea!'); + * + * @name isNotFalse + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isNotFalse=function(val,msg){new Assertion(val,msg,assert.isNotFalse,true).to.not.equal(false);};/** + * ### .isNull(value, [message]) + * + * Asserts that \`value\` is null. + * + * assert.isNull(err, 'there was no error'); + * + * @name isNull + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isNull=function(val,msg){new Assertion(val,msg,assert.isNull,true).to.equal(null);};/** + * ### .isNotNull(value, [message]) + * + * Asserts that \`value\` is not null. + * + * var tea = 'tasty chai'; + * assert.isNotNull(tea, 'great, time for tea!'); + * + * @name isNotNull + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isNotNull=function(val,msg){new Assertion(val,msg,assert.isNotNull,true).to.not.equal(null);};/** + * ### .isNaN + * + * Asserts that value is NaN. + * + * assert.isNaN(NaN, 'NaN is NaN'); + * + * @name isNaN + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isNaN=function(val,msg){new Assertion(val,msg,assert.isNaN,true).to.be.NaN;};/** + * ### .isNotNaN + * + * Asserts that value is not NaN. + * + * assert.isNotNaN(4, '4 is not NaN'); + * + * @name isNotNaN + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isNotNaN=function(val,msg){new Assertion(val,msg,assert.isNotNaN,true).not.to.be.NaN;};/** + * ### .exists + * + * Asserts that the target is neither \`null\` nor \`undefined\`. + * + * var foo = 'hi'; + * + * assert.exists(foo, 'foo is neither \`null\` nor \`undefined\`'); + * + * @name exists + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.exists=function(val,msg){new Assertion(val,msg,assert.exists,true).to.exist;};/** + * ### .notExists + * + * Asserts that the target is either \`null\` or \`undefined\`. + * + * var bar = null + * , baz; + * + * assert.notExists(bar); + * assert.notExists(baz, 'baz is either null or undefined'); + * + * @name notExists + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.notExists=function(val,msg){new Assertion(val,msg,assert.notExists,true).to.not.exist;};/** + * ### .isUndefined(value, [message]) + * + * Asserts that \`value\` is \`undefined\`. + * + * var tea; + * assert.isUndefined(tea, 'no tea defined'); + * + * @name isUndefined + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isUndefined=function(val,msg){new Assertion(val,msg,assert.isUndefined,true).to.equal(undefined);};/** + * ### .isDefined(value, [message]) + * + * Asserts that \`value\` is not \`undefined\`. + * + * var tea = 'cup of chai'; + * assert.isDefined(tea, 'tea has been defined'); + * + * @name isDefined + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isDefined=function(val,msg){new Assertion(val,msg,assert.isDefined,true).to.not.equal(undefined);};/** + * ### .isFunction(value, [message]) + * + * Asserts that \`value\` is a function. + * + * function serveTea() { return 'cup of tea'; }; + * assert.isFunction(serveTea, 'great, we can have tea now'); + * + * @name isFunction + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isFunction=function(val,msg){new Assertion(val,msg,assert.isFunction,true).to.be.a('function');};/** + * ### .isNotFunction(value, [message]) + * + * Asserts that \`value\` is _not_ a function. + * + * var serveTea = [ 'heat', 'pour', 'sip' ]; + * assert.isNotFunction(serveTea, 'great, we have listed the steps'); + * + * @name isNotFunction + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isNotFunction=function(val,msg){new Assertion(val,msg,assert.isNotFunction,true).to.not.be.a('function');};/** + * ### .isObject(value, [message]) + * + * Asserts that \`value\` is an object of type 'Object' (as revealed by \`Object.prototype.toString\`). + * _The assertion does not match subclassed objects._ + * + * var selection = { name: 'Chai', serve: 'with spices' }; + * assert.isObject(selection, 'tea selection is an object'); + * + * @name isObject + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isObject=function(val,msg){new Assertion(val,msg,assert.isObject,true).to.be.a('object');};/** + * ### .isNotObject(value, [message]) + * + * Asserts that \`value\` is _not_ an object of type 'Object' (as revealed by \`Object.prototype.toString\`). + * + * var selection = 'chai' + * assert.isNotObject(selection, 'tea selection is not an object'); + * assert.isNotObject(null, 'null is not an object'); + * + * @name isNotObject + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isNotObject=function(val,msg){new Assertion(val,msg,assert.isNotObject,true).to.not.be.a('object');};/** + * ### .isArray(value, [message]) + * + * Asserts that \`value\` is an array. + * + * var menu = [ 'green', 'chai', 'oolong' ]; + * assert.isArray(menu, 'what kind of tea do we want?'); + * + * @name isArray + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isArray=function(val,msg){new Assertion(val,msg,assert.isArray,true).to.be.an('array');};/** + * ### .isNotArray(value, [message]) + * + * Asserts that \`value\` is _not_ an array. + * + * var menu = 'green|chai|oolong'; + * assert.isNotArray(menu, 'what kind of tea do we want?'); + * + * @name isNotArray + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isNotArray=function(val,msg){new Assertion(val,msg,assert.isNotArray,true).to.not.be.an('array');};/** + * ### .isString(value, [message]) + * + * Asserts that \`value\` is a string. + * + * var teaOrder = 'chai'; + * assert.isString(teaOrder, 'order placed'); + * + * @name isString + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isString=function(val,msg){new Assertion(val,msg,assert.isString,true).to.be.a('string');};/** + * ### .isNotString(value, [message]) + * + * Asserts that \`value\` is _not_ a string. + * + * var teaOrder = 4; + * assert.isNotString(teaOrder, 'order placed'); + * + * @name isNotString + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isNotString=function(val,msg){new Assertion(val,msg,assert.isNotString,true).to.not.be.a('string');};/** + * ### .isNumber(value, [message]) + * + * Asserts that \`value\` is a number. + * + * var cups = 2; + * assert.isNumber(cups, 'how many cups'); + * + * @name isNumber + * @param {Number} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isNumber=function(val,msg){new Assertion(val,msg,assert.isNumber,true).to.be.a('number');};/** + * ### .isNotNumber(value, [message]) + * + * Asserts that \`value\` is _not_ a number. + * + * var cups = '2 cups please'; + * assert.isNotNumber(cups, 'how many cups'); + * + * @name isNotNumber + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isNotNumber=function(val,msg){new Assertion(val,msg,assert.isNotNumber,true).to.not.be.a('number');};/** + * ### .isFinite(value, [message]) + * + * Asserts that \`value\` is a finite number. Unlike \`.isNumber\`, this will fail for \`NaN\` and \`Infinity\`. + * + * var cups = 2; + * assert.isFinite(cups, 'how many cups'); + * + * assert.isFinite(NaN); // throws + * + * @name isFinite + * @param {Number} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isFinite=function(val,msg){new Assertion(val,msg,assert.isFinite,true).to.be.finite;};/** + * ### .isBoolean(value, [message]) + * + * Asserts that \`value\` is a boolean. + * + * var teaReady = true + * , teaServed = false; + * + * assert.isBoolean(teaReady, 'is the tea ready'); + * assert.isBoolean(teaServed, 'has tea been served'); + * + * @name isBoolean + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isBoolean=function(val,msg){new Assertion(val,msg,assert.isBoolean,true).to.be.a('boolean');};/** + * ### .isNotBoolean(value, [message]) + * + * Asserts that \`value\` is _not_ a boolean. + * + * var teaReady = 'yep' + * , teaServed = 'nope'; + * + * assert.isNotBoolean(teaReady, 'is the tea ready'); + * assert.isNotBoolean(teaServed, 'has tea been served'); + * + * @name isNotBoolean + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.isNotBoolean=function(val,msg){new Assertion(val,msg,assert.isNotBoolean,true).to.not.be.a('boolean');};/** + * ### .typeOf(value, name, [message]) + * + * Asserts that \`value\`'s type is \`name\`, as determined by + * \`Object.prototype.toString\`. + * + * assert.typeOf({ tea: 'chai' }, 'object', 'we have an object'); + * assert.typeOf(['chai', 'jasmine'], 'array', 'we have an array'); + * assert.typeOf('tea', 'string', 'we have a string'); + * assert.typeOf(/tea/, 'regexp', 'we have a regular expression'); + * assert.typeOf(null, 'null', 'we have a null'); + * assert.typeOf(undefined, 'undefined', 'we have an undefined'); + * + * @name typeOf + * @param {Mixed} value + * @param {String} name + * @param {String} message + * @namespace Assert + * @api public + */assert.typeOf=function(val,type,msg){new Assertion(val,msg,assert.typeOf,true).to.be.a(type);};/** + * ### .notTypeOf(value, name, [message]) + * + * Asserts that \`value\`'s type is _not_ \`name\`, as determined by + * \`Object.prototype.toString\`. + * + * assert.notTypeOf('tea', 'number', 'strings are not numbers'); + * + * @name notTypeOf + * @param {Mixed} value + * @param {String} typeof name + * @param {String} message + * @namespace Assert + * @api public + */assert.notTypeOf=function(val,type,msg){new Assertion(val,msg,assert.notTypeOf,true).to.not.be.a(type);};/** + * ### .instanceOf(object, constructor, [message]) + * + * Asserts that \`value\` is an instance of \`constructor\`. + * + * var Tea = function (name) { this.name = name; } + * , chai = new Tea('chai'); + * + * assert.instanceOf(chai, Tea, 'chai is an instance of tea'); + * + * @name instanceOf + * @param {Object} object + * @param {Constructor} constructor + * @param {String} message + * @namespace Assert + * @api public + */assert.instanceOf=function(val,type,msg){new Assertion(val,msg,assert.instanceOf,true).to.be.instanceOf(type);};/** + * ### .notInstanceOf(object, constructor, [message]) + * + * Asserts \`value\` is not an instance of \`constructor\`. + * + * var Tea = function (name) { this.name = name; } + * , chai = new String('chai'); + * + * assert.notInstanceOf(chai, Tea, 'chai is not an instance of tea'); + * + * @name notInstanceOf + * @param {Object} object + * @param {Constructor} constructor + * @param {String} message + * @namespace Assert + * @api public + */assert.notInstanceOf=function(val,type,msg){new Assertion(val,msg,assert.notInstanceOf,true).to.not.be.instanceOf(type);};/** + * ### .include(haystack, needle, [message]) + * + * Asserts that \`haystack\` includes \`needle\`. Can be used to assert the + * inclusion of a value in an array, a substring in a string, or a subset of + * properties in an object. + * + * assert.include([1,2,3], 2, 'array contains value'); + * assert.include('foobar', 'foo', 'string contains substring'); + * assert.include({ foo: 'bar', hello: 'universe' }, { foo: 'bar' }, 'object contains property'); + * + * Strict equality (===) is used. When asserting the inclusion of a value in + * an array, the array is searched for an element that's strictly equal to the + * given value. When asserting a subset of properties in an object, the object + * is searched for the given property keys, checking that each one is present + * and strictly equal to the given property value. For instance: + * + * var obj1 = {a: 1} + * , obj2 = {b: 2}; + * assert.include([obj1, obj2], obj1); + * assert.include({foo: obj1, bar: obj2}, {foo: obj1}); + * assert.include({foo: obj1, bar: obj2}, {foo: obj1, bar: obj2}); + * + * @name include + * @param {Array|String} haystack + * @param {Mixed} needle + * @param {String} message + * @namespace Assert + * @api public + */assert.include=function(exp,inc,msg){new Assertion(exp,msg,assert.include,true).include(inc);};/** + * ### .notInclude(haystack, needle, [message]) + * + * Asserts that \`haystack\` does not include \`needle\`. Can be used to assert + * the absence of a value in an array, a substring in a string, or a subset of + * properties in an object. + * + * assert.notInclude([1,2,3], 4, "array doesn't contain value"); + * assert.notInclude('foobar', 'baz', "string doesn't contain substring"); + * assert.notInclude({ foo: 'bar', hello: 'universe' }, { foo: 'baz' }, 'object doesn't contain property'); + * + * Strict equality (===) is used. When asserting the absence of a value in an + * array, the array is searched to confirm the absence of an element that's + * strictly equal to the given value. When asserting a subset of properties in + * an object, the object is searched to confirm that at least one of the given + * property keys is either not present or not strictly equal to the given + * property value. For instance: + * + * var obj1 = {a: 1} + * , obj2 = {b: 2}; + * assert.notInclude([obj1, obj2], {a: 1}); + * assert.notInclude({foo: obj1, bar: obj2}, {foo: {a: 1}}); + * assert.notInclude({foo: obj1, bar: obj2}, {foo: obj1, bar: {b: 2}}); + * + * @name notInclude + * @param {Array|String} haystack + * @param {Mixed} needle + * @param {String} message + * @namespace Assert + * @api public + */assert.notInclude=function(exp,inc,msg){new Assertion(exp,msg,assert.notInclude,true).not.include(inc);};/** + * ### .deepInclude(haystack, needle, [message]) + * + * Asserts that \`haystack\` includes \`needle\`. Can be used to assert the + * inclusion of a value in an array or a subset of properties in an object. + * Deep equality is used. + * + * var obj1 = {a: 1} + * , obj2 = {b: 2}; + * assert.deepInclude([obj1, obj2], {a: 1}); + * assert.deepInclude({foo: obj1, bar: obj2}, {foo: {a: 1}}); + * assert.deepInclude({foo: obj1, bar: obj2}, {foo: {a: 1}, bar: {b: 2}}); + * + * @name deepInclude + * @param {Array|String} haystack + * @param {Mixed} needle + * @param {String} message + * @namespace Assert + * @api public + */assert.deepInclude=function(exp,inc,msg){new Assertion(exp,msg,assert.deepInclude,true).deep.include(inc);};/** + * ### .notDeepInclude(haystack, needle, [message]) + * + * Asserts that \`haystack\` does not include \`needle\`. Can be used to assert + * the absence of a value in an array or a subset of properties in an object. + * Deep equality is used. + * + * var obj1 = {a: 1} + * , obj2 = {b: 2}; + * assert.notDeepInclude([obj1, obj2], {a: 9}); + * assert.notDeepInclude({foo: obj1, bar: obj2}, {foo: {a: 9}}); + * assert.notDeepInclude({foo: obj1, bar: obj2}, {foo: {a: 1}, bar: {b: 9}}); + * + * @name notDeepInclude + * @param {Array|String} haystack + * @param {Mixed} needle + * @param {String} message + * @namespace Assert + * @api public + */assert.notDeepInclude=function(exp,inc,msg){new Assertion(exp,msg,assert.notDeepInclude,true).not.deep.include(inc);};/** + * ### .nestedInclude(haystack, needle, [message]) + * + * Asserts that 'haystack' includes 'needle'. + * Can be used to assert the inclusion of a subset of properties in an + * object. + * Enables the use of dot- and bracket-notation for referencing nested + * properties. + * '[]' and '.' in property names can be escaped using double backslashes. + * + * assert.nestedInclude({'.a': {'b': 'x'}}, {'\\\\.a.[b]': 'x'}); + * assert.nestedInclude({'a': {'[b]': 'x'}}, {'a.\\\\[b\\\\]': 'x'}); + * + * @name nestedInclude + * @param {Object} haystack + * @param {Object} needle + * @param {String} message + * @namespace Assert + * @api public + */assert.nestedInclude=function(exp,inc,msg){new Assertion(exp,msg,assert.nestedInclude,true).nested.include(inc);};/** + * ### .notNestedInclude(haystack, needle, [message]) + * + * Asserts that 'haystack' does not include 'needle'. + * Can be used to assert the absence of a subset of properties in an + * object. + * Enables the use of dot- and bracket-notation for referencing nested + * properties. + * '[]' and '.' in property names can be escaped using double backslashes. + * + * assert.notNestedInclude({'.a': {'b': 'x'}}, {'\\\\.a.b': 'y'}); + * assert.notNestedInclude({'a': {'[b]': 'x'}}, {'a.\\\\[b\\\\]': 'y'}); + * + * @name notNestedInclude + * @param {Object} haystack + * @param {Object} needle + * @param {String} message + * @namespace Assert + * @api public + */assert.notNestedInclude=function(exp,inc,msg){new Assertion(exp,msg,assert.notNestedInclude,true).not.nested.include(inc);};/** + * ### .deepNestedInclude(haystack, needle, [message]) + * + * Asserts that 'haystack' includes 'needle'. + * Can be used to assert the inclusion of a subset of properties in an + * object while checking for deep equality. + * Enables the use of dot- and bracket-notation for referencing nested + * properties. + * '[]' and '.' in property names can be escaped using double backslashes. + * + * assert.deepNestedInclude({a: {b: [{x: 1}]}}, {'a.b[0]': {x: 1}}); + * assert.deepNestedInclude({'.a': {'[b]': {x: 1}}}, {'\\\\.a.\\\\[b\\\\]': {x: 1}}); + * + * @name deepNestedInclude + * @param {Object} haystack + * @param {Object} needle + * @param {String} message + * @namespace Assert + * @api public + */assert.deepNestedInclude=function(exp,inc,msg){new Assertion(exp,msg,assert.deepNestedInclude,true).deep.nested.include(inc);};/** + * ### .notDeepNestedInclude(haystack, needle, [message]) + * + * Asserts that 'haystack' does not include 'needle'. + * Can be used to assert the absence of a subset of properties in an + * object while checking for deep equality. + * Enables the use of dot- and bracket-notation for referencing nested + * properties. + * '[]' and '.' in property names can be escaped using double backslashes. + * + * assert.notDeepNestedInclude({a: {b: [{x: 1}]}}, {'a.b[0]': {y: 1}}) + * assert.notDeepNestedInclude({'.a': {'[b]': {x: 1}}}, {'\\\\.a.\\\\[b\\\\]': {y: 2}}); + * + * @name notDeepNestedInclude + * @param {Object} haystack + * @param {Object} needle + * @param {String} message + * @namespace Assert + * @api public + */assert.notDeepNestedInclude=function(exp,inc,msg){new Assertion(exp,msg,assert.notDeepNestedInclude,true).not.deep.nested.include(inc);};/** + * ### .ownInclude(haystack, needle, [message]) + * + * Asserts that 'haystack' includes 'needle'. + * Can be used to assert the inclusion of a subset of properties in an + * object while ignoring inherited properties. + * + * assert.ownInclude({ a: 1 }, { a: 1 }); + * + * @name ownInclude + * @param {Object} haystack + * @param {Object} needle + * @param {String} message + * @namespace Assert + * @api public + */assert.ownInclude=function(exp,inc,msg){new Assertion(exp,msg,assert.ownInclude,true).own.include(inc);};/** + * ### .notOwnInclude(haystack, needle, [message]) + * + * Asserts that 'haystack' includes 'needle'. + * Can be used to assert the absence of a subset of properties in an + * object while ignoring inherited properties. + * + * Object.prototype.b = 2; + * + * assert.notOwnInclude({ a: 1 }, { b: 2 }); + * + * @name notOwnInclude + * @param {Object} haystack + * @param {Object} needle + * @param {String} message + * @namespace Assert + * @api public + */assert.notOwnInclude=function(exp,inc,msg){new Assertion(exp,msg,assert.notOwnInclude,true).not.own.include(inc);};/** + * ### .deepOwnInclude(haystack, needle, [message]) + * + * Asserts that 'haystack' includes 'needle'. + * Can be used to assert the inclusion of a subset of properties in an + * object while ignoring inherited properties and checking for deep equality. + * + * assert.deepOwnInclude({a: {b: 2}}, {a: {b: 2}}); + * + * @name deepOwnInclude + * @param {Object} haystack + * @param {Object} needle + * @param {String} message + * @namespace Assert + * @api public + */assert.deepOwnInclude=function(exp,inc,msg){new Assertion(exp,msg,assert.deepOwnInclude,true).deep.own.include(inc);};/** + * ### .notDeepOwnInclude(haystack, needle, [message]) + * + * Asserts that 'haystack' includes 'needle'. + * Can be used to assert the absence of a subset of properties in an + * object while ignoring inherited properties and checking for deep equality. + * + * assert.notDeepOwnInclude({a: {b: 2}}, {a: {c: 3}}); + * + * @name notDeepOwnInclude + * @param {Object} haystack + * @param {Object} needle + * @param {String} message + * @namespace Assert + * @api public + */assert.notDeepOwnInclude=function(exp,inc,msg){new Assertion(exp,msg,assert.notDeepOwnInclude,true).not.deep.own.include(inc);};/** + * ### .match(value, regexp, [message]) + * + * Asserts that \`value\` matches the regular expression \`regexp\`. + * + * assert.match('foobar', /^foo/, 'regexp matches'); + * + * @name match + * @param {Mixed} value + * @param {RegExp} regexp + * @param {String} message + * @namespace Assert + * @api public + */assert.match=function(exp,re,msg){new Assertion(exp,msg,assert.match,true).to.match(re);};/** + * ### .notMatch(value, regexp, [message]) + * + * Asserts that \`value\` does not match the regular expression \`regexp\`. + * + * assert.notMatch('foobar', /^foo/, 'regexp does not match'); + * + * @name notMatch + * @param {Mixed} value + * @param {RegExp} regexp + * @param {String} message + * @namespace Assert + * @api public + */assert.notMatch=function(exp,re,msg){new Assertion(exp,msg,assert.notMatch,true).to.not.match(re);};/** + * ### .property(object, property, [message]) + * + * Asserts that \`object\` has a direct or inherited property named by + * \`property\`. + * + * assert.property({ tea: { green: 'matcha' }}, 'tea'); + * assert.property({ tea: { green: 'matcha' }}, 'toString'); + * + * @name property + * @param {Object} object + * @param {String} property + * @param {String} message + * @namespace Assert + * @api public + */assert.property=function(obj,prop,msg){new Assertion(obj,msg,assert.property,true).to.have.property(prop);};/** + * ### .notProperty(object, property, [message]) + * + * Asserts that \`object\` does _not_ have a direct or inherited property named + * by \`property\`. + * + * assert.notProperty({ tea: { green: 'matcha' }}, 'coffee'); + * + * @name notProperty + * @param {Object} object + * @param {String} property + * @param {String} message + * @namespace Assert + * @api public + */assert.notProperty=function(obj,prop,msg){new Assertion(obj,msg,assert.notProperty,true).to.not.have.property(prop);};/** + * ### .propertyVal(object, property, value, [message]) + * + * Asserts that \`object\` has a direct or inherited property named by + * \`property\` with a value given by \`value\`. Uses a strict equality check + * (===). + * + * assert.propertyVal({ tea: 'is good' }, 'tea', 'is good'); + * + * @name propertyVal + * @param {Object} object + * @param {String} property + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.propertyVal=function(obj,prop,val,msg){new Assertion(obj,msg,assert.propertyVal,true).to.have.property(prop,val);};/** + * ### .notPropertyVal(object, property, value, [message]) + * + * Asserts that \`object\` does _not_ have a direct or inherited property named + * by \`property\` with value given by \`value\`. Uses a strict equality check + * (===). + * + * assert.notPropertyVal({ tea: 'is good' }, 'tea', 'is bad'); + * assert.notPropertyVal({ tea: 'is good' }, 'coffee', 'is good'); + * + * @name notPropertyVal + * @param {Object} object + * @param {String} property + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.notPropertyVal=function(obj,prop,val,msg){new Assertion(obj,msg,assert.notPropertyVal,true).to.not.have.property(prop,val);};/** + * ### .deepPropertyVal(object, property, value, [message]) + * + * Asserts that \`object\` has a direct or inherited property named by + * \`property\` with a value given by \`value\`. Uses a deep equality check. + * + * assert.deepPropertyVal({ tea: { green: 'matcha' } }, 'tea', { green: 'matcha' }); + * + * @name deepPropertyVal + * @param {Object} object + * @param {String} property + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.deepPropertyVal=function(obj,prop,val,msg){new Assertion(obj,msg,assert.deepPropertyVal,true).to.have.deep.property(prop,val);};/** + * ### .notDeepPropertyVal(object, property, value, [message]) + * + * Asserts that \`object\` does _not_ have a direct or inherited property named + * by \`property\` with value given by \`value\`. Uses a deep equality check. + * + * assert.notDeepPropertyVal({ tea: { green: 'matcha' } }, 'tea', { black: 'matcha' }); + * assert.notDeepPropertyVal({ tea: { green: 'matcha' } }, 'tea', { green: 'oolong' }); + * assert.notDeepPropertyVal({ tea: { green: 'matcha' } }, 'coffee', { green: 'matcha' }); + * + * @name notDeepPropertyVal + * @param {Object} object + * @param {String} property + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.notDeepPropertyVal=function(obj,prop,val,msg){new Assertion(obj,msg,assert.notDeepPropertyVal,true).to.not.have.deep.property(prop,val);};/** + * ### .ownProperty(object, property, [message]) + * + * Asserts that \`object\` has a direct property named by \`property\`. Inherited + * properties aren't checked. + * + * assert.ownProperty({ tea: { green: 'matcha' }}, 'tea'); + * + * @name ownProperty + * @param {Object} object + * @param {String} property + * @param {String} message + * @api public + */assert.ownProperty=function(obj,prop,msg){new Assertion(obj,msg,assert.ownProperty,true).to.have.own.property(prop);};/** + * ### .notOwnProperty(object, property, [message]) + * + * Asserts that \`object\` does _not_ have a direct property named by + * \`property\`. Inherited properties aren't checked. + * + * assert.notOwnProperty({ tea: { green: 'matcha' }}, 'coffee'); + * assert.notOwnProperty({}, 'toString'); + * + * @name notOwnProperty + * @param {Object} object + * @param {String} property + * @param {String} message + * @api public + */assert.notOwnProperty=function(obj,prop,msg){new Assertion(obj,msg,assert.notOwnProperty,true).to.not.have.own.property(prop);};/** + * ### .ownPropertyVal(object, property, value, [message]) + * + * Asserts that \`object\` has a direct property named by \`property\` and a value + * equal to the provided \`value\`. Uses a strict equality check (===). + * Inherited properties aren't checked. + * + * assert.ownPropertyVal({ coffee: 'is good'}, 'coffee', 'is good'); + * + * @name ownPropertyVal + * @param {Object} object + * @param {String} property + * @param {Mixed} value + * @param {String} message + * @api public + */assert.ownPropertyVal=function(obj,prop,value,msg){new Assertion(obj,msg,assert.ownPropertyVal,true).to.have.own.property(prop,value);};/** + * ### .notOwnPropertyVal(object, property, value, [message]) + * + * Asserts that \`object\` does _not_ have a direct property named by \`property\` + * with a value equal to the provided \`value\`. Uses a strict equality check + * (===). Inherited properties aren't checked. + * + * assert.notOwnPropertyVal({ tea: 'is better'}, 'tea', 'is worse'); + * assert.notOwnPropertyVal({}, 'toString', Object.prototype.toString); + * + * @name notOwnPropertyVal + * @param {Object} object + * @param {String} property + * @param {Mixed} value + * @param {String} message + * @api public + */assert.notOwnPropertyVal=function(obj,prop,value,msg){new Assertion(obj,msg,assert.notOwnPropertyVal,true).to.not.have.own.property(prop,value);};/** + * ### .deepOwnPropertyVal(object, property, value, [message]) + * + * Asserts that \`object\` has a direct property named by \`property\` and a value + * equal to the provided \`value\`. Uses a deep equality check. Inherited + * properties aren't checked. + * + * assert.deepOwnPropertyVal({ tea: { green: 'matcha' } }, 'tea', { green: 'matcha' }); + * + * @name deepOwnPropertyVal + * @param {Object} object + * @param {String} property + * @param {Mixed} value + * @param {String} message + * @api public + */assert.deepOwnPropertyVal=function(obj,prop,value,msg){new Assertion(obj,msg,assert.deepOwnPropertyVal,true).to.have.deep.own.property(prop,value);};/** + * ### .notDeepOwnPropertyVal(object, property, value, [message]) + * + * Asserts that \`object\` does _not_ have a direct property named by \`property\` + * with a value equal to the provided \`value\`. Uses a deep equality check. + * Inherited properties aren't checked. + * + * assert.notDeepOwnPropertyVal({ tea: { green: 'matcha' } }, 'tea', { black: 'matcha' }); + * assert.notDeepOwnPropertyVal({ tea: { green: 'matcha' } }, 'tea', { green: 'oolong' }); + * assert.notDeepOwnPropertyVal({ tea: { green: 'matcha' } }, 'coffee', { green: 'matcha' }); + * assert.notDeepOwnPropertyVal({}, 'toString', Object.prototype.toString); + * + * @name notDeepOwnPropertyVal + * @param {Object} object + * @param {String} property + * @param {Mixed} value + * @param {String} message + * @api public + */assert.notDeepOwnPropertyVal=function(obj,prop,value,msg){new Assertion(obj,msg,assert.notDeepOwnPropertyVal,true).to.not.have.deep.own.property(prop,value);};/** + * ### .nestedProperty(object, property, [message]) + * + * Asserts that \`object\` has a direct or inherited property named by + * \`property\`, which can be a string using dot- and bracket-notation for + * nested reference. + * + * assert.nestedProperty({ tea: { green: 'matcha' }}, 'tea.green'); + * + * @name nestedProperty + * @param {Object} object + * @param {String} property + * @param {String} message + * @namespace Assert + * @api public + */assert.nestedProperty=function(obj,prop,msg){new Assertion(obj,msg,assert.nestedProperty,true).to.have.nested.property(prop);};/** + * ### .notNestedProperty(object, property, [message]) + * + * Asserts that \`object\` does _not_ have a property named by \`property\`, which + * can be a string using dot- and bracket-notation for nested reference. The + * property cannot exist on the object nor anywhere in its prototype chain. + * + * assert.notNestedProperty({ tea: { green: 'matcha' }}, 'tea.oolong'); + * + * @name notNestedProperty + * @param {Object} object + * @param {String} property + * @param {String} message + * @namespace Assert + * @api public + */assert.notNestedProperty=function(obj,prop,msg){new Assertion(obj,msg,assert.notNestedProperty,true).to.not.have.nested.property(prop);};/** + * ### .nestedPropertyVal(object, property, value, [message]) + * + * Asserts that \`object\` has a property named by \`property\` with value given + * by \`value\`. \`property\` can use dot- and bracket-notation for nested + * reference. Uses a strict equality check (===). + * + * assert.nestedPropertyVal({ tea: { green: 'matcha' }}, 'tea.green', 'matcha'); + * + * @name nestedPropertyVal + * @param {Object} object + * @param {String} property + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.nestedPropertyVal=function(obj,prop,val,msg){new Assertion(obj,msg,assert.nestedPropertyVal,true).to.have.nested.property(prop,val);};/** + * ### .notNestedPropertyVal(object, property, value, [message]) + * + * Asserts that \`object\` does _not_ have a property named by \`property\` with + * value given by \`value\`. \`property\` can use dot- and bracket-notation for + * nested reference. Uses a strict equality check (===). + * + * assert.notNestedPropertyVal({ tea: { green: 'matcha' }}, 'tea.green', 'konacha'); + * assert.notNestedPropertyVal({ tea: { green: 'matcha' }}, 'coffee.green', 'matcha'); + * + * @name notNestedPropertyVal + * @param {Object} object + * @param {String} property + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.notNestedPropertyVal=function(obj,prop,val,msg){new Assertion(obj,msg,assert.notNestedPropertyVal,true).to.not.have.nested.property(prop,val);};/** + * ### .deepNestedPropertyVal(object, property, value, [message]) + * + * Asserts that \`object\` has a property named by \`property\` with a value given + * by \`value\`. \`property\` can use dot- and bracket-notation for nested + * reference. Uses a deep equality check. + * + * assert.deepNestedPropertyVal({ tea: { green: { matcha: 'yum' } } }, 'tea.green', { matcha: 'yum' }); + * + * @name deepNestedPropertyVal + * @param {Object} object + * @param {String} property + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.deepNestedPropertyVal=function(obj,prop,val,msg){new Assertion(obj,msg,assert.deepNestedPropertyVal,true).to.have.deep.nested.property(prop,val);};/** + * ### .notDeepNestedPropertyVal(object, property, value, [message]) + * + * Asserts that \`object\` does _not_ have a property named by \`property\` with + * value given by \`value\`. \`property\` can use dot- and bracket-notation for + * nested reference. Uses a deep equality check. + * + * assert.notDeepNestedPropertyVal({ tea: { green: { matcha: 'yum' } } }, 'tea.green', { oolong: 'yum' }); + * assert.notDeepNestedPropertyVal({ tea: { green: { matcha: 'yum' } } }, 'tea.green', { matcha: 'yuck' }); + * assert.notDeepNestedPropertyVal({ tea: { green: { matcha: 'yum' } } }, 'tea.black', { matcha: 'yum' }); + * + * @name notDeepNestedPropertyVal + * @param {Object} object + * @param {String} property + * @param {Mixed} value + * @param {String} message + * @namespace Assert + * @api public + */assert.notDeepNestedPropertyVal=function(obj,prop,val,msg){new Assertion(obj,msg,assert.notDeepNestedPropertyVal,true).to.not.have.deep.nested.property(prop,val);};/** + * ### .lengthOf(object, length, [message]) + * + * Asserts that \`object\` has a \`length\` or \`size\` with the expected value. + * + * assert.lengthOf([1,2,3], 3, 'array has length of 3'); + * assert.lengthOf('foobar', 6, 'string has length of 6'); + * assert.lengthOf(new Set([1,2,3]), 3, 'set has size of 3'); + * assert.lengthOf(new Map([['a',1],['b',2],['c',3]]), 3, 'map has size of 3'); + * + * @name lengthOf + * @param {Mixed} object + * @param {Number} length + * @param {String} message + * @namespace Assert + * @api public + */assert.lengthOf=function(exp,len,msg){new Assertion(exp,msg,assert.lengthOf,true).to.have.lengthOf(len);};/** + * ### .hasAnyKeys(object, [keys], [message]) + * + * Asserts that \`object\` has at least one of the \`keys\` provided. + * You can also provide a single object instead of a \`keys\` array and its keys + * will be used as the expected set of keys. + * + * assert.hasAnyKeys({foo: 1, bar: 2, baz: 3}, ['foo', 'iDontExist', 'baz']); + * assert.hasAnyKeys({foo: 1, bar: 2, baz: 3}, {foo: 30, iDontExist: 99, baz: 1337}); + * assert.hasAnyKeys(new Map([[{foo: 1}, 'bar'], ['key', 'value']]), [{foo: 1}, 'key']); + * assert.hasAnyKeys(new Set([{foo: 'bar'}, 'anotherKey']), [{foo: 'bar'}, 'anotherKey']); + * + * @name hasAnyKeys + * @param {Mixed} object + * @param {Array|Object} keys + * @param {String} message + * @namespace Assert + * @api public + */assert.hasAnyKeys=function(obj,keys,msg){new Assertion(obj,msg,assert.hasAnyKeys,true).to.have.any.keys(keys);};/** + * ### .hasAllKeys(object, [keys], [message]) + * + * Asserts that \`object\` has all and only all of the \`keys\` provided. + * You can also provide a single object instead of a \`keys\` array and its keys + * will be used as the expected set of keys. + * + * assert.hasAllKeys({foo: 1, bar: 2, baz: 3}, ['foo', 'bar', 'baz']); + * assert.hasAllKeys({foo: 1, bar: 2, baz: 3}, {foo: 30, bar: 99, baz: 1337]); + * assert.hasAllKeys(new Map([[{foo: 1}, 'bar'], ['key', 'value']]), [{foo: 1}, 'key']); + * assert.hasAllKeys(new Set([{foo: 'bar'}, 'anotherKey'], [{foo: 'bar'}, 'anotherKey']); + * + * @name hasAllKeys + * @param {Mixed} object + * @param {String[]} keys + * @param {String} message + * @namespace Assert + * @api public + */assert.hasAllKeys=function(obj,keys,msg){new Assertion(obj,msg,assert.hasAllKeys,true).to.have.all.keys(keys);};/** + * ### .containsAllKeys(object, [keys], [message]) + * + * Asserts that \`object\` has all of the \`keys\` provided but may have more keys not listed. + * You can also provide a single object instead of a \`keys\` array and its keys + * will be used as the expected set of keys. + * + * assert.containsAllKeys({foo: 1, bar: 2, baz: 3}, ['foo', 'baz']); + * assert.containsAllKeys({foo: 1, bar: 2, baz: 3}, ['foo', 'bar', 'baz']); + * assert.containsAllKeys({foo: 1, bar: 2, baz: 3}, {foo: 30, baz: 1337}); + * assert.containsAllKeys({foo: 1, bar: 2, baz: 3}, {foo: 30, bar: 99, baz: 1337}); + * assert.containsAllKeys(new Map([[{foo: 1}, 'bar'], ['key', 'value']]), [{foo: 1}]); + * assert.containsAllKeys(new Map([[{foo: 1}, 'bar'], ['key', 'value']]), [{foo: 1}, 'key']); + * assert.containsAllKeys(new Set([{foo: 'bar'}, 'anotherKey'], [{foo: 'bar'}]); + * assert.containsAllKeys(new Set([{foo: 'bar'}, 'anotherKey'], [{foo: 'bar'}, 'anotherKey']); + * + * @name containsAllKeys + * @param {Mixed} object + * @param {String[]} keys + * @param {String} message + * @namespace Assert + * @api public + */assert.containsAllKeys=function(obj,keys,msg){new Assertion(obj,msg,assert.containsAllKeys,true).to.contain.all.keys(keys);};/** + * ### .doesNotHaveAnyKeys(object, [keys], [message]) + * + * Asserts that \`object\` has none of the \`keys\` provided. + * You can also provide a single object instead of a \`keys\` array and its keys + * will be used as the expected set of keys. + * + * assert.doesNotHaveAnyKeys({foo: 1, bar: 2, baz: 3}, ['one', 'two', 'example']); + * assert.doesNotHaveAnyKeys({foo: 1, bar: 2, baz: 3}, {one: 1, two: 2, example: 'foo'}); + * assert.doesNotHaveAnyKeys(new Map([[{foo: 1}, 'bar'], ['key', 'value']]), [{one: 'two'}, 'example']); + * assert.doesNotHaveAnyKeys(new Set([{foo: 'bar'}, 'anotherKey'], [{one: 'two'}, 'example']); + * + * @name doesNotHaveAnyKeys + * @param {Mixed} object + * @param {String[]} keys + * @param {String} message + * @namespace Assert + * @api public + */assert.doesNotHaveAnyKeys=function(obj,keys,msg){new Assertion(obj,msg,assert.doesNotHaveAnyKeys,true).to.not.have.any.keys(keys);};/** + * ### .doesNotHaveAllKeys(object, [keys], [message]) + * + * Asserts that \`object\` does not have at least one of the \`keys\` provided. + * You can also provide a single object instead of a \`keys\` array and its keys + * will be used as the expected set of keys. + * + * assert.doesNotHaveAllKeys({foo: 1, bar: 2, baz: 3}, ['one', 'two', 'example']); + * assert.doesNotHaveAllKeys({foo: 1, bar: 2, baz: 3}, {one: 1, two: 2, example: 'foo'}); + * assert.doesNotHaveAllKeys(new Map([[{foo: 1}, 'bar'], ['key', 'value']]), [{one: 'two'}, 'example']); + * assert.doesNotHaveAllKeys(new Set([{foo: 'bar'}, 'anotherKey'], [{one: 'two'}, 'example']); + * + * @name doesNotHaveAllKeys + * @param {Mixed} object + * @param {String[]} keys + * @param {String} message + * @namespace Assert + * @api public + */assert.doesNotHaveAllKeys=function(obj,keys,msg){new Assertion(obj,msg,assert.doesNotHaveAllKeys,true).to.not.have.all.keys(keys);};/** + * ### .hasAnyDeepKeys(object, [keys], [message]) + * + * Asserts that \`object\` has at least one of the \`keys\` provided. + * Since Sets and Maps can have objects as keys you can use this assertion to perform + * a deep comparison. + * You can also provide a single object instead of a \`keys\` array and its keys + * will be used as the expected set of keys. + * + * assert.hasAnyDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [1, 2]]), {one: 'one'}); + * assert.hasAnyDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [1, 2]]), [{one: 'one'}, {two: 'two'}]); + * assert.hasAnyDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [{two: 'two'}, 'valueTwo']]), [{one: 'one'}, {two: 'two'}]); + * assert.hasAnyDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), {one: 'one'}); + * assert.hasAnyDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {three: 'three'}]); + * assert.hasAnyDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {two: 'two'}]); + * + * @name hasAnyDeepKeys + * @param {Mixed} object + * @param {Array|Object} keys + * @param {String} message + * @namespace Assert + * @api public + */assert.hasAnyDeepKeys=function(obj,keys,msg){new Assertion(obj,msg,assert.hasAnyDeepKeys,true).to.have.any.deep.keys(keys);};/** + * ### .hasAllDeepKeys(object, [keys], [message]) + * + * Asserts that \`object\` has all and only all of the \`keys\` provided. + * Since Sets and Maps can have objects as keys you can use this assertion to perform + * a deep comparison. + * You can also provide a single object instead of a \`keys\` array and its keys + * will be used as the expected set of keys. + * + * assert.hasAllDeepKeys(new Map([[{one: 'one'}, 'valueOne']]), {one: 'one'}); + * assert.hasAllDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [{two: 'two'}, 'valueTwo']]), [{one: 'one'}, {two: 'two'}]); + * assert.hasAllDeepKeys(new Set([{one: 'one'}]), {one: 'one'}); + * assert.hasAllDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {two: 'two'}]); + * + * @name hasAllDeepKeys + * @param {Mixed} object + * @param {Array|Object} keys + * @param {String} message + * @namespace Assert + * @api public + */assert.hasAllDeepKeys=function(obj,keys,msg){new Assertion(obj,msg,assert.hasAllDeepKeys,true).to.have.all.deep.keys(keys);};/** + * ### .containsAllDeepKeys(object, [keys], [message]) + * + * Asserts that \`object\` contains all of the \`keys\` provided. + * Since Sets and Maps can have objects as keys you can use this assertion to perform + * a deep comparison. + * You can also provide a single object instead of a \`keys\` array and its keys + * will be used as the expected set of keys. + * + * assert.containsAllDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [1, 2]]), {one: 'one'}); + * assert.containsAllDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [{two: 'two'}, 'valueTwo']]), [{one: 'one'}, {two: 'two'}]); + * assert.containsAllDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), {one: 'one'}); + * assert.containsAllDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {two: 'two'}]); + * + * @name containsAllDeepKeys + * @param {Mixed} object + * @param {Array|Object} keys + * @param {String} message + * @namespace Assert + * @api public + */assert.containsAllDeepKeys=function(obj,keys,msg){new Assertion(obj,msg,assert.containsAllDeepKeys,true).to.contain.all.deep.keys(keys);};/** + * ### .doesNotHaveAnyDeepKeys(object, [keys], [message]) + * + * Asserts that \`object\` has none of the \`keys\` provided. + * Since Sets and Maps can have objects as keys you can use this assertion to perform + * a deep comparison. + * You can also provide a single object instead of a \`keys\` array and its keys + * will be used as the expected set of keys. + * + * assert.doesNotHaveAnyDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [1, 2]]), {thisDoesNot: 'exist'}); + * assert.doesNotHaveAnyDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [{two: 'two'}, 'valueTwo']]), [{twenty: 'twenty'}, {fifty: 'fifty'}]); + * assert.doesNotHaveAnyDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), {twenty: 'twenty'}); + * assert.doesNotHaveAnyDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{twenty: 'twenty'}, {fifty: 'fifty'}]); + * + * @name doesNotHaveAnyDeepKeys + * @param {Mixed} object + * @param {Array|Object} keys + * @param {String} message + * @namespace Assert + * @api public + */assert.doesNotHaveAnyDeepKeys=function(obj,keys,msg){new Assertion(obj,msg,assert.doesNotHaveAnyDeepKeys,true).to.not.have.any.deep.keys(keys);};/** + * ### .doesNotHaveAllDeepKeys(object, [keys], [message]) + * + * Asserts that \`object\` does not have at least one of the \`keys\` provided. + * Since Sets and Maps can have objects as keys you can use this assertion to perform + * a deep comparison. + * You can also provide a single object instead of a \`keys\` array and its keys + * will be used as the expected set of keys. + * + * assert.doesNotHaveAllDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [1, 2]]), {thisDoesNot: 'exist'}); + * assert.doesNotHaveAllDeepKeys(new Map([[{one: 'one'}, 'valueOne'], [{two: 'two'}, 'valueTwo']]), [{twenty: 'twenty'}, {one: 'one'}]); + * assert.doesNotHaveAllDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), {twenty: 'twenty'}); + * assert.doesNotHaveAllDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {fifty: 'fifty'}]); + * + * @name doesNotHaveAllDeepKeys + * @param {Mixed} object + * @param {Array|Object} keys + * @param {String} message + * @namespace Assert + * @api public + */assert.doesNotHaveAllDeepKeys=function(obj,keys,msg){new Assertion(obj,msg,assert.doesNotHaveAllDeepKeys,true).to.not.have.all.deep.keys(keys);};/** + * ### .throws(fn, [errorLike/string/regexp], [string/regexp], [message]) + * + * If \`errorLike\` is an \`Error\` constructor, asserts that \`fn\` will throw an error that is an + * instance of \`errorLike\`. + * If \`errorLike\` is an \`Error\` instance, asserts that the error thrown is the same + * instance as \`errorLike\`. + * If \`errMsgMatcher\` is provided, it also asserts that the error thrown will have a + * message matching \`errMsgMatcher\`. + * + * assert.throws(fn, 'Error thrown must have this msg'); + * assert.throws(fn, /Error thrown must have a msg that matches this/); + * assert.throws(fn, ReferenceError); + * assert.throws(fn, errorInstance); + * assert.throws(fn, ReferenceError, 'Error thrown must be a ReferenceError and have this msg'); + * assert.throws(fn, errorInstance, 'Error thrown must be the same errorInstance and have this msg'); + * assert.throws(fn, ReferenceError, /Error thrown must be a ReferenceError and match this/); + * assert.throws(fn, errorInstance, /Error thrown must be the same errorInstance and match this/); + * + * @name throws + * @alias throw + * @alias Throw + * @param {Function} fn + * @param {ErrorConstructor|Error} errorLike + * @param {RegExp|String} errMsgMatcher + * @param {String} message + * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types + * @namespace Assert + * @api public + */assert.throws=function(fn,errorLike,errMsgMatcher,msg){if('string'===typeof errorLike||errorLike instanceof RegExp){errMsgMatcher=errorLike;errorLike=null;}var assertErr=new Assertion(fn,msg,assert.throws,true).to.throw(errorLike,errMsgMatcher);return flag(assertErr,'object');};/** + * ### .doesNotThrow(fn, [errorLike/string/regexp], [string/regexp], [message]) + * + * If \`errorLike\` is an \`Error\` constructor, asserts that \`fn\` will _not_ throw an error that is an + * instance of \`errorLike\`. + * If \`errorLike\` is an \`Error\` instance, asserts that the error thrown is _not_ the same + * instance as \`errorLike\`. + * If \`errMsgMatcher\` is provided, it also asserts that the error thrown will _not_ have a + * message matching \`errMsgMatcher\`. + * + * assert.doesNotThrow(fn, 'Any Error thrown must not have this message'); + * assert.doesNotThrow(fn, /Any Error thrown must not match this/); + * assert.doesNotThrow(fn, Error); + * assert.doesNotThrow(fn, errorInstance); + * assert.doesNotThrow(fn, Error, 'Error must not have this message'); + * assert.doesNotThrow(fn, errorInstance, 'Error must not have this message'); + * assert.doesNotThrow(fn, Error, /Error must not match this/); + * assert.doesNotThrow(fn, errorInstance, /Error must not match this/); + * + * @name doesNotThrow + * @param {Function} fn + * @param {ErrorConstructor} errorLike + * @param {RegExp|String} errMsgMatcher + * @param {String} message + * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types + * @namespace Assert + * @api public + */assert.doesNotThrow=function(fn,errorLike,errMsgMatcher,msg){if('string'===typeof errorLike||errorLike instanceof RegExp){errMsgMatcher=errorLike;errorLike=null;}new Assertion(fn,msg,assert.doesNotThrow,true).to.not.throw(errorLike,errMsgMatcher);};/** + * ### .operator(val1, operator, val2, [message]) + * + * Compares two values using \`operator\`. + * + * assert.operator(1, '<', 2, 'everything is ok'); + * assert.operator(1, '>', 2, 'this will fail'); + * + * @name operator + * @param {Mixed} val1 + * @param {String} operator + * @param {Mixed} val2 + * @param {String} message + * @namespace Assert + * @api public + */assert.operator=function(val,operator,val2,msg){var ok;switch(operator){case'==':ok=val==val2;break;case'===':ok=val===val2;break;case'>':ok=val>val2;break;case'>=':ok=val>=val2;break;case'<':ok=val} list + * @param {String} message + * @namespace Assert + * @api public + */assert.oneOf=function(inList,list,msg){new Assertion(inList,msg,assert.oneOf,true).to.be.oneOf(list);};/** + * ### .changes(function, object, property, [message]) + * + * Asserts that a function changes the value of a property. + * + * var obj = { val: 10 }; + * var fn = function() { obj.val = 22 }; + * assert.changes(fn, obj, 'val'); + * + * @name changes + * @param {Function} modifier function + * @param {Object} object or getter function + * @param {String} property name _optional_ + * @param {String} message _optional_ + * @namespace Assert + * @api public + */assert.changes=function(fn,obj,prop,msg){if(arguments.length===3&&typeof obj==='function'){msg=prop;prop=null;}new Assertion(fn,msg,assert.changes,true).to.change(obj,prop);};/** + * ### .changesBy(function, object, property, delta, [message]) + * + * Asserts that a function changes the value of a property by an amount (delta). + * + * var obj = { val: 10 }; + * var fn = function() { obj.val += 2 }; + * assert.changesBy(fn, obj, 'val', 2); + * + * @name changesBy + * @param {Function} modifier function + * @param {Object} object or getter function + * @param {String} property name _optional_ + * @param {Number} change amount (delta) + * @param {String} message _optional_ + * @namespace Assert + * @api public + */assert.changesBy=function(fn,obj,prop,delta,msg){if(arguments.length===4&&typeof obj==='function'){var tmpMsg=delta;delta=prop;msg=tmpMsg;}else if(arguments.length===3){delta=prop;prop=null;}new Assertion(fn,msg,assert.changesBy,true).to.change(obj,prop).by(delta);};/** + * ### .doesNotChange(function, object, property, [message]) + * + * Asserts that a function does not change the value of a property. + * + * var obj = { val: 10 }; + * var fn = function() { console.log('foo'); }; + * assert.doesNotChange(fn, obj, 'val'); + * + * @name doesNotChange + * @param {Function} modifier function + * @param {Object} object or getter function + * @param {String} property name _optional_ + * @param {String} message _optional_ + * @namespace Assert + * @api public + */assert.doesNotChange=function(fn,obj,prop,msg){if(arguments.length===3&&typeof obj==='function'){msg=prop;prop=null;}return new Assertion(fn,msg,assert.doesNotChange,true).to.not.change(obj,prop);};/** + * ### .changesButNotBy(function, object, property, delta, [message]) + * + * Asserts that a function does not change the value of a property or of a function's return value by an amount (delta) + * + * var obj = { val: 10 }; + * var fn = function() { obj.val += 10 }; + * assert.changesButNotBy(fn, obj, 'val', 5); + * + * @name changesButNotBy + * @param {Function} modifier function + * @param {Object} object or getter function + * @param {String} property name _optional_ + * @param {Number} change amount (delta) + * @param {String} message _optional_ + * @namespace Assert + * @api public + */assert.changesButNotBy=function(fn,obj,prop,delta,msg){if(arguments.length===4&&typeof obj==='function'){var tmpMsg=delta;delta=prop;msg=tmpMsg;}else if(arguments.length===3){delta=prop;prop=null;}new Assertion(fn,msg,assert.changesButNotBy,true).to.change(obj,prop).but.not.by(delta);};/** + * ### .increases(function, object, property, [message]) + * + * Asserts that a function increases a numeric object property. + * + * var obj = { val: 10 }; + * var fn = function() { obj.val = 13 }; + * assert.increases(fn, obj, 'val'); + * + * @name increases + * @param {Function} modifier function + * @param {Object} object or getter function + * @param {String} property name _optional_ + * @param {String} message _optional_ + * @namespace Assert + * @api public + */assert.increases=function(fn,obj,prop,msg){if(arguments.length===3&&typeof obj==='function'){msg=prop;prop=null;}return new Assertion(fn,msg,assert.increases,true).to.increase(obj,prop);};/** + * ### .increasesBy(function, object, property, delta, [message]) + * + * Asserts that a function increases a numeric object property or a function's return value by an amount (delta). + * + * var obj = { val: 10 }; + * var fn = function() { obj.val += 10 }; + * assert.increasesBy(fn, obj, 'val', 10); + * + * @name increasesBy + * @param {Function} modifier function + * @param {Object} object or getter function + * @param {String} property name _optional_ + * @param {Number} change amount (delta) + * @param {String} message _optional_ + * @namespace Assert + * @api public + */assert.increasesBy=function(fn,obj,prop,delta,msg){if(arguments.length===4&&typeof obj==='function'){var tmpMsg=delta;delta=prop;msg=tmpMsg;}else if(arguments.length===3){delta=prop;prop=null;}new Assertion(fn,msg,assert.increasesBy,true).to.increase(obj,prop).by(delta);};/** + * ### .doesNotIncrease(function, object, property, [message]) + * + * Asserts that a function does not increase a numeric object property. + * + * var obj = { val: 10 }; + * var fn = function() { obj.val = 8 }; + * assert.doesNotIncrease(fn, obj, 'val'); + * + * @name doesNotIncrease + * @param {Function} modifier function + * @param {Object} object or getter function + * @param {String} property name _optional_ + * @param {String} message _optional_ + * @namespace Assert + * @api public + */assert.doesNotIncrease=function(fn,obj,prop,msg){if(arguments.length===3&&typeof obj==='function'){msg=prop;prop=null;}return new Assertion(fn,msg,assert.doesNotIncrease,true).to.not.increase(obj,prop);};/** + * ### .increasesButNotBy(function, object, property, delta, [message]) + * + * Asserts that a function does not increase a numeric object property or function's return value by an amount (delta). + * + * var obj = { val: 10 }; + * var fn = function() { obj.val = 15 }; + * assert.increasesButNotBy(fn, obj, 'val', 10); + * + * @name increasesButNotBy + * @param {Function} modifier function + * @param {Object} object or getter function + * @param {String} property name _optional_ + * @param {Number} change amount (delta) + * @param {String} message _optional_ + * @namespace Assert + * @api public + */assert.increasesButNotBy=function(fn,obj,prop,delta,msg){if(arguments.length===4&&typeof obj==='function'){var tmpMsg=delta;delta=prop;msg=tmpMsg;}else if(arguments.length===3){delta=prop;prop=null;}new Assertion(fn,msg,assert.increasesButNotBy,true).to.increase(obj,prop).but.not.by(delta);};/** + * ### .decreases(function, object, property, [message]) + * + * Asserts that a function decreases a numeric object property. + * + * var obj = { val: 10 }; + * var fn = function() { obj.val = 5 }; + * assert.decreases(fn, obj, 'val'); + * + * @name decreases + * @param {Function} modifier function + * @param {Object} object or getter function + * @param {String} property name _optional_ + * @param {String} message _optional_ + * @namespace Assert + * @api public + */assert.decreases=function(fn,obj,prop,msg){if(arguments.length===3&&typeof obj==='function'){msg=prop;prop=null;}return new Assertion(fn,msg,assert.decreases,true).to.decrease(obj,prop);};/** + * ### .decreasesBy(function, object, property, delta, [message]) + * + * Asserts that a function decreases a numeric object property or a function's return value by an amount (delta) + * + * var obj = { val: 10 }; + * var fn = function() { obj.val -= 5 }; + * assert.decreasesBy(fn, obj, 'val', 5); + * + * @name decreasesBy + * @param {Function} modifier function + * @param {Object} object or getter function + * @param {String} property name _optional_ + * @param {Number} change amount (delta) + * @param {String} message _optional_ + * @namespace Assert + * @api public + */assert.decreasesBy=function(fn,obj,prop,delta,msg){if(arguments.length===4&&typeof obj==='function'){var tmpMsg=delta;delta=prop;msg=tmpMsg;}else if(arguments.length===3){delta=prop;prop=null;}new Assertion(fn,msg,assert.decreasesBy,true).to.decrease(obj,prop).by(delta);};/** + * ### .doesNotDecrease(function, object, property, [message]) + * + * Asserts that a function does not decreases a numeric object property. + * + * var obj = { val: 10 }; + * var fn = function() { obj.val = 15 }; + * assert.doesNotDecrease(fn, obj, 'val'); + * + * @name doesNotDecrease + * @param {Function} modifier function + * @param {Object} object or getter function + * @param {String} property name _optional_ + * @param {String} message _optional_ + * @namespace Assert + * @api public + */assert.doesNotDecrease=function(fn,obj,prop,msg){if(arguments.length===3&&typeof obj==='function'){msg=prop;prop=null;}return new Assertion(fn,msg,assert.doesNotDecrease,true).to.not.decrease(obj,prop);};/** + * ### .doesNotDecreaseBy(function, object, property, delta, [message]) + * + * Asserts that a function does not decreases a numeric object property or a function's return value by an amount (delta) + * + * var obj = { val: 10 }; + * var fn = function() { obj.val = 5 }; + * assert.doesNotDecreaseBy(fn, obj, 'val', 1); + * + * @name doesNotDecreaseBy + * @param {Function} modifier function + * @param {Object} object or getter function + * @param {String} property name _optional_ + * @param {Number} change amount (delta) + * @param {String} message _optional_ + * @namespace Assert + * @api public + */assert.doesNotDecreaseBy=function(fn,obj,prop,delta,msg){if(arguments.length===4&&typeof obj==='function'){var tmpMsg=delta;delta=prop;msg=tmpMsg;}else if(arguments.length===3){delta=prop;prop=null;}return new Assertion(fn,msg,assert.doesNotDecreaseBy,true).to.not.decrease(obj,prop).by(delta);};/** + * ### .decreasesButNotBy(function, object, property, delta, [message]) + * + * Asserts that a function does not decreases a numeric object property or a function's return value by an amount (delta) + * + * var obj = { val: 10 }; + * var fn = function() { obj.val = 5 }; + * assert.decreasesButNotBy(fn, obj, 'val', 1); + * + * @name decreasesButNotBy + * @param {Function} modifier function + * @param {Object} object or getter function + * @param {String} property name _optional_ + * @param {Number} change amount (delta) + * @param {String} message _optional_ + * @namespace Assert + * @api public + */assert.decreasesButNotBy=function(fn,obj,prop,delta,msg){if(arguments.length===4&&typeof obj==='function'){var tmpMsg=delta;delta=prop;msg=tmpMsg;}else if(arguments.length===3){delta=prop;prop=null;}new Assertion(fn,msg,assert.decreasesButNotBy,true).to.decrease(obj,prop).but.not.by(delta);};/*! + * ### .ifError(object) + * + * Asserts if value is not a false value, and throws if it is a true value. + * This is added to allow for chai to be a drop-in replacement for Node's + * assert class. + * + * var err = new Error('I am a custom error'); + * assert.ifError(err); // Rethrows err! + * + * @name ifError + * @param {Object} object + * @namespace Assert + * @api public + */assert.ifError=function(val){if(val){throw val;}};/** + * ### .isExtensible(object) + * + * Asserts that \`object\` is extensible (can have new properties added to it). + * + * assert.isExtensible({}); + * + * @name isExtensible + * @alias extensible + * @param {Object} object + * @param {String} message _optional_ + * @namespace Assert + * @api public + */assert.isExtensible=function(obj,msg){new Assertion(obj,msg,assert.isExtensible,true).to.be.extensible;};/** + * ### .isNotExtensible(object) + * + * Asserts that \`object\` is _not_ extensible. + * + * var nonExtensibleObject = Object.preventExtensions({}); + * var sealedObject = Object.seal({}); + * var frozenObject = Object.freeze({}); + * + * assert.isNotExtensible(nonExtensibleObject); + * assert.isNotExtensible(sealedObject); + * assert.isNotExtensible(frozenObject); + * + * @name isNotExtensible + * @alias notExtensible + * @param {Object} object + * @param {String} message _optional_ + * @namespace Assert + * @api public + */assert.isNotExtensible=function(obj,msg){new Assertion(obj,msg,assert.isNotExtensible,true).to.not.be.extensible;};/** + * ### .isSealed(object) + * + * Asserts that \`object\` is sealed (cannot have new properties added to it + * and its existing properties cannot be removed). + * + * var sealedObject = Object.seal({}); + * var frozenObject = Object.seal({}); + * + * assert.isSealed(sealedObject); + * assert.isSealed(frozenObject); + * + * @name isSealed + * @alias sealed + * @param {Object} object + * @param {String} message _optional_ + * @namespace Assert + * @api public + */assert.isSealed=function(obj,msg){new Assertion(obj,msg,assert.isSealed,true).to.be.sealed;};/** + * ### .isNotSealed(object) + * + * Asserts that \`object\` is _not_ sealed. + * + * assert.isNotSealed({}); + * + * @name isNotSealed + * @alias notSealed + * @param {Object} object + * @param {String} message _optional_ + * @namespace Assert + * @api public + */assert.isNotSealed=function(obj,msg){new Assertion(obj,msg,assert.isNotSealed,true).to.not.be.sealed;};/** + * ### .isFrozen(object) + * + * Asserts that \`object\` is frozen (cannot have new properties added to it + * and its existing properties cannot be modified). + * + * var frozenObject = Object.freeze({}); + * assert.frozen(frozenObject); + * + * @name isFrozen + * @alias frozen + * @param {Object} object + * @param {String} message _optional_ + * @namespace Assert + * @api public + */assert.isFrozen=function(obj,msg){new Assertion(obj,msg,assert.isFrozen,true).to.be.frozen;};/** + * ### .isNotFrozen(object) + * + * Asserts that \`object\` is _not_ frozen. + * + * assert.isNotFrozen({}); + * + * @name isNotFrozen + * @alias notFrozen + * @param {Object} object + * @param {String} message _optional_ + * @namespace Assert + * @api public + */assert.isNotFrozen=function(obj,msg){new Assertion(obj,msg,assert.isNotFrozen,true).to.not.be.frozen;};/** + * ### .isEmpty(target) + * + * Asserts that the target does not contain any values. + * For arrays and strings, it checks the \`length\` property. + * For \`Map\` and \`Set\` instances, it checks the \`size\` property. + * For non-function objects, it gets the count of own + * enumerable string keys. + * + * assert.isEmpty([]); + * assert.isEmpty(''); + * assert.isEmpty(new Map); + * assert.isEmpty({}); + * + * @name isEmpty + * @alias empty + * @param {Object|Array|String|Map|Set} target + * @param {String} message _optional_ + * @namespace Assert + * @api public + */assert.isEmpty=function(val,msg){new Assertion(val,msg,assert.isEmpty,true).to.be.empty;};/** + * ### .isNotEmpty(target) + * + * Asserts that the target contains values. + * For arrays and strings, it checks the \`length\` property. + * For \`Map\` and \`Set\` instances, it checks the \`size\` property. + * For non-function objects, it gets the count of own + * enumerable string keys. + * + * assert.isNotEmpty([1, 2]); + * assert.isNotEmpty('34'); + * assert.isNotEmpty(new Set([5, 6])); + * assert.isNotEmpty({ key: 7 }); + * + * @name isNotEmpty + * @alias notEmpty + * @param {Object|Array|String|Map|Set} target + * @param {String} message _optional_ + * @namespace Assert + * @api public + */assert.isNotEmpty=function(val,msg){new Assertion(val,msg,assert.isNotEmpty,true).to.not.be.empty;};/*! + * Aliases. + */(function alias(name,as){assert[as]=assert[name];return alias;})('isOk','ok')('isNotOk','notOk')('throws','throw')('throws','Throw')('isExtensible','extensible')('isNotExtensible','notExtensible')('isSealed','sealed')('isNotSealed','notSealed')('isFrozen','frozen')('isNotFrozen','notFrozen')('isEmpty','empty')('isNotEmpty','notEmpty');};/*! + * chai + * Copyright(c) 2011-2014 Jake Luer + * MIT Licensed + */var hasRequiredChai;function requireChai(){if(hasRequiredChai)return chai$3;hasRequiredChai=1;(function(exports){var used=[];/*! + * Chai version + */exports.version='4.3.8';/*! + * Assertion Error + */exports.AssertionError=assertionError;/*! + * Utils for plugins (not exported) + */var util=requireUtils();/** + * # .use(function) + * + * Provides a way to extend the internals of Chai. + * + * @param {Function} + * @returns {this} for chaining + * @api public + */exports.use=function(fn){if(!~used.indexOf(fn)){fn(exports,util);used.push(fn);}return exports;};/*! + * Utility Functions + */exports.util=util;/*! + * Configuration + */var config=config$5;exports.config=config;/*! + * Primary \`Assertion\` prototype + */var assertion$1=assertion;exports.use(assertion$1);/*! + * Core Assertions + */var core=assertions;exports.use(core);/*! + * Expect interface + */var expect=expect$1;exports.use(expect);/*! + * Should interface + */var should$1=should;exports.use(should$1);/*! + * Assert interface + */var assert=assert$1;exports.use(assert);})(chai$3);return chai$3;}var chai$1=requireChai();const chai$2=/*@__PURE__*/getDefaultExportFromCjs$2(chai$1);const expect=chai$2.expect;chai$2.version;chai$2.Assertion;chai$2.AssertionError;const util=chai$2.util;chai$2.config;const use=chai$2.use;chai$2.should;const assert=chai$2.assert;chai$2.core;var commonjsGlobal=typeof globalThis!=='undefined'?globalThis:typeof window!=='undefined'?window:typeof global!=='undefined'?global:typeof self!=='undefined'?self:{};function getDefaultExportFromCjs$1(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,'default')?x['default']:x;}// src/utils.ts +function R(e,t){if(!e)throw new Error(t);}function u(e,t){return typeof t===e;}function b(e){return e instanceof Promise;}function f(e,t,n){Object.defineProperty(e,t,n);}function i(e,t,n){Object.defineProperty(e,t,{value:n});}// src/constants.ts +var c=Symbol.for("tinyspy:spy");// src/internal.ts +var g=/* @__PURE__ */new Set(),C=e=>{e.called=!1,e.callCount=0,e.calls=[],e.results=[],e.next=[];},M=e=>(f(e,c,{value:{reset:()=>C(e[c])}}),e[c]),A=e=>e[c]||M(e);function I(e){R(u("function",e)||u("undefined",e),"cannot spy on a non-function value");let t=function(...s){let r=A(t);r.called=!0,r.callCount++,r.calls.push(s);let m=r.next.shift();if(m){r.results.push(m);let _m=_slicedToArray(m,2),l=_m[0],o=_m[1];if(l==="ok")return o;throw o;}let p,d="ok";if(r.impl)try{new.target?p=Reflect.construct(r.impl,s,new.target):p=r.impl.apply(this,s),d="ok";}catch(l){throw p=l,d="error",r.results.push([d,l]),l;}let a=[d,p];if(b(p)){let l=p.then(o=>a[1]=o).catch(o=>{throw a[0]="error",a[1]=o,o;});Object.assign(l,p),p=l;}return r.results.push(a),p;};i(t,"_isMockFunction",!0),i(t,"length",e?e.length:0),i(t,"name",e&&e.name||"spy");let n=A(t);return n.reset(),n.impl=e,t;}// src/spyOn.ts +var k=(e,t)=>Object.getOwnPropertyDescriptor(e,t),P=(e,t)=>{t!=null&&typeof t=="function"&&t.prototype!=null&&Object.setPrototypeOf(e.prototype,t.prototype);};function E(e,t,n){R(!u("undefined",e),"spyOn could not find an object to spy upon"),R(u("object",e)||u("function",e),"cannot spyOn on a primitive value");let _ref9=(()=>{if(!u("object",t))return[t,"value"];if("getter"in t&&"setter"in t)throw new Error("cannot spy on both getter and setter");if("getter"in t)return[t.getter,"get"];if("setter"in t)return[t.setter,"set"];throw new Error("specify getter or setter to spy on");})(),_ref10=_slicedToArray(_ref9,2),s=_ref10[0],r=_ref10[1],m=k(e,s),p=Object.getPrototypeOf(e),d=p&&k(p,s),a=m||d;R(a||s in e,\`\${String(s)} does not exist\`);let l=!1;r==="value"&&a&&!a.value&&a.get&&(r="get",l=!0,n=a.get());let o;a?o=a[r]:r!=="value"?o=()=>e[s]:o=e[s],n||(n=o);let y=I(n);r==="value"&&P(y,o);let O=h=>{let _ref11=a||{configurable:!0,writable:!0},G=_ref11.value,w=_objectWithoutProperties(_ref11,_excluded2);r!=="value"&&delete w.writable,w[r]=h,f(e,s,w);},K=()=>a?f(e,s,a):O(o),T=y[c];return i(T,"restore",K),i(T,"getOriginal",()=>l?o():o),i(T,"willCall",h=>(T.impl=h,y)),O(l?()=>(P(y,n),y):y),g.add(y),y;}const mocks=/* @__PURE__ */new Set();function isMockFunction(fn2){return typeof fn2==="function"&&"_isMockFunction"in fn2&&fn2._isMockFunction;}function spyOn(obj,method,accessType){const dictionary={get:"getter",set:"setter"};const objMethod=accessType?{[dictionary[accessType]]:method}:method;const stub=E(obj,objMethod);return enhanceSpy(stub);}let callOrder=0;function enhanceSpy(spy){const stub=spy;let implementation;let instances=[];let invocations=[];const state=A(spy);const mockContext={get calls(){return state.calls;},get instances(){return instances;},get invocationCallOrder(){return invocations;},get results(){return state.results.map(([callType,value])=>{const type=callType==="error"?"throw":"return";return{type,value};});},get lastCall(){return state.calls[state.calls.length-1];}};let onceImplementations=[];let implementationChangedTemporarily=false;function mockCall(...args){instances.push(this);invocations.push(++callOrder);const impl=implementationChangedTemporarily?implementation:onceImplementations.shift()||implementation||state.getOriginal()||(()=>{});return impl.apply(this,args);}let name=stub.name;stub.getMockName=()=>name||"vi.fn()";stub.mockName=n=>{name=n;return stub;};stub.mockClear=()=>{state.reset();instances=[];invocations=[];return stub;};stub.mockReset=()=>{stub.mockClear();implementation=()=>void 0;onceImplementations=[];return stub;};stub.mockRestore=()=>{stub.mockReset();state.restore();implementation=void 0;return stub;};stub.getMockImplementation=()=>implementation;stub.mockImplementation=fn2=>{implementation=fn2;state.willCall(mockCall);return stub;};stub.mockImplementationOnce=fn2=>{onceImplementations.push(fn2);return stub;};function withImplementation(fn2,cb){const originalImplementation=implementation;implementation=fn2;state.willCall(mockCall);implementationChangedTemporarily=true;const reset=()=>{implementation=originalImplementation;implementationChangedTemporarily=false;};const result=cb();if(result instanceof Promise){return result.then(()=>{reset();return stub;});}reset();return stub;}stub.withImplementation=withImplementation;stub.mockReturnThis=()=>stub.mockImplementation(function(){return this;});stub.mockReturnValue=val=>stub.mockImplementation(()=>val);stub.mockReturnValueOnce=val=>stub.mockImplementationOnce(()=>val);stub.mockResolvedValue=val=>stub.mockImplementation(()=>Promise.resolve(val));stub.mockResolvedValueOnce=val=>stub.mockImplementationOnce(()=>Promise.resolve(val));stub.mockRejectedValue=val=>stub.mockImplementation(()=>Promise.reject(val));stub.mockRejectedValueOnce=val=>stub.mockImplementationOnce(()=>Promise.reject(val));Object.defineProperty(stub,"mock",{get:()=>mockContext});state.willCall(mockCall);mocks.add(stub);return stub;}function fn(implementation){const enhancedSpy=enhanceSpy(E({spy:implementation||(()=>{})},"spy"));if(implementation)enhancedSpy.mockImplementation(implementation);return enhancedSpy;}const MATCHERS_OBJECT$1=Symbol.for("matchers-object");const JEST_MATCHERS_OBJECT$1=Symbol.for("$$jest-matchers-object");const GLOBAL_EXPECT$1=Symbol.for("expect-global");const ASYMMETRIC_MATCHERS_OBJECT$1=Symbol.for("asymmetric-matchers-object");if(!Object.prototype.hasOwnProperty.call(globalThis,MATCHERS_OBJECT$1)){const globalState=/* @__PURE__ */new WeakMap();const matchers=/* @__PURE__ */Object.create(null);const customEqualityTesters=[];const assymetricMatchers=/* @__PURE__ */Object.create(null);Object.defineProperty(globalThis,MATCHERS_OBJECT$1,{get:()=>globalState});Object.defineProperty(globalThis,JEST_MATCHERS_OBJECT$1,{configurable:true,get:()=>({state:globalState.get(globalThis[GLOBAL_EXPECT$1]),matchers,customEqualityTesters})});Object.defineProperty(globalThis,ASYMMETRIC_MATCHERS_OBJECT$1,{get:()=>assymetricMatchers});}function getState(expect){return globalThis[MATCHERS_OBJECT$1].get(expect);}function setState(state,expect){const map=globalThis[MATCHERS_OBJECT$1];const current=map.get(expect)||{};Object.assign(current,state);map.set(expect,current);}function getMatcherUtils(){const c=()=>getColors();const EXPECTED_COLOR=c().green;const RECEIVED_COLOR=c().red;const INVERTED_COLOR=c().inverse;const BOLD_WEIGHT=c().bold;const DIM_COLOR=c().dim;function matcherHint(matcherName,received="received",expected="expected",options={}){const _options$comment=options.comment,comment=_options$comment===void 0?"":_options$comment,_options$isDirectExpe=options.isDirectExpectCall,isDirectExpectCall=_options$isDirectExpe===void 0?false:_options$isDirectExpe,_options$isNot=options.isNot,isNot=_options$isNot===void 0?false:_options$isNot,_options$promise=options.promise,promise=_options$promise===void 0?"":_options$promise,_options$secondArgume=options.secondArgument,secondArgument=_options$secondArgume===void 0?"":_options$secondArgume,_options$expectedColo=options.expectedColor,expectedColor=_options$expectedColo===void 0?EXPECTED_COLOR:_options$expectedColo,_options$receivedColo=options.receivedColor,receivedColor=_options$receivedColo===void 0?RECEIVED_COLOR:_options$receivedColo,_options$secondArgume2=options.secondArgumentColor,secondArgumentColor=_options$secondArgume2===void 0?EXPECTED_COLOR:_options$secondArgume2;let hint="";let dimString="expect";if(!isDirectExpectCall&&received!==""){hint+=DIM_COLOR(\`\${dimString}(\`)+receivedColor(received);dimString=")";}if(promise!==""){hint+=DIM_COLOR(\`\${dimString}.\`)+promise;dimString="";}if(isNot){hint+=\`\${DIM_COLOR(\`\${dimString}.\`)}not\`;dimString="";}if(matcherName.includes(".")){dimString+=matcherName;}else{hint+=DIM_COLOR(\`\${dimString}.\`)+matcherName;dimString="";}if(expected===""){dimString+="()";}else{hint+=DIM_COLOR(\`\${dimString}(\`)+expectedColor(expected);if(secondArgument)hint+=DIM_COLOR(", ")+secondArgumentColor(secondArgument);dimString=")";}if(comment!=="")dimString+=\` // \${comment}\`;if(dimString!=="")hint+=DIM_COLOR(dimString);return hint;}const SPACE_SYMBOL="\\xB7";const replaceTrailingSpaces=text=>text.replace(/\\s+$/gm,spaces=>SPACE_SYMBOL.repeat(spaces.length));const printReceived=object=>RECEIVED_COLOR(replaceTrailingSpaces(stringify(object)));const printExpected=value=>EXPECTED_COLOR(replaceTrailingSpaces(stringify(value)));return{EXPECTED_COLOR,RECEIVED_COLOR,INVERTED_COLOR,BOLD_WEIGHT,DIM_COLOR,matcherHint,printReceived,printExpected};}function addCustomEqualityTesters(newTesters){if(!Array.isArray(newTesters)){throw new TypeError(\`expect.customEqualityTesters: Must be set to an array of Testers. Was given "\${getType$2(newTesters)}"\`);}globalThis[JEST_MATCHERS_OBJECT$1].customEqualityTesters.push(...newTesters);}function getCustomEqualityTesters(){return globalThis[JEST_MATCHERS_OBJECT$1].customEqualityTesters;}function equals(a,b,customTesters,strictCheck){customTesters=customTesters||[];return eq(a,b,[],[],customTesters,strictCheck?hasKey:hasDefinedKey);}function isAsymmetric(obj){return!!obj&&typeof obj==="object"&&"asymmetricMatch"in obj&&isA("Function",obj.asymmetricMatch);}function asymmetricMatch(a,b){const asymmetricA=isAsymmetric(a);const asymmetricB=isAsymmetric(b);if(asymmetricA&&asymmetricB)return void 0;if(asymmetricA)return a.asymmetricMatch(b);if(asymmetricB)return b.asymmetricMatch(a);}function eq(a,b,aStack,bStack,customTesters,hasKey2){let result=true;const asymmetricResult=asymmetricMatch(a,b);if(asymmetricResult!==void 0)return asymmetricResult;const testerContext={equals};for(let i=0;iObject.getOwnPropertyDescriptor(obj,symbol).enumerable));}function hasDefinedKey(obj,key){return hasKey(obj,key)&&obj[key]!==void 0;}function hasKey(obj,key){return Object.prototype.hasOwnProperty.call(obj,key);}function isA(typeName,value){return Object.prototype.toString.apply(value)===\`[object \${typeName}]\`;}function isDomNode(obj){return obj!==null&&typeof obj==="object"&&"nodeType"in obj&&typeof obj.nodeType==="number"&&"nodeName"in obj&&typeof obj.nodeName==="string"&&"isEqualNode"in obj&&typeof obj.isEqualNode==="function";}const IS_KEYED_SENTINEL="@@__IMMUTABLE_KEYED__@@";const IS_SET_SENTINEL="@@__IMMUTABLE_SET__@@";const IS_ORDERED_SENTINEL="@@__IMMUTABLE_ORDERED__@@";function isImmutableUnorderedKeyed(maybeKeyed){return!!(maybeKeyed&&maybeKeyed[IS_KEYED_SENTINEL]&&!maybeKeyed[IS_ORDERED_SENTINEL]);}function isImmutableUnorderedSet(maybeSet){return!!(maybeSet&&maybeSet[IS_SET_SENTINEL]&&!maybeSet[IS_ORDERED_SENTINEL]);}const IteratorSymbol=Symbol.iterator;function hasIterator(object){return!!(object!=null&&object[IteratorSymbol]);}function iterableEquality(a,b,customTesters=[],aStack=[],bStack=[]){if(typeof a!=="object"||typeof b!=="object"||Array.isArray(a)||Array.isArray(b)||!hasIterator(a)||!hasIterator(b))return void 0;if(a.constructor!==b.constructor)return false;let length=aStack.length;while(length--){if(aStack[length]===a)return bStack[length]===b;}aStack.push(a);bStack.push(b);const filteredCustomTesters=[...customTesters.filter(t=>t!==iterableEquality),iterableEqualityWithStack];function iterableEqualityWithStack(a2,b2){return iterableEquality(a2,b2,[...filteredCustomTesters],[...aStack],[...bStack]);}if(a.size!==void 0){if(a.size!==b.size){return false;}else if(isA("Set",a)||isImmutableUnorderedSet(a)){let allFound=true;for(const aValue of a){if(!b.has(aValue)){let has=false;for(const bValue of b){const isEqual=equals(aValue,bValue,filteredCustomTesters);if(isEqual===true)has=true;}if(has===false){allFound=false;break;}}}aStack.pop();bStack.pop();return allFound;}else if(isA("Map",a)||isImmutableUnorderedKeyed(a)){let allFound=true;for(const aEntry of a){if(!b.has(aEntry[0])||!equals(aEntry[1],b.get(aEntry[0]),filteredCustomTesters)){let has=false;for(const bEntry of b){const matchedKey=equals(aEntry[0],bEntry[0],filteredCustomTesters);let matchedValue=false;if(matchedKey===true)matchedValue=equals(aEntry[1],bEntry[1],filteredCustomTesters);if(matchedValue===true)has=true;}if(has===false){allFound=false;break;}}}aStack.pop();bStack.pop();return allFound;}}const bIterator=b[IteratorSymbol]();for(const aValue of a){const nextB=bIterator.next();if(nextB.done||!equals(aValue,nextB.value,filteredCustomTesters))return false;}if(!bIterator.next().done)return false;aStack.pop();bStack.pop();return true;}function hasPropertyInObject(object,key){const shouldTerminate=!object||typeof object!=="object"||object===Object.prototype;if(shouldTerminate)return false;return Object.prototype.hasOwnProperty.call(object,key)||hasPropertyInObject(Object.getPrototypeOf(object),key);}function isObjectWithKeys(a){return isObject$1(a)&&!(a instanceof Error)&&!Array.isArray(a)&&!(a instanceof Date);}function subsetEquality(object,subset,customTesters=[]){const filteredCustomTesters=customTesters.filter(t=>t!==subsetEquality);const subsetEqualityWithContext=(seenReferences=/* @__PURE__ */new WeakMap())=>(object2,subset2)=>{if(!isObjectWithKeys(subset2))return void 0;return Object.keys(subset2).every(key=>{if(isObjectWithKeys(subset2[key])){if(seenReferences.has(subset2[key]))return equals(object2[key],subset2[key],filteredCustomTesters);seenReferences.set(subset2[key],true);}const result=object2!=null&&hasPropertyInObject(object2,key)&&equals(object2[key],subset2[key],[...filteredCustomTesters,subsetEqualityWithContext(seenReferences)]);seenReferences.delete(subset2[key]);return result;});};return subsetEqualityWithContext()(object,subset);}function typeEquality(a,b){if(a==null||b==null||a.constructor===b.constructor)return void 0;return false;}function arrayBufferEquality(a,b){let dataViewA=a;let dataViewB=b;if(!(a instanceof DataView&&b instanceof DataView)){if(!(a instanceof ArrayBuffer)||!(b instanceof ArrayBuffer))return void 0;try{dataViewA=new DataView(a);dataViewB=new DataView(b);}catch{return void 0;}}if(dataViewA.byteLength!==dataViewB.byteLength)return false;for(let i=0;it!==sparseArrayEquality);return equals(a,b,filteredCustomTesters,true)&&equals(aKeys,bKeys);}function generateToBeMessage(deepEqualityName,expected="#{this}",actual="#{exp}"){const toBeMessage=\`expected \${expected} to be \${actual} // Object.is equality\`;if(["toStrictEqual","toEqual"].includes(deepEqualityName))return\`\${toBeMessage} + +If it should pass with deep equality, replace "toBe" with "\${deepEqualityName}" + +Expected: \${expected} +Received: serializes to the same string +\`;return toBeMessage;}function pluralize(word,count){return\`\${count} \${word}\${count===1?"":"s"}\`;}let AsymmetricMatcher$1=class AsymmetricMatcher{constructor(sample,inverse=false){this.sample=sample;this.inverse=inverse;}// should have "jest" to be compatible with its ecosystem +$$typeof=Symbol.for("jest.asymmetricMatcher");getMatcherContext(expect){return _objectSpread(_objectSpread({},getState(expect||globalThis[GLOBAL_EXPECT$1])),{},{equals,isNot:this.inverse,customTesters:getCustomEqualityTesters(),utils:_objectSpread(_objectSpread({},getMatcherUtils()),{},{diff,stringify,iterableEquality,subsetEquality})});}// implement custom chai/loupe inspect for better AssertionError.message formatting +// https://github.com/chaijs/loupe/blob/9b8a6deabcd50adc056a64fb705896194710c5c6/src/index.ts#L29 +[Symbol.for("chai/inspect")](options){const result=stringify(this,options.depth,{min:true});if(result.length<=options.truncate)return result;return\`\${this.toString()}{\\u2026}\`;}};class StringContaining extends AsymmetricMatcher$1{constructor(sample,inverse=false){if(!isA("String",sample))throw new Error("Expected is not a string");super(sample,inverse);}asymmetricMatch(other){const result=isA("String",other)&&other.includes(this.sample);return this.inverse?!result:result;}toString(){return\`String\${this.inverse?"Not":""}Containing\`;}getExpectedType(){return"string";}}class Anything extends AsymmetricMatcher$1{asymmetricMatch(other){return other!=null;}toString(){return"Anything";}toAsymmetricMatcher(){return"Anything";}}class ObjectContaining extends AsymmetricMatcher$1{constructor(sample,inverse=false){super(sample,inverse);}getPrototype(obj){if(Object.getPrototypeOf)return Object.getPrototypeOf(obj);if(obj.constructor.prototype===obj)return null;return obj.constructor.prototype;}hasProperty(obj,property){if(!obj)return false;if(Object.prototype.hasOwnProperty.call(obj,property))return true;return this.hasProperty(this.getPrototype(obj),property);}asymmetricMatch(other){if(typeof this.sample!=="object"){throw new TypeError(\`You must provide an object to \${this.toString()}, not '\${typeof this.sample}'.\`);}let result=true;const matcherContext=this.getMatcherContext();for(const property in this.sample){if(!this.hasProperty(other,property)||!equals(this.sample[property],other[property],matcherContext.customTesters)){result=false;break;}}return this.inverse?!result:result;}toString(){return\`Object\${this.inverse?"Not":""}Containing\`;}getExpectedType(){return"object";}}class ArrayContaining extends AsymmetricMatcher$1{constructor(sample,inverse=false){super(sample,inverse);}asymmetricMatch(other){if(!Array.isArray(this.sample)){throw new TypeError(\`You must provide an array to \${this.toString()}, not '\${typeof this.sample}'.\`);}const matcherContext=this.getMatcherContext();const result=this.sample.length===0||Array.isArray(other)&&this.sample.every(item=>other.some(another=>equals(item,another,matcherContext.customTesters)));return this.inverse?!result:result;}toString(){return\`Array\${this.inverse?"Not":""}Containing\`;}getExpectedType(){return"array";}}class Any extends AsymmetricMatcher$1{constructor(sample){if(typeof sample==="undefined"){throw new TypeError("any() expects to be passed a constructor function. Please pass one or use anything() to match any object.");}super(sample);}fnNameFor(func){if(func.name)return func.name;const functionToString=Function.prototype.toString;const matches=functionToString.call(func).match(/^(?:async)?\\s*function\\s*\\*?\\s*([\\w$]+)\\s*\\(/);return matches?matches[1]:"";}asymmetricMatch(other){if(this.sample===String)return typeof other=="string"||other instanceof String;if(this.sample===Number)return typeof other=="number"||other instanceof Number;if(this.sample===Function)return typeof other=="function"||other instanceof Function;if(this.sample===Boolean)return typeof other=="boolean"||other instanceof Boolean;if(this.sample===BigInt)return typeof other=="bigint"||other instanceof BigInt;if(this.sample===Symbol)return typeof other=="symbol"||other instanceof Symbol;if(this.sample===Object)return typeof other=="object";return other instanceof this.sample;}toString(){return"Any";}getExpectedType(){if(this.sample===String)return"string";if(this.sample===Number)return"number";if(this.sample===Function)return"function";if(this.sample===Object)return"object";if(this.sample===Boolean)return"boolean";return this.fnNameFor(this.sample);}toAsymmetricMatcher(){return\`Any<\${this.fnNameFor(this.sample)}>\`;}}class StringMatching extends AsymmetricMatcher$1{constructor(sample,inverse=false){if(!isA("String",sample)&&!isA("RegExp",sample))throw new Error("Expected is not a String or a RegExp");super(new RegExp(sample),inverse);}asymmetricMatch(other){const result=isA("String",other)&&this.sample.test(other);return this.inverse?!result:result;}toString(){return\`String\${this.inverse?"Not":""}Matching\`;}getExpectedType(){return"string";}}class CloseTo extends AsymmetricMatcher$1{precision;constructor(sample,precision=2,inverse=false){if(!isA("Number",sample))throw new Error("Expected is not a Number");if(!isA("Number",precision))throw new Error("Precision is not a Number");super(sample);this.inverse=inverse;this.precision=precision;}asymmetricMatch(other){if(!isA("Number",other))return false;let result=false;if(other===Number.POSITIVE_INFINITY&&this.sample===Number.POSITIVE_INFINITY){result=true;}else if(other===Number.NEGATIVE_INFINITY&&this.sample===Number.NEGATIVE_INFINITY){result=true;}else{result=Math.abs(this.sample-other)<10**-this.precision/2;}return this.inverse?!result:result;}toString(){return\`Number\${this.inverse?"Not":""}CloseTo\`;}getExpectedType(){return"number";}toAsymmetricMatcher(){return[this.toString(),this.sample,\`(\${pluralize("digit",this.precision)})\`].join(" ");}}const JestAsymmetricMatchers=(chai,utils)=>{utils.addMethod(chai.expect,"anything",()=>new Anything());utils.addMethod(chai.expect,"any",expected=>new Any(expected));utils.addMethod(chai.expect,"stringContaining",expected=>new StringContaining(expected));utils.addMethod(chai.expect,"objectContaining",expected=>new ObjectContaining(expected));utils.addMethod(chai.expect,"arrayContaining",expected=>new ArrayContaining(expected));utils.addMethod(chai.expect,"stringMatching",expected=>new StringMatching(expected));utils.addMethod(chai.expect,"closeTo",(expected,precision)=>new CloseTo(expected,precision));chai.expect.not={stringContaining:expected=>new StringContaining(expected,true),objectContaining:expected=>new ObjectContaining(expected,true),arrayContaining:expected=>new ArrayContaining(expected,true),stringMatching:expected=>new StringMatching(expected,true),closeTo:(expected,precision)=>new CloseTo(expected,precision,true)};};function recordAsyncExpect$1(test,promise){if(test&&promise instanceof Promise){promise=promise.finally(()=>{const index=test.promises.indexOf(promise);if(index!==-1)test.promises.splice(index,1);});if(!test.promises)test.promises=[];test.promises.push(promise);}return promise;}function wrapSoft(utils,fn){return function(...args){var _a;const test=utils.flag(this,"vitest-test");const state=(test==null?void 0:test.context._local)?test.context.expect.getState():getState(globalThis[GLOBAL_EXPECT$1]);if(!state.soft)return fn.apply(this,args);if(!test)throw new Error("expect.soft() can only be used inside a test");try{return fn.apply(this,args);}catch(err){test.result||(test.result={state:"fail"});test.result.state="fail";(_a=test.result).errors||(_a.errors=[]);test.result.errors.push(processError(err));}};}const JestChaiExpect=(chai,utils)=>{const AssertionError=chai.AssertionError;const c=()=>getColors();const customTesters=getCustomEqualityTesters();function def(name,fn){const addMethod=n=>{const softWrapper=wrapSoft(utils,fn);utils.addMethod(chai.Assertion.prototype,n,softWrapper);utils.addMethod(globalThis[JEST_MATCHERS_OBJECT$1].matchers,n,softWrapper);};if(Array.isArray(name))name.forEach(n=>addMethod(n));else addMethod(name);}["throw","throws","Throw"].forEach(m=>{utils.overwriteMethod(chai.Assertion.prototype,m,_super=>{return function(...args){const promise=utils.flag(this,"promise");const object=utils.flag(this,"object");const isNot=utils.flag(this,"negate");if(promise==="rejects"){utils.flag(this,"object",()=>{throw object;});}else if(promise==="resolves"&&typeof object!=="function"){if(!isNot){const message=utils.flag(this,"message")||"expected promise to throw an error, but it didn't";const error={showDiff:false};throw new AssertionError(message,error,utils.flag(this,"ssfi"));}else{return;}}_super.apply(this,args);};});});def("withTest",function(test){utils.flag(this,"vitest-test",test);return this;});def("toEqual",function(expected){const actual=utils.flag(this,"object");const equal=equals(actual,expected,[...customTesters,iterableEquality]);return this.assert(equal,"expected #{this} to deeply equal #{exp}","expected #{this} to not deeply equal #{exp}",expected,actual);});def("toStrictEqual",function(expected){const obj=utils.flag(this,"object");const equal=equals(obj,expected,[...customTesters,iterableEquality,typeEquality,sparseArrayEquality,arrayBufferEquality],true);return this.assert(equal,"expected #{this} to strictly equal #{exp}","expected #{this} to not strictly equal #{exp}",expected,obj);});def("toBe",function(expected){const actual=this._obj;const pass=Object.is(actual,expected);let deepEqualityName="";if(!pass){const toStrictEqualPass=equals(actual,expected,[...customTesters,iterableEquality,typeEquality,sparseArrayEquality,arrayBufferEquality],true);if(toStrictEqualPass){deepEqualityName="toStrictEqual";}else{const toEqualPass=equals(actual,expected,[...customTesters,iterableEquality]);if(toEqualPass)deepEqualityName="toEqual";}}return this.assert(pass,generateToBeMessage(deepEqualityName),"expected #{this} not to be #{exp} // Object.is equality",expected,actual);});def("toMatchObject",function(expected){const actual=this._obj;return this.assert(equals(actual,expected,[...customTesters,iterableEquality,subsetEquality]),"expected #{this} to match object #{exp}","expected #{this} to not match object #{exp}",expected,actual);});def("toMatch",function(expected){if(typeof expected==="string")return this.include(expected);else return this.match(expected);});def("toContain",function(item){const actual=this._obj;if(typeof Node!=="undefined"&&actual instanceof Node){if(!(item instanceof Node))throw new TypeError(\`toContain() expected a DOM node as the argument, but got \${typeof item}\`);return this.assert(actual.contains(item),"expected #{this} to contain element #{exp}","expected #{this} not to contain element #{exp}",item,actual);}if(typeof DOMTokenList!=="undefined"&&actual instanceof DOMTokenList){assertTypes(item,"class name",["string"]);const isNot=utils.flag(this,"negate");const expectedClassList=isNot?actual.value.replace(item,"").trim():\`\${actual.value} \${item}\`;return this.assert(actual.contains(item),\`expected "\${actual.value}" to contain "\${item}"\`,\`expected "\${actual.value}" not to contain "\${item}"\`,expectedClassList,actual.value);}if(actual!=null&&typeof actual!=="string")utils.flag(this,"object",Array.from(actual));return this.contain(item);});def("toContainEqual",function(expected){const obj=utils.flag(this,"object");const index=Array.from(obj).findIndex(item=>{return equals(item,expected,customTesters);});this.assert(index!==-1,"expected #{this} to deep equally contain #{exp}","expected #{this} to not deep equally contain #{exp}",expected);});def("toBeTruthy",function(){const obj=utils.flag(this,"object");this.assert(Boolean(obj),"expected #{this} to be truthy","expected #{this} to not be truthy",obj,false);});def("toBeFalsy",function(){const obj=utils.flag(this,"object");this.assert(!obj,"expected #{this} to be falsy","expected #{this} to not be falsy",obj,false);});def("toBeGreaterThan",function(expected){const actual=this._obj;assertTypes(actual,"actual",["number","bigint"]);assertTypes(expected,"expected",["number","bigint"]);return this.assert(actual>expected,\`expected \${actual} to be greater than \${expected}\`,\`expected \${actual} to be not greater than \${expected}\`,actual,expected,false);});def("toBeGreaterThanOrEqual",function(expected){const actual=this._obj;assertTypes(actual,"actual",["number","bigint"]);assertTypes(expected,"expected",["number","bigint"]);return this.assert(actual>=expected,\`expected \${actual} to be greater than or equal to \${expected}\`,\`expected \${actual} to be not greater than or equal to \${expected}\`,actual,expected,false);});def("toBeLessThan",function(expected){const actual=this._obj;assertTypes(actual,"actual",["number","bigint"]);assertTypes(expected,"expected",["number","bigint"]);return this.assert(actualString(key).replace(/([.[\\]])/g,"\\\\$1")).join(".");const actual=this._obj;const propertyName=args[0],expected=args[1];const getValue=()=>{const hasOwn=Object.prototype.hasOwnProperty.call(actual,propertyName);if(hasOwn)return{value:actual[propertyName],exists:true};return utils.getPathInfo(actual,propertyName);};const _getValue=getValue(),value=_getValue.value,exists=_getValue.exists;const pass=exists&&(args.length===1||equals(expected,value,customTesters));const valueString=args.length===1?"":\` with value \${utils.objDisplay(expected)}\`;return this.assert(pass,\`expected #{this} to have property "\${propertyName}"\${valueString}\`,\`expected #{this} to not have property "\${propertyName}"\${valueString}\`,expected,exists?value:void 0);});def("toBeCloseTo",function(received,precision=2){const expected=this._obj;let pass=false;let expectedDiff=0;let receivedDiff=0;if(received===Number.POSITIVE_INFINITY&&expected===Number.POSITIVE_INFINITY){pass=true;}else if(received===Number.NEGATIVE_INFINITY&&expected===Number.NEGATIVE_INFINITY){pass=true;}else{expectedDiff=10**-precision/2;receivedDiff=Math.abs(expected-received);pass=receivedDiff{if(!isMockFunction(assertion._obj))throw new TypeError(\`\${utils.inspect(assertion._obj)} is not a spy or a call to a spy!\`);};const getSpy=assertion=>{assertIsMock(assertion);return assertion._obj;};const ordinalOf=i=>{const j=i%10;const k=i%100;if(j===1&&k!==11)return\`\${i}st\`;if(j===2&&k!==12)return\`\${i}nd\`;if(j===3&&k!==13)return\`\${i}rd\`;return\`\${i}th\`;};const formatCalls=(spy,msg,actualCall)=>{if(spy.mock.calls){msg+=c().gray(\` + +Received: + +\${spy.mock.calls.map((callArg,i)=>{let methodCall=c().bold(\` \${ordinalOf(i+1)} \${spy.getMockName()} call: + +\`);if(actualCall)methodCall+=diff(actualCall,callArg,{omitAnnotationLines:true});else methodCall+=stringify(callArg).split("\\n").map(line=>\` \${line}\`).join("\\n");methodCall+="\\n";return methodCall;}).join("\\n")}\`);}msg+=c().gray(\` + +Number of calls: \${c().bold(spy.mock.calls.length)} +\`);return msg;};const formatReturns=(spy,msg,actualReturn)=>{msg+=c().gray(\` + +Received: + +\${spy.mock.results.map((callReturn,i)=>{let methodCall=c().bold(\` \${ordinalOf(i+1)} \${spy.getMockName()} call return: + +\`);if(actualReturn)methodCall+=diff(actualReturn,callReturn.value,{omitAnnotationLines:true});else methodCall+=stringify(callReturn).split("\\n").map(line=>\` \${line}\`).join("\\n");methodCall+="\\n";return methodCall;}).join("\\n")}\`);msg+=c().gray(\` + +Number of calls: \${c().bold(spy.mock.calls.length)} +\`);return msg;};def(["toHaveBeenCalledTimes","toBeCalledTimes"],function(number){const spy=getSpy(this);const spyName=spy.getMockName();const callCount=spy.mock.calls.length;return this.assert(callCount===number,\`expected "\${spyName}" to be called #{exp} times, but got \${callCount} times\`,\`expected "\${spyName}" to not be called #{exp} times\`,number,callCount,false);});def("toHaveBeenCalledOnce",function(){const spy=getSpy(this);const spyName=spy.getMockName();const callCount=spy.mock.calls.length;return this.assert(callCount===1,\`expected "\${spyName}" to be called once, but got \${callCount} times\`,\`expected "\${spyName}" to not be called once\`,1,callCount,false);});def(["toHaveBeenCalled","toBeCalled"],function(){const spy=getSpy(this);const spyName=spy.getMockName();const callCount=spy.mock.calls.length;const called=callCount>0;const isNot=utils.flag(this,"negate");let msg=utils.getMessage(this,[called,\`expected "\${spyName}" to be called at least once\`,\`expected "\${spyName}" to not be called at all, but actually been called \${callCount} times\`,true,called]);if(called&&isNot)msg=formatCalls(spy,msg);if(called&&isNot||!called&&!isNot)throw new AssertionError(msg);});def(["toHaveBeenCalledWith","toBeCalledWith"],function(...args){const spy=getSpy(this);const spyName=spy.getMockName();const pass=spy.mock.calls.some(callArg=>equals(callArg,args,[...customTesters,iterableEquality]));const isNot=utils.flag(this,"negate");const msg=utils.getMessage(this,[pass,\`expected "\${spyName}" to be called with arguments: #{exp}\`,\`expected "\${spyName}" to not be called with arguments: #{exp}\`,args]);if(pass&&isNot||!pass&&!isNot)throw new AssertionError(formatCalls(spy,msg,args));});def(["toHaveBeenNthCalledWith","nthCalledWith"],function(times,...args){const spy=getSpy(this);const spyName=spy.getMockName();const nthCall=spy.mock.calls[times-1];this.assert(equals(nthCall,args,[...customTesters,iterableEquality]),\`expected \${ordinalOf(times)} "\${spyName}" call to have been called with #{exp}\`,\`expected \${ordinalOf(times)} "\${spyName}" call to not have been called with #{exp}\`,args,nthCall);});def(["toHaveBeenLastCalledWith","lastCalledWith"],function(...args){const spy=getSpy(this);const spyName=spy.getMockName();const lastCall=spy.mock.calls[spy.mock.calls.length-1];this.assert(equals(lastCall,args,[...customTesters,iterableEquality]),\`expected last "\${spyName}" call to have been called with #{exp}\`,\`expected last "\${spyName}" call to not have been called with #{exp}\`,args,lastCall);});def(["toThrow","toThrowError"],function(expected){if(typeof expected==="string"||typeof expected==="undefined"||expected instanceof RegExp)return this.throws(expected);const obj=this._obj;const promise=utils.flag(this,"promise");const isNot=utils.flag(this,"negate");let thrown=null;if(promise==="rejects"){thrown=obj;}else if(promise==="resolves"&&typeof obj!=="function"){if(!isNot){const message=utils.flag(this,"message")||"expected promise to throw an error, but it didn't";const error={showDiff:false};throw new AssertionError(message,error,utils.flag(this,"ssfi"));}else{return;}}else{let isThrow=false;try{obj();}catch(err){isThrow=true;thrown=err;}if(!isThrow&&!isNot){const message=utils.flag(this,"message")||"expected function to throw an error, but it didn't";const error={showDiff:false};throw new AssertionError(message,error,utils.flag(this,"ssfi"));}}if(typeof expected==="function"){const name=expected.name||expected.prototype.constructor.name;return this.assert(thrown&&thrown instanceof expected,\`expected error to be instance of \${name}\`,\`expected error not to be instance of \${name}\`,expected,thrown);}if(expected instanceof Error){return this.assert(thrown&&expected.message===thrown.message,\`expected error to have message: \${expected.message}\`,\`expected error not to have message: \${expected.message}\`,expected.message,thrown&&thrown.message);}if(typeof expected==="object"&&"asymmetricMatch"in expected&&typeof expected.asymmetricMatch==="function"){const matcher=expected;return this.assert(thrown&&matcher.asymmetricMatch(thrown),"expected error to match asymmetric matcher","expected error not to match asymmetric matcher",matcher,thrown);}throw new Error(\`"toThrow" expects string, RegExp, function, Error instance or asymmetric matcher, got "\${typeof expected}"\`);});def(["toHaveReturned","toReturn"],function(){const spy=getSpy(this);const spyName=spy.getMockName();const calledAndNotThrew=spy.mock.calls.length>0&&spy.mock.results.some(({type})=>type!=="throw");this.assert(calledAndNotThrew,\`expected "\${spyName}" to be successfully called at least once\`,\`expected "\${spyName}" to not be successfully called\`,calledAndNotThrew,!calledAndNotThrew,false);});def(["toHaveReturnedTimes","toReturnTimes"],function(times){const spy=getSpy(this);const spyName=spy.getMockName();const successfulReturns=spy.mock.results.reduce((success,{type})=>type==="throw"?success:++success,0);this.assert(successfulReturns===times,\`expected "\${spyName}" to be successfully called \${times} times\`,\`expected "\${spyName}" to not be successfully called \${times} times\`,\`expected number of returns: \${times}\`,\`received number of returns: \${successfulReturns}\`,false);});def(["toHaveReturnedWith","toReturnWith"],function(value){const spy=getSpy(this);const spyName=spy.getMockName();const pass=spy.mock.results.some(({type,value:result})=>type==="return"&&equals(value,result));const isNot=utils.flag(this,"negate");const msg=utils.getMessage(this,[pass,\`expected "\${spyName}" to return with: #{exp} at least once\`,\`expected "\${spyName}" to not return with: #{exp}\`,value]);if(pass&&isNot||!pass&&!isNot)throw new AssertionError(formatReturns(spy,msg,value));});def(["toHaveLastReturnedWith","lastReturnedWith"],function(value){const spy=getSpy(this);const spyName=spy.getMockName();const lastResult=spy.mock.results[spy.mock.results.length-1].value;const pass=equals(lastResult,value);this.assert(pass,\`expected last "\${spyName}" call to return #{exp}\`,\`expected last "\${spyName}" call to not return #{exp}\`,value,lastResult);});def(["toHaveNthReturnedWith","nthReturnedWith"],function(nthCall,value){const spy=getSpy(this);const spyName=spy.getMockName();const isNot=utils.flag(this,"negate");const _spy$mock$results=spy.mock.results[nthCall-1],callType=_spy$mock$results.type,callResult=_spy$mock$results.value;const ordinalCall=\`\${ordinalOf(nthCall)} call\`;if(!isNot&&callType==="throw")chai.assert.fail(\`expected \${ordinalCall} to return #{exp}, but instead it threw an error\`);const nthCallReturn=equals(callResult,value);this.assert(nthCallReturn,\`expected \${ordinalCall} "\${spyName}" call to return #{exp}\`,\`expected \${ordinalCall} "\${spyName}" call to not return #{exp}\`,value,callResult);});def("toSatisfy",function(matcher,message){return this.be.satisfy(matcher,message);});utils.addProperty(chai.Assertion.prototype,"resolves",function __VITEST_RESOLVES__(){const error=new Error("resolves");utils.flag(this,"promise","resolves");utils.flag(this,"error",error);const test=utils.flag(this,"vitest-test");const obj=utils.flag(this,"object");if(typeof(obj==null?void 0:obj.then)!=="function")throw new TypeError(\`You must provide a Promise to expect() when using .resolves, not '\${typeof obj}'.\`);const proxy=new Proxy(this,{get:(target,key,receiver)=>{const result=Reflect.get(target,key,receiver);if(typeof result!=="function")return result instanceof chai.Assertion?proxy:result;return async(...args)=>{const promise=obj.then(value=>{utils.flag(this,"object",value);return result.call(this,...args);},err=>{const _error=new AssertionError(\`promise rejected "\${utils.inspect(err)}" instead of resolving\`,{showDiff:false});_error.cause=err;_error.stack=error.stack.replace(error.message,_error.message);throw _error;});return recordAsyncExpect$1(test,promise);};}});return proxy;});utils.addProperty(chai.Assertion.prototype,"rejects",function __VITEST_REJECTS__(){const error=new Error("rejects");utils.flag(this,"promise","rejects");utils.flag(this,"error",error);const test=utils.flag(this,"vitest-test");const obj=utils.flag(this,"object");const wrapper=typeof obj==="function"?obj():obj;if(typeof(wrapper==null?void 0:wrapper.then)!=="function")throw new TypeError(\`You must provide a Promise to expect() when using .rejects, not '\${typeof wrapper}'.\`);const proxy=new Proxy(this,{get:(target,key,receiver)=>{const result=Reflect.get(target,key,receiver);if(typeof result!=="function")return result instanceof chai.Assertion?proxy:result;return async(...args)=>{const promise=wrapper.then(value=>{const _error=new AssertionError(\`promise resolved "\${utils.inspect(value)}" instead of rejecting\`,{showDiff:true,expected:new Error("rejected promise"),actual:value});_error.stack=error.stack.replace(error.message,_error.message);throw _error;},err=>{utils.flag(this,"object",err);return result.call(this,...args);});return recordAsyncExpect$1(test,promise);};}});return proxy;});};function getMatcherState(assertion,expect){const obj=assertion._obj;const isNot=util.flag(assertion,"negate");const promise=util.flag(assertion,"promise")||"";const jestUtils=_objectSpread(_objectSpread({},getMatcherUtils()),{},{diff,stringify,iterableEquality,subsetEquality});const matcherState=_objectSpread(_objectSpread({},getState(expect)),{},{customTesters:getCustomEqualityTesters(),isNot,utils:jestUtils,promise,equals,// needed for built-in jest-snapshots, but we don't use it +suppressedErrors:[]});return{state:matcherState,isNot,obj};}class JestExtendError extends Error{constructor(message,actual,expected){super(message);this.actual=actual;this.expected=expected;}}function JestExtendPlugin(expect,matchers){return(c,utils)=>{Object.entries(matchers).forEach(([expectAssertionName,expectAssertion])=>{function expectWrapper(...args){const _getMatcherState=getMatcherState(this,expect),state=_getMatcherState.state,isNot=_getMatcherState.isNot,obj=_getMatcherState.obj;const result=expectAssertion.call(state,obj,...args);if(result&&typeof result==="object"&&result instanceof Promise){return result.then(({pass:pass2,message:message2,actual:actual2,expected:expected2})=>{if(pass2&&isNot||!pass2&&!isNot)throw new JestExtendError(message2(),actual2,expected2);});}const pass=result.pass,message=result.message,actual=result.actual,expected=result.expected;if(pass&&isNot||!pass&&!isNot)throw new JestExtendError(message(),actual,expected);}const softWrapper=wrapSoft(utils,expectWrapper);utils.addMethod(globalThis[JEST_MATCHERS_OBJECT$1].matchers,expectAssertionName,softWrapper);utils.addMethod(c.Assertion.prototype,expectAssertionName,softWrapper);class CustomMatcher extends AsymmetricMatcher$1{constructor(inverse=false,...sample){super(sample,inverse);}asymmetricMatch(other){const _expectAssertion$call=expectAssertion.call(this.getMatcherContext(expect),other,...this.sample),pass=_expectAssertion$call.pass;return this.inverse?!pass:pass;}toString(){return\`\${this.inverse?"not.":""}\${expectAssertionName}\`;}getExpectedType(){return"any";}toAsymmetricMatcher(){return\`\${this.toString()}<\${this.sample.map(String).join(", ")}>\`;}}const customMatcher=(...sample)=>new CustomMatcher(false,...sample);Object.defineProperty(expect,expectAssertionName,{configurable:true,enumerable:true,value:customMatcher,writable:true});Object.defineProperty(expect.not,expectAssertionName,{configurable:true,enumerable:true,value:(...sample)=>new CustomMatcher(true,...sample),writable:true});Object.defineProperty(globalThis[ASYMMETRIC_MATCHERS_OBJECT$1],expectAssertionName,{configurable:true,enumerable:true,value:customMatcher,writable:true});});};}const JestExtend=(chai,utils)=>{utils.addMethod(chai.expect,"extend",(expect,expects)=>{chai.use(JestExtendPlugin(expect,expects));});};function getDefaultExportFromCjs(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,'default')?x['default']:x;}var naturalCompare$2={exports:{}};/* + * @version 1.4.0 + * @date 2015-10-26 + * @stability 3 - Stable + * @author Lauri Rooden (https://github.com/litejs/natural-compare-lite) + * @license MIT License + */var naturalCompare=function(a,b){var i,codeA,codeB=1,posA=0,posB=0,alphabet=String.alphabet;function getCode(str,pos,code){if(code){for(i=pos;code=getCode(str,i),code<76&&code>65;)++i;return+str.slice(pos-1,i);}code=alphabet&&alphabet.indexOf(str.charAt(pos));return code>-1?code+76:(code=str.charCodeAt(pos)||0,code<45||code>127)?code:code<46?65// - +:code<48?code-1:code<58?code+18// 0-9 +:code<65?code-11:code<91?code+11// A-Z +:code<97?code-37:code<123?code+5// a-z +:code-63;}if((a+="")!=(b+=""))for(;codeB;){codeA=getCode(a,posA++);codeB=getCode(b,posB++);if(codeA<76&&codeB<76&&codeA>66&&codeB>66){codeA=getCode(a,posA,posA);codeB=getCode(b,posB,posA=i);posB=i;}if(codeA!=codeB)return codeA'Promise{…}';try{const _process$binding2=process.binding('util'),getPromiseDetails=_process$binding2.getPromiseDetails,kPending=_process$binding2.kPending,kRejected=_process$binding2.kRejected;if(Array.isArray(getPromiseDetails(Promise.resolve()))){getPromiseValue=(value,options)=>{const _getPromiseDetails3=getPromiseDetails(value),_getPromiseDetails4=_slicedToArray(_getPromiseDetails3,2),state=_getPromiseDetails4[0],innerValue=_getPromiseDetails4[1];if(state===kPending){return'Promise{}';}return\`Promise\${state===kRejected?'!':''}{\${options.inspect(innerValue,options)}}\`;};}}catch(notNode){/* ignore */}/* ! + * loupe + * Copyright(c) 2013 Jake Luer + * MIT Licensed + */let nodeInspect=false;try{// eslint-disable-next-line global-require +const nodeUtil=require('util');nodeInspect=nodeUtil.inspect?nodeUtil.inspect.custom:false;}catch(noNodeInspect){nodeInspect=false;}const lineSplitRE=/\\r?\\n/;function positionToOffset(source,lineNumber,columnNumber){const lines=source.split(lineSplitRE);const nl=/\\r\\n/.test(source)?2:1;let start=0;if(lineNumber>lines.length)return source.length;for(let i=0;isource.length){throw new Error(\`offset is longer than source length! offset \${offset} > length \${source.length}\`);}const lines=source.split(lineSplitRE);const nl=/\\r\\n/.test(source)?2:1;let counted=0;let line=0;for(;line=offset)break;counted+=lineLength;}return line+1;}// Copyright 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Simon Lydell +// License: MIT. +var LineTerminatorSequence;LineTerminatorSequence=/\\r?\\n|[\\r\\u2028\\u2029]/y;RegExp(LineTerminatorSequence.source);// src/index.ts +var reservedWords={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"]};new Set(reservedWords.keyword);new Set(reservedWords.strict);const serialize$1=(val,config,indentation,depth,refs,printer)=>{const name=val.getMockName();const nameString=name==="vi.fn()"?"":\` \${name}\`;let callsString="";if(val.mock.calls.length!==0){const indentationNext=indentation+config.indent;callsString=\` {\${config.spacingOuter}\${indentationNext}"calls": \${printer(val.mock.calls,config,indentationNext,depth,refs)}\${config.min?", ":","}\${config.spacingOuter}\${indentationNext}"results": \${printer(val.mock.results,config,indentationNext,depth,refs)}\${config.min?"":","}\${config.spacingOuter}\${indentation}}\`;}return\`[MockFunction\${nameString}]\${callsString}\`;};const test=val=>val&&!!val._isMockFunction;const plugin={serialize:serialize$1,test};const _plugins_3=plugins_1,DOMCollection=_plugins_3.DOMCollection,DOMElement=_plugins_3.DOMElement,Immutable=_plugins_3.Immutable,ReactElement=_plugins_3.ReactElement,ReactTestComponent=_plugins_3.ReactTestComponent,AsymmetricMatcher=_plugins_3.AsymmetricMatcher;let PLUGINS=[ReactTestComponent,ReactElement,DOMElement,DOMCollection,Immutable,AsymmetricMatcher,plugin];function addSerializer(plugin){PLUGINS=[plugin].concat(PLUGINS);}function getSerializers(){return PLUGINS;}function testNameToKey(testName,count){return\`\${testName} \${count}\`;}function keyToTestName(key){if(!/ \\d+$/.test(key))throw new Error("Snapshot keys must end with a number.");return key.replace(/ \\d+$/,"");}function getSnapshotData(content,options){const update=options.updateSnapshot;const data=/* @__PURE__ */Object.create(null);let snapshotContents="";let dirty=false;if(content!=null){try{snapshotContents=content;const populate=new Function("exports",snapshotContents);populate(data);}catch{}}const isInvalid=snapshotContents;if((update==="all"||update==="new")&&isInvalid)dirty=true;return{data,dirty};}function addExtraLineBreaks(string){return string.includes("\\n")?\` +\${string} +\`:string;}function removeExtraLineBreaks(string){return string.length>2&&string.startsWith("\\n")&&string.endsWith("\\n")?string.slice(1,-1):string;}const escapeRegex=true;const printFunctionName=false;function serialize(val,indent=2,formatOverrides={}){return normalizeNewlines(format_1(val,_objectSpread({escapeRegex,indent,plugins:getSerializers(),printFunctionName},formatOverrides)));}function escapeBacktickString(str){return str.replace(/\`|\\\\|\\\${/g,"\\\\$&");}function printBacktickString(str){return\`\\\`\${escapeBacktickString(str)}\\\`\`;}function normalizeNewlines(string){return string.replace(/\\r\\n|\\r/g,"\\n");}async function saveSnapshotFile(environment,snapshotData,snapshotPath){const snapshots=Object.keys(snapshotData).sort(naturalCompare$1).map(key=>\`exports[\${printBacktickString(key)}] = \${printBacktickString(normalizeNewlines(snapshotData[key]))};\`);const content=\`\${environment.getHeader()} + +\${snapshots.join("\\n\\n")} +\`;const oldContent=await environment.readSnapshotFile(snapshotPath);const skipWriting=oldContent!=null&&oldContent===content;if(skipWriting)return;await environment.saveSnapshotFile(snapshotPath,content);}function prepareExpected(expected){function findStartIndent(){var _a,_b;const matchObject=/^( +)}\\s+$/m.exec(expected||"");const objectIndent=(_a=matchObject==null?void 0:matchObject[1])==null?void 0:_a.length;if(objectIndent)return objectIndent;const matchText=/^\\n( +)"/.exec(expected||"");return((_b=matchText==null?void 0:matchText[1])==null?void 0:_b.length)||0;}const startIndent=findStartIndent();let expectedTrimmed=expected==null?void 0:expected.trim();if(startIndent){expectedTrimmed=expectedTrimmed==null?void 0:expectedTrimmed.replace(new RegExp(\`^\${" ".repeat(startIndent)}\`,"gm"),"").replace(/ +}$/,"}");}return expectedTrimmed;}function deepMergeArray(target=[],source=[]){const mergedOutput=Array.from(target);source.forEach((sourceElement,index)=>{const targetElement=mergedOutput[index];if(Array.isArray(target[index])){mergedOutput[index]=deepMergeArray(target[index],sourceElement);}else if(isObject(targetElement)){mergedOutput[index]=deepMergeSnapshot(target[index],sourceElement);}else{mergedOutput[index]=sourceElement;}});return mergedOutput;}function deepMergeSnapshot(target,source){if(isObject(target)&&isObject(source)){const mergedOutput=_objectSpread({},target);Object.keys(source).forEach(key=>{if(isObject(source[key])&&!source[key].$$typeof){if(!(key in target))Object.assign(mergedOutput,{[key]:source[key]});else mergedOutput[key]=deepMergeSnapshot(target[key],source[key]);}else if(Array.isArray(source[key])){mergedOutput[key]=deepMergeArray(target[key],source[key]);}else{Object.assign(mergedOutput,{[key]:source[key]});}});return mergedOutput;}else if(Array.isArray(target)&&Array.isArray(source)){return deepMergeArray(target,source);}return target;}const comma=','.charCodeAt(0);const chars$1='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';const intToChar$1=new Uint8Array(64);// 64 possible chars. +const charToInt$1=new Uint8Array(128);// z is 122 in ASCII +for(let i=0;i>>=1;if(shouldNegate){value=-0x80000000|-value;}state[j]+=value;return pos;}function hasMoreVlq(mappings,i,length){if(i>=length)return false;return mappings.charCodeAt(i)!==comma;}function sort$1(line){line.sort(sortComparator$1);}function sortComparator$1(a,b){return a[0]-b[0];}// Matches the scheme of a URL, eg "http://" +const schemeRegex=/^[\\w+.-]+:\\/\\//;/** + * Matches the parts of a URL: + * 1. Scheme, including ":", guaranteed. + * 2. User/password, including "@", optional. + * 3. Host, guaranteed. + * 4. Port, including ":", optional. + * 5. Path, including "/", optional. + * 6. Query, including "?", optional. + * 7. Hash, including "#", optional. + */const urlRegex=/^([\\w+.-]+:)\\/\\/([^@/#?]*@)?([^:/#?]*)(:\\d+)?(\\/[^#?]*)?(\\?[^#]*)?(#.*)?/;/** + * File URLs are weird. They dont' need the regular \`//\` in the scheme, they may or may not start + * with a leading \`/\`, they can have a domain (but only if they don't start with a Windows drive). + * + * 1. Host, optional. + * 2. Path, which may include "/", guaranteed. + * 3. Query, including "?", optional. + * 4. Hash, including "#", optional. + */const fileRegex=/^file:(?:\\/\\/((?![a-z]:)[^/#?]*)?)?(\\/?[^#?]*)(\\?[^#]*)?(#.*)?/i;var UrlType$1;(function(UrlType){UrlType[UrlType["Empty"]=1]="Empty";UrlType[UrlType["Hash"]=2]="Hash";UrlType[UrlType["Query"]=3]="Query";UrlType[UrlType["RelativePath"]=4]="RelativePath";UrlType[UrlType["AbsolutePath"]=5]="AbsolutePath";UrlType[UrlType["SchemeRelative"]=6]="SchemeRelative";UrlType[UrlType["Absolute"]=7]="Absolute";})(UrlType$1||(UrlType$1={}));function isAbsoluteUrl(input){return schemeRegex.test(input);}function isSchemeRelativeUrl(input){return input.startsWith('//');}function isAbsolutePath(input){return input.startsWith('/');}function isFileUrl(input){return input.startsWith('file:');}function isRelative(input){return /^[.?#]/.test(input);}function parseAbsoluteUrl(input){const match=urlRegex.exec(input);return makeUrl(match[1],match[2]||'',match[3],match[4]||'',match[5]||'/',match[6]||'',match[7]||'');}function parseFileUrl(input){const match=fileRegex.exec(input);const path=match[2];return makeUrl('file:','',match[1]||'','',isAbsolutePath(path)?path:'/'+path,match[3]||'',match[4]||'');}function makeUrl(scheme,user,host,port,path,query,hash){return{scheme,user,host,port,path,query,hash,type:UrlType$1.Absolute};}function parseUrl(input){if(isSchemeRelativeUrl(input)){const url=parseAbsoluteUrl('http:'+input);url.scheme='';url.type=UrlType$1.SchemeRelative;return url;}if(isAbsolutePath(input)){const url=parseAbsoluteUrl('http://foo.com'+input);url.scheme='';url.host='';url.type=UrlType$1.AbsolutePath;return url;}if(isFileUrl(input))return parseFileUrl(input);if(isAbsoluteUrl(input))return parseAbsoluteUrl(input);const url=parseAbsoluteUrl('http://foo.com/'+input);url.scheme='';url.host='';url.type=input?input.startsWith('?')?UrlType$1.Query:input.startsWith('#')?UrlType$1.Hash:UrlType$1.RelativePath:UrlType$1.Empty;return url;}function stripPathFilename(path){// If a path ends with a parent directory "..", then it's a relative path with excess parent +// paths. It's not a file, so we can't strip it. +if(path.endsWith('/..'))return path;const index=path.lastIndexOf('/');return path.slice(0,index+1);}function mergePaths(url,base){normalizePath(base,base.type);// If the path is just a "/", then it was an empty path to begin with (remember, we're a relative +// path). +if(url.path==='/'){url.path=base.path;}else{// Resolution happens relative to the base path's directory, not the file. +url.path=stripPathFilename(base.path)+url.path;}}/** + * The path can have empty directories "//", unneeded parents "foo/..", or current directory + * "foo/.". We need to normalize to a standard representation. + */function normalizePath(url,type){const rel=type<=UrlType$1.RelativePath;const pieces=url.path.split('/');// We need to preserve the first piece always, so that we output a leading slash. The item at +// pieces[0] is an empty string. +let pointer=1;// Positive is the number of real directories we've output, used for popping a parent directory. +// Eg, "foo/bar/.." will have a positive 2, and we can decrement to be left with just "foo". +let positive=0;// We need to keep a trailing slash if we encounter an empty directory (eg, splitting "foo/" will +// generate \`["foo", ""]\` pieces). And, if we pop a parent directory. But once we encounter a +// real directory, we won't need to append, unless the other conditions happen again. +let addTrailingSlash=false;for(let i=1;iinputType)inputType=baseType;}normalizePath(url,inputType);const queryHash=url.query+url.hash;switch(inputType){// This is impossible, because of the empty checks at the start of the function. +// case UrlType.Empty: +case UrlType$1.Hash:case UrlType$1.Query:return queryHash;case UrlType$1.RelativePath:{// The first char is always a "/", and we need it to be relative. +const path=url.path.slice(1);if(!path)return queryHash||'.';if(isRelative(base||input)&&!isRelative(path)){// If base started with a leading ".", or there is no base and input started with a ".", +// then we need to ensure that the relative path starts with a ".". We don't know if +// relative starts with a "..", though, so check before prepending. +return'./'+path+queryHash;}return path+queryHash;}case UrlType$1.AbsolutePath:return url.path+queryHash;default:return url.scheme+'//'+url.user+url.host+url.port+url.path+queryHash;}}function resolve(input,base){// The base is always treated as a directory, if it's not empty. +// https://github.com/mozilla/source-map/blob/8cb3ee57/lib/util.js#L327 +// https://github.com/chromium/chromium/blob/da4adbb3/third_party/blink/renderer/devtools/front_end/sdk/SourceMap.js#L400-L401 +if(base&&!base.endsWith('/'))base+='/';return resolve$1(input,base);}/** + * Removes everything after the last "/", but leaves the slash. + */function stripFilename(path){if(!path)return'';const index=path.lastIndexOf('/');return path.slice(0,index+1);}const COLUMN=0;const SOURCES_INDEX=1;const SOURCE_LINE=2;const SOURCE_COLUMN=3;const NAMES_INDEX=4;function maybeSort(mappings,owned){const unsortedIndex=nextUnsortedSegmentLine(mappings,0);if(unsortedIndex===mappings.length)return mappings;// If we own the array (meaning we parsed it from JSON), then we're free to directly mutate it. If +// not, we do not want to modify the consumer's input array. +if(!owned)mappings=mappings.slice();for(let i=unsortedIndex;i item - needle); + * + * assert.equal(index, 0); + * array.splice(index + 1, 0, needle); + * assert.deepEqual(array, [1, 2, 3]); + * \`\`\` + */function binarySearch(haystack,needle,low,high){while(low<=high){const mid=low+(high-low>>1);const cmp=haystack[mid][COLUMN]-needle;if(cmp===0){found=true;return mid;}if(cmp<0){low=mid+1;}else{high=mid-1;}}found=false;return low-1;}function upperBound(haystack,needle,index){for(let i=index+1;i=0;index=i--){if(haystack[i][COLUMN]!==needle)break;}return index;}function memoizedState(){return{lastKey:-1,lastNeedle:-1,lastIndex:-1};}/** + * This overly complicated beast is just to record the last tested line/column and the resulting + * index, allowing us to skip a few tests if mappings are monotonically increasing. + */function memoizedBinarySearch(haystack,needle,state,key){const lastKey=state.lastKey,lastNeedle=state.lastNeedle,lastIndex=state.lastIndex;let low=0;let high=haystack.length-1;if(key===lastKey){if(needle===lastNeedle){found=lastIndex!==-1&&haystack[lastIndex][COLUMN]===needle;return lastIndex;}if(needle>=lastNeedle){// lastIndex may be -1 if the previous needle was not found. +low=lastIndex===-1?0:lastIndex;}else{high=lastIndex;}}state.lastKey=key;state.lastNeedle=needle;return state.lastIndex=binarySearch(haystack,needle,low,high);}const LINE_GTR_ZERO='\`line\` must be greater than 0 (lines start at line 1)';const COL_GTR_EQ_ZERO='\`column\` must be greater than or equal to 0 (columns start at column 0)';const LEAST_UPPER_BOUND=-1;const GREATEST_LOWER_BOUND=1;/** + * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field. + */let decodedMappings;/** + * A higher-level API to find the source/line/column associated with a generated line/column + * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in + * \`source-map\` library. + */let originalPositionFor;class TraceMap{constructor(map,mapUrl){const isString=typeof map==='string';if(!isString&&map._decodedMemo)return map;const parsed=isString?JSON.parse(map):map;const version=parsed.version,file=parsed.file,names=parsed.names,sourceRoot=parsed.sourceRoot,sources=parsed.sources,sourcesContent=parsed.sourcesContent;this.version=version;this.file=file;this.names=names||[];this.sourceRoot=sourceRoot;this.sources=sources;this.sourcesContent=sourcesContent;const from=resolve(sourceRoot||'',stripFilename(mapUrl));this.resolvedSources=sources.map(s=>resolve(s||'',from));const mappings=parsed.mappings;if(typeof mappings==='string'){this._encoded=mappings;this._decoded=undefined;}else{this._encoded=undefined;this._decoded=maybeSort(mappings,isString);}this._decodedMemo=memoizedState();this._bySources=undefined;this._bySourceMemos=undefined;}}(()=>{decodedMappings=map=>{return map._decoded||(map._decoded=decode(map._encoded));};originalPositionFor=(map,{line,column,bias})=>{line--;if(line<0)throw new Error(LINE_GTR_ZERO);if(column<0)throw new Error(COL_GTR_EQ_ZERO);const decoded=decodedMappings(map);// It's common for parent source maps to have pointers to lines that have no +// mapping (like a "//# sourceMappingURL=") at the end of the child file. +if(line>=decoded.length)return OMapping(null,null,null,null);const segments=decoded[line];const index=traceSegmentInternal(segments,map._decodedMemo,line,column,bias||GREATEST_LOWER_BOUND);if(index===-1)return OMapping(null,null,null,null);const segment=segments[index];if(segment.length===1)return OMapping(null,null,null,null);const names=map.names,resolvedSources=map.resolvedSources;return OMapping(resolvedSources[segment[SOURCES_INDEX]],segment[SOURCE_LINE]+1,segment[SOURCE_COLUMN],segment.length===5?names[segment[NAMES_INDEX]]:null);};})();function OMapping(source,line,column,name){return{source,line,column,name};}function traceSegmentInternal(segments,memo,line,column,bias){let index=memoizedBinarySearch(segments,column,memo,line);if(found){index=(bias===LEAST_UPPER_BOUND?upperBound:lowerBound)(segments,column,index);}else if(bias===LEAST_UPPER_BOUND)index++;if(index===-1||index===segments.length)return-1;return index;}const CHROME_IE_STACK_REGEXP$1=/^\\s*at .*(\\S+:\\d+|\\(native\\))/m;const SAFARI_NATIVE_CODE_REGEXP$1=/^(eval@)?(\\[native code])?$/;const stackIgnorePatterns=["node:internal",/\\/packages\\/\\w+\\/dist\\//,/\\/@vitest\\/\\w+\\/dist\\//,"/vitest/dist/","/vitest/src/","/vite-node/dist/","/vite-node/src/","/node_modules/chai/","/node_modules/tinypool/","/node_modules/tinyspy/","/deps/chai.js",/__vitest_browser__/];function extractLocation$1(urlLike){if(!urlLike.includes(":"))return[urlLike];const regExp=/(.+?)(?::(\\d+))?(?::(\\d+))?$/;const parts=regExp.exec(urlLike.replace(/^\\(|\\)$/g,""));if(!parts)return[urlLike];let url=parts[1];if(url.startsWith("http:")||url.startsWith("https:")){const urlObj=new URL(url);url=urlObj.pathname;}if(url.startsWith("/@fs/")){url=url.slice(typeof process!=="undefined"&&process.platform==="win32"?5:4);}return[url,parts[2]||void 0,parts[3]||void 0];}function parseSingleFFOrSafariStack$1(raw){let line=raw.trim();if(SAFARI_NATIVE_CODE_REGEXP$1.test(line))return null;if(line.includes(" > eval"))line=line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval:\\d+:\\d+/g,":$1");if(!line.includes("@")&&!line.includes(":"))return null;const functionNameRegex=/((.*".+"[^@]*)?[^@]*)(?:@)/;const matches=line.match(functionNameRegex);const functionName=matches&&matches[1]?matches[1]:void 0;const _extractLocation$=extractLocation$1(line.replace(functionNameRegex,"")),_extractLocation$2=_slicedToArray(_extractLocation$,3),url=_extractLocation$2[0],lineNumber=_extractLocation$2[1],columnNumber=_extractLocation$2[2];if(!url||!lineNumber||!columnNumber)return null;return{file:url,method:functionName||"",line:Number.parseInt(lineNumber),column:Number.parseInt(columnNumber)};}function parseSingleV8Stack$1(raw){let line=raw.trim();if(!CHROME_IE_STACK_REGEXP$1.test(line))return null;if(line.includes("(eval "))line=line.replace(/eval code/g,"eval").replace(/(\\(eval at [^()]*)|(,.*$)/g,"");let sanitizedLine=line.replace(/^\\s+/,"").replace(/\\(eval code/g,"(").replace(/^.*?\\s+/,"");const location=sanitizedLine.match(/ (\\(.+\\)$)/);sanitizedLine=location?sanitizedLine.replace(location[0],""):sanitizedLine;const _extractLocation$3=extractLocation$1(location?location[1]:sanitizedLine),_extractLocation$4=_slicedToArray(_extractLocation$3,3),url=_extractLocation$4[0],lineNumber=_extractLocation$4[1],columnNumber=_extractLocation$4[2];let method=location&&sanitizedLine||"";let file=url&&["eval",""].includes(url)?void 0:url;if(!file||!lineNumber||!columnNumber)return null;if(method.startsWith("async "))method=method.slice(6);if(file.startsWith("file://"))file=file.slice(7);file=resolve$3(file);if(method)method=method.replace(/__vite_ssr_import_\\d+__\\./g,"");return{method,file,line:Number.parseInt(lineNumber),column:Number.parseInt(columnNumber)};}function parseStacktrace(stack,options={}){const _options$ignoreStackE=options.ignoreStackEntries,ignoreStackEntries=_options$ignoreStackE===void 0?stackIgnorePatterns:_options$ignoreStackE;let stacks=!CHROME_IE_STACK_REGEXP$1.test(stack)?parseFFOrSafariStackTrace(stack):parseV8Stacktrace(stack);if(ignoreStackEntries.length)stacks=stacks.filter(stack2=>!ignoreStackEntries.some(p=>stack2.file.match(p)));return stacks.map(stack2=>{var _a;const map=(_a=options.getSourceMap)==null?void 0:_a.call(options,stack2.file);if(!map||typeof map!=="object"||!map.version)return stack2;const traceMap=new TraceMap(map);const _originalPositionFor=originalPositionFor(traceMap,stack2),line=_originalPositionFor.line,column=_originalPositionFor.column;if(line!=null&&column!=null)return _objectSpread(_objectSpread({},stack2),{},{line,column});return stack2;});}function parseFFOrSafariStackTrace(stack){return stack.split("\\n").map(line=>parseSingleFFOrSafariStack$1(line)).filter(notNullish);}function parseV8Stacktrace(stack){return stack.split("\\n").map(line=>parseSingleV8Stack$1(line)).filter(notNullish);}function parseErrorStacktrace(e,options={}){if(!e||isPrimitive(e))return[];if(e.stacks)return e.stacks;const stackStr=e.stack||e.stackStr||"";let stackFrames=parseStacktrace(stackStr,options);if(options.frameFilter)stackFrames=stackFrames.filter(f=>options.frameFilter(e,f)!==false);e.stacks=stackFrames;return stackFrames;}async function saveInlineSnapshots(environment,snapshots){const MagicString=(await import('./bundle-ly9OXwfJ.js')).default;const files=new Set(snapshots.map(i=>i.file));await Promise.all(Array.from(files).map(async file=>{const snaps=snapshots.filter(i=>i.file===file);const code=await environment.readSnapshotFile(file);const s=new MagicString(code);for(const snap of snaps){const index=positionToOffset(code,snap.line,snap.column);replaceInlineSnap(code,s,index,snap.snapshot);}const transformed=s.toString();if(transformed!==code)await environment.saveSnapshotFile(file,transformed);}));}const startObjectRegex=/(?:toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot)\\s*\\(\\s*(?:\\/\\*[\\S\\s]*\\*\\/\\s*|\\/\\/.*\\s+)*\\s*({)/m;function replaceObjectSnap(code,s,index,newSnap){let _code=code.slice(index);const startMatch=startObjectRegex.exec(_code);if(!startMatch)return false;_code=_code.slice(startMatch.index);let callEnd=getCallLastIndex(_code);if(callEnd===null)return false;callEnd+=index+startMatch.index;const shapeStart=index+startMatch.index+startMatch[0].length;const shapeEnd=getObjectShapeEndIndex(code,shapeStart);const snap=\`, \${prepareSnapString(newSnap,code,index)}\`;if(shapeEnd===callEnd){s.appendLeft(callEnd,snap);}else{s.overwrite(shapeEnd,callEnd,snap);}return true;}function getObjectShapeEndIndex(code,index){let startBraces=1;let endBraces=0;while(startBraces!==endBraces&&indexi?indentNext+i:"").join("\\n").replace(/\`/g,"\\\\\`").replace(/\\\${/g,"\\\\\${")} +\${indent}\${quote}\`;}const startRegex=/(?:toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot)\\s*\\(\\s*(?:\\/\\*[\\S\\s]*\\*\\/\\s*|\\/\\/.*\\s+)*\\s*[\\w_$]*(['"\`\\)])/m;function replaceInlineSnap(code,s,index,newSnap){const codeStartingAtIndex=code.slice(index);const startMatch=startRegex.exec(codeStartingAtIndex);const firstKeywordMatch=/toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot/.exec(codeStartingAtIndex);if(!startMatch||startMatch.index!==(firstKeywordMatch==null?void 0:firstKeywordMatch.index))return replaceObjectSnap(code,s,index,newSnap);const quote=startMatch[1];const startIndex=index+startMatch.index+startMatch[0].length;const snapString=prepareSnapString(newSnap,code,index);if(quote===")"){s.appendRight(startIndex-1,snapString);return true;}const quoteEndRE=new RegExp(\`(?:^|[^\\\\\\\\])\${quote}\`);const endMatch=quoteEndRE.exec(code.slice(startIndex));if(!endMatch)return false;const endIndex=startIndex+endMatch.index+endMatch[0].length;s.overwrite(startIndex-1,endIndex,snapString);return true;}const INDENTATION_REGEX=/^([^\\S\\n]*)\\S/m;function stripSnapshotIndentation(inlineSnapshot){const match=inlineSnapshot.match(INDENTATION_REGEX);if(!match||!match[1]){return inlineSnapshot;}const indentation=match[1];const lines=inlineSnapshot.split(/\\n/g);if(lines.length<=2){return inlineSnapshot;}if(lines[0].trim()!==""||lines[lines.length-1].trim()!==""){return inlineSnapshot;}for(let i=1;i{if(!snap.readonly)await environment.saveSnapshotFile(snap.file,snap.snapshot);}));}class SnapshotState{constructor(testFilePath,snapshotPath,snapshotContent,options){this.testFilePath=testFilePath;this.snapshotPath=snapshotPath;const _getSnapshotData=getSnapshotData(snapshotContent,options),data=_getSnapshotData.data,dirty=_getSnapshotData.dirty;this._fileExists=snapshotContent!=null;this._initialData=data;this._snapshotData=data;this._dirty=dirty;this._inlineSnapshots=[];this._rawSnapshots=[];this._uncheckedKeys=new Set(Object.keys(this._snapshotData));this._counters=/* @__PURE__ */new Map();this.expand=options.expand||false;this.added=0;this.matched=0;this.unmatched=0;this._updateSnapshot=options.updateSnapshot;this.updated=0;this._snapshotFormat=_objectSpread({printBasicPrototype:false,escapeString:false},options.snapshotFormat);this._environment=options.snapshotEnvironment;}_counters;_dirty;_updateSnapshot;_snapshotData;_initialData;_inlineSnapshots;_rawSnapshots;_uncheckedKeys;_snapshotFormat;_environment;_fileExists;added;expand;matched;unmatched;updated;static async create(testFilePath,options){const snapshotPath=await options.snapshotEnvironment.resolvePath(testFilePath);const content=await options.snapshotEnvironment.readSnapshotFile(snapshotPath);return new SnapshotState(testFilePath,snapshotPath,content,options);}get environment(){return this._environment;}markSnapshotsAsCheckedForTest(testName){this._uncheckedKeys.forEach(uncheckedKey=>{if(keyToTestName(uncheckedKey)===testName)this._uncheckedKeys.delete(uncheckedKey);});}_inferInlineSnapshotStack(stacks){const promiseIndex=stacks.findIndex(i=>i.method.match(/__VITEST_(RESOLVES|REJECTS)__/));if(promiseIndex!==-1)return stacks[promiseIndex+3];const stackIndex=stacks.findIndex(i=>i.method.includes("__INLINE_SNAPSHOT__"));return stackIndex!==-1?stacks[stackIndex+2]:null;}_addSnapshot(key,receivedSerialized,options){this._dirty=true;if(options.isInline){const stacks=parseErrorStacktrace(options.error||new Error("snapshot"),{ignoreStackEntries:[]});const stack=this._inferInlineSnapshotStack(stacks);if(!stack){throw new Error(\`@vitest/snapshot: Couldn't infer stack frame for inline snapshot. +\${JSON.stringify(stacks)}\`);}stack.column--;this._inlineSnapshots.push(_objectSpread({snapshot:receivedSerialized},stack));}else if(options.rawSnapshot){this._rawSnapshots.push(_objectSpread(_objectSpread({},options.rawSnapshot),{},{snapshot:receivedSerialized}));}else{this._snapshotData[key]=receivedSerialized;}}clear(){this._snapshotData=this._initialData;this._counters=/* @__PURE__ */new Map();this.added=0;this.matched=0;this.unmatched=0;this.updated=0;this._dirty=false;}async save(){const hasExternalSnapshots=Object.keys(this._snapshotData).length;const hasInlineSnapshots=this._inlineSnapshots.length;const hasRawSnapshots=this._rawSnapshots.length;const isEmpty=!hasExternalSnapshots&&!hasInlineSnapshots&&!hasRawSnapshots;const status={deleted:false,saved:false};if((this._dirty||this._uncheckedKeys.size)&&!isEmpty){if(hasExternalSnapshots){await saveSnapshotFile(this._environment,this._snapshotData,this.snapshotPath);this._fileExists=true;}if(hasInlineSnapshots)await saveInlineSnapshots(this._environment,this._inlineSnapshots);if(hasRawSnapshots)await saveRawSnapshots(this._environment,this._rawSnapshots);status.saved=true;}else if(!hasExternalSnapshots&&this._fileExists){if(this._updateSnapshot==="all"){await this._environment.removeSnapshotFile(this.snapshotPath);this._fileExists=false;}status.deleted=true;}return status;}getUncheckedCount(){return this._uncheckedKeys.size||0;}getUncheckedKeys(){return Array.from(this._uncheckedKeys);}removeUncheckedKeys(){if(this._updateSnapshot==="all"&&this._uncheckedKeys.size){this._dirty=true;this._uncheckedKeys.forEach(key=>delete this._snapshotData[key]);this._uncheckedKeys.clear();}}match({testName,received,key,inlineSnapshot,isInline,error,rawSnapshot}){this._counters.set(testName,(this._counters.get(testName)||0)+1);const count=Number(this._counters.get(testName));if(!key)key=testNameToKey(testName,count);if(!(isInline&&this._snapshotData[key]!==void 0))this._uncheckedKeys.delete(key);let receivedSerialized=rawSnapshot&&typeof received==="string"?received:serialize(received,void 0,this._snapshotFormat);if(!rawSnapshot)receivedSerialized=addExtraLineBreaks(receivedSerialized);if(rawSnapshot){if(rawSnapshot.content&&rawSnapshot.content.match(/\\r\\n/)&&!receivedSerialized.match(/\\r\\n/))rawSnapshot.content=normalizeNewlines(rawSnapshot.content);}const expected=isInline?inlineSnapshot:rawSnapshot?rawSnapshot.content:this._snapshotData[key];const expectedTrimmed=prepareExpected(expected);const pass=expectedTrimmed===prepareExpected(receivedSerialized);const hasSnapshot=expected!==void 0;const snapshotIsPersisted=isInline||this._fileExists||rawSnapshot&&rawSnapshot.content!=null;if(pass&&!isInline&&!rawSnapshot){this._snapshotData[key]=receivedSerialized;}if(hasSnapshot&&this._updateSnapshot==="all"||(!hasSnapshot||!snapshotIsPersisted)&&(this._updateSnapshot==="new"||this._updateSnapshot==="all")){if(this._updateSnapshot==="all"){if(!pass){if(hasSnapshot)this.updated++;else this.added++;this._addSnapshot(key,receivedSerialized,{error,isInline,rawSnapshot});}else{this.matched++;}}else{this._addSnapshot(key,receivedSerialized,{error,isInline,rawSnapshot});this.added++;}return{actual:"",count,expected:"",key,pass:true};}else{if(!pass){this.unmatched++;return{actual:removeExtraLineBreaks(receivedSerialized),count,expected:expectedTrimmed!==void 0?removeExtraLineBreaks(expectedTrimmed):void 0,key,pass:false};}else{this.matched++;return{actual:"",count,expected:"",key,pass:true};}}}async pack(){const snapshot={filepath:this.testFilePath,added:0,fileDeleted:false,matched:0,unchecked:0,uncheckedKeys:[],unmatched:0,updated:0};const uncheckedCount=this.getUncheckedCount();const uncheckedKeys=this.getUncheckedKeys();if(uncheckedCount)this.removeUncheckedKeys();const status=await this.save();snapshot.fileDeleted=status.deleted;snapshot.added=this.added;snapshot.matched=this.matched;snapshot.unmatched=this.unmatched;snapshot.updated=this.updated;snapshot.unchecked=!status.deleted?uncheckedCount:0;snapshot.uncheckedKeys=Array.from(uncheckedKeys);return snapshot;}}function createMismatchError(message,expand,actual,expected){const error=new Error(message);Object.defineProperty(error,"actual",{value:actual,enumerable:true,configurable:true,writable:true});Object.defineProperty(error,"expected",{value:expected,enumerable:true,configurable:true,writable:true});Object.defineProperty(error,"diffOptions",{value:{expand}});return error;}class SnapshotClient{constructor(options={}){this.options=options;}filepath;name;snapshotState;snapshotStateMap=/* @__PURE__ */new Map();async startCurrentRun(filepath,name,options){var _a;this.filepath=filepath;this.name=name;if(((_a=this.snapshotState)==null?void 0:_a.testFilePath)!==filepath){await this.finishCurrentRun();if(!this.getSnapshotState(filepath)){this.snapshotStateMap.set(filepath,await SnapshotState.create(filepath,options));}this.snapshotState=this.getSnapshotState(filepath);}}getSnapshotState(filepath){return this.snapshotStateMap.get(filepath);}clearTest(){this.filepath=void 0;this.name=void 0;}skipTestSnapshots(name){var _a;(_a=this.snapshotState)==null?void 0:_a.markSnapshotsAsCheckedForTest(name);}assert(options){var _a,_b,_c,_d;const _options$filepath=options.filepath,filepath=_options$filepath===void 0?this.filepath:_options$filepath,_options$name=options.name,name=_options$name===void 0?this.name:_options$name,message=options.message,_options$isInline=options.isInline,isInline=_options$isInline===void 0?false:_options$isInline,properties=options.properties,inlineSnapshot=options.inlineSnapshot,error=options.error,errorMessage=options.errorMessage,rawSnapshot=options.rawSnapshot;let received=options.received;if(!filepath)throw new Error("Snapshot cannot be used outside of test");if(typeof properties==="object"){if(typeof received!=="object"||!received)throw new Error("Received value must be an object when the matcher has properties");try{const pass2=((_b=(_a=this.options).isEqual)==null?void 0:_b.call(_a,received,properties))??false;if(!pass2)throw createMismatchError("Snapshot properties mismatched",(_c=this.snapshotState)==null?void 0:_c.expand,received,properties);else received=deepMergeSnapshot(received,properties);}catch(err){err.message=errorMessage||"Snapshot mismatched";throw err;}}const testName=[name,...(message?[message]:[])].join(" > ");const snapshotState=this.getSnapshotState(filepath);const _snapshotState$match=snapshotState.match({testName,received,isInline,error,inlineSnapshot,rawSnapshot}),actual=_snapshotState$match.actual,expected=_snapshotState$match.expected,key=_snapshotState$match.key,pass=_snapshotState$match.pass;if(!pass)throw createMismatchError(\`Snapshot \\\`\${key||"unknown"}\\\` mismatched\`,(_d=this.snapshotState)==null?void 0:_d.expand,actual==null?void 0:actual.trim(),expected==null?void 0:expected.trim());}async assertRaw(options){if(!options.rawSnapshot)throw new Error("Raw snapshot is required");const _options$filepath2=options.filepath,filepath=_options$filepath2===void 0?this.filepath:_options$filepath2,rawSnapshot=options.rawSnapshot;if(rawSnapshot.content==null){if(!filepath)throw new Error("Snapshot cannot be used outside of test");const snapshotState=this.getSnapshotState(filepath);options.filepath||(options.filepath=filepath);rawSnapshot.file=await snapshotState.environment.resolveRawPath(filepath,rawSnapshot.file);rawSnapshot.content=(await snapshotState.environment.readSnapshotFile(rawSnapshot.file))||void 0;}return this.assert(options);}async finishCurrentRun(){if(!this.snapshotState)return null;const result=await this.snapshotState.pack();this.snapshotState=void 0;return result;}clear(){this.snapshotStateMap.clear();}}function getFullName(task,separator=" > "){return getNames(task).join(separator);}function normalizeWindowsPath(input=""){if(!input||!input.includes("\\\\")){return input;}return input.replace(/\\\\/g,"/");}const _IS_ABSOLUTE_RE=/^[/\\\\](?![/\\\\])|^[/\\\\]{2}(?!\\.)|^[A-Za-z]:[/\\\\]/;function cwd(){if(typeof process!=="undefined"){return process.cwd().replace(/\\\\/g,"/");}return"/";}const resolve$2=function(...arguments_){arguments_=arguments_.map(argument=>normalizeWindowsPath(argument));let resolvedPath="";let resolvedAbsolute=false;for(let index=arguments_.length-1;index>=-1&&!resolvedAbsolute;index--){const path=index>=0?arguments_[index]:cwd();if(!path||path.length===0){continue;}resolvedPath=\`\${path}/\${resolvedPath}\`;resolvedAbsolute=isAbsolute(path);}resolvedPath=normalizeString(resolvedPath,!resolvedAbsolute);if(resolvedAbsolute&&!isAbsolute(resolvedPath)){return\`/\${resolvedPath}\`;}return resolvedPath.length>0?resolvedPath:".";};function normalizeString(path,allowAboveRoot){let res="";let lastSegmentLength=0;let lastSlash=-1;let dots=0;let char=null;for(let index=0;index<=path.length;++index){if(index2){const lastSlashIndex=res.lastIndexOf("/");if(lastSlashIndex===-1){res="";lastSegmentLength=0;}else{res=res.slice(0,lastSlashIndex);lastSegmentLength=res.length-1-res.lastIndexOf("/");}lastSlash=index;dots=0;continue;}else if(res.length>0){res="";lastSegmentLength=0;lastSlash=index;dots=0;continue;}}if(allowAboveRoot){res+=res.length>0?"/..":"..";lastSegmentLength=2;}}else{if(res.length>0){res+=\`/\${path.slice(lastSlash+1,index)}\`;}else{res=path.slice(lastSlash+1,index);}lastSegmentLength=index-lastSlash-1;}lastSlash=index;dots=0;}else if(char==="."&&dots!==-1){++dots;}else{dots=-1;}}return res;}const isAbsolute=function(p){return _IS_ABSOLUTE_RE.test(p);};const chars='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';const intToChar=new Uint8Array(64);// 64 possible chars. +const charToInt=new Uint8Array(128);// z is 122 in ASCII +for(let i=0;i eval"))line=line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval:\\d+:\\d+/g,":$1");if(!line.includes("@")&&!line.includes(":"))return null;const functionNameRegex=/((.*".+"[^@]*)?[^@]*)(?:@)/;const matches=line.match(functionNameRegex);const functionName=matches&&matches[1]?matches[1]:void 0;const _extractLocation=extractLocation(line.replace(functionNameRegex,"")),_extractLocation2=_slicedToArray(_extractLocation,3),url=_extractLocation2[0],lineNumber=_extractLocation2[1],columnNumber=_extractLocation2[2];if(!url||!lineNumber||!columnNumber)return null;return{file:url,method:functionName||"",line:Number.parseInt(lineNumber),column:Number.parseInt(columnNumber)};}function parseSingleStack(raw){const line=raw.trim();if(!CHROME_IE_STACK_REGEXP.test(line))return parseSingleFFOrSafariStack(line);return parseSingleV8Stack(line);}function parseSingleV8Stack(raw){let line=raw.trim();if(!CHROME_IE_STACK_REGEXP.test(line))return null;if(line.includes("(eval "))line=line.replace(/eval code/g,"eval").replace(/(\\(eval at [^()]*)|(,.*$)/g,"");let sanitizedLine=line.replace(/^\\s+/,"").replace(/\\(eval code/g,"(").replace(/^.*?\\s+/,"");const location=sanitizedLine.match(/ (\\(.+\\)$)/);sanitizedLine=location?sanitizedLine.replace(location[0],""):sanitizedLine;const _extractLocation3=extractLocation(location?location[1]:sanitizedLine),_extractLocation4=_slicedToArray(_extractLocation3,3),url=_extractLocation4[0],lineNumber=_extractLocation4[1],columnNumber=_extractLocation4[2];let method=location&&sanitizedLine||"";let file=url&&["eval",""].includes(url)?void 0:url;if(!file||!lineNumber||!columnNumber)return null;if(method.startsWith("async "))method=method.slice(6);if(file.startsWith("file://"))file=file.slice(7);file=resolve$2(file);if(method)method=method.replace(/__vite_ssr_import_\\d+__\\./g,"");return{method,file,line:Number.parseInt(lineNumber),column:Number.parseInt(columnNumber)};}function isChildProcess(){return typeof process!=="undefined"&&!!process.send;}const RealDate=Date;let now=null;class MockDate extends RealDate{constructor(y,m,d,h,M,s,ms){super();let date;switch(arguments.length){case 0:if(now!==null)date=new RealDate(now.valueOf());else date=new RealDate();break;case 1:date=new RealDate(y);break;default:d=typeof d==="undefined"?1:d;h=h||0;M=M||0;s=s||0;ms=ms||0;date=new RealDate(y,m,d,h,M,s,ms);break;}Object.setPrototypeOf(date,MockDate.prototype);return date;}}MockDate.UTC=RealDate.UTC;MockDate.now=function(){return new MockDate().valueOf();};MockDate.parse=function(dateString){return RealDate.parse(dateString);};MockDate.toString=function(){return RealDate.toString();};function mockDate(date){const dateObj=new RealDate(date.valueOf());if(Number.isNaN(dateObj.getTime()))throw new TypeError(\`mockdate: The time set is an invalid date: \${date}\`);globalThis.Date=MockDate;now=dateObj.valueOf();}function resetDate(){globalThis.Date=RealDate;}function resetModules(modules,resetMocks=false){const skipPaths=[// Vitest +/\\/vitest\\/dist\\//,/\\/vite-node\\/dist\\//,// yarn's .store folder +/vitest-virtual-\\w+\\/dist/,// cnpm +/@vitest\\/dist/,// don't clear mocks +...(!resetMocks?[/^mock:/]:[])];modules.forEach((mod,path)=>{if(skipPaths.some(re=>re.test(path)))return;modules.invalidateModule(mod);});}function waitNextTick(){const _getSafeTimers2=getSafeTimers(),setTimeout=_getSafeTimers2.setTimeout;return new Promise(resolve=>setTimeout(resolve,0));}async function waitForImportsToResolve(){await waitNextTick();const state=getWorkerState();const promises=[];let resolvingCount=0;for(const mod of state.moduleCache.values()){if(mod.promise&&!mod.evaluated)promises.push(mod.promise);if(mod.resolving)resolvingCount++;}if(!promises.length&&!resolvingCount)return;await Promise.allSettled(promises);await waitForImportsToResolve();}function commonjsRequire(path){throw new Error('Could not dynamically require "'+path+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');}var chaiSubset={exports:{}};(function(module,exports){(function(){(function(chaiSubset){if(typeof commonjsRequire==='function'&&'object'==='object'&&'object'==='object'){return module.exports=chaiSubset;}else{return chai.use(chaiSubset);}})(function(chai,utils){var Assertion=chai.Assertion;var assertionPrototype=Assertion.prototype;Assertion.addMethod('containSubset',function(expected){var actual=utils.flag(this,'object');var showDiff=chai.config.showDiff;assertionPrototype.assert.call(this,compare(expected,actual),'expected #{act} to contain subset #{exp}','expected #{act} to not contain subset #{exp}',expected,actual,showDiff);});chai.assert.containSubset=function(val,exp,msg){new chai.Assertion(val,msg).to.be.containSubset(exp);};function compare(expected,actual){if(expected===actual){return true;}if(typeof actual!==typeof expected){return false;}if(typeof expected!=='object'||expected===null){return expected===actual;}if(!!expected&&!actual){return false;}if(Array.isArray(expected)){if(typeof actual.length!=='number'){return false;}var aa=Array.prototype.slice.call(actual);return expected.every(function(exp){return aa.some(function(act){return compare(exp,act);});});}if(expected instanceof Date){if(actual instanceof Date){return expected.getTime()===actual.getTime();}else{return false;}}return Object.keys(expected).every(function(key){var eo=expected[key];var ao=actual[key];if(typeof eo==='object'&&eo!==null&&ao!==null){return compare(eo,ao);}if(typeof eo==='function'){return eo(ao);}return ao===eo;});}});}).call(commonjsGlobal);})(chaiSubset);var chaiSubsetExports=chaiSubset.exports;var Subset=/*@__PURE__*/getDefaultExportFromCjs$1(chaiSubsetExports);const MATCHERS_OBJECT=Symbol.for("matchers-object");const JEST_MATCHERS_OBJECT=Symbol.for("$$jest-matchers-object");const GLOBAL_EXPECT=Symbol.for("expect-global");const ASYMMETRIC_MATCHERS_OBJECT=Symbol.for("asymmetric-matchers-object");if(!Object.prototype.hasOwnProperty.call(globalThis,MATCHERS_OBJECT)){const globalState=/* @__PURE__ */new WeakMap();const matchers=/* @__PURE__ */Object.create(null);const customEqualityTesters=[];const assymetricMatchers=/* @__PURE__ */Object.create(null);Object.defineProperty(globalThis,MATCHERS_OBJECT,{get:()=>globalState});Object.defineProperty(globalThis,JEST_MATCHERS_OBJECT,{configurable:true,get:()=>({state:globalState.get(globalThis[GLOBAL_EXPECT]),matchers,customEqualityTesters})});Object.defineProperty(globalThis,ASYMMETRIC_MATCHERS_OBJECT,{get:()=>assymetricMatchers});}function recordAsyncExpect(test,promise){if(test&&promise instanceof Promise){promise=promise.finally(()=>{const index=test.promises.indexOf(promise);if(index!==-1)test.promises.splice(index,1);});if(!test.promises)test.promises=[];test.promises.push(promise);}return promise;}let _client;function getSnapshotClient(){if(!_client){_client=new SnapshotClient({isEqual:(received,expected)=>{return equals(received,expected,[iterableEquality,subsetEquality]);}});}return _client;}function getError(expected,promise){if(typeof expected!=="function"){if(!promise)throw new Error(\`expected must be a function, received \${typeof expected}\`);return expected;}try{expected();}catch(e){return e;}throw new Error("snapshot function didn't throw");}const SnapshotPlugin=(chai,utils)=>{const getTestNames=test=>{var _a;if(!test)return{};return{filepath:(_a=test.file)==null?void 0:_a.filepath,name:getNames(test).slice(1).join(" > ")};};for(const key of["matchSnapshot","toMatchSnapshot"]){utils.addMethod(chai.Assertion.prototype,key,function(properties,message){const expected=utils.flag(this,"object");const test=utils.flag(this,"vitest-test");if(typeof properties==="string"&&typeof message==="undefined"){message=properties;properties=void 0;}const errorMessage=utils.flag(this,"message");getSnapshotClient().assert(_objectSpread({received:expected,message,isInline:false,properties,errorMessage},getTestNames(test)));});}utils.addMethod(chai.Assertion.prototype,"toMatchFileSnapshot",function(file,message){const expected=utils.flag(this,"object");const test=utils.flag(this,"vitest-test");const errorMessage=utils.flag(this,"message");const promise=getSnapshotClient().assertRaw(_objectSpread({received:expected,message,isInline:false,rawSnapshot:{file},errorMessage},getTestNames(test)));return recordAsyncExpect(test,promise);});utils.addMethod(chai.Assertion.prototype,"toMatchInlineSnapshot",function __INLINE_SNAPSHOT__(properties,inlineSnapshot,message){var _a;const test=utils.flag(this,"vitest-test");const isInsideEach=test&&(test.each||((_a=test.suite)==null?void 0:_a.each));if(isInsideEach)throw new Error("InlineSnapshot cannot be used inside of test.each or describe.each");const expected=utils.flag(this,"object");const error=utils.flag(this,"error");if(typeof properties==="string"){message=inlineSnapshot;inlineSnapshot=properties;properties=void 0;}if(inlineSnapshot)inlineSnapshot=stripSnapshotIndentation(inlineSnapshot);const errorMessage=utils.flag(this,"message");getSnapshotClient().assert(_objectSpread({received:expected,message,isInline:true,properties,inlineSnapshot,error,errorMessage},getTestNames(test)));});utils.addMethod(chai.Assertion.prototype,"toThrowErrorMatchingSnapshot",function(message){const expected=utils.flag(this,"object");const test=utils.flag(this,"vitest-test");const promise=utils.flag(this,"promise");const errorMessage=utils.flag(this,"message");getSnapshotClient().assert(_objectSpread({received:getError(expected,promise),message,errorMessage},getTestNames(test)));});utils.addMethod(chai.Assertion.prototype,"toThrowErrorMatchingInlineSnapshot",function __INLINE_SNAPSHOT__(inlineSnapshot,message){var _a;const test=utils.flag(this,"vitest-test");const isInsideEach=test&&(test.each||((_a=test.suite)==null?void 0:_a.each));if(isInsideEach)throw new Error("InlineSnapshot cannot be used inside of test.each or describe.each");const expected=utils.flag(this,"object");const error=utils.flag(this,"error");const promise=utils.flag(this,"promise");const errorMessage=utils.flag(this,"message");if(inlineSnapshot)inlineSnapshot=stripSnapshotIndentation(inlineSnapshot);getSnapshotClient().assert(_objectSpread({received:getError(expected,promise),message,inlineSnapshot,isInline:true,error,errorMessage},getTestNames(test)));});utils.addMethod(chai.expect,"addSnapshotSerializer",addSerializer);};use(JestExtend);use(JestChaiExpect);use(Subset);use(SnapshotPlugin);use(JestAsymmetricMatchers);function createExpect(test){var _a;const expect$1=(value,message)=>{const _getState=getState(expect$1),assertionCalls=_getState.assertionCalls;setState({assertionCalls:assertionCalls+1,soft:false},expect$1);const assert2=expect(value,message);const _test=test||getCurrentTest();if(_test)return assert2.withTest(_test);else return assert2;};Object.assign(expect$1,expect);Object.assign(expect$1,globalThis[ASYMMETRIC_MATCHERS_OBJECT$1]);expect$1.getState=()=>getState(expect$1);expect$1.setState=state=>setState(state,expect$1);const globalState=getState(globalThis[GLOBAL_EXPECT$1])||{};setState(_objectSpread(_objectSpread({},globalState),{},{assertionCalls:0,isExpectingAssertions:false,isExpectingAssertionsError:null,expectedAssertionsNumber:null,expectedAssertionsNumberErrorGen:null,environment:getCurrentEnvironment(),testPath:test?(_a=test.suite.file)==null?void 0:_a.filepath:globalState.testPath,currentTestName:test?getFullName(test):globalState.currentTestName}),expect$1);expect$1.extend=matchers=>expect.extend(expect$1,matchers);expect$1.addEqualityTesters=customTesters=>addCustomEqualityTesters(customTesters);expect$1.soft=(...args)=>{const assert2=expect$1(...args);expect$1.setState({soft:true});return assert2;};expect$1.unreachable=message=>{assert.fail(\`expected\${message?\` "\${message}" \`:" "}not to be reached\`);};function assertions(expected){const errorGen=()=>new Error(\`expected number of assertions to be \${expected}, but got \${expect$1.getState().assertionCalls}\`);if(Error.captureStackTrace)Error.captureStackTrace(errorGen(),assertions);expect$1.setState({expectedAssertionsNumber:expected,expectedAssertionsNumberErrorGen:errorGen});}function hasAssertions(){const error=new Error("expected any number of assertion, but got none");if(Error.captureStackTrace)Error.captureStackTrace(error,hasAssertions);expect$1.setState({isExpectingAssertions:true,isExpectingAssertionsError:error});}util.addMethod(expect$1,"assertions",assertions);util.addMethod(expect$1,"hasAssertions",hasAssertions);return expect$1;}const globalExpect=createExpect();Object.defineProperty(globalThis,GLOBAL_EXPECT$1,{value:globalExpect,writable:true,configurable:true});/** + * A reference to the global object + * + * @type {object} globalObject + */var globalObject$1;/* istanbul ignore else */if(typeof commonjsGlobal!=="undefined"){// Node +globalObject$1=commonjsGlobal;}else if(typeof window!=="undefined"){// Browser +globalObject$1=window;}else{// WebWorker +globalObject$1=self;}var global$1=globalObject$1;/** + * Is true when the environment causes an error to be thrown for accessing the + * __proto__ property. + * + * This is necessary in order to support \`node --disable-proto=throw\`. + * + * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/proto + * + * @type {boolean} + */let throwsOnProto$1;try{const object={};// eslint-disable-next-line no-proto, no-unused-expressions +object.__proto__;throwsOnProto$1=false;}catch(_){// This branch is covered when tests are run with \`--disable-proto=throw\`, +// however we can test both branches at the same time, so this is ignored +/* istanbul ignore next */throwsOnProto$1=true;}var throwsOnProto_1=throwsOnProto$1;var call=Function.call;var throwsOnProto=throwsOnProto_1;var disallowedProperties=[// ignore size because it throws from Map +"size","caller","callee","arguments"];// This branch is covered when tests are run with \`--disable-proto=throw\`, +// however we can test both branches at the same time, so this is ignored +/* istanbul ignore next */if(throwsOnProto){disallowedProperties.push("__proto__");}var copyPrototypeMethods=function copyPrototypeMethods(prototype){// eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods +return Object.getOwnPropertyNames(prototype).reduce(function(result,name){if(disallowedProperties.includes(name)){return result;}if(typeof prototype[name]!=="function"){return result;}result[name]=call.bind(prototype[name]);return result;},Object.create(null));};var copyPrototype$5=copyPrototypeMethods;var array=copyPrototype$5(Array.prototype);var every$1=array.every;/** + * @private + */function hasCallsLeft(callMap,spy){if(callMap[spy.id]===undefined){callMap[spy.id]=0;}return callMap[spy.id]1?arguments:spies;return every$1(_spies,checkAdjacentCalls.bind(null,callMap));}var calledInOrder_1=calledInOrder;/** + * Returns a display name for a function + * + * @param {Function} func + * @returns {string} + */var functionName$1=function functionName(func){if(!func){return"";}try{return func.displayName||func.name||// Use function decomposition as a last resort to get function +// name. Does not rely on function decomposition to work - if it +// doesn't debugging will be slightly less informative +// (i.e. toString will say 'spy' rather than 'myFunc'). +(String(func).match(/function ([^\\s(]+)/)||[])[1];}catch(e){// Stringify may fail and we might get an exception, as a last-last +// resort fall back to empty string. +return"";}};var functionName=functionName$1;/** + * Returns a display name for a value from a constructor + * + * @param {object} value A value to examine + * @returns {(string|null)} A string or null + */function className(value){return value.constructor&&value.constructor.name||// The next branch is for IE11 support only: +// Because the name property is not set on the prototype +// of the Function object, we finally try to grab the +// name from its definition. This will never be reached +// in node, so we are not able to test this properly. +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name +typeof value.constructor==="function"&&/* istanbul ignore next */functionName(value.constructor)||null;}var className_1=className;var deprecated={};/* eslint-disable no-console */(function(exports){/** + * Returns a function that will invoke the supplied function and print a + * deprecation warning to the console each time it is called. + * + * @param {Function} func + * @param {string} msg + * @returns {Function} + */exports.wrap=function(func,msg){var wrapped=function(){exports.printWarning(msg);return func.apply(this,arguments);};if(func.prototype){wrapped.prototype=func.prototype;}return wrapped;};/** + * Returns a string which can be supplied to \`wrap()\` to notify the user that a + * particular part of the sinon API has been deprecated. + * + * @param {string} packageName + * @param {string} funcName + * @returns {string} + */exports.defaultMsg=function(packageName,funcName){return\`\${packageName}.\${funcName} is deprecated and will be removed from the public API in a future version of \${packageName}.\`;};/** + * Prints a warning on the console, when it exists + * + * @param {string} msg + * @returns {undefined} + */exports.printWarning=function(msg){/* istanbul ignore next */if(typeof process==="object"&&process.emitWarning){// Emit Warnings in Node +process.emitWarning(msg);}else if(console.info){console.info(msg);}else{console.log(msg);}};})(deprecated);/** + * Returns true when fn returns true for all members of obj. + * This is an every implementation that works for all iterables + * + * @param {object} obj + * @param {Function} fn + * @returns {boolean} + */var every=function every(obj,fn){var pass=true;try{// eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods +obj.forEach(function(){if(!fn.apply(this,arguments)){// Throwing an error is the only way to break \`forEach\` +throw new Error();}});}catch(e){pass=false;}return pass;};var sort=array.sort;var slice=array.slice;/** + * @private + */function comparator(a,b){// uuid, won't ever be equal +var aCall=a.getCall(0);var bCall=b.getCall(0);var aId=aCall&&aCall.callId||-1;var bId=bCall&&bCall.callId||-1;return aId + * MIT Licensed + */var promiseExists=typeof Promise==='function';/* eslint-disable no-undef */var globalObject=typeof self==='object'?self:commonjsGlobal;// eslint-disable-line id-blacklist +var symbolExists=typeof Symbol!=='undefined';var mapExists=typeof Map!=='undefined';var setExists=typeof Set!=='undefined';var weakMapExists=typeof WeakMap!=='undefined';var weakSetExists=typeof WeakSet!=='undefined';var dataViewExists=typeof DataView!=='undefined';var symbolIteratorExists=symbolExists&&typeof Symbol.iterator!=='undefined';var symbolToStringTagExists=symbolExists&&typeof Symbol.toStringTag!=='undefined';var setEntriesExists=setExists&&typeof Set.prototype.entries==='function';var mapEntriesExists=mapExists&&typeof Map.prototype.entries==='function';var setIteratorPrototype=setEntriesExists&&Object.getPrototypeOf(new Set().entries());var mapIteratorPrototype=mapEntriesExists&&Object.getPrototypeOf(new Map().entries());var arrayIteratorExists=symbolIteratorExists&&typeof Array.prototype[Symbol.iterator]==='function';var arrayIteratorPrototype=arrayIteratorExists&&Object.getPrototypeOf([][Symbol.iterator]());var stringIteratorExists=symbolIteratorExists&&typeof String.prototype[Symbol.iterator]==='function';var stringIteratorPrototype=stringIteratorExists&&Object.getPrototypeOf(''[Symbol.iterator]());var toStringLeftSliceLength=8;var toStringRightSliceLength=-1;/** + * ### typeOf (obj) + * + * Uses \`Object.prototype.toString\` to determine the type of an object, + * normalising behaviour across engine versions & well optimised. + * + * @param {Mixed} object + * @return {String} object type + * @api public + */function typeDetect(obj){/* ! Speed optimisation + * Pre: + * string literal x 3,039,035 ops/sec ±1.62% (78 runs sampled) + * boolean literal x 1,424,138 ops/sec ±4.54% (75 runs sampled) + * number literal x 1,653,153 ops/sec ±1.91% (82 runs sampled) + * undefined x 9,978,660 ops/sec ±1.92% (75 runs sampled) + * function x 2,556,769 ops/sec ±1.73% (77 runs sampled) + * Post: + * string literal x 38,564,796 ops/sec ±1.15% (79 runs sampled) + * boolean literal x 31,148,940 ops/sec ±1.10% (79 runs sampled) + * number literal x 32,679,330 ops/sec ±1.90% (78 runs sampled) + * undefined x 32,363,368 ops/sec ±1.07% (82 runs sampled) + * function x 31,296,870 ops/sec ±0.96% (83 runs sampled) + */var typeofObj=typeof obj;if(typeofObj!=='object'){return typeofObj;}/* ! Speed optimisation + * Pre: + * null x 28,645,765 ops/sec ±1.17% (82 runs sampled) + * Post: + * null x 36,428,962 ops/sec ±1.37% (84 runs sampled) + */if(obj===null){return'null';}/* ! Spec Conformance + * Test: \`Object.prototype.toString.call(window)\`\` + * - Node === "[object global]" + * - Chrome === "[object global]" + * - Firefox === "[object Window]" + * - PhantomJS === "[object Window]" + * - Safari === "[object Window]" + * - IE 11 === "[object Window]" + * - IE Edge === "[object Window]" + * Test: \`Object.prototype.toString.call(this)\`\` + * - Chrome Worker === "[object global]" + * - Firefox Worker === "[object DedicatedWorkerGlobalScope]" + * - Safari Worker === "[object DedicatedWorkerGlobalScope]" + * - IE 11 Worker === "[object WorkerGlobalScope]" + * - IE Edge Worker === "[object WorkerGlobalScope]" + */if(obj===globalObject){return'global';}/* ! Speed optimisation + * Pre: + * array literal x 2,888,352 ops/sec ±0.67% (82 runs sampled) + * Post: + * array literal x 22,479,650 ops/sec ±0.96% (81 runs sampled) + */if(Array.isArray(obj)&&(symbolToStringTagExists===false||!(Symbol.toStringTag in obj))){return'Array';}// Not caching existence of \`window\` and related properties due to potential +// for \`window\` to be unset before tests in quasi-browser environments. +if(typeof window==='object'&&window!==null){/* ! Spec Conformance + * (https://html.spec.whatwg.org/multipage/browsers.html#location) + * WhatWG HTML$7.7.3 - The \`Location\` interface + * Test: \`Object.prototype.toString.call(window.location)\`\` + * - IE <=11 === "[object Object]" + * - IE Edge <=13 === "[object Object]" + */if(typeof window.location==='object'&&obj===window.location){return'Location';}/* ! Spec Conformance + * (https://html.spec.whatwg.org/#document) + * WhatWG HTML$3.1.1 - The \`Document\` object + * Note: Most browsers currently adher to the W3C DOM Level 2 spec + * (https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26809268) + * which suggests that browsers should use HTMLTableCellElement for + * both TD and TH elements. WhatWG separates these. + * WhatWG HTML states: + * > For historical reasons, Window objects must also have a + * > writable, configurable, non-enumerable property named + * > HTMLDocument whose value is the Document interface object. + * Test: \`Object.prototype.toString.call(document)\`\` + * - Chrome === "[object HTMLDocument]" + * - Firefox === "[object HTMLDocument]" + * - Safari === "[object HTMLDocument]" + * - IE <=10 === "[object Document]" + * - IE 11 === "[object HTMLDocument]" + * - IE Edge <=13 === "[object HTMLDocument]" + */if(typeof window.document==='object'&&obj===window.document){return'Document';}if(typeof window.navigator==='object'){/* ! Spec Conformance + * (https://html.spec.whatwg.org/multipage/webappapis.html#mimetypearray) + * WhatWG HTML$8.6.1.5 - Plugins - Interface MimeTypeArray + * Test: \`Object.prototype.toString.call(navigator.mimeTypes)\`\` + * - IE <=10 === "[object MSMimeTypesCollection]" + */if(typeof window.navigator.mimeTypes==='object'&&obj===window.navigator.mimeTypes){return'MimeTypeArray';}/* ! Spec Conformance + * (https://html.spec.whatwg.org/multipage/webappapis.html#pluginarray) + * WhatWG HTML$8.6.1.5 - Plugins - Interface PluginArray + * Test: \`Object.prototype.toString.call(navigator.plugins)\`\` + * - IE <=10 === "[object MSPluginsCollection]" + */if(typeof window.navigator.plugins==='object'&&obj===window.navigator.plugins){return'PluginArray';}}if((typeof window.HTMLElement==='function'||typeof window.HTMLElement==='object')&&obj instanceof window.HTMLElement){/* ! Spec Conformance + * (https://html.spec.whatwg.org/multipage/webappapis.html#pluginarray) + * WhatWG HTML$4.4.4 - The \`blockquote\` element - Interface \`HTMLQuoteElement\` + * Test: \`Object.prototype.toString.call(document.createElement('blockquote'))\`\` + * - IE <=10 === "[object HTMLBlockElement]" + */if(obj.tagName==='BLOCKQUOTE'){return'HTMLQuoteElement';}/* ! Spec Conformance + * (https://html.spec.whatwg.org/#htmltabledatacellelement) + * WhatWG HTML$4.9.9 - The \`td\` element - Interface \`HTMLTableDataCellElement\` + * Note: Most browsers currently adher to the W3C DOM Level 2 spec + * (https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-82915075) + * which suggests that browsers should use HTMLTableCellElement for + * both TD and TH elements. WhatWG separates these. + * Test: Object.prototype.toString.call(document.createElement('td')) + * - Chrome === "[object HTMLTableCellElement]" + * - Firefox === "[object HTMLTableCellElement]" + * - Safari === "[object HTMLTableCellElement]" + */if(obj.tagName==='TD'){return'HTMLTableDataCellElement';}/* ! Spec Conformance + * (https://html.spec.whatwg.org/#htmltableheadercellelement) + * WhatWG HTML$4.9.9 - The \`td\` element - Interface \`HTMLTableHeaderCellElement\` + * Note: Most browsers currently adher to the W3C DOM Level 2 spec + * (https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-82915075) + * which suggests that browsers should use HTMLTableCellElement for + * both TD and TH elements. WhatWG separates these. + * Test: Object.prototype.toString.call(document.createElement('th')) + * - Chrome === "[object HTMLTableCellElement]" + * - Firefox === "[object HTMLTableCellElement]" + * - Safari === "[object HTMLTableCellElement]" + */if(obj.tagName==='TH'){return'HTMLTableHeaderCellElement';}}}/* ! Speed optimisation + * Pre: + * Float64Array x 625,644 ops/sec ±1.58% (80 runs sampled) + * Float32Array x 1,279,852 ops/sec ±2.91% (77 runs sampled) + * Uint32Array x 1,178,185 ops/sec ±1.95% (83 runs sampled) + * Uint16Array x 1,008,380 ops/sec ±2.25% (80 runs sampled) + * Uint8Array x 1,128,040 ops/sec ±2.11% (81 runs sampled) + * Int32Array x 1,170,119 ops/sec ±2.88% (80 runs sampled) + * Int16Array x 1,176,348 ops/sec ±5.79% (86 runs sampled) + * Int8Array x 1,058,707 ops/sec ±4.94% (77 runs sampled) + * Uint8ClampedArray x 1,110,633 ops/sec ±4.20% (80 runs sampled) + * Post: + * Float64Array x 7,105,671 ops/sec ±13.47% (64 runs sampled) + * Float32Array x 5,887,912 ops/sec ±1.46% (82 runs sampled) + * Uint32Array x 6,491,661 ops/sec ±1.76% (79 runs sampled) + * Uint16Array x 6,559,795 ops/sec ±1.67% (82 runs sampled) + * Uint8Array x 6,463,966 ops/sec ±1.43% (85 runs sampled) + * Int32Array x 5,641,841 ops/sec ±3.49% (81 runs sampled) + * Int16Array x 6,583,511 ops/sec ±1.98% (80 runs sampled) + * Int8Array x 6,606,078 ops/sec ±1.74% (81 runs sampled) + * Uint8ClampedArray x 6,602,224 ops/sec ±1.77% (83 runs sampled) + */var stringTag=symbolToStringTagExists&&obj[Symbol.toStringTag];if(typeof stringTag==='string'){return stringTag;}var objPrototype=Object.getPrototypeOf(obj);/* ! Speed optimisation + * Pre: + * regex literal x 1,772,385 ops/sec ±1.85% (77 runs sampled) + * regex constructor x 2,143,634 ops/sec ±2.46% (78 runs sampled) + * Post: + * regex literal x 3,928,009 ops/sec ±0.65% (78 runs sampled) + * regex constructor x 3,931,108 ops/sec ±0.58% (84 runs sampled) + */if(objPrototype===RegExp.prototype){return'RegExp';}/* ! Speed optimisation + * Pre: + * date x 2,130,074 ops/sec ±4.42% (68 runs sampled) + * Post: + * date x 3,953,779 ops/sec ±1.35% (77 runs sampled) + */if(objPrototype===Date.prototype){return'Date';}/* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-promise.prototype-@@tostringtag) + * ES6$25.4.5.4 - Promise.prototype[@@toStringTag] should be "Promise": + * Test: \`Object.prototype.toString.call(Promise.resolve())\`\` + * - Chrome <=47 === "[object Object]" + * - Edge <=20 === "[object Object]" + * - Firefox 29-Latest === "[object Promise]" + * - Safari 7.1-Latest === "[object Promise]" + */if(promiseExists&&objPrototype===Promise.prototype){return'Promise';}/* ! Speed optimisation + * Pre: + * set x 2,222,186 ops/sec ±1.31% (82 runs sampled) + * Post: + * set x 4,545,879 ops/sec ±1.13% (83 runs sampled) + */if(setExists&&objPrototype===Set.prototype){return'Set';}/* ! Speed optimisation + * Pre: + * map x 2,396,842 ops/sec ±1.59% (81 runs sampled) + * Post: + * map x 4,183,945 ops/sec ±6.59% (82 runs sampled) + */if(mapExists&&objPrototype===Map.prototype){return'Map';}/* ! Speed optimisation + * Pre: + * weakset x 1,323,220 ops/sec ±2.17% (76 runs sampled) + * Post: + * weakset x 4,237,510 ops/sec ±2.01% (77 runs sampled) + */if(weakSetExists&&objPrototype===WeakSet.prototype){return'WeakSet';}/* ! Speed optimisation + * Pre: + * weakmap x 1,500,260 ops/sec ±2.02% (78 runs sampled) + * Post: + * weakmap x 3,881,384 ops/sec ±1.45% (82 runs sampled) + */if(weakMapExists&&objPrototype===WeakMap.prototype){return'WeakMap';}/* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-dataview.prototype-@@tostringtag) + * ES6$24.2.4.21 - DataView.prototype[@@toStringTag] should be "DataView": + * Test: \`Object.prototype.toString.call(new DataView(new ArrayBuffer(1)))\`\` + * - Edge <=13 === "[object Object]" + */if(dataViewExists&&objPrototype===DataView.prototype){return'DataView';}/* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%mapiteratorprototype%-@@tostringtag) + * ES6$23.1.5.2.2 - %MapIteratorPrototype%[@@toStringTag] should be "Map Iterator": + * Test: \`Object.prototype.toString.call(new Map().entries())\`\` + * - Edge <=13 === "[object Object]" + */if(mapExists&&objPrototype===mapIteratorPrototype){return'Map Iterator';}/* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%setiteratorprototype%-@@tostringtag) + * ES6$23.2.5.2.2 - %SetIteratorPrototype%[@@toStringTag] should be "Set Iterator": + * Test: \`Object.prototype.toString.call(new Set().entries())\`\` + * - Edge <=13 === "[object Object]" + */if(setExists&&objPrototype===setIteratorPrototype){return'Set Iterator';}/* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%arrayiteratorprototype%-@@tostringtag) + * ES6$22.1.5.2.2 - %ArrayIteratorPrototype%[@@toStringTag] should be "Array Iterator": + * Test: \`Object.prototype.toString.call([][Symbol.iterator]())\`\` + * - Edge <=13 === "[object Object]" + */if(arrayIteratorExists&&objPrototype===arrayIteratorPrototype){return'Array Iterator';}/* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%stringiteratorprototype%-@@tostringtag) + * ES6$21.1.5.2.2 - %StringIteratorPrototype%[@@toStringTag] should be "String Iterator": + * Test: \`Object.prototype.toString.call(''[Symbol.iterator]())\`\` + * - Edge <=13 === "[object Object]" + */if(stringIteratorExists&&objPrototype===stringIteratorPrototype){return'String Iterator';}/* ! Speed optimisation + * Pre: + * object from null x 2,424,320 ops/sec ±1.67% (76 runs sampled) + * Post: + * object from null x 5,838,000 ops/sec ±0.99% (84 runs sampled) + */if(objPrototype===null){return'Object';}return Object.prototype.toString.call(obj).slice(toStringLeftSliceLength,toStringRightSliceLength);}return typeDetect;});})(typeDetect);var typeDetectExports=typeDetect.exports;var type=typeDetectExports;/** + * Returns the lower-case result of running type from type-detect on the value + * + * @param {*} value + * @returns {string} + */var typeOf=function typeOf(value){return type(value).toLowerCase();};/** + * Returns a string representation of the value + * + * @param {*} value + * @returns {string} + */function valueToString(value){if(value&&value.toString){// eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods +return value.toString();}return String(value);}var valueToString_1=valueToString;var lib={global:global$1,calledInOrder:calledInOrder_1,className:className_1,deprecated:deprecated,every:every,functionName:functionName$1,orderByFirstCall:orderByFirstCall_1,prototypes:prototypes,typeOf:typeOf,valueToString:valueToString_1};const globalObject=lib.global;let timersModule;if(typeof __vitest_required__!=='undefined'){try{timersModule=__vitest_required__.timers;}catch(e){// ignored +}}/** + * @typedef {object} IdleDeadline + * @property {boolean} didTimeout - whether or not the callback was called before reaching the optional timeout + * @property {function():number} timeRemaining - a floating-point value providing an estimate of the number of milliseconds remaining in the current idle period + */ /** + * Queues a function to be called during a browser's idle periods + * + * @callback RequestIdleCallback + * @param {function(IdleDeadline)} callback + * @param {{timeout: number}} options - an options object + * @returns {number} the id + */ /** + * @callback NextTick + * @param {VoidVarArgsFunc} callback - the callback to run + * @param {...*} arguments - optional arguments to call the callback with + * @returns {void} + */ /** + * @callback SetImmediate + * @param {VoidVarArgsFunc} callback - the callback to run + * @param {...*} arguments - optional arguments to call the callback with + * @returns {NodeImmediate} + */ /** + * @callback VoidVarArgsFunc + * @param {...*} callback - the callback to run + * @returns {void} + */ /** + * @typedef RequestAnimationFrame + * @property {function(number):void} requestAnimationFrame + * @returns {number} - the id + */ /** + * @typedef Performance + * @property {function(): number} now + */ /* eslint-disable jsdoc/require-property-description */ /** + * @typedef {object} Clock + * @property {number} now - the current time + * @property {Date} Date - the Date constructor + * @property {number} loopLimit - the maximum number of timers before assuming an infinite loop + * @property {RequestIdleCallback} requestIdleCallback + * @property {function(number):void} cancelIdleCallback + * @property {setTimeout} setTimeout + * @property {clearTimeout} clearTimeout + * @property {NextTick} nextTick + * @property {queueMicrotask} queueMicrotask + * @property {setInterval} setInterval + * @property {clearInterval} clearInterval + * @property {SetImmediate} setImmediate + * @property {function(NodeImmediate):void} clearImmediate + * @property {function():number} countTimers + * @property {RequestAnimationFrame} requestAnimationFrame + * @property {function(number):void} cancelAnimationFrame + * @property {function():void} runMicrotasks + * @property {function(string | number): number} tick + * @property {function(string | number): Promise} tickAsync + * @property {function(): number} next + * @property {function(): Promise} nextAsync + * @property {function(): number} runAll + * @property {function(): number} runToFrame + * @property {function(): Promise} runAllAsync + * @property {function(): number} runToLast + * @property {function(): Promise} runToLastAsync + * @property {function(): void} reset + * @property {function(number | Date): void} setSystemTime + * @property {function(number): void} jump + * @property {Performance} performance + * @property {function(number[]): number[]} hrtime - process.hrtime (legacy) + * @property {function(): void} uninstall Uninstall the clock. + * @property {Function[]} methods - the methods that are faked + * @property {boolean} [shouldClearNativeTimers] inherited from config + * @property {{methodName:string, original:any}[] | undefined} timersModuleMethods + */ /* eslint-enable jsdoc/require-property-description */ /** + * Configuration object for the \`install\` method. + * + * @typedef {object} Config + * @property {number|Date} [now] a number (in milliseconds) or a Date object (default epoch) + * @property {string[]} [toFake] names of the methods that should be faked. + * @property {number} [loopLimit] the maximum number of timers that will be run when calling runAll() + * @property {boolean} [shouldAdvanceTime] tells FakeTimers to increment mocked time automatically (default false) + * @property {number} [advanceTimeDelta] increment mocked time every <> ms (default: 20ms) + * @property {boolean} [shouldClearNativeTimers] forwards clear timer calls to native functions if they are not fakes (default: false) + */ /* eslint-disable jsdoc/require-property-description */ /** + * The internal structure to describe a scheduled fake timer + * + * @typedef {object} Timer + * @property {Function} func + * @property {*[]} args + * @property {number} delay + * @property {number} callAt + * @property {number} createdAt + * @property {boolean} immediate + * @property {number} id + * @property {Error} [error] + */ /** + * A Node timer + * + * @typedef {object} NodeImmediate + * @property {function(): boolean} hasRef + * @property {function(): NodeImmediate} ref + * @property {function(): NodeImmediate} unref + */ /* eslint-enable jsdoc/require-property-description */ /* eslint-disable complexity */ /** + * Mocks available features in the specified global namespace. + * + * @param {*} _global Namespace to mock (e.g. \`window\`) + * @returns {FakeTimers} + */function withGlobal(_global){const maxTimeout=Math.pow(2,31)-1;//see https://heycam.github.io/webidl/#abstract-opdef-converttoint +const idCounterStart=1e12;// arbitrarily large number to avoid collisions with native timer IDs +const NOOP=function(){return undefined;};const NOOP_ARRAY=function(){return[];};const timeoutResult=_global.setTimeout(NOOP,0);const addTimerReturnsObject=typeof timeoutResult==="object";const hrtimePresent=_global.process&&typeof _global.process.hrtime==="function";const hrtimeBigintPresent=hrtimePresent&&typeof _global.process.hrtime.bigint==="function";const nextTickPresent=_global.process&&typeof _global.process.nextTick==="function";const utilPromisify=_global.process&&_global.__vitest_required__&&_global.__vitest_required__.util.promisify;const performancePresent=_global.performance&&typeof _global.performance.now==="function";const hasPerformancePrototype=_global.Performance&&(typeof _global.Performance).match(/^(function|object)$/);const hasPerformanceConstructorPrototype=_global.performance&&_global.performance.constructor&&_global.performance.constructor.prototype;const queueMicrotaskPresent=_global.hasOwnProperty("queueMicrotask");const requestAnimationFramePresent=_global.requestAnimationFrame&&typeof _global.requestAnimationFrame==="function";const cancelAnimationFramePresent=_global.cancelAnimationFrame&&typeof _global.cancelAnimationFrame==="function";const requestIdleCallbackPresent=_global.requestIdleCallback&&typeof _global.requestIdleCallback==="function";const cancelIdleCallbackPresent=_global.cancelIdleCallback&&typeof _global.cancelIdleCallback==="function";const setImmediatePresent=_global.setImmediate&&typeof _global.setImmediate==="function";const intlPresent=_global.Intl&&typeof _global.Intl==="object";_global.clearTimeout(timeoutResult);const NativeDate=_global.Date;const NativeIntl=_global.Intl;let uniqueTimerId=idCounterStart;/** + * @param {number} num + * @returns {boolean} + */function isNumberFinite(num){if(Number.isFinite){return Number.isFinite(num);}return isFinite(num);}let isNearInfiniteLimit=false;/** + * @param {Clock} clock + * @param {number} i + */function checkIsNearInfiniteLimit(clock,i){if(clock.loopLimit&&i===clock.loopLimit-1){isNearInfiniteLimit=true;}}/** + * + */function resetIsNearInfiniteLimit(){isNearInfiniteLimit=false;}/** + * Parse strings like "01:10:00" (meaning 1 hour, 10 minutes, 0 seconds) into + * number of milliseconds. This is used to support human-readable strings passed + * to clock.tick() + * + * @param {string} str + * @returns {number} + */function parseTime(str){if(!str){return 0;}const strings=str.split(":");const l=strings.length;let i=l;let ms=0;let parsed;if(l>3||!/^(\\d\\d:){0,2}\\d\\d?$/.test(str)){throw new Error("tick only understands numbers, 'm:s' and 'h:m:s'. Each part must be two digits");}while(i--){parsed=parseInt(strings[i],10);if(parsed>=60){throw new Error(\`Invalid time \${str}\`);}ms+=parsed*Math.pow(60,l-i-1);}return ms*1000;}/** + * Get the decimal part of the millisecond value as nanoseconds + * + * @param {number} msFloat the number of milliseconds + * @returns {number} an integer number of nanoseconds in the range [0,1e6) + * + * Example: nanoRemainer(123.456789) -> 456789 + */function nanoRemainder(msFloat){const modulo=1e6;const remainder=msFloat*1e6%modulo;const positiveRemainder=remainder<0?remainder+modulo:remainder;return Math.floor(positiveRemainder);}/** + * Used to grok the \`now\` parameter to createClock. + * + * @param {Date|number} epoch the system time + * @returns {number} + */function getEpoch(epoch){if(!epoch){return 0;}if(typeof epoch.getTime==="function"){return epoch.getTime();}if(typeof epoch==="number"){return epoch;}throw new TypeError("now should be milliseconds since UNIX epoch");}/** + * @param {number} from + * @param {number} to + * @param {Timer} timer + * @returns {boolean} + */function inRange(from,to,timer){return timer&&timer.callAt>=from&&timer.callAt<=to;}/** + * @param {Clock} clock + * @param {Timer} job + */function getInfiniteLoopError(clock,job){const infiniteLoopError=new Error(\`Aborting after running \${clock.loopLimit} timers, assuming an infinite loop!\`);if(!job.error){return infiniteLoopError;}// pattern never matched in Node +const computedTargetPattern=/target\\.*[<|(|[].*?[>|\\]|)]\\s*/;let clockMethodPattern=new RegExp(String(Object.keys(clock).join("|")));if(addTimerReturnsObject){// node.js environment +clockMethodPattern=new RegExp(\`\\\\s+at (Object\\\\.)?(?:\${Object.keys(clock).join("|")})\\\\s+\`);}let matchedLineIndex=-1;job.error.stack.split("\\n").some(function(line,i){// If we've matched a computed target line (e.g. setTimeout) then we +// don't need to look any further. Return true to stop iterating. +const matchedComputedTarget=line.match(computedTargetPattern);/* istanbul ignore if */if(matchedComputedTarget){matchedLineIndex=i;return true;}// If we've matched a clock method line, then there may still be +// others further down the trace. Return false to keep iterating. +const matchedClockMethod=line.match(clockMethodPattern);if(matchedClockMethod){matchedLineIndex=i;return false;}// If we haven't matched anything on this line, but we matched +// previously and set the matched line index, then we can stop. +// If we haven't matched previously, then we should keep iterating. +return matchedLineIndex>=0;});const stack=\`\${infiniteLoopError}\\n\${job.type||"Microtask"} - \${job.func.name||"anonymous"}\\n\${job.error.stack.split("\\n").slice(matchedLineIndex+1).join("\\n")}\`;try{Object.defineProperty(infiniteLoopError,"stack",{value:stack});}catch(e){// noop +}return infiniteLoopError;}/** + * @param {Date} target + * @param {Date} source + * @returns {Date} the target after modifications + */function mirrorDateProperties(target,source){let prop;for(prop in source){if(source.hasOwnProperty(prop)){target[prop]=source[prop];}}// set special now implementation +if(source.now){target.now=function now(){return target.clock.now;};}else{delete target.now;}// set special toSource implementation +if(source.toSource){target.toSource=function toSource(){return source.toSource();};}else{delete target.toSource;}// set special toString implementation +target.toString=function toString(){return source.toString();};target.prototype=source.prototype;target.parse=source.parse;target.UTC=source.UTC;target.prototype.toUTCString=source.prototype.toUTCString;target.isFake=true;return target;}//eslint-disable-next-line jsdoc/require-jsdoc +function createDate(){/** + * @param {number} year + * @param {number} month + * @param {number} date + * @param {number} hour + * @param {number} minute + * @param {number} second + * @param {number} ms + * @returns {Date} + */function ClockDate(year,month,date,hour,minute,second,ms){// the Date constructor called as a function, ref Ecma-262 Edition 5.1, section 15.9.2. +// This remains so in the 10th edition of 2019 as well. +if(!(this instanceof ClockDate)){return new NativeDate(ClockDate.clock.now).toString();}// if Date is called as a constructor with 'new' keyword +// Defensive and verbose to avoid potential harm in passing +// explicit undefined when user does not pass argument +switch(arguments.length){case 0:return new NativeDate(ClockDate.clock.now);case 1:return new NativeDate(year);case 2:return new NativeDate(year,month);case 3:return new NativeDate(year,month,date);case 4:return new NativeDate(year,month,date,hour);case 5:return new NativeDate(year,month,date,hour,minute);case 6:return new NativeDate(year,month,date,hour,minute,second);default:return new NativeDate(year,month,date,hour,minute,second,ms);}}return mirrorDateProperties(ClockDate,NativeDate);}//eslint-disable-next-line jsdoc/require-jsdoc +function createIntl(){const ClockIntl=_objectSpread({},NativeIntl);ClockIntl.DateTimeFormat=function(...args){const realFormatter=new NativeIntl.DateTimeFormat(...args);const formatter={};["formatRange","formatRangeToParts","resolvedOptions"].forEach(method=>{formatter[method]=realFormatter[method].bind(realFormatter);});["format","formatToParts"].forEach(method=>{formatter[method]=function(date){return realFormatter[method](date||ClockIntl.clock.now);};});return formatter;};ClockIntl.DateTimeFormat.prototype=Object.create(NativeIntl.DateTimeFormat.prototype);ClockIntl.DateTimeFormat.supportedLocalesOf=NativeIntl.DateTimeFormat.supportedLocalesOf;return ClockIntl;}//eslint-disable-next-line jsdoc/require-jsdoc +function enqueueJob(clock,job){// enqueues a microtick-deferred task - ecma262/#sec-enqueuejob +if(!clock.jobs){clock.jobs=[];}clock.jobs.push(job);}//eslint-disable-next-line jsdoc/require-jsdoc +function runJobs(clock){// runs all microtick-deferred tasks - ecma262/#sec-runjobs +if(!clock.jobs){return;}for(let i=0;iclock.loopLimit){throw getInfiniteLoopError(clock,job);}}resetIsNearInfiniteLimit();clock.jobs=[];}/** + * @param {Clock} clock + * @param {Timer} timer + * @returns {number} id of the created timer + */function addTimer(clock,timer){if(timer.func===undefined){throw new Error("Callback must be provided to timer calls");}if(addTimerReturnsObject){// Node.js environment +if(typeof timer.func!=="function"){throw new TypeError(\`[ERR_INVALID_CALLBACK]: Callback must be a function. Received \${timer.func} of type \${typeof timer.func}\`);}}if(isNearInfiniteLimit){timer.error=new Error();}timer.type=timer.immediate?"Immediate":"Timeout";if(timer.hasOwnProperty("delay")){if(typeof timer.delay!=="number"){timer.delay=parseInt(timer.delay,10);}if(!isNumberFinite(timer.delay)){timer.delay=0;}timer.delay=timer.delay>maxTimeout?1:timer.delay;timer.delay=Math.max(0,timer.delay);}if(timer.hasOwnProperty("interval")){timer.type="Interval";timer.interval=timer.interval>maxTimeout?1:timer.interval;}if(timer.hasOwnProperty("animation")){timer.type="AnimationFrame";timer.animation=true;}if(timer.hasOwnProperty("idleCallback")){timer.type="IdleCallback";timer.idleCallback=true;}if(!clock.timers){clock.timers={};}timer.id=uniqueTimerId++;timer.createdAt=clock.now;timer.callAt=clock.now+(parseInt(timer.delay)||(clock.duringTick?1:0));clock.timers[timer.id]=timer;if(addTimerReturnsObject){const res={refed:true,ref:function(){this.refed=true;return res;},unref:function(){this.refed=false;return res;},hasRef:function(){return this.refed;},refresh:function(){timer.callAt=clock.now+(parseInt(timer.delay)||(clock.duringTick?1:0));// it _might_ have been removed, but if not the assignment is perfectly fine +clock.timers[timer.id]=timer;return res;},[Symbol.toPrimitive]:function(){return timer.id;}};return res;}return timer.id;}/* eslint consistent-return: "off" */ /** + * Timer comparitor + * + * @param {Timer} a + * @param {Timer} b + * @returns {number} + */function compareTimers(a,b){// Sort first by absolute timing +if(a.callAtb.callAt){return 1;}// Sort next by immediate, immediate timers take precedence +if(a.immediate&&!b.immediate){return-1;}if(!a.immediate&&b.immediate){return 1;}// Sort next by creation time, earlier-created timers take precedence +if(a.createdAtb.createdAt){return 1;}// Sort next by id, lower-id timers take precedence +if(a.idb.id){return 1;}// As timer ids are unique, no fallback \`0\` is necessary +}/** + * @param {Clock} clock + * @param {number} from + * @param {number} to + * @returns {Timer} + */function firstTimerInRange(clock,from,to){const timers=clock.timers;let timer=null;let id,isInRange;for(id in timers){if(timers.hasOwnProperty(id)){isInRange=inRange(from,to,timers[id]);if(isInRange&&(!timer||compareTimers(timer,timers[id])===1)){timer=timers[id];}}}return timer;}/** + * @param {Clock} clock + * @returns {Timer} + */function firstTimer(clock){const timers=clock.timers;let timer=null;let id;for(id in timers){if(timers.hasOwnProperty(id)){if(!timer||compareTimers(timer,timers[id])===1){timer=timers[id];}}}return timer;}/** + * @param {Clock} clock + * @returns {Timer} + */function lastTimer(clock){const timers=clock.timers;let timer=null;let id;for(id in timers){if(timers.hasOwnProperty(id)){if(!timer||compareTimers(timer,timers[id])===-1){timer=timers[id];}}}return timer;}/** + * @param {Clock} clock + * @param {Timer} timer + */function callTimer(clock,timer){if(typeof timer.interval==="number"){clock.timers[timer.id].callAt+=timer.interval;}else{delete clock.timers[timer.id];}if(typeof timer.func==="function"){timer.func.apply(null,timer.args);}else{/* eslint no-eval: "off" */const eval2=eval;(function(){eval2(timer.func);})();}}/** + * Gets clear handler name for a given timer type + * + * @param {string} ttype + */function getClearHandler(ttype){if(ttype==="IdleCallback"||ttype==="AnimationFrame"){return\`cancel\${ttype}\`;}return\`clear\${ttype}\`;}/** + * Gets schedule handler name for a given timer type + * + * @param {string} ttype + */function getScheduleHandler(ttype){if(ttype==="IdleCallback"||ttype==="AnimationFrame"){return\`request\${ttype}\`;}return\`set\${ttype}\`;}/** + * Creates an anonymous function to warn only once + */function createWarnOnce(){let calls=0;return function(msg){// eslint-disable-next-line +!calls++&&console.warn(msg);};}const warnOnce=createWarnOnce();/** + * @param {Clock} clock + * @param {number} timerId + * @param {string} ttype + */function clearTimer(clock,timerId,ttype){if(!timerId){// null appears to be allowed in most browsers, and appears to be +// relied upon by some libraries, like Bootstrap carousel +return;}if(!clock.timers){clock.timers={};}// in Node, the ID is stored as the primitive value for \`Timeout\` objects +// for \`Immediate\` objects, no ID exists, so it gets coerced to NaN +const id=Number(timerId);if(Number.isNaN(id)||id1e9){throw new TypeError("Number of nanoseconds can't exceed a billion");}const oldSecs=prev[0];let nanoDiff=remainderInNanos-prev[1];let secDiff=secsSinceStart-oldSecs;if(nanoDiff<0){nanoDiff+=1e9;secDiff-=1;}return[secDiff,nanoDiff];}return[secsSinceStart,remainderInNanos];}function fakePerformanceNow(){const hrt=hrtime();const millis=hrt[0]*1000+hrt[1]/1e6;return millis;}if(hrtimeBigintPresent){hrtime.bigint=function(){const parts=hrtime();return BigInt(parts[0])*BigInt(1e9)+BigInt(parts[1]);// eslint-disable-line +};}if(intlPresent){clock.Intl=createIntl();clock.Intl.clock=clock;}clock.requestIdleCallback=function requestIdleCallback(func,timeout){let timeToNextIdlePeriod=0;if(clock.countTimers()>0){timeToNextIdlePeriod=50;// const for now +}const result=addTimer(clock,{func:func,args:Array.prototype.slice.call(arguments,2),delay:typeof timeout==="undefined"?timeToNextIdlePeriod:Math.min(timeout,timeToNextIdlePeriod),idleCallback:true});return Number(result);};clock.cancelIdleCallback=function cancelIdleCallback(timerId){return clearTimer(clock,timerId,"IdleCallback");};clock.setTimeout=function setTimeout(func,timeout){return addTimer(clock,{func:func,args:Array.prototype.slice.call(arguments,2),delay:timeout});};if(typeof _global.Promise!=="undefined"&&utilPromisify){clock.setTimeout[utilPromisify.custom]=function promisifiedSetTimeout(timeout,arg){return new _global.Promise(function setTimeoutExecutor(resolve){addTimer(clock,{func:resolve,args:[arg],delay:timeout});});};}clock.clearTimeout=function clearTimeout(timerId){return clearTimer(clock,timerId,"Timeout");};clock.nextTick=function nextTick(func){return enqueueJob(clock,{func:func,args:Array.prototype.slice.call(arguments,1),error:isNearInfiniteLimit?new Error():null});};clock.queueMicrotask=function queueMicrotask(func){return clock.nextTick(func);// explicitly drop additional arguments +};clock.setInterval=function setInterval(func,timeout){// eslint-disable-next-line no-param-reassign +timeout=parseInt(timeout,10);return addTimer(clock,{func:func,args:Array.prototype.slice.call(arguments,2),delay:timeout,interval:timeout});};clock.clearInterval=function clearInterval(timerId){return clearTimer(clock,timerId,"Interval");};if(setImmediatePresent){clock.setImmediate=function setImmediate(func){return addTimer(clock,{func:func,args:Array.prototype.slice.call(arguments,1),immediate:true});};if(typeof _global.Promise!=="undefined"&&utilPromisify){clock.setImmediate[utilPromisify.custom]=function promisifiedSetImmediate(arg){return new _global.Promise(function setImmediateExecutor(resolve){addTimer(clock,{func:resolve,args:[arg],immediate:true});});};}clock.clearImmediate=function clearImmediate(timerId){return clearTimer(clock,timerId,"Immediate");};}clock.countTimers=function countTimers(){return Object.keys(clock.timers||{}).length+(clock.jobs||[]).length;};clock.requestAnimationFrame=function requestAnimationFrame(func){const result=addTimer(clock,{func:func,delay:getTimeToNextFrame(),get args(){return[fakePerformanceNow()];},animation:true});return Number(result);};clock.cancelAnimationFrame=function cancelAnimationFrame(timerId){return clearTimer(clock,timerId,"AnimationFrame");};clock.runMicrotasks=function runMicrotasks(){runJobs(clock);};/** + * @param {number|string} tickValue milliseconds or a string parseable by parseTime + * @param {boolean} isAsync + * @param {Function} resolve + * @param {Function} reject + * @returns {number|undefined} will return the new \`now\` value or nothing for async + */function doTick(tickValue,isAsync,resolve,reject){const msFloat=typeof tickValue==="number"?tickValue:parseTime(tickValue);const ms=Math.floor(msFloat);const remainder=nanoRemainder(msFloat);let nanosTotal=nanos+remainder;let tickTo=clock.now+ms;if(msFloat<0){throw new TypeError("Negative ticks are not supported");}// adjust for positive overflow +if(nanosTotal>=1e6){tickTo+=1;nanosTotal-=1e6;}nanos=nanosTotal;let tickFrom=clock.now;let previous=clock.now;// ESLint fails to detect this correctly +/* eslint-disable prefer-const */let timer,firstException,oldNow,nextPromiseTick,compensationCheck,postTimerCall;/* eslint-enable prefer-const */clock.duringTick=true;// perform microtasks +oldNow=clock.now;runJobs(clock);if(oldNow!==clock.now){// compensate for any setSystemTime() call during microtask callback +tickFrom+=clock.now-oldNow;tickTo+=clock.now-oldNow;}//eslint-disable-next-line jsdoc/require-jsdoc +function doTickInner(){// perform each timer in the requested range +timer=firstTimerInRange(clock,tickFrom,tickTo);// eslint-disable-next-line no-unmodified-loop-condition +while(timer&&tickFrom<=tickTo){if(clock.timers[timer.id]){tickFrom=timer.callAt;clock.now=timer.callAt;oldNow=clock.now;try{runJobs(clock);callTimer(clock,timer);}catch(e){firstException=firstException||e;}if(isAsync){// finish up after native setImmediate callback to allow +// all native es6 promises to process their callbacks after +// each timer fires. +originalSetTimeout(nextPromiseTick);return;}compensationCheck();}postTimerCall();}// perform process.nextTick()s again +oldNow=clock.now;runJobs(clock);if(oldNow!==clock.now){// compensate for any setSystemTime() call during process.nextTick() callback +tickFrom+=clock.now-oldNow;tickTo+=clock.now-oldNow;}clock.duringTick=false;// corner case: during runJobs new timers were scheduled which could be in the range [clock.now, tickTo] +timer=firstTimerInRange(clock,tickFrom,tickTo);if(timer){try{clock.tick(tickTo-clock.now);// do it all again - for the remainder of the requested range +}catch(e){firstException=firstException||e;}}else{// no timers remaining in the requested range: move the clock all the way to the end +clock.now=tickTo;// update nanos +nanos=nanosTotal;}if(firstException){throw firstException;}if(isAsync){resolve(clock.now);}else{return clock.now;}}nextPromiseTick=isAsync&&function(){try{compensationCheck();postTimerCall();doTickInner();}catch(e){reject(e);}};compensationCheck=function(){// compensate for any setSystemTime() call during timer callback +if(oldNow!==clock.now){tickFrom+=clock.now-oldNow;tickTo+=clock.now-oldNow;previous+=clock.now-oldNow;}};postTimerCall=function(){timer=firstTimerInRange(clock,previous,tickTo);previous=tickFrom;};return doTickInner();}/** + * @param {string|number} tickValue number of milliseconds or a human-readable value like "01:11:15" + * @returns {number} will return the new \`now\` value + */clock.tick=function tick(tickValue){return doTick(tickValue,false);};if(typeof _global.Promise!=="undefined"){/** + * @param {string|number} tickValue number of milliseconds or a human-readable value like "01:11:15" + * @returns {Promise} + */clock.tickAsync=function tickAsync(tickValue){return new _global.Promise(function(resolve,reject){originalSetTimeout(function(){try{doTick(tickValue,true,resolve,reject);}catch(e){reject(e);}});});};}clock.next=function next(){runJobs(clock);const timer=firstTimer(clock);if(!timer){return clock.now;}clock.duringTick=true;try{clock.now=timer.callAt;callTimer(clock,timer);runJobs(clock);return clock.now;}finally{clock.duringTick=false;}};if(typeof _global.Promise!=="undefined"){clock.nextAsync=function nextAsync(){return new _global.Promise(function(resolve,reject){originalSetTimeout(function(){try{const timer=firstTimer(clock);if(!timer){resolve(clock.now);return;}let err;clock.duringTick=true;clock.now=timer.callAt;try{callTimer(clock,timer);}catch(e){err=e;}clock.duringTick=false;originalSetTimeout(function(){if(err){reject(err);}else{resolve(clock.now);}});}catch(e){reject(e);}});});};}clock.runAll=function runAll(){let numTimers,i;runJobs(clock);for(i=0;itimer.callAt){timer.callAt=clock.now+ms;}}clock.tick(ms);};if(performancePresent){clock.performance=Object.create(null);clock.performance.now=fakePerformanceNow;}if(hrtimePresent){clock.hrtime=hrtime;}return clock;}/* eslint-disable complexity */ /** + * @param {Config=} [config] Optional config + * @returns {Clock} + */function install(config){if(arguments.length>1||config instanceof Date||Array.isArray(config)||typeof config==="number"){throw new TypeError(\`FakeTimers.install called with \${String(config)} install requires an object parameter\`);}if(_global.Date.isFake===true){// Timers are already faked; this is a problem. +// Make the user reset timers before continuing. +throw new TypeError("Can't install fake timers twice on the same global object.");}// eslint-disable-next-line no-param-reassign +config=typeof config!=="undefined"?config:{};config.shouldAdvanceTime=config.shouldAdvanceTime||false;config.advanceTimeDelta=config.advanceTimeDelta||20;config.shouldClearNativeTimers=config.shouldClearNativeTimers||false;if(config.target){throw new TypeError("config.target is no longer supported. Use \`withGlobal(target)\` instead.");}let i,l;const clock=createClock(config.now,config.loopLimit);clock.shouldClearNativeTimers=config.shouldClearNativeTimers;clock.uninstall=function(){return uninstall(clock,config);};clock.methods=config.toFake||[];if(clock.methods.length===0){// do not fake nextTick by default - GitHub#126 +clock.methods=Object.keys(timers).filter(function(key){return key!=="nextTick"&&key!=="queueMicrotask";});}if(config.shouldAdvanceTime===true){const intervalTick=doIntervalTick.bind(null,clock,config.advanceTimeDelta);const intervalId=_global.setInterval(intervalTick,config.advanceTimeDelta);clock.attachedInterval=intervalId;}if(clock.methods.includes("performance")){const proto=(()=>{if(hasPerformanceConstructorPrototype){return _global.performance.constructor.prototype;}if(hasPerformancePrototype){return _global.Performance.prototype;}})();if(proto){Object.getOwnPropertyNames(proto).forEach(function(name){if(name!=="now"){clock.performance[name]=name.indexOf("getEntries")===0?NOOP_ARRAY:NOOP;}});}else if((config.toFake||[]).includes("performance")){// user explicitly tried to fake performance when not present +throw new ReferenceError("non-existent performance object cannot be faked");}}if(_global===globalObject&&timersModule){clock.timersModuleMethods=[];}for(i=0,l=clock.methods.length;i0;i--){this._clock.next();this._clock.tick(0);if(this._clock.countTimers()===0)break;}}}async advanceTimersToNextTimerAsync(steps=1){if(this._checkFakeTimers()){for(let i=steps;i>0;i--){await this._clock.nextAsync();this._clock.tick(0);if(this._clock.countTimers()===0)break;}}}advanceTimersByTime(msToRun){if(this._checkFakeTimers())this._clock.tick(msToRun);}async advanceTimersByTimeAsync(msToRun){if(this._checkFakeTimers())await this._clock.tickAsync(msToRun);}runAllTicks(){if(this._checkFakeTimers()){this._clock.runMicrotasks();}}useRealTimers(){if(this._fakingDate){resetDate();this._fakingDate=false;}if(this._fakingTime){this._clock.uninstall();this._fakingTime=false;}}useFakeTimers(){var _a,_b,_c;if(this._fakingDate){throw new Error('"setSystemTime" was called already and date was mocked. Reset timers using \`vi.useRealTimers()\` if you want to use fake timers again.');}if(!this._fakingTime){const toFake=Object.keys(this._fakeTimers.timers).filter(timer=>timer!=="nextTick");if(((_b=(_a=this._userConfig)==null?void 0:_a.toFake)==null?void 0:_b.includes("nextTick"))&&isChildProcess())throw new Error("process.nextTick cannot be mocked inside child_process");const existingFakedMethods=(((_c=this._userConfig)==null?void 0:_c.toFake)||toFake).filter(method=>{switch(method){case"setImmediate":case"clearImmediate":return method in this._global&&this._global[method];default:return true;}});this._clock=this._fakeTimers.install(_objectSpread(_objectSpread({now:Date.now()},this._userConfig),{},{toFake:existingFakedMethods}));this._fakingTime=true;}}reset(){if(this._checkFakeTimers()){const now=this._clock.now;this._clock.reset();this._clock.setSystemTime(now);}}setSystemTime(now){if(this._fakingTime){this._clock.setSystemTime(now);}else{mockDate(now??this.getRealSystemTime());this._fakingDate=true;}}getRealSystemTime(){return this._now();}getTimerCount(){if(this._checkFakeTimers())return this._clock.countTimers();return 0;}configure(config){this._userConfig=config;}isFakeTimers(){return this._fakingTime;}_checkFakeTimers(){if(!this._fakingTime){throw new Error('Timers are not mocked. Try calling "vi.useFakeTimers()" first.');}return this._fakingTime;}}function copyStackTrace(target,source){if(source.stack!==void 0)target.stack=source.stack.replace(source.message,target.message);return target;}function waitFor(callback,options={}){const _getSafeTimers3=getSafeTimers(),setTimeout=_getSafeTimers3.setTimeout,setInterval=_getSafeTimers3.setInterval,clearTimeout=_getSafeTimers3.clearTimeout,clearInterval=_getSafeTimers3.clearInterval;const _ref12=typeof options==="number"?{timeout:options}:options,_ref12$interval=_ref12.interval,interval=_ref12$interval===void 0?50:_ref12$interval,_ref12$timeout=_ref12.timeout,timeout=_ref12$timeout===void 0?1e3:_ref12$timeout;const STACK_TRACE_ERROR=new Error("STACK_TRACE_ERROR");return new Promise((resolve,reject)=>{let lastError;let promiseStatus="idle";let timeoutId;let intervalId;const onResolve=result=>{if(timeoutId)clearTimeout(timeoutId);if(intervalId)clearInterval(intervalId);resolve(result);};const handleTimeout=()=>{let error=lastError;if(!error)error=copyStackTrace(new Error("Timed out in waitFor!"),STACK_TRACE_ERROR);reject(error);};const checkCallback=()=>{if(vi.isFakeTimers())vi.advanceTimersByTime(interval);if(promiseStatus==="pending")return;try{const result=callback();if(result!==null&&typeof result==="object"&&typeof result.then==="function"){const thenable=result;promiseStatus="pending";thenable.then(resolvedValue=>{promiseStatus="resolved";onResolve(resolvedValue);},rejectedValue=>{promiseStatus="rejected";lastError=rejectedValue;});}else{onResolve(result);return true;}}catch(error){lastError=error;}};if(checkCallback()===true)return;timeoutId=setTimeout(handleTimeout,timeout);intervalId=setInterval(checkCallback,interval);});}function waitUntil(callback,options={}){const _getSafeTimers4=getSafeTimers(),setTimeout=_getSafeTimers4.setTimeout,setInterval=_getSafeTimers4.setInterval,clearTimeout=_getSafeTimers4.clearTimeout,clearInterval=_getSafeTimers4.clearInterval;const _ref13=typeof options==="number"?{timeout:options}:options,_ref13$interval=_ref13.interval,interval=_ref13$interval===void 0?50:_ref13$interval,_ref13$timeout=_ref13.timeout,timeout=_ref13$timeout===void 0?1e3:_ref13$timeout;const STACK_TRACE_ERROR=new Error("STACK_TRACE_ERROR");return new Promise((resolve,reject)=>{let promiseStatus="idle";let timeoutId;let intervalId;const onReject=error=>{if(!error)error=copyStackTrace(new Error("Timed out in waitUntil!"),STACK_TRACE_ERROR);reject(error);};const onResolve=result=>{if(!result)return;if(timeoutId)clearTimeout(timeoutId);if(intervalId)clearInterval(intervalId);resolve(result);return true;};const checkCallback=()=>{if(vi.isFakeTimers())vi.advanceTimersByTime(interval);if(promiseStatus==="pending")return;try{const result=callback();if(result!==null&&typeof result==="object"&&typeof result.then==="function"){const thenable=result;promiseStatus="pending";thenable.then(resolvedValue=>{promiseStatus="resolved";onResolve(resolvedValue);},rejectedValue=>{promiseStatus="rejected";onReject(rejectedValue);});}else{return onResolve(result);}}catch(error){onReject(error);}};if(checkCallback()===true)return;timeoutId=setTimeout(onReject,timeout);intervalId=setInterval(checkCallback,interval);});}function createVitest(){const _mocker=typeof __vitest_mocker__!=="undefined"?__vitest_mocker__:new Proxy({},{get(_,name){throw new Error(\`Vitest mocker was not initialized in this environment. vi.\${String(name)}() is forbidden.\`);}});let _mockedDate=null;let _config=null;const workerState=getWorkerState();const _timers=new FakeTimers({global:globalThis,config:workerState.config.fakeTimers});const _stubsGlobal=/* @__PURE__ */new Map();const _stubsEnv=/* @__PURE__ */new Map();const getImporter=()=>{const stackTrace=createSimpleStackTrace({stackTraceLimit:4});const importerStack=stackTrace.split("\\n")[4];const stack=parseSingleStack(importerStack);return(stack==null?void 0:stack.file)||"";};const utils={useFakeTimers(config){var _a,_b,_c,_d;if(isChildProcess()){if(((_a=config==null?void 0:config.toFake)==null?void 0:_a.includes("nextTick"))||((_d=(_c=(_b=workerState.config)==null?void 0:_b.fakeTimers)==null?void 0:_c.toFake)==null?void 0:_d.includes("nextTick"))){throw new Error('vi.useFakeTimers({ toFake: ["nextTick"] }) is not supported in node:child_process. Use --pool=threads if mocking nextTick is required.');}}if(config)_timers.configure(_objectSpread(_objectSpread({},workerState.config.fakeTimers),config));else _timers.configure(workerState.config.fakeTimers);_timers.useFakeTimers();return utils;},isFakeTimers(){return _timers.isFakeTimers();},useRealTimers(){_timers.useRealTimers();_mockedDate=null;return utils;},runOnlyPendingTimers(){_timers.runOnlyPendingTimers();return utils;},async runOnlyPendingTimersAsync(){await _timers.runOnlyPendingTimersAsync();return utils;},runAllTimers(){_timers.runAllTimers();return utils;},async runAllTimersAsync(){await _timers.runAllTimersAsync();return utils;},runAllTicks(){_timers.runAllTicks();return utils;},advanceTimersByTime(ms){_timers.advanceTimersByTime(ms);return utils;},async advanceTimersByTimeAsync(ms){await _timers.advanceTimersByTimeAsync(ms);return utils;},advanceTimersToNextTimer(){_timers.advanceTimersToNextTimer();return utils;},async advanceTimersToNextTimerAsync(){await _timers.advanceTimersToNextTimerAsync();return utils;},getTimerCount(){return _timers.getTimerCount();},setSystemTime(time){const date=time instanceof Date?time:new Date(time);_mockedDate=date;_timers.setSystemTime(date);return utils;},getMockedSystemTime(){return _mockedDate;},getRealSystemTime(){return _timers.getRealSystemTime();},clearAllTimers(){_timers.clearAllTimers();return utils;},// mocks +spyOn,fn,waitFor,waitUntil,hoisted(factory){assertTypes(factory,'"vi.hoisted" factory',["function"]);return factory();},mock(path,factory){const importer=getImporter();_mocker.queueMock(path,importer,factory?()=>factory(()=>_mocker.importActual(path,importer,_mocker.getMockContext().callstack)):void 0,true);},unmock(path){_mocker.queueUnmock(path,getImporter());},doMock(path,factory){const importer=getImporter();_mocker.queueMock(path,importer,factory?()=>factory(()=>_mocker.importActual(path,importer,_mocker.getMockContext().callstack)):void 0,false);},doUnmock(path){_mocker.queueUnmock(path,getImporter());},async importActual(path){return _mocker.importActual(path,getImporter(),_mocker.getMockContext().callstack);},async importMock(path){return _mocker.importMock(path,getImporter());},// this is typed in the interface so it's not necessary to type it here +mocked(item,_options={}){return item;},isMockFunction(fn2){return isMockFunction(fn2);},clearAllMocks(){mocks.forEach(spy=>spy.mockClear());return utils;},resetAllMocks(){mocks.forEach(spy=>spy.mockReset());return utils;},restoreAllMocks(){mocks.forEach(spy=>spy.mockRestore());return utils;},stubGlobal(name,value){if(!_stubsGlobal.has(name))_stubsGlobal.set(name,Object.getOwnPropertyDescriptor(globalThis,name));Object.defineProperty(globalThis,name,{value,writable:true,configurable:true,enumerable:true});return utils;},stubEnv(name,value){if(!_stubsEnv.has(name))_stubsEnv.set(name,process.env[name]);process.env[name]=value;return utils;},unstubAllGlobals(){_stubsGlobal.forEach((original,name)=>{if(!original)Reflect.deleteProperty(globalThis,name);else Object.defineProperty(globalThis,name,original);});_stubsGlobal.clear();return utils;},unstubAllEnvs(){_stubsEnv.forEach((original,name)=>{if(original===void 0)delete process.env[name];else process.env[name]=original;});_stubsEnv.clear();return utils;},resetModules(){resetModules(workerState.moduleCache);return utils;},async dynamicImportSettled(){return waitForImportsToResolve();},setConfig(config){if(!_config)_config=_objectSpread({},workerState.config);Object.assign(workerState.config,config);},resetConfig(){if(_config)Object.assign(workerState.config,_config);}};return utils;}const vitest=createVitest();const vi=vitest;class Spy{called=false;mock=()=>{};method(){}}function spy(){const inst=new Spy();return vi.fn(inst.mock);}async function wait(){}exports.spy=spy;exports.wait=wait; +//# sourceMappingURL=test.js.map +" `; -exports[`Outputs (swc) artifacts builds all the artifacts with rollup 7`] = ` -[ - "umd/client.js", - "(function (global, factory) { +exports[`Outputs (swc) > artifacts > builds all the artifacts with rollup > umd/client.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define("Packemon", ["exports"], factory); } else if (typeof exports !== "undefined") { @@ -2011,11 +18289,10 @@ exports[`Outputs (swc) artifacts builds all the artifacts with rollup 7`] = ` } }); //# sourceMappingURL=client.js.map -", -] +" `; -exports[`Outputs (swc) artifacts builds all the artifacts with rollup 8`] = ` +exports[`Outputs (swc) > artifacts > builds all the artifacts with rollup 1`] = ` [ { "format": "lib", @@ -2026,10 +18303,8 @@ exports[`Outputs (swc) artifacts builds all the artifacts with rollup 8`] = ` ] `; -exports[`Outputs (swc) bundle bundles all files into a single file with rollup 1`] = ` -[ - "lib/index.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Outputs (swc) > bundle > bundles all files into a single file with rollup > lib/index.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: lib 'use strict'; @@ -2039,28 +18314,29 @@ function bar() {} exports.bar = bar; exports.foo = foo; //# sourceMappingURL=index.js.map -", -] +" `; -exports[`Outputs (swc) bundle bundles all files into a single file with rollup 2`] = ` -[ - "package.json", - { - "main": "./lib/index.js", - "name": "project-bundle", - "packemon": { - "bundle": true, - "platform": "node", - }, - }, -] +exports[`Outputs (swc) > bundle with assets > bundles all files and references assets (browser, esm) > ../assets/fonts-4e5dc96c.css 1`] = ` +"@font-face { +} +" `; -exports[`Outputs (swc) bundle with assets bundles all files and references assets (browser, esm) 1`] = ` -[ - "esm/index.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Outputs (swc) > bundle with assets > bundles all files and references assets (browser, esm) > ../assets/globals-107ab52e.css 1`] = ` +"html { +} +" +`; + +exports[`Outputs (swc) > bundle with assets > bundles all files and references assets (browser, esm) > ../assets/styles-b11c3a83.css 1`] = ` +".button { +} +" +`; + +exports[`Outputs (swc) > bundle with assets > bundles all files and references assets (browser, esm) > esm/index.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: esm import '../assets/globals-107ab52e.css'; @@ -2069,50 +18345,29 @@ import '../assets/styles-b11c3a83.css'; function button() {} export { button }; //# sourceMappingURL=index.js.map -", -] -`; - -exports[`Outputs (swc) bundle with assets bundles all files and references assets (browser, esm) 2`] = ` -[ - "package.json", - { - "main": "./esm/index.js", - "module": "./esm/index.js", - "name": "project-assets", - "packemon": { - "bundle": true, - "platform": "node", - }, - }, -] +" `; -exports[`Outputs (swc) bundle with assets bundles all files and references assets (browser, esm) 3`] = ` -[ - "src/button/styles.css", - "assets/styles-b11c3a83.css", -] +exports[`Outputs (swc) > bundle with assets > bundles all files and references assets (browser, lib) > ../assets/fonts-4e5dc96c.css 1`] = ` +"@font-face { +} +" `; -exports[`Outputs (swc) bundle with assets bundles all files and references assets (browser, esm) 4`] = ` -[ - "src/globals.css", - "assets/globals-107ab52e.css", -] +exports[`Outputs (swc) > bundle with assets > bundles all files and references assets (browser, lib) > ../assets/globals-107ab52e.css 1`] = ` +"html { +} +" `; -exports[`Outputs (swc) bundle with assets bundles all files and references assets (browser, esm) 5`] = ` -[ - "src/shared/fonts.css", - "assets/fonts-4e5dc96c.css", -] +exports[`Outputs (swc) > bundle with assets > bundles all files and references assets (browser, lib) > ../assets/styles-b11c3a83.css 1`] = ` +".button { +} +" `; -exports[`Outputs (swc) bundle with assets bundles all files and references assets (browser, lib) 1`] = ` -[ - "lib/index.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Outputs (swc) > bundle with assets > bundles all files and references assets (browser, lib) > lib/index.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: lib 'use strict'; @@ -2123,85 +18378,29 @@ require('../assets/styles-b11c3a83.css'); function button() {} exports.button = button; //# sourceMappingURL=index.js.map -", -] -`; - -exports[`Outputs (swc) bundle with assets bundles all files and references assets (browser, lib) 2`] = ` -[ - "package.json", - { - "main": "./lib/index.js", - "name": "project-assets", - "packemon": { - "bundle": true, - "platform": "node", - }, - }, -] -`; - -exports[`Outputs (swc) bundle with assets bundles all files and references assets (browser, lib) 3`] = ` -[ - "src/button/styles.css", - "assets/styles-b11c3a83.css", -] -`; - -exports[`Outputs (swc) bundle with assets bundles all files and references assets (browser, lib) 4`] = ` -[ - "src/globals.css", - "assets/globals-107ab52e.css", -] -`; - -exports[`Outputs (swc) bundle with assets bundles all files and references assets (browser, lib) 5`] = ` -[ - "src/shared/fonts.css", - "assets/fonts-4e5dc96c.css", -] -`; - -exports[`Outputs (swc) bundle with assets bundles all files and references assets (browser, umd) 1`] = ` -[ - "package.json", - { - "browser": "./umd/index.js", - "main": "./lib/index.js", - "name": "project-assets", - "packemon": { - "bundle": true, - "platform": "node", - }, - }, -] +" `; -exports[`Outputs (swc) bundle with assets bundles all files and references assets (browser, umd) 2`] = ` -[ - "src/button/styles.css", - "assets/styles-b11c3a83.css", -] +exports[`Outputs (swc) > bundle with assets > bundles all files and references assets (browser, umd) > ../assets/fonts-4e5dc96c.css 1`] = ` +"@font-face { +} +" `; -exports[`Outputs (swc) bundle with assets bundles all files and references assets (browser, umd) 3`] = ` -[ - "src/globals.css", - "assets/globals-107ab52e.css", -] +exports[`Outputs (swc) > bundle with assets > bundles all files and references assets (browser, umd) > ../assets/globals-107ab52e.css 1`] = ` +"html { +} +" `; -exports[`Outputs (swc) bundle with assets bundles all files and references assets (browser, umd) 4`] = ` -[ - "src/shared/fonts.css", - "assets/fonts-4e5dc96c.css", -] +exports[`Outputs (swc) > bundle with assets > bundles all files and references assets (browser, umd) > ../assets/styles-b11c3a83.css 1`] = ` +".button { +} +" `; -exports[`Outputs (swc) bundle with assets bundles all files and references assets (browser, umd) 5`] = ` -[ - "umd/index.js", - "(function (global, factory) { +exports[`Outputs (swc) > bundle with assets > bundles all files and references assets (browser, umd) > umd/index.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports", "../assets/globals-107ab52e.css", "../assets/fonts-4e5dc96c.css", "../assets/styles-b11c3a83.css"], factory); } else if (typeof exports !== "undefined") { @@ -2226,14 +18425,29 @@ exports[`Outputs (swc) bundle with assets bundles all files and references asset function button() {} }); //# sourceMappingURL=index.js.map -", -] +" `; -exports[`Outputs (swc) bundle with assets bundles all files and references assets (electron, esm) 1`] = ` -[ - "esm/index.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Outputs (swc) > bundle with assets > bundles all files and references assets (electron, esm) > ../assets/fonts-4e5dc96c.css 1`] = ` +"@font-face { +} +" +`; + +exports[`Outputs (swc) > bundle with assets > bundles all files and references assets (electron, esm) > ../assets/globals-107ab52e.css 1`] = ` +"html { +} +" +`; + +exports[`Outputs (swc) > bundle with assets > bundles all files and references assets (electron, esm) > ../assets/styles-b11c3a83.css 1`] = ` +".button { +} +" +`; + +exports[`Outputs (swc) > bundle with assets > bundles all files and references assets (electron, esm) > esm/index.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: esm import '../assets/globals-107ab52e.css'; @@ -2242,50 +18456,29 @@ import '../assets/styles-b11c3a83.css'; function button() {} export { button }; //# sourceMappingURL=index.js.map -", -] -`; - -exports[`Outputs (swc) bundle with assets bundles all files and references assets (electron, esm) 2`] = ` -[ - "package.json", - { - "main": "./esm/index.js", - "module": "./esm/index.js", - "name": "project-assets", - "packemon": { - "bundle": true, - "platform": "node", - }, - }, -] +" `; -exports[`Outputs (swc) bundle with assets bundles all files and references assets (electron, esm) 3`] = ` -[ - "src/button/styles.css", - "assets/styles-b11c3a83.css", -] +exports[`Outputs (swc) > bundle with assets > bundles all files and references assets (electron, lib) > ../assets/fonts-4e5dc96c.css 1`] = ` +"@font-face { +} +" `; -exports[`Outputs (swc) bundle with assets bundles all files and references assets (electron, esm) 4`] = ` -[ - "src/globals.css", - "assets/globals-107ab52e.css", -] +exports[`Outputs (swc) > bundle with assets > bundles all files and references assets (electron, lib) > ../assets/globals-107ab52e.css 1`] = ` +"html { +} +" `; -exports[`Outputs (swc) bundle with assets bundles all files and references assets (electron, esm) 5`] = ` -[ - "src/shared/fonts.css", - "assets/fonts-4e5dc96c.css", -] +exports[`Outputs (swc) > bundle with assets > bundles all files and references assets (electron, lib) > ../assets/styles-b11c3a83.css 1`] = ` +".button { +} +" `; -exports[`Outputs (swc) bundle with assets bundles all files and references assets (electron, lib) 1`] = ` -[ - "lib/index.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Outputs (swc) > bundle with assets > bundles all files and references assets (electron, lib) > lib/index.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: lib 'use strict'; @@ -2296,49 +18489,29 @@ require('../assets/styles-b11c3a83.css'); function button() {} exports.button = button; //# sourceMappingURL=index.js.map -", -] -`; - -exports[`Outputs (swc) bundle with assets bundles all files and references assets (electron, lib) 2`] = ` -[ - "package.json", - { - "main": "./lib/index.js", - "name": "project-assets", - "packemon": { - "bundle": true, - "platform": "node", - }, - }, -] +" `; -exports[`Outputs (swc) bundle with assets bundles all files and references assets (electron, lib) 3`] = ` -[ - "src/button/styles.css", - "assets/styles-b11c3a83.css", -] +exports[`Outputs (swc) > bundle with assets > bundles all files and references assets (native, lib) > ../assets/fonts-4e5dc96c.css 1`] = ` +"@font-face { +} +" `; -exports[`Outputs (swc) bundle with assets bundles all files and references assets (electron, lib) 4`] = ` -[ - "src/globals.css", - "assets/globals-107ab52e.css", -] +exports[`Outputs (swc) > bundle with assets > bundles all files and references assets (native, lib) > ../assets/globals-107ab52e.css 1`] = ` +"html { +} +" `; -exports[`Outputs (swc) bundle with assets bundles all files and references assets (electron, lib) 5`] = ` -[ - "src/shared/fonts.css", - "assets/fonts-4e5dc96c.css", -] +exports[`Outputs (swc) > bundle with assets > bundles all files and references assets (native, lib) > ../assets/styles-b11c3a83.css 1`] = ` +".button { +} +" `; -exports[`Outputs (swc) bundle with assets bundles all files and references assets (native, lib) 1`] = ` -[ - "lib/index.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Outputs (swc) > bundle with assets > bundles all files and references assets (native, lib) > lib/index.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: stable, Format: lib 'use strict'; @@ -2349,49 +18522,29 @@ require('../assets/styles-b11c3a83.css'); function button() {} exports.button = button; //# sourceMappingURL=index.js.map -", -] -`; - -exports[`Outputs (swc) bundle with assets bundles all files and references assets (native, lib) 2`] = ` -[ - "package.json", - { - "main": "./lib/index.js", - "name": "project-assets", - "packemon": { - "bundle": true, - "platform": "node", - }, - }, -] +" `; -exports[`Outputs (swc) bundle with assets bundles all files and references assets (native, lib) 3`] = ` -[ - "src/button/styles.css", - "assets/styles-b11c3a83.css", -] +exports[`Outputs (swc) > bundle with assets > bundles all files and references assets (node, cjs) > ../assets/fonts-4e5dc96c.css 1`] = ` +"@font-face { +} +" `; -exports[`Outputs (swc) bundle with assets bundles all files and references assets (native, lib) 4`] = ` -[ - "src/globals.css", - "assets/globals-107ab52e.css", -] +exports[`Outputs (swc) > bundle with assets > bundles all files and references assets (node, cjs) > ../assets/globals-107ab52e.css 1`] = ` +"html { +} +" `; -exports[`Outputs (swc) bundle with assets bundles all files and references assets (native, lib) 5`] = ` -[ - "src/shared/fonts.css", - "assets/fonts-4e5dc96c.css", -] +exports[`Outputs (swc) > bundle with assets > bundles all files and references assets (node, cjs) > ../assets/styles-b11c3a83.css 1`] = ` +".button { +} +" `; -exports[`Outputs (swc) bundle with assets bundles all files and references assets (node, cjs) 1`] = ` -[ - "cjs/index.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Outputs (swc) > bundle with assets > bundles all files and references assets (node, cjs) > cjs/index.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: cjs 'use strict'; @@ -2402,49 +18555,38 @@ require('../assets/styles-b11c3a83.css'); function button() {} exports.button = button; //# sourceMappingURL=index.cjs.map -", -] +" `; -exports[`Outputs (swc) bundle with assets bundles all files and references assets (node, cjs) 2`] = ` -[ - "package.json", - { - "main": "./cjs/index.cjs", - "name": "project-assets", - "packemon": { - "bundle": true, - "platform": "node", - }, - }, -] +exports[`Outputs (swc) > bundle with assets > bundles all files and references assets (node, cjs) > cjs/index-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index.cjs'; + +export const { button } = data;" `; -exports[`Outputs (swc) bundle with assets bundles all files and references assets (node, cjs) 3`] = ` -[ - "src/button/styles.css", - "assets/styles-b11c3a83.css", -] +exports[`Outputs (swc) > bundle with assets > bundles all files and references assets (node, lib) > ../assets/fonts-4e5dc96c.css 1`] = ` +"@font-face { +} +" `; -exports[`Outputs (swc) bundle with assets bundles all files and references assets (node, cjs) 4`] = ` -[ - "src/globals.css", - "assets/globals-107ab52e.css", -] +exports[`Outputs (swc) > bundle with assets > bundles all files and references assets (node, lib) > ../assets/globals-107ab52e.css 1`] = ` +"html { +} +" `; -exports[`Outputs (swc) bundle with assets bundles all files and references assets (node, cjs) 5`] = ` -[ - "src/shared/fonts.css", - "assets/fonts-4e5dc96c.css", -] +exports[`Outputs (swc) > bundle with assets > bundles all files and references assets (node, lib) > ../assets/styles-b11c3a83.css 1`] = ` +".button { +} +" `; -exports[`Outputs (swc) bundle with assets bundles all files and references assets (node, lib) 1`] = ` -[ - "lib/index.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Outputs (swc) > bundle with assets > bundles all files and references assets (node, lib) > lib/index.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: lib 'use strict'; @@ -2455,49 +18597,29 @@ require('../assets/styles-b11c3a83.css'); function button() {} exports.button = button; //# sourceMappingURL=index.js.map -", -] -`; - -exports[`Outputs (swc) bundle with assets bundles all files and references assets (node, lib) 2`] = ` -[ - "package.json", - { - "main": "./lib/index.js", - "name": "project-assets", - "packemon": { - "bundle": true, - "platform": "node", - }, - }, -] +" `; -exports[`Outputs (swc) bundle with assets bundles all files and references assets (node, lib) 3`] = ` -[ - "src/button/styles.css", - "assets/styles-b11c3a83.css", -] +exports[`Outputs (swc) > bundle with assets > bundles all files and references assets (node, mjs) > ../assets/fonts-4e5dc96c.css 1`] = ` +"@font-face { +} +" `; -exports[`Outputs (swc) bundle with assets bundles all files and references assets (node, lib) 4`] = ` -[ - "src/globals.css", - "assets/globals-107ab52e.css", -] +exports[`Outputs (swc) > bundle with assets > bundles all files and references assets (node, mjs) > ../assets/globals-107ab52e.css 1`] = ` +"html { +} +" `; -exports[`Outputs (swc) bundle with assets bundles all files and references assets (node, lib) 5`] = ` -[ - "src/shared/fonts.css", - "assets/fonts-4e5dc96c.css", -] +exports[`Outputs (swc) > bundle with assets > bundles all files and references assets (node, mjs) > ../assets/styles-b11c3a83.css 1`] = ` +".button { +} +" `; -exports[`Outputs (swc) bundle with assets bundles all files and references assets (node, mjs) 1`] = ` -[ - "mjs/index.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Outputs (swc) > bundle with assets > bundles all files and references assets (node, mjs) > mjs/index.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: mjs import '../assets/globals-107ab52e.css'; @@ -2506,49 +18628,65 @@ import '../assets/styles-b11c3a83.css'; function button() {} export { button }; //# sourceMappingURL=index.mjs.map -", -] +" `; -exports[`Outputs (swc) bundle with assets bundles all files and references assets (node, mjs) 2`] = ` -[ - "package.json", - { - "main": "./mjs/index.mjs", - "name": "project-assets", - "packemon": { - "bundle": true, - "platform": "node", - }, - }, -] +exports[`Outputs (swc) > bundle with assets > uses same assets across multiple formats > ../assets/fonts-4e5dc96c.css 1`] = ` +"@font-face { +} +" `; -exports[`Outputs (swc) bundle with assets bundles all files and references assets (node, mjs) 3`] = ` -[ - "src/button/styles.css", - "assets/styles-b11c3a83.css", -] +exports[`Outputs (swc) > bundle with assets > uses same assets across multiple formats > ../assets/fonts-4e5dc96c.css 2`] = ` +"@font-face { +} +" `; -exports[`Outputs (swc) bundle with assets bundles all files and references assets (node, mjs) 4`] = ` -[ - "src/globals.css", - "assets/globals-107ab52e.css", -] +exports[`Outputs (swc) > bundle with assets > uses same assets across multiple formats > ../assets/fonts-4e5dc96c.css 3`] = ` +"@font-face { +} +" `; -exports[`Outputs (swc) bundle with assets bundles all files and references assets (node, mjs) 5`] = ` -[ - "src/shared/fonts.css", - "assets/fonts-4e5dc96c.css", -] +exports[`Outputs (swc) > bundle with assets > uses same assets across multiple formats > ../assets/globals-107ab52e.css 1`] = ` +"html { +} +" `; -exports[`Outputs (swc) bundle with assets uses same assets across multiple formats 1`] = ` -[ - "cjs/index.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Outputs (swc) > bundle with assets > uses same assets across multiple formats > ../assets/globals-107ab52e.css 2`] = ` +"html { +} +" +`; + +exports[`Outputs (swc) > bundle with assets > uses same assets across multiple formats > ../assets/globals-107ab52e.css 3`] = ` +"html { +} +" +`; + +exports[`Outputs (swc) > bundle with assets > uses same assets across multiple formats > ../assets/styles-b11c3a83.css 1`] = ` +".button { +} +" +`; + +exports[`Outputs (swc) > bundle with assets > uses same assets across multiple formats > ../assets/styles-b11c3a83.css 2`] = ` +".button { +} +" +`; + +exports[`Outputs (swc) > bundle with assets > uses same assets across multiple formats > ../assets/styles-b11c3a83.css 3`] = ` +".button { +} +" +`; + +exports[`Outputs (swc) > bundle with assets > uses same assets across multiple formats > cjs/index.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: cjs 'use strict'; @@ -2559,14 +18697,20 @@ require('../assets/styles-b11c3a83.css'); function button() {} exports.button = button; //# sourceMappingURL=index.cjs.map -", -] +" `; -exports[`Outputs (swc) bundle with assets uses same assets across multiple formats 2`] = ` -[ - "esm/index.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Outputs (swc) > bundle with assets > uses same assets across multiple formats > cjs/index-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index.cjs'; + +export const { button } = data;" +`; + +exports[`Outputs (swc) > bundle with assets > uses same assets across multiple formats > esm/index.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: esm import '../assets/globals-107ab52e.css'; @@ -2575,318 +18719,164 @@ import '../assets/styles-b11c3a83.css'; function button() {} export { button }; //# sourceMappingURL=index.js.map -", -] -`; - -exports[`Outputs (swc) bundle with assets uses same assets across multiple formats 3`] = ` -[ - "lib/index.js", - "// Bundled with Packemon: https://packemon.dev -// Platform: node, Support: stable, Format: lib - -'use strict'; - -require('../assets/globals-107ab52e.css'); -require('../assets/fonts-4e5dc96c.css'); -require('../assets/styles-b11c3a83.css'); -function button() {} -exports.button = button; -//# sourceMappingURL=index.js.map -", -] -`; - -exports[`Outputs (swc) bundle with assets uses same assets across multiple formats 4`] = ` -[ - "package.json", - { - "main": "./lib/index.js", - "module": "./esm/index.js", - "name": "project-assets", - "packemon": { - "bundle": true, - "platform": "node", - }, - }, -] +" `; -exports[`Outputs (swc) bundle with assets uses same assets across multiple formats 5`] = ` -[ - "src/button/styles.css", - "assets/styles-b11c3a83.css", -] -`; +exports[`Outputs (swc) > bundle with assets > uses same assets across multiple formats > esm/index-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file -exports[`Outputs (swc) bundle with assets uses same assets across multiple formats 6`] = ` -[ - "src/button/styles.css", - "assets/styles-b11c3a83.css", -] -`; +import data from './index.cjs'; -exports[`Outputs (swc) bundle with assets uses same assets across multiple formats 7`] = ` -[ - "src/button/styles.css", - "assets/styles-b11c3a83.css", -] +export const { button } = data;" `; -exports[`Outputs (swc) bundle with assets uses same assets across multiple formats 8`] = ` -[ - "src/globals.css", - "assets/globals-107ab52e.css", -] -`; +exports[`Outputs (swc) > bundle with assets > uses same assets across multiple formats > lib/index.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// Platform: node, Support: stable, Format: lib -exports[`Outputs (swc) bundle with assets uses same assets across multiple formats 9`] = ` -[ - "src/globals.css", - "assets/globals-107ab52e.css", -] -`; +'use strict'; -exports[`Outputs (swc) bundle with assets uses same assets across multiple formats 10`] = ` -[ - "src/globals.css", - "assets/globals-107ab52e.css", -] +require('../assets/globals-107ab52e.css'); +require('../assets/fonts-4e5dc96c.css'); +require('../assets/styles-b11c3a83.css'); +function button() {} +exports.button = button; +//# sourceMappingURL=index.js.map +" `; -exports[`Outputs (swc) bundle with assets uses same assets across multiple formats 11`] = ` -[ - "src/shared/fonts.css", - "assets/fonts-4e5dc96c.css", -] -`; +exports[`Outputs (swc) > bundle with assets > uses same assets across multiple formats > lib/index-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file -exports[`Outputs (swc) bundle with assets uses same assets across multiple formats 12`] = ` -[ - "src/shared/fonts.css", - "assets/fonts-4e5dc96c.css", -] -`; +import data from './index.cjs'; -exports[`Outputs (swc) bundle with assets uses same assets across multiple formats 13`] = ` -[ - "src/shared/fonts.css", - "assets/fonts-4e5dc96c.css", -] +export const { button } = data;" `; -exports[`Outputs (swc) no bundle creates individual files for every source file 1`] = ` -[ - "lib/index.js", - "'use strict'; +exports[`Outputs (swc) > no bundle > creates individual files for every source file > lib/index.js 1`] = ` +"'use strict'; const other = require('./other.js'); function bar() {} exports.foo = other.foo; exports.bar = bar; //# sourceMappingURL=index.js.map -", -] +" `; -exports[`Outputs (swc) no bundle creates individual files for every source file 2`] = ` -[ - "lib/not-imported.js", - "'use strict'; +exports[`Outputs (swc) > no bundle > creates individual files for every source file > lib/not-imported.js 1`] = ` +"'use strict'; function baz() {} exports.baz = baz; //# sourceMappingURL=not-imported.js.map -", -] +" `; -exports[`Outputs (swc) no bundle creates individual files for every source file 3`] = ` -[ - "lib/other.js", - "'use strict'; +exports[`Outputs (swc) > no bundle > creates individual files for every source file > lib/other.js 1`] = ` +"'use strict'; function foo() {} exports.foo = foo; //# sourceMappingURL=other.js.map -", -] +" `; -exports[`Outputs (swc) no bundle creates individual files for every source file 4`] = ` -[ - "package.json", - { - "main": "./lib/index.js", - "name": "project-bundle", - "packemon": { - "bundle": true, - "platform": "node", - }, - }, -] +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (browser, esm) > ../assets/fonts-4e5dc96c.css 1`] = ` +"@font-face { +} +" `; -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (browser, esm) 1`] = ` -[ - "esm/button/index.js", - "import '../../assets/styles-b11c3a83.css'; +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (browser, esm) > ../assets/globals-107ab52e.css 1`] = ` +"html { +} +" +`; + +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (browser, esm) > ../assets/styles-b11c3a83.css 1`] = ` +".button { +} +" +`; + +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (browser, esm) > esm/button/index.js 1`] = ` +"import '../../assets/styles-b11c3a83.css'; function button() {} export { button }; //# sourceMappingURL=index.js.map -", -] +" `; -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (browser, esm) 2`] = ` -[ - "esm/index.js", - "import '../assets/globals-107ab52e.css'; +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (browser, esm) > esm/index.js 1`] = ` +"import '../assets/globals-107ab52e.css'; import '../assets/fonts-4e5dc96c.css'; export { button } from './button/index.js'; //# sourceMappingURL=index.js.map -", -] -`; - -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (browser, esm) 3`] = ` -[ - "package.json", - { - "main": "./esm/index.js", - "module": "./esm/index.js", - "name": "project-assets", - "packemon": { - "bundle": true, - "platform": "node", - }, - }, -] +" `; -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (browser, esm) 4`] = ` -[ - "src/button/styles.css", - "assets/styles-b11c3a83.css", -] +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (browser, lib) > ../assets/fonts-4e5dc96c.css 1`] = ` +"@font-face { +} +" `; -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (browser, esm) 5`] = ` -[ - "src/globals.css", - "assets/globals-107ab52e.css", -] +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (browser, lib) > ../assets/globals-107ab52e.css 1`] = ` +"html { +} +" `; -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (browser, esm) 6`] = ` -[ - "src/shared/fonts.css", - "assets/fonts-4e5dc96c.css", -] +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (browser, lib) > ../assets/styles-b11c3a83.css 1`] = ` +".button { +} +" `; -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (browser, lib) 1`] = ` -[ - "lib/button/index.js", - "'use strict'; +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (browser, lib) > lib/button/index.js 1`] = ` +"'use strict'; require('../../assets/styles-b11c3a83.css'); function button() {} exports.button = button; //# sourceMappingURL=index.js.map -", -] +" `; -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (browser, lib) 2`] = ` -[ - "lib/index.js", - "'use strict'; +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (browser, lib) > lib/index.js 1`] = ` +"'use strict'; require('../assets/globals-107ab52e.css'); require('../assets/fonts-4e5dc96c.css'); const index = require('./button/index.js'); exports.button = index.button; //# sourceMappingURL=index.js.map -", -] -`; - -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (browser, lib) 3`] = ` -[ - "package.json", - { - "main": "./lib/index.js", - "name": "project-assets", - "packemon": { - "bundle": true, - "platform": "node", - }, - }, -] -`; - -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (browser, lib) 4`] = ` -[ - "src/button/styles.css", - "assets/styles-b11c3a83.css", -] -`; - -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (browser, lib) 5`] = ` -[ - "src/globals.css", - "assets/globals-107ab52e.css", -] -`; - -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (browser, lib) 6`] = ` -[ - "src/shared/fonts.css", - "assets/fonts-4e5dc96c.css", -] -`; - -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (browser, umd) 1`] = ` -[ - "package.json", - { - "browser": "./umd/index.js", - "main": "./lib/index.js", - "name": "project-assets", - "packemon": { - "bundle": true, - "platform": "node", - }, - }, -] +" `; -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (browser, umd) 2`] = ` -[ - "src/button/styles.css", - "assets/styles-b11c3a83.css", -] +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (browser, umd) > ../assets/fonts-4e5dc96c.css 1`] = ` +"@font-face { +} +" `; -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (browser, umd) 3`] = ` -[ - "src/globals.css", - "assets/globals-107ab52e.css", -] +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (browser, umd) > ../assets/globals-107ab52e.css 1`] = ` +"html { +} +" `; -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (browser, umd) 4`] = ` -[ - "src/shared/fonts.css", - "assets/fonts-4e5dc96c.css", -] +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (browser, umd) > ../assets/styles-b11c3a83.css 1`] = ` +".button { +} +" `; -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (browser, umd) 5`] = ` -[ - "umd/button/index.js", - "(function (global, factory) { +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (browser, umd) > umd/button/index.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports", "../../assets/styles-b11c3a83.css"], factory); } else if (typeof exports !== "undefined") { @@ -2908,14 +18898,11 @@ exports[`Outputs (swc) no bundle with assets creates individual files and refere function button() {} }); //# sourceMappingURL=index.js.map -", -] +" `; -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (browser, umd) 6`] = ` -[ - "umd/index.js", - "(function (global, factory) { +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (browser, umd) > umd/index.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports", "../assets/globals-107ab52e.css", "../assets/fonts-4e5dc96c.css", "./button/index.js"], factory); } else if (typeof exports !== "undefined") { @@ -2941,377 +18928,244 @@ exports[`Outputs (swc) no bundle with assets creates individual files and refere }); }); //# sourceMappingURL=index.js.map -", -] +" `; -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (electron, esm) 1`] = ` -[ - "esm/button/index.js", - "import '../../assets/styles-b11c3a83.css'; +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (electron, esm) > ../assets/fonts-4e5dc96c.css 1`] = ` +"@font-face { +} +" +`; + +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (electron, esm) > ../assets/globals-107ab52e.css 1`] = ` +"html { +} +" +`; + +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (electron, esm) > ../assets/styles-b11c3a83.css 1`] = ` +".button { +} +" +`; + +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (electron, esm) > esm/button/index.js 1`] = ` +"import '../../assets/styles-b11c3a83.css'; function button() {} export { button }; //# sourceMappingURL=index.js.map -", -] +" `; -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (electron, esm) 2`] = ` -[ - "esm/index.js", - "import '../assets/globals-107ab52e.css'; +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (electron, esm) > esm/index.js 1`] = ` +"import '../assets/globals-107ab52e.css'; import '../assets/fonts-4e5dc96c.css'; export { button } from './button/index.js'; //# sourceMappingURL=index.js.map -", -] -`; - -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (electron, esm) 3`] = ` -[ - "package.json", - { - "main": "./esm/index.js", - "module": "./esm/index.js", - "name": "project-assets", - "packemon": { - "bundle": true, - "platform": "node", - }, - }, -] +" `; -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (electron, esm) 4`] = ` -[ - "src/button/styles.css", - "assets/styles-b11c3a83.css", -] +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (electron, lib) > ../assets/fonts-4e5dc96c.css 1`] = ` +"@font-face { +} +" `; -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (electron, esm) 5`] = ` -[ - "src/globals.css", - "assets/globals-107ab52e.css", -] +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (electron, lib) > ../assets/globals-107ab52e.css 1`] = ` +"html { +} +" `; -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (electron, esm) 6`] = ` -[ - "src/shared/fonts.css", - "assets/fonts-4e5dc96c.css", -] +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (electron, lib) > ../assets/styles-b11c3a83.css 1`] = ` +".button { +} +" `; -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (electron, lib) 1`] = ` -[ - "lib/button/index.js", - "'use strict'; +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (electron, lib) > lib/button/index.js 1`] = ` +"'use strict'; require('../../assets/styles-b11c3a83.css'); function button() {} exports.button = button; //# sourceMappingURL=index.js.map -", -] +" `; -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (electron, lib) 2`] = ` -[ - "lib/index.js", - "'use strict'; +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (electron, lib) > lib/index.js 1`] = ` +"'use strict'; require('../assets/globals-107ab52e.css'); require('../assets/fonts-4e5dc96c.css'); const index = require('./button/index.js'); exports.button = index.button; //# sourceMappingURL=index.js.map -", -] -`; - -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (electron, lib) 3`] = ` -[ - "package.json", - { - "main": "./lib/index.js", - "name": "project-assets", - "packemon": { - "bundle": true, - "platform": "node", - }, - }, -] +" `; -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (electron, lib) 4`] = ` -[ - "src/button/styles.css", - "assets/styles-b11c3a83.css", -] +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (native, lib) > ../assets/fonts-4e5dc96c.css 1`] = ` +"@font-face { +} +" `; -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (electron, lib) 5`] = ` -[ - "src/globals.css", - "assets/globals-107ab52e.css", -] +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (native, lib) > ../assets/globals-107ab52e.css 1`] = ` +"html { +} +" `; -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (electron, lib) 6`] = ` -[ - "src/shared/fonts.css", - "assets/fonts-4e5dc96c.css", -] +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (native, lib) > ../assets/styles-b11c3a83.css 1`] = ` +".button { +} +" `; -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (native, lib) 1`] = ` -[ - "lib/button/index.js", - "'use strict'; +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (native, lib) > lib/button/index.js 1`] = ` +"'use strict'; require('../../assets/styles-b11c3a83.css'); function button() {} exports.button = button; //# sourceMappingURL=index.js.map -", -] +" `; -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (native, lib) 2`] = ` -[ - "lib/index.js", - "'use strict'; +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (native, lib) > lib/index.js 1`] = ` +"'use strict'; require('../assets/globals-107ab52e.css'); require('../assets/fonts-4e5dc96c.css'); const index = require('./button/index.js'); exports.button = index.button; //# sourceMappingURL=index.js.map -", -] -`; - -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (native, lib) 3`] = ` -[ - "package.json", - { - "main": "./lib/index.js", - "name": "project-assets", - "packemon": { - "bundle": true, - "platform": "node", - }, - }, -] +" `; -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (native, lib) 4`] = ` -[ - "src/button/styles.css", - "assets/styles-b11c3a83.css", -] +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (node, cjs) > ../assets/fonts-4e5dc96c.css 1`] = ` +"@font-face { +} +" `; -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (native, lib) 5`] = ` -[ - "src/globals.css", - "assets/globals-107ab52e.css", -] +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (node, cjs) > ../assets/globals-107ab52e.css 1`] = ` +"html { +} +" `; -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (native, lib) 6`] = ` -[ - "src/shared/fonts.css", - "assets/fonts-4e5dc96c.css", -] +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (node, cjs) > ../assets/styles-b11c3a83.css 1`] = ` +".button { +} +" `; -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (node, cjs) 1`] = ` -[ - "cjs/button/index.cjs", - "'use strict'; +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (node, cjs) > cjs/button/index.cjs 1`] = ` +"'use strict'; require('../../assets/styles-b11c3a83.css'); function button() {} exports.button = button; //# sourceMappingURL=index.cjs.map -", -] +" `; -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (node, cjs) 2`] = ` -[ - "cjs/index.cjs", - "'use strict'; +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (node, cjs) > cjs/index.cjs 1`] = ` +"'use strict'; require('../assets/globals-107ab52e.css'); require('../assets/fonts-4e5dc96c.css'); const index = require('./button/index.cjs'); exports.button = index.button; //# sourceMappingURL=index.cjs.map -", -] +" `; -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (node, cjs) 3`] = ` -[ - "package.json", - { - "main": "./cjs/index.cjs", - "name": "project-assets", - "packemon": { - "bundle": true, - "platform": "node", - }, - }, -] +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (node, cjs) > cjs/index-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index.cjs'; + +export const { button } = data;" `; -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (node, cjs) 4`] = ` -[ - "src/button/styles.css", - "assets/styles-b11c3a83.css", -] +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (node, lib) > ../assets/fonts-4e5dc96c.css 1`] = ` +"@font-face { +} +" `; -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (node, cjs) 5`] = ` -[ - "src/globals.css", - "assets/globals-107ab52e.css", -] +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (node, lib) > ../assets/globals-107ab52e.css 1`] = ` +"html { +} +" `; -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (node, cjs) 6`] = ` -[ - "src/shared/fonts.css", - "assets/fonts-4e5dc96c.css", -] +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (node, lib) > ../assets/styles-b11c3a83.css 1`] = ` +".button { +} +" `; -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (node, lib) 1`] = ` -[ - "lib/button/index.js", - "'use strict'; +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (node, lib) > lib/button/index.js 1`] = ` +"'use strict'; require('../../assets/styles-b11c3a83.css'); function button() {} exports.button = button; //# sourceMappingURL=index.js.map -", -] +" `; -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (node, lib) 2`] = ` -[ - "lib/index.js", - "'use strict'; +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (node, lib) > lib/index.js 1`] = ` +"'use strict'; require('../assets/globals-107ab52e.css'); require('../assets/fonts-4e5dc96c.css'); const index = require('./button/index.js'); exports.button = index.button; //# sourceMappingURL=index.js.map -", -] -`; - -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (node, lib) 3`] = ` -[ - "package.json", - { - "main": "./lib/index.js", - "name": "project-assets", - "packemon": { - "bundle": true, - "platform": "node", - }, - }, -] +" `; -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (node, lib) 4`] = ` -[ - "src/button/styles.css", - "assets/styles-b11c3a83.css", -] +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (node, mjs) > ../assets/fonts-4e5dc96c.css 1`] = ` +"@font-face { +} +" `; -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (node, lib) 5`] = ` -[ - "src/globals.css", - "assets/globals-107ab52e.css", -] +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (node, mjs) > ../assets/globals-107ab52e.css 1`] = ` +"html { +} +" `; -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (node, lib) 6`] = ` -[ - "src/shared/fonts.css", - "assets/fonts-4e5dc96c.css", -] +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (node, mjs) > ../assets/styles-b11c3a83.css 1`] = ` +".button { +} +" `; -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (node, mjs) 1`] = ` -[ - "mjs/button/index.mjs", - "import '../../assets/styles-b11c3a83.css'; +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (node, mjs) > mjs/button/index.mjs 1`] = ` +"import '../../assets/styles-b11c3a83.css'; function button() {} export { button }; //# sourceMappingURL=index.mjs.map -", -] +" `; -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (node, mjs) 2`] = ` -[ - "mjs/index.mjs", - "import '../assets/globals-107ab52e.css'; +exports[`Outputs (swc) > no bundle with assets > creates individual files and references assets (node, mjs) > mjs/index.mjs 1`] = ` +"import '../assets/globals-107ab52e.css'; import '../assets/fonts-4e5dc96c.css'; export { button } from './button/index.mjs'; //# sourceMappingURL=index.mjs.map -", -] -`; - -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (node, mjs) 3`] = ` -[ - "package.json", - { - "main": "./mjs/index.mjs", - "name": "project-assets", - "packemon": { - "bundle": true, - "platform": "node", - }, - }, -] -`; - -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (node, mjs) 4`] = ` -[ - "src/button/styles.css", - "assets/styles-b11c3a83.css", -] -`; - -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (node, mjs) 5`] = ` -[ - "src/globals.css", - "assets/globals-107ab52e.css", -] -`; - -exports[`Outputs (swc) no bundle with assets creates individual files and references assets (node, mjs) 6`] = ` -[ - "src/shared/fonts.css", - "assets/fonts-4e5dc96c.css", -] +" `; -exports[`Special formats cjs supports .ts -> .cjs / .d.cts (compat) 1`] = ` -[ - "cjs/index.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Special formats > cjs > supports .ts -> .cjs / .d.cts (compat) > cjs/index.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: cjs 'use strict'; @@ -3321,38 +19175,31 @@ function test() { } module.exports = test; //# sourceMappingURL=index.cjs.map -", -] +" `; -exports[`Special formats cjs supports .ts -> .cjs / .d.cts (compat) 2`] = ` -[ - "package.json", - { - "main": "./cjs/index.cjs", - "name": "project-cjs-compat", - "packemon": { - "format": "cjs", - "inputs": { - "index": "src/index.ts", - }, - }, - "types": "./cjs/index.d.cts", - }, -] +exports[`Special formats > cjs > supports .ts -> .cjs / .d.cts (compat) > cjs/index-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index.cjs'; + +export default data;" `; -exports[`Special formats cjs supports .ts -> .cjs / .d.cts (compat) 3`] = ` +exports[`Special formats > cjs > supports .ts -> .cjs / .d.cts (compat) 1`] = ` "export default function test(): number; -//# sourceMappingURL=index.d.cts.map" +//# sourceMappingURL=index.d.cts.map +" `; -exports[`Special formats cjs supports .ts -> .cjs / .d.cts (compat) 4`] = `"{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,IAAI,WAE3B"}"`; +exports[`Special formats > cjs > supports .ts -> .cjs / .d.cts (compat) 2`] = ` +"{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,IAAI,WAE3B"} +" +`; -exports[`Special formats cts supports .cts -> .cjs / .d.cts 1`] = ` -[ - "cjs/index.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Special formats > cts > supports .cts -> .cjs / .d.cts > cjs/index.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: cjs 'use strict'; @@ -3365,37 +19212,23 @@ function test() { return 123; } //# sourceMappingURL=index.cjs.map -", -] +" `; -exports[`Special formats cts supports .cts -> .cjs / .d.cts 2`] = ` -[ - "package.json", - { - "main": "./cjs/index.cjs", - "name": "project-cts", - "packemon": { - "format": "cjs", - "inputs": { - "index": "src/index.cts", - }, - }, - "type": "commonjs", - "types": "./cjs/index.d.cts", - }, -] +exports[`Special formats > cts > supports .cts -> .cjs / .d.cts > cjs/index-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index.cjs';" `; -exports[`Special formats cts supports .cts -> .cjs / .d.cts 3`] = ` +exports[`Special formats > cts > supports .cts -> .cjs / .d.cts 1`] = ` "export default function test(): number; //# sourceMappingURL=index.d.cts.map" `; -exports[`Special formats mts supports .mts -> .mjs / .d.mts 1`] = ` -[ - "mjs/index.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Special formats > mts > supports .mts -> .mjs / .d.mts > mjs/index.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: mjs function test() { @@ -3403,29 +19236,10 @@ function test() { } export { test as default }; //# sourceMappingURL=index.mjs.map -", -] -`; - -exports[`Special formats mts supports .mts -> .mjs / .d.mts 2`] = ` -[ - "package.json", - { - "main": "./mjs/index.mjs", - "name": "project-mts", - "packemon": { - "format": "mjs", - "inputs": { - "index": "src/index.mts", - }, - }, - "type": "module", - "types": "./mjs/index.d.mts", - }, -] +" `; -exports[`Special formats mts supports .mts -> .mjs / .d.mts 3`] = ` +exports[`Special formats > mts > supports .mts -> .mjs / .d.mts 1`] = ` "export default function test(): string; //# sourceMappingURL=index.d.mts.map" `; diff --git a/packages/packemon/tests/babel/__snapshots__/config.test.ts.snap b/packages/packemon/tests/babel/__snapshots__/config.test.ts.snap index fd4099854..ad7a0aa30 100644 --- a/packages/packemon/tests/babel/__snapshots__/config.test.ts.snap +++ b/packages/packemon/tests/babel/__snapshots__/config.test.ts.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`getBabelInputConfig() can mutate config 1`] = ` +exports[`getBabelInputConfig() > can mutate config 1`] = ` { "babelrc": false, "caller": { @@ -20,7 +20,7 @@ exports[`getBabelInputConfig() can mutate config 1`] = ` } `; -exports[`getBabelInputConfig() doesnt include typescript decorators if \`typescript\` feature flag is false 1`] = ` +exports[`getBabelInputConfig() > doesnt include typescript decorators if \`typescript\` feature flag is false 1`] = ` { "babelrc": false, "caller": { @@ -37,7 +37,7 @@ exports[`getBabelInputConfig() doesnt include typescript decorators if \`typescr } `; -exports[`getBabelInputConfig() includes flow preset if \`flow\` feature flag is true 1`] = ` +exports[`getBabelInputConfig() > includes flow preset if \`flow\` feature flag is true 1`] = ` [ [ "@babel/preset-flow", @@ -48,7 +48,7 @@ exports[`getBabelInputConfig() includes flow preset if \`flow\` feature flag is ] `; -exports[`getBabelInputConfig() includes no plugins or presets by default 1`] = ` +exports[`getBabelInputConfig() > includes no plugins or presets by default 1`] = ` { "babelrc": false, "caller": { @@ -65,7 +65,7 @@ exports[`getBabelInputConfig() includes no plugins or presets by default 1`] = ` } `; -exports[`getBabelInputConfig() includes react preset if \`react\` feature flag is true 1`] = ` +exports[`getBabelInputConfig() > includes react preset if \`react\` feature flag is true 1`] = ` [ [ "@babel/preset-react", @@ -78,7 +78,7 @@ exports[`getBabelInputConfig() includes react preset if \`react\` feature flag i ] `; -exports[`getBabelInputConfig() includes react preset if \`react\` feature flag is true 2`] = ` +exports[`getBabelInputConfig() > includes react preset if \`react\` feature flag is true 2`] = ` [ [ "@babel/preset-react", @@ -91,13 +91,13 @@ exports[`getBabelInputConfig() includes react preset if \`react\` feature flag i ] `; -exports[`getBabelInputConfig() includes solid preset if \`solid\` feature flag is true 1`] = ` +exports[`getBabelInputConfig() > includes solid preset if \`solid\` feature flag is true 1`] = ` [ "babel-preset-solid", ] `; -exports[`getBabelInputConfig() includes typescript decorators if \`typescript\` and \`decorators\` feature flag is true 1`] = ` +exports[`getBabelInputConfig() > includes typescript decorators if \`typescript\` and \`decorators\` feature flag is true 1`] = ` { "babelrc": false, "caller": { @@ -156,7 +156,7 @@ exports[`getBabelInputConfig() includes typescript decorators if \`typescript\` } `; -exports[`getBabelInputConfig() includes typescript preset if \`typescript\` feature flag is true 1`] = ` +exports[`getBabelInputConfig() > includes typescript preset if \`typescript\` feature flag is true 1`] = ` [ [ "@babel/preset-typescript", @@ -169,7 +169,7 @@ exports[`getBabelInputConfig() includes typescript preset if \`typescript\` feat ] `; -exports[`getBabelInputConfig() supports private properties with decorators if dep exists 1`] = ` +exports[`getBabelInputConfig() > supports private properties with decorators if dep exists 1`] = ` { "babelrc": false, "caller": { @@ -228,7 +228,7 @@ exports[`getBabelInputConfig() supports private properties with decorators if de } `; -exports[`getBabelOutputConfig() can mutate config 1`] = ` +exports[`getBabelOutputConfig() > can mutate config 1`] = ` { "babelrc": false, "caller": { @@ -285,7 +285,7 @@ exports[`getBabelOutputConfig() can mutate config 1`] = ` } `; -exports[`getBabelOutputConfig() handles preset-env: browser + esm + current 1`] = ` +exports[`getBabelOutputConfig() > handles preset-env: browser + esm + current 1`] = ` [ "@babel/preset-env", { @@ -310,7 +310,7 @@ exports[`getBabelOutputConfig() handles preset-env: browser + esm + current 1`] ] `; -exports[`getBabelOutputConfig() handles preset-env: browser + esm + experimental 1`] = ` +exports[`getBabelOutputConfig() > handles preset-env: browser + esm + experimental 1`] = ` [ "@babel/preset-env", { @@ -335,7 +335,7 @@ exports[`getBabelOutputConfig() handles preset-env: browser + esm + experimental ] `; -exports[`getBabelOutputConfig() handles preset-env: browser + esm + legacy 1`] = ` +exports[`getBabelOutputConfig() > handles preset-env: browser + esm + legacy 1`] = ` [ "@babel/preset-env", { @@ -360,7 +360,7 @@ exports[`getBabelOutputConfig() handles preset-env: browser + esm + legacy 1`] = ] `; -exports[`getBabelOutputConfig() handles preset-env: browser + esm + stable 1`] = ` +exports[`getBabelOutputConfig() > handles preset-env: browser + esm + stable 1`] = ` [ "@babel/preset-env", { @@ -385,7 +385,7 @@ exports[`getBabelOutputConfig() handles preset-env: browser + esm + stable 1`] = ] `; -exports[`getBabelOutputConfig() handles preset-env: browser + lib + current 1`] = ` +exports[`getBabelOutputConfig() > handles preset-env: browser + lib + current 1`] = ` [ "@babel/preset-env", { @@ -410,7 +410,7 @@ exports[`getBabelOutputConfig() handles preset-env: browser + lib + current 1`] ] `; -exports[`getBabelOutputConfig() handles preset-env: browser + lib + experimental 1`] = ` +exports[`getBabelOutputConfig() > handles preset-env: browser + lib + experimental 1`] = ` [ "@babel/preset-env", { @@ -435,7 +435,7 @@ exports[`getBabelOutputConfig() handles preset-env: browser + lib + experimental ] `; -exports[`getBabelOutputConfig() handles preset-env: browser + lib + legacy 1`] = ` +exports[`getBabelOutputConfig() > handles preset-env: browser + lib + legacy 1`] = ` [ "@babel/preset-env", { @@ -460,7 +460,7 @@ exports[`getBabelOutputConfig() handles preset-env: browser + lib + legacy 1`] = ] `; -exports[`getBabelOutputConfig() handles preset-env: browser + lib + stable 1`] = ` +exports[`getBabelOutputConfig() > handles preset-env: browser + lib + stable 1`] = ` [ "@babel/preset-env", { @@ -485,7 +485,7 @@ exports[`getBabelOutputConfig() handles preset-env: browser + lib + stable 1`] = ] `; -exports[`getBabelOutputConfig() handles preset-env: browser + umd + current 1`] = ` +exports[`getBabelOutputConfig() > handles preset-env: browser + umd + current 1`] = ` [ "@babel/preset-env", { @@ -493,7 +493,6 @@ exports[`getBabelOutputConfig() handles preset-env: browser + umd + current 1`] "exclude": [ "@babel/plugin-transform-regenerator", "@babel/plugin-transform-async-to-generator", - "@babel/plugin-proposal-dynamic-import", ], "loose": false, "modules": "umd", @@ -510,7 +509,7 @@ exports[`getBabelOutputConfig() handles preset-env: browser + umd + current 1`] ] `; -exports[`getBabelOutputConfig() handles preset-env: browser + umd + experimental 1`] = ` +exports[`getBabelOutputConfig() > handles preset-env: browser + umd + experimental 1`] = ` [ "@babel/preset-env", { @@ -518,7 +517,6 @@ exports[`getBabelOutputConfig() handles preset-env: browser + umd + experimental "exclude": [ "@babel/plugin-transform-regenerator", "@babel/plugin-transform-async-to-generator", - "@babel/plugin-proposal-dynamic-import", ], "loose": false, "modules": "umd", @@ -535,7 +533,7 @@ exports[`getBabelOutputConfig() handles preset-env: browser + umd + experimental ] `; -exports[`getBabelOutputConfig() handles preset-env: browser + umd + legacy 1`] = ` +exports[`getBabelOutputConfig() > handles preset-env: browser + umd + legacy 1`] = ` [ "@babel/preset-env", { @@ -543,7 +541,6 @@ exports[`getBabelOutputConfig() handles preset-env: browser + umd + legacy 1`] = "exclude": [ "@babel/plugin-transform-regenerator", "@babel/plugin-transform-async-to-generator", - "@babel/plugin-proposal-dynamic-import", ], "loose": false, "modules": "umd", @@ -560,7 +557,7 @@ exports[`getBabelOutputConfig() handles preset-env: browser + umd + legacy 1`] = ] `; -exports[`getBabelOutputConfig() handles preset-env: browser + umd + stable 1`] = ` +exports[`getBabelOutputConfig() > handles preset-env: browser + umd + stable 1`] = ` [ "@babel/preset-env", { @@ -568,7 +565,6 @@ exports[`getBabelOutputConfig() handles preset-env: browser + umd + stable 1`] = "exclude": [ "@babel/plugin-transform-regenerator", "@babel/plugin-transform-async-to-generator", - "@babel/plugin-proposal-dynamic-import", ], "loose": false, "modules": "umd", @@ -585,7 +581,7 @@ exports[`getBabelOutputConfig() handles preset-env: browser + umd + stable 1`] = ] `; -exports[`getBabelOutputConfig() handles preset-env: native + lib + current 1`] = ` +exports[`getBabelOutputConfig() > handles preset-env: native + lib + current 1`] = ` [ "@babel/preset-env", { @@ -593,6 +589,7 @@ exports[`getBabelOutputConfig() handles preset-env: native + lib + current 1`] = "exclude": [ "@babel/plugin-transform-regenerator", "@babel/plugin-transform-async-to-generator", + "@babel/plugin-proposal-dynamic-import", ], "loose": false, "modules": "cjs", @@ -606,7 +603,7 @@ exports[`getBabelOutputConfig() handles preset-env: native + lib + current 1`] = ] `; -exports[`getBabelOutputConfig() handles preset-env: native + lib + experimental 1`] = ` +exports[`getBabelOutputConfig() > handles preset-env: native + lib + experimental 1`] = ` [ "@babel/preset-env", { @@ -614,6 +611,7 @@ exports[`getBabelOutputConfig() handles preset-env: native + lib + experimental "exclude": [ "@babel/plugin-transform-regenerator", "@babel/plugin-transform-async-to-generator", + "@babel/plugin-proposal-dynamic-import", ], "loose": false, "modules": "cjs", @@ -627,7 +625,7 @@ exports[`getBabelOutputConfig() handles preset-env: native + lib + experimental ] `; -exports[`getBabelOutputConfig() handles preset-env: native + lib + legacy 1`] = ` +exports[`getBabelOutputConfig() > handles preset-env: native + lib + legacy 1`] = ` [ "@babel/preset-env", { @@ -635,6 +633,7 @@ exports[`getBabelOutputConfig() handles preset-env: native + lib + legacy 1`] = "exclude": [ "@babel/plugin-transform-regenerator", "@babel/plugin-transform-async-to-generator", + "@babel/plugin-proposal-dynamic-import", ], "loose": false, "modules": "cjs", @@ -648,7 +647,7 @@ exports[`getBabelOutputConfig() handles preset-env: native + lib + legacy 1`] = ] `; -exports[`getBabelOutputConfig() handles preset-env: native + lib + stable 1`] = ` +exports[`getBabelOutputConfig() > handles preset-env: native + lib + stable 1`] = ` [ "@babel/preset-env", { @@ -656,6 +655,7 @@ exports[`getBabelOutputConfig() handles preset-env: native + lib + stable 1`] = "exclude": [ "@babel/plugin-transform-regenerator", "@babel/plugin-transform-async-to-generator", + "@babel/plugin-proposal-dynamic-import", ], "loose": false, "modules": "cjs", @@ -669,7 +669,7 @@ exports[`getBabelOutputConfig() handles preset-env: native + lib + stable 1`] = ] `; -exports[`getBabelOutputConfig() handles preset-env: node + cjs + current 1`] = ` +exports[`getBabelOutputConfig() > handles preset-env: node + cjs + current 1`] = ` [ "@babel/preset-env", { @@ -691,7 +691,7 @@ exports[`getBabelOutputConfig() handles preset-env: node + cjs + current 1`] = ` ] `; -exports[`getBabelOutputConfig() handles preset-env: node + cjs + experimental 1`] = ` +exports[`getBabelOutputConfig() > handles preset-env: node + cjs + experimental 1`] = ` [ "@babel/preset-env", { @@ -713,7 +713,7 @@ exports[`getBabelOutputConfig() handles preset-env: node + cjs + experimental 1` ] `; -exports[`getBabelOutputConfig() handles preset-env: node + cjs + legacy 1`] = ` +exports[`getBabelOutputConfig() > handles preset-env: node + cjs + legacy 1`] = ` [ "@babel/preset-env", { @@ -735,7 +735,7 @@ exports[`getBabelOutputConfig() handles preset-env: node + cjs + legacy 1`] = ` ] `; -exports[`getBabelOutputConfig() handles preset-env: node + cjs + stable 1`] = ` +exports[`getBabelOutputConfig() > handles preset-env: node + cjs + stable 1`] = ` [ "@babel/preset-env", { @@ -757,7 +757,7 @@ exports[`getBabelOutputConfig() handles preset-env: node + cjs + stable 1`] = ` ] `; -exports[`getBabelOutputConfig() handles preset-env: node + lib + current 1`] = ` +exports[`getBabelOutputConfig() > handles preset-env: node + lib + current 1`] = ` [ "@babel/preset-env", { @@ -779,7 +779,7 @@ exports[`getBabelOutputConfig() handles preset-env: node + lib + current 1`] = ` ] `; -exports[`getBabelOutputConfig() handles preset-env: node + lib + experimental 1`] = ` +exports[`getBabelOutputConfig() > handles preset-env: node + lib + experimental 1`] = ` [ "@babel/preset-env", { @@ -801,7 +801,7 @@ exports[`getBabelOutputConfig() handles preset-env: node + lib + experimental 1` ] `; -exports[`getBabelOutputConfig() handles preset-env: node + lib + legacy 1`] = ` +exports[`getBabelOutputConfig() > handles preset-env: node + lib + legacy 1`] = ` [ "@babel/preset-env", { @@ -823,7 +823,7 @@ exports[`getBabelOutputConfig() handles preset-env: node + lib + legacy 1`] = ` ] `; -exports[`getBabelOutputConfig() handles preset-env: node + lib + stable 1`] = ` +exports[`getBabelOutputConfig() > handles preset-env: node + lib + stable 1`] = ` [ "@babel/preset-env", { @@ -845,7 +845,7 @@ exports[`getBabelOutputConfig() handles preset-env: node + lib + stable 1`] = ` ] `; -exports[`getBabelOutputConfig() handles preset-env: node + mjs + current 1`] = ` +exports[`getBabelOutputConfig() > handles preset-env: node + mjs + current 1`] = ` [ "@babel/preset-env", { @@ -867,7 +867,7 @@ exports[`getBabelOutputConfig() handles preset-env: node + mjs + current 1`] = ` ] `; -exports[`getBabelOutputConfig() handles preset-env: node + mjs + experimental 1`] = ` +exports[`getBabelOutputConfig() > handles preset-env: node + mjs + experimental 1`] = ` [ "@babel/preset-env", { @@ -889,7 +889,7 @@ exports[`getBabelOutputConfig() handles preset-env: node + mjs + experimental 1` ] `; -exports[`getBabelOutputConfig() handles preset-env: node + mjs + legacy 1`] = ` +exports[`getBabelOutputConfig() > handles preset-env: node + mjs + legacy 1`] = ` [ "@babel/preset-env", { @@ -911,7 +911,7 @@ exports[`getBabelOutputConfig() handles preset-env: node + mjs + legacy 1`] = ` ] `; -exports[`getBabelOutputConfig() handles preset-env: node + mjs + stable 1`] = ` +exports[`getBabelOutputConfig() > handles preset-env: node + mjs + stable 1`] = ` [ "@babel/preset-env", { @@ -933,7 +933,7 @@ exports[`getBabelOutputConfig() handles preset-env: node + mjs + stable 1`] = ` ] `; -exports[`getBabelOutputConfig() transforms async/await to promises when \`browser\` or \`native\` 1`] = ` +exports[`getBabelOutputConfig() > transforms async/await to promises when \`browser\` or \`native\` 1`] = ` { "babelrc": false, "caller": { @@ -988,7 +988,7 @@ exports[`getBabelOutputConfig() transforms async/await to promises when \`browse } `; -exports[`getBabelOutputConfig() transforms async/await to promises when \`browser\` or \`native\` 2`] = ` +exports[`getBabelOutputConfig() > transforms async/await to promises when \`browser\` or \`native\` 2`] = ` { "babelrc": false, "caller": { @@ -1024,6 +1024,7 @@ exports[`getBabelOutputConfig() transforms async/await to promises when \`browse "exclude": [ "@babel/plugin-transform-regenerator", "@babel/plugin-transform-async-to-generator", + "@babel/plugin-proposal-dynamic-import", ], "loose": false, "modules": "cjs", @@ -1039,7 +1040,7 @@ exports[`getBabelOutputConfig() transforms async/await to promises when \`browse } `; -exports[`getBabelOutputConfig() uses built-in destructuring and object spread when \`current\` or \`experimental\` 1`] = ` +exports[`getBabelOutputConfig() > uses built-in destructuring and object spread when \`current\` or \`experimental\` 1`] = ` { "babelrc": false, "caller": { @@ -1097,7 +1098,7 @@ exports[`getBabelOutputConfig() uses built-in destructuring and object spread wh } `; -exports[`getBabelOutputConfig() uses built-in destructuring and object spread when \`current\` or \`experimental\` 2`] = ` +exports[`getBabelOutputConfig() > uses built-in destructuring and object spread when \`current\` or \`experimental\` 2`] = ` { "babelrc": false, "caller": { diff --git a/packages/packemon/tests/babel/config.test.ts b/packages/packemon/tests/babel/config.test.ts index efd6db63a..5715dfc29 100644 --- a/packages/packemon/tests/babel/config.test.ts +++ b/packages/packemon/tests/babel/config.test.ts @@ -1,10 +1,11 @@ /* eslint-disable no-param-reassign */ // import { createConfig, createRootConfig } from '../../src/babel'; +import { describe, expect, it, vi } from 'vitest'; import { getBabelInputConfig, getBabelOutputConfig } from '../../src/babel/config'; import { Format, Platform, Support } from '../../src/types'; -jest.mock('../../src/babel/resolve', () => ({ +vi.mock('../../src/babel/resolve', () => ({ resolve: (name: string) => name, resolveFromBabel: (name: string) => name, })); @@ -51,7 +52,7 @@ describe('getBabelInputConfig()', () => { }); it('supports private properties with decorators if dep exists', () => { - const spy = jest.spyOn(bundleArtifact.package, 'hasDependency').mockImplementation(() => true); + const spy = vi.spyOn(bundleArtifact.package, 'hasDependency').mockImplementation(() => true); expect( getBabelInputConfig(bundleArtifact, { decorators: true, typescript: true }), @@ -80,7 +81,7 @@ describe('getBabelInputConfig()', () => { }); function renderPresetEnv(platform: Platform, format: Format, support: Support) { - test(`handles preset-env: ${platform} + ${format} + ${support}`, () => { + it(`handles preset-env: ${platform} + ${format} + ${support}`, () => { expect(getBabelOutputConfig(platform, support, format, {})?.presets?.[0]).toMatchSnapshot(); }); } @@ -149,7 +150,7 @@ describe('getBabelOutputConfig()', () => { }); it('passes build params to config', () => { - const spy = jest.fn(); + const spy = vi.fn(); getBabelOutputConfig( 'browser', diff --git a/packages/packemon/tests/configs.test.ts b/packages/packemon/tests/configs.test.ts index 195560d5b..77c8f0c78 100644 --- a/packages/packemon/tests/configs.test.ts +++ b/packages/packemon/tests/configs.test.ts @@ -1,43 +1,43 @@ import { rollup } from 'rollup'; +import { beforeEach, describe, expect, it, type Mock, type MockInstance, vi } from 'vitest'; import { Path } from '@boost/common'; import { Packemon } from '../src'; -import { createSnapshotSpies, getFixturePath, loadPackageAtPath } from './helpers'; +import { getFixturePath, loadPackageAtPath } from './helpers'; -jest.mock('execa'); +vi.mock('execa'); -jest.mock('rollup', () => ({ - ...jest.requireActual('rollup'), - rollup: jest.fn(), +vi.mock('rollup', async (importOriginal) => ({ + ...(await importOriginal()), + rollup: vi.fn(), })); -jest.mock('@rollup/plugin-babel', () => ({ - ...jest.requireActual('@rollup/plugin-babel'), +vi.mock('@rollup/plugin-babel', async (importOriginal) => ({ + ...(await importOriginal()), // Pipe options through so we can inspect them getBabelInputPlugin: (opts: object) => ({ name: '@rollup/plugin-babel-input', ...opts }), getBabelOutputPlugin: (opts: object) => ({ name: '@rollup/plugin-babel-output', ...opts }), })); describe('Config files', () => { - let rollupSpy: jest.Mock; - let generateSpy: jest.Mock; + let rollupSpy: Mock; + let generateSpy: Mock; beforeEach(() => { - generateSpy = jest.fn(() => ({ output: [] })); - rollupSpy = jest.fn(() => ({ generate: generateSpy })); + generateSpy = vi.fn(() => ({ output: [] })); + rollupSpy = vi.fn(() => ({ generate: generateSpy })); - (rollup as unknown as jest.SpyInstance).mockImplementation(rollupSpy); + (rollup as unknown as MockInstance).mockImplementation(rollupSpy); }); describe('monorepo', () => { const root = Path.create(getFixturePath('config-files-monorepo')); - createSnapshotSpies(root); // Mock fs - it('inherits config from root and branches', async () => { const packemon = new Packemon(root); // bar (using push) await packemon.build(loadPackageAtPath(root.append('packages/bar'), root), { + addEntries: false, loadConfigs: true, }); @@ -85,6 +85,7 @@ describe('Config files', () => { // baz (using unshift) await packemon.build(loadPackageAtPath(root.append('packages/baz'), root), { + addEntries: false, loadConfigs: true, }); @@ -132,6 +133,7 @@ describe('Config files', () => { // foo (using push) await packemon.build(loadPackageAtPath(root.append('packages/foo'), root), { + addEntries: false, loadConfigs: true, }); @@ -183,6 +185,7 @@ describe('Config files', () => { // bar (using push) await packemon.build(loadPackageAtPath(root.append('packages/bar'), root), { + addEntries: false, loadConfigs: false, }); @@ -230,6 +233,7 @@ describe('Config files', () => { // baz (using unshift) await packemon.build(loadPackageAtPath(root.append('packages/baz'), root), { + addEntries: false, loadConfigs: false, }); @@ -277,6 +281,7 @@ describe('Config files', () => { // foo (using push) await packemon.build(loadPackageAtPath(root.append('packages/foo'), root), { + addEntries: false, loadConfigs: false, }); @@ -327,12 +332,11 @@ describe('Config files', () => { describe('polyrepo', () => { const root = getFixturePath('config-files-polyrepo'); - createSnapshotSpies(root); // Mock fs - it('inherits config from root and branches', async () => { const packemon = new Packemon(root); - await packemon.build(loadPackageAtPath(root), { + await packemon.build(loadPackageAtPath(root, null), { + addEntries: false, loadConfigs: true, }); @@ -382,7 +386,8 @@ describe('Config files', () => { it('doesnt inherit config if option is false', async () => { const packemon = new Packemon(root); - await packemon.build(loadPackageAtPath(root), { + await packemon.build(loadPackageAtPath(root, null), { + addEntries: false, loadConfigs: false, }); diff --git a/packages/packemon/tests/examples/__snapshots__/assetImports.test.ts.snap b/packages/packemon/tests/examples/__snapshots__/assetImports.test.ts.snap index 4eb13e9a8..0e32f5095 100644 --- a/packages/packemon/tests/examples/__snapshots__/assetImports.test.ts.snap +++ b/packages/packemon/tests/examples/__snapshots__/assetImports.test.ts.snap @@ -1,9 +1,13 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`Assets babel transforms example test case: browser-current-esm 1`] = ` -[ - "esm/index-browser-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > babel > transforms example test case: browser-current-esm > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" +`; + +exports[`Assets > babel > transforms example test case: browser-current-esm > esm/index-browser-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: esm import '../assets/styles-17df299b.css'; @@ -19,21 +23,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-browser-current-esm.js.map -", -] +" `; -exports[`Assets babel transforms example test case: browser-current-esm 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > babel > transforms example test case: browser-current-lib > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets babel transforms example test case: browser-current-lib 1`] = ` -[ - "lib/index-browser-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > babel > transforms example test case: browser-current-lib > lib/index-browser-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: lib 'use strict'; @@ -51,28 +51,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-browser-current-lib.js.map -", -] -`; - -exports[`Assets babel transforms example test case: browser-current-lib 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +" `; -exports[`Assets babel transforms example test case: browser-current-umd 1`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > babel > transforms example test case: browser-current-umd > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets babel transforms example test case: browser-current-umd 2`] = ` -[ - "umd/index-browser-current-umd.js", - "(function (global, factory) { +exports[`Assets > babel > transforms example test case: browser-current-umd > umd/index-browser-current-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["../assets/styles-17df299b.css", "../assets/logo-c21f559f.svg", "website/src/css/custom.css"], factory); } else if (typeof exports !== "undefined") { @@ -101,14 +90,17 @@ exports[`Assets babel transforms example test case: browser-current-umd 2`] = ` console.log(json); }); //# sourceMappingURL=index-browser-current-umd.js.map -", -] +" `; -exports[`Assets babel transforms example test case: browser-experimental-esm 1`] = ` -[ - "esm/index-browser-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > babel > transforms example test case: browser-experimental-esm > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" +`; + +exports[`Assets > babel > transforms example test case: browser-experimental-esm > esm/index-browser-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: esm import '../assets/styles-17df299b.css'; @@ -124,21 +116,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-browser-experimental-esm.js.map -", -] +" `; -exports[`Assets babel transforms example test case: browser-experimental-esm 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > babel > transforms example test case: browser-experimental-lib > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets babel transforms example test case: browser-experimental-lib 1`] = ` -[ - "lib/index-browser-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > babel > transforms example test case: browser-experimental-lib > lib/index-browser-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: lib 'use strict'; @@ -156,28 +144,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-browser-experimental-lib.js.map -", -] +" `; -exports[`Assets babel transforms example test case: browser-experimental-lib 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > babel > transforms example test case: browser-experimental-umd > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets babel transforms example test case: browser-experimental-umd 1`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] -`; - -exports[`Assets babel transforms example test case: browser-experimental-umd 2`] = ` -[ - "umd/index-browser-experimental-umd.js", - "(function (global, factory) { +exports[`Assets > babel > transforms example test case: browser-experimental-umd > umd/index-browser-experimental-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["../assets/styles-17df299b.css", "../assets/logo-c21f559f.svg", "website/src/css/custom.css"], factory); } else if (typeof exports !== "undefined") { @@ -206,14 +183,17 @@ exports[`Assets babel transforms example test case: browser-experimental-umd 2`] console.log(json); }); //# sourceMappingURL=index-browser-experimental-umd.js.map -", -] +" +`; + +exports[`Assets > babel > transforms example test case: browser-legacy-esm > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets babel transforms example test case: browser-legacy-esm 1`] = ` -[ - "esm/index-browser-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > babel > transforms example test case: browser-legacy-esm > esm/index-browser-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: esm import '../assets/styles-17df299b.css'; @@ -229,21 +209,17 @@ var json = { }; console.log(json); //# sourceMappingURL=index-browser-legacy-esm.js.map -", -] +" `; -exports[`Assets babel transforms example test case: browser-legacy-esm 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > babel > transforms example test case: browser-legacy-lib > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets babel transforms example test case: browser-legacy-lib 1`] = ` -[ - "lib/index-browser-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > babel > transforms example test case: browser-legacy-lib > lib/index-browser-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: lib 'use strict'; @@ -261,28 +237,17 @@ var json = { }; console.log(json); //# sourceMappingURL=index-browser-legacy-lib.js.map -", -] +" `; -exports[`Assets babel transforms example test case: browser-legacy-lib 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > babel > transforms example test case: browser-legacy-umd > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets babel transforms example test case: browser-legacy-umd 1`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] -`; - -exports[`Assets babel transforms example test case: browser-legacy-umd 2`] = ` -[ - "umd/index-browser-legacy-umd.js", - "(function (global, factory) { +exports[`Assets > babel > transforms example test case: browser-legacy-umd > umd/index-browser-legacy-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["../assets/styles-17df299b.css", "../assets/logo-c21f559f.svg", "website/src/css/custom.css"], factory); } else if (typeof exports !== "undefined") { @@ -311,14 +276,17 @@ exports[`Assets babel transforms example test case: browser-legacy-umd 2`] = ` console.log(json); }); //# sourceMappingURL=index-browser-legacy-umd.js.map -", -] +" `; -exports[`Assets babel transforms example test case: browser-stable-esm 1`] = ` -[ - "esm/index-browser-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > babel > transforms example test case: browser-stable-esm > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" +`; + +exports[`Assets > babel > transforms example test case: browser-stable-esm > esm/index-browser-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: esm import '../assets/styles-17df299b.css'; @@ -334,21 +302,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-browser-stable-esm.js.map -", -] +" `; -exports[`Assets babel transforms example test case: browser-stable-esm 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > babel > transforms example test case: browser-stable-lib > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets babel transforms example test case: browser-stable-lib 1`] = ` -[ - "lib/index-browser-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > babel > transforms example test case: browser-stable-lib > lib/index-browser-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: lib 'use strict'; @@ -366,28 +330,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-browser-stable-lib.js.map -", -] -`; - -exports[`Assets babel transforms example test case: browser-stable-lib 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +" `; -exports[`Assets babel transforms example test case: browser-stable-umd 1`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > babel > transforms example test case: browser-stable-umd > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets babel transforms example test case: browser-stable-umd 2`] = ` -[ - "umd/index-browser-stable-umd.js", - "(function (global, factory) { +exports[`Assets > babel > transforms example test case: browser-stable-umd > umd/index-browser-stable-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["../assets/styles-17df299b.css", "../assets/logo-c21f559f.svg", "website/src/css/custom.css"], factory); } else if (typeof exports !== "undefined") { @@ -416,14 +369,17 @@ exports[`Assets babel transforms example test case: browser-stable-umd 2`] = ` console.log(json); }); //# sourceMappingURL=index-browser-stable-umd.js.map -", -] +" `; -exports[`Assets babel transforms example test case: electron-current-esm 1`] = ` -[ - "esm/index-electron-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > babel > transforms example test case: electron-current-esm > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" +`; + +exports[`Assets > babel > transforms example test case: electron-current-esm > esm/index-electron-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: esm import '../assets/styles-17df299b.css'; @@ -439,21 +395,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-electron-current-esm.js.map -", -] +" `; -exports[`Assets babel transforms example test case: electron-current-esm 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > babel > transforms example test case: electron-current-lib > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets babel transforms example test case: electron-current-lib 1`] = ` -[ - "lib/index-electron-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > babel > transforms example test case: electron-current-lib > lib/index-electron-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: lib 'use strict'; @@ -471,21 +423,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-electron-current-lib.js.map -", -] +" `; -exports[`Assets babel transforms example test case: electron-current-lib 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > babel > transforms example test case: electron-experimental-esm > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets babel transforms example test case: electron-experimental-esm 1`] = ` -[ - "esm/index-electron-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > babel > transforms example test case: electron-experimental-esm > esm/index-electron-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: esm import '../assets/styles-17df299b.css'; @@ -501,21 +449,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-electron-experimental-esm.js.map -", -] +" `; -exports[`Assets babel transforms example test case: electron-experimental-esm 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > babel > transforms example test case: electron-experimental-lib > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets babel transforms example test case: electron-experimental-lib 1`] = ` -[ - "lib/index-electron-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > babel > transforms example test case: electron-experimental-lib > lib/index-electron-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: lib 'use strict'; @@ -533,21 +477,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-electron-experimental-lib.js.map -", -] +" `; -exports[`Assets babel transforms example test case: electron-experimental-lib 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > babel > transforms example test case: electron-legacy-esm > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets babel transforms example test case: electron-legacy-esm 1`] = ` -[ - "esm/index-electron-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > babel > transforms example test case: electron-legacy-esm > esm/index-electron-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: esm import '../assets/styles-17df299b.css'; @@ -563,21 +503,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-electron-legacy-esm.js.map -", -] +" `; -exports[`Assets babel transforms example test case: electron-legacy-esm 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > babel > transforms example test case: electron-legacy-lib > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets babel transforms example test case: electron-legacy-lib 1`] = ` -[ - "lib/index-electron-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > babel > transforms example test case: electron-legacy-lib > lib/index-electron-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: lib 'use strict'; @@ -595,21 +531,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-electron-legacy-lib.js.map -", -] +" `; -exports[`Assets babel transforms example test case: electron-legacy-lib 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > babel > transforms example test case: electron-stable-esm > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets babel transforms example test case: electron-stable-esm 1`] = ` -[ - "esm/index-electron-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > babel > transforms example test case: electron-stable-esm > esm/index-electron-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: esm import '../assets/styles-17df299b.css'; @@ -625,21 +557,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-electron-stable-esm.js.map -", -] +" `; -exports[`Assets babel transforms example test case: electron-stable-esm 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > babel > transforms example test case: electron-stable-lib > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets babel transforms example test case: electron-stable-lib 1`] = ` -[ - "lib/index-electron-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > babel > transforms example test case: electron-stable-lib > lib/index-electron-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: lib 'use strict'; @@ -657,21 +585,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-electron-stable-lib.js.map -", -] +" `; -exports[`Assets babel transforms example test case: electron-stable-lib 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > babel > transforms example test case: native-current-lib > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets babel transforms example test case: native-current-lib 1`] = ` -[ - "lib/index-native-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > babel > transforms example test case: native-current-lib > lib/index-native-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: current, Format: lib 'use strict'; @@ -689,21 +613,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-native-current-lib.js.map -", -] +" `; -exports[`Assets babel transforms example test case: native-current-lib 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > babel > transforms example test case: native-experimental-lib > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets babel transforms example test case: native-experimental-lib 1`] = ` -[ - "lib/index-native-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > babel > transforms example test case: native-experimental-lib > lib/index-native-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: experimental, Format: lib 'use strict'; @@ -721,21 +641,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-native-experimental-lib.js.map -", -] +" `; -exports[`Assets babel transforms example test case: native-experimental-lib 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > babel > transforms example test case: native-legacy-lib > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets babel transforms example test case: native-legacy-lib 1`] = ` -[ - "lib/index-native-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > babel > transforms example test case: native-legacy-lib > lib/index-native-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: legacy, Format: lib 'use strict'; @@ -753,21 +669,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-native-legacy-lib.js.map -", -] +" `; -exports[`Assets babel transforms example test case: native-legacy-lib 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > babel > transforms example test case: native-stable-lib > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets babel transforms example test case: native-stable-lib 1`] = ` -[ - "lib/index-native-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > babel > transforms example test case: native-stable-lib > lib/index-native-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: stable, Format: lib 'use strict'; @@ -785,31 +697,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-native-stable-lib.js.map -", -] -`; - -exports[`Assets babel transforms example test case: native-stable-lib 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +" `; -exports[`Assets babel transforms example test case: node-current-cjs 1`] = ` -[ - "cjs/index-node-current-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import './index-node-current-cjs.cjs';", -] +exports[`Assets > babel > transforms example test case: node-current-cjs > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets babel transforms example test case: node-current-cjs 2`] = ` -[ - "cjs/index-node-current-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > babel > transforms example test case: node-current-cjs > cjs/index-node-current-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: cjs 'use strict'; @@ -827,21 +725,24 @@ const json = { }; console.log(json); //# sourceMappingURL=index-node-current-cjs.cjs.map -", -] +" +`; + +exports[`Assets > babel > transforms example test case: node-current-cjs > cjs/index-node-current-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-current-cjs.cjs';" `; -exports[`Assets babel transforms example test case: node-current-cjs 3`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > babel > transforms example test case: node-current-lib > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets babel transforms example test case: node-current-lib 1`] = ` -[ - "lib/index-node-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > babel > transforms example test case: node-current-lib > lib/index-node-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: lib 'use strict'; @@ -859,21 +760,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-node-current-lib.js.map -", -] +" `; -exports[`Assets babel transforms example test case: node-current-lib 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > babel > transforms example test case: node-current-mjs > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets babel transforms example test case: node-current-mjs 1`] = ` -[ - "mjs/index-node-current-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > babel > transforms example test case: node-current-mjs > mjs/index-node-current-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: mjs import '../assets/styles-17df299b.css'; @@ -889,31 +786,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-node-current-mjs.mjs.map -", -] +" `; -exports[`Assets babel transforms example test case: node-current-mjs 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > babel > transforms example test case: node-experimental-cjs > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets babel transforms example test case: node-experimental-cjs 1`] = ` -[ - "cjs/index-node-experimental-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import './index-node-experimental-cjs.cjs';", -] -`; - -exports[`Assets babel transforms example test case: node-experimental-cjs 2`] = ` -[ - "cjs/index-node-experimental-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > babel > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: cjs 'use strict'; @@ -931,21 +814,24 @@ const json = { }; console.log(json); //# sourceMappingURL=index-node-experimental-cjs.cjs.map -", -] +" `; -exports[`Assets babel transforms example test case: node-experimental-cjs 3`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > babel > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-experimental-cjs.cjs';" `; -exports[`Assets babel transforms example test case: node-experimental-lib 1`] = ` -[ - "lib/index-node-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > babel > transforms example test case: node-experimental-lib > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" +`; + +exports[`Assets > babel > transforms example test case: node-experimental-lib > lib/index-node-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: lib 'use strict'; @@ -963,21 +849,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-node-experimental-lib.js.map -", -] +" `; -exports[`Assets babel transforms example test case: node-experimental-lib 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > babel > transforms example test case: node-experimental-mjs > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets babel transforms example test case: node-experimental-mjs 1`] = ` -[ - "mjs/index-node-experimental-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > babel > transforms example test case: node-experimental-mjs > mjs/index-node-experimental-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: mjs import '../assets/styles-17df299b.css'; @@ -993,31 +875,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-node-experimental-mjs.mjs.map -", -] -`; - -exports[`Assets babel transforms example test case: node-experimental-mjs 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +" `; -exports[`Assets babel transforms example test case: node-legacy-cjs 1`] = ` -[ - "cjs/index-node-legacy-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import './index-node-legacy-cjs.cjs';", -] +exports[`Assets > babel > transforms example test case: node-legacy-cjs > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets babel transforms example test case: node-legacy-cjs 2`] = ` -[ - "cjs/index-node-legacy-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > babel > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: cjs 'use strict'; @@ -1035,21 +903,24 @@ const json = { }; console.log(json); //# sourceMappingURL=index-node-legacy-cjs.cjs.map -", -] +" `; -exports[`Assets babel transforms example test case: node-legacy-cjs 3`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > babel > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-legacy-cjs.cjs';" +`; + +exports[`Assets > babel > transforms example test case: node-legacy-lib > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets babel transforms example test case: node-legacy-lib 1`] = ` -[ - "lib/index-node-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > babel > transforms example test case: node-legacy-lib > lib/index-node-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: lib 'use strict'; @@ -1067,21 +938,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-node-legacy-lib.js.map -", -] +" `; -exports[`Assets babel transforms example test case: node-legacy-lib 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > babel > transforms example test case: node-legacy-mjs > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets babel transforms example test case: node-legacy-mjs 1`] = ` -[ - "mjs/index-node-legacy-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > babel > transforms example test case: node-legacy-mjs > mjs/index-node-legacy-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: mjs import '../assets/styles-17df299b.css'; @@ -1097,31 +964,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-node-legacy-mjs.mjs.map -", -] -`; - -exports[`Assets babel transforms example test case: node-legacy-mjs 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +" `; -exports[`Assets babel transforms example test case: node-stable-cjs 1`] = ` -[ - "cjs/index-node-stable-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import './index-node-stable-cjs.cjs';", -] +exports[`Assets > babel > transforms example test case: node-stable-cjs > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets babel transforms example test case: node-stable-cjs 2`] = ` -[ - "cjs/index-node-stable-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > babel > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: cjs 'use strict'; @@ -1139,21 +992,24 @@ const json = { }; console.log(json); //# sourceMappingURL=index-node-stable-cjs.cjs.map -", -] +" +`; + +exports[`Assets > babel > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-stable-cjs.cjs';" `; -exports[`Assets babel transforms example test case: node-stable-cjs 3`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > babel > transforms example test case: node-stable-lib > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets babel transforms example test case: node-stable-lib 1`] = ` -[ - "lib/index-node-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > babel > transforms example test case: node-stable-lib > lib/index-node-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: lib 'use strict'; @@ -1171,21 +1027,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-node-stable-lib.js.map -", -] +" `; -exports[`Assets babel transforms example test case: node-stable-lib 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > babel > transforms example test case: node-stable-mjs > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets babel transforms example test case: node-stable-mjs 1`] = ` -[ - "mjs/index-node-stable-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > babel > transforms example test case: node-stable-mjs > mjs/index-node-stable-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: mjs import '../assets/styles-17df299b.css'; @@ -1201,21 +1053,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-node-stable-mjs.mjs.map -", -] +" `; -exports[`Assets babel transforms example test case: node-stable-mjs 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > swc > transforms example test case: browser-current-esm > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets swc transforms example test case: browser-current-esm 1`] = ` -[ - "esm/index-browser-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > swc > transforms example test case: browser-current-esm > esm/index-browser-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: esm import "../assets/styles-17df299b.css"; import "../assets/logo-c21f559f.svg"; @@ -1234,21 +1082,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-browser-current-esm.js.map -", -] +" `; -exports[`Assets swc transforms example test case: browser-current-esm 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > swc > transforms example test case: browser-current-lib > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets swc transforms example test case: browser-current-lib 1`] = ` -[ - "lib/index-browser-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > swc > transforms example test case: browser-current-lib > lib/index-browser-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: lib "use strict"; require("../assets/styles-17df299b.css"); @@ -1268,28 +1112,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-browser-current-lib.js.map -", -] +" `; -exports[`Assets swc transforms example test case: browser-current-lib 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > swc > transforms example test case: browser-current-umd > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets swc transforms example test case: browser-current-umd 1`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] -`; - -exports[`Assets swc transforms example test case: browser-current-umd 2`] = ` -[ - "umd/index-browser-current-umd.js", - "(function(global, factory) { +exports[`Assets > swc > transforms example test case: browser-current-umd > umd/index-browser-current-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports, require("../assets/styles-17df299b.css"), require("../assets/logo-c21f559f.svg"), require("website/src/css/custom.css")); else if (typeof define === "function" && define.amd) define([ "exports", @@ -1318,14 +1151,17 @@ exports[`Assets swc transforms example test case: browser-current-umd 2`] = ` console.log(json); }); //# sourceMappingURL=index-browser-current-umd.js.map -", -] +" +`; + +exports[`Assets > swc > transforms example test case: browser-experimental-esm > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets swc transforms example test case: browser-experimental-esm 1`] = ` -[ - "esm/index-browser-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > swc > transforms example test case: browser-experimental-esm > esm/index-browser-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: esm import "../assets/styles-17df299b.css"; import "../assets/logo-c21f559f.svg"; @@ -1344,21 +1180,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-browser-experimental-esm.js.map -", -] +" `; -exports[`Assets swc transforms example test case: browser-experimental-esm 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > swc > transforms example test case: browser-experimental-lib > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets swc transforms example test case: browser-experimental-lib 1`] = ` -[ - "lib/index-browser-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > swc > transforms example test case: browser-experimental-lib > lib/index-browser-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: lib "use strict"; require("../assets/styles-17df299b.css"); @@ -1378,28 +1210,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-browser-experimental-lib.js.map -", -] +" `; -exports[`Assets swc transforms example test case: browser-experimental-lib 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > swc > transforms example test case: browser-experimental-umd > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets swc transforms example test case: browser-experimental-umd 1`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] -`; - -exports[`Assets swc transforms example test case: browser-experimental-umd 2`] = ` -[ - "umd/index-browser-experimental-umd.js", - "(function(global, factory) { +exports[`Assets > swc > transforms example test case: browser-experimental-umd > umd/index-browser-experimental-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports, require("../assets/styles-17df299b.css"), require("../assets/logo-c21f559f.svg"), require("website/src/css/custom.css")); else if (typeof define === "function" && define.amd) define([ "exports", @@ -1428,14 +1249,17 @@ exports[`Assets swc transforms example test case: browser-experimental-umd 2`] = console.log(json); }); //# sourceMappingURL=index-browser-experimental-umd.js.map -", -] +" `; -exports[`Assets swc transforms example test case: browser-legacy-esm 1`] = ` -[ - "esm/index-browser-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > swc > transforms example test case: browser-legacy-esm > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" +`; + +exports[`Assets > swc > transforms example test case: browser-legacy-esm > esm/index-browser-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: esm import "../assets/styles-17df299b.css"; import "../assets/logo-c21f559f.svg"; @@ -1454,21 +1278,17 @@ var json = { }; console.log(json); //# sourceMappingURL=index-browser-legacy-esm.js.map -", -] +" `; -exports[`Assets swc transforms example test case: browser-legacy-esm 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > swc > transforms example test case: browser-legacy-lib > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets swc transforms example test case: browser-legacy-lib 1`] = ` -[ - "lib/index-browser-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > swc > transforms example test case: browser-legacy-lib > lib/index-browser-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: lib "use strict"; require("../assets/styles-17df299b.css"); @@ -1488,28 +1308,17 @@ var json = { }; console.log(json); //# sourceMappingURL=index-browser-legacy-lib.js.map -", -] -`; - -exports[`Assets swc transforms example test case: browser-legacy-lib 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +" `; -exports[`Assets swc transforms example test case: browser-legacy-umd 1`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > swc > transforms example test case: browser-legacy-umd > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets swc transforms example test case: browser-legacy-umd 2`] = ` -[ - "umd/index-browser-legacy-umd.js", - "(function(global, factory) { +exports[`Assets > swc > transforms example test case: browser-legacy-umd > umd/index-browser-legacy-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports, require("../assets/styles-17df299b.css"), require("../assets/logo-c21f559f.svg"), require("website/src/css/custom.css")); else if (typeof define === "function" && define.amd) define([ "exports", @@ -1538,14 +1347,17 @@ exports[`Assets swc transforms example test case: browser-legacy-umd 2`] = ` console.log(json); }); //# sourceMappingURL=index-browser-legacy-umd.js.map -", -] +" `; -exports[`Assets swc transforms example test case: browser-stable-esm 1`] = ` -[ - "esm/index-browser-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > swc > transforms example test case: browser-stable-esm > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" +`; + +exports[`Assets > swc > transforms example test case: browser-stable-esm > esm/index-browser-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: esm import "../assets/styles-17df299b.css"; import "../assets/logo-c21f559f.svg"; @@ -1564,21 +1376,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-browser-stable-esm.js.map -", -] +" `; -exports[`Assets swc transforms example test case: browser-stable-esm 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > swc > transforms example test case: browser-stable-lib > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets swc transforms example test case: browser-stable-lib 1`] = ` -[ - "lib/index-browser-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > swc > transforms example test case: browser-stable-lib > lib/index-browser-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: lib "use strict"; require("../assets/styles-17df299b.css"); @@ -1598,28 +1406,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-browser-stable-lib.js.map -", -] +" `; -exports[`Assets swc transforms example test case: browser-stable-lib 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > swc > transforms example test case: browser-stable-umd > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets swc transforms example test case: browser-stable-umd 1`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] -`; - -exports[`Assets swc transforms example test case: browser-stable-umd 2`] = ` -[ - "umd/index-browser-stable-umd.js", - "(function(global, factory) { +exports[`Assets > swc > transforms example test case: browser-stable-umd > umd/index-browser-stable-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports, require("../assets/styles-17df299b.css"), require("../assets/logo-c21f559f.svg"), require("website/src/css/custom.css")); else if (typeof define === "function" && define.amd) define([ "exports", @@ -1648,14 +1445,17 @@ exports[`Assets swc transforms example test case: browser-stable-umd 2`] = ` console.log(json); }); //# sourceMappingURL=index-browser-stable-umd.js.map -", -] +" +`; + +exports[`Assets > swc > transforms example test case: electron-current-esm > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets swc transforms example test case: electron-current-esm 1`] = ` -[ - "esm/index-electron-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > swc > transforms example test case: electron-current-esm > esm/index-electron-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: esm import "../assets/styles-17df299b.css"; import "../assets/logo-c21f559f.svg"; @@ -1674,21 +1474,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-electron-current-esm.js.map -", -] +" `; -exports[`Assets swc transforms example test case: electron-current-esm 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > swc > transforms example test case: electron-current-lib > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets swc transforms example test case: electron-current-lib 1`] = ` -[ - "lib/index-electron-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > swc > transforms example test case: electron-current-lib > lib/index-electron-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: lib "use strict"; require("../assets/styles-17df299b.css"); @@ -1708,21 +1504,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-electron-current-lib.js.map -", -] +" `; -exports[`Assets swc transforms example test case: electron-current-lib 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > swc > transforms example test case: electron-experimental-esm > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets swc transforms example test case: electron-experimental-esm 1`] = ` -[ - "esm/index-electron-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > swc > transforms example test case: electron-experimental-esm > esm/index-electron-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: esm import "../assets/styles-17df299b.css"; import "../assets/logo-c21f559f.svg"; @@ -1741,21 +1533,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-electron-experimental-esm.js.map -", -] +" `; -exports[`Assets swc transforms example test case: electron-experimental-esm 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > swc > transforms example test case: electron-experimental-lib > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets swc transforms example test case: electron-experimental-lib 1`] = ` -[ - "lib/index-electron-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > swc > transforms example test case: electron-experimental-lib > lib/index-electron-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: lib "use strict"; require("../assets/styles-17df299b.css"); @@ -1775,21 +1563,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-electron-experimental-lib.js.map -", -] +" `; -exports[`Assets swc transforms example test case: electron-experimental-lib 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > swc > transforms example test case: electron-legacy-esm > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets swc transforms example test case: electron-legacy-esm 1`] = ` -[ - "esm/index-electron-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > swc > transforms example test case: electron-legacy-esm > esm/index-electron-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: esm import "../assets/styles-17df299b.css"; import "../assets/logo-c21f559f.svg"; @@ -1808,21 +1592,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-electron-legacy-esm.js.map -", -] +" `; -exports[`Assets swc transforms example test case: electron-legacy-esm 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > swc > transforms example test case: electron-legacy-lib > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets swc transforms example test case: electron-legacy-lib 1`] = ` -[ - "lib/index-electron-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > swc > transforms example test case: electron-legacy-lib > lib/index-electron-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: lib "use strict"; require("../assets/styles-17df299b.css"); @@ -1842,21 +1622,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-electron-legacy-lib.js.map -", -] +" `; -exports[`Assets swc transforms example test case: electron-legacy-lib 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > swc > transforms example test case: electron-stable-esm > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets swc transforms example test case: electron-stable-esm 1`] = ` -[ - "esm/index-electron-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > swc > transforms example test case: electron-stable-esm > esm/index-electron-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: esm import "../assets/styles-17df299b.css"; import "../assets/logo-c21f559f.svg"; @@ -1875,21 +1651,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-electron-stable-esm.js.map -", -] +" `; -exports[`Assets swc transforms example test case: electron-stable-esm 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > swc > transforms example test case: electron-stable-lib > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets swc transforms example test case: electron-stable-lib 1`] = ` -[ - "lib/index-electron-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > swc > transforms example test case: electron-stable-lib > lib/index-electron-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: lib "use strict"; require("../assets/styles-17df299b.css"); @@ -1909,21 +1681,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-electron-stable-lib.js.map -", -] +" `; -exports[`Assets swc transforms example test case: electron-stable-lib 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > swc > transforms example test case: native-current-lib > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets swc transforms example test case: native-current-lib 1`] = ` -[ - "lib/index-native-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > swc > transforms example test case: native-current-lib > lib/index-native-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: current, Format: lib "use strict"; require("../assets/styles-17df299b.css"); @@ -1943,21 +1711,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-native-current-lib.js.map -", -] +" `; -exports[`Assets swc transforms example test case: native-current-lib 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > swc > transforms example test case: native-experimental-lib > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets swc transforms example test case: native-experimental-lib 1`] = ` -[ - "lib/index-native-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > swc > transforms example test case: native-experimental-lib > lib/index-native-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: experimental, Format: lib "use strict"; require("../assets/styles-17df299b.css"); @@ -1977,21 +1741,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-native-experimental-lib.js.map -", -] +" `; -exports[`Assets swc transforms example test case: native-experimental-lib 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > swc > transforms example test case: native-legacy-lib > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets swc transforms example test case: native-legacy-lib 1`] = ` -[ - "lib/index-native-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > swc > transforms example test case: native-legacy-lib > lib/index-native-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: legacy, Format: lib "use strict"; require("../assets/styles-17df299b.css"); @@ -2011,21 +1771,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-native-legacy-lib.js.map -", -] +" `; -exports[`Assets swc transforms example test case: native-legacy-lib 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > swc > transforms example test case: native-stable-lib > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets swc transforms example test case: native-stable-lib 1`] = ` -[ - "lib/index-native-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > swc > transforms example test case: native-stable-lib > lib/index-native-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: stable, Format: lib "use strict"; require("../assets/styles-17df299b.css"); @@ -2045,31 +1801,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-native-stable-lib.js.map -", -] +" `; -exports[`Assets swc transforms example test case: native-stable-lib 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] -`; - -exports[`Assets swc transforms example test case: node-current-cjs 1`] = ` -[ - "cjs/index-node-current-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import './index-node-current-cjs.cjs';", -] +exports[`Assets > swc > transforms example test case: node-current-cjs > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets swc transforms example test case: node-current-cjs 2`] = ` -[ - "cjs/index-node-current-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > swc > transforms example test case: node-current-cjs > cjs/index-node-current-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: cjs "use strict"; require("../assets/styles-17df299b.css"); @@ -2089,21 +1831,24 @@ const json = { }; console.log(json); //# sourceMappingURL=index-node-current-cjs.cjs.map -", -] +" +`; + +exports[`Assets > swc > transforms example test case: node-current-cjs > cjs/index-node-current-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-current-cjs.cjs';" `; -exports[`Assets swc transforms example test case: node-current-cjs 3`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > swc > transforms example test case: node-current-lib > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets swc transforms example test case: node-current-lib 1`] = ` -[ - "lib/index-node-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > swc > transforms example test case: node-current-lib > lib/index-node-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: lib "use strict"; require("../assets/styles-17df299b.css"); @@ -2123,21 +1868,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-node-current-lib.js.map -", -] +" `; -exports[`Assets swc transforms example test case: node-current-lib 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > swc > transforms example test case: node-current-mjs > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets swc transforms example test case: node-current-mjs 1`] = ` -[ - "mjs/index-node-current-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > swc > transforms example test case: node-current-mjs > mjs/index-node-current-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: mjs import "../assets/styles-17df299b.css"; import "../assets/logo-c21f559f.svg"; @@ -2156,31 +1897,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-node-current-mjs.mjs.map -", -] -`; - -exports[`Assets swc transforms example test case: node-current-mjs 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +" `; -exports[`Assets swc transforms example test case: node-experimental-cjs 1`] = ` -[ - "cjs/index-node-experimental-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import './index-node-experimental-cjs.cjs';", -] +exports[`Assets > swc > transforms example test case: node-experimental-cjs > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets swc transforms example test case: node-experimental-cjs 2`] = ` -[ - "cjs/index-node-experimental-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > swc > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: cjs "use strict"; require("../assets/styles-17df299b.css"); @@ -2200,21 +1927,24 @@ const json = { }; console.log(json); //# sourceMappingURL=index-node-experimental-cjs.cjs.map -", -] +" +`; + +exports[`Assets > swc > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-experimental-cjs.cjs';" `; -exports[`Assets swc transforms example test case: node-experimental-cjs 3`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > swc > transforms example test case: node-experimental-lib > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets swc transforms example test case: node-experimental-lib 1`] = ` -[ - "lib/index-node-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > swc > transforms example test case: node-experimental-lib > lib/index-node-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: lib "use strict"; require("../assets/styles-17df299b.css"); @@ -2234,21 +1964,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-node-experimental-lib.js.map -", -] +" `; -exports[`Assets swc transforms example test case: node-experimental-lib 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > swc > transforms example test case: node-experimental-mjs > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets swc transforms example test case: node-experimental-mjs 1`] = ` -[ - "mjs/index-node-experimental-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > swc > transforms example test case: node-experimental-mjs > mjs/index-node-experimental-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: mjs import "../assets/styles-17df299b.css"; import "../assets/logo-c21f559f.svg"; @@ -2267,31 +1993,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-node-experimental-mjs.mjs.map -", -] +" `; -exports[`Assets swc transforms example test case: node-experimental-mjs 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > swc > transforms example test case: node-legacy-cjs > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets swc transforms example test case: node-legacy-cjs 1`] = ` -[ - "cjs/index-node-legacy-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import './index-node-legacy-cjs.cjs';", -] -`; - -exports[`Assets swc transforms example test case: node-legacy-cjs 2`] = ` -[ - "cjs/index-node-legacy-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > swc > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: cjs "use strict"; require("../assets/styles-17df299b.css"); @@ -2311,21 +2023,24 @@ const json = { }; console.log(json); //# sourceMappingURL=index-node-legacy-cjs.cjs.map -", -] +" `; -exports[`Assets swc transforms example test case: node-legacy-cjs 3`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > swc > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-legacy-cjs.cjs';" `; -exports[`Assets swc transforms example test case: node-legacy-lib 1`] = ` -[ - "lib/index-node-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > swc > transforms example test case: node-legacy-lib > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" +`; + +exports[`Assets > swc > transforms example test case: node-legacy-lib > lib/index-node-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: lib "use strict"; require("../assets/styles-17df299b.css"); @@ -2345,21 +2060,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-node-legacy-lib.js.map -", -] +" `; -exports[`Assets swc transforms example test case: node-legacy-lib 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > swc > transforms example test case: node-legacy-mjs > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets swc transforms example test case: node-legacy-mjs 1`] = ` -[ - "mjs/index-node-legacy-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > swc > transforms example test case: node-legacy-mjs > mjs/index-node-legacy-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: mjs import "../assets/styles-17df299b.css"; import "../assets/logo-c21f559f.svg"; @@ -2378,31 +2089,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-node-legacy-mjs.mjs.map -", -] -`; - -exports[`Assets swc transforms example test case: node-legacy-mjs 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +" `; -exports[`Assets swc transforms example test case: node-stable-cjs 1`] = ` -[ - "cjs/index-node-stable-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import './index-node-stable-cjs.cjs';", -] +exports[`Assets > swc > transforms example test case: node-stable-cjs > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets swc transforms example test case: node-stable-cjs 2`] = ` -[ - "cjs/index-node-stable-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > swc > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: cjs "use strict"; require("../assets/styles-17df299b.css"); @@ -2422,21 +2119,24 @@ const json = { }; console.log(json); //# sourceMappingURL=index-node-stable-cjs.cjs.map -", -] +" `; -exports[`Assets swc transforms example test case: node-stable-cjs 3`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > swc > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-stable-cjs.cjs';" +`; + +exports[`Assets > swc > transforms example test case: node-stable-lib > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets swc transforms example test case: node-stable-lib 1`] = ` -[ - "lib/index-node-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > swc > transforms example test case: node-stable-lib > lib/index-node-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: lib "use strict"; require("../assets/styles-17df299b.css"); @@ -2456,21 +2156,17 @@ const json = { }; console.log(json); //# sourceMappingURL=index-node-stable-lib.js.map -", -] +" `; -exports[`Assets swc transforms example test case: node-stable-lib 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +exports[`Assets > swc > transforms example test case: node-stable-mjs > ../assets/styles-17df299b.css 1`] = ` +".baz { +} +" `; -exports[`Assets swc transforms example test case: node-stable-mjs 1`] = ` -[ - "mjs/index-node-stable-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Assets > swc > transforms example test case: node-stable-mjs > mjs/index-node-stable-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: mjs import "../assets/styles-17df299b.css"; import "../assets/logo-c21f559f.svg"; @@ -2489,13 +2185,5 @@ const json = { }; console.log(json); //# sourceMappingURL=index-node-stable-mjs.mjs.map -", -] -`; - -exports[`Assets swc transforms example test case: node-stable-mjs 2`] = ` -[ - "styles.css", - "assets/styles-17df299b.css", -] +" `; diff --git a/packages/packemon/tests/examples/__snapshots__/asyncAwait.test.ts.snap b/packages/packemon/tests/examples/__snapshots__/asyncAwait.test.ts.snap index bd210f00a..677258a35 100644 --- a/packages/packemon/tests/examples/__snapshots__/asyncAwait.test.ts.snap +++ b/packages/packemon/tests/examples/__snapshots__/asyncAwait.test.ts.snap @@ -1,9 +1,7 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`Async/await babel transforms example test case: browser-current-esm 1`] = ` -[ - "esm/index-browser-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > babel > transforms example test case: browser-current-esm > esm/index-browser-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: esm async function wait() { @@ -20,14 +18,11 @@ async function run() { } export { run, wait }; //# sourceMappingURL=index-browser-current-esm.js.map -", -] +" `; -exports[`Async/await babel transforms example test case: browser-current-lib 1`] = ` -[ - "lib/index-browser-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > babel > transforms example test case: browser-current-lib > lib/index-browser-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: lib 'use strict'; @@ -47,14 +42,11 @@ async function run() { exports.run = run; exports.wait = wait; //# sourceMappingURL=index-browser-current-lib.js.map -", -] +" `; -exports[`Async/await babel transforms example test case: browser-current-umd 1`] = ` -[ - "umd/index-browser-current-umd.js", - "(function (global, factory) { +exports[`Async/await > babel > transforms example test case: browser-current-umd > umd/index-browser-current-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports"], factory); } else if (typeof exports !== "undefined") { @@ -91,14 +83,11 @@ exports[`Async/await babel transforms example test case: browser-current-umd 1`] } }); //# sourceMappingURL=index-browser-current-umd.js.map -", -] +" `; -exports[`Async/await babel transforms example test case: browser-experimental-esm 1`] = ` -[ - "esm/index-browser-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > babel > transforms example test case: browser-experimental-esm > esm/index-browser-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: esm async function wait() { @@ -115,14 +104,11 @@ async function run() { } export { run, wait }; //# sourceMappingURL=index-browser-experimental-esm.js.map -", -] +" `; -exports[`Async/await babel transforms example test case: browser-experimental-lib 1`] = ` -[ - "lib/index-browser-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > babel > transforms example test case: browser-experimental-lib > lib/index-browser-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: lib 'use strict'; @@ -142,14 +128,11 @@ async function run() { exports.run = run; exports.wait = wait; //# sourceMappingURL=index-browser-experimental-lib.js.map -", -] +" `; -exports[`Async/await babel transforms example test case: browser-experimental-umd 1`] = ` -[ - "umd/index-browser-experimental-umd.js", - "(function (global, factory) { +exports[`Async/await > babel > transforms example test case: browser-experimental-umd > umd/index-browser-experimental-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports"], factory); } else if (typeof exports !== "undefined") { @@ -186,14 +169,11 @@ exports[`Async/await babel transforms example test case: browser-experimental-um } }); //# sourceMappingURL=index-browser-experimental-umd.js.map -", -] +" `; -exports[`Async/await babel transforms example test case: browser-legacy-esm 1`] = ` -[ - "esm/index-browser-legacy-esm.js", - "function _newArrowCheck(innerThis, boundThis) { if (innerThis !== boundThis) { throw new TypeError("Cannot instantiate an arrow function"); } } +exports[`Async/await > babel > transforms example test case: browser-legacy-esm > esm/index-browser-legacy-esm.js 1`] = ` +"function _newArrowCheck(innerThis, boundThis) { if (innerThis !== boundThis) { throw new TypeError("Cannot instantiate an arrow function"); } } // Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: esm @@ -213,14 +193,11 @@ async function run() { } export { run, wait }; //# sourceMappingURL=index-browser-legacy-esm.js.map -", -] +" `; -exports[`Async/await babel transforms example test case: browser-legacy-lib 1`] = ` -[ - "lib/index-browser-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > babel > transforms example test case: browser-legacy-lib > lib/index-browser-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: lib 'use strict'; @@ -243,14 +220,11 @@ async function run() { exports.run = run; exports.wait = wait; //# sourceMappingURL=index-browser-legacy-lib.js.map -", -] +" `; -exports[`Async/await babel transforms example test case: browser-legacy-umd 1`] = ` -[ - "umd/index-browser-legacy-umd.js", - "(function (global, factory) { +exports[`Async/await > babel > transforms example test case: browser-legacy-umd > umd/index-browser-legacy-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports"], factory); } else if (typeof exports !== "undefined") { @@ -290,14 +264,11 @@ exports[`Async/await babel transforms example test case: browser-legacy-umd 1`] } }); //# sourceMappingURL=index-browser-legacy-umd.js.map -", -] +" `; -exports[`Async/await babel transforms example test case: browser-stable-esm 1`] = ` -[ - "esm/index-browser-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > babel > transforms example test case: browser-stable-esm > esm/index-browser-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: esm async function wait() { @@ -314,14 +285,11 @@ async function run() { } export { run, wait }; //# sourceMappingURL=index-browser-stable-esm.js.map -", -] +" `; -exports[`Async/await babel transforms example test case: browser-stable-lib 1`] = ` -[ - "lib/index-browser-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > babel > transforms example test case: browser-stable-lib > lib/index-browser-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: lib 'use strict'; @@ -341,14 +309,11 @@ async function run() { exports.run = run; exports.wait = wait; //# sourceMappingURL=index-browser-stable-lib.js.map -", -] +" `; -exports[`Async/await babel transforms example test case: browser-stable-umd 1`] = ` -[ - "umd/index-browser-stable-umd.js", - "(function (global, factory) { +exports[`Async/await > babel > transforms example test case: browser-stable-umd > umd/index-browser-stable-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports"], factory); } else if (typeof exports !== "undefined") { @@ -385,14 +350,11 @@ exports[`Async/await babel transforms example test case: browser-stable-umd 1`] } }); //# sourceMappingURL=index-browser-stable-umd.js.map -", -] +" `; -exports[`Async/await babel transforms example test case: electron-current-esm 1`] = ` -[ - "esm/index-electron-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > babel > transforms example test case: electron-current-esm > esm/index-electron-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: esm async function wait() { @@ -409,14 +371,11 @@ async function run() { } export { run, wait }; //# sourceMappingURL=index-electron-current-esm.js.map -", -] +" `; -exports[`Async/await babel transforms example test case: electron-current-lib 1`] = ` -[ - "lib/index-electron-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > babel > transforms example test case: electron-current-lib > lib/index-electron-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: lib 'use strict'; @@ -436,14 +395,11 @@ async function run() { exports.run = run; exports.wait = wait; //# sourceMappingURL=index-electron-current-lib.js.map -", -] +" `; -exports[`Async/await babel transforms example test case: electron-experimental-esm 1`] = ` -[ - "esm/index-electron-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > babel > transforms example test case: electron-experimental-esm > esm/index-electron-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: esm async function wait() { @@ -460,14 +416,11 @@ async function run() { } export { run, wait }; //# sourceMappingURL=index-electron-experimental-esm.js.map -", -] +" `; -exports[`Async/await babel transforms example test case: electron-experimental-lib 1`] = ` -[ - "lib/index-electron-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > babel > transforms example test case: electron-experimental-lib > lib/index-electron-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: lib 'use strict'; @@ -487,14 +440,11 @@ async function run() { exports.run = run; exports.wait = wait; //# sourceMappingURL=index-electron-experimental-lib.js.map -", -] +" `; -exports[`Async/await babel transforms example test case: electron-legacy-esm 1`] = ` -[ - "esm/index-electron-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > babel > transforms example test case: electron-legacy-esm > esm/index-electron-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: esm async function wait() { @@ -511,14 +461,11 @@ async function run() { } export { run, wait }; //# sourceMappingURL=index-electron-legacy-esm.js.map -", -] +" `; -exports[`Async/await babel transforms example test case: electron-legacy-lib 1`] = ` -[ - "lib/index-electron-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > babel > transforms example test case: electron-legacy-lib > lib/index-electron-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: lib 'use strict'; @@ -538,14 +485,11 @@ async function run() { exports.run = run; exports.wait = wait; //# sourceMappingURL=index-electron-legacy-lib.js.map -", -] +" `; -exports[`Async/await babel transforms example test case: electron-stable-esm 1`] = ` -[ - "esm/index-electron-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > babel > transforms example test case: electron-stable-esm > esm/index-electron-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: esm async function wait() { @@ -562,14 +506,11 @@ async function run() { } export { run, wait }; //# sourceMappingURL=index-electron-stable-esm.js.map -", -] +" `; -exports[`Async/await babel transforms example test case: electron-stable-lib 1`] = ` -[ - "lib/index-electron-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > babel > transforms example test case: electron-stable-lib > lib/index-electron-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: lib 'use strict'; @@ -589,14 +530,11 @@ async function run() { exports.run = run; exports.wait = wait; //# sourceMappingURL=index-electron-stable-lib.js.map -", -] +" `; -exports[`Async/await babel transforms example test case: native-current-lib 1`] = ` -[ - "lib/index-native-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > babel > transforms example test case: native-current-lib > lib/index-native-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: current, Format: lib 'use strict'; @@ -616,14 +554,11 @@ async function run() { exports.run = run; exports.wait = wait; //# sourceMappingURL=index-native-current-lib.js.map -", -] +" `; -exports[`Async/await babel transforms example test case: native-experimental-lib 1`] = ` -[ - "lib/index-native-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > babel > transforms example test case: native-experimental-lib > lib/index-native-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: experimental, Format: lib 'use strict'; @@ -643,14 +578,11 @@ async function run() { exports.run = run; exports.wait = wait; //# sourceMappingURL=index-native-experimental-lib.js.map -", -] +" `; -exports[`Async/await babel transforms example test case: native-legacy-lib 1`] = ` -[ - "lib/index-native-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > babel > transforms example test case: native-legacy-lib > lib/index-native-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: legacy, Format: lib 'use strict'; @@ -670,14 +602,11 @@ async function run() { exports.run = run; exports.wait = wait; //# sourceMappingURL=index-native-legacy-lib.js.map -", -] +" `; -exports[`Async/await babel transforms example test case: native-stable-lib 1`] = ` -[ - "lib/index-native-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > babel > transforms example test case: native-stable-lib > lib/index-native-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: stable, Format: lib 'use strict'; @@ -697,26 +626,11 @@ async function run() { exports.run = run; exports.wait = wait; //# sourceMappingURL=index-native-stable-lib.js.map -", -] +" `; -exports[`Async/await babel transforms example test case: node-current-cjs 1`] = ` -[ - "cjs/index-node-current-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-current-cjs.cjs'; - -export const { run, wait } = data;", -] -`; - -exports[`Async/await babel transforms example test case: node-current-cjs 2`] = ` -[ - "cjs/index-node-current-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > babel > transforms example test case: node-current-cjs > cjs/index-node-current-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: cjs 'use strict'; @@ -736,14 +650,20 @@ async function run() { exports.run = run; exports.wait = wait; //# sourceMappingURL=index-node-current-cjs.cjs.map -", -] +" +`; + +exports[`Async/await > babel > transforms example test case: node-current-cjs > cjs/index-node-current-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-current-cjs.cjs'; + +export const { run, wait } = data;" `; -exports[`Async/await babel transforms example test case: node-current-lib 1`] = ` -[ - "lib/index-node-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > babel > transforms example test case: node-current-lib > lib/index-node-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: lib 'use strict'; @@ -763,14 +683,11 @@ async function run() { exports.run = run; exports.wait = wait; //# sourceMappingURL=index-node-current-lib.js.map -", -] +" `; -exports[`Async/await babel transforms example test case: node-current-mjs 1`] = ` -[ - "mjs/index-node-current-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > babel > transforms example test case: node-current-mjs > mjs/index-node-current-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: mjs async function wait() { @@ -787,26 +704,11 @@ async function run() { } export { run, wait }; //# sourceMappingURL=index-node-current-mjs.mjs.map -", -] +" `; -exports[`Async/await babel transforms example test case: node-experimental-cjs 1`] = ` -[ - "cjs/index-node-experimental-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-experimental-cjs.cjs'; - -export const { run, wait } = data;", -] -`; - -exports[`Async/await babel transforms example test case: node-experimental-cjs 2`] = ` -[ - "cjs/index-node-experimental-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > babel > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: cjs 'use strict'; @@ -826,14 +728,20 @@ async function run() { exports.run = run; exports.wait = wait; //# sourceMappingURL=index-node-experimental-cjs.cjs.map -", -] +" +`; + +exports[`Async/await > babel > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-experimental-cjs.cjs'; + +export const { run, wait } = data;" `; -exports[`Async/await babel transforms example test case: node-experimental-lib 1`] = ` -[ - "lib/index-node-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > babel > transforms example test case: node-experimental-lib > lib/index-node-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: lib 'use strict'; @@ -853,14 +761,11 @@ async function run() { exports.run = run; exports.wait = wait; //# sourceMappingURL=index-node-experimental-lib.js.map -", -] +" `; -exports[`Async/await babel transforms example test case: node-experimental-mjs 1`] = ` -[ - "mjs/index-node-experimental-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > babel > transforms example test case: node-experimental-mjs > mjs/index-node-experimental-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: mjs async function wait() { @@ -877,26 +782,11 @@ async function run() { } export { run, wait }; //# sourceMappingURL=index-node-experimental-mjs.mjs.map -", -] +" `; -exports[`Async/await babel transforms example test case: node-legacy-cjs 1`] = ` -[ - "cjs/index-node-legacy-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-legacy-cjs.cjs'; - -export const { run, wait } = data;", -] -`; - -exports[`Async/await babel transforms example test case: node-legacy-cjs 2`] = ` -[ - "cjs/index-node-legacy-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > babel > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: cjs 'use strict'; @@ -916,14 +806,20 @@ async function run() { exports.run = run; exports.wait = wait; //# sourceMappingURL=index-node-legacy-cjs.cjs.map -", -] +" +`; + +exports[`Async/await > babel > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-legacy-cjs.cjs'; + +export const { run, wait } = data;" `; -exports[`Async/await babel transforms example test case: node-legacy-lib 1`] = ` -[ - "lib/index-node-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > babel > transforms example test case: node-legacy-lib > lib/index-node-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: lib 'use strict'; @@ -943,14 +839,11 @@ async function run() { exports.run = run; exports.wait = wait; //# sourceMappingURL=index-node-legacy-lib.js.map -", -] +" `; -exports[`Async/await babel transforms example test case: node-legacy-mjs 1`] = ` -[ - "mjs/index-node-legacy-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > babel > transforms example test case: node-legacy-mjs > mjs/index-node-legacy-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: mjs async function wait() { @@ -967,26 +860,11 @@ async function run() { } export { run, wait }; //# sourceMappingURL=index-node-legacy-mjs.mjs.map -", -] +" `; -exports[`Async/await babel transforms example test case: node-stable-cjs 1`] = ` -[ - "cjs/index-node-stable-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-stable-cjs.cjs'; - -export const { run, wait } = data;", -] -`; - -exports[`Async/await babel transforms example test case: node-stable-cjs 2`] = ` -[ - "cjs/index-node-stable-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > babel > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: cjs 'use strict'; @@ -1006,14 +884,20 @@ async function run() { exports.run = run; exports.wait = wait; //# sourceMappingURL=index-node-stable-cjs.cjs.map -", -] +" +`; + +exports[`Async/await > babel > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-stable-cjs.cjs'; + +export const { run, wait } = data;" `; -exports[`Async/await babel transforms example test case: node-stable-lib 1`] = ` -[ - "lib/index-node-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > babel > transforms example test case: node-stable-lib > lib/index-node-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: lib 'use strict'; @@ -1033,14 +917,11 @@ async function run() { exports.run = run; exports.wait = wait; //# sourceMappingURL=index-node-stable-lib.js.map -", -] +" `; -exports[`Async/await babel transforms example test case: node-stable-mjs 1`] = ` -[ - "mjs/index-node-stable-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > babel > transforms example test case: node-stable-mjs > mjs/index-node-stable-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: mjs async function wait() { @@ -1057,14 +938,11 @@ async function run() { } export { run, wait }; //# sourceMappingURL=index-node-stable-mjs.mjs.map -", -] +" `; -exports[`Async/await swc transforms example test case: browser-current-esm 1`] = ` -[ - "esm/index-browser-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > swc > transforms example test case: browser-current-esm > esm/index-browser-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: esm async function wait() { return new Promise((resolve)=>{ @@ -1080,14 +958,11 @@ async function run() { } export { run, wait }; //# sourceMappingURL=index-browser-current-esm.js.map -", -] +" `; -exports[`Async/await swc transforms example test case: browser-current-lib 1`] = ` -[ - "lib/index-browser-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > swc > transforms example test case: browser-current-lib > lib/index-browser-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: lib "use strict"; async function wait() { @@ -1105,14 +980,11 @@ async function run() { exports.run = run; exports.wait = wait; //# sourceMappingURL=index-browser-current-lib.js.map -", -] +" `; -exports[`Async/await swc transforms example test case: browser-current-umd 1`] = ` -[ - "umd/index-browser-current-umd.js", - "(function(global, factory) { +exports[`Async/await > swc > transforms example test case: browser-current-umd > umd/index-browser-current-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports); else if (typeof define === "function" && define.amd) define([ "exports" @@ -1151,14 +1023,11 @@ exports[`Async/await swc transforms example test case: browser-current-umd 1`] = } }); //# sourceMappingURL=index-browser-current-umd.js.map -", -] +" `; -exports[`Async/await swc transforms example test case: browser-experimental-esm 1`] = ` -[ - "esm/index-browser-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > swc > transforms example test case: browser-experimental-esm > esm/index-browser-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: esm async function wait() { return new Promise((resolve)=>{ @@ -1174,14 +1043,11 @@ async function run() { } export { run, wait }; //# sourceMappingURL=index-browser-experimental-esm.js.map -", -] +" `; -exports[`Async/await swc transforms example test case: browser-experimental-lib 1`] = ` -[ - "lib/index-browser-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > swc > transforms example test case: browser-experimental-lib > lib/index-browser-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: lib "use strict"; async function wait() { @@ -1199,14 +1065,11 @@ async function run() { exports.run = run; exports.wait = wait; //# sourceMappingURL=index-browser-experimental-lib.js.map -", -] +" `; -exports[`Async/await swc transforms example test case: browser-experimental-umd 1`] = ` -[ - "umd/index-browser-experimental-umd.js", - "(function(global, factory) { +exports[`Async/await > swc > transforms example test case: browser-experimental-umd > umd/index-browser-experimental-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports); else if (typeof define === "function" && define.amd) define([ "exports" @@ -1245,14 +1108,11 @@ exports[`Async/await swc transforms example test case: browser-experimental-umd } }); //# sourceMappingURL=index-browser-experimental-umd.js.map -", -] +" `; -exports[`Async/await swc transforms example test case: browser-legacy-esm 1`] = ` -[ - "esm/index-browser-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > swc > transforms example test case: browser-legacy-esm > esm/index-browser-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: esm function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { @@ -1433,14 +1293,11 @@ function _run() { } export { run, wait }; //# sourceMappingURL=index-browser-legacy-esm.js.map -", -] +" `; -exports[`Async/await swc transforms example test case: browser-legacy-lib 1`] = ` -[ - "lib/index-browser-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > swc > transforms example test case: browser-legacy-lib > lib/index-browser-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: lib "use strict"; function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { @@ -1623,14 +1480,11 @@ function _run() { exports.run = run; exports.wait = wait; //# sourceMappingURL=index-browser-legacy-lib.js.map -", -] +" `; -exports[`Async/await swc transforms example test case: browser-legacy-umd 1`] = ` -[ - "umd/index-browser-legacy-umd.js", - "(function(global, factory) { +exports[`Async/await > swc > transforms example test case: browser-legacy-umd > umd/index-browser-legacy-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports); else if (typeof define === "function" && define.amd) define([ "exports" @@ -1834,14 +1688,11 @@ exports[`Async/await swc transforms example test case: browser-legacy-umd 1`] = } }); //# sourceMappingURL=index-browser-legacy-umd.js.map -", -] +" `; -exports[`Async/await swc transforms example test case: browser-stable-esm 1`] = ` -[ - "esm/index-browser-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > swc > transforms example test case: browser-stable-esm > esm/index-browser-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: esm async function wait() { return new Promise((resolve)=>{ @@ -1857,14 +1708,11 @@ async function run() { } export { run, wait }; //# sourceMappingURL=index-browser-stable-esm.js.map -", -] +" `; -exports[`Async/await swc transforms example test case: browser-stable-lib 1`] = ` -[ - "lib/index-browser-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > swc > transforms example test case: browser-stable-lib > lib/index-browser-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: lib "use strict"; async function wait() { @@ -1882,14 +1730,11 @@ async function run() { exports.run = run; exports.wait = wait; //# sourceMappingURL=index-browser-stable-lib.js.map -", -] +" `; -exports[`Async/await swc transforms example test case: browser-stable-umd 1`] = ` -[ - "umd/index-browser-stable-umd.js", - "(function(global, factory) { +exports[`Async/await > swc > transforms example test case: browser-stable-umd > umd/index-browser-stable-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports); else if (typeof define === "function" && define.amd) define([ "exports" @@ -1928,14 +1773,11 @@ exports[`Async/await swc transforms example test case: browser-stable-umd 1`] = } }); //# sourceMappingURL=index-browser-stable-umd.js.map -", -] +" `; -exports[`Async/await swc transforms example test case: electron-current-esm 1`] = ` -[ - "esm/index-electron-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > swc > transforms example test case: electron-current-esm > esm/index-electron-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: esm async function wait() { return new Promise((resolve)=>{ @@ -1951,14 +1793,11 @@ async function run() { } export { run, wait }; //# sourceMappingURL=index-electron-current-esm.js.map -", -] +" `; -exports[`Async/await swc transforms example test case: electron-current-lib 1`] = ` -[ - "lib/index-electron-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > swc > transforms example test case: electron-current-lib > lib/index-electron-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: lib "use strict"; async function wait() { @@ -1976,14 +1815,11 @@ async function run() { exports.run = run; exports.wait = wait; //# sourceMappingURL=index-electron-current-lib.js.map -", -] +" `; -exports[`Async/await swc transforms example test case: electron-experimental-esm 1`] = ` -[ - "esm/index-electron-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > swc > transforms example test case: electron-experimental-esm > esm/index-electron-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: esm async function wait() { return new Promise((resolve)=>{ @@ -1999,14 +1835,11 @@ async function run() { } export { run, wait }; //# sourceMappingURL=index-electron-experimental-esm.js.map -", -] +" `; -exports[`Async/await swc transforms example test case: electron-experimental-lib 1`] = ` -[ - "lib/index-electron-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > swc > transforms example test case: electron-experimental-lib > lib/index-electron-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: lib "use strict"; async function wait() { @@ -2024,14 +1857,11 @@ async function run() { exports.run = run; exports.wait = wait; //# sourceMappingURL=index-electron-experimental-lib.js.map -", -] +" `; -exports[`Async/await swc transforms example test case: electron-legacy-esm 1`] = ` -[ - "esm/index-electron-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > swc > transforms example test case: electron-legacy-esm > esm/index-electron-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: esm async function wait() { return new Promise((resolve)=>{ @@ -2047,14 +1877,11 @@ async function run() { } export { run, wait }; //# sourceMappingURL=index-electron-legacy-esm.js.map -", -] +" `; -exports[`Async/await swc transforms example test case: electron-legacy-lib 1`] = ` -[ - "lib/index-electron-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > swc > transforms example test case: electron-legacy-lib > lib/index-electron-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: lib "use strict"; async function wait() { @@ -2072,14 +1899,11 @@ async function run() { exports.run = run; exports.wait = wait; //# sourceMappingURL=index-electron-legacy-lib.js.map -", -] +" `; -exports[`Async/await swc transforms example test case: electron-stable-esm 1`] = ` -[ - "esm/index-electron-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > swc > transforms example test case: electron-stable-esm > esm/index-electron-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: esm async function wait() { return new Promise((resolve)=>{ @@ -2095,14 +1919,11 @@ async function run() { } export { run, wait }; //# sourceMappingURL=index-electron-stable-esm.js.map -", -] +" `; -exports[`Async/await swc transforms example test case: electron-stable-lib 1`] = ` -[ - "lib/index-electron-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > swc > transforms example test case: electron-stable-lib > lib/index-electron-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: lib "use strict"; async function wait() { @@ -2120,14 +1941,11 @@ async function run() { exports.run = run; exports.wait = wait; //# sourceMappingURL=index-electron-stable-lib.js.map -", -] +" `; -exports[`Async/await swc transforms example test case: native-current-lib 1`] = ` -[ - "lib/index-native-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > swc > transforms example test case: native-current-lib > lib/index-native-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: current, Format: lib "use strict"; async function wait() { @@ -2145,14 +1963,11 @@ async function run() { exports.run = run; exports.wait = wait; //# sourceMappingURL=index-native-current-lib.js.map -", -] +" `; -exports[`Async/await swc transforms example test case: native-experimental-lib 1`] = ` -[ - "lib/index-native-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > swc > transforms example test case: native-experimental-lib > lib/index-native-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: experimental, Format: lib "use strict"; async function wait() { @@ -2170,14 +1985,11 @@ async function run() { exports.run = run; exports.wait = wait; //# sourceMappingURL=index-native-experimental-lib.js.map -", -] +" `; -exports[`Async/await swc transforms example test case: native-legacy-lib 1`] = ` -[ - "lib/index-native-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > swc > transforms example test case: native-legacy-lib > lib/index-native-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: legacy, Format: lib "use strict"; async function wait() { @@ -2195,14 +2007,11 @@ async function run() { exports.run = run; exports.wait = wait; //# sourceMappingURL=index-native-legacy-lib.js.map -", -] +" `; -exports[`Async/await swc transforms example test case: native-stable-lib 1`] = ` -[ - "lib/index-native-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > swc > transforms example test case: native-stable-lib > lib/index-native-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: stable, Format: lib "use strict"; async function wait() { @@ -2220,26 +2029,11 @@ async function run() { exports.run = run; exports.wait = wait; //# sourceMappingURL=index-native-stable-lib.js.map -", -] +" `; -exports[`Async/await swc transforms example test case: node-current-cjs 1`] = ` -[ - "cjs/index-node-current-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-current-cjs.cjs'; - -export const { run, wait } = data;", -] -`; - -exports[`Async/await swc transforms example test case: node-current-cjs 2`] = ` -[ - "cjs/index-node-current-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > swc > transforms example test case: node-current-cjs > cjs/index-node-current-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: cjs "use strict"; async function wait() { @@ -2257,14 +2051,20 @@ async function run() { exports.run = run; exports.wait = wait; //# sourceMappingURL=index-node-current-cjs.cjs.map -", -] +" +`; + +exports[`Async/await > swc > transforms example test case: node-current-cjs > cjs/index-node-current-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-current-cjs.cjs'; + +export const { run, wait } = data;" `; -exports[`Async/await swc transforms example test case: node-current-lib 1`] = ` -[ - "lib/index-node-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > swc > transforms example test case: node-current-lib > lib/index-node-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: lib "use strict"; async function wait() { @@ -2282,14 +2082,11 @@ async function run() { exports.run = run; exports.wait = wait; //# sourceMappingURL=index-node-current-lib.js.map -", -] +" `; -exports[`Async/await swc transforms example test case: node-current-mjs 1`] = ` -[ - "mjs/index-node-current-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > swc > transforms example test case: node-current-mjs > mjs/index-node-current-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: mjs async function wait() { return new Promise((resolve)=>{ @@ -2305,26 +2102,11 @@ async function run() { } export { run, wait }; //# sourceMappingURL=index-node-current-mjs.mjs.map -", -] +" `; -exports[`Async/await swc transforms example test case: node-experimental-cjs 1`] = ` -[ - "cjs/index-node-experimental-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-experimental-cjs.cjs'; - -export const { run, wait } = data;", -] -`; - -exports[`Async/await swc transforms example test case: node-experimental-cjs 2`] = ` -[ - "cjs/index-node-experimental-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > swc > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: cjs "use strict"; async function wait() { @@ -2342,14 +2124,20 @@ async function run() { exports.run = run; exports.wait = wait; //# sourceMappingURL=index-node-experimental-cjs.cjs.map -", -] +" +`; + +exports[`Async/await > swc > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-experimental-cjs.cjs'; + +export const { run, wait } = data;" `; -exports[`Async/await swc transforms example test case: node-experimental-lib 1`] = ` -[ - "lib/index-node-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > swc > transforms example test case: node-experimental-lib > lib/index-node-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: lib "use strict"; async function wait() { @@ -2367,14 +2155,11 @@ async function run() { exports.run = run; exports.wait = wait; //# sourceMappingURL=index-node-experimental-lib.js.map -", -] +" `; -exports[`Async/await swc transforms example test case: node-experimental-mjs 1`] = ` -[ - "mjs/index-node-experimental-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > swc > transforms example test case: node-experimental-mjs > mjs/index-node-experimental-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: mjs async function wait() { return new Promise((resolve)=>{ @@ -2390,26 +2175,11 @@ async function run() { } export { run, wait }; //# sourceMappingURL=index-node-experimental-mjs.mjs.map -", -] +" `; -exports[`Async/await swc transforms example test case: node-legacy-cjs 1`] = ` -[ - "cjs/index-node-legacy-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-legacy-cjs.cjs'; - -export const { run, wait } = data;", -] -`; - -exports[`Async/await swc transforms example test case: node-legacy-cjs 2`] = ` -[ - "cjs/index-node-legacy-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > swc > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: cjs "use strict"; async function wait() { @@ -2427,14 +2197,20 @@ async function run() { exports.run = run; exports.wait = wait; //# sourceMappingURL=index-node-legacy-cjs.cjs.map -", -] +" +`; + +exports[`Async/await > swc > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-legacy-cjs.cjs'; + +export const { run, wait } = data;" `; -exports[`Async/await swc transforms example test case: node-legacy-lib 1`] = ` -[ - "lib/index-node-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > swc > transforms example test case: node-legacy-lib > lib/index-node-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: lib "use strict"; async function wait() { @@ -2452,14 +2228,11 @@ async function run() { exports.run = run; exports.wait = wait; //# sourceMappingURL=index-node-legacy-lib.js.map -", -] +" `; -exports[`Async/await swc transforms example test case: node-legacy-mjs 1`] = ` -[ - "mjs/index-node-legacy-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > swc > transforms example test case: node-legacy-mjs > mjs/index-node-legacy-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: mjs async function wait() { return new Promise((resolve)=>{ @@ -2475,26 +2248,11 @@ async function run() { } export { run, wait }; //# sourceMappingURL=index-node-legacy-mjs.mjs.map -", -] +" `; -exports[`Async/await swc transforms example test case: node-stable-cjs 1`] = ` -[ - "cjs/index-node-stable-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-stable-cjs.cjs'; - -export const { run, wait } = data;", -] -`; - -exports[`Async/await swc transforms example test case: node-stable-cjs 2`] = ` -[ - "cjs/index-node-stable-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > swc > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: cjs "use strict"; async function wait() { @@ -2512,14 +2270,20 @@ async function run() { exports.run = run; exports.wait = wait; //# sourceMappingURL=index-node-stable-cjs.cjs.map -", -] +" +`; + +exports[`Async/await > swc > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-stable-cjs.cjs'; + +export const { run, wait } = data;" `; -exports[`Async/await swc transforms example test case: node-stable-lib 1`] = ` -[ - "lib/index-node-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > swc > transforms example test case: node-stable-lib > lib/index-node-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: lib "use strict"; async function wait() { @@ -2537,14 +2301,11 @@ async function run() { exports.run = run; exports.wait = wait; //# sourceMappingURL=index-node-stable-lib.js.map -", -] +" `; -exports[`Async/await swc transforms example test case: node-stable-mjs 1`] = ` -[ - "mjs/index-node-stable-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Async/await > swc > transforms example test case: node-stable-mjs > mjs/index-node-stable-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: mjs async function wait() { return new Promise((resolve)=>{ @@ -2560,6 +2321,5 @@ async function run() { } export { run, wait }; //# sourceMappingURL=index-node-stable-mjs.mjs.map -", -] +" `; diff --git a/packages/packemon/tests/examples/__snapshots__/cjsEsmInterop.test.ts.snap b/packages/packemon/tests/examples/__snapshots__/cjsEsmInterop.test.ts.snap index f4d4ddbce..e6cf7d3af 100644 --- a/packages/packemon/tests/examples/__snapshots__/cjsEsmInterop.test.ts.snap +++ b/packages/packemon/tests/examples/__snapshots__/cjsEsmInterop.test.ts.snap @@ -1,22 +1,17 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`CJS/ESM interop babel transforms example test case: browser-current-esm 1`] = ` -[ - "esm/index-browser-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS/ESM interop > babel > transforms example test case: browser-current-esm > esm/index-browser-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: esm __dirname; __filename; //# sourceMappingURL=index-browser-current-esm.js.map -", -] +" `; -exports[`CJS/ESM interop babel transforms example test case: browser-current-lib 1`] = ` -[ - "lib/index-browser-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS/ESM interop > babel > transforms example test case: browser-current-lib > lib/index-browser-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: lib 'use strict'; @@ -24,40 +19,31 @@ exports[`CJS/ESM interop babel transforms example test case: browser-current-lib __dirname; __filename; //# sourceMappingURL=index-browser-current-lib.js.map -", -] +" `; -exports[`CJS/ESM interop babel transforms example test case: browser-current-umd 1`] = ` -[ - "umd/index-browser-current-umd.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS/ESM interop > babel > transforms example test case: browser-current-umd > umd/index-browser-current-umd.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: umd __dirname; __filename; //# sourceMappingURL=index-browser-current-umd.js.map -", -] +" `; -exports[`CJS/ESM interop babel transforms example test case: browser-experimental-esm 1`] = ` -[ - "esm/index-browser-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS/ESM interop > babel > transforms example test case: browser-experimental-esm > esm/index-browser-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: esm __dirname; __filename; //# sourceMappingURL=index-browser-experimental-esm.js.map -", -] +" `; -exports[`CJS/ESM interop babel transforms example test case: browser-experimental-lib 1`] = ` -[ - "lib/index-browser-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS/ESM interop > babel > transforms example test case: browser-experimental-lib > lib/index-browser-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: lib 'use strict'; @@ -65,40 +51,31 @@ exports[`CJS/ESM interop babel transforms example test case: browser-experimenta __dirname; __filename; //# sourceMappingURL=index-browser-experimental-lib.js.map -", -] +" `; -exports[`CJS/ESM interop babel transforms example test case: browser-experimental-umd 1`] = ` -[ - "umd/index-browser-experimental-umd.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS/ESM interop > babel > transforms example test case: browser-experimental-umd > umd/index-browser-experimental-umd.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: umd __dirname; __filename; //# sourceMappingURL=index-browser-experimental-umd.js.map -", -] +" `; -exports[`CJS/ESM interop babel transforms example test case: browser-legacy-esm 1`] = ` -[ - "esm/index-browser-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS/ESM interop > babel > transforms example test case: browser-legacy-esm > esm/index-browser-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: esm __dirname; __filename; //# sourceMappingURL=index-browser-legacy-esm.js.map -", -] +" `; -exports[`CJS/ESM interop babel transforms example test case: browser-legacy-lib 1`] = ` -[ - "lib/index-browser-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS/ESM interop > babel > transforms example test case: browser-legacy-lib > lib/index-browser-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: lib 'use strict'; @@ -106,40 +83,31 @@ exports[`CJS/ESM interop babel transforms example test case: browser-legacy-lib __dirname; __filename; //# sourceMappingURL=index-browser-legacy-lib.js.map -", -] +" `; -exports[`CJS/ESM interop babel transforms example test case: browser-legacy-umd 1`] = ` -[ - "umd/index-browser-legacy-umd.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS/ESM interop > babel > transforms example test case: browser-legacy-umd > umd/index-browser-legacy-umd.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: umd __dirname; __filename; //# sourceMappingURL=index-browser-legacy-umd.js.map -", -] +" `; -exports[`CJS/ESM interop babel transforms example test case: browser-stable-esm 1`] = ` -[ - "esm/index-browser-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS/ESM interop > babel > transforms example test case: browser-stable-esm > esm/index-browser-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: esm __dirname; __filename; //# sourceMappingURL=index-browser-stable-esm.js.map -", -] +" `; -exports[`CJS/ESM interop babel transforms example test case: browser-stable-lib 1`] = ` -[ - "lib/index-browser-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS/ESM interop > babel > transforms example test case: browser-stable-lib > lib/index-browser-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: lib 'use strict'; @@ -147,40 +115,31 @@ exports[`CJS/ESM interop babel transforms example test case: browser-stable-lib __dirname; __filename; //# sourceMappingURL=index-browser-stable-lib.js.map -", -] +" `; -exports[`CJS/ESM interop babel transforms example test case: browser-stable-umd 1`] = ` -[ - "umd/index-browser-stable-umd.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS/ESM interop > babel > transforms example test case: browser-stable-umd > umd/index-browser-stable-umd.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: umd __dirname; __filename; //# sourceMappingURL=index-browser-stable-umd.js.map -", -] +" `; -exports[`CJS/ESM interop babel transforms example test case: electron-current-esm 1`] = ` -[ - "esm/index-electron-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS/ESM interop > babel > transforms example test case: electron-current-esm > esm/index-electron-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: esm __dirname; __filename; //# sourceMappingURL=index-electron-current-esm.js.map -", -] +" `; -exports[`CJS/ESM interop babel transforms example test case: electron-current-lib 1`] = ` -[ - "lib/index-electron-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS/ESM interop > babel > transforms example test case: electron-current-lib > lib/index-electron-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: lib 'use strict'; @@ -188,27 +147,21 @@ exports[`CJS/ESM interop babel transforms example test case: electron-current-li __dirname; __filename; //# sourceMappingURL=index-electron-current-lib.js.map -", -] +" `; -exports[`CJS/ESM interop babel transforms example test case: electron-experimental-esm 1`] = ` -[ - "esm/index-electron-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS/ESM interop > babel > transforms example test case: electron-experimental-esm > esm/index-electron-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: esm __dirname; __filename; //# sourceMappingURL=index-electron-experimental-esm.js.map -", -] +" `; -exports[`CJS/ESM interop babel transforms example test case: electron-experimental-lib 1`] = ` -[ - "lib/index-electron-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS/ESM interop > babel > transforms example test case: electron-experimental-lib > lib/index-electron-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: lib 'use strict'; @@ -216,27 +169,21 @@ exports[`CJS/ESM interop babel transforms example test case: electron-experiment __dirname; __filename; //# sourceMappingURL=index-electron-experimental-lib.js.map -", -] +" `; -exports[`CJS/ESM interop babel transforms example test case: electron-legacy-esm 1`] = ` -[ - "esm/index-electron-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS/ESM interop > babel > transforms example test case: electron-legacy-esm > esm/index-electron-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: esm __dirname; __filename; //# sourceMappingURL=index-electron-legacy-esm.js.map -", -] +" `; -exports[`CJS/ESM interop babel transforms example test case: electron-legacy-lib 1`] = ` -[ - "lib/index-electron-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS/ESM interop > babel > transforms example test case: electron-legacy-lib > lib/index-electron-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: lib 'use strict'; @@ -244,27 +191,21 @@ exports[`CJS/ESM interop babel transforms example test case: electron-legacy-lib __dirname; __filename; //# sourceMappingURL=index-electron-legacy-lib.js.map -", -] +" `; -exports[`CJS/ESM interop babel transforms example test case: electron-stable-esm 1`] = ` -[ - "esm/index-electron-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS/ESM interop > babel > transforms example test case: electron-stable-esm > esm/index-electron-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: esm __dirname; __filename; //# sourceMappingURL=index-electron-stable-esm.js.map -", -] +" `; -exports[`CJS/ESM interop babel transforms example test case: electron-stable-lib 1`] = ` -[ - "lib/index-electron-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS/ESM interop > babel > transforms example test case: electron-stable-lib > lib/index-electron-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: lib 'use strict'; @@ -272,14 +213,11 @@ exports[`CJS/ESM interop babel transforms example test case: electron-stable-lib __dirname; __filename; //# sourceMappingURL=index-electron-stable-lib.js.map -", -] +" `; -exports[`CJS/ESM interop babel transforms example test case: native-current-lib 1`] = ` -[ - "lib/index-native-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS/ESM interop > babel > transforms example test case: native-current-lib > lib/index-native-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: current, Format: lib 'use strict'; @@ -287,14 +225,11 @@ exports[`CJS/ESM interop babel transforms example test case: native-current-lib __dirname; __filename; //# sourceMappingURL=index-native-current-lib.js.map -", -] +" `; -exports[`CJS/ESM interop babel transforms example test case: native-experimental-lib 1`] = ` -[ - "lib/index-native-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS/ESM interop > babel > transforms example test case: native-experimental-lib > lib/index-native-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: experimental, Format: lib 'use strict'; @@ -302,14 +237,11 @@ exports[`CJS/ESM interop babel transforms example test case: native-experimental __dirname; __filename; //# sourceMappingURL=index-native-experimental-lib.js.map -", -] +" `; -exports[`CJS/ESM interop babel transforms example test case: native-legacy-lib 1`] = ` -[ - "lib/index-native-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS/ESM interop > babel > transforms example test case: native-legacy-lib > lib/index-native-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: legacy, Format: lib 'use strict'; @@ -317,14 +249,11 @@ exports[`CJS/ESM interop babel transforms example test case: native-legacy-lib 1 __dirname; __filename; //# sourceMappingURL=index-native-legacy-lib.js.map -", -] +" `; -exports[`CJS/ESM interop babel transforms example test case: native-stable-lib 1`] = ` -[ - "lib/index-native-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS/ESM interop > babel > transforms example test case: native-stable-lib > lib/index-native-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: stable, Format: lib 'use strict'; @@ -332,24 +261,11 @@ exports[`CJS/ESM interop babel transforms example test case: native-stable-lib 1 __dirname; __filename; //# sourceMappingURL=index-native-stable-lib.js.map -", -] +" `; -exports[`CJS/ESM interop babel transforms example test case: node-current-cjs 1`] = ` -[ - "cjs/index-node-current-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import './index-node-current-cjs.cjs';", -] -`; - -exports[`CJS/ESM interop babel transforms example test case: node-current-cjs 2`] = ` -[ - "cjs/index-node-current-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS/ESM interop > babel > transforms example test case: node-current-cjs > cjs/index-node-current-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: cjs 'use strict'; @@ -357,14 +273,18 @@ exports[`CJS/ESM interop babel transforms example test case: node-current-cjs 2` __dirname; __filename; //# sourceMappingURL=index-node-current-cjs.cjs.map -", -] +" +`; + +exports[`CJS/ESM interop > babel > transforms example test case: node-current-cjs > cjs/index-node-current-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-current-cjs.cjs';" `; -exports[`CJS/ESM interop babel transforms example test case: node-current-lib 1`] = ` -[ - "lib/index-node-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS/ESM interop > babel > transforms example test case: node-current-lib > lib/index-node-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: lib 'use strict'; @@ -372,14 +292,11 @@ exports[`CJS/ESM interop babel transforms example test case: node-current-lib 1` __dirname; __filename; //# sourceMappingURL=index-node-current-lib.js.map -", -] +" `; -exports[`CJS/ESM interop babel transforms example test case: node-current-mjs 1`] = ` -[ - "mjs/index-node-current-mjs.mjs", - "var _path = _interopRequireDefault(require("path")).default; +exports[`CJS/ESM interop > babel > transforms example test case: node-current-mjs > mjs/index-node-current-mjs.mjs 1`] = ` +"var _path = _interopRequireDefault(require("path")).default; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: mjs @@ -387,24 +304,11 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de _path.dirname(import.meta.url); import.meta.url; //# sourceMappingURL=index-node-current-mjs.mjs.map -", -] +" `; -exports[`CJS/ESM interop babel transforms example test case: node-experimental-cjs 1`] = ` -[ - "cjs/index-node-experimental-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import './index-node-experimental-cjs.cjs';", -] -`; - -exports[`CJS/ESM interop babel transforms example test case: node-experimental-cjs 2`] = ` -[ - "cjs/index-node-experimental-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS/ESM interop > babel > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: cjs 'use strict'; @@ -412,14 +316,18 @@ exports[`CJS/ESM interop babel transforms example test case: node-experimental-c __dirname; __filename; //# sourceMappingURL=index-node-experimental-cjs.cjs.map -", -] +" +`; + +exports[`CJS/ESM interop > babel > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-experimental-cjs.cjs';" `; -exports[`CJS/ESM interop babel transforms example test case: node-experimental-lib 1`] = ` -[ - "lib/index-node-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS/ESM interop > babel > transforms example test case: node-experimental-lib > lib/index-node-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: lib 'use strict'; @@ -427,14 +335,11 @@ exports[`CJS/ESM interop babel transforms example test case: node-experimental-l __dirname; __filename; //# sourceMappingURL=index-node-experimental-lib.js.map -", -] +" `; -exports[`CJS/ESM interop babel transforms example test case: node-experimental-mjs 1`] = ` -[ - "mjs/index-node-experimental-mjs.mjs", - "var _path = _interopRequireDefault(require("path")).default; +exports[`CJS/ESM interop > babel > transforms example test case: node-experimental-mjs > mjs/index-node-experimental-mjs.mjs 1`] = ` +"var _path = _interopRequireDefault(require("path")).default; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: mjs @@ -442,24 +347,11 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de _path.dirname(import.meta.url); import.meta.url; //# sourceMappingURL=index-node-experimental-mjs.mjs.map -", -] +" `; -exports[`CJS/ESM interop babel transforms example test case: node-legacy-cjs 1`] = ` -[ - "cjs/index-node-legacy-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import './index-node-legacy-cjs.cjs';", -] -`; - -exports[`CJS/ESM interop babel transforms example test case: node-legacy-cjs 2`] = ` -[ - "cjs/index-node-legacy-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS/ESM interop > babel > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: cjs 'use strict'; @@ -467,14 +359,18 @@ exports[`CJS/ESM interop babel transforms example test case: node-legacy-cjs 2`] __dirname; __filename; //# sourceMappingURL=index-node-legacy-cjs.cjs.map -", -] +" +`; + +exports[`CJS/ESM interop > babel > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-legacy-cjs.cjs';" `; -exports[`CJS/ESM interop babel transforms example test case: node-legacy-lib 1`] = ` -[ - "lib/index-node-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS/ESM interop > babel > transforms example test case: node-legacy-lib > lib/index-node-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: lib 'use strict'; @@ -482,14 +378,11 @@ exports[`CJS/ESM interop babel transforms example test case: node-legacy-lib 1`] __dirname; __filename; //# sourceMappingURL=index-node-legacy-lib.js.map -", -] +" `; -exports[`CJS/ESM interop babel transforms example test case: node-legacy-mjs 1`] = ` -[ - "mjs/index-node-legacy-mjs.mjs", - "var _path = _interopRequireDefault(require("path")).default; +exports[`CJS/ESM interop > babel > transforms example test case: node-legacy-mjs > mjs/index-node-legacy-mjs.mjs 1`] = ` +"var _path = _interopRequireDefault(require("path")).default; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: mjs @@ -497,24 +390,11 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de _path.dirname(import.meta.url); import.meta.url; //# sourceMappingURL=index-node-legacy-mjs.mjs.map -", -] +" `; -exports[`CJS/ESM interop babel transforms example test case: node-stable-cjs 1`] = ` -[ - "cjs/index-node-stable-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import './index-node-stable-cjs.cjs';", -] -`; - -exports[`CJS/ESM interop babel transforms example test case: node-stable-cjs 2`] = ` -[ - "cjs/index-node-stable-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS/ESM interop > babel > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: cjs 'use strict'; @@ -522,14 +402,18 @@ exports[`CJS/ESM interop babel transforms example test case: node-stable-cjs 2`] __dirname; __filename; //# sourceMappingURL=index-node-stable-cjs.cjs.map -", -] +" +`; + +exports[`CJS/ESM interop > babel > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-stable-cjs.cjs';" `; -exports[`CJS/ESM interop babel transforms example test case: node-stable-lib 1`] = ` -[ - "lib/index-node-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS/ESM interop > babel > transforms example test case: node-stable-lib > lib/index-node-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: lib 'use strict'; @@ -537,14 +421,11 @@ exports[`CJS/ESM interop babel transforms example test case: node-stable-lib 1`] __dirname; __filename; //# sourceMappingURL=index-node-stable-lib.js.map -", -] +" `; -exports[`CJS/ESM interop babel transforms example test case: node-stable-mjs 1`] = ` -[ - "mjs/index-node-stable-mjs.mjs", - "var _path = _interopRequireDefault(require("path")).default; +exports[`CJS/ESM interop > babel > transforms example test case: node-stable-mjs > mjs/index-node-stable-mjs.mjs 1`] = ` +"var _path = _interopRequireDefault(require("path")).default; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: mjs @@ -552,6 +433,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de _path.dirname(import.meta.url); import.meta.url; //# sourceMappingURL=index-node-stable-mjs.mjs.map -", -] +" `; diff --git a/packages/packemon/tests/examples/__snapshots__/cjsMjsWrapper.test.ts.snap b/packages/packemon/tests/examples/__snapshots__/cjsMjsWrapper.test.ts.snap index 419036752..77285aa5d 100644 --- a/packages/packemon/tests/examples/__snapshots__/cjsMjsWrapper.test.ts.snap +++ b/packages/packemon/tests/examples/__snapshots__/cjsMjsWrapper.test.ts.snap @@ -1,9 +1,7 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`CJS -> MJS wrapper (externals) babel transforms example test case: browser-current-esm 1`] = ` -[ - "esm/index-browser-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > babel > transforms example test case: browser-current-esm > esm/index-browser-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: esm export * from 'optimal'; @@ -12,14 +10,11 @@ export { optimal }; export { func, string } from 'optimal'; export { useState } from 'react'; //# sourceMappingURL=index-browser-current-esm.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) babel transforms example test case: browser-current-lib 1`] = ` -[ - "lib/index-browser-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > babel > transforms example test case: browser-current-lib > lib/index-browser-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: lib 'use strict'; @@ -64,14 +59,11 @@ Object.keys(optimal).forEach(k => { }); }); //# sourceMappingURL=index-browser-current-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) babel transforms example test case: browser-current-umd 1`] = ` -[ - "umd/index-browser-current-umd.js", - "(function (global, factory) { +exports[`CJS -> MJS wrapper (externals) > babel > transforms example test case: browser-current-umd > umd/index-browser-current-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports", "optimal", "react"], factory); } else if (typeof exports !== "undefined") { @@ -131,14 +123,11 @@ exports[`CJS -> MJS wrapper (externals) babel transforms example test case: brow function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } }); //# sourceMappingURL=index-browser-current-umd.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) babel transforms example test case: browser-experimental-esm 1`] = ` -[ - "esm/index-browser-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > babel > transforms example test case: browser-experimental-esm > esm/index-browser-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: esm export * from 'optimal'; @@ -147,14 +136,11 @@ export { optimal }; export { func, string } from 'optimal'; export { useState } from 'react'; //# sourceMappingURL=index-browser-experimental-esm.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) babel transforms example test case: browser-experimental-lib 1`] = ` -[ - "lib/index-browser-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > babel > transforms example test case: browser-experimental-lib > lib/index-browser-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: lib 'use strict'; @@ -199,14 +185,11 @@ Object.keys(optimal).forEach(k => { }); }); //# sourceMappingURL=index-browser-experimental-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) babel transforms example test case: browser-experimental-umd 1`] = ` -[ - "umd/index-browser-experimental-umd.js", - "(function (global, factory) { +exports[`CJS -> MJS wrapper (externals) > babel > transforms example test case: browser-experimental-umd > umd/index-browser-experimental-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports", "optimal", "react"], factory); } else if (typeof exports !== "undefined") { @@ -266,14 +249,11 @@ exports[`CJS -> MJS wrapper (externals) babel transforms example test case: brow function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } }); //# sourceMappingURL=index-browser-experimental-umd.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) babel transforms example test case: browser-legacy-esm 1`] = ` -[ - "esm/index-browser-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > babel > transforms example test case: browser-legacy-esm > esm/index-browser-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: esm export * from 'optimal'; @@ -282,14 +262,11 @@ export { optimal }; export { func, string } from 'optimal'; export { useState } from 'react'; //# sourceMappingURL=index-browser-legacy-esm.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) babel transforms example test case: browser-legacy-lib 1`] = ` -[ - "lib/index-browser-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > babel > transforms example test case: browser-legacy-lib > lib/index-browser-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: lib 'use strict'; @@ -357,14 +334,11 @@ Object.keys(optimal).forEach(function (k) { }); }.bind(this)); //# sourceMappingURL=index-browser-legacy-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) babel transforms example test case: browser-legacy-umd 1`] = ` -[ - "umd/index-browser-legacy-umd.js", - "(function (global, factory) { +exports[`CJS -> MJS wrapper (externals) > babel > transforms example test case: browser-legacy-umd > umd/index-browser-legacy-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports", "optimal", "react"], factory); } else if (typeof exports !== "undefined") { @@ -424,14 +398,11 @@ exports[`CJS -> MJS wrapper (externals) babel transforms example test case: brow function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } }); //# sourceMappingURL=index-browser-legacy-umd.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) babel transforms example test case: browser-stable-esm 1`] = ` -[ - "esm/index-browser-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > babel > transforms example test case: browser-stable-esm > esm/index-browser-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: esm export * from 'optimal'; @@ -440,14 +411,11 @@ export { optimal }; export { func, string } from 'optimal'; export { useState } from 'react'; //# sourceMappingURL=index-browser-stable-esm.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) babel transforms example test case: browser-stable-lib 1`] = ` -[ - "lib/index-browser-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > babel > transforms example test case: browser-stable-lib > lib/index-browser-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: lib 'use strict'; @@ -492,14 +460,11 @@ Object.keys(optimal).forEach(k => { }); }); //# sourceMappingURL=index-browser-stable-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) babel transforms example test case: browser-stable-umd 1`] = ` -[ - "umd/index-browser-stable-umd.js", - "(function (global, factory) { +exports[`CJS -> MJS wrapper (externals) > babel > transforms example test case: browser-stable-umd > umd/index-browser-stable-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports", "optimal", "react"], factory); } else if (typeof exports !== "undefined") { @@ -559,14 +524,11 @@ exports[`CJS -> MJS wrapper (externals) babel transforms example test case: brow function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } }); //# sourceMappingURL=index-browser-stable-umd.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) babel transforms example test case: electron-current-esm 1`] = ` -[ - "esm/index-electron-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > babel > transforms example test case: electron-current-esm > esm/index-electron-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: esm export * from 'optimal'; @@ -575,14 +537,11 @@ export { optimal }; export { func, string } from 'optimal'; export { useState } from 'react'; //# sourceMappingURL=index-electron-current-esm.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) babel transforms example test case: electron-current-lib 1`] = ` -[ - "lib/index-electron-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > babel > transforms example test case: electron-current-lib > lib/index-electron-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: lib 'use strict'; @@ -627,14 +586,11 @@ Object.keys(optimal).forEach(k => { }); }); //# sourceMappingURL=index-electron-current-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) babel transforms example test case: electron-experimental-esm 1`] = ` -[ - "esm/index-electron-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > babel > transforms example test case: electron-experimental-esm > esm/index-electron-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: esm export * from 'optimal'; @@ -643,14 +599,11 @@ export { optimal }; export { func, string } from 'optimal'; export { useState } from 'react'; //# sourceMappingURL=index-electron-experimental-esm.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) babel transforms example test case: electron-experimental-lib 1`] = ` -[ - "lib/index-electron-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > babel > transforms example test case: electron-experimental-lib > lib/index-electron-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: lib 'use strict'; @@ -695,14 +648,11 @@ Object.keys(optimal).forEach(k => { }); }); //# sourceMappingURL=index-electron-experimental-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) babel transforms example test case: electron-legacy-esm 1`] = ` -[ - "esm/index-electron-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > babel > transforms example test case: electron-legacy-esm > esm/index-electron-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: esm export * from 'optimal'; @@ -711,14 +661,11 @@ export { optimal }; export { func, string } from 'optimal'; export { useState } from 'react'; //# sourceMappingURL=index-electron-legacy-esm.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) babel transforms example test case: electron-legacy-lib 1`] = ` -[ - "lib/index-electron-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > babel > transforms example test case: electron-legacy-lib > lib/index-electron-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: lib 'use strict'; @@ -763,14 +710,11 @@ Object.keys(optimal).forEach(k => { }); }); //# sourceMappingURL=index-electron-legacy-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) babel transforms example test case: electron-stable-esm 1`] = ` -[ - "esm/index-electron-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > babel > transforms example test case: electron-stable-esm > esm/index-electron-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: esm export * from 'optimal'; @@ -779,14 +723,11 @@ export { optimal }; export { func, string } from 'optimal'; export { useState } from 'react'; //# sourceMappingURL=index-electron-stable-esm.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) babel transforms example test case: electron-stable-lib 1`] = ` -[ - "lib/index-electron-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > babel > transforms example test case: electron-stable-lib > lib/index-electron-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: lib 'use strict'; @@ -831,14 +772,11 @@ Object.keys(optimal).forEach(k => { }); }); //# sourceMappingURL=index-electron-stable-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) babel transforms example test case: native-current-lib 1`] = ` -[ - "lib/index-native-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > babel > transforms example test case: native-current-lib > lib/index-native-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: current, Format: lib 'use strict'; @@ -883,14 +821,11 @@ Object.keys(optimal).forEach(k => { }); }); //# sourceMappingURL=index-native-current-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) babel transforms example test case: native-experimental-lib 1`] = ` -[ - "lib/index-native-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > babel > transforms example test case: native-experimental-lib > lib/index-native-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: experimental, Format: lib 'use strict'; @@ -935,14 +870,11 @@ Object.keys(optimal).forEach(k => { }); }); //# sourceMappingURL=index-native-experimental-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) babel transforms example test case: native-legacy-lib 1`] = ` -[ - "lib/index-native-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > babel > transforms example test case: native-legacy-lib > lib/index-native-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: legacy, Format: lib 'use strict'; @@ -987,14 +919,11 @@ Object.keys(optimal).forEach(k => { }); }); //# sourceMappingURL=index-native-legacy-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) babel transforms example test case: native-stable-lib 1`] = ` -[ - "lib/index-native-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > babel > transforms example test case: native-stable-lib > lib/index-native-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: stable, Format: lib 'use strict'; @@ -1039,29 +968,11 @@ Object.keys(optimal).forEach(k => { }); }); //# sourceMappingURL=index-native-stable-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) babel transforms example test case: node-current-cjs 1`] = ` -[ - "cjs/index-node-current-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import './index-node-current-cjs.cjs'; - -export * from 'optimal'; -export * as optimal from 'optimal'; -export { string, func } from 'optimal'; -export { useState } from 'react';", -] -`; - -exports[`CJS -> MJS wrapper (externals) babel transforms example test case: node-current-cjs 2`] = ` -[ - "cjs/index-node-current-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > babel > transforms example test case: node-current-cjs > cjs/index-node-current-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: cjs 'use strict'; @@ -1106,14 +1017,23 @@ Object.keys(optimal).forEach(k => { }); }); //# sourceMappingURL=index-node-current-cjs.cjs.map -", -] +" +`; + +exports[`CJS -> MJS wrapper (externals) > babel > transforms example test case: node-current-cjs > cjs/index-node-current-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-current-cjs.cjs'; + +export * from 'optimal'; +export * as optimal from 'optimal'; +export { string, func } from 'optimal'; +export { useState } from 'react';" `; -exports[`CJS -> MJS wrapper (externals) babel transforms example test case: node-current-lib 1`] = ` -[ - "lib/index-node-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > babel > transforms example test case: node-current-lib > lib/index-node-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: lib 'use strict'; @@ -1158,14 +1078,11 @@ Object.keys(optimal).forEach(k => { }); }); //# sourceMappingURL=index-node-current-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) babel transforms example test case: node-current-mjs 1`] = ` -[ - "mjs/index-node-current-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > babel > transforms example test case: node-current-mjs > mjs/index-node-current-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: mjs export * from 'optimal'; @@ -1174,29 +1091,11 @@ export { optimal }; export { func, string } from 'optimal'; export { useState } from 'react'; //# sourceMappingURL=index-node-current-mjs.mjs.map -", -] -`; - -exports[`CJS -> MJS wrapper (externals) babel transforms example test case: node-experimental-cjs 1`] = ` -[ - "cjs/index-node-experimental-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import './index-node-experimental-cjs.cjs'; - -export * from 'optimal'; -export * as optimal from 'optimal'; -export { string, func } from 'optimal'; -export { useState } from 'react';", -] +" `; -exports[`CJS -> MJS wrapper (externals) babel transforms example test case: node-experimental-cjs 2`] = ` -[ - "cjs/index-node-experimental-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > babel > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: cjs 'use strict'; @@ -1241,14 +1140,23 @@ Object.keys(optimal).forEach(k => { }); }); //# sourceMappingURL=index-node-experimental-cjs.cjs.map -", -] +" +`; + +exports[`CJS -> MJS wrapper (externals) > babel > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-experimental-cjs.cjs'; + +export * from 'optimal'; +export * as optimal from 'optimal'; +export { string, func } from 'optimal'; +export { useState } from 'react';" `; -exports[`CJS -> MJS wrapper (externals) babel transforms example test case: node-experimental-lib 1`] = ` -[ - "lib/index-node-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > babel > transforms example test case: node-experimental-lib > lib/index-node-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: lib 'use strict'; @@ -1293,14 +1201,11 @@ Object.keys(optimal).forEach(k => { }); }); //# sourceMappingURL=index-node-experimental-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) babel transforms example test case: node-experimental-mjs 1`] = ` -[ - "mjs/index-node-experimental-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > babel > transforms example test case: node-experimental-mjs > mjs/index-node-experimental-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: mjs export * from 'optimal'; @@ -1309,29 +1214,11 @@ export { optimal }; export { func, string } from 'optimal'; export { useState } from 'react'; //# sourceMappingURL=index-node-experimental-mjs.mjs.map -", -] -`; - -exports[`CJS -> MJS wrapper (externals) babel transforms example test case: node-legacy-cjs 1`] = ` -[ - "cjs/index-node-legacy-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import './index-node-legacy-cjs.cjs'; - -export * from 'optimal'; -export * as optimal from 'optimal'; -export { string, func } from 'optimal'; -export { useState } from 'react';", -] +" `; -exports[`CJS -> MJS wrapper (externals) babel transforms example test case: node-legacy-cjs 2`] = ` -[ - "cjs/index-node-legacy-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > babel > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: cjs 'use strict'; @@ -1376,14 +1263,23 @@ Object.keys(optimal).forEach(k => { }); }); //# sourceMappingURL=index-node-legacy-cjs.cjs.map -", -] +" +`; + +exports[`CJS -> MJS wrapper (externals) > babel > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-legacy-cjs.cjs'; + +export * from 'optimal'; +export * as optimal from 'optimal'; +export { string, func } from 'optimal'; +export { useState } from 'react';" `; -exports[`CJS -> MJS wrapper (externals) babel transforms example test case: node-legacy-lib 1`] = ` -[ - "lib/index-node-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > babel > transforms example test case: node-legacy-lib > lib/index-node-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: lib 'use strict'; @@ -1428,14 +1324,11 @@ Object.keys(optimal).forEach(k => { }); }); //# sourceMappingURL=index-node-legacy-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) babel transforms example test case: node-legacy-mjs 1`] = ` -[ - "mjs/index-node-legacy-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > babel > transforms example test case: node-legacy-mjs > mjs/index-node-legacy-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: mjs export * from 'optimal'; @@ -1444,29 +1337,11 @@ export { optimal }; export { func, string } from 'optimal'; export { useState } from 'react'; //# sourceMappingURL=index-node-legacy-mjs.mjs.map -", -] -`; - -exports[`CJS -> MJS wrapper (externals) babel transforms example test case: node-stable-cjs 1`] = ` -[ - "cjs/index-node-stable-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import './index-node-stable-cjs.cjs'; - -export * from 'optimal'; -export * as optimal from 'optimal'; -export { string, func } from 'optimal'; -export { useState } from 'react';", -] +" `; -exports[`CJS -> MJS wrapper (externals) babel transforms example test case: node-stable-cjs 2`] = ` -[ - "cjs/index-node-stable-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > babel > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: cjs 'use strict'; @@ -1511,14 +1386,23 @@ Object.keys(optimal).forEach(k => { }); }); //# sourceMappingURL=index-node-stable-cjs.cjs.map -", -] +" +`; + +exports[`CJS -> MJS wrapper (externals) > babel > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-stable-cjs.cjs'; + +export * from 'optimal'; +export * as optimal from 'optimal'; +export { string, func } from 'optimal'; +export { useState } from 'react';" `; -exports[`CJS -> MJS wrapper (externals) babel transforms example test case: node-stable-lib 1`] = ` -[ - "lib/index-node-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > babel > transforms example test case: node-stable-lib > lib/index-node-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: lib 'use strict'; @@ -1563,14 +1447,11 @@ Object.keys(optimal).forEach(k => { }); }); //# sourceMappingURL=index-node-stable-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) babel transforms example test case: node-stable-mjs 1`] = ` -[ - "mjs/index-node-stable-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > babel > transforms example test case: node-stable-mjs > mjs/index-node-stable-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: mjs export * from 'optimal'; @@ -1579,14 +1460,11 @@ export { optimal }; export { func, string } from 'optimal'; export { useState } from 'react'; //# sourceMappingURL=index-node-stable-mjs.mjs.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) swc transforms example test case: browser-current-esm 1`] = ` -[ - "esm/index-browser-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > swc > transforms example test case: browser-current-esm > esm/index-browser-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: esm export * from "optimal"; import * as optimal from "optimal"; @@ -1594,14 +1472,11 @@ export { optimal }; export { func, string } from "optimal"; export { useState } from "react"; //# sourceMappingURL=index-browser-current-esm.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) swc transforms example test case: browser-current-lib 1`] = ` -[ - "lib/index-browser-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > swc > transforms example test case: browser-current-lib > lib/index-browser-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: lib "use strict"; const optimal = require("optimal"); @@ -1644,14 +1519,11 @@ Object.keys(optimal).forEach((k)=>{ }); }); //# sourceMappingURL=index-browser-current-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) swc transforms example test case: browser-current-umd 1`] = ` -[ - "umd/index-browser-current-umd.js", - "(function(global, factory) { +exports[`CJS -> MJS wrapper (externals) > swc > transforms example test case: browser-current-umd > umd/index-browser-current-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports, require("optimal"), require("react" /*#__PURE__*/ )); else if (typeof define === "function" && define.amd) define([ "exports", @@ -1741,14 +1613,11 @@ exports[`CJS -> MJS wrapper (externals) swc transforms example test case: browse } }); //# sourceMappingURL=index-browser-current-umd.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) swc transforms example test case: browser-experimental-esm 1`] = ` -[ - "esm/index-browser-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > swc > transforms example test case: browser-experimental-esm > esm/index-browser-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: esm export * from "optimal"; import * as optimal from "optimal"; @@ -1756,14 +1625,11 @@ export { optimal }; export { func, string } from "optimal"; export { useState } from "react"; //# sourceMappingURL=index-browser-experimental-esm.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) swc transforms example test case: browser-experimental-lib 1`] = ` -[ - "lib/index-browser-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > swc > transforms example test case: browser-experimental-lib > lib/index-browser-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: lib "use strict"; const optimal = require("optimal"); @@ -1806,14 +1672,11 @@ Object.keys(optimal).forEach((k)=>{ }); }); //# sourceMappingURL=index-browser-experimental-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) swc transforms example test case: browser-experimental-umd 1`] = ` -[ - "umd/index-browser-experimental-umd.js", - "(function(global, factory) { +exports[`CJS -> MJS wrapper (externals) > swc > transforms example test case: browser-experimental-umd > umd/index-browser-experimental-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports, require("optimal"), require("react" /*#__PURE__*/ )); else if (typeof define === "function" && define.amd) define([ "exports", @@ -1903,14 +1766,11 @@ exports[`CJS -> MJS wrapper (externals) swc transforms example test case: browse } }); //# sourceMappingURL=index-browser-experimental-umd.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) swc transforms example test case: browser-legacy-esm 1`] = ` -[ - "esm/index-browser-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > swc > transforms example test case: browser-legacy-esm > esm/index-browser-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: esm export * from "optimal"; import * as optimal from "optimal"; @@ -1918,14 +1778,11 @@ export { optimal }; export { func, string } from "optimal"; export { useState } from "react"; //# sourceMappingURL=index-browser-legacy-esm.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) swc transforms example test case: browser-legacy-lib 1`] = ` -[ - "lib/index-browser-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > swc > transforms example test case: browser-legacy-lib > lib/index-browser-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: lib "use strict"; var optimal = require("optimal"); @@ -1979,14 +1836,11 @@ Object.keys(optimal).forEach(function(k) { }); }); //# sourceMappingURL=index-browser-legacy-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) swc transforms example test case: browser-legacy-umd 1`] = ` -[ - "umd/index-browser-legacy-umd.js", - "(function(global, factory) { +exports[`CJS -> MJS wrapper (externals) > swc > transforms example test case: browser-legacy-umd > umd/index-browser-legacy-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports, require("optimal"), require("react" /*#__PURE__*/ )); else if (typeof define === "function" && define.amd) define([ "exports", @@ -2076,14 +1930,11 @@ exports[`CJS -> MJS wrapper (externals) swc transforms example test case: browse } }); //# sourceMappingURL=index-browser-legacy-umd.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) swc transforms example test case: browser-stable-esm 1`] = ` -[ - "esm/index-browser-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > swc > transforms example test case: browser-stable-esm > esm/index-browser-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: esm export * from "optimal"; import * as optimal from "optimal"; @@ -2091,14 +1942,11 @@ export { optimal }; export { func, string } from "optimal"; export { useState } from "react"; //# sourceMappingURL=index-browser-stable-esm.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) swc transforms example test case: browser-stable-lib 1`] = ` -[ - "lib/index-browser-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > swc > transforms example test case: browser-stable-lib > lib/index-browser-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: lib "use strict"; const optimal = require("optimal"); @@ -2141,14 +1989,11 @@ Object.keys(optimal).forEach((k)=>{ }); }); //# sourceMappingURL=index-browser-stable-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) swc transforms example test case: browser-stable-umd 1`] = ` -[ - "umd/index-browser-stable-umd.js", - "(function(global, factory) { +exports[`CJS -> MJS wrapper (externals) > swc > transforms example test case: browser-stable-umd > umd/index-browser-stable-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports, require("optimal"), require("react" /*#__PURE__*/ )); else if (typeof define === "function" && define.amd) define([ "exports", @@ -2238,14 +2083,11 @@ exports[`CJS -> MJS wrapper (externals) swc transforms example test case: browse } }); //# sourceMappingURL=index-browser-stable-umd.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) swc transforms example test case: electron-current-esm 1`] = ` -[ - "esm/index-electron-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > swc > transforms example test case: electron-current-esm > esm/index-electron-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: esm export * from "optimal"; import * as optimal from "optimal"; @@ -2253,14 +2095,11 @@ export { optimal }; export { func, string } from "optimal"; export { useState } from "react"; //# sourceMappingURL=index-electron-current-esm.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) swc transforms example test case: electron-current-lib 1`] = ` -[ - "lib/index-electron-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > swc > transforms example test case: electron-current-lib > lib/index-electron-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: lib "use strict"; const optimal = require("optimal"); @@ -2303,14 +2142,11 @@ Object.keys(optimal).forEach((k)=>{ }); }); //# sourceMappingURL=index-electron-current-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) swc transforms example test case: electron-experimental-esm 1`] = ` -[ - "esm/index-electron-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > swc > transforms example test case: electron-experimental-esm > esm/index-electron-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: esm export * from "optimal"; import * as optimal from "optimal"; @@ -2318,14 +2154,11 @@ export { optimal }; export { func, string } from "optimal"; export { useState } from "react"; //# sourceMappingURL=index-electron-experimental-esm.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) swc transforms example test case: electron-experimental-lib 1`] = ` -[ - "lib/index-electron-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > swc > transforms example test case: electron-experimental-lib > lib/index-electron-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: lib "use strict"; const optimal = require("optimal"); @@ -2368,14 +2201,11 @@ Object.keys(optimal).forEach((k)=>{ }); }); //# sourceMappingURL=index-electron-experimental-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) swc transforms example test case: electron-legacy-esm 1`] = ` -[ - "esm/index-electron-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > swc > transforms example test case: electron-legacy-esm > esm/index-electron-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: esm export * from "optimal"; import * as optimal from "optimal"; @@ -2383,14 +2213,11 @@ export { optimal }; export { func, string } from "optimal"; export { useState } from "react"; //# sourceMappingURL=index-electron-legacy-esm.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) swc transforms example test case: electron-legacy-lib 1`] = ` -[ - "lib/index-electron-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > swc > transforms example test case: electron-legacy-lib > lib/index-electron-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: lib "use strict"; const optimal = require("optimal"); @@ -2433,14 +2260,11 @@ Object.keys(optimal).forEach((k)=>{ }); }); //# sourceMappingURL=index-electron-legacy-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) swc transforms example test case: electron-stable-esm 1`] = ` -[ - "esm/index-electron-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > swc > transforms example test case: electron-stable-esm > esm/index-electron-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: esm export * from "optimal"; import * as optimal from "optimal"; @@ -2448,14 +2272,11 @@ export { optimal }; export { func, string } from "optimal"; export { useState } from "react"; //# sourceMappingURL=index-electron-stable-esm.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) swc transforms example test case: electron-stable-lib 1`] = ` -[ - "lib/index-electron-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > swc > transforms example test case: electron-stable-lib > lib/index-electron-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: lib "use strict"; const optimal = require("optimal"); @@ -2498,14 +2319,11 @@ Object.keys(optimal).forEach((k)=>{ }); }); //# sourceMappingURL=index-electron-stable-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) swc transforms example test case: native-current-lib 1`] = ` -[ - "lib/index-native-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > swc > transforms example test case: native-current-lib > lib/index-native-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: current, Format: lib "use strict"; const optimal = require("optimal"); @@ -2548,14 +2366,11 @@ Object.keys(optimal).forEach((k)=>{ }); }); //# sourceMappingURL=index-native-current-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) swc transforms example test case: native-experimental-lib 1`] = ` -[ - "lib/index-native-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > swc > transforms example test case: native-experimental-lib > lib/index-native-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: experimental, Format: lib "use strict"; const optimal = require("optimal"); @@ -2598,14 +2413,11 @@ Object.keys(optimal).forEach((k)=>{ }); }); //# sourceMappingURL=index-native-experimental-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) swc transforms example test case: native-legacy-lib 1`] = ` -[ - "lib/index-native-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > swc > transforms example test case: native-legacy-lib > lib/index-native-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: legacy, Format: lib "use strict"; const optimal = require("optimal"); @@ -2648,14 +2460,11 @@ Object.keys(optimal).forEach((k)=>{ }); }); //# sourceMappingURL=index-native-legacy-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) swc transforms example test case: native-stable-lib 1`] = ` -[ - "lib/index-native-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > swc > transforms example test case: native-stable-lib > lib/index-native-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: stable, Format: lib "use strict"; const optimal = require("optimal"); @@ -2698,29 +2507,11 @@ Object.keys(optimal).forEach((k)=>{ }); }); //# sourceMappingURL=index-native-stable-lib.js.map -", -] -`; - -exports[`CJS -> MJS wrapper (externals) swc transforms example test case: node-current-cjs 1`] = ` -[ - "cjs/index-node-current-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import './index-node-current-cjs.cjs'; - -export * from 'optimal'; -export * as optimal from 'optimal'; -export { string, func } from 'optimal'; -export { useState } from 'react';", -] +" `; -exports[`CJS -> MJS wrapper (externals) swc transforms example test case: node-current-cjs 2`] = ` -[ - "cjs/index-node-current-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > swc > transforms example test case: node-current-cjs > cjs/index-node-current-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: cjs "use strict"; const optimal = require("optimal"); @@ -2763,14 +2554,23 @@ Object.keys(optimal).forEach((k)=>{ }); }); //# sourceMappingURL=index-node-current-cjs.cjs.map -", -] +" +`; + +exports[`CJS -> MJS wrapper (externals) > swc > transforms example test case: node-current-cjs > cjs/index-node-current-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-current-cjs.cjs'; + +export * from 'optimal'; +export * as optimal from 'optimal'; +export { string, func } from 'optimal'; +export { useState } from 'react';" `; -exports[`CJS -> MJS wrapper (externals) swc transforms example test case: node-current-lib 1`] = ` -[ - "lib/index-node-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > swc > transforms example test case: node-current-lib > lib/index-node-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: lib "use strict"; const optimal = require("optimal"); @@ -2813,14 +2613,11 @@ Object.keys(optimal).forEach((k)=>{ }); }); //# sourceMappingURL=index-node-current-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) swc transforms example test case: node-current-mjs 1`] = ` -[ - "mjs/index-node-current-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > swc > transforms example test case: node-current-mjs > mjs/index-node-current-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: mjs export * from "optimal"; import * as optimal from "optimal"; @@ -2828,29 +2625,11 @@ export { optimal }; export { func, string } from "optimal"; export { useState } from "react"; //# sourceMappingURL=index-node-current-mjs.mjs.map -", -] -`; - -exports[`CJS -> MJS wrapper (externals) swc transforms example test case: node-experimental-cjs 1`] = ` -[ - "cjs/index-node-experimental-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import './index-node-experimental-cjs.cjs'; - -export * from 'optimal'; -export * as optimal from 'optimal'; -export { string, func } from 'optimal'; -export { useState } from 'react';", -] +" `; -exports[`CJS -> MJS wrapper (externals) swc transforms example test case: node-experimental-cjs 2`] = ` -[ - "cjs/index-node-experimental-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > swc > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: cjs "use strict"; const optimal = require("optimal"); @@ -2893,14 +2672,23 @@ Object.keys(optimal).forEach((k)=>{ }); }); //# sourceMappingURL=index-node-experimental-cjs.cjs.map -", -] +" +`; + +exports[`CJS -> MJS wrapper (externals) > swc > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-experimental-cjs.cjs'; + +export * from 'optimal'; +export * as optimal from 'optimal'; +export { string, func } from 'optimal'; +export { useState } from 'react';" `; -exports[`CJS -> MJS wrapper (externals) swc transforms example test case: node-experimental-lib 1`] = ` -[ - "lib/index-node-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > swc > transforms example test case: node-experimental-lib > lib/index-node-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: lib "use strict"; const optimal = require("optimal"); @@ -2943,14 +2731,11 @@ Object.keys(optimal).forEach((k)=>{ }); }); //# sourceMappingURL=index-node-experimental-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) swc transforms example test case: node-experimental-mjs 1`] = ` -[ - "mjs/index-node-experimental-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > swc > transforms example test case: node-experimental-mjs > mjs/index-node-experimental-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: mjs export * from "optimal"; import * as optimal from "optimal"; @@ -2958,29 +2743,11 @@ export { optimal }; export { func, string } from "optimal"; export { useState } from "react"; //# sourceMappingURL=index-node-experimental-mjs.mjs.map -", -] -`; - -exports[`CJS -> MJS wrapper (externals) swc transforms example test case: node-legacy-cjs 1`] = ` -[ - "cjs/index-node-legacy-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import './index-node-legacy-cjs.cjs'; - -export * from 'optimal'; -export * as optimal from 'optimal'; -export { string, func } from 'optimal'; -export { useState } from 'react';", -] +" `; -exports[`CJS -> MJS wrapper (externals) swc transforms example test case: node-legacy-cjs 2`] = ` -[ - "cjs/index-node-legacy-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > swc > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: cjs "use strict"; const optimal = require("optimal"); @@ -3023,14 +2790,23 @@ Object.keys(optimal).forEach((k)=>{ }); }); //# sourceMappingURL=index-node-legacy-cjs.cjs.map -", -] +" +`; + +exports[`CJS -> MJS wrapper (externals) > swc > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-legacy-cjs.cjs'; + +export * from 'optimal'; +export * as optimal from 'optimal'; +export { string, func } from 'optimal'; +export { useState } from 'react';" `; -exports[`CJS -> MJS wrapper (externals) swc transforms example test case: node-legacy-lib 1`] = ` -[ - "lib/index-node-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > swc > transforms example test case: node-legacy-lib > lib/index-node-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: lib "use strict"; const optimal = require("optimal"); @@ -3073,14 +2849,11 @@ Object.keys(optimal).forEach((k)=>{ }); }); //# sourceMappingURL=index-node-legacy-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) swc transforms example test case: node-legacy-mjs 1`] = ` -[ - "mjs/index-node-legacy-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > swc > transforms example test case: node-legacy-mjs > mjs/index-node-legacy-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: mjs export * from "optimal"; import * as optimal from "optimal"; @@ -3088,29 +2861,11 @@ export { optimal }; export { func, string } from "optimal"; export { useState } from "react"; //# sourceMappingURL=index-node-legacy-mjs.mjs.map -", -] -`; - -exports[`CJS -> MJS wrapper (externals) swc transforms example test case: node-stable-cjs 1`] = ` -[ - "cjs/index-node-stable-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import './index-node-stable-cjs.cjs'; - -export * from 'optimal'; -export * as optimal from 'optimal'; -export { string, func } from 'optimal'; -export { useState } from 'react';", -] +" `; -exports[`CJS -> MJS wrapper (externals) swc transforms example test case: node-stable-cjs 2`] = ` -[ - "cjs/index-node-stable-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > swc > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: cjs "use strict"; const optimal = require("optimal"); @@ -3153,14 +2908,23 @@ Object.keys(optimal).forEach((k)=>{ }); }); //# sourceMappingURL=index-node-stable-cjs.cjs.map -", -] +" +`; + +exports[`CJS -> MJS wrapper (externals) > swc > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-stable-cjs.cjs'; + +export * from 'optimal'; +export * as optimal from 'optimal'; +export { string, func } from 'optimal'; +export { useState } from 'react';" `; -exports[`CJS -> MJS wrapper (externals) swc transforms example test case: node-stable-lib 1`] = ` -[ - "lib/index-node-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > swc > transforms example test case: node-stable-lib > lib/index-node-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: lib "use strict"; const optimal = require("optimal"); @@ -3203,14 +2967,11 @@ Object.keys(optimal).forEach((k)=>{ }); }); //# sourceMappingURL=index-node-stable-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper (externals) swc transforms example test case: node-stable-mjs 1`] = ` -[ - "mjs/index-node-stable-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper (externals) > swc > transforms example test case: node-stable-mjs > mjs/index-node-stable-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: mjs export * from "optimal"; import * as optimal from "optimal"; @@ -3218,14 +2979,11 @@ export { optimal }; export { func, string } from "optimal"; export { useState } from "react"; //# sourceMappingURL=index-node-stable-mjs.mjs.map -", -] +" `; -exports[`CJS -> MJS wrapper babel transforms example test case: browser-current-esm 1`] = ` -[ - "esm/index-browser-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > babel > transforms example test case: browser-current-esm > esm/index-browser-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: esm function foo() {} @@ -3256,14 +3014,11 @@ class DefaultClass {} export { CONST, ClassName, a, arrowFunc, b, bar, c, d, DefaultClass as default, e, f, foo, foo as fooRenamed, func, helpers as ns1, helpers as ns2, helpers as ns3 }; //# sourceMappingURL=index-browser-current-esm.js.map -", -] +" `; -exports[`CJS -> MJS wrapper babel transforms example test case: browser-current-lib 1`] = ` -[ - "lib/index-browser-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > babel > transforms example test case: browser-current-lib > lib/index-browser-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: lib 'use strict'; @@ -3313,14 +3068,11 @@ exports.ns1 = helpers; exports.ns2 = helpers; exports.ns3 = helpers; //# sourceMappingURL=index-browser-current-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper babel transforms example test case: browser-current-umd 1`] = ` -[ - "umd/index-browser-current-umd.js", - "(function (global, factory) { +exports[`CJS -> MJS wrapper > babel > transforms example test case: browser-current-umd > umd/index-browser-current-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports"], factory); } else if (typeof exports !== "undefined") { @@ -3375,14 +3127,11 @@ exports[`CJS -> MJS wrapper babel transforms example test case: browser-current- _exports.default = DefaultClass; }); //# sourceMappingURL=index-browser-current-umd.js.map -", -] +" `; -exports[`CJS -> MJS wrapper babel transforms example test case: browser-experimental-esm 1`] = ` -[ - "esm/index-browser-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > babel > transforms example test case: browser-experimental-esm > esm/index-browser-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: esm function foo() {} @@ -3413,14 +3162,11 @@ class DefaultClass {} export { CONST, ClassName, a, arrowFunc, b, bar, c, d, DefaultClass as default, e, f, foo, foo as fooRenamed, func, helpers as ns1, helpers as ns2, helpers as ns3 }; //# sourceMappingURL=index-browser-experimental-esm.js.map -", -] +" `; -exports[`CJS -> MJS wrapper babel transforms example test case: browser-experimental-lib 1`] = ` -[ - "lib/index-browser-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > babel > transforms example test case: browser-experimental-lib > lib/index-browser-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: lib 'use strict'; @@ -3470,14 +3216,11 @@ exports.ns1 = helpers; exports.ns2 = helpers; exports.ns3 = helpers; //# sourceMappingURL=index-browser-experimental-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper babel transforms example test case: browser-experimental-umd 1`] = ` -[ - "umd/index-browser-experimental-umd.js", - "(function (global, factory) { +exports[`CJS -> MJS wrapper > babel > transforms example test case: browser-experimental-umd > umd/index-browser-experimental-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports"], factory); } else if (typeof exports !== "undefined") { @@ -3532,14 +3275,11 @@ exports[`CJS -> MJS wrapper babel transforms example test case: browser-experime _exports.default = DefaultClass; }); //# sourceMappingURL=index-browser-experimental-umd.js.map -", -] +" `; -exports[`CJS -> MJS wrapper babel transforms example test case: browser-legacy-esm 1`] = ` -[ - "esm/index-browser-legacy-esm.js", - "var _this = this; +exports[`CJS -> MJS wrapper > babel > transforms example test case: browser-legacy-esm > esm/index-browser-legacy-esm.js 1`] = ` +"var _this = this; function _newArrowCheck(innerThis, boundThis) { if (innerThis !== boundThis) { throw new TypeError("Cannot instantiate an arrow function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } @@ -3580,14 +3320,11 @@ var DefaultClass = /*#__PURE__*/_createClass(function DefaultClass() { }); // Types should be ignored export { CONST, ClassName, a, arrowFunc, b, bar, c, d, DefaultClass as default, e, f, foo, foo as fooRenamed, func, helpers as ns1, helpers as ns2, helpers as ns3 }; //# sourceMappingURL=index-browser-legacy-esm.js.map -", -] +" `; -exports[`CJS -> MJS wrapper babel transforms example test case: browser-legacy-lib 1`] = ` -[ - "lib/index-browser-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > babel > transforms example test case: browser-legacy-lib > lib/index-browser-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: lib 'use strict'; @@ -3647,14 +3384,11 @@ exports.ns1 = helpers; exports.ns2 = helpers; exports.ns3 = helpers; //# sourceMappingURL=index-browser-legacy-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper babel transforms example test case: browser-legacy-umd 1`] = ` -[ - "umd/index-browser-legacy-umd.js", - "(function (global, factory) { +exports[`CJS -> MJS wrapper > babel > transforms example test case: browser-legacy-umd > umd/index-browser-legacy-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports"], factory); } else if (typeof exports !== "undefined") { @@ -3717,14 +3451,11 @@ exports[`CJS -> MJS wrapper babel transforms example test case: browser-legacy-u }); // Types should be ignored }); //# sourceMappingURL=index-browser-legacy-umd.js.map -", -] +" `; -exports[`CJS -> MJS wrapper babel transforms example test case: browser-stable-esm 1`] = ` -[ - "esm/index-browser-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > babel > transforms example test case: browser-stable-esm > esm/index-browser-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: esm function foo() {} @@ -3755,14 +3486,11 @@ class DefaultClass {} export { CONST, ClassName, a, arrowFunc, b, bar, c, d, DefaultClass as default, e, f, foo, foo as fooRenamed, func, helpers as ns1, helpers as ns2, helpers as ns3 }; //# sourceMappingURL=index-browser-stable-esm.js.map -", -] +" `; -exports[`CJS -> MJS wrapper babel transforms example test case: browser-stable-lib 1`] = ` -[ - "lib/index-browser-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > babel > transforms example test case: browser-stable-lib > lib/index-browser-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: lib 'use strict'; @@ -3812,14 +3540,11 @@ exports.ns1 = helpers; exports.ns2 = helpers; exports.ns3 = helpers; //# sourceMappingURL=index-browser-stable-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper babel transforms example test case: browser-stable-umd 1`] = ` -[ - "umd/index-browser-stable-umd.js", - "(function (global, factory) { +exports[`CJS -> MJS wrapper > babel > transforms example test case: browser-stable-umd > umd/index-browser-stable-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports"], factory); } else if (typeof exports !== "undefined") { @@ -3874,14 +3599,11 @@ exports[`CJS -> MJS wrapper babel transforms example test case: browser-stable-u _exports.default = DefaultClass; }); //# sourceMappingURL=index-browser-stable-umd.js.map -", -] +" `; -exports[`CJS -> MJS wrapper babel transforms example test case: electron-current-esm 1`] = ` -[ - "esm/index-electron-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > babel > transforms example test case: electron-current-esm > esm/index-electron-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: esm function foo() {} @@ -3912,14 +3634,11 @@ class DefaultClass {} export { CONST, ClassName, a, arrowFunc, b, bar, c, d, DefaultClass as default, e, f, foo, foo as fooRenamed, func, helpers as ns1, helpers as ns2, helpers as ns3 }; //# sourceMappingURL=index-electron-current-esm.js.map -", -] +" `; -exports[`CJS -> MJS wrapper babel transforms example test case: electron-current-lib 1`] = ` -[ - "lib/index-electron-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > babel > transforms example test case: electron-current-lib > lib/index-electron-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: lib 'use strict'; @@ -3969,14 +3688,11 @@ exports.ns1 = helpers; exports.ns2 = helpers; exports.ns3 = helpers; //# sourceMappingURL=index-electron-current-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper babel transforms example test case: electron-experimental-esm 1`] = ` -[ - "esm/index-electron-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > babel > transforms example test case: electron-experimental-esm > esm/index-electron-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: esm function foo() {} @@ -4007,14 +3723,11 @@ class DefaultClass {} export { CONST, ClassName, a, arrowFunc, b, bar, c, d, DefaultClass as default, e, f, foo, foo as fooRenamed, func, helpers as ns1, helpers as ns2, helpers as ns3 }; //# sourceMappingURL=index-electron-experimental-esm.js.map -", -] +" `; -exports[`CJS -> MJS wrapper babel transforms example test case: electron-experimental-lib 1`] = ` -[ - "lib/index-electron-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > babel > transforms example test case: electron-experimental-lib > lib/index-electron-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: lib 'use strict'; @@ -4064,14 +3777,11 @@ exports.ns1 = helpers; exports.ns2 = helpers; exports.ns3 = helpers; //# sourceMappingURL=index-electron-experimental-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper babel transforms example test case: electron-legacy-esm 1`] = ` -[ - "esm/index-electron-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > babel > transforms example test case: electron-legacy-esm > esm/index-electron-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: esm function foo() {} @@ -4102,14 +3812,11 @@ class DefaultClass {} export { CONST, ClassName, a, arrowFunc, b, bar, c, d, DefaultClass as default, e, f, foo, foo as fooRenamed, func, helpers as ns1, helpers as ns2, helpers as ns3 }; //# sourceMappingURL=index-electron-legacy-esm.js.map -", -] +" `; -exports[`CJS -> MJS wrapper babel transforms example test case: electron-legacy-lib 1`] = ` -[ - "lib/index-electron-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > babel > transforms example test case: electron-legacy-lib > lib/index-electron-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: lib 'use strict'; @@ -4159,14 +3866,11 @@ exports.ns1 = helpers; exports.ns2 = helpers; exports.ns3 = helpers; //# sourceMappingURL=index-electron-legacy-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper babel transforms example test case: electron-stable-esm 1`] = ` -[ - "esm/index-electron-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > babel > transforms example test case: electron-stable-esm > esm/index-electron-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: esm function foo() {} @@ -4197,14 +3901,11 @@ class DefaultClass {} export { CONST, ClassName, a, arrowFunc, b, bar, c, d, DefaultClass as default, e, f, foo, foo as fooRenamed, func, helpers as ns1, helpers as ns2, helpers as ns3 }; //# sourceMappingURL=index-electron-stable-esm.js.map -", -] +" `; -exports[`CJS -> MJS wrapper babel transforms example test case: electron-stable-lib 1`] = ` -[ - "lib/index-electron-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > babel > transforms example test case: electron-stable-lib > lib/index-electron-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: lib 'use strict'; @@ -4254,14 +3955,11 @@ exports.ns1 = helpers; exports.ns2 = helpers; exports.ns3 = helpers; //# sourceMappingURL=index-electron-stable-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper babel transforms example test case: native-current-lib 1`] = ` -[ - "lib/index-native-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > babel > transforms example test case: native-current-lib > lib/index-native-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: current, Format: lib 'use strict'; @@ -4311,14 +4009,11 @@ exports.ns1 = helpers; exports.ns2 = helpers; exports.ns3 = helpers; //# sourceMappingURL=index-native-current-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper babel transforms example test case: native-experimental-lib 1`] = ` -[ - "lib/index-native-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > babel > transforms example test case: native-experimental-lib > lib/index-native-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: experimental, Format: lib 'use strict'; @@ -4368,14 +4063,11 @@ exports.ns1 = helpers; exports.ns2 = helpers; exports.ns3 = helpers; //# sourceMappingURL=index-native-experimental-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper babel transforms example test case: native-legacy-lib 1`] = ` -[ - "lib/index-native-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > babel > transforms example test case: native-legacy-lib > lib/index-native-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: legacy, Format: lib 'use strict'; @@ -4425,14 +4117,11 @@ exports.ns1 = helpers; exports.ns2 = helpers; exports.ns3 = helpers; //# sourceMappingURL=index-native-legacy-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper babel transforms example test case: native-stable-lib 1`] = ` -[ - "lib/index-native-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > babel > transforms example test case: native-stable-lib > lib/index-native-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: stable, Format: lib 'use strict'; @@ -4482,27 +4171,11 @@ exports.ns1 = helpers; exports.ns2 = helpers; exports.ns3 = helpers; //# sourceMappingURL=index-native-stable-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper babel transforms example test case: node-current-cjs 1`] = ` -[ - "cjs/index-node-current-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-current-cjs.cjs'; - -export const { CONST, ClassName, a, arrowFunc, b, bar, c, d, e, f, foo, fooRenamed, func, ns1, ns2, ns3 } = data; -export default data.default;", -] -`; - -exports[`CJS -> MJS wrapper babel transforms example test case: node-current-cjs 2`] = ` -[ - "cjs/index-node-current-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > babel > transforms example test case: node-current-cjs > cjs/index-node-current-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: cjs 'use strict'; @@ -4552,14 +4225,21 @@ exports.ns1 = helpers; exports.ns2 = helpers; exports.ns3 = helpers; //# sourceMappingURL=index-node-current-cjs.cjs.map -", -] +" +`; + +exports[`CJS -> MJS wrapper > babel > transforms example test case: node-current-cjs > cjs/index-node-current-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-current-cjs.cjs'; + +export const { CONST, ClassName, a, arrowFunc, b, bar, c, d, e, f, foo, fooRenamed, func, ns1, ns2, ns3 } = data; +export default data.default;" `; -exports[`CJS -> MJS wrapper babel transforms example test case: node-current-lib 1`] = ` -[ - "lib/index-node-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > babel > transforms example test case: node-current-lib > lib/index-node-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: lib 'use strict'; @@ -4609,14 +4289,11 @@ exports.ns1 = helpers; exports.ns2 = helpers; exports.ns3 = helpers; //# sourceMappingURL=index-node-current-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper babel transforms example test case: node-current-mjs 1`] = ` -[ - "mjs/index-node-current-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > babel > transforms example test case: node-current-mjs > mjs/index-node-current-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: mjs function foo() {} @@ -4647,27 +4324,11 @@ class DefaultClass {} export { CONST, ClassName, a, arrowFunc, b, bar, c, d, DefaultClass as default, e, f, foo, foo as fooRenamed, func, helpers as ns1, helpers as ns2, helpers as ns3 }; //# sourceMappingURL=index-node-current-mjs.mjs.map -", -] -`; - -exports[`CJS -> MJS wrapper babel transforms example test case: node-experimental-cjs 1`] = ` -[ - "cjs/index-node-experimental-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-experimental-cjs.cjs'; - -export const { CONST, ClassName, a, arrowFunc, b, bar, c, d, e, f, foo, fooRenamed, func, ns1, ns2, ns3 } = data; -export default data.default;", -] +" `; -exports[`CJS -> MJS wrapper babel transforms example test case: node-experimental-cjs 2`] = ` -[ - "cjs/index-node-experimental-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > babel > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: cjs 'use strict'; @@ -4717,14 +4378,21 @@ exports.ns1 = helpers; exports.ns2 = helpers; exports.ns3 = helpers; //# sourceMappingURL=index-node-experimental-cjs.cjs.map -", -] +" +`; + +exports[`CJS -> MJS wrapper > babel > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-experimental-cjs.cjs'; + +export const { CONST, ClassName, a, arrowFunc, b, bar, c, d, e, f, foo, fooRenamed, func, ns1, ns2, ns3 } = data; +export default data.default;" `; -exports[`CJS -> MJS wrapper babel transforms example test case: node-experimental-lib 1`] = ` -[ - "lib/index-node-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > babel > transforms example test case: node-experimental-lib > lib/index-node-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: lib 'use strict'; @@ -4774,14 +4442,11 @@ exports.ns1 = helpers; exports.ns2 = helpers; exports.ns3 = helpers; //# sourceMappingURL=index-node-experimental-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper babel transforms example test case: node-experimental-mjs 1`] = ` -[ - "mjs/index-node-experimental-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > babel > transforms example test case: node-experimental-mjs > mjs/index-node-experimental-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: mjs function foo() {} @@ -4812,27 +4477,11 @@ class DefaultClass {} export { CONST, ClassName, a, arrowFunc, b, bar, c, d, DefaultClass as default, e, f, foo, foo as fooRenamed, func, helpers as ns1, helpers as ns2, helpers as ns3 }; //# sourceMappingURL=index-node-experimental-mjs.mjs.map -", -] -`; - -exports[`CJS -> MJS wrapper babel transforms example test case: node-legacy-cjs 1`] = ` -[ - "cjs/index-node-legacy-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-legacy-cjs.cjs'; - -export const { CONST, ClassName, a, arrowFunc, b, bar, c, d, e, f, foo, fooRenamed, func, ns1, ns2, ns3 } = data; -export default data.default;", -] +" `; -exports[`CJS -> MJS wrapper babel transforms example test case: node-legacy-cjs 2`] = ` -[ - "cjs/index-node-legacy-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > babel > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: cjs 'use strict'; @@ -4882,14 +4531,21 @@ exports.ns1 = helpers; exports.ns2 = helpers; exports.ns3 = helpers; //# sourceMappingURL=index-node-legacy-cjs.cjs.map -", -] +" +`; + +exports[`CJS -> MJS wrapper > babel > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-legacy-cjs.cjs'; + +export const { CONST, ClassName, a, arrowFunc, b, bar, c, d, e, f, foo, fooRenamed, func, ns1, ns2, ns3 } = data; +export default data.default;" `; -exports[`CJS -> MJS wrapper babel transforms example test case: node-legacy-lib 1`] = ` -[ - "lib/index-node-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > babel > transforms example test case: node-legacy-lib > lib/index-node-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: lib 'use strict'; @@ -4939,14 +4595,11 @@ exports.ns1 = helpers; exports.ns2 = helpers; exports.ns3 = helpers; //# sourceMappingURL=index-node-legacy-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper babel transforms example test case: node-legacy-mjs 1`] = ` -[ - "mjs/index-node-legacy-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > babel > transforms example test case: node-legacy-mjs > mjs/index-node-legacy-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: mjs function foo() {} @@ -4977,27 +4630,11 @@ class DefaultClass {} export { CONST, ClassName, a, arrowFunc, b, bar, c, d, DefaultClass as default, e, f, foo, foo as fooRenamed, func, helpers as ns1, helpers as ns2, helpers as ns3 }; //# sourceMappingURL=index-node-legacy-mjs.mjs.map -", -] -`; - -exports[`CJS -> MJS wrapper babel transforms example test case: node-stable-cjs 1`] = ` -[ - "cjs/index-node-stable-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-stable-cjs.cjs'; - -export const { CONST, ClassName, a, arrowFunc, b, bar, c, d, e, f, foo, fooRenamed, func, ns1, ns2, ns3 } = data; -export default data.default;", -] +" `; -exports[`CJS -> MJS wrapper babel transforms example test case: node-stable-cjs 2`] = ` -[ - "cjs/index-node-stable-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > babel > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: cjs 'use strict'; @@ -5047,14 +4684,21 @@ exports.ns1 = helpers; exports.ns2 = helpers; exports.ns3 = helpers; //# sourceMappingURL=index-node-stable-cjs.cjs.map -", -] +" +`; + +exports[`CJS -> MJS wrapper > babel > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-stable-cjs.cjs'; + +export const { CONST, ClassName, a, arrowFunc, b, bar, c, d, e, f, foo, fooRenamed, func, ns1, ns2, ns3 } = data; +export default data.default;" `; -exports[`CJS -> MJS wrapper babel transforms example test case: node-stable-lib 1`] = ` -[ - "lib/index-node-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > babel > transforms example test case: node-stable-lib > lib/index-node-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: lib 'use strict'; @@ -5104,14 +4748,11 @@ exports.ns1 = helpers; exports.ns2 = helpers; exports.ns3 = helpers; //# sourceMappingURL=index-node-stable-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper babel transforms example test case: node-stable-mjs 1`] = ` -[ - "mjs/index-node-stable-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > babel > transforms example test case: node-stable-mjs > mjs/index-node-stable-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: mjs function foo() {} @@ -5142,14 +4783,11 @@ class DefaultClass {} export { CONST, ClassName, a, arrowFunc, b, bar, c, d, DefaultClass as default, e, f, foo, foo as fooRenamed, func, helpers as ns1, helpers as ns2, helpers as ns3 }; //# sourceMappingURL=index-node-stable-mjs.mjs.map -", -] +" `; -exports[`CJS -> MJS wrapper swc transforms example test case: browser-current-esm 1`] = ` -[ - "esm/index-browser-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > swc > transforms example test case: browser-current-esm > esm/index-browser-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: esm function foo() {} function bar() {} @@ -5179,14 +4817,11 @@ let DefaultClass = class DefaultClass { // Types should be ignored export { CONST, ClassName, a, arrowFunc, b, bar, c, d, DefaultClass as default, e, f, foo, foo as fooRenamed, func, helpers as ns1, helpers as ns2, helpers as ns3 }; //# sourceMappingURL=index-browser-current-esm.js.map -", -] +" `; -exports[`CJS -> MJS wrapper swc transforms example test case: browser-current-lib 1`] = ` -[ - "lib/index-browser-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > swc > transforms example test case: browser-current-lib > lib/index-browser-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: lib "use strict"; Object.defineProperty(exports, "__esModule", { @@ -5234,14 +4869,11 @@ exports.ns1 = helpers; exports.ns2 = helpers; exports.ns3 = helpers; //# sourceMappingURL=index-browser-current-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper swc transforms example test case: browser-current-umd 1`] = ` -[ - "umd/index-browser-current-umd.js", - "(function(global, factory) { +exports[`CJS -> MJS wrapper > swc > transforms example test case: browser-current-umd > umd/index-browser-current-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports); else if (typeof define === "function" && define.amd) define([ "exports" @@ -5337,14 +4969,11 @@ exports[`CJS -> MJS wrapper swc transforms example test case: browser-current-um }; }); //# sourceMappingURL=index-browser-current-umd.js.map -", -] +" `; -exports[`CJS -> MJS wrapper swc transforms example test case: browser-experimental-esm 1`] = ` -[ - "esm/index-browser-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > swc > transforms example test case: browser-experimental-esm > esm/index-browser-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: esm function foo() {} function bar() {} @@ -5374,14 +5003,11 @@ let DefaultClass = class DefaultClass { // Types should be ignored export { CONST, ClassName, a, arrowFunc, b, bar, c, d, DefaultClass as default, e, f, foo, foo as fooRenamed, func, helpers as ns1, helpers as ns2, helpers as ns3 }; //# sourceMappingURL=index-browser-experimental-esm.js.map -", -] +" `; -exports[`CJS -> MJS wrapper swc transforms example test case: browser-experimental-lib 1`] = ` -[ - "lib/index-browser-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > swc > transforms example test case: browser-experimental-lib > lib/index-browser-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: lib "use strict"; Object.defineProperty(exports, "__esModule", { @@ -5429,14 +5055,11 @@ exports.ns1 = helpers; exports.ns2 = helpers; exports.ns3 = helpers; //# sourceMappingURL=index-browser-experimental-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper swc transforms example test case: browser-experimental-umd 1`] = ` -[ - "umd/index-browser-experimental-umd.js", - "(function(global, factory) { +exports[`CJS -> MJS wrapper > swc > transforms example test case: browser-experimental-umd > umd/index-browser-experimental-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports); else if (typeof define === "function" && define.amd) define([ "exports" @@ -5532,14 +5155,11 @@ exports[`CJS -> MJS wrapper swc transforms example test case: browser-experiment }; }); //# sourceMappingURL=index-browser-experimental-umd.js.map -", -] +" `; -exports[`CJS -> MJS wrapper swc transforms example test case: browser-legacy-esm 1`] = ` -[ - "esm/index-browser-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > swc > transforms example test case: browser-legacy-esm > esm/index-browser-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: esm function _class_call_check(instance, Constructor) { if (!(instance instanceof Constructor)) { @@ -5576,14 +5196,11 @@ var DefaultClass = function DefaultClass() { // Types should be ignored export { CONST, ClassName, a, arrowFunc, b, bar, c, d, DefaultClass as default, e, f, foo, foo as fooRenamed, func, helpers as ns1, helpers as ns2, helpers as ns3 }; //# sourceMappingURL=index-browser-legacy-esm.js.map -", -] +" `; -exports[`CJS -> MJS wrapper swc transforms example test case: browser-legacy-lib 1`] = ` -[ - "lib/index-browser-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > swc > transforms example test case: browser-legacy-lib > lib/index-browser-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: lib "use strict"; function _class_call_check(instance, Constructor) { @@ -5636,14 +5253,11 @@ exports.ns1 = helpers; exports.ns2 = helpers; exports.ns3 = helpers; //# sourceMappingURL=index-browser-legacy-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper swc transforms example test case: browser-legacy-umd 1`] = ` -[ - "umd/index-browser-legacy-umd.js", - "(function(global, factory) { +exports[`CJS -> MJS wrapper > swc > transforms example test case: browser-legacy-umd > umd/index-browser-legacy-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports); else if (typeof define === "function" && define.amd) define([ "exports" @@ -5746,14 +5360,11 @@ exports[`CJS -> MJS wrapper swc transforms example test case: browser-legacy-umd }; }); //# sourceMappingURL=index-browser-legacy-umd.js.map -", -] +" `; -exports[`CJS -> MJS wrapper swc transforms example test case: browser-stable-esm 1`] = ` -[ - "esm/index-browser-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > swc > transforms example test case: browser-stable-esm > esm/index-browser-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: esm function foo() {} function bar() {} @@ -5783,14 +5394,11 @@ let DefaultClass = class DefaultClass { // Types should be ignored export { CONST, ClassName, a, arrowFunc, b, bar, c, d, DefaultClass as default, e, f, foo, foo as fooRenamed, func, helpers as ns1, helpers as ns2, helpers as ns3 }; //# sourceMappingURL=index-browser-stable-esm.js.map -", -] +" `; -exports[`CJS -> MJS wrapper swc transforms example test case: browser-stable-lib 1`] = ` -[ - "lib/index-browser-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > swc > transforms example test case: browser-stable-lib > lib/index-browser-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: lib "use strict"; Object.defineProperty(exports, "__esModule", { @@ -5838,14 +5446,11 @@ exports.ns1 = helpers; exports.ns2 = helpers; exports.ns3 = helpers; //# sourceMappingURL=index-browser-stable-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper swc transforms example test case: browser-stable-umd 1`] = ` -[ - "umd/index-browser-stable-umd.js", - "(function(global, factory) { +exports[`CJS -> MJS wrapper > swc > transforms example test case: browser-stable-umd > umd/index-browser-stable-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports); else if (typeof define === "function" && define.amd) define([ "exports" @@ -5941,14 +5546,11 @@ exports[`CJS -> MJS wrapper swc transforms example test case: browser-stable-umd }; }); //# sourceMappingURL=index-browser-stable-umd.js.map -", -] +" `; -exports[`CJS -> MJS wrapper swc transforms example test case: electron-current-esm 1`] = ` -[ - "esm/index-electron-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > swc > transforms example test case: electron-current-esm > esm/index-electron-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: esm function foo() {} function bar() {} @@ -5978,14 +5580,11 @@ let DefaultClass = class DefaultClass { // Types should be ignored export { CONST, ClassName, a, arrowFunc, b, bar, c, d, DefaultClass as default, e, f, foo, foo as fooRenamed, func, helpers as ns1, helpers as ns2, helpers as ns3 }; //# sourceMappingURL=index-electron-current-esm.js.map -", -] +" `; -exports[`CJS -> MJS wrapper swc transforms example test case: electron-current-lib 1`] = ` -[ - "lib/index-electron-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > swc > transforms example test case: electron-current-lib > lib/index-electron-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: lib "use strict"; Object.defineProperty(exports, "__esModule", { @@ -6033,14 +5632,11 @@ exports.ns1 = helpers; exports.ns2 = helpers; exports.ns3 = helpers; //# sourceMappingURL=index-electron-current-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper swc transforms example test case: electron-experimental-esm 1`] = ` -[ - "esm/index-electron-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > swc > transforms example test case: electron-experimental-esm > esm/index-electron-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: esm function foo() {} function bar() {} @@ -6070,14 +5666,11 @@ let DefaultClass = class DefaultClass { // Types should be ignored export { CONST, ClassName, a, arrowFunc, b, bar, c, d, DefaultClass as default, e, f, foo, foo as fooRenamed, func, helpers as ns1, helpers as ns2, helpers as ns3 }; //# sourceMappingURL=index-electron-experimental-esm.js.map -", -] +" `; -exports[`CJS -> MJS wrapper swc transforms example test case: electron-experimental-lib 1`] = ` -[ - "lib/index-electron-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > swc > transforms example test case: electron-experimental-lib > lib/index-electron-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: lib "use strict"; Object.defineProperty(exports, "__esModule", { @@ -6125,14 +5718,11 @@ exports.ns1 = helpers; exports.ns2 = helpers; exports.ns3 = helpers; //# sourceMappingURL=index-electron-experimental-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper swc transforms example test case: electron-legacy-esm 1`] = ` -[ - "esm/index-electron-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > swc > transforms example test case: electron-legacy-esm > esm/index-electron-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: esm function foo() {} function bar() {} @@ -6162,14 +5752,11 @@ let DefaultClass = class DefaultClass { // Types should be ignored export { CONST, ClassName, a, arrowFunc, b, bar, c, d, DefaultClass as default, e, f, foo, foo as fooRenamed, func, helpers as ns1, helpers as ns2, helpers as ns3 }; //# sourceMappingURL=index-electron-legacy-esm.js.map -", -] +" `; -exports[`CJS -> MJS wrapper swc transforms example test case: electron-legacy-lib 1`] = ` -[ - "lib/index-electron-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > swc > transforms example test case: electron-legacy-lib > lib/index-electron-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: lib "use strict"; Object.defineProperty(exports, "__esModule", { @@ -6217,14 +5804,11 @@ exports.ns1 = helpers; exports.ns2 = helpers; exports.ns3 = helpers; //# sourceMappingURL=index-electron-legacy-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper swc transforms example test case: electron-stable-esm 1`] = ` -[ - "esm/index-electron-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > swc > transforms example test case: electron-stable-esm > esm/index-electron-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: esm function foo() {} function bar() {} @@ -6254,14 +5838,11 @@ let DefaultClass = class DefaultClass { // Types should be ignored export { CONST, ClassName, a, arrowFunc, b, bar, c, d, DefaultClass as default, e, f, foo, foo as fooRenamed, func, helpers as ns1, helpers as ns2, helpers as ns3 }; //# sourceMappingURL=index-electron-stable-esm.js.map -", -] +" `; -exports[`CJS -> MJS wrapper swc transforms example test case: electron-stable-lib 1`] = ` -[ - "lib/index-electron-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > swc > transforms example test case: electron-stable-lib > lib/index-electron-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: lib "use strict"; Object.defineProperty(exports, "__esModule", { @@ -6309,14 +5890,11 @@ exports.ns1 = helpers; exports.ns2 = helpers; exports.ns3 = helpers; //# sourceMappingURL=index-electron-stable-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper swc transforms example test case: native-current-lib 1`] = ` -[ - "lib/index-native-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > swc > transforms example test case: native-current-lib > lib/index-native-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: current, Format: lib "use strict"; Object.defineProperty(exports, "__esModule", { @@ -6364,14 +5942,11 @@ exports.ns1 = helpers; exports.ns2 = helpers; exports.ns3 = helpers; //# sourceMappingURL=index-native-current-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper swc transforms example test case: native-experimental-lib 1`] = ` -[ - "lib/index-native-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > swc > transforms example test case: native-experimental-lib > lib/index-native-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: experimental, Format: lib "use strict"; Object.defineProperty(exports, "__esModule", { @@ -6419,14 +5994,11 @@ exports.ns1 = helpers; exports.ns2 = helpers; exports.ns3 = helpers; //# sourceMappingURL=index-native-experimental-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper swc transforms example test case: native-legacy-lib 1`] = ` -[ - "lib/index-native-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > swc > transforms example test case: native-legacy-lib > lib/index-native-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: legacy, Format: lib "use strict"; Object.defineProperty(exports, "__esModule", { @@ -6474,14 +6046,11 @@ exports.ns1 = helpers; exports.ns2 = helpers; exports.ns3 = helpers; //# sourceMappingURL=index-native-legacy-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper swc transforms example test case: native-stable-lib 1`] = ` -[ - "lib/index-native-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > swc > transforms example test case: native-stable-lib > lib/index-native-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: stable, Format: lib "use strict"; Object.defineProperty(exports, "__esModule", { @@ -6529,27 +6098,11 @@ exports.ns1 = helpers; exports.ns2 = helpers; exports.ns3 = helpers; //# sourceMappingURL=index-native-stable-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper swc transforms example test case: node-current-cjs 1`] = ` -[ - "cjs/index-node-current-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-current-cjs.cjs'; - -export const { CONST, ClassName, a, arrowFunc, b, bar, c, d, e, f, foo, fooRenamed, func, ns1, ns2, ns3 } = data; -export default data.default;", -] -`; - -exports[`CJS -> MJS wrapper swc transforms example test case: node-current-cjs 2`] = ` -[ - "cjs/index-node-current-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > swc > transforms example test case: node-current-cjs > cjs/index-node-current-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: cjs "use strict"; Object.defineProperty(exports, "__esModule", { @@ -6597,14 +6150,21 @@ exports.ns1 = helpers; exports.ns2 = helpers; exports.ns3 = helpers; //# sourceMappingURL=index-node-current-cjs.cjs.map -", -] +" +`; + +exports[`CJS -> MJS wrapper > swc > transforms example test case: node-current-cjs > cjs/index-node-current-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-current-cjs.cjs'; + +export const { CONST, ClassName, a, arrowFunc, b, bar, c, d, e, f, foo, fooRenamed, func, ns1, ns2, ns3 } = data; +export default data.default;" `; -exports[`CJS -> MJS wrapper swc transforms example test case: node-current-lib 1`] = ` -[ - "lib/index-node-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > swc > transforms example test case: node-current-lib > lib/index-node-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: lib "use strict"; Object.defineProperty(exports, "__esModule", { @@ -6652,14 +6212,11 @@ exports.ns1 = helpers; exports.ns2 = helpers; exports.ns3 = helpers; //# sourceMappingURL=index-node-current-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper swc transforms example test case: node-current-mjs 1`] = ` -[ - "mjs/index-node-current-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > swc > transforms example test case: node-current-mjs > mjs/index-node-current-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: mjs function foo() {} function bar() {} @@ -6689,27 +6246,11 @@ let DefaultClass = class DefaultClass { // Types should be ignored export { CONST, ClassName, a, arrowFunc, b, bar, c, d, DefaultClass as default, e, f, foo, foo as fooRenamed, func, helpers as ns1, helpers as ns2, helpers as ns3 }; //# sourceMappingURL=index-node-current-mjs.mjs.map -", -] -`; - -exports[`CJS -> MJS wrapper swc transforms example test case: node-experimental-cjs 1`] = ` -[ - "cjs/index-node-experimental-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-experimental-cjs.cjs'; - -export const { CONST, ClassName, a, arrowFunc, b, bar, c, d, e, f, foo, fooRenamed, func, ns1, ns2, ns3 } = data; -export default data.default;", -] +" `; -exports[`CJS -> MJS wrapper swc transforms example test case: node-experimental-cjs 2`] = ` -[ - "cjs/index-node-experimental-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > swc > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: cjs "use strict"; Object.defineProperty(exports, "__esModule", { @@ -6757,14 +6298,21 @@ exports.ns1 = helpers; exports.ns2 = helpers; exports.ns3 = helpers; //# sourceMappingURL=index-node-experimental-cjs.cjs.map -", -] +" +`; + +exports[`CJS -> MJS wrapper > swc > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-experimental-cjs.cjs'; + +export const { CONST, ClassName, a, arrowFunc, b, bar, c, d, e, f, foo, fooRenamed, func, ns1, ns2, ns3 } = data; +export default data.default;" `; -exports[`CJS -> MJS wrapper swc transforms example test case: node-experimental-lib 1`] = ` -[ - "lib/index-node-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > swc > transforms example test case: node-experimental-lib > lib/index-node-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: lib "use strict"; Object.defineProperty(exports, "__esModule", { @@ -6812,14 +6360,11 @@ exports.ns1 = helpers; exports.ns2 = helpers; exports.ns3 = helpers; //# sourceMappingURL=index-node-experimental-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper swc transforms example test case: node-experimental-mjs 1`] = ` -[ - "mjs/index-node-experimental-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > swc > transforms example test case: node-experimental-mjs > mjs/index-node-experimental-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: mjs function foo() {} function bar() {} @@ -6849,27 +6394,11 @@ let DefaultClass = class DefaultClass { // Types should be ignored export { CONST, ClassName, a, arrowFunc, b, bar, c, d, DefaultClass as default, e, f, foo, foo as fooRenamed, func, helpers as ns1, helpers as ns2, helpers as ns3 }; //# sourceMappingURL=index-node-experimental-mjs.mjs.map -", -] -`; - -exports[`CJS -> MJS wrapper swc transforms example test case: node-legacy-cjs 1`] = ` -[ - "cjs/index-node-legacy-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-legacy-cjs.cjs'; - -export const { CONST, ClassName, a, arrowFunc, b, bar, c, d, e, f, foo, fooRenamed, func, ns1, ns2, ns3 } = data; -export default data.default;", -] +" `; -exports[`CJS -> MJS wrapper swc transforms example test case: node-legacy-cjs 2`] = ` -[ - "cjs/index-node-legacy-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > swc > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: cjs "use strict"; Object.defineProperty(exports, "__esModule", { @@ -6917,14 +6446,21 @@ exports.ns1 = helpers; exports.ns2 = helpers; exports.ns3 = helpers; //# sourceMappingURL=index-node-legacy-cjs.cjs.map -", -] +" +`; + +exports[`CJS -> MJS wrapper > swc > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-legacy-cjs.cjs'; + +export const { CONST, ClassName, a, arrowFunc, b, bar, c, d, e, f, foo, fooRenamed, func, ns1, ns2, ns3 } = data; +export default data.default;" `; -exports[`CJS -> MJS wrapper swc transforms example test case: node-legacy-lib 1`] = ` -[ - "lib/index-node-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > swc > transforms example test case: node-legacy-lib > lib/index-node-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: lib "use strict"; Object.defineProperty(exports, "__esModule", { @@ -6972,14 +6508,11 @@ exports.ns1 = helpers; exports.ns2 = helpers; exports.ns3 = helpers; //# sourceMappingURL=index-node-legacy-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper swc transforms example test case: node-legacy-mjs 1`] = ` -[ - "mjs/index-node-legacy-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > swc > transforms example test case: node-legacy-mjs > mjs/index-node-legacy-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: mjs function foo() {} function bar() {} @@ -7009,27 +6542,11 @@ let DefaultClass = class DefaultClass { // Types should be ignored export { CONST, ClassName, a, arrowFunc, b, bar, c, d, DefaultClass as default, e, f, foo, foo as fooRenamed, func, helpers as ns1, helpers as ns2, helpers as ns3 }; //# sourceMappingURL=index-node-legacy-mjs.mjs.map -", -] -`; - -exports[`CJS -> MJS wrapper swc transforms example test case: node-stable-cjs 1`] = ` -[ - "cjs/index-node-stable-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-stable-cjs.cjs'; - -export const { CONST, ClassName, a, arrowFunc, b, bar, c, d, e, f, foo, fooRenamed, func, ns1, ns2, ns3 } = data; -export default data.default;", -] +" `; -exports[`CJS -> MJS wrapper swc transforms example test case: node-stable-cjs 2`] = ` -[ - "cjs/index-node-stable-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > swc > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: cjs "use strict"; Object.defineProperty(exports, "__esModule", { @@ -7077,14 +6594,21 @@ exports.ns1 = helpers; exports.ns2 = helpers; exports.ns3 = helpers; //# sourceMappingURL=index-node-stable-cjs.cjs.map -", -] +" +`; + +exports[`CJS -> MJS wrapper > swc > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-stable-cjs.cjs'; + +export const { CONST, ClassName, a, arrowFunc, b, bar, c, d, e, f, foo, fooRenamed, func, ns1, ns2, ns3 } = data; +export default data.default;" `; -exports[`CJS -> MJS wrapper swc transforms example test case: node-stable-lib 1`] = ` -[ - "lib/index-node-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > swc > transforms example test case: node-stable-lib > lib/index-node-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: lib "use strict"; Object.defineProperty(exports, "__esModule", { @@ -7132,14 +6656,11 @@ exports.ns1 = helpers; exports.ns2 = helpers; exports.ns3 = helpers; //# sourceMappingURL=index-node-stable-lib.js.map -", -] +" `; -exports[`CJS -> MJS wrapper swc transforms example test case: node-stable-mjs 1`] = ` -[ - "mjs/index-node-stable-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`CJS -> MJS wrapper > swc > transforms example test case: node-stable-mjs > mjs/index-node-stable-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: mjs function foo() {} function bar() {} @@ -7169,6 +6690,5 @@ let DefaultClass = class DefaultClass { // Types should be ignored export { CONST, ClassName, a, arrowFunc, b, bar, c, d, DefaultClass as default, e, f, foo, foo as fooRenamed, func, helpers as ns1, helpers as ns2, helpers as ns3 }; //# sourceMappingURL=index-node-stable-mjs.mjs.map -", -] +" `; diff --git a/packages/packemon/tests/examples/__snapshots__/dynamicImports.test.ts.snap b/packages/packemon/tests/examples/__snapshots__/dynamicImports.test.ts.snap index ae283097b..7ab94c4ee 100644 --- a/packages/packemon/tests/examples/__snapshots__/dynamicImports.test.ts.snap +++ b/packages/packemon/tests/examples/__snapshots__/dynamicImports.test.ts.snap @@ -1,23 +1,18 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`Dynamic imports babel transforms example test case: browser-current-esm 1`] = ` -[ - "esm/bundle-3M9lVmk8.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: browser-current-esm > esm/bundle-3M9lVmk8.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: esm function foo() {} function bar() {} export { bar, foo }; //# sourceMappingURL=bundle-3M9lVmk8.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: browser-current-esm 2`] = ` -[ - "esm/index-browser-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: browser-current-esm > esm/index-browser-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: esm import('./bundle-3M9lVmk8.js').then(result => { @@ -29,14 +24,11 @@ import( /* webpackChunkName: "helpers" */'./bundle-3M9lVmk8.js').then(({ bar(); }); //# sourceMappingURL=index-browser-current-esm.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: browser-current-lib 1`] = ` -[ - "lib/bundle-kHKBi9mZ.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: browser-current-lib > lib/bundle-kHKBi9mZ.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: lib 'use strict'; @@ -46,14 +38,11 @@ function bar() {} exports.bar = bar; exports.foo = foo; //# sourceMappingURL=bundle-kHKBi9mZ.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: browser-current-lib 2`] = ` -[ - "lib/index-browser-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: browser-current-lib > lib/index-browser-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: lib 'use strict'; @@ -67,14 +56,11 @@ import( /* webpackChunkName: "helpers" */'./bundle-kHKBi9mZ.js').then(({ bar(); }); //# sourceMappingURL=index-browser-current-lib.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: browser-current-umd 1`] = ` -[ - "umd/bundle-ABwVSm2R.js", - "(function (global, factory) { +exports[`Dynamic imports > babel > transforms example test case: browser-current-umd > umd/bundle-ABwVSm2R.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports"], factory); } else if (typeof exports !== "undefined") { @@ -101,14 +87,11 @@ exports[`Dynamic imports babel transforms example test case: browser-current-umd function bar() {} }); //# sourceMappingURL=bundle-ABwVSm2R.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: browser-current-umd 2`] = ` -[ - "umd/index-browser-current-umd.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: browser-current-umd > umd/index-browser-current-umd.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: umd import('./bundle-ABwVSm2R.js').then(result => { @@ -120,28 +103,22 @@ import( /* webpackChunkName: "helpers" */'./bundle-ABwVSm2R.js').then(({ bar(); }); //# sourceMappingURL=index-browser-current-umd.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: browser-experimental-esm 1`] = ` -[ - "esm/bundle-zhaXZT2y.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: browser-experimental-esm > esm/bundle-zhaXZT2y.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: esm function foo() {} function bar() {} export { bar, foo }; //# sourceMappingURL=bundle-zhaXZT2y.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: browser-experimental-esm 2`] = ` -[ - "esm/index-browser-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: browser-experimental-esm > esm/index-browser-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: esm import('./bundle-zhaXZT2y.js').then(result => { @@ -153,14 +130,11 @@ import( /* webpackChunkName: "helpers" */'./bundle-zhaXZT2y.js').then(({ bar(); }); //# sourceMappingURL=index-browser-experimental-esm.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: browser-experimental-lib 1`] = ` -[ - "lib/bundle-h_GDa_5w.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: browser-experimental-lib > lib/bundle-h_GDa_5w.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: lib 'use strict'; @@ -170,14 +144,11 @@ function bar() {} exports.bar = bar; exports.foo = foo; //# sourceMappingURL=bundle-h_GDa_5w.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: browser-experimental-lib 2`] = ` -[ - "lib/index-browser-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: browser-experimental-lib > lib/index-browser-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: lib 'use strict'; @@ -191,14 +162,11 @@ import( /* webpackChunkName: "helpers" */'./bundle-h_GDa_5w.js').then(({ bar(); }); //# sourceMappingURL=index-browser-experimental-lib.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: browser-experimental-umd 1`] = ` -[ - "umd/bundle-xYfI8Fmt.js", - "(function (global, factory) { +exports[`Dynamic imports > babel > transforms example test case: browser-experimental-umd > umd/bundle-xYfI8Fmt.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports"], factory); } else if (typeof exports !== "undefined") { @@ -225,14 +193,11 @@ exports[`Dynamic imports babel transforms example test case: browser-experimenta function bar() {} }); //# sourceMappingURL=bundle-xYfI8Fmt.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: browser-experimental-umd 2`] = ` -[ - "umd/index-browser-experimental-umd.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: browser-experimental-umd > umd/index-browser-experimental-umd.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: umd import('./bundle-xYfI8Fmt.js').then(result => { @@ -244,28 +209,22 @@ import( /* webpackChunkName: "helpers" */'./bundle-xYfI8Fmt.js').then(({ bar(); }); //# sourceMappingURL=index-browser-experimental-umd.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: browser-legacy-esm 1`] = ` -[ - "esm/bundle-Zh8W98hu.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: browser-legacy-esm > esm/bundle-Zh8W98hu.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: esm function foo() {} function bar() {} export { bar, foo }; //# sourceMappingURL=bundle-Zh8W98hu.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: browser-legacy-esm 2`] = ` -[ - "esm/index-browser-legacy-esm.js", - "var _this = this; +exports[`Dynamic imports > babel > transforms example test case: browser-legacy-esm > esm/index-browser-legacy-esm.js 1`] = ` +"var _this = this; function _newArrowCheck(innerThis, boundThis) { if (innerThis !== boundThis) { throw new TypeError("Cannot instantiate an arrow function"); } } // Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: esm @@ -280,14 +239,11 @@ import( /* webpackChunkName: "helpers" */'./bundle-Zh8W98hu.js').then(function ( bar(); }.bind(this)); //# sourceMappingURL=index-browser-legacy-esm.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: browser-legacy-lib 1`] = ` -[ - "lib/bundle-vPF_A4rU.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: browser-legacy-lib > lib/bundle-vPF_A4rU.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: lib 'use strict'; @@ -297,14 +253,11 @@ function bar() {} exports.bar = bar; exports.foo = foo; //# sourceMappingURL=bundle-vPF_A4rU.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: browser-legacy-lib 2`] = ` -[ - "lib/index-browser-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: browser-legacy-lib > lib/index-browser-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: lib 'use strict'; @@ -321,14 +274,11 @@ import( /* webpackChunkName: "helpers" */'./bundle-vPF_A4rU.js').then(function ( bar(); }.bind(this)); //# sourceMappingURL=index-browser-legacy-lib.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: browser-legacy-umd 1`] = ` -[ - "umd/bundle-fXSu6JQY.js", - "(function (global, factory) { +exports[`Dynamic imports > babel > transforms example test case: browser-legacy-umd > umd/bundle-fXSu6JQY.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports"], factory); } else if (typeof exports !== "undefined") { @@ -355,14 +305,11 @@ exports[`Dynamic imports babel transforms example test case: browser-legacy-umd function bar() {} }); //# sourceMappingURL=bundle-fXSu6JQY.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: browser-legacy-umd 2`] = ` -[ - "umd/index-browser-legacy-umd.js", - "var _this = this; +exports[`Dynamic imports > babel > transforms example test case: browser-legacy-umd > umd/index-browser-legacy-umd.js 1`] = ` +"var _this = this; function _newArrowCheck(innerThis, boundThis) { if (innerThis !== boundThis) { throw new TypeError("Cannot instantiate an arrow function"); } } // Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: umd @@ -377,28 +324,22 @@ import( /* webpackChunkName: "helpers" */'./bundle-fXSu6JQY.js').then(function ( bar(); }.bind(this)); //# sourceMappingURL=index-browser-legacy-umd.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: browser-stable-esm 1`] = ` -[ - "esm/bundle-bXN382qE.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: browser-stable-esm > esm/bundle-bXN382qE.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: esm function foo() {} function bar() {} export { bar, foo }; //# sourceMappingURL=bundle-bXN382qE.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: browser-stable-esm 2`] = ` -[ - "esm/index-browser-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: browser-stable-esm > esm/index-browser-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: esm import('./bundle-bXN382qE.js').then(result => { @@ -410,14 +351,11 @@ import( /* webpackChunkName: "helpers" */'./bundle-bXN382qE.js').then(({ bar(); }); //# sourceMappingURL=index-browser-stable-esm.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: browser-stable-lib 1`] = ` -[ - "lib/bundle-kysAUAQe.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: browser-stable-lib > lib/bundle-kysAUAQe.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: lib 'use strict'; @@ -427,14 +365,11 @@ function bar() {} exports.bar = bar; exports.foo = foo; //# sourceMappingURL=bundle-kysAUAQe.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: browser-stable-lib 2`] = ` -[ - "lib/index-browser-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: browser-stable-lib > lib/index-browser-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: lib 'use strict'; @@ -448,14 +383,11 @@ import( /* webpackChunkName: "helpers" */'./bundle-kysAUAQe.js').then(({ bar(); }); //# sourceMappingURL=index-browser-stable-lib.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: browser-stable-umd 1`] = ` -[ - "umd/bundle-DoGq67TH.js", - "(function (global, factory) { +exports[`Dynamic imports > babel > transforms example test case: browser-stable-umd > umd/bundle-DoGq67TH.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports"], factory); } else if (typeof exports !== "undefined") { @@ -482,14 +414,11 @@ exports[`Dynamic imports babel transforms example test case: browser-stable-umd function bar() {} }); //# sourceMappingURL=bundle-DoGq67TH.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: browser-stable-umd 2`] = ` -[ - "umd/index-browser-stable-umd.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: browser-stable-umd > umd/index-browser-stable-umd.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: umd import('./bundle-DoGq67TH.js').then(result => { @@ -501,28 +430,22 @@ import( /* webpackChunkName: "helpers" */'./bundle-DoGq67TH.js').then(({ bar(); }); //# sourceMappingURL=index-browser-stable-umd.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: electron-current-esm 1`] = ` -[ - "esm/bundle-AuRQPVx5.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: electron-current-esm > esm/bundle-AuRQPVx5.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: esm function foo() {} function bar() {} export { bar, foo }; //# sourceMappingURL=bundle-AuRQPVx5.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: electron-current-esm 2`] = ` -[ - "esm/index-electron-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: electron-current-esm > esm/index-electron-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: esm import('./bundle-AuRQPVx5.js').then(result => { @@ -534,14 +457,11 @@ import( /* webpackChunkName: "helpers" */'./bundle-AuRQPVx5.js').then(({ bar(); }); //# sourceMappingURL=index-electron-current-esm.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: electron-current-lib 1`] = ` -[ - "lib/bundle-1obYgplG.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: electron-current-lib > lib/bundle-1obYgplG.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: lib 'use strict'; @@ -551,14 +471,11 @@ function bar() {} exports.bar = bar; exports.foo = foo; //# sourceMappingURL=bundle-1obYgplG.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: electron-current-lib 2`] = ` -[ - "lib/index-electron-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: electron-current-lib > lib/index-electron-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: lib 'use strict'; @@ -572,28 +489,22 @@ import( /* webpackChunkName: "helpers" */'./bundle-1obYgplG.js').then(({ bar(); }); //# sourceMappingURL=index-electron-current-lib.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: electron-experimental-esm 1`] = ` -[ - "esm/bundle-fcjp6VW1.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: electron-experimental-esm > esm/bundle-fcjp6VW1.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: esm function foo() {} function bar() {} export { bar, foo }; //# sourceMappingURL=bundle-fcjp6VW1.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: electron-experimental-esm 2`] = ` -[ - "esm/index-electron-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: electron-experimental-esm > esm/index-electron-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: esm import('./bundle-fcjp6VW1.js').then(result => { @@ -605,14 +516,11 @@ import( /* webpackChunkName: "helpers" */'./bundle-fcjp6VW1.js').then(({ bar(); }); //# sourceMappingURL=index-electron-experimental-esm.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: electron-experimental-lib 1`] = ` -[ - "lib/bundle-ERO7dll3.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: electron-experimental-lib > lib/bundle-ERO7dll3.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: lib 'use strict'; @@ -622,14 +530,11 @@ function bar() {} exports.bar = bar; exports.foo = foo; //# sourceMappingURL=bundle-ERO7dll3.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: electron-experimental-lib 2`] = ` -[ - "lib/index-electron-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: electron-experimental-lib > lib/index-electron-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: lib 'use strict'; @@ -643,28 +548,22 @@ import( /* webpackChunkName: "helpers" */'./bundle-ERO7dll3.js').then(({ bar(); }); //# sourceMappingURL=index-electron-experimental-lib.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: electron-legacy-esm 1`] = ` -[ - "esm/bundle-0b7TsP3m.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: electron-legacy-esm > esm/bundle-0b7TsP3m.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: esm function foo() {} function bar() {} export { bar, foo }; //# sourceMappingURL=bundle-0b7TsP3m.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: electron-legacy-esm 2`] = ` -[ - "esm/index-electron-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: electron-legacy-esm > esm/index-electron-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: esm import('./bundle-0b7TsP3m.js').then(result => { @@ -676,14 +575,11 @@ import( /* webpackChunkName: "helpers" */'./bundle-0b7TsP3m.js').then(({ bar(); }); //# sourceMappingURL=index-electron-legacy-esm.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: electron-legacy-lib 1`] = ` -[ - "lib/bundle-HVCtTKei.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: electron-legacy-lib > lib/bundle-HVCtTKei.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: lib 'use strict'; @@ -693,14 +589,11 @@ function bar() {} exports.bar = bar; exports.foo = foo; //# sourceMappingURL=bundle-HVCtTKei.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: electron-legacy-lib 2`] = ` -[ - "lib/index-electron-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: electron-legacy-lib > lib/index-electron-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: lib 'use strict'; @@ -714,28 +607,22 @@ import( /* webpackChunkName: "helpers" */'./bundle-HVCtTKei.js').then(({ bar(); }); //# sourceMappingURL=index-electron-legacy-lib.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: electron-stable-esm 1`] = ` -[ - "esm/bundle-eJ16P6Ik.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: electron-stable-esm > esm/bundle-eJ16P6Ik.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: esm function foo() {} function bar() {} export { bar, foo }; //# sourceMappingURL=bundle-eJ16P6Ik.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: electron-stable-esm 2`] = ` -[ - "esm/index-electron-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: electron-stable-esm > esm/index-electron-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: esm import('./bundle-eJ16P6Ik.js').then(result => { @@ -747,14 +634,11 @@ import( /* webpackChunkName: "helpers" */'./bundle-eJ16P6Ik.js').then(({ bar(); }); //# sourceMappingURL=index-electron-stable-esm.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: electron-stable-lib 1`] = ` -[ - "lib/bundle-TH51JAs8.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: electron-stable-lib > lib/bundle-TH51JAs8.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: lib 'use strict'; @@ -764,14 +648,11 @@ function bar() {} exports.bar = bar; exports.foo = foo; //# sourceMappingURL=bundle-TH51JAs8.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: electron-stable-lib 2`] = ` -[ - "lib/index-electron-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: electron-stable-lib > lib/index-electron-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: lib 'use strict'; @@ -785,14 +666,11 @@ import( /* webpackChunkName: "helpers" */'./bundle-TH51JAs8.js').then(({ bar(); }); //# sourceMappingURL=index-electron-stable-lib.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: native-current-lib 1`] = ` -[ - "lib/bundle-Pctkl0OM.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: native-current-lib > lib/bundle-Pctkl0OM.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: current, Format: lib 'use strict'; @@ -802,35 +680,29 @@ function bar() {} exports.bar = bar; exports.foo = foo; //# sourceMappingURL=bundle-Pctkl0OM.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: native-current-lib 2`] = ` -[ - "lib/index-native-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: native-current-lib > lib/index-native-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: current, Format: lib 'use strict'; -Promise.resolve().then(() => require('./bundle-Pctkl0OM.js')).then(result => { +import('./bundle-Pctkl0OM.js').then(result => { result.foo(); }); -Promise.resolve().then(() => require( /* webpackChunkName: "helpers" */'./bundle-Pctkl0OM.js')).then(({ +import( /* webpackChunkName: "helpers" */'./bundle-Pctkl0OM.js').then(({ bar }) => { bar(); }); //# sourceMappingURL=index-native-current-lib.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: native-experimental-lib 1`] = ` -[ - "lib/bundle-9YJidWY8.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: native-experimental-lib > lib/bundle-9YJidWY8.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: experimental, Format: lib 'use strict'; @@ -840,35 +712,29 @@ function bar() {} exports.bar = bar; exports.foo = foo; //# sourceMappingURL=bundle-9YJidWY8.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: native-experimental-lib 2`] = ` -[ - "lib/index-native-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: native-experimental-lib > lib/index-native-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: experimental, Format: lib 'use strict'; -Promise.resolve().then(() => require('./bundle-9YJidWY8.js')).then(result => { +import('./bundle-9YJidWY8.js').then(result => { result.foo(); }); -Promise.resolve().then(() => require( /* webpackChunkName: "helpers" */'./bundle-9YJidWY8.js')).then(({ +import( /* webpackChunkName: "helpers" */'./bundle-9YJidWY8.js').then(({ bar }) => { bar(); }); //# sourceMappingURL=index-native-experimental-lib.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: native-legacy-lib 1`] = ` -[ - "lib/bundle-N5SU9kaz.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: native-legacy-lib > lib/bundle-N5SU9kaz.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: legacy, Format: lib 'use strict'; @@ -878,35 +744,29 @@ function bar() {} exports.bar = bar; exports.foo = foo; //# sourceMappingURL=bundle-N5SU9kaz.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: native-legacy-lib 2`] = ` -[ - "lib/index-native-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: native-legacy-lib > lib/index-native-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: legacy, Format: lib 'use strict'; -Promise.resolve().then(() => require('./bundle-N5SU9kaz.js')).then(result => { +import('./bundle-N5SU9kaz.js').then(result => { result.foo(); }); -Promise.resolve().then(() => require( /* webpackChunkName: "helpers" */'./bundle-N5SU9kaz.js')).then(({ +import( /* webpackChunkName: "helpers" */'./bundle-N5SU9kaz.js').then(({ bar }) => { bar(); }); //# sourceMappingURL=index-native-legacy-lib.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: native-stable-lib 1`] = ` -[ - "lib/bundle-jpwc-oDR.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: native-stable-lib > lib/bundle-jpwc-oDR.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: stable, Format: lib 'use strict'; @@ -916,35 +776,29 @@ function bar() {} exports.bar = bar; exports.foo = foo; //# sourceMappingURL=bundle-jpwc-oDR.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: native-stable-lib 2`] = ` -[ - "lib/index-native-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: native-stable-lib > lib/index-native-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: stable, Format: lib 'use strict'; -Promise.resolve().then(() => require('./bundle-jpwc-oDR.js')).then(result => { +import('./bundle-jpwc-oDR.js').then(result => { result.foo(); }); -Promise.resolve().then(() => require( /* webpackChunkName: "helpers" */'./bundle-jpwc-oDR.js')).then(({ +import( /* webpackChunkName: "helpers" */'./bundle-jpwc-oDR.js').then(({ bar }) => { bar(); }); //# sourceMappingURL=index-native-stable-lib.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: node-current-cjs 1`] = ` -[ - "cjs/bundle-_71PWQLV.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: node-current-cjs > cjs/bundle-_71PWQLV.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: cjs 'use strict'; @@ -954,24 +808,11 @@ function bar() {} exports.bar = bar; exports.foo = foo; //# sourceMappingURL=bundle-_71PWQLV.cjs.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: node-current-cjs 2`] = ` -[ - "cjs/index-node-current-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import './index-node-current-cjs.cjs';", -] -`; - -exports[`Dynamic imports babel transforms example test case: node-current-cjs 3`] = ` -[ - "cjs/index-node-current-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: node-current-cjs > cjs/index-node-current-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: cjs 'use strict'; @@ -985,14 +826,18 @@ import( /* webpackChunkName: "helpers" */'./bundle-_71PWQLV.cjs').then(({ bar(); }); //# sourceMappingURL=index-node-current-cjs.cjs.map -", -] +" +`; + +exports[`Dynamic imports > babel > transforms example test case: node-current-cjs > cjs/index-node-current-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-current-cjs.cjs';" `; -exports[`Dynamic imports babel transforms example test case: node-current-lib 1`] = ` -[ - "lib/bundle-kA87Rk4F.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: node-current-lib > lib/bundle-kA87Rk4F.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: lib 'use strict'; @@ -1002,14 +847,11 @@ function bar() {} exports.bar = bar; exports.foo = foo; //# sourceMappingURL=bundle-kA87Rk4F.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: node-current-lib 2`] = ` -[ - "lib/index-node-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: node-current-lib > lib/index-node-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: lib 'use strict'; @@ -1023,28 +865,22 @@ import( /* webpackChunkName: "helpers" */'./bundle-kA87Rk4F.js').then(({ bar(); }); //# sourceMappingURL=index-node-current-lib.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: node-current-mjs 1`] = ` -[ - "mjs/bundle-BK-paazK.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: node-current-mjs > mjs/bundle-BK-paazK.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: mjs function foo() {} function bar() {} export { bar, foo }; //# sourceMappingURL=bundle-BK-paazK.mjs.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: node-current-mjs 2`] = ` -[ - "mjs/index-node-current-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: node-current-mjs > mjs/index-node-current-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: mjs import('./bundle-BK-paazK.mjs').then(result => { @@ -1056,14 +892,11 @@ import( /* webpackChunkName: "helpers" */'./bundle-BK-paazK.mjs').then(({ bar(); }); //# sourceMappingURL=index-node-current-mjs.mjs.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: node-experimental-cjs 1`] = ` -[ - "cjs/bundle-DAKsN3xY.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: node-experimental-cjs > cjs/bundle-DAKsN3xY.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: cjs 'use strict'; @@ -1073,24 +906,11 @@ function bar() {} exports.bar = bar; exports.foo = foo; //# sourceMappingURL=bundle-DAKsN3xY.cjs.map -", -] -`; - -exports[`Dynamic imports babel transforms example test case: node-experimental-cjs 2`] = ` -[ - "cjs/index-node-experimental-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import './index-node-experimental-cjs.cjs';", -] +" `; -exports[`Dynamic imports babel transforms example test case: node-experimental-cjs 3`] = ` -[ - "cjs/index-node-experimental-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: cjs 'use strict'; @@ -1104,14 +924,18 @@ import( /* webpackChunkName: "helpers" */'./bundle-DAKsN3xY.cjs').then(({ bar(); }); //# sourceMappingURL=index-node-experimental-cjs.cjs.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: node-experimental-lib 1`] = ` -[ - "lib/bundle-az7ZSxOo.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-experimental-cjs.cjs';" +`; + +exports[`Dynamic imports > babel > transforms example test case: node-experimental-lib > lib/bundle-az7ZSxOo.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: lib 'use strict'; @@ -1121,14 +945,11 @@ function bar() {} exports.bar = bar; exports.foo = foo; //# sourceMappingURL=bundle-az7ZSxOo.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: node-experimental-lib 2`] = ` -[ - "lib/index-node-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: node-experimental-lib > lib/index-node-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: lib 'use strict'; @@ -1142,28 +963,22 @@ import( /* webpackChunkName: "helpers" */'./bundle-az7ZSxOo.js').then(({ bar(); }); //# sourceMappingURL=index-node-experimental-lib.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: node-experimental-mjs 1`] = ` -[ - "mjs/bundle-UAQNGTBj.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: node-experimental-mjs > mjs/bundle-UAQNGTBj.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: mjs function foo() {} function bar() {} export { bar, foo }; //# sourceMappingURL=bundle-UAQNGTBj.mjs.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: node-experimental-mjs 2`] = ` -[ - "mjs/index-node-experimental-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: node-experimental-mjs > mjs/index-node-experimental-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: mjs import('./bundle-UAQNGTBj.mjs').then(result => { @@ -1175,14 +990,11 @@ import( /* webpackChunkName: "helpers" */'./bundle-UAQNGTBj.mjs').then(({ bar(); }); //# sourceMappingURL=index-node-experimental-mjs.mjs.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: node-legacy-cjs 1`] = ` -[ - "cjs/bundle-R7c4FVRE.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: node-legacy-cjs > cjs/bundle-R7c4FVRE.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: cjs 'use strict'; @@ -1192,24 +1004,11 @@ function bar() {} exports.bar = bar; exports.foo = foo; //# sourceMappingURL=bundle-R7c4FVRE.cjs.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: node-legacy-cjs 2`] = ` -[ - "cjs/index-node-legacy-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import './index-node-legacy-cjs.cjs';", -] -`; - -exports[`Dynamic imports babel transforms example test case: node-legacy-cjs 3`] = ` -[ - "cjs/index-node-legacy-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: cjs 'use strict'; @@ -1223,14 +1022,18 @@ import( /* webpackChunkName: "helpers" */'./bundle-R7c4FVRE.cjs').then(({ bar(); }); //# sourceMappingURL=index-node-legacy-cjs.cjs.map -", -] +" +`; + +exports[`Dynamic imports > babel > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-legacy-cjs.cjs';" `; -exports[`Dynamic imports babel transforms example test case: node-legacy-lib 1`] = ` -[ - "lib/bundle-3n_KI-v0.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: node-legacy-lib > lib/bundle-3n_KI-v0.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: lib 'use strict'; @@ -1240,14 +1043,11 @@ function bar() {} exports.bar = bar; exports.foo = foo; //# sourceMappingURL=bundle-3n_KI-v0.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: node-legacy-lib 2`] = ` -[ - "lib/index-node-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: node-legacy-lib > lib/index-node-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: lib 'use strict'; @@ -1261,28 +1061,22 @@ import( /* webpackChunkName: "helpers" */'./bundle-3n_KI-v0.js').then(({ bar(); }); //# sourceMappingURL=index-node-legacy-lib.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: node-legacy-mjs 1`] = ` -[ - "mjs/bundle-YzUH8RD0.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: node-legacy-mjs > mjs/bundle-YzUH8RD0.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: mjs function foo() {} function bar() {} export { bar, foo }; //# sourceMappingURL=bundle-YzUH8RD0.mjs.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: node-legacy-mjs 2`] = ` -[ - "mjs/index-node-legacy-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: node-legacy-mjs > mjs/index-node-legacy-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: mjs import('./bundle-YzUH8RD0.mjs').then(result => { @@ -1294,14 +1088,11 @@ import( /* webpackChunkName: "helpers" */'./bundle-YzUH8RD0.mjs').then(({ bar(); }); //# sourceMappingURL=index-node-legacy-mjs.mjs.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: node-stable-cjs 1`] = ` -[ - "cjs/bundle-9YUm9Bbo.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: node-stable-cjs > cjs/bundle-9YUm9Bbo.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: cjs 'use strict'; @@ -1311,24 +1102,11 @@ function bar() {} exports.bar = bar; exports.foo = foo; //# sourceMappingURL=bundle-9YUm9Bbo.cjs.map -", -] -`; - -exports[`Dynamic imports babel transforms example test case: node-stable-cjs 2`] = ` -[ - "cjs/index-node-stable-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import './index-node-stable-cjs.cjs';", -] +" `; -exports[`Dynamic imports babel transforms example test case: node-stable-cjs 3`] = ` -[ - "cjs/index-node-stable-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: cjs 'use strict'; @@ -1342,14 +1120,18 @@ import( /* webpackChunkName: "helpers" */'./bundle-9YUm9Bbo.cjs').then(({ bar(); }); //# sourceMappingURL=index-node-stable-cjs.cjs.map -", -] +" +`; + +exports[`Dynamic imports > babel > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-stable-cjs.cjs';" `; -exports[`Dynamic imports babel transforms example test case: node-stable-lib 1`] = ` -[ - "lib/bundle-hCJ2hPkz.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: node-stable-lib > lib/bundle-hCJ2hPkz.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: lib 'use strict'; @@ -1359,14 +1141,11 @@ function bar() {} exports.bar = bar; exports.foo = foo; //# sourceMappingURL=bundle-hCJ2hPkz.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: node-stable-lib 2`] = ` -[ - "lib/index-node-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: node-stable-lib > lib/index-node-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: lib 'use strict'; @@ -1380,28 +1159,22 @@ import( /* webpackChunkName: "helpers" */'./bundle-hCJ2hPkz.js').then(({ bar(); }); //# sourceMappingURL=index-node-stable-lib.js.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: node-stable-mjs 1`] = ` -[ - "mjs/bundle-N2mxTj-7.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: node-stable-mjs > mjs/bundle-N2mxTj-7.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: mjs function foo() {} function bar() {} export { bar, foo }; //# sourceMappingURL=bundle-N2mxTj-7.mjs.map -", -] +" `; -exports[`Dynamic imports babel transforms example test case: node-stable-mjs 2`] = ` -[ - "mjs/index-node-stable-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > babel > transforms example test case: node-stable-mjs > mjs/index-node-stable-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: mjs import('./bundle-N2mxTj-7.mjs').then(result => { @@ -1413,27 +1186,21 @@ import( /* webpackChunkName: "helpers" */'./bundle-N2mxTj-7.mjs').then(({ bar(); }); //# sourceMappingURL=index-node-stable-mjs.mjs.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: browser-current-esm 1`] = ` -[ - "esm/bundle-NLqBMetY.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: browser-current-esm > esm/bundle-NLqBMetY.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: esm function foo() {} function bar() {} export { bar, foo }; //# sourceMappingURL=bundle-NLqBMetY.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: browser-current-esm 2`] = ` -[ - "esm/index-browser-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: browser-current-esm > esm/index-browser-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: esm import("./bundle-NLqBMetY.js").then((result)=>{ result.foo(); @@ -1442,14 +1209,11 @@ import(/* webpackChunkName: "helpers" */ "./bundle-NLqBMetY.js").then(({ bar })= bar(); }); //# sourceMappingURL=index-browser-current-esm.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: browser-current-lib 1`] = ` -[ - "lib/bundle-utDa9_O8.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: browser-current-lib > lib/bundle-utDa9_O8.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: lib "use strict"; function foo() {} @@ -1457,14 +1221,11 @@ function bar() {} exports.bar = bar; exports.foo = foo; //# sourceMappingURL=bundle-utDa9_O8.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: browser-current-lib 2`] = ` -[ - "lib/index-browser-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: browser-current-lib > lib/index-browser-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: lib "use strict"; import("./bundle-utDa9_O8.js").then((result)=>{ @@ -1474,14 +1235,11 @@ import(/* webpackChunkName: "helpers" */ "./bundle-utDa9_O8.js").then(({ bar })= bar(); }); //# sourceMappingURL=index-browser-current-lib.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: browser-current-umd 1`] = ` -[ - "umd/bundle-b2GC_i-K.js", - "(function(global, factory) { +exports[`Dynamic imports > swc > transforms example test case: browser-current-umd > umd/bundle-b2GC_i-K.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports); else if (typeof define === "function" && define.amd) define([ "exports" @@ -1510,19 +1268,57 @@ exports[`Dynamic imports swc transforms example test case: browser-current-umd 1 function bar() {} }); //# sourceMappingURL=bundle-b2GC_i-K.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: browser-current-umd 2`] = ` -[ - "umd/index-browser-current-umd.js", - "(function(global, factory) { +exports[`Dynamic imports > swc > transforms example test case: browser-current-umd > umd/index-browser-current-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(); else if (typeof define === "function" && define.amd) define([], factory); else if (global = typeof globalThis !== "undefined" ? globalThis : global || self) factory(); })(this, function() { "use strict"; + function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== "function") return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function(nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); + } + function _interop_require_wildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || typeof obj !== "object" && typeof obj !== "function") { + return { + default: obj + }; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = { + __proto__: null + }; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for(var key in obj){ + if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } import("./bundle-b2GC_i-K.js").then((result)=>{ result.foo(); }); @@ -1531,27 +1327,21 @@ exports[`Dynamic imports swc transforms example test case: browser-current-umd 2 }); }); //# sourceMappingURL=index-browser-current-umd.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: browser-experimental-esm 1`] = ` -[ - "esm/bundle-oBG6aZke.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: browser-experimental-esm > esm/bundle-oBG6aZke.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: esm function foo() {} function bar() {} export { bar, foo }; //# sourceMappingURL=bundle-oBG6aZke.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: browser-experimental-esm 2`] = ` -[ - "esm/index-browser-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: browser-experimental-esm > esm/index-browser-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: esm import("./bundle-oBG6aZke.js").then((result)=>{ result.foo(); @@ -1560,14 +1350,11 @@ import(/* webpackChunkName: "helpers" */ "./bundle-oBG6aZke.js").then(({ bar })= bar(); }); //# sourceMappingURL=index-browser-experimental-esm.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: browser-experimental-lib 1`] = ` -[ - "lib/bundle-azzoyFhI.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: browser-experimental-lib > lib/bundle-azzoyFhI.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: lib "use strict"; function foo() {} @@ -1575,14 +1362,11 @@ function bar() {} exports.bar = bar; exports.foo = foo; //# sourceMappingURL=bundle-azzoyFhI.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: browser-experimental-lib 2`] = ` -[ - "lib/index-browser-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: browser-experimental-lib > lib/index-browser-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: lib "use strict"; import("./bundle-azzoyFhI.js").then((result)=>{ @@ -1592,14 +1376,11 @@ import(/* webpackChunkName: "helpers" */ "./bundle-azzoyFhI.js").then(({ bar })= bar(); }); //# sourceMappingURL=index-browser-experimental-lib.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: browser-experimental-umd 1`] = ` -[ - "umd/bundle-b2GC_i-K.js", - "(function(global, factory) { +exports[`Dynamic imports > swc > transforms example test case: browser-experimental-umd > umd/bundle-b2GC_i-K.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports); else if (typeof define === "function" && define.amd) define([ "exports" @@ -1628,19 +1409,57 @@ exports[`Dynamic imports swc transforms example test case: browser-experimental- function bar() {} }); //# sourceMappingURL=bundle-b2GC_i-K.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: browser-experimental-umd 2`] = ` -[ - "umd/index-browser-experimental-umd.js", - "(function(global, factory) { +exports[`Dynamic imports > swc > transforms example test case: browser-experimental-umd > umd/index-browser-experimental-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(); else if (typeof define === "function" && define.amd) define([], factory); else if (global = typeof globalThis !== "undefined" ? globalThis : global || self) factory(); })(this, function() { "use strict"; + function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== "function") return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function(nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); + } + function _interop_require_wildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || typeof obj !== "object" && typeof obj !== "function") { + return { + default: obj + }; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = { + __proto__: null + }; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for(var key in obj){ + if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } import("./bundle-b2GC_i-K.js").then((result)=>{ result.foo(); }); @@ -1649,27 +1468,21 @@ exports[`Dynamic imports swc transforms example test case: browser-experimental- }); }); //# sourceMappingURL=index-browser-experimental-umd.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: browser-legacy-esm 1`] = ` -[ - "esm/bundle-92DHqCjr.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: browser-legacy-esm > esm/bundle-92DHqCjr.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: esm function foo() {} function bar() {} export { bar, foo }; //# sourceMappingURL=bundle-92DHqCjr.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: browser-legacy-esm 2`] = ` -[ - "esm/index-browser-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: browser-legacy-esm > esm/index-browser-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: esm import("./bundle-92DHqCjr.js").then(function(result) { result.foo(); @@ -1679,14 +1492,11 @@ import(/* webpackChunkName: "helpers" */ "./bundle-92DHqCjr.js").then(function(p bar(); }); //# sourceMappingURL=index-browser-legacy-esm.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: browser-legacy-lib 1`] = ` -[ - "lib/bundle-E6nrlNAi.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: browser-legacy-lib > lib/bundle-E6nrlNAi.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: lib "use strict"; function foo() {} @@ -1694,14 +1504,11 @@ function bar() {} exports.bar = bar; exports.foo = foo; //# sourceMappingURL=bundle-E6nrlNAi.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: browser-legacy-lib 2`] = ` -[ - "lib/index-browser-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: browser-legacy-lib > lib/index-browser-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: lib "use strict"; import("./bundle-E6nrlNAi.js").then(function(result) { @@ -1712,14 +1519,11 @@ import(/* webpackChunkName: "helpers" */ "./bundle-E6nrlNAi.js").then(function(p bar(); }); //# sourceMappingURL=index-browser-legacy-lib.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: browser-legacy-umd 1`] = ` -[ - "umd/bundle-b2GC_i-K.js", - "(function(global, factory) { +exports[`Dynamic imports > swc > transforms example test case: browser-legacy-umd > umd/bundle-b2GC_i-K.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports); else if (typeof define === "function" && define.amd) define([ "exports" @@ -1748,19 +1552,57 @@ exports[`Dynamic imports swc transforms example test case: browser-legacy-umd 1` function bar() {} }); //# sourceMappingURL=bundle-b2GC_i-K.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: browser-legacy-umd 2`] = ` -[ - "umd/index-browser-legacy-umd.js", - "(function(global, factory) { +exports[`Dynamic imports > swc > transforms example test case: browser-legacy-umd > umd/index-browser-legacy-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(); else if (typeof define === "function" && define.amd) define([], factory); else if (global = typeof globalThis !== "undefined" ? globalThis : global || self) factory(); })(this, function() { "use strict"; + function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== "function") return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function(nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); + } + function _interop_require_wildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || typeof obj !== "object" && typeof obj !== "function") { + return { + default: obj + }; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = { + __proto__: null + }; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for(var key in obj){ + if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } import("./bundle-b2GC_i-K.js").then(function(result) { result.foo(); }); @@ -1770,27 +1612,21 @@ exports[`Dynamic imports swc transforms example test case: browser-legacy-umd 2` }); }); //# sourceMappingURL=index-browser-legacy-umd.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: browser-stable-esm 1`] = ` -[ - "esm/bundle-2ydu3TQy.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: browser-stable-esm > esm/bundle-2ydu3TQy.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: esm function foo() {} function bar() {} export { bar, foo }; //# sourceMappingURL=bundle-2ydu3TQy.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: browser-stable-esm 2`] = ` -[ - "esm/index-browser-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: browser-stable-esm > esm/index-browser-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: esm import("./bundle-2ydu3TQy.js").then((result)=>{ result.foo(); @@ -1799,14 +1635,11 @@ import(/* webpackChunkName: "helpers" */ "./bundle-2ydu3TQy.js").then(({ bar })= bar(); }); //# sourceMappingURL=index-browser-stable-esm.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: browser-stable-lib 1`] = ` -[ - "lib/bundle-ktd5u-Mc.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: browser-stable-lib > lib/bundle-ktd5u-Mc.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: lib "use strict"; function foo() {} @@ -1814,14 +1647,11 @@ function bar() {} exports.bar = bar; exports.foo = foo; //# sourceMappingURL=bundle-ktd5u-Mc.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: browser-stable-lib 2`] = ` -[ - "lib/index-browser-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: browser-stable-lib > lib/index-browser-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: lib "use strict"; import("./bundle-ktd5u-Mc.js").then((result)=>{ @@ -1831,14 +1661,11 @@ import(/* webpackChunkName: "helpers" */ "./bundle-ktd5u-Mc.js").then(({ bar })= bar(); }); //# sourceMappingURL=index-browser-stable-lib.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: browser-stable-umd 1`] = ` -[ - "umd/bundle-b2GC_i-K.js", - "(function(global, factory) { +exports[`Dynamic imports > swc > transforms example test case: browser-stable-umd > umd/bundle-b2GC_i-K.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports); else if (typeof define === "function" && define.amd) define([ "exports" @@ -1867,19 +1694,57 @@ exports[`Dynamic imports swc transforms example test case: browser-stable-umd 1` function bar() {} }); //# sourceMappingURL=bundle-b2GC_i-K.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: browser-stable-umd 2`] = ` -[ - "umd/index-browser-stable-umd.js", - "(function(global, factory) { +exports[`Dynamic imports > swc > transforms example test case: browser-stable-umd > umd/index-browser-stable-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(); else if (typeof define === "function" && define.amd) define([], factory); else if (global = typeof globalThis !== "undefined" ? globalThis : global || self) factory(); })(this, function() { "use strict"; + function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== "function") return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function(nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); + } + function _interop_require_wildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || typeof obj !== "object" && typeof obj !== "function") { + return { + default: obj + }; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = { + __proto__: null + }; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for(var key in obj){ + if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; + } import("./bundle-b2GC_i-K.js").then((result)=>{ result.foo(); }); @@ -1888,27 +1753,21 @@ exports[`Dynamic imports swc transforms example test case: browser-stable-umd 2` }); }); //# sourceMappingURL=index-browser-stable-umd.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: electron-current-esm 1`] = ` -[ - "esm/bundle-cJW1qcOY.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: electron-current-esm > esm/bundle-cJW1qcOY.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: esm function foo() {} function bar() {} export { bar, foo }; //# sourceMappingURL=bundle-cJW1qcOY.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: electron-current-esm 2`] = ` -[ - "esm/index-electron-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: electron-current-esm > esm/index-electron-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: esm import("./bundle-cJW1qcOY.js").then((result)=>{ result.foo(); @@ -1917,14 +1776,11 @@ import(/* webpackChunkName: "helpers" */ "./bundle-cJW1qcOY.js").then(({ bar })= bar(); }); //# sourceMappingURL=index-electron-current-esm.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: electron-current-lib 1`] = ` -[ - "lib/bundle-aqzY33Db.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: electron-current-lib > lib/bundle-aqzY33Db.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: lib "use strict"; function foo() {} @@ -1932,14 +1788,11 @@ function bar() {} exports.bar = bar; exports.foo = foo; //# sourceMappingURL=bundle-aqzY33Db.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: electron-current-lib 2`] = ` -[ - "lib/index-electron-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: electron-current-lib > lib/index-electron-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: lib "use strict"; import("./bundle-aqzY33Db.js").then((result)=>{ @@ -1949,27 +1802,21 @@ import(/* webpackChunkName: "helpers" */ "./bundle-aqzY33Db.js").then(({ bar })= bar(); }); //# sourceMappingURL=index-electron-current-lib.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: electron-experimental-esm 1`] = ` -[ - "esm/bundle-okQF6WJs.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: electron-experimental-esm > esm/bundle-okQF6WJs.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: esm function foo() {} function bar() {} export { bar, foo }; //# sourceMappingURL=bundle-okQF6WJs.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: electron-experimental-esm 2`] = ` -[ - "esm/index-electron-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: electron-experimental-esm > esm/index-electron-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: esm import("./bundle-okQF6WJs.js").then((result)=>{ result.foo(); @@ -1978,14 +1825,11 @@ import(/* webpackChunkName: "helpers" */ "./bundle-okQF6WJs.js").then(({ bar })= bar(); }); //# sourceMappingURL=index-electron-experimental-esm.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: electron-experimental-lib 1`] = ` -[ - "lib/bundle-90F0lDEa.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: electron-experimental-lib > lib/bundle-90F0lDEa.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: lib "use strict"; function foo() {} @@ -1993,14 +1837,11 @@ function bar() {} exports.bar = bar; exports.foo = foo; //# sourceMappingURL=bundle-90F0lDEa.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: electron-experimental-lib 2`] = ` -[ - "lib/index-electron-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: electron-experimental-lib > lib/index-electron-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: lib "use strict"; import("./bundle-90F0lDEa.js").then((result)=>{ @@ -2010,27 +1851,21 @@ import(/* webpackChunkName: "helpers" */ "./bundle-90F0lDEa.js").then(({ bar })= bar(); }); //# sourceMappingURL=index-electron-experimental-lib.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: electron-legacy-esm 1`] = ` -[ - "esm/bundle-2IkUES5f.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: electron-legacy-esm > esm/bundle-2IkUES5f.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: esm function foo() {} function bar() {} export { bar, foo }; //# sourceMappingURL=bundle-2IkUES5f.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: electron-legacy-esm 2`] = ` -[ - "esm/index-electron-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: electron-legacy-esm > esm/index-electron-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: esm import("./bundle-2IkUES5f.js").then((result)=>{ result.foo(); @@ -2039,14 +1874,11 @@ import(/* webpackChunkName: "helpers" */ "./bundle-2IkUES5f.js").then(({ bar })= bar(); }); //# sourceMappingURL=index-electron-legacy-esm.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: electron-legacy-lib 1`] = ` -[ - "lib/bundle-ebugfJSh.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: electron-legacy-lib > lib/bundle-ebugfJSh.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: lib "use strict"; function foo() {} @@ -2054,14 +1886,11 @@ function bar() {} exports.bar = bar; exports.foo = foo; //# sourceMappingURL=bundle-ebugfJSh.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: electron-legacy-lib 2`] = ` -[ - "lib/index-electron-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: electron-legacy-lib > lib/index-electron-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: lib "use strict"; import("./bundle-ebugfJSh.js").then((result)=>{ @@ -2071,27 +1900,21 @@ import(/* webpackChunkName: "helpers" */ "./bundle-ebugfJSh.js").then(({ bar })= bar(); }); //# sourceMappingURL=index-electron-legacy-lib.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: electron-stable-esm 1`] = ` -[ - "esm/bundle-a93ZhMR_.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: electron-stable-esm > esm/bundle-a93ZhMR_.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: esm function foo() {} function bar() {} export { bar, foo }; //# sourceMappingURL=bundle-a93ZhMR_.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: electron-stable-esm 2`] = ` -[ - "esm/index-electron-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: electron-stable-esm > esm/index-electron-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: esm import("./bundle-a93ZhMR_.js").then((result)=>{ result.foo(); @@ -2100,14 +1923,11 @@ import(/* webpackChunkName: "helpers" */ "./bundle-a93ZhMR_.js").then(({ bar })= bar(); }); //# sourceMappingURL=index-electron-stable-esm.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: electron-stable-lib 1`] = ` -[ - "lib/bundle-Hqs1JeVJ.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: electron-stable-lib > lib/bundle-Hqs1JeVJ.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: lib "use strict"; function foo() {} @@ -2115,14 +1935,11 @@ function bar() {} exports.bar = bar; exports.foo = foo; //# sourceMappingURL=bundle-Hqs1JeVJ.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: electron-stable-lib 2`] = ` -[ - "lib/index-electron-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: electron-stable-lib > lib/index-electron-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: lib "use strict"; import("./bundle-Hqs1JeVJ.js").then((result)=>{ @@ -2132,14 +1949,11 @@ import(/* webpackChunkName: "helpers" */ "./bundle-Hqs1JeVJ.js").then(({ bar })= bar(); }); //# sourceMappingURL=index-electron-stable-lib.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: native-current-lib 1`] = ` -[ - "lib/bundle-3zLFMKSE.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: native-current-lib > lib/bundle-3zLFMKSE.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: current, Format: lib "use strict"; function foo() {} @@ -2147,31 +1961,25 @@ function bar() {} exports.bar = bar; exports.foo = foo; //# sourceMappingURL=bundle-3zLFMKSE.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: native-current-lib 2`] = ` -[ - "lib/index-native-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: native-current-lib > lib/index-native-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: current, Format: lib "use strict"; -Promise.resolve().then(()=>require("./bundle-3zLFMKSE.js")).then((result)=>{ +import("./bundle-3zLFMKSE.js").then((result)=>{ result.foo(); }); -Promise.resolve().then(()=>require(/* webpackChunkName: "helpers" */ "./bundle-3zLFMKSE.js")).then(({ bar })=>{ +import(/* webpackChunkName: "helpers" */ "./bundle-3zLFMKSE.js").then(({ bar })=>{ bar(); }); //# sourceMappingURL=index-native-current-lib.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: native-experimental-lib 1`] = ` -[ - "lib/bundle-yUS5CVMs.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: native-experimental-lib > lib/bundle-yUS5CVMs.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: experimental, Format: lib "use strict"; function foo() {} @@ -2179,31 +1987,25 @@ function bar() {} exports.bar = bar; exports.foo = foo; //# sourceMappingURL=bundle-yUS5CVMs.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: native-experimental-lib 2`] = ` -[ - "lib/index-native-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: native-experimental-lib > lib/index-native-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: experimental, Format: lib "use strict"; -Promise.resolve().then(()=>require("./bundle-yUS5CVMs.js")).then((result)=>{ +import("./bundle-yUS5CVMs.js").then((result)=>{ result.foo(); }); -Promise.resolve().then(()=>require(/* webpackChunkName: "helpers" */ "./bundle-yUS5CVMs.js")).then(({ bar })=>{ +import(/* webpackChunkName: "helpers" */ "./bundle-yUS5CVMs.js").then(({ bar })=>{ bar(); }); //# sourceMappingURL=index-native-experimental-lib.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: native-legacy-lib 1`] = ` -[ - "lib/bundle-XkHFZVb6.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: native-legacy-lib > lib/bundle-XkHFZVb6.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: legacy, Format: lib "use strict"; function foo() {} @@ -2211,31 +2013,25 @@ function bar() {} exports.bar = bar; exports.foo = foo; //# sourceMappingURL=bundle-XkHFZVb6.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: native-legacy-lib 2`] = ` -[ - "lib/index-native-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: native-legacy-lib > lib/index-native-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: legacy, Format: lib "use strict"; -Promise.resolve().then(()=>require("./bundle-XkHFZVb6.js")).then((result)=>{ +import("./bundle-XkHFZVb6.js").then((result)=>{ result.foo(); }); -Promise.resolve().then(()=>require(/* webpackChunkName: "helpers" */ "./bundle-XkHFZVb6.js")).then(({ bar })=>{ +import(/* webpackChunkName: "helpers" */ "./bundle-XkHFZVb6.js").then(({ bar })=>{ bar(); }); //# sourceMappingURL=index-native-legacy-lib.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: native-stable-lib 1`] = ` -[ - "lib/bundle-ax2or5ZR.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: native-stable-lib > lib/bundle-ax2or5ZR.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: stable, Format: lib "use strict"; function foo() {} @@ -2243,31 +2039,25 @@ function bar() {} exports.bar = bar; exports.foo = foo; //# sourceMappingURL=bundle-ax2or5ZR.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: native-stable-lib 2`] = ` -[ - "lib/index-native-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: native-stable-lib > lib/index-native-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: stable, Format: lib "use strict"; -Promise.resolve().then(()=>require("./bundle-ax2or5ZR.js")).then((result)=>{ +import("./bundle-ax2or5ZR.js").then((result)=>{ result.foo(); }); -Promise.resolve().then(()=>require(/* webpackChunkName: "helpers" */ "./bundle-ax2or5ZR.js")).then(({ bar })=>{ +import(/* webpackChunkName: "helpers" */ "./bundle-ax2or5ZR.js").then(({ bar })=>{ bar(); }); //# sourceMappingURL=index-native-stable-lib.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: node-current-cjs 1`] = ` -[ - "cjs/bundle-a0TmwKVU.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: node-current-cjs > cjs/bundle-a0TmwKVU.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: cjs "use strict"; function foo() {} @@ -2275,24 +2065,11 @@ function bar() {} exports.bar = bar; exports.foo = foo; //# sourceMappingURL=bundle-a0TmwKVU.cjs.map -", -] -`; - -exports[`Dynamic imports swc transforms example test case: node-current-cjs 2`] = ` -[ - "cjs/index-node-current-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import './index-node-current-cjs.cjs';", -] +" `; -exports[`Dynamic imports swc transforms example test case: node-current-cjs 3`] = ` -[ - "cjs/index-node-current-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: node-current-cjs > cjs/index-node-current-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: cjs "use strict"; import("./bundle-a0TmwKVU.cjs").then((result)=>{ @@ -2302,14 +2079,18 @@ import(/* webpackChunkName: "helpers" */ "./bundle-a0TmwKVU.cjs").then(({ bar }) bar(); }); //# sourceMappingURL=index-node-current-cjs.cjs.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: node-current-lib 1`] = ` -[ - "lib/bundle-nwisUpj0.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: node-current-cjs > cjs/index-node-current-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-current-cjs.cjs';" +`; + +exports[`Dynamic imports > swc > transforms example test case: node-current-lib > lib/bundle-nwisUpj0.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: lib "use strict"; function foo() {} @@ -2317,14 +2098,11 @@ function bar() {} exports.bar = bar; exports.foo = foo; //# sourceMappingURL=bundle-nwisUpj0.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: node-current-lib 2`] = ` -[ - "lib/index-node-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: node-current-lib > lib/index-node-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: lib "use strict"; import("./bundle-nwisUpj0.js").then((result)=>{ @@ -2334,27 +2112,21 @@ import(/* webpackChunkName: "helpers" */ "./bundle-nwisUpj0.js").then(({ bar })= bar(); }); //# sourceMappingURL=index-node-current-lib.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: node-current-mjs 1`] = ` -[ - "mjs/bundle-bDQYClYL.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: node-current-mjs > mjs/bundle-bDQYClYL.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: mjs function foo() {} function bar() {} export { bar, foo }; //# sourceMappingURL=bundle-bDQYClYL.mjs.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: node-current-mjs 2`] = ` -[ - "mjs/index-node-current-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: node-current-mjs > mjs/index-node-current-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: mjs import("./bundle-bDQYClYL.mjs").then((result)=>{ result.foo(); @@ -2363,14 +2135,11 @@ import(/* webpackChunkName: "helpers" */ "./bundle-bDQYClYL.mjs").then(({ bar }) bar(); }); //# sourceMappingURL=index-node-current-mjs.mjs.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: node-experimental-cjs 1`] = ` -[ - "cjs/bundle-bGhDu9dC.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: node-experimental-cjs > cjs/bundle-bGhDu9dC.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: cjs "use strict"; function foo() {} @@ -2378,24 +2147,11 @@ function bar() {} exports.bar = bar; exports.foo = foo; //# sourceMappingURL=bundle-bGhDu9dC.cjs.map -", -] -`; - -exports[`Dynamic imports swc transforms example test case: node-experimental-cjs 2`] = ` -[ - "cjs/index-node-experimental-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import './index-node-experimental-cjs.cjs';", -] +" `; -exports[`Dynamic imports swc transforms example test case: node-experimental-cjs 3`] = ` -[ - "cjs/index-node-experimental-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: cjs "use strict"; import("./bundle-bGhDu9dC.cjs").then((result)=>{ @@ -2405,14 +2161,18 @@ import(/* webpackChunkName: "helpers" */ "./bundle-bGhDu9dC.cjs").then(({ bar }) bar(); }); //# sourceMappingURL=index-node-experimental-cjs.cjs.map -", -] +" +`; + +exports[`Dynamic imports > swc > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-experimental-cjs.cjs';" `; -exports[`Dynamic imports swc transforms example test case: node-experimental-lib 1`] = ` -[ - "lib/bundle-7mP55VlV.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: node-experimental-lib > lib/bundle-7mP55VlV.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: lib "use strict"; function foo() {} @@ -2420,14 +2180,11 @@ function bar() {} exports.bar = bar; exports.foo = foo; //# sourceMappingURL=bundle-7mP55VlV.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: node-experimental-lib 2`] = ` -[ - "lib/index-node-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: node-experimental-lib > lib/index-node-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: lib "use strict"; import("./bundle-7mP55VlV.js").then((result)=>{ @@ -2437,27 +2194,21 @@ import(/* webpackChunkName: "helpers" */ "./bundle-7mP55VlV.js").then(({ bar })= bar(); }); //# sourceMappingURL=index-node-experimental-lib.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: node-experimental-mjs 1`] = ` -[ - "mjs/bundle-Oxmf1_V_.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: node-experimental-mjs > mjs/bundle-Oxmf1_V_.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: mjs function foo() {} function bar() {} export { bar, foo }; //# sourceMappingURL=bundle-Oxmf1_V_.mjs.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: node-experimental-mjs 2`] = ` -[ - "mjs/index-node-experimental-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: node-experimental-mjs > mjs/index-node-experimental-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: mjs import("./bundle-Oxmf1_V_.mjs").then((result)=>{ result.foo(); @@ -2466,14 +2217,11 @@ import(/* webpackChunkName: "helpers" */ "./bundle-Oxmf1_V_.mjs").then(({ bar }) bar(); }); //# sourceMappingURL=index-node-experimental-mjs.mjs.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: node-legacy-cjs 1`] = ` -[ - "cjs/bundle-_ofX8Blw.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: node-legacy-cjs > cjs/bundle-_ofX8Blw.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: cjs "use strict"; function foo() {} @@ -2481,24 +2229,11 @@ function bar() {} exports.bar = bar; exports.foo = foo; //# sourceMappingURL=bundle-_ofX8Blw.cjs.map -", -] -`; - -exports[`Dynamic imports swc transforms example test case: node-legacy-cjs 2`] = ` -[ - "cjs/index-node-legacy-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import './index-node-legacy-cjs.cjs';", -] +" `; -exports[`Dynamic imports swc transforms example test case: node-legacy-cjs 3`] = ` -[ - "cjs/index-node-legacy-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: cjs "use strict"; import("./bundle-_ofX8Blw.cjs").then((result)=>{ @@ -2508,14 +2243,18 @@ import(/* webpackChunkName: "helpers" */ "./bundle-_ofX8Blw.cjs").then(({ bar }) bar(); }); //# sourceMappingURL=index-node-legacy-cjs.cjs.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: node-legacy-lib 1`] = ` -[ - "lib/bundle-f1fTiCe3.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-legacy-cjs.cjs';" +`; + +exports[`Dynamic imports > swc > transforms example test case: node-legacy-lib > lib/bundle-f1fTiCe3.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: lib "use strict"; function foo() {} @@ -2523,14 +2262,11 @@ function bar() {} exports.bar = bar; exports.foo = foo; //# sourceMappingURL=bundle-f1fTiCe3.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: node-legacy-lib 2`] = ` -[ - "lib/index-node-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: node-legacy-lib > lib/index-node-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: lib "use strict"; import("./bundle-f1fTiCe3.js").then((result)=>{ @@ -2540,27 +2276,21 @@ import(/* webpackChunkName: "helpers" */ "./bundle-f1fTiCe3.js").then(({ bar })= bar(); }); //# sourceMappingURL=index-node-legacy-lib.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: node-legacy-mjs 1`] = ` -[ - "mjs/bundle-boLczVlg.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: node-legacy-mjs > mjs/bundle-boLczVlg.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: mjs function foo() {} function bar() {} export { bar, foo }; //# sourceMappingURL=bundle-boLczVlg.mjs.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: node-legacy-mjs 2`] = ` -[ - "mjs/index-node-legacy-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: node-legacy-mjs > mjs/index-node-legacy-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: mjs import("./bundle-boLczVlg.mjs").then((result)=>{ result.foo(); @@ -2569,14 +2299,11 @@ import(/* webpackChunkName: "helpers" */ "./bundle-boLczVlg.mjs").then(({ bar }) bar(); }); //# sourceMappingURL=index-node-legacy-mjs.mjs.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: node-stable-cjs 1`] = ` -[ - "cjs/bundle-_xpKJhek.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: node-stable-cjs > cjs/bundle-_xpKJhek.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: cjs "use strict"; function foo() {} @@ -2584,24 +2311,11 @@ function bar() {} exports.bar = bar; exports.foo = foo; //# sourceMappingURL=bundle-_xpKJhek.cjs.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: node-stable-cjs 2`] = ` -[ - "cjs/index-node-stable-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import './index-node-stable-cjs.cjs';", -] -`; - -exports[`Dynamic imports swc transforms example test case: node-stable-cjs 3`] = ` -[ - "cjs/index-node-stable-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: cjs "use strict"; import("./bundle-_xpKJhek.cjs").then((result)=>{ @@ -2611,14 +2325,18 @@ import(/* webpackChunkName: "helpers" */ "./bundle-_xpKJhek.cjs").then(({ bar }) bar(); }); //# sourceMappingURL=index-node-stable-cjs.cjs.map -", -] +" +`; + +exports[`Dynamic imports > swc > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-stable-cjs.cjs';" `; -exports[`Dynamic imports swc transforms example test case: node-stable-lib 1`] = ` -[ - "lib/bundle-fRyzw-H0.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: node-stable-lib > lib/bundle-fRyzw-H0.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: lib "use strict"; function foo() {} @@ -2626,14 +2344,11 @@ function bar() {} exports.bar = bar; exports.foo = foo; //# sourceMappingURL=bundle-fRyzw-H0.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: node-stable-lib 2`] = ` -[ - "lib/index-node-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: node-stable-lib > lib/index-node-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: lib "use strict"; import("./bundle-fRyzw-H0.js").then((result)=>{ @@ -2643,27 +2358,21 @@ import(/* webpackChunkName: "helpers" */ "./bundle-fRyzw-H0.js").then(({ bar })= bar(); }); //# sourceMappingURL=index-node-stable-lib.js.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: node-stable-mjs 1`] = ` -[ - "mjs/bundle-jxsTfifR.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: node-stable-mjs > mjs/bundle-jxsTfifR.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: mjs function foo() {} function bar() {} export { bar, foo }; //# sourceMappingURL=bundle-jxsTfifR.mjs.map -", -] +" `; -exports[`Dynamic imports swc transforms example test case: node-stable-mjs 2`] = ` -[ - "mjs/index-node-stable-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Dynamic imports > swc > transforms example test case: node-stable-mjs > mjs/index-node-stable-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: mjs import("./bundle-jxsTfifR.mjs").then((result)=>{ result.foo(); @@ -2672,6 +2381,5 @@ import(/* webpackChunkName: "helpers" */ "./bundle-jxsTfifR.mjs").then(({ bar }) bar(); }); //# sourceMappingURL=index-node-stable-mjs.mjs.map -", -] +" `; diff --git a/packages/packemon/tests/examples/__snapshots__/externals.test.ts.snap b/packages/packemon/tests/examples/__snapshots__/externals.test.ts.snap index fac01e9ca..27d695039 100644 --- a/packages/packemon/tests/examples/__snapshots__/externals.test.ts.snap +++ b/packages/packemon/tests/examples/__snapshots__/externals.test.ts.snap @@ -1,22 +1,17 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`Rollup externals (regex) babel transforms example test case: browser-current-esm 1`] = ` -[ - "esm/index-browser-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals (regex) > babel > transforms example test case: browser-current-esm > esm/index-browser-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: esm import '@packemon/foo'; import '@packemon/bar'; //# sourceMappingURL=index-browser-current-esm.js.map -", -] +" `; -exports[`Rollup externals (regex) babel transforms example test case: browser-current-lib 1`] = ` -[ - "lib/index-browser-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals (regex) > babel > transforms example test case: browser-current-lib > lib/index-browser-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: lib 'use strict'; @@ -24,14 +19,11 @@ exports[`Rollup externals (regex) babel transforms example test case: browser-cu require('@packemon/foo'); require('@packemon/bar'); //# sourceMappingURL=index-browser-current-lib.js.map -", -] +" `; -exports[`Rollup externals (regex) babel transforms example test case: browser-current-umd 1`] = ` -[ - "umd/index-browser-current-umd.js", - "(function (global, factory) { +exports[`Rollup externals (regex) > babel > transforms example test case: browser-current-umd > umd/index-browser-current-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["@packemon/foo", "@packemon/bar"], factory); } else if (typeof exports !== "undefined") { @@ -47,27 +39,21 @@ exports[`Rollup externals (regex) babel transforms example test case: browser-cu "use strict"; }); //# sourceMappingURL=index-browser-current-umd.js.map -", -] +" `; -exports[`Rollup externals (regex) babel transforms example test case: browser-experimental-esm 1`] = ` -[ - "esm/index-browser-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals (regex) > babel > transforms example test case: browser-experimental-esm > esm/index-browser-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: esm import '@packemon/foo'; import '@packemon/bar'; //# sourceMappingURL=index-browser-experimental-esm.js.map -", -] +" `; -exports[`Rollup externals (regex) babel transforms example test case: browser-experimental-lib 1`] = ` -[ - "lib/index-browser-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals (regex) > babel > transforms example test case: browser-experimental-lib > lib/index-browser-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: lib 'use strict'; @@ -75,14 +61,11 @@ exports[`Rollup externals (regex) babel transforms example test case: browser-ex require('@packemon/foo'); require('@packemon/bar'); //# sourceMappingURL=index-browser-experimental-lib.js.map -", -] +" `; -exports[`Rollup externals (regex) babel transforms example test case: browser-experimental-umd 1`] = ` -[ - "umd/index-browser-experimental-umd.js", - "(function (global, factory) { +exports[`Rollup externals (regex) > babel > transforms example test case: browser-experimental-umd > umd/index-browser-experimental-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["@packemon/foo", "@packemon/bar"], factory); } else if (typeof exports !== "undefined") { @@ -98,27 +81,21 @@ exports[`Rollup externals (regex) babel transforms example test case: browser-ex "use strict"; }); //# sourceMappingURL=index-browser-experimental-umd.js.map -", -] +" `; -exports[`Rollup externals (regex) babel transforms example test case: browser-legacy-esm 1`] = ` -[ - "esm/index-browser-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals (regex) > babel > transforms example test case: browser-legacy-esm > esm/index-browser-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: esm import '@packemon/foo'; import '@packemon/bar'; //# sourceMappingURL=index-browser-legacy-esm.js.map -", -] +" `; -exports[`Rollup externals (regex) babel transforms example test case: browser-legacy-lib 1`] = ` -[ - "lib/index-browser-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals (regex) > babel > transforms example test case: browser-legacy-lib > lib/index-browser-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: lib 'use strict'; @@ -126,14 +103,11 @@ exports[`Rollup externals (regex) babel transforms example test case: browser-le require('@packemon/foo'); require('@packemon/bar'); //# sourceMappingURL=index-browser-legacy-lib.js.map -", -] +" `; -exports[`Rollup externals (regex) babel transforms example test case: browser-legacy-umd 1`] = ` -[ - "umd/index-browser-legacy-umd.js", - "(function (global, factory) { +exports[`Rollup externals (regex) > babel > transforms example test case: browser-legacy-umd > umd/index-browser-legacy-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["@packemon/foo", "@packemon/bar"], factory); } else if (typeof exports !== "undefined") { @@ -149,27 +123,21 @@ exports[`Rollup externals (regex) babel transforms example test case: browser-le "use strict"; }); //# sourceMappingURL=index-browser-legacy-umd.js.map -", -] +" `; -exports[`Rollup externals (regex) babel transforms example test case: browser-stable-esm 1`] = ` -[ - "esm/index-browser-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals (regex) > babel > transforms example test case: browser-stable-esm > esm/index-browser-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: esm import '@packemon/foo'; import '@packemon/bar'; //# sourceMappingURL=index-browser-stable-esm.js.map -", -] +" `; -exports[`Rollup externals (regex) babel transforms example test case: browser-stable-lib 1`] = ` -[ - "lib/index-browser-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals (regex) > babel > transforms example test case: browser-stable-lib > lib/index-browser-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: lib 'use strict'; @@ -177,14 +145,11 @@ exports[`Rollup externals (regex) babel transforms example test case: browser-st require('@packemon/foo'); require('@packemon/bar'); //# sourceMappingURL=index-browser-stable-lib.js.map -", -] +" `; -exports[`Rollup externals (regex) babel transforms example test case: browser-stable-umd 1`] = ` -[ - "umd/index-browser-stable-umd.js", - "(function (global, factory) { +exports[`Rollup externals (regex) > babel > transforms example test case: browser-stable-umd > umd/index-browser-stable-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["@packemon/foo", "@packemon/bar"], factory); } else if (typeof exports !== "undefined") { @@ -200,27 +165,21 @@ exports[`Rollup externals (regex) babel transforms example test case: browser-st "use strict"; }); //# sourceMappingURL=index-browser-stable-umd.js.map -", -] +" `; -exports[`Rollup externals (regex) babel transforms example test case: electron-current-esm 1`] = ` -[ - "esm/index-electron-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals (regex) > babel > transforms example test case: electron-current-esm > esm/index-electron-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: esm import '@packemon/foo'; import '@packemon/bar'; //# sourceMappingURL=index-electron-current-esm.js.map -", -] +" `; -exports[`Rollup externals (regex) babel transforms example test case: electron-current-lib 1`] = ` -[ - "lib/index-electron-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals (regex) > babel > transforms example test case: electron-current-lib > lib/index-electron-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: lib 'use strict'; @@ -228,27 +187,21 @@ exports[`Rollup externals (regex) babel transforms example test case: electron-c require('@packemon/foo'); require('@packemon/bar'); //# sourceMappingURL=index-electron-current-lib.js.map -", -] +" `; -exports[`Rollup externals (regex) babel transforms example test case: electron-experimental-esm 1`] = ` -[ - "esm/index-electron-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals (regex) > babel > transforms example test case: electron-experimental-esm > esm/index-electron-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: esm import '@packemon/foo'; import '@packemon/bar'; //# sourceMappingURL=index-electron-experimental-esm.js.map -", -] +" `; -exports[`Rollup externals (regex) babel transforms example test case: electron-experimental-lib 1`] = ` -[ - "lib/index-electron-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals (regex) > babel > transforms example test case: electron-experimental-lib > lib/index-electron-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: lib 'use strict'; @@ -256,27 +209,21 @@ exports[`Rollup externals (regex) babel transforms example test case: electron-e require('@packemon/foo'); require('@packemon/bar'); //# sourceMappingURL=index-electron-experimental-lib.js.map -", -] +" `; -exports[`Rollup externals (regex) babel transforms example test case: electron-legacy-esm 1`] = ` -[ - "esm/index-electron-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals (regex) > babel > transforms example test case: electron-legacy-esm > esm/index-electron-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: esm import '@packemon/foo'; import '@packemon/bar'; //# sourceMappingURL=index-electron-legacy-esm.js.map -", -] +" `; -exports[`Rollup externals (regex) babel transforms example test case: electron-legacy-lib 1`] = ` -[ - "lib/index-electron-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals (regex) > babel > transforms example test case: electron-legacy-lib > lib/index-electron-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: lib 'use strict'; @@ -284,27 +231,21 @@ exports[`Rollup externals (regex) babel transforms example test case: electron-l require('@packemon/foo'); require('@packemon/bar'); //# sourceMappingURL=index-electron-legacy-lib.js.map -", -] +" `; -exports[`Rollup externals (regex) babel transforms example test case: electron-stable-esm 1`] = ` -[ - "esm/index-electron-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals (regex) > babel > transforms example test case: electron-stable-esm > esm/index-electron-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: esm import '@packemon/foo'; import '@packemon/bar'; //# sourceMappingURL=index-electron-stable-esm.js.map -", -] +" `; -exports[`Rollup externals (regex) babel transforms example test case: electron-stable-lib 1`] = ` -[ - "lib/index-electron-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals (regex) > babel > transforms example test case: electron-stable-lib > lib/index-electron-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: lib 'use strict'; @@ -312,14 +253,11 @@ exports[`Rollup externals (regex) babel transforms example test case: electron-s require('@packemon/foo'); require('@packemon/bar'); //# sourceMappingURL=index-electron-stable-lib.js.map -", -] +" `; -exports[`Rollup externals (regex) babel transforms example test case: native-current-lib 1`] = ` -[ - "lib/index-native-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals (regex) > babel > transforms example test case: native-current-lib > lib/index-native-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: current, Format: lib 'use strict'; @@ -327,14 +265,11 @@ exports[`Rollup externals (regex) babel transforms example test case: native-cur require('@packemon/foo'); require('@packemon/bar'); //# sourceMappingURL=index-native-current-lib.js.map -", -] +" `; -exports[`Rollup externals (regex) babel transforms example test case: native-experimental-lib 1`] = ` -[ - "lib/index-native-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals (regex) > babel > transforms example test case: native-experimental-lib > lib/index-native-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: experimental, Format: lib 'use strict'; @@ -342,14 +277,11 @@ exports[`Rollup externals (regex) babel transforms example test case: native-exp require('@packemon/foo'); require('@packemon/bar'); //# sourceMappingURL=index-native-experimental-lib.js.map -", -] +" `; -exports[`Rollup externals (regex) babel transforms example test case: native-legacy-lib 1`] = ` -[ - "lib/index-native-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals (regex) > babel > transforms example test case: native-legacy-lib > lib/index-native-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: legacy, Format: lib 'use strict'; @@ -357,14 +289,11 @@ exports[`Rollup externals (regex) babel transforms example test case: native-leg require('@packemon/foo'); require('@packemon/bar'); //# sourceMappingURL=index-native-legacy-lib.js.map -", -] +" `; -exports[`Rollup externals (regex) babel transforms example test case: native-stable-lib 1`] = ` -[ - "lib/index-native-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals (regex) > babel > transforms example test case: native-stable-lib > lib/index-native-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: stable, Format: lib 'use strict'; @@ -372,24 +301,11 @@ exports[`Rollup externals (regex) babel transforms example test case: native-sta require('@packemon/foo'); require('@packemon/bar'); //# sourceMappingURL=index-native-stable-lib.js.map -", -] +" `; -exports[`Rollup externals (regex) babel transforms example test case: node-current-cjs 1`] = ` -[ - "cjs/index-node-current-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import './index-node-current-cjs.cjs';", -] -`; - -exports[`Rollup externals (regex) babel transforms example test case: node-current-cjs 2`] = ` -[ - "cjs/index-node-current-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals (regex) > babel > transforms example test case: node-current-cjs > cjs/index-node-current-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: cjs 'use strict'; @@ -397,14 +313,18 @@ exports[`Rollup externals (regex) babel transforms example test case: node-curre require('@packemon/foo'); require('@packemon/bar'); //# sourceMappingURL=index-node-current-cjs.cjs.map -", -] +" +`; + +exports[`Rollup externals (regex) > babel > transforms example test case: node-current-cjs > cjs/index-node-current-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-current-cjs.cjs';" `; -exports[`Rollup externals (regex) babel transforms example test case: node-current-lib 1`] = ` -[ - "lib/index-node-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals (regex) > babel > transforms example test case: node-current-lib > lib/index-node-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: lib 'use strict'; @@ -412,37 +332,21 @@ exports[`Rollup externals (regex) babel transforms example test case: node-curre require('@packemon/foo'); require('@packemon/bar'); //# sourceMappingURL=index-node-current-lib.js.map -", -] +" `; -exports[`Rollup externals (regex) babel transforms example test case: node-current-mjs 1`] = ` -[ - "mjs/index-node-current-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals (regex) > babel > transforms example test case: node-current-mjs > mjs/index-node-current-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: mjs import '@packemon/foo'; import '@packemon/bar'; //# sourceMappingURL=index-node-current-mjs.mjs.map -", -] +" `; -exports[`Rollup externals (regex) babel transforms example test case: node-experimental-cjs 1`] = ` -[ - "cjs/index-node-experimental-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import './index-node-experimental-cjs.cjs';", -] -`; - -exports[`Rollup externals (regex) babel transforms example test case: node-experimental-cjs 2`] = ` -[ - "cjs/index-node-experimental-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals (regex) > babel > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: cjs 'use strict'; @@ -450,14 +354,18 @@ exports[`Rollup externals (regex) babel transforms example test case: node-exper require('@packemon/foo'); require('@packemon/bar'); //# sourceMappingURL=index-node-experimental-cjs.cjs.map -", -] +" +`; + +exports[`Rollup externals (regex) > babel > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-experimental-cjs.cjs';" `; -exports[`Rollup externals (regex) babel transforms example test case: node-experimental-lib 1`] = ` -[ - "lib/index-node-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals (regex) > babel > transforms example test case: node-experimental-lib > lib/index-node-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: lib 'use strict'; @@ -465,37 +373,21 @@ exports[`Rollup externals (regex) babel transforms example test case: node-exper require('@packemon/foo'); require('@packemon/bar'); //# sourceMappingURL=index-node-experimental-lib.js.map -", -] +" `; -exports[`Rollup externals (regex) babel transforms example test case: node-experimental-mjs 1`] = ` -[ - "mjs/index-node-experimental-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals (regex) > babel > transforms example test case: node-experimental-mjs > mjs/index-node-experimental-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: mjs import '@packemon/foo'; import '@packemon/bar'; //# sourceMappingURL=index-node-experimental-mjs.mjs.map -", -] +" `; -exports[`Rollup externals (regex) babel transforms example test case: node-legacy-cjs 1`] = ` -[ - "cjs/index-node-legacy-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import './index-node-legacy-cjs.cjs';", -] -`; - -exports[`Rollup externals (regex) babel transforms example test case: node-legacy-cjs 2`] = ` -[ - "cjs/index-node-legacy-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals (regex) > babel > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: cjs 'use strict'; @@ -503,14 +395,18 @@ exports[`Rollup externals (regex) babel transforms example test case: node-legac require('@packemon/foo'); require('@packemon/bar'); //# sourceMappingURL=index-node-legacy-cjs.cjs.map -", -] +" +`; + +exports[`Rollup externals (regex) > babel > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-legacy-cjs.cjs';" `; -exports[`Rollup externals (regex) babel transforms example test case: node-legacy-lib 1`] = ` -[ - "lib/index-node-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals (regex) > babel > transforms example test case: node-legacy-lib > lib/index-node-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: lib 'use strict'; @@ -518,37 +414,21 @@ exports[`Rollup externals (regex) babel transforms example test case: node-legac require('@packemon/foo'); require('@packemon/bar'); //# sourceMappingURL=index-node-legacy-lib.js.map -", -] +" `; -exports[`Rollup externals (regex) babel transforms example test case: node-legacy-mjs 1`] = ` -[ - "mjs/index-node-legacy-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals (regex) > babel > transforms example test case: node-legacy-mjs > mjs/index-node-legacy-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: mjs import '@packemon/foo'; import '@packemon/bar'; //# sourceMappingURL=index-node-legacy-mjs.mjs.map -", -] +" `; -exports[`Rollup externals (regex) babel transforms example test case: node-stable-cjs 1`] = ` -[ - "cjs/index-node-stable-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import './index-node-stable-cjs.cjs';", -] -`; - -exports[`Rollup externals (regex) babel transforms example test case: node-stable-cjs 2`] = ` -[ - "cjs/index-node-stable-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals (regex) > babel > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: cjs 'use strict'; @@ -556,14 +436,18 @@ exports[`Rollup externals (regex) babel transforms example test case: node-stabl require('@packemon/foo'); require('@packemon/bar'); //# sourceMappingURL=index-node-stable-cjs.cjs.map -", -] +" +`; + +exports[`Rollup externals (regex) > babel > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-stable-cjs.cjs';" `; -exports[`Rollup externals (regex) babel transforms example test case: node-stable-lib 1`] = ` -[ - "lib/index-node-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals (regex) > babel > transforms example test case: node-stable-lib > lib/index-node-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: lib 'use strict'; @@ -571,40 +455,31 @@ exports[`Rollup externals (regex) babel transforms example test case: node-stabl require('@packemon/foo'); require('@packemon/bar'); //# sourceMappingURL=index-node-stable-lib.js.map -", -] +" `; -exports[`Rollup externals (regex) babel transforms example test case: node-stable-mjs 1`] = ` -[ - "mjs/index-node-stable-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals (regex) > babel > transforms example test case: node-stable-mjs > mjs/index-node-stable-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: mjs import '@packemon/foo'; import '@packemon/bar'; //# sourceMappingURL=index-node-stable-mjs.mjs.map -", -] +" `; -exports[`Rollup externals babel transforms example test case: browser-current-esm 1`] = ` -[ - "esm/index-browser-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals > babel > transforms example test case: browser-current-esm > esm/index-browser-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: esm import '@packemon/foo'; import '@packemon/bar'; //# sourceMappingURL=index-browser-current-esm.js.map -", -] +" `; -exports[`Rollup externals babel transforms example test case: browser-current-lib 1`] = ` -[ - "lib/index-browser-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals > babel > transforms example test case: browser-current-lib > lib/index-browser-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: lib 'use strict'; @@ -612,14 +487,11 @@ exports[`Rollup externals babel transforms example test case: browser-current-li require('@packemon/foo'); require('@packemon/bar'); //# sourceMappingURL=index-browser-current-lib.js.map -", -] +" `; -exports[`Rollup externals babel transforms example test case: browser-current-umd 1`] = ` -[ - "umd/index-browser-current-umd.js", - "(function (global, factory) { +exports[`Rollup externals > babel > transforms example test case: browser-current-umd > umd/index-browser-current-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["@packemon/foo", "@packemon/bar"], factory); } else if (typeof exports !== "undefined") { @@ -635,27 +507,21 @@ exports[`Rollup externals babel transforms example test case: browser-current-um "use strict"; }); //# sourceMappingURL=index-browser-current-umd.js.map -", -] +" `; -exports[`Rollup externals babel transforms example test case: browser-experimental-esm 1`] = ` -[ - "esm/index-browser-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals > babel > transforms example test case: browser-experimental-esm > esm/index-browser-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: esm import '@packemon/foo'; import '@packemon/bar'; //# sourceMappingURL=index-browser-experimental-esm.js.map -", -] +" `; -exports[`Rollup externals babel transforms example test case: browser-experimental-lib 1`] = ` -[ - "lib/index-browser-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals > babel > transforms example test case: browser-experimental-lib > lib/index-browser-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: lib 'use strict'; @@ -663,14 +529,11 @@ exports[`Rollup externals babel transforms example test case: browser-experiment require('@packemon/foo'); require('@packemon/bar'); //# sourceMappingURL=index-browser-experimental-lib.js.map -", -] +" `; -exports[`Rollup externals babel transforms example test case: browser-experimental-umd 1`] = ` -[ - "umd/index-browser-experimental-umd.js", - "(function (global, factory) { +exports[`Rollup externals > babel > transforms example test case: browser-experimental-umd > umd/index-browser-experimental-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["@packemon/foo", "@packemon/bar"], factory); } else if (typeof exports !== "undefined") { @@ -686,27 +549,21 @@ exports[`Rollup externals babel transforms example test case: browser-experiment "use strict"; }); //# sourceMappingURL=index-browser-experimental-umd.js.map -", -] +" `; -exports[`Rollup externals babel transforms example test case: browser-legacy-esm 1`] = ` -[ - "esm/index-browser-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals > babel > transforms example test case: browser-legacy-esm > esm/index-browser-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: esm import '@packemon/foo'; import '@packemon/bar'; //# sourceMappingURL=index-browser-legacy-esm.js.map -", -] +" `; -exports[`Rollup externals babel transforms example test case: browser-legacy-lib 1`] = ` -[ - "lib/index-browser-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals > babel > transforms example test case: browser-legacy-lib > lib/index-browser-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: lib 'use strict'; @@ -714,14 +571,11 @@ exports[`Rollup externals babel transforms example test case: browser-legacy-lib require('@packemon/foo'); require('@packemon/bar'); //# sourceMappingURL=index-browser-legacy-lib.js.map -", -] +" `; -exports[`Rollup externals babel transforms example test case: browser-legacy-umd 1`] = ` -[ - "umd/index-browser-legacy-umd.js", - "(function (global, factory) { +exports[`Rollup externals > babel > transforms example test case: browser-legacy-umd > umd/index-browser-legacy-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["@packemon/foo", "@packemon/bar"], factory); } else if (typeof exports !== "undefined") { @@ -737,27 +591,21 @@ exports[`Rollup externals babel transforms example test case: browser-legacy-umd "use strict"; }); //# sourceMappingURL=index-browser-legacy-umd.js.map -", -] +" `; -exports[`Rollup externals babel transforms example test case: browser-stable-esm 1`] = ` -[ - "esm/index-browser-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals > babel > transforms example test case: browser-stable-esm > esm/index-browser-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: esm import '@packemon/foo'; import '@packemon/bar'; //# sourceMappingURL=index-browser-stable-esm.js.map -", -] +" `; -exports[`Rollup externals babel transforms example test case: browser-stable-lib 1`] = ` -[ - "lib/index-browser-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals > babel > transforms example test case: browser-stable-lib > lib/index-browser-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: lib 'use strict'; @@ -765,14 +613,11 @@ exports[`Rollup externals babel transforms example test case: browser-stable-lib require('@packemon/foo'); require('@packemon/bar'); //# sourceMappingURL=index-browser-stable-lib.js.map -", -] +" `; -exports[`Rollup externals babel transforms example test case: browser-stable-umd 1`] = ` -[ - "umd/index-browser-stable-umd.js", - "(function (global, factory) { +exports[`Rollup externals > babel > transforms example test case: browser-stable-umd > umd/index-browser-stable-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["@packemon/foo", "@packemon/bar"], factory); } else if (typeof exports !== "undefined") { @@ -788,27 +633,21 @@ exports[`Rollup externals babel transforms example test case: browser-stable-umd "use strict"; }); //# sourceMappingURL=index-browser-stable-umd.js.map -", -] +" `; -exports[`Rollup externals babel transforms example test case: electron-current-esm 1`] = ` -[ - "esm/index-electron-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals > babel > transforms example test case: electron-current-esm > esm/index-electron-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: esm import '@packemon/foo'; import '@packemon/bar'; //# sourceMappingURL=index-electron-current-esm.js.map -", -] +" `; -exports[`Rollup externals babel transforms example test case: electron-current-lib 1`] = ` -[ - "lib/index-electron-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals > babel > transforms example test case: electron-current-lib > lib/index-electron-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: lib 'use strict'; @@ -816,27 +655,21 @@ exports[`Rollup externals babel transforms example test case: electron-current-l require('@packemon/foo'); require('@packemon/bar'); //# sourceMappingURL=index-electron-current-lib.js.map -", -] +" `; -exports[`Rollup externals babel transforms example test case: electron-experimental-esm 1`] = ` -[ - "esm/index-electron-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals > babel > transforms example test case: electron-experimental-esm > esm/index-electron-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: esm import '@packemon/foo'; import '@packemon/bar'; //# sourceMappingURL=index-electron-experimental-esm.js.map -", -] +" `; -exports[`Rollup externals babel transforms example test case: electron-experimental-lib 1`] = ` -[ - "lib/index-electron-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals > babel > transforms example test case: electron-experimental-lib > lib/index-electron-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: lib 'use strict'; @@ -844,27 +677,21 @@ exports[`Rollup externals babel transforms example test case: electron-experimen require('@packemon/foo'); require('@packemon/bar'); //# sourceMappingURL=index-electron-experimental-lib.js.map -", -] +" `; -exports[`Rollup externals babel transforms example test case: electron-legacy-esm 1`] = ` -[ - "esm/index-electron-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals > babel > transforms example test case: electron-legacy-esm > esm/index-electron-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: esm import '@packemon/foo'; import '@packemon/bar'; //# sourceMappingURL=index-electron-legacy-esm.js.map -", -] +" `; -exports[`Rollup externals babel transforms example test case: electron-legacy-lib 1`] = ` -[ - "lib/index-electron-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals > babel > transforms example test case: electron-legacy-lib > lib/index-electron-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: lib 'use strict'; @@ -872,27 +699,21 @@ exports[`Rollup externals babel transforms example test case: electron-legacy-li require('@packemon/foo'); require('@packemon/bar'); //# sourceMappingURL=index-electron-legacy-lib.js.map -", -] +" `; -exports[`Rollup externals babel transforms example test case: electron-stable-esm 1`] = ` -[ - "esm/index-electron-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals > babel > transforms example test case: electron-stable-esm > esm/index-electron-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: esm import '@packemon/foo'; import '@packemon/bar'; //# sourceMappingURL=index-electron-stable-esm.js.map -", -] +" `; -exports[`Rollup externals babel transforms example test case: electron-stable-lib 1`] = ` -[ - "lib/index-electron-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals > babel > transforms example test case: electron-stable-lib > lib/index-electron-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: lib 'use strict'; @@ -900,14 +721,11 @@ exports[`Rollup externals babel transforms example test case: electron-stable-li require('@packemon/foo'); require('@packemon/bar'); //# sourceMappingURL=index-electron-stable-lib.js.map -", -] +" `; -exports[`Rollup externals babel transforms example test case: native-current-lib 1`] = ` -[ - "lib/index-native-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals > babel > transforms example test case: native-current-lib > lib/index-native-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: current, Format: lib 'use strict'; @@ -915,14 +733,11 @@ exports[`Rollup externals babel transforms example test case: native-current-lib require('@packemon/foo'); require('@packemon/bar'); //# sourceMappingURL=index-native-current-lib.js.map -", -] +" `; -exports[`Rollup externals babel transforms example test case: native-experimental-lib 1`] = ` -[ - "lib/index-native-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals > babel > transforms example test case: native-experimental-lib > lib/index-native-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: experimental, Format: lib 'use strict'; @@ -930,14 +745,11 @@ exports[`Rollup externals babel transforms example test case: native-experimenta require('@packemon/foo'); require('@packemon/bar'); //# sourceMappingURL=index-native-experimental-lib.js.map -", -] +" `; -exports[`Rollup externals babel transforms example test case: native-legacy-lib 1`] = ` -[ - "lib/index-native-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals > babel > transforms example test case: native-legacy-lib > lib/index-native-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: legacy, Format: lib 'use strict'; @@ -945,14 +757,11 @@ exports[`Rollup externals babel transforms example test case: native-legacy-lib require('@packemon/foo'); require('@packemon/bar'); //# sourceMappingURL=index-native-legacy-lib.js.map -", -] +" `; -exports[`Rollup externals babel transforms example test case: native-stable-lib 1`] = ` -[ - "lib/index-native-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals > babel > transforms example test case: native-stable-lib > lib/index-native-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: stable, Format: lib 'use strict'; @@ -960,24 +769,11 @@ exports[`Rollup externals babel transforms example test case: native-stable-lib require('@packemon/foo'); require('@packemon/bar'); //# sourceMappingURL=index-native-stable-lib.js.map -", -] +" `; -exports[`Rollup externals babel transforms example test case: node-current-cjs 1`] = ` -[ - "cjs/index-node-current-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import './index-node-current-cjs.cjs';", -] -`; - -exports[`Rollup externals babel transforms example test case: node-current-cjs 2`] = ` -[ - "cjs/index-node-current-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals > babel > transforms example test case: node-current-cjs > cjs/index-node-current-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: cjs 'use strict'; @@ -985,14 +781,18 @@ exports[`Rollup externals babel transforms example test case: node-current-cjs 2 require('@packemon/foo'); require('@packemon/bar'); //# sourceMappingURL=index-node-current-cjs.cjs.map -", -] +" +`; + +exports[`Rollup externals > babel > transforms example test case: node-current-cjs > cjs/index-node-current-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-current-cjs.cjs';" `; -exports[`Rollup externals babel transforms example test case: node-current-lib 1`] = ` -[ - "lib/index-node-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals > babel > transforms example test case: node-current-lib > lib/index-node-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: lib 'use strict'; @@ -1000,37 +800,21 @@ exports[`Rollup externals babel transforms example test case: node-current-lib 1 require('@packemon/foo'); require('@packemon/bar'); //# sourceMappingURL=index-node-current-lib.js.map -", -] +" `; -exports[`Rollup externals babel transforms example test case: node-current-mjs 1`] = ` -[ - "mjs/index-node-current-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals > babel > transforms example test case: node-current-mjs > mjs/index-node-current-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: mjs import '@packemon/foo'; import '@packemon/bar'; //# sourceMappingURL=index-node-current-mjs.mjs.map -", -] +" `; -exports[`Rollup externals babel transforms example test case: node-experimental-cjs 1`] = ` -[ - "cjs/index-node-experimental-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import './index-node-experimental-cjs.cjs';", -] -`; - -exports[`Rollup externals babel transforms example test case: node-experimental-cjs 2`] = ` -[ - "cjs/index-node-experimental-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals > babel > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: cjs 'use strict'; @@ -1038,14 +822,18 @@ exports[`Rollup externals babel transforms example test case: node-experimental- require('@packemon/foo'); require('@packemon/bar'); //# sourceMappingURL=index-node-experimental-cjs.cjs.map -", -] +" +`; + +exports[`Rollup externals > babel > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-experimental-cjs.cjs';" `; -exports[`Rollup externals babel transforms example test case: node-experimental-lib 1`] = ` -[ - "lib/index-node-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals > babel > transforms example test case: node-experimental-lib > lib/index-node-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: lib 'use strict'; @@ -1053,37 +841,21 @@ exports[`Rollup externals babel transforms example test case: node-experimental- require('@packemon/foo'); require('@packemon/bar'); //# sourceMappingURL=index-node-experimental-lib.js.map -", -] +" `; -exports[`Rollup externals babel transforms example test case: node-experimental-mjs 1`] = ` -[ - "mjs/index-node-experimental-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals > babel > transforms example test case: node-experimental-mjs > mjs/index-node-experimental-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: mjs import '@packemon/foo'; import '@packemon/bar'; //# sourceMappingURL=index-node-experimental-mjs.mjs.map -", -] +" `; -exports[`Rollup externals babel transforms example test case: node-legacy-cjs 1`] = ` -[ - "cjs/index-node-legacy-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import './index-node-legacy-cjs.cjs';", -] -`; - -exports[`Rollup externals babel transforms example test case: node-legacy-cjs 2`] = ` -[ - "cjs/index-node-legacy-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals > babel > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: cjs 'use strict'; @@ -1091,14 +863,18 @@ exports[`Rollup externals babel transforms example test case: node-legacy-cjs 2` require('@packemon/foo'); require('@packemon/bar'); //# sourceMappingURL=index-node-legacy-cjs.cjs.map -", -] +" +`; + +exports[`Rollup externals > babel > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-legacy-cjs.cjs';" `; -exports[`Rollup externals babel transforms example test case: node-legacy-lib 1`] = ` -[ - "lib/index-node-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals > babel > transforms example test case: node-legacy-lib > lib/index-node-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: lib 'use strict'; @@ -1106,37 +882,21 @@ exports[`Rollup externals babel transforms example test case: node-legacy-lib 1` require('@packemon/foo'); require('@packemon/bar'); //# sourceMappingURL=index-node-legacy-lib.js.map -", -] +" `; -exports[`Rollup externals babel transforms example test case: node-legacy-mjs 1`] = ` -[ - "mjs/index-node-legacy-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals > babel > transforms example test case: node-legacy-mjs > mjs/index-node-legacy-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: mjs import '@packemon/foo'; import '@packemon/bar'; //# sourceMappingURL=index-node-legacy-mjs.mjs.map -", -] +" `; -exports[`Rollup externals babel transforms example test case: node-stable-cjs 1`] = ` -[ - "cjs/index-node-stable-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import './index-node-stable-cjs.cjs';", -] -`; - -exports[`Rollup externals babel transforms example test case: node-stable-cjs 2`] = ` -[ - "cjs/index-node-stable-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals > babel > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: cjs 'use strict'; @@ -1144,14 +904,18 @@ exports[`Rollup externals babel transforms example test case: node-stable-cjs 2` require('@packemon/foo'); require('@packemon/bar'); //# sourceMappingURL=index-node-stable-cjs.cjs.map -", -] +" +`; + +exports[`Rollup externals > babel > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import './index-node-stable-cjs.cjs';" `; -exports[`Rollup externals babel transforms example test case: node-stable-lib 1`] = ` -[ - "lib/index-node-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals > babel > transforms example test case: node-stable-lib > lib/index-node-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: lib 'use strict'; @@ -1159,19 +923,15 @@ exports[`Rollup externals babel transforms example test case: node-stable-lib 1` require('@packemon/foo'); require('@packemon/bar'); //# sourceMappingURL=index-node-stable-lib.js.map -", -] +" `; -exports[`Rollup externals babel transforms example test case: node-stable-mjs 1`] = ` -[ - "mjs/index-node-stable-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Rollup externals > babel > transforms example test case: node-stable-mjs > mjs/index-node-stable-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: mjs import '@packemon/foo'; import '@packemon/bar'; //# sourceMappingURL=index-node-stable-mjs.mjs.map -", -] +" `; diff --git a/packages/packemon/tests/examples/__snapshots__/generators.test.ts.snap b/packages/packemon/tests/examples/__snapshots__/generators.test.ts.snap index db18a428d..bb0393376 100644 --- a/packages/packemon/tests/examples/__snapshots__/generators.test.ts.snap +++ b/packages/packemon/tests/examples/__snapshots__/generators.test.ts.snap @@ -1,9 +1,7 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`Generators babel transforms example test case: browser-current-esm 1`] = ` -[ - "esm/index-browser-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > babel > transforms example test case: browser-current-esm > esm/index-browser-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: esm function* gen() {} @@ -14,14 +12,11 @@ function runGen() { } export { gen, runGen }; //# sourceMappingURL=index-browser-current-esm.js.map -", -] +" `; -exports[`Generators babel transforms example test case: browser-current-lib 1`] = ` -[ - "lib/index-browser-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > babel > transforms example test case: browser-current-lib > lib/index-browser-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: lib 'use strict'; @@ -35,14 +30,11 @@ function runGen() { exports.gen = gen; exports.runGen = runGen; //# sourceMappingURL=index-browser-current-lib.js.map -", -] +" `; -exports[`Generators babel transforms example test case: browser-current-umd 1`] = ` -[ - "umd/index-browser-current-umd.js", - "(function (global, factory) { +exports[`Generators > babel > transforms example test case: browser-current-umd > umd/index-browser-current-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports"], factory); } else if (typeof exports !== "undefined") { @@ -73,14 +65,11 @@ exports[`Generators babel transforms example test case: browser-current-umd 1`] } }); //# sourceMappingURL=index-browser-current-umd.js.map -", -] +" `; -exports[`Generators babel transforms example test case: browser-experimental-esm 1`] = ` -[ - "esm/index-browser-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > babel > transforms example test case: browser-experimental-esm > esm/index-browser-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: esm function* gen() {} @@ -91,14 +80,11 @@ function runGen() { } export { gen, runGen }; //# sourceMappingURL=index-browser-experimental-esm.js.map -", -] +" `; -exports[`Generators babel transforms example test case: browser-experimental-lib 1`] = ` -[ - "lib/index-browser-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > babel > transforms example test case: browser-experimental-lib > lib/index-browser-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: lib 'use strict'; @@ -112,14 +98,11 @@ function runGen() { exports.gen = gen; exports.runGen = runGen; //# sourceMappingURL=index-browser-experimental-lib.js.map -", -] +" `; -exports[`Generators babel transforms example test case: browser-experimental-umd 1`] = ` -[ - "umd/index-browser-experimental-umd.js", - "(function (global, factory) { +exports[`Generators > babel > transforms example test case: browser-experimental-umd > umd/index-browser-experimental-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports"], factory); } else if (typeof exports !== "undefined") { @@ -150,14 +133,11 @@ exports[`Generators babel transforms example test case: browser-experimental-umd } }); //# sourceMappingURL=index-browser-experimental-umd.js.map -", -] +" `; -exports[`Generators babel transforms example test case: browser-legacy-esm 1`] = ` -[ - "esm/index-browser-legacy-esm.js", - "function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } +exports[`Generators > babel > transforms example test case: browser-legacy-esm > esm/index-browser-legacy-esm.js 1`] = ` +"function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } // Bundled with Packemon: https://packemon.dev @@ -180,14 +160,11 @@ function runGen() { } export { gen, runGen }; //# sourceMappingURL=index-browser-legacy-esm.js.map -", -] +" `; -exports[`Generators babel transforms example test case: browser-legacy-lib 1`] = ` -[ - "lib/index-browser-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > babel > transforms example test case: browser-legacy-lib > lib/index-browser-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: lib 'use strict'; @@ -213,14 +190,11 @@ function runGen() { exports.gen = gen; exports.runGen = runGen; //# sourceMappingURL=index-browser-legacy-lib.js.map -", -] +" `; -exports[`Generators babel transforms example test case: browser-legacy-umd 1`] = ` -[ - "umd/index-browser-legacy-umd.js", - "(function (global, factory) { +exports[`Generators > babel > transforms example test case: browser-legacy-umd > umd/index-browser-legacy-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports"], factory); } else if (typeof exports !== "undefined") { @@ -263,14 +237,11 @@ exports[`Generators babel transforms example test case: browser-legacy-umd 1`] = } }); //# sourceMappingURL=index-browser-legacy-umd.js.map -", -] +" `; -exports[`Generators babel transforms example test case: browser-stable-esm 1`] = ` -[ - "esm/index-browser-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > babel > transforms example test case: browser-stable-esm > esm/index-browser-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: esm function* gen() {} @@ -281,14 +252,11 @@ function runGen() { } export { gen, runGen }; //# sourceMappingURL=index-browser-stable-esm.js.map -", -] +" `; -exports[`Generators babel transforms example test case: browser-stable-lib 1`] = ` -[ - "lib/index-browser-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > babel > transforms example test case: browser-stable-lib > lib/index-browser-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: lib 'use strict'; @@ -302,14 +270,11 @@ function runGen() { exports.gen = gen; exports.runGen = runGen; //# sourceMappingURL=index-browser-stable-lib.js.map -", -] +" `; -exports[`Generators babel transforms example test case: browser-stable-umd 1`] = ` -[ - "umd/index-browser-stable-umd.js", - "(function (global, factory) { +exports[`Generators > babel > transforms example test case: browser-stable-umd > umd/index-browser-stable-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports"], factory); } else if (typeof exports !== "undefined") { @@ -340,14 +305,11 @@ exports[`Generators babel transforms example test case: browser-stable-umd 1`] = } }); //# sourceMappingURL=index-browser-stable-umd.js.map -", -] +" `; -exports[`Generators babel transforms example test case: electron-current-esm 1`] = ` -[ - "esm/index-electron-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > babel > transforms example test case: electron-current-esm > esm/index-electron-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: esm function* gen() {} @@ -358,14 +320,11 @@ function runGen() { } export { gen, runGen }; //# sourceMappingURL=index-electron-current-esm.js.map -", -] +" `; -exports[`Generators babel transforms example test case: electron-current-lib 1`] = ` -[ - "lib/index-electron-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > babel > transforms example test case: electron-current-lib > lib/index-electron-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: lib 'use strict'; @@ -379,14 +338,11 @@ function runGen() { exports.gen = gen; exports.runGen = runGen; //# sourceMappingURL=index-electron-current-lib.js.map -", -] +" `; -exports[`Generators babel transforms example test case: electron-experimental-esm 1`] = ` -[ - "esm/index-electron-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > babel > transforms example test case: electron-experimental-esm > esm/index-electron-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: esm function* gen() {} @@ -397,14 +353,11 @@ function runGen() { } export { gen, runGen }; //# sourceMappingURL=index-electron-experimental-esm.js.map -", -] +" `; -exports[`Generators babel transforms example test case: electron-experimental-lib 1`] = ` -[ - "lib/index-electron-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > babel > transforms example test case: electron-experimental-lib > lib/index-electron-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: lib 'use strict'; @@ -418,14 +371,11 @@ function runGen() { exports.gen = gen; exports.runGen = runGen; //# sourceMappingURL=index-electron-experimental-lib.js.map -", -] +" `; -exports[`Generators babel transforms example test case: electron-legacy-esm 1`] = ` -[ - "esm/index-electron-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > babel > transforms example test case: electron-legacy-esm > esm/index-electron-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: esm function* gen() {} @@ -436,14 +386,11 @@ function runGen() { } export { gen, runGen }; //# sourceMappingURL=index-electron-legacy-esm.js.map -", -] +" `; -exports[`Generators babel transforms example test case: electron-legacy-lib 1`] = ` -[ - "lib/index-electron-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > babel > transforms example test case: electron-legacy-lib > lib/index-electron-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: lib 'use strict'; @@ -457,14 +404,11 @@ function runGen() { exports.gen = gen; exports.runGen = runGen; //# sourceMappingURL=index-electron-legacy-lib.js.map -", -] +" `; -exports[`Generators babel transforms example test case: electron-stable-esm 1`] = ` -[ - "esm/index-electron-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > babel > transforms example test case: electron-stable-esm > esm/index-electron-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: esm function* gen() {} @@ -475,14 +419,11 @@ function runGen() { } export { gen, runGen }; //# sourceMappingURL=index-electron-stable-esm.js.map -", -] +" `; -exports[`Generators babel transforms example test case: electron-stable-lib 1`] = ` -[ - "lib/index-electron-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > babel > transforms example test case: electron-stable-lib > lib/index-electron-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: lib 'use strict'; @@ -496,14 +437,11 @@ function runGen() { exports.gen = gen; exports.runGen = runGen; //# sourceMappingURL=index-electron-stable-lib.js.map -", -] +" `; -exports[`Generators babel transforms example test case: native-current-lib 1`] = ` -[ - "lib/index-native-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > babel > transforms example test case: native-current-lib > lib/index-native-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: current, Format: lib 'use strict'; @@ -517,14 +455,11 @@ function runGen() { exports.gen = gen; exports.runGen = runGen; //# sourceMappingURL=index-native-current-lib.js.map -", -] +" `; -exports[`Generators babel transforms example test case: native-experimental-lib 1`] = ` -[ - "lib/index-native-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > babel > transforms example test case: native-experimental-lib > lib/index-native-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: experimental, Format: lib 'use strict'; @@ -538,14 +473,11 @@ function runGen() { exports.gen = gen; exports.runGen = runGen; //# sourceMappingURL=index-native-experimental-lib.js.map -", -] +" `; -exports[`Generators babel transforms example test case: native-legacy-lib 1`] = ` -[ - "lib/index-native-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > babel > transforms example test case: native-legacy-lib > lib/index-native-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: legacy, Format: lib 'use strict'; @@ -559,14 +491,11 @@ function runGen() { exports.gen = gen; exports.runGen = runGen; //# sourceMappingURL=index-native-legacy-lib.js.map -", -] +" `; -exports[`Generators babel transforms example test case: native-stable-lib 1`] = ` -[ - "lib/index-native-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > babel > transforms example test case: native-stable-lib > lib/index-native-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: stable, Format: lib 'use strict'; @@ -580,26 +509,11 @@ function runGen() { exports.gen = gen; exports.runGen = runGen; //# sourceMappingURL=index-native-stable-lib.js.map -", -] +" `; -exports[`Generators babel transforms example test case: node-current-cjs 1`] = ` -[ - "cjs/index-node-current-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-current-cjs.cjs'; - -export const { gen, runGen } = data;", -] -`; - -exports[`Generators babel transforms example test case: node-current-cjs 2`] = ` -[ - "cjs/index-node-current-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > babel > transforms example test case: node-current-cjs > cjs/index-node-current-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: cjs 'use strict'; @@ -613,14 +527,20 @@ function runGen() { exports.gen = gen; exports.runGen = runGen; //# sourceMappingURL=index-node-current-cjs.cjs.map -", -] +" +`; + +exports[`Generators > babel > transforms example test case: node-current-cjs > cjs/index-node-current-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-current-cjs.cjs'; + +export const { gen, runGen } = data;" `; -exports[`Generators babel transforms example test case: node-current-lib 1`] = ` -[ - "lib/index-node-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > babel > transforms example test case: node-current-lib > lib/index-node-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: lib 'use strict'; @@ -634,14 +554,11 @@ function runGen() { exports.gen = gen; exports.runGen = runGen; //# sourceMappingURL=index-node-current-lib.js.map -", -] +" `; -exports[`Generators babel transforms example test case: node-current-mjs 1`] = ` -[ - "mjs/index-node-current-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > babel > transforms example test case: node-current-mjs > mjs/index-node-current-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: mjs function* gen() {} @@ -652,26 +569,11 @@ function runGen() { } export { gen, runGen }; //# sourceMappingURL=index-node-current-mjs.mjs.map -", -] +" `; -exports[`Generators babel transforms example test case: node-experimental-cjs 1`] = ` -[ - "cjs/index-node-experimental-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-experimental-cjs.cjs'; - -export const { gen, runGen } = data;", -] -`; - -exports[`Generators babel transforms example test case: node-experimental-cjs 2`] = ` -[ - "cjs/index-node-experimental-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > babel > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: cjs 'use strict'; @@ -685,14 +587,20 @@ function runGen() { exports.gen = gen; exports.runGen = runGen; //# sourceMappingURL=index-node-experimental-cjs.cjs.map -", -] +" +`; + +exports[`Generators > babel > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-experimental-cjs.cjs'; + +export const { gen, runGen } = data;" `; -exports[`Generators babel transforms example test case: node-experimental-lib 1`] = ` -[ - "lib/index-node-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > babel > transforms example test case: node-experimental-lib > lib/index-node-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: lib 'use strict'; @@ -706,14 +614,11 @@ function runGen() { exports.gen = gen; exports.runGen = runGen; //# sourceMappingURL=index-node-experimental-lib.js.map -", -] +" `; -exports[`Generators babel transforms example test case: node-experimental-mjs 1`] = ` -[ - "mjs/index-node-experimental-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > babel > transforms example test case: node-experimental-mjs > mjs/index-node-experimental-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: mjs function* gen() {} @@ -724,26 +629,11 @@ function runGen() { } export { gen, runGen }; //# sourceMappingURL=index-node-experimental-mjs.mjs.map -", -] +" `; -exports[`Generators babel transforms example test case: node-legacy-cjs 1`] = ` -[ - "cjs/index-node-legacy-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-legacy-cjs.cjs'; - -export const { gen, runGen } = data;", -] -`; - -exports[`Generators babel transforms example test case: node-legacy-cjs 2`] = ` -[ - "cjs/index-node-legacy-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > babel > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: cjs 'use strict'; @@ -757,14 +647,20 @@ function runGen() { exports.gen = gen; exports.runGen = runGen; //# sourceMappingURL=index-node-legacy-cjs.cjs.map -", -] +" +`; + +exports[`Generators > babel > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-legacy-cjs.cjs'; + +export const { gen, runGen } = data;" `; -exports[`Generators babel transforms example test case: node-legacy-lib 1`] = ` -[ - "lib/index-node-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > babel > transforms example test case: node-legacy-lib > lib/index-node-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: lib 'use strict'; @@ -778,14 +674,11 @@ function runGen() { exports.gen = gen; exports.runGen = runGen; //# sourceMappingURL=index-node-legacy-lib.js.map -", -] +" `; -exports[`Generators babel transforms example test case: node-legacy-mjs 1`] = ` -[ - "mjs/index-node-legacy-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > babel > transforms example test case: node-legacy-mjs > mjs/index-node-legacy-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: mjs function* gen() {} @@ -796,26 +689,11 @@ function runGen() { } export { gen, runGen }; //# sourceMappingURL=index-node-legacy-mjs.mjs.map -", -] +" `; -exports[`Generators babel transforms example test case: node-stable-cjs 1`] = ` -[ - "cjs/index-node-stable-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-stable-cjs.cjs'; - -export const { gen, runGen } = data;", -] -`; - -exports[`Generators babel transforms example test case: node-stable-cjs 2`] = ` -[ - "cjs/index-node-stable-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > babel > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: cjs 'use strict'; @@ -829,14 +707,20 @@ function runGen() { exports.gen = gen; exports.runGen = runGen; //# sourceMappingURL=index-node-stable-cjs.cjs.map -", -] +" +`; + +exports[`Generators > babel > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-stable-cjs.cjs'; + +export const { gen, runGen } = data;" `; -exports[`Generators babel transforms example test case: node-stable-lib 1`] = ` -[ - "lib/index-node-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > babel > transforms example test case: node-stable-lib > lib/index-node-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: lib 'use strict'; @@ -850,14 +734,11 @@ function runGen() { exports.gen = gen; exports.runGen = runGen; //# sourceMappingURL=index-node-stable-lib.js.map -", -] +" `; -exports[`Generators babel transforms example test case: node-stable-mjs 1`] = ` -[ - "mjs/index-node-stable-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > babel > transforms example test case: node-stable-mjs > mjs/index-node-stable-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: mjs function* gen() {} @@ -868,14 +749,11 @@ function runGen() { } export { gen, runGen }; //# sourceMappingURL=index-node-stable-mjs.mjs.map -", -] +" `; -exports[`Generators swc transforms example test case: browser-current-esm 1`] = ` -[ - "esm/index-browser-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > swc > transforms example test case: browser-current-esm > esm/index-browser-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: esm function* gen() {} function runGen() { @@ -885,14 +763,11 @@ function runGen() { } export { gen, runGen }; //# sourceMappingURL=index-browser-current-esm.js.map -", -] +" `; -exports[`Generators swc transforms example test case: browser-current-lib 1`] = ` -[ - "lib/index-browser-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > swc > transforms example test case: browser-current-lib > lib/index-browser-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: lib "use strict"; function* gen() {} @@ -904,14 +779,11 @@ function runGen() { exports.gen = gen; exports.runGen = runGen; //# sourceMappingURL=index-browser-current-lib.js.map -", -] +" `; -exports[`Generators swc transforms example test case: browser-current-umd 1`] = ` -[ - "umd/index-browser-current-umd.js", - "(function(global, factory) { +exports[`Generators > swc > transforms example test case: browser-current-umd > umd/index-browser-current-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports); else if (typeof define === "function" && define.amd) define([ "exports" @@ -944,14 +816,11 @@ exports[`Generators swc transforms example test case: browser-current-umd 1`] = } }); //# sourceMappingURL=index-browser-current-umd.js.map -", -] +" `; -exports[`Generators swc transforms example test case: browser-experimental-esm 1`] = ` -[ - "esm/index-browser-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > swc > transforms example test case: browser-experimental-esm > esm/index-browser-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: esm function* gen() {} function runGen() { @@ -961,14 +830,11 @@ function runGen() { } export { gen, runGen }; //# sourceMappingURL=index-browser-experimental-esm.js.map -", -] +" `; -exports[`Generators swc transforms example test case: browser-experimental-lib 1`] = ` -[ - "lib/index-browser-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > swc > transforms example test case: browser-experimental-lib > lib/index-browser-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: lib "use strict"; function* gen() {} @@ -980,14 +846,11 @@ function runGen() { exports.gen = gen; exports.runGen = runGen; //# sourceMappingURL=index-browser-experimental-lib.js.map -", -] +" `; -exports[`Generators swc transforms example test case: browser-experimental-umd 1`] = ` -[ - "umd/index-browser-experimental-umd.js", - "(function(global, factory) { +exports[`Generators > swc > transforms example test case: browser-experimental-umd > umd/index-browser-experimental-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports); else if (typeof define === "function" && define.amd) define([ "exports" @@ -1020,14 +883,11 @@ exports[`Generators swc transforms example test case: browser-experimental-umd 1 } }); //# sourceMappingURL=index-browser-experimental-umd.js.map -", -] +" `; -exports[`Generators swc transforms example test case: browser-legacy-esm 1`] = ` -[ - "esm/index-browser-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > swc > transforms example test case: browser-legacy-esm > esm/index-browser-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: esm function _ts_generator(thisArg, body) { var f, y, t, g, _ = { @@ -1155,14 +1015,11 @@ function runGen() { } export { gen, runGen }; //# sourceMappingURL=index-browser-legacy-esm.js.map -", -] +" `; -exports[`Generators swc transforms example test case: browser-legacy-lib 1`] = ` -[ - "lib/index-browser-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > swc > transforms example test case: browser-legacy-lib > lib/index-browser-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: lib "use strict"; function _ts_generator(thisArg, body) { @@ -1292,14 +1149,11 @@ function runGen() { exports.gen = gen; exports.runGen = runGen; //# sourceMappingURL=index-browser-legacy-lib.js.map -", -] +" `; -exports[`Generators swc transforms example test case: browser-legacy-umd 1`] = ` -[ - "umd/index-browser-legacy-umd.js", - "(function(global, factory) { +exports[`Generators > swc > transforms example test case: browser-legacy-umd > umd/index-browser-legacy-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports); else if (typeof define === "function" && define.amd) define([ "exports" @@ -1450,14 +1304,11 @@ exports[`Generators swc transforms example test case: browser-legacy-umd 1`] = ` } }); //# sourceMappingURL=index-browser-legacy-umd.js.map -", -] +" `; -exports[`Generators swc transforms example test case: browser-stable-esm 1`] = ` -[ - "esm/index-browser-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > swc > transforms example test case: browser-stable-esm > esm/index-browser-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: esm function* gen() {} function runGen() { @@ -1467,14 +1318,11 @@ function runGen() { } export { gen, runGen }; //# sourceMappingURL=index-browser-stable-esm.js.map -", -] +" `; -exports[`Generators swc transforms example test case: browser-stable-lib 1`] = ` -[ - "lib/index-browser-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > swc > transforms example test case: browser-stable-lib > lib/index-browser-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: lib "use strict"; function* gen() {} @@ -1486,14 +1334,11 @@ function runGen() { exports.gen = gen; exports.runGen = runGen; //# sourceMappingURL=index-browser-stable-lib.js.map -", -] +" `; -exports[`Generators swc transforms example test case: browser-stable-umd 1`] = ` -[ - "umd/index-browser-stable-umd.js", - "(function(global, factory) { +exports[`Generators > swc > transforms example test case: browser-stable-umd > umd/index-browser-stable-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports); else if (typeof define === "function" && define.amd) define([ "exports" @@ -1526,14 +1371,11 @@ exports[`Generators swc transforms example test case: browser-stable-umd 1`] = ` } }); //# sourceMappingURL=index-browser-stable-umd.js.map -", -] +" `; -exports[`Generators swc transforms example test case: electron-current-esm 1`] = ` -[ - "esm/index-electron-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > swc > transforms example test case: electron-current-esm > esm/index-electron-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: esm function* gen() {} function runGen() { @@ -1543,14 +1385,11 @@ function runGen() { } export { gen, runGen }; //# sourceMappingURL=index-electron-current-esm.js.map -", -] +" `; -exports[`Generators swc transforms example test case: electron-current-lib 1`] = ` -[ - "lib/index-electron-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > swc > transforms example test case: electron-current-lib > lib/index-electron-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: lib "use strict"; function* gen() {} @@ -1562,14 +1401,11 @@ function runGen() { exports.gen = gen; exports.runGen = runGen; //# sourceMappingURL=index-electron-current-lib.js.map -", -] +" `; -exports[`Generators swc transforms example test case: electron-experimental-esm 1`] = ` -[ - "esm/index-electron-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > swc > transforms example test case: electron-experimental-esm > esm/index-electron-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: esm function* gen() {} function runGen() { @@ -1579,14 +1415,11 @@ function runGen() { } export { gen, runGen }; //# sourceMappingURL=index-electron-experimental-esm.js.map -", -] +" `; -exports[`Generators swc transforms example test case: electron-experimental-lib 1`] = ` -[ - "lib/index-electron-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > swc > transforms example test case: electron-experimental-lib > lib/index-electron-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: lib "use strict"; function* gen() {} @@ -1598,14 +1431,11 @@ function runGen() { exports.gen = gen; exports.runGen = runGen; //# sourceMappingURL=index-electron-experimental-lib.js.map -", -] +" `; -exports[`Generators swc transforms example test case: electron-legacy-esm 1`] = ` -[ - "esm/index-electron-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > swc > transforms example test case: electron-legacy-esm > esm/index-electron-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: esm function* gen() {} function runGen() { @@ -1615,14 +1445,11 @@ function runGen() { } export { gen, runGen }; //# sourceMappingURL=index-electron-legacy-esm.js.map -", -] +" `; -exports[`Generators swc transforms example test case: electron-legacy-lib 1`] = ` -[ - "lib/index-electron-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > swc > transforms example test case: electron-legacy-lib > lib/index-electron-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: lib "use strict"; function* gen() {} @@ -1634,14 +1461,11 @@ function runGen() { exports.gen = gen; exports.runGen = runGen; //# sourceMappingURL=index-electron-legacy-lib.js.map -", -] +" `; -exports[`Generators swc transforms example test case: electron-stable-esm 1`] = ` -[ - "esm/index-electron-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > swc > transforms example test case: electron-stable-esm > esm/index-electron-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: esm function* gen() {} function runGen() { @@ -1651,14 +1475,11 @@ function runGen() { } export { gen, runGen }; //# sourceMappingURL=index-electron-stable-esm.js.map -", -] +" `; -exports[`Generators swc transforms example test case: electron-stable-lib 1`] = ` -[ - "lib/index-electron-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > swc > transforms example test case: electron-stable-lib > lib/index-electron-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: lib "use strict"; function* gen() {} @@ -1670,14 +1491,11 @@ function runGen() { exports.gen = gen; exports.runGen = runGen; //# sourceMappingURL=index-electron-stable-lib.js.map -", -] +" `; -exports[`Generators swc transforms example test case: native-current-lib 1`] = ` -[ - "lib/index-native-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > swc > transforms example test case: native-current-lib > lib/index-native-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: current, Format: lib "use strict"; function* gen() {} @@ -1689,14 +1507,11 @@ function runGen() { exports.gen = gen; exports.runGen = runGen; //# sourceMappingURL=index-native-current-lib.js.map -", -] +" `; -exports[`Generators swc transforms example test case: native-experimental-lib 1`] = ` -[ - "lib/index-native-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > swc > transforms example test case: native-experimental-lib > lib/index-native-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: experimental, Format: lib "use strict"; function* gen() {} @@ -1708,14 +1523,11 @@ function runGen() { exports.gen = gen; exports.runGen = runGen; //# sourceMappingURL=index-native-experimental-lib.js.map -", -] +" `; -exports[`Generators swc transforms example test case: native-legacy-lib 1`] = ` -[ - "lib/index-native-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > swc > transforms example test case: native-legacy-lib > lib/index-native-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: legacy, Format: lib "use strict"; function* gen() {} @@ -1727,14 +1539,11 @@ function runGen() { exports.gen = gen; exports.runGen = runGen; //# sourceMappingURL=index-native-legacy-lib.js.map -", -] +" `; -exports[`Generators swc transforms example test case: native-stable-lib 1`] = ` -[ - "lib/index-native-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > swc > transforms example test case: native-stable-lib > lib/index-native-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: stable, Format: lib "use strict"; function* gen() {} @@ -1746,26 +1555,11 @@ function runGen() { exports.gen = gen; exports.runGen = runGen; //# sourceMappingURL=index-native-stable-lib.js.map -", -] +" `; -exports[`Generators swc transforms example test case: node-current-cjs 1`] = ` -[ - "cjs/index-node-current-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-current-cjs.cjs'; - -export const { gen, runGen } = data;", -] -`; - -exports[`Generators swc transforms example test case: node-current-cjs 2`] = ` -[ - "cjs/index-node-current-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > swc > transforms example test case: node-current-cjs > cjs/index-node-current-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: cjs "use strict"; function* gen() {} @@ -1777,14 +1571,20 @@ function runGen() { exports.gen = gen; exports.runGen = runGen; //# sourceMappingURL=index-node-current-cjs.cjs.map -", -] +" +`; + +exports[`Generators > swc > transforms example test case: node-current-cjs > cjs/index-node-current-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-current-cjs.cjs'; + +export const { gen, runGen } = data;" `; -exports[`Generators swc transforms example test case: node-current-lib 1`] = ` -[ - "lib/index-node-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > swc > transforms example test case: node-current-lib > lib/index-node-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: lib "use strict"; function* gen() {} @@ -1796,14 +1596,11 @@ function runGen() { exports.gen = gen; exports.runGen = runGen; //# sourceMappingURL=index-node-current-lib.js.map -", -] +" `; -exports[`Generators swc transforms example test case: node-current-mjs 1`] = ` -[ - "mjs/index-node-current-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > swc > transforms example test case: node-current-mjs > mjs/index-node-current-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: mjs function* gen() {} function runGen() { @@ -1813,26 +1610,11 @@ function runGen() { } export { gen, runGen }; //# sourceMappingURL=index-node-current-mjs.mjs.map -", -] +" `; -exports[`Generators swc transforms example test case: node-experimental-cjs 1`] = ` -[ - "cjs/index-node-experimental-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-experimental-cjs.cjs'; - -export const { gen, runGen } = data;", -] -`; - -exports[`Generators swc transforms example test case: node-experimental-cjs 2`] = ` -[ - "cjs/index-node-experimental-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > swc > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: cjs "use strict"; function* gen() {} @@ -1844,14 +1626,20 @@ function runGen() { exports.gen = gen; exports.runGen = runGen; //# sourceMappingURL=index-node-experimental-cjs.cjs.map -", -] +" +`; + +exports[`Generators > swc > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-experimental-cjs.cjs'; + +export const { gen, runGen } = data;" `; -exports[`Generators swc transforms example test case: node-experimental-lib 1`] = ` -[ - "lib/index-node-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > swc > transforms example test case: node-experimental-lib > lib/index-node-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: lib "use strict"; function* gen() {} @@ -1863,14 +1651,11 @@ function runGen() { exports.gen = gen; exports.runGen = runGen; //# sourceMappingURL=index-node-experimental-lib.js.map -", -] +" `; -exports[`Generators swc transforms example test case: node-experimental-mjs 1`] = ` -[ - "mjs/index-node-experimental-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > swc > transforms example test case: node-experimental-mjs > mjs/index-node-experimental-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: mjs function* gen() {} function runGen() { @@ -1880,26 +1665,11 @@ function runGen() { } export { gen, runGen }; //# sourceMappingURL=index-node-experimental-mjs.mjs.map -", -] +" `; -exports[`Generators swc transforms example test case: node-legacy-cjs 1`] = ` -[ - "cjs/index-node-legacy-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-legacy-cjs.cjs'; - -export const { gen, runGen } = data;", -] -`; - -exports[`Generators swc transforms example test case: node-legacy-cjs 2`] = ` -[ - "cjs/index-node-legacy-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > swc > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: cjs "use strict"; function* gen() {} @@ -1911,14 +1681,20 @@ function runGen() { exports.gen = gen; exports.runGen = runGen; //# sourceMappingURL=index-node-legacy-cjs.cjs.map -", -] +" +`; + +exports[`Generators > swc > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-legacy-cjs.cjs'; + +export const { gen, runGen } = data;" `; -exports[`Generators swc transforms example test case: node-legacy-lib 1`] = ` -[ - "lib/index-node-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > swc > transforms example test case: node-legacy-lib > lib/index-node-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: lib "use strict"; function* gen() {} @@ -1930,14 +1706,11 @@ function runGen() { exports.gen = gen; exports.runGen = runGen; //# sourceMappingURL=index-node-legacy-lib.js.map -", -] +" `; -exports[`Generators swc transforms example test case: node-legacy-mjs 1`] = ` -[ - "mjs/index-node-legacy-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > swc > transforms example test case: node-legacy-mjs > mjs/index-node-legacy-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: mjs function* gen() {} function runGen() { @@ -1947,26 +1720,11 @@ function runGen() { } export { gen, runGen }; //# sourceMappingURL=index-node-legacy-mjs.mjs.map -", -] +" `; -exports[`Generators swc transforms example test case: node-stable-cjs 1`] = ` -[ - "cjs/index-node-stable-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-stable-cjs.cjs'; - -export const { gen, runGen } = data;", -] -`; - -exports[`Generators swc transforms example test case: node-stable-cjs 2`] = ` -[ - "cjs/index-node-stable-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > swc > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: cjs "use strict"; function* gen() {} @@ -1978,14 +1736,20 @@ function runGen() { exports.gen = gen; exports.runGen = runGen; //# sourceMappingURL=index-node-stable-cjs.cjs.map -", -] +" +`; + +exports[`Generators > swc > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-stable-cjs.cjs'; + +export const { gen, runGen } = data;" `; -exports[`Generators swc transforms example test case: node-stable-lib 1`] = ` -[ - "lib/index-node-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > swc > transforms example test case: node-stable-lib > lib/index-node-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: lib "use strict"; function* gen() {} @@ -1997,14 +1761,11 @@ function runGen() { exports.gen = gen; exports.runGen = runGen; //# sourceMappingURL=index-node-stable-lib.js.map -", -] +" `; -exports[`Generators swc transforms example test case: node-stable-mjs 1`] = ` -[ - "mjs/index-node-stable-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Generators > swc > transforms example test case: node-stable-mjs > mjs/index-node-stable-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: mjs function* gen() {} function runGen() { @@ -2014,6 +1775,5 @@ function runGen() { } export { gen, runGen }; //# sourceMappingURL=index-node-stable-mjs.mjs.map -", -] +" `; diff --git a/packages/packemon/tests/examples/__snapshots__/jsonImports.test.ts.snap b/packages/packemon/tests/examples/__snapshots__/jsonImports.test.ts.snap index d4303beff..173d4ae2f 100644 --- a/packages/packemon/tests/examples/__snapshots__/jsonImports.test.ts.snap +++ b/packages/packemon/tests/examples/__snapshots__/jsonImports.test.ts.snap @@ -1,9 +1,7 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`JSON imports babel transforms example test case: browser-current-esm 1`] = ` -[ - "esm/index-browser-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > babel > transforms example test case: browser-current-esm > esm/index-browser-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: esm const data = { @@ -19,14 +17,11 @@ const data = { const keys = Object.keys(data); export { keys }; //# sourceMappingURL=index-browser-current-esm.js.map -", -] +" `; -exports[`JSON imports babel transforms example test case: browser-current-lib 1`] = ` -[ - "lib/index-browser-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > babel > transforms example test case: browser-current-lib > lib/index-browser-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: lib 'use strict'; @@ -44,14 +39,11 @@ const data = { const keys = Object.keys(data); exports.keys = keys; //# sourceMappingURL=index-browser-current-lib.js.map -", -] +" `; -exports[`JSON imports babel transforms example test case: browser-current-umd 1`] = ` -[ - "umd/index-browser-current-umd.js", - "(function (global, factory) { +exports[`JSON imports > babel > transforms example test case: browser-current-umd > umd/index-browser-current-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports"], factory); } else if (typeof exports !== "undefined") { @@ -86,14 +78,11 @@ exports[`JSON imports babel transforms example test case: browser-current-umd 1` const keys = _exports.keys = Object.keys(data); }); //# sourceMappingURL=index-browser-current-umd.js.map -", -] +" `; -exports[`JSON imports babel transforms example test case: browser-experimental-esm 1`] = ` -[ - "esm/index-browser-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > babel > transforms example test case: browser-experimental-esm > esm/index-browser-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: esm const data = { @@ -109,14 +98,11 @@ const data = { const keys = Object.keys(data); export { keys }; //# sourceMappingURL=index-browser-experimental-esm.js.map -", -] +" `; -exports[`JSON imports babel transforms example test case: browser-experimental-lib 1`] = ` -[ - "lib/index-browser-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > babel > transforms example test case: browser-experimental-lib > lib/index-browser-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: lib 'use strict'; @@ -134,14 +120,11 @@ const data = { const keys = Object.keys(data); exports.keys = keys; //# sourceMappingURL=index-browser-experimental-lib.js.map -", -] +" `; -exports[`JSON imports babel transforms example test case: browser-experimental-umd 1`] = ` -[ - "umd/index-browser-experimental-umd.js", - "(function (global, factory) { +exports[`JSON imports > babel > transforms example test case: browser-experimental-umd > umd/index-browser-experimental-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports"], factory); } else if (typeof exports !== "undefined") { @@ -176,14 +159,11 @@ exports[`JSON imports babel transforms example test case: browser-experimental-u const keys = _exports.keys = Object.keys(data); }); //# sourceMappingURL=index-browser-experimental-umd.js.map -", -] +" `; -exports[`JSON imports babel transforms example test case: browser-legacy-esm 1`] = ` -[ - "esm/index-browser-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > babel > transforms example test case: browser-legacy-esm > esm/index-browser-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: esm var data = { @@ -199,14 +179,11 @@ var data = { var keys = Object.keys(data); export { keys }; //# sourceMappingURL=index-browser-legacy-esm.js.map -", -] +" `; -exports[`JSON imports babel transforms example test case: browser-legacy-lib 1`] = ` -[ - "lib/index-browser-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > babel > transforms example test case: browser-legacy-lib > lib/index-browser-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: lib 'use strict'; @@ -224,14 +201,11 @@ var data = { var keys = Object.keys(data); exports.keys = keys; //# sourceMappingURL=index-browser-legacy-lib.js.map -", -] +" `; -exports[`JSON imports babel transforms example test case: browser-legacy-umd 1`] = ` -[ - "umd/index-browser-legacy-umd.js", - "(function (global, factory) { +exports[`JSON imports > babel > transforms example test case: browser-legacy-umd > umd/index-browser-legacy-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports"], factory); } else if (typeof exports !== "undefined") { @@ -266,14 +240,11 @@ exports[`JSON imports babel transforms example test case: browser-legacy-umd 1`] var keys = _exports.keys = Object.keys(data); }); //# sourceMappingURL=index-browser-legacy-umd.js.map -", -] +" `; -exports[`JSON imports babel transforms example test case: browser-stable-esm 1`] = ` -[ - "esm/index-browser-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > babel > transforms example test case: browser-stable-esm > esm/index-browser-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: esm const data = { @@ -289,14 +260,11 @@ const data = { const keys = Object.keys(data); export { keys }; //# sourceMappingURL=index-browser-stable-esm.js.map -", -] +" `; -exports[`JSON imports babel transforms example test case: browser-stable-lib 1`] = ` -[ - "lib/index-browser-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > babel > transforms example test case: browser-stable-lib > lib/index-browser-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: lib 'use strict'; @@ -314,14 +282,11 @@ const data = { const keys = Object.keys(data); exports.keys = keys; //# sourceMappingURL=index-browser-stable-lib.js.map -", -] +" `; -exports[`JSON imports babel transforms example test case: browser-stable-umd 1`] = ` -[ - "umd/index-browser-stable-umd.js", - "(function (global, factory) { +exports[`JSON imports > babel > transforms example test case: browser-stable-umd > umd/index-browser-stable-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports"], factory); } else if (typeof exports !== "undefined") { @@ -356,14 +321,11 @@ exports[`JSON imports babel transforms example test case: browser-stable-umd 1`] const keys = _exports.keys = Object.keys(data); }); //# sourceMappingURL=index-browser-stable-umd.js.map -", -] +" `; -exports[`JSON imports babel transforms example test case: electron-current-esm 1`] = ` -[ - "esm/index-electron-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > babel > transforms example test case: electron-current-esm > esm/index-electron-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: esm const data = { @@ -379,14 +341,11 @@ const data = { const keys = Object.keys(data); export { keys }; //# sourceMappingURL=index-electron-current-esm.js.map -", -] +" `; -exports[`JSON imports babel transforms example test case: electron-current-lib 1`] = ` -[ - "lib/index-electron-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > babel > transforms example test case: electron-current-lib > lib/index-electron-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: lib 'use strict'; @@ -404,14 +363,11 @@ const data = { const keys = Object.keys(data); exports.keys = keys; //# sourceMappingURL=index-electron-current-lib.js.map -", -] +" `; -exports[`JSON imports babel transforms example test case: electron-experimental-esm 1`] = ` -[ - "esm/index-electron-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > babel > transforms example test case: electron-experimental-esm > esm/index-electron-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: esm const data = { @@ -427,14 +383,11 @@ const data = { const keys = Object.keys(data); export { keys }; //# sourceMappingURL=index-electron-experimental-esm.js.map -", -] +" `; -exports[`JSON imports babel transforms example test case: electron-experimental-lib 1`] = ` -[ - "lib/index-electron-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > babel > transforms example test case: electron-experimental-lib > lib/index-electron-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: lib 'use strict'; @@ -452,14 +405,11 @@ const data = { const keys = Object.keys(data); exports.keys = keys; //# sourceMappingURL=index-electron-experimental-lib.js.map -", -] +" `; -exports[`JSON imports babel transforms example test case: electron-legacy-esm 1`] = ` -[ - "esm/index-electron-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > babel > transforms example test case: electron-legacy-esm > esm/index-electron-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: esm const data = { @@ -475,14 +425,11 @@ const data = { const keys = Object.keys(data); export { keys }; //# sourceMappingURL=index-electron-legacy-esm.js.map -", -] +" `; -exports[`JSON imports babel transforms example test case: electron-legacy-lib 1`] = ` -[ - "lib/index-electron-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > babel > transforms example test case: electron-legacy-lib > lib/index-electron-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: lib 'use strict'; @@ -500,14 +447,11 @@ const data = { const keys = Object.keys(data); exports.keys = keys; //# sourceMappingURL=index-electron-legacy-lib.js.map -", -] +" `; -exports[`JSON imports babel transforms example test case: electron-stable-esm 1`] = ` -[ - "esm/index-electron-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > babel > transforms example test case: electron-stable-esm > esm/index-electron-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: esm const data = { @@ -523,14 +467,11 @@ const data = { const keys = Object.keys(data); export { keys }; //# sourceMappingURL=index-electron-stable-esm.js.map -", -] +" `; -exports[`JSON imports babel transforms example test case: electron-stable-lib 1`] = ` -[ - "lib/index-electron-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > babel > transforms example test case: electron-stable-lib > lib/index-electron-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: lib 'use strict'; @@ -548,14 +489,11 @@ const data = { const keys = Object.keys(data); exports.keys = keys; //# sourceMappingURL=index-electron-stable-lib.js.map -", -] +" `; -exports[`JSON imports babel transforms example test case: native-current-lib 1`] = ` -[ - "lib/index-native-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > babel > transforms example test case: native-current-lib > lib/index-native-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: current, Format: lib 'use strict'; @@ -573,14 +511,11 @@ const data = { const keys = Object.keys(data); exports.keys = keys; //# sourceMappingURL=index-native-current-lib.js.map -", -] +" `; -exports[`JSON imports babel transforms example test case: native-experimental-lib 1`] = ` -[ - "lib/index-native-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > babel > transforms example test case: native-experimental-lib > lib/index-native-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: experimental, Format: lib 'use strict'; @@ -598,14 +533,11 @@ const data = { const keys = Object.keys(data); exports.keys = keys; //# sourceMappingURL=index-native-experimental-lib.js.map -", -] +" `; -exports[`JSON imports babel transforms example test case: native-legacy-lib 1`] = ` -[ - "lib/index-native-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > babel > transforms example test case: native-legacy-lib > lib/index-native-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: legacy, Format: lib 'use strict'; @@ -623,14 +555,11 @@ const data = { const keys = Object.keys(data); exports.keys = keys; //# sourceMappingURL=index-native-legacy-lib.js.map -", -] +" `; -exports[`JSON imports babel transforms example test case: native-stable-lib 1`] = ` -[ - "lib/index-native-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > babel > transforms example test case: native-stable-lib > lib/index-native-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: stable, Format: lib 'use strict'; @@ -648,26 +577,11 @@ const data = { const keys = Object.keys(data); exports.keys = keys; //# sourceMappingURL=index-native-stable-lib.js.map -", -] +" `; -exports[`JSON imports babel transforms example test case: node-current-cjs 1`] = ` -[ - "cjs/index-node-current-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-current-cjs.cjs'; - -export const { keys } = data;", -] -`; - -exports[`JSON imports babel transforms example test case: node-current-cjs 2`] = ` -[ - "cjs/index-node-current-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > babel > transforms example test case: node-current-cjs > cjs/index-node-current-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: cjs 'use strict'; @@ -685,14 +599,20 @@ const data = { const keys = Object.keys(data); exports.keys = keys; //# sourceMappingURL=index-node-current-cjs.cjs.map -", -] +" +`; + +exports[`JSON imports > babel > transforms example test case: node-current-cjs > cjs/index-node-current-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-current-cjs.cjs'; + +export const { keys } = data;" `; -exports[`JSON imports babel transforms example test case: node-current-lib 1`] = ` -[ - "lib/index-node-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > babel > transforms example test case: node-current-lib > lib/index-node-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: lib 'use strict'; @@ -710,14 +630,11 @@ const data = { const keys = Object.keys(data); exports.keys = keys; //# sourceMappingURL=index-node-current-lib.js.map -", -] +" `; -exports[`JSON imports babel transforms example test case: node-current-mjs 1`] = ` -[ - "mjs/index-node-current-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > babel > transforms example test case: node-current-mjs > mjs/index-node-current-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: mjs const data = { @@ -733,26 +650,11 @@ const data = { const keys = Object.keys(data); export { keys }; //# sourceMappingURL=index-node-current-mjs.mjs.map -", -] +" `; -exports[`JSON imports babel transforms example test case: node-experimental-cjs 1`] = ` -[ - "cjs/index-node-experimental-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-experimental-cjs.cjs'; - -export const { keys } = data;", -] -`; - -exports[`JSON imports babel transforms example test case: node-experimental-cjs 2`] = ` -[ - "cjs/index-node-experimental-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > babel > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: cjs 'use strict'; @@ -770,14 +672,20 @@ const data = { const keys = Object.keys(data); exports.keys = keys; //# sourceMappingURL=index-node-experimental-cjs.cjs.map -", -] +" +`; + +exports[`JSON imports > babel > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-experimental-cjs.cjs'; + +export const { keys } = data;" `; -exports[`JSON imports babel transforms example test case: node-experimental-lib 1`] = ` -[ - "lib/index-node-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > babel > transforms example test case: node-experimental-lib > lib/index-node-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: lib 'use strict'; @@ -795,14 +703,11 @@ const data = { const keys = Object.keys(data); exports.keys = keys; //# sourceMappingURL=index-node-experimental-lib.js.map -", -] +" `; -exports[`JSON imports babel transforms example test case: node-experimental-mjs 1`] = ` -[ - "mjs/index-node-experimental-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > babel > transforms example test case: node-experimental-mjs > mjs/index-node-experimental-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: mjs const data = { @@ -818,26 +723,11 @@ const data = { const keys = Object.keys(data); export { keys }; //# sourceMappingURL=index-node-experimental-mjs.mjs.map -", -] +" `; -exports[`JSON imports babel transforms example test case: node-legacy-cjs 1`] = ` -[ - "cjs/index-node-legacy-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-legacy-cjs.cjs'; - -export const { keys } = data;", -] -`; - -exports[`JSON imports babel transforms example test case: node-legacy-cjs 2`] = ` -[ - "cjs/index-node-legacy-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > babel > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: cjs 'use strict'; @@ -855,14 +745,20 @@ const data = { const keys = Object.keys(data); exports.keys = keys; //# sourceMappingURL=index-node-legacy-cjs.cjs.map -", -] +" +`; + +exports[`JSON imports > babel > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-legacy-cjs.cjs'; + +export const { keys } = data;" `; -exports[`JSON imports babel transforms example test case: node-legacy-lib 1`] = ` -[ - "lib/index-node-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > babel > transforms example test case: node-legacy-lib > lib/index-node-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: lib 'use strict'; @@ -880,14 +776,11 @@ const data = { const keys = Object.keys(data); exports.keys = keys; //# sourceMappingURL=index-node-legacy-lib.js.map -", -] +" `; -exports[`JSON imports babel transforms example test case: node-legacy-mjs 1`] = ` -[ - "mjs/index-node-legacy-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > babel > transforms example test case: node-legacy-mjs > mjs/index-node-legacy-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: mjs const data = { @@ -903,26 +796,11 @@ const data = { const keys = Object.keys(data); export { keys }; //# sourceMappingURL=index-node-legacy-mjs.mjs.map -", -] +" `; -exports[`JSON imports babel transforms example test case: node-stable-cjs 1`] = ` -[ - "cjs/index-node-stable-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-stable-cjs.cjs'; - -export const { keys } = data;", -] -`; - -exports[`JSON imports babel transforms example test case: node-stable-cjs 2`] = ` -[ - "cjs/index-node-stable-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > babel > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: cjs 'use strict'; @@ -940,14 +818,20 @@ const data = { const keys = Object.keys(data); exports.keys = keys; //# sourceMappingURL=index-node-stable-cjs.cjs.map -", -] +" +`; + +exports[`JSON imports > babel > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-stable-cjs.cjs'; + +export const { keys } = data;" `; -exports[`JSON imports babel transforms example test case: node-stable-lib 1`] = ` -[ - "lib/index-node-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > babel > transforms example test case: node-stable-lib > lib/index-node-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: lib 'use strict'; @@ -965,14 +849,11 @@ const data = { const keys = Object.keys(data); exports.keys = keys; //# sourceMappingURL=index-node-stable-lib.js.map -", -] +" `; -exports[`JSON imports babel transforms example test case: node-stable-mjs 1`] = ` -[ - "mjs/index-node-stable-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > babel > transforms example test case: node-stable-mjs > mjs/index-node-stable-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: mjs const data = { @@ -988,14 +869,11 @@ const data = { const keys = Object.keys(data); export { keys }; //# sourceMappingURL=index-node-stable-mjs.mjs.map -", -] +" `; -exports[`JSON imports swc transforms example test case: browser-current-esm 1`] = ` -[ - "esm/index-browser-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > swc > transforms example test case: browser-current-esm > esm/index-browser-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: esm const data = { list: [ @@ -1013,14 +891,11 @@ const data = { const keys = Object.keys(data); export { keys }; //# sourceMappingURL=index-browser-current-esm.js.map -", -] +" `; -exports[`JSON imports swc transforms example test case: browser-current-lib 1`] = ` -[ - "lib/index-browser-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > swc > transforms example test case: browser-current-lib > lib/index-browser-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: lib "use strict"; const data = { @@ -1039,14 +914,11 @@ const data = { const keys = Object.keys(data); exports.keys = keys; //# sourceMappingURL=index-browser-current-lib.js.map -", -] +" `; -exports[`JSON imports swc transforms example test case: browser-current-umd 1`] = ` -[ - "umd/index-browser-current-umd.js", - "(function(global, factory) { +exports[`JSON imports > swc > transforms example test case: browser-current-umd > umd/index-browser-current-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports); else if (typeof define === "function" && define.amd) define([ "exports" @@ -1079,14 +951,11 @@ exports[`JSON imports swc transforms example test case: browser-current-umd 1`] const keys = Object.keys(data); }); //# sourceMappingURL=index-browser-current-umd.js.map -", -] +" `; -exports[`JSON imports swc transforms example test case: browser-experimental-esm 1`] = ` -[ - "esm/index-browser-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > swc > transforms example test case: browser-experimental-esm > esm/index-browser-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: esm const data = { list: [ @@ -1104,14 +973,11 @@ const data = { const keys = Object.keys(data); export { keys }; //# sourceMappingURL=index-browser-experimental-esm.js.map -", -] +" `; -exports[`JSON imports swc transforms example test case: browser-experimental-lib 1`] = ` -[ - "lib/index-browser-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > swc > transforms example test case: browser-experimental-lib > lib/index-browser-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: lib "use strict"; const data = { @@ -1130,14 +996,11 @@ const data = { const keys = Object.keys(data); exports.keys = keys; //# sourceMappingURL=index-browser-experimental-lib.js.map -", -] +" `; -exports[`JSON imports swc transforms example test case: browser-experimental-umd 1`] = ` -[ - "umd/index-browser-experimental-umd.js", - "(function(global, factory) { +exports[`JSON imports > swc > transforms example test case: browser-experimental-umd > umd/index-browser-experimental-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports); else if (typeof define === "function" && define.amd) define([ "exports" @@ -1170,14 +1033,11 @@ exports[`JSON imports swc transforms example test case: browser-experimental-umd const keys = Object.keys(data); }); //# sourceMappingURL=index-browser-experimental-umd.js.map -", -] +" `; -exports[`JSON imports swc transforms example test case: browser-legacy-esm 1`] = ` -[ - "esm/index-browser-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > swc > transforms example test case: browser-legacy-esm > esm/index-browser-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: esm var data = { list: [ @@ -1195,14 +1055,11 @@ var data = { var keys = Object.keys(data); export { keys }; //# sourceMappingURL=index-browser-legacy-esm.js.map -", -] +" `; -exports[`JSON imports swc transforms example test case: browser-legacy-lib 1`] = ` -[ - "lib/index-browser-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > swc > transforms example test case: browser-legacy-lib > lib/index-browser-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: lib "use strict"; var data = { @@ -1221,14 +1078,11 @@ var data = { var keys = Object.keys(data); exports.keys = keys; //# sourceMappingURL=index-browser-legacy-lib.js.map -", -] +" `; -exports[`JSON imports swc transforms example test case: browser-legacy-umd 1`] = ` -[ - "umd/index-browser-legacy-umd.js", - "(function(global, factory) { +exports[`JSON imports > swc > transforms example test case: browser-legacy-umd > umd/index-browser-legacy-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports); else if (typeof define === "function" && define.amd) define([ "exports" @@ -1261,14 +1115,11 @@ exports[`JSON imports swc transforms example test case: browser-legacy-umd 1`] = var keys = Object.keys(data); }); //# sourceMappingURL=index-browser-legacy-umd.js.map -", -] +" `; -exports[`JSON imports swc transforms example test case: browser-stable-esm 1`] = ` -[ - "esm/index-browser-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > swc > transforms example test case: browser-stable-esm > esm/index-browser-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: esm const data = { list: [ @@ -1286,14 +1137,11 @@ const data = { const keys = Object.keys(data); export { keys }; //# sourceMappingURL=index-browser-stable-esm.js.map -", -] +" `; -exports[`JSON imports swc transforms example test case: browser-stable-lib 1`] = ` -[ - "lib/index-browser-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > swc > transforms example test case: browser-stable-lib > lib/index-browser-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: lib "use strict"; const data = { @@ -1312,14 +1160,11 @@ const data = { const keys = Object.keys(data); exports.keys = keys; //# sourceMappingURL=index-browser-stable-lib.js.map -", -] +" `; -exports[`JSON imports swc transforms example test case: browser-stable-umd 1`] = ` -[ - "umd/index-browser-stable-umd.js", - "(function(global, factory) { +exports[`JSON imports > swc > transforms example test case: browser-stable-umd > umd/index-browser-stable-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports); else if (typeof define === "function" && define.amd) define([ "exports" @@ -1352,14 +1197,11 @@ exports[`JSON imports swc transforms example test case: browser-stable-umd 1`] = const keys = Object.keys(data); }); //# sourceMappingURL=index-browser-stable-umd.js.map -", -] +" `; -exports[`JSON imports swc transforms example test case: electron-current-esm 1`] = ` -[ - "esm/index-electron-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > swc > transforms example test case: electron-current-esm > esm/index-electron-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: esm const data = { list: [ @@ -1377,14 +1219,11 @@ const data = { const keys = Object.keys(data); export { keys }; //# sourceMappingURL=index-electron-current-esm.js.map -", -] +" `; -exports[`JSON imports swc transforms example test case: electron-current-lib 1`] = ` -[ - "lib/index-electron-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > swc > transforms example test case: electron-current-lib > lib/index-electron-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: lib "use strict"; const data = { @@ -1403,14 +1242,11 @@ const data = { const keys = Object.keys(data); exports.keys = keys; //# sourceMappingURL=index-electron-current-lib.js.map -", -] +" `; -exports[`JSON imports swc transforms example test case: electron-experimental-esm 1`] = ` -[ - "esm/index-electron-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > swc > transforms example test case: electron-experimental-esm > esm/index-electron-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: esm const data = { list: [ @@ -1428,14 +1264,11 @@ const data = { const keys = Object.keys(data); export { keys }; //# sourceMappingURL=index-electron-experimental-esm.js.map -", -] +" `; -exports[`JSON imports swc transforms example test case: electron-experimental-lib 1`] = ` -[ - "lib/index-electron-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > swc > transforms example test case: electron-experimental-lib > lib/index-electron-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: lib "use strict"; const data = { @@ -1454,14 +1287,11 @@ const data = { const keys = Object.keys(data); exports.keys = keys; //# sourceMappingURL=index-electron-experimental-lib.js.map -", -] +" `; -exports[`JSON imports swc transforms example test case: electron-legacy-esm 1`] = ` -[ - "esm/index-electron-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > swc > transforms example test case: electron-legacy-esm > esm/index-electron-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: esm const data = { list: [ @@ -1479,14 +1309,11 @@ const data = { const keys = Object.keys(data); export { keys }; //# sourceMappingURL=index-electron-legacy-esm.js.map -", -] +" `; -exports[`JSON imports swc transforms example test case: electron-legacy-lib 1`] = ` -[ - "lib/index-electron-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > swc > transforms example test case: electron-legacy-lib > lib/index-electron-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: lib "use strict"; const data = { @@ -1505,14 +1332,11 @@ const data = { const keys = Object.keys(data); exports.keys = keys; //# sourceMappingURL=index-electron-legacy-lib.js.map -", -] +" `; -exports[`JSON imports swc transforms example test case: electron-stable-esm 1`] = ` -[ - "esm/index-electron-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > swc > transforms example test case: electron-stable-esm > esm/index-electron-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: esm const data = { list: [ @@ -1530,14 +1354,11 @@ const data = { const keys = Object.keys(data); export { keys }; //# sourceMappingURL=index-electron-stable-esm.js.map -", -] +" `; -exports[`JSON imports swc transforms example test case: electron-stable-lib 1`] = ` -[ - "lib/index-electron-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > swc > transforms example test case: electron-stable-lib > lib/index-electron-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: lib "use strict"; const data = { @@ -1556,14 +1377,11 @@ const data = { const keys = Object.keys(data); exports.keys = keys; //# sourceMappingURL=index-electron-stable-lib.js.map -", -] +" `; -exports[`JSON imports swc transforms example test case: native-current-lib 1`] = ` -[ - "lib/index-native-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > swc > transforms example test case: native-current-lib > lib/index-native-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: current, Format: lib "use strict"; const data = { @@ -1582,14 +1400,11 @@ const data = { const keys = Object.keys(data); exports.keys = keys; //# sourceMappingURL=index-native-current-lib.js.map -", -] +" `; -exports[`JSON imports swc transforms example test case: native-experimental-lib 1`] = ` -[ - "lib/index-native-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > swc > transforms example test case: native-experimental-lib > lib/index-native-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: experimental, Format: lib "use strict"; const data = { @@ -1608,14 +1423,11 @@ const data = { const keys = Object.keys(data); exports.keys = keys; //# sourceMappingURL=index-native-experimental-lib.js.map -", -] +" `; -exports[`JSON imports swc transforms example test case: native-legacy-lib 1`] = ` -[ - "lib/index-native-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > swc > transforms example test case: native-legacy-lib > lib/index-native-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: legacy, Format: lib "use strict"; const data = { @@ -1634,14 +1446,11 @@ const data = { const keys = Object.keys(data); exports.keys = keys; //# sourceMappingURL=index-native-legacy-lib.js.map -", -] +" `; -exports[`JSON imports swc transforms example test case: native-stable-lib 1`] = ` -[ - "lib/index-native-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > swc > transforms example test case: native-stable-lib > lib/index-native-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: stable, Format: lib "use strict"; const data = { @@ -1660,26 +1469,11 @@ const data = { const keys = Object.keys(data); exports.keys = keys; //# sourceMappingURL=index-native-stable-lib.js.map -", -] +" `; -exports[`JSON imports swc transforms example test case: node-current-cjs 1`] = ` -[ - "cjs/index-node-current-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-current-cjs.cjs'; - -export const { keys } = data;", -] -`; - -exports[`JSON imports swc transforms example test case: node-current-cjs 2`] = ` -[ - "cjs/index-node-current-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > swc > transforms example test case: node-current-cjs > cjs/index-node-current-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: cjs "use strict"; const data = { @@ -1698,14 +1492,20 @@ const data = { const keys = Object.keys(data); exports.keys = keys; //# sourceMappingURL=index-node-current-cjs.cjs.map -", -] +" +`; + +exports[`JSON imports > swc > transforms example test case: node-current-cjs > cjs/index-node-current-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-current-cjs.cjs'; + +export const { keys } = data;" `; -exports[`JSON imports swc transforms example test case: node-current-lib 1`] = ` -[ - "lib/index-node-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > swc > transforms example test case: node-current-lib > lib/index-node-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: lib "use strict"; const data = { @@ -1724,14 +1524,11 @@ const data = { const keys = Object.keys(data); exports.keys = keys; //# sourceMappingURL=index-node-current-lib.js.map -", -] +" `; -exports[`JSON imports swc transforms example test case: node-current-mjs 1`] = ` -[ - "mjs/index-node-current-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > swc > transforms example test case: node-current-mjs > mjs/index-node-current-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: mjs const data = { list: [ @@ -1749,26 +1546,11 @@ const data = { const keys = Object.keys(data); export { keys }; //# sourceMappingURL=index-node-current-mjs.mjs.map -", -] +" `; -exports[`JSON imports swc transforms example test case: node-experimental-cjs 1`] = ` -[ - "cjs/index-node-experimental-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-experimental-cjs.cjs'; - -export const { keys } = data;", -] -`; - -exports[`JSON imports swc transforms example test case: node-experimental-cjs 2`] = ` -[ - "cjs/index-node-experimental-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > swc > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: cjs "use strict"; const data = { @@ -1787,14 +1569,20 @@ const data = { const keys = Object.keys(data); exports.keys = keys; //# sourceMappingURL=index-node-experimental-cjs.cjs.map -", -] +" +`; + +exports[`JSON imports > swc > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-experimental-cjs.cjs'; + +export const { keys } = data;" `; -exports[`JSON imports swc transforms example test case: node-experimental-lib 1`] = ` -[ - "lib/index-node-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > swc > transforms example test case: node-experimental-lib > lib/index-node-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: lib "use strict"; const data = { @@ -1813,14 +1601,11 @@ const data = { const keys = Object.keys(data); exports.keys = keys; //# sourceMappingURL=index-node-experimental-lib.js.map -", -] +" `; -exports[`JSON imports swc transforms example test case: node-experimental-mjs 1`] = ` -[ - "mjs/index-node-experimental-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > swc > transforms example test case: node-experimental-mjs > mjs/index-node-experimental-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: mjs const data = { list: [ @@ -1838,26 +1623,11 @@ const data = { const keys = Object.keys(data); export { keys }; //# sourceMappingURL=index-node-experimental-mjs.mjs.map -", -] +" `; -exports[`JSON imports swc transforms example test case: node-legacy-cjs 1`] = ` -[ - "cjs/index-node-legacy-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-legacy-cjs.cjs'; - -export const { keys } = data;", -] -`; - -exports[`JSON imports swc transforms example test case: node-legacy-cjs 2`] = ` -[ - "cjs/index-node-legacy-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > swc > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: cjs "use strict"; const data = { @@ -1876,14 +1646,20 @@ const data = { const keys = Object.keys(data); exports.keys = keys; //# sourceMappingURL=index-node-legacy-cjs.cjs.map -", -] +" +`; + +exports[`JSON imports > swc > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-legacy-cjs.cjs'; + +export const { keys } = data;" `; -exports[`JSON imports swc transforms example test case: node-legacy-lib 1`] = ` -[ - "lib/index-node-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > swc > transforms example test case: node-legacy-lib > lib/index-node-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: lib "use strict"; const data = { @@ -1902,14 +1678,11 @@ const data = { const keys = Object.keys(data); exports.keys = keys; //# sourceMappingURL=index-node-legacy-lib.js.map -", -] +" `; -exports[`JSON imports swc transforms example test case: node-legacy-mjs 1`] = ` -[ - "mjs/index-node-legacy-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > swc > transforms example test case: node-legacy-mjs > mjs/index-node-legacy-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: mjs const data = { list: [ @@ -1927,26 +1700,11 @@ const data = { const keys = Object.keys(data); export { keys }; //# sourceMappingURL=index-node-legacy-mjs.mjs.map -", -] +" `; -exports[`JSON imports swc transforms example test case: node-stable-cjs 1`] = ` -[ - "cjs/index-node-stable-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-stable-cjs.cjs'; - -export const { keys } = data;", -] -`; - -exports[`JSON imports swc transforms example test case: node-stable-cjs 2`] = ` -[ - "cjs/index-node-stable-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > swc > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: cjs "use strict"; const data = { @@ -1965,14 +1723,20 @@ const data = { const keys = Object.keys(data); exports.keys = keys; //# sourceMappingURL=index-node-stable-cjs.cjs.map -", -] +" +`; + +exports[`JSON imports > swc > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-stable-cjs.cjs'; + +export const { keys } = data;" `; -exports[`JSON imports swc transforms example test case: node-stable-lib 1`] = ` -[ - "lib/index-node-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > swc > transforms example test case: node-stable-lib > lib/index-node-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: lib "use strict"; const data = { @@ -1991,14 +1755,11 @@ const data = { const keys = Object.keys(data); exports.keys = keys; //# sourceMappingURL=index-node-stable-lib.js.map -", -] +" `; -exports[`JSON imports swc transforms example test case: node-stable-mjs 1`] = ` -[ - "mjs/index-node-stable-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`JSON imports > swc > transforms example test case: node-stable-mjs > mjs/index-node-stable-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: mjs const data = { list: [ @@ -2016,6 +1777,5 @@ const data = { const keys = Object.keys(data); export { keys }; //# sourceMappingURL=index-node-stable-mjs.mjs.map -", -] +" `; diff --git a/packages/packemon/tests/examples/__snapshots__/namespaces.test.ts.snap b/packages/packemon/tests/examples/__snapshots__/namespaces.test.ts.snap index f6e371bd4..b73d53149 100644 --- a/packages/packemon/tests/examples/__snapshots__/namespaces.test.ts.snap +++ b/packages/packemon/tests/examples/__snapshots__/namespaces.test.ts.snap @@ -1,9 +1,7 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`Namespaces babel transforms example test case: browser-current-esm 1`] = ` -[ - "esm/index-browser-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > babel > transforms example test case: browser-current-esm > esm/index-browser-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: esm function foo() {} @@ -17,14 +15,11 @@ const helpers = /*#__PURE__*/Object.freeze( /*#__PURE__*/Object.defineProperty({ })); export { helpers as ns1, helpers as ns2 }; //# sourceMappingURL=index-browser-current-esm.js.map -", -] +" `; -exports[`Namespaces babel transforms example test case: browser-current-lib 1`] = ` -[ - "lib/index-browser-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > babel > transforms example test case: browser-current-lib > lib/index-browser-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: lib 'use strict'; @@ -39,14 +34,11 @@ const helpers = /*#__PURE__*/Object.freeze({ exports.ns1 = helpers; exports.ns2 = helpers; //# sourceMappingURL=index-browser-current-lib.js.map -", -] +" `; -exports[`Namespaces babel transforms example test case: browser-current-umd 1`] = ` -[ - "umd/index-browser-current-umd.js", - "(function (global, factory) { +exports[`Namespaces > babel > transforms example test case: browser-current-umd > umd/index-browser-current-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports"], factory); } else if (typeof exports !== "undefined") { @@ -77,14 +69,11 @@ exports[`Namespaces babel transforms example test case: browser-current-umd 1`] }); }); //# sourceMappingURL=index-browser-current-umd.js.map -", -] +" `; -exports[`Namespaces babel transforms example test case: browser-experimental-esm 1`] = ` -[ - "esm/index-browser-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > babel > transforms example test case: browser-experimental-esm > esm/index-browser-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: esm function foo() {} @@ -98,14 +87,11 @@ const helpers = /*#__PURE__*/Object.freeze( /*#__PURE__*/Object.defineProperty({ })); export { helpers as ns1, helpers as ns2 }; //# sourceMappingURL=index-browser-experimental-esm.js.map -", -] +" `; -exports[`Namespaces babel transforms example test case: browser-experimental-lib 1`] = ` -[ - "lib/index-browser-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > babel > transforms example test case: browser-experimental-lib > lib/index-browser-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: lib 'use strict'; @@ -120,14 +106,11 @@ const helpers = /*#__PURE__*/Object.freeze({ exports.ns1 = helpers; exports.ns2 = helpers; //# sourceMappingURL=index-browser-experimental-lib.js.map -", -] +" `; -exports[`Namespaces babel transforms example test case: browser-experimental-umd 1`] = ` -[ - "umd/index-browser-experimental-umd.js", - "(function (global, factory) { +exports[`Namespaces > babel > transforms example test case: browser-experimental-umd > umd/index-browser-experimental-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports"], factory); } else if (typeof exports !== "undefined") { @@ -158,14 +141,11 @@ exports[`Namespaces babel transforms example test case: browser-experimental-umd }); }); //# sourceMappingURL=index-browser-experimental-umd.js.map -", -] +" `; -exports[`Namespaces babel transforms example test case: browser-legacy-esm 1`] = ` -[ - "esm/index-browser-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > babel > transforms example test case: browser-legacy-esm > esm/index-browser-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: esm function foo() {} @@ -179,14 +159,11 @@ var helpers = /*#__PURE__*/Object.freeze( /*#__PURE__*/Object.defineProperty({ })); export { helpers as ns1, helpers as ns2 }; //# sourceMappingURL=index-browser-legacy-esm.js.map -", -] +" `; -exports[`Namespaces babel transforms example test case: browser-legacy-lib 1`] = ` -[ - "lib/index-browser-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > babel > transforms example test case: browser-legacy-lib > lib/index-browser-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: lib 'use strict'; @@ -201,14 +178,11 @@ var helpers = /*#__PURE__*/Object.freeze({ exports.ns1 = helpers; exports.ns2 = helpers; //# sourceMappingURL=index-browser-legacy-lib.js.map -", -] +" `; -exports[`Namespaces babel transforms example test case: browser-legacy-umd 1`] = ` -[ - "umd/index-browser-legacy-umd.js", - "(function (global, factory) { +exports[`Namespaces > babel > transforms example test case: browser-legacy-umd > umd/index-browser-legacy-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports"], factory); } else if (typeof exports !== "undefined") { @@ -239,14 +213,11 @@ exports[`Namespaces babel transforms example test case: browser-legacy-umd 1`] = }); }); //# sourceMappingURL=index-browser-legacy-umd.js.map -", -] +" `; -exports[`Namespaces babel transforms example test case: browser-stable-esm 1`] = ` -[ - "esm/index-browser-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > babel > transforms example test case: browser-stable-esm > esm/index-browser-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: esm function foo() {} @@ -260,14 +231,11 @@ const helpers = /*#__PURE__*/Object.freeze( /*#__PURE__*/Object.defineProperty({ })); export { helpers as ns1, helpers as ns2 }; //# sourceMappingURL=index-browser-stable-esm.js.map -", -] +" `; -exports[`Namespaces babel transforms example test case: browser-stable-lib 1`] = ` -[ - "lib/index-browser-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > babel > transforms example test case: browser-stable-lib > lib/index-browser-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: lib 'use strict'; @@ -282,14 +250,11 @@ const helpers = /*#__PURE__*/Object.freeze({ exports.ns1 = helpers; exports.ns2 = helpers; //# sourceMappingURL=index-browser-stable-lib.js.map -", -] +" `; -exports[`Namespaces babel transforms example test case: browser-stable-umd 1`] = ` -[ - "umd/index-browser-stable-umd.js", - "(function (global, factory) { +exports[`Namespaces > babel > transforms example test case: browser-stable-umd > umd/index-browser-stable-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports"], factory); } else if (typeof exports !== "undefined") { @@ -320,14 +285,11 @@ exports[`Namespaces babel transforms example test case: browser-stable-umd 1`] = }); }); //# sourceMappingURL=index-browser-stable-umd.js.map -", -] +" `; -exports[`Namespaces babel transforms example test case: electron-current-esm 1`] = ` -[ - "esm/index-electron-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > babel > transforms example test case: electron-current-esm > esm/index-electron-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: esm function foo() {} @@ -341,14 +303,11 @@ const helpers = /*#__PURE__*/Object.freeze( /*#__PURE__*/Object.defineProperty({ })); export { helpers as ns1, helpers as ns2 }; //# sourceMappingURL=index-electron-current-esm.js.map -", -] +" `; -exports[`Namespaces babel transforms example test case: electron-current-lib 1`] = ` -[ - "lib/index-electron-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > babel > transforms example test case: electron-current-lib > lib/index-electron-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: lib 'use strict'; @@ -363,14 +322,11 @@ const helpers = /*#__PURE__*/Object.freeze({ exports.ns1 = helpers; exports.ns2 = helpers; //# sourceMappingURL=index-electron-current-lib.js.map -", -] +" `; -exports[`Namespaces babel transforms example test case: electron-experimental-esm 1`] = ` -[ - "esm/index-electron-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > babel > transforms example test case: electron-experimental-esm > esm/index-electron-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: esm function foo() {} @@ -384,14 +340,11 @@ const helpers = /*#__PURE__*/Object.freeze( /*#__PURE__*/Object.defineProperty({ })); export { helpers as ns1, helpers as ns2 }; //# sourceMappingURL=index-electron-experimental-esm.js.map -", -] +" `; -exports[`Namespaces babel transforms example test case: electron-experimental-lib 1`] = ` -[ - "lib/index-electron-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > babel > transforms example test case: electron-experimental-lib > lib/index-electron-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: lib 'use strict'; @@ -406,14 +359,11 @@ const helpers = /*#__PURE__*/Object.freeze({ exports.ns1 = helpers; exports.ns2 = helpers; //# sourceMappingURL=index-electron-experimental-lib.js.map -", -] +" `; -exports[`Namespaces babel transforms example test case: electron-legacy-esm 1`] = ` -[ - "esm/index-electron-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > babel > transforms example test case: electron-legacy-esm > esm/index-electron-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: esm function foo() {} @@ -427,14 +377,11 @@ const helpers = /*#__PURE__*/Object.freeze( /*#__PURE__*/Object.defineProperty({ })); export { helpers as ns1, helpers as ns2 }; //# sourceMappingURL=index-electron-legacy-esm.js.map -", -] +" `; -exports[`Namespaces babel transforms example test case: electron-legacy-lib 1`] = ` -[ - "lib/index-electron-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > babel > transforms example test case: electron-legacy-lib > lib/index-electron-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: lib 'use strict'; @@ -449,14 +396,11 @@ const helpers = /*#__PURE__*/Object.freeze({ exports.ns1 = helpers; exports.ns2 = helpers; //# sourceMappingURL=index-electron-legacy-lib.js.map -", -] +" `; -exports[`Namespaces babel transforms example test case: electron-stable-esm 1`] = ` -[ - "esm/index-electron-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > babel > transforms example test case: electron-stable-esm > esm/index-electron-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: esm function foo() {} @@ -470,14 +414,11 @@ const helpers = /*#__PURE__*/Object.freeze( /*#__PURE__*/Object.defineProperty({ })); export { helpers as ns1, helpers as ns2 }; //# sourceMappingURL=index-electron-stable-esm.js.map -", -] +" `; -exports[`Namespaces babel transforms example test case: electron-stable-lib 1`] = ` -[ - "lib/index-electron-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > babel > transforms example test case: electron-stable-lib > lib/index-electron-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: lib 'use strict'; @@ -492,14 +433,11 @@ const helpers = /*#__PURE__*/Object.freeze({ exports.ns1 = helpers; exports.ns2 = helpers; //# sourceMappingURL=index-electron-stable-lib.js.map -", -] +" `; -exports[`Namespaces babel transforms example test case: native-current-lib 1`] = ` -[ - "lib/index-native-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > babel > transforms example test case: native-current-lib > lib/index-native-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: current, Format: lib 'use strict'; @@ -514,14 +452,11 @@ const helpers = /*#__PURE__*/Object.freeze({ exports.ns1 = helpers; exports.ns2 = helpers; //# sourceMappingURL=index-native-current-lib.js.map -", -] +" `; -exports[`Namespaces babel transforms example test case: native-experimental-lib 1`] = ` -[ - "lib/index-native-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > babel > transforms example test case: native-experimental-lib > lib/index-native-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: experimental, Format: lib 'use strict'; @@ -536,14 +471,11 @@ const helpers = /*#__PURE__*/Object.freeze({ exports.ns1 = helpers; exports.ns2 = helpers; //# sourceMappingURL=index-native-experimental-lib.js.map -", -] +" `; -exports[`Namespaces babel transforms example test case: native-legacy-lib 1`] = ` -[ - "lib/index-native-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > babel > transforms example test case: native-legacy-lib > lib/index-native-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: legacy, Format: lib 'use strict'; @@ -558,14 +490,11 @@ const helpers = /*#__PURE__*/Object.freeze({ exports.ns1 = helpers; exports.ns2 = helpers; //# sourceMappingURL=index-native-legacy-lib.js.map -", -] +" `; -exports[`Namespaces babel transforms example test case: native-stable-lib 1`] = ` -[ - "lib/index-native-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > babel > transforms example test case: native-stable-lib > lib/index-native-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: stable, Format: lib 'use strict'; @@ -580,26 +509,11 @@ const helpers = /*#__PURE__*/Object.freeze({ exports.ns1 = helpers; exports.ns2 = helpers; //# sourceMappingURL=index-native-stable-lib.js.map -", -] +" `; -exports[`Namespaces babel transforms example test case: node-current-cjs 1`] = ` -[ - "cjs/index-node-current-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-current-cjs.cjs'; - -export const { ns1, ns2 } = data;", -] -`; - -exports[`Namespaces babel transforms example test case: node-current-cjs 2`] = ` -[ - "cjs/index-node-current-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > babel > transforms example test case: node-current-cjs > cjs/index-node-current-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: cjs 'use strict'; @@ -614,14 +528,20 @@ const helpers = /*#__PURE__*/Object.freeze({ exports.ns1 = helpers; exports.ns2 = helpers; //# sourceMappingURL=index-node-current-cjs.cjs.map -", -] +" +`; + +exports[`Namespaces > babel > transforms example test case: node-current-cjs > cjs/index-node-current-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-current-cjs.cjs'; + +export const { ns1, ns2 } = data;" `; -exports[`Namespaces babel transforms example test case: node-current-lib 1`] = ` -[ - "lib/index-node-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > babel > transforms example test case: node-current-lib > lib/index-node-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: lib 'use strict'; @@ -636,14 +556,11 @@ const helpers = /*#__PURE__*/Object.freeze({ exports.ns1 = helpers; exports.ns2 = helpers; //# sourceMappingURL=index-node-current-lib.js.map -", -] +" `; -exports[`Namespaces babel transforms example test case: node-current-mjs 1`] = ` -[ - "mjs/index-node-current-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > babel > transforms example test case: node-current-mjs > mjs/index-node-current-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: mjs function foo() {} @@ -657,26 +574,11 @@ const helpers = /*#__PURE__*/Object.freeze( /*#__PURE__*/Object.defineProperty({ })); export { helpers as ns1, helpers as ns2 }; //# sourceMappingURL=index-node-current-mjs.mjs.map -", -] +" `; -exports[`Namespaces babel transforms example test case: node-experimental-cjs 1`] = ` -[ - "cjs/index-node-experimental-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-experimental-cjs.cjs'; - -export const { ns1, ns2 } = data;", -] -`; - -exports[`Namespaces babel transforms example test case: node-experimental-cjs 2`] = ` -[ - "cjs/index-node-experimental-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > babel > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: cjs 'use strict'; @@ -691,14 +593,20 @@ const helpers = /*#__PURE__*/Object.freeze({ exports.ns1 = helpers; exports.ns2 = helpers; //# sourceMappingURL=index-node-experimental-cjs.cjs.map -", -] +" +`; + +exports[`Namespaces > babel > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-experimental-cjs.cjs'; + +export const { ns1, ns2 } = data;" `; -exports[`Namespaces babel transforms example test case: node-experimental-lib 1`] = ` -[ - "lib/index-node-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > babel > transforms example test case: node-experimental-lib > lib/index-node-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: lib 'use strict'; @@ -713,14 +621,11 @@ const helpers = /*#__PURE__*/Object.freeze({ exports.ns1 = helpers; exports.ns2 = helpers; //# sourceMappingURL=index-node-experimental-lib.js.map -", -] +" `; -exports[`Namespaces babel transforms example test case: node-experimental-mjs 1`] = ` -[ - "mjs/index-node-experimental-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > babel > transforms example test case: node-experimental-mjs > mjs/index-node-experimental-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: mjs function foo() {} @@ -734,26 +639,11 @@ const helpers = /*#__PURE__*/Object.freeze( /*#__PURE__*/Object.defineProperty({ })); export { helpers as ns1, helpers as ns2 }; //# sourceMappingURL=index-node-experimental-mjs.mjs.map -", -] +" `; -exports[`Namespaces babel transforms example test case: node-legacy-cjs 1`] = ` -[ - "cjs/index-node-legacy-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-legacy-cjs.cjs'; - -export const { ns1, ns2 } = data;", -] -`; - -exports[`Namespaces babel transforms example test case: node-legacy-cjs 2`] = ` -[ - "cjs/index-node-legacy-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > babel > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: cjs 'use strict'; @@ -768,14 +658,20 @@ const helpers = /*#__PURE__*/Object.freeze({ exports.ns1 = helpers; exports.ns2 = helpers; //# sourceMappingURL=index-node-legacy-cjs.cjs.map -", -] +" +`; + +exports[`Namespaces > babel > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-legacy-cjs.cjs'; + +export const { ns1, ns2 } = data;" `; -exports[`Namespaces babel transforms example test case: node-legacy-lib 1`] = ` -[ - "lib/index-node-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > babel > transforms example test case: node-legacy-lib > lib/index-node-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: lib 'use strict'; @@ -790,14 +686,11 @@ const helpers = /*#__PURE__*/Object.freeze({ exports.ns1 = helpers; exports.ns2 = helpers; //# sourceMappingURL=index-node-legacy-lib.js.map -", -] +" `; -exports[`Namespaces babel transforms example test case: node-legacy-mjs 1`] = ` -[ - "mjs/index-node-legacy-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > babel > transforms example test case: node-legacy-mjs > mjs/index-node-legacy-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: mjs function foo() {} @@ -811,26 +704,11 @@ const helpers = /*#__PURE__*/Object.freeze( /*#__PURE__*/Object.defineProperty({ })); export { helpers as ns1, helpers as ns2 }; //# sourceMappingURL=index-node-legacy-mjs.mjs.map -", -] +" `; -exports[`Namespaces babel transforms example test case: node-stable-cjs 1`] = ` -[ - "cjs/index-node-stable-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-stable-cjs.cjs'; - -export const { ns1, ns2 } = data;", -] -`; - -exports[`Namespaces babel transforms example test case: node-stable-cjs 2`] = ` -[ - "cjs/index-node-stable-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > babel > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: cjs 'use strict'; @@ -845,14 +723,20 @@ const helpers = /*#__PURE__*/Object.freeze({ exports.ns1 = helpers; exports.ns2 = helpers; //# sourceMappingURL=index-node-stable-cjs.cjs.map -", -] +" +`; + +exports[`Namespaces > babel > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-stable-cjs.cjs'; + +export const { ns1, ns2 } = data;" `; -exports[`Namespaces babel transforms example test case: node-stable-lib 1`] = ` -[ - "lib/index-node-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > babel > transforms example test case: node-stable-lib > lib/index-node-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: lib 'use strict'; @@ -867,14 +751,11 @@ const helpers = /*#__PURE__*/Object.freeze({ exports.ns1 = helpers; exports.ns2 = helpers; //# sourceMappingURL=index-node-stable-lib.js.map -", -] +" `; -exports[`Namespaces babel transforms example test case: node-stable-mjs 1`] = ` -[ - "mjs/index-node-stable-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > babel > transforms example test case: node-stable-mjs > mjs/index-node-stable-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: mjs function foo() {} @@ -888,14 +769,11 @@ const helpers = /*#__PURE__*/Object.freeze( /*#__PURE__*/Object.defineProperty({ })); export { helpers as ns1, helpers as ns2 }; //# sourceMappingURL=index-node-stable-mjs.mjs.map -", -] +" `; -exports[`Namespaces swc transforms example test case: browser-current-esm 1`] = ` -[ - "esm/index-browser-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > swc > transforms example test case: browser-current-esm > esm/index-browser-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: esm function foo() {} function bar() {} @@ -908,14 +786,11 @@ const helpers = /*#__PURE__*/ Object.freeze(/*#__PURE__*/ Object.defineProperty( })); export { helpers as ns1, helpers as ns2 }; //# sourceMappingURL=index-browser-current-esm.js.map -", -] +" `; -exports[`Namespaces swc transforms example test case: browser-current-lib 1`] = ` -[ - "lib/index-browser-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > swc > transforms example test case: browser-current-lib > lib/index-browser-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: lib "use strict"; function foo() {} @@ -928,14 +803,11 @@ const helpers = /*#__PURE__*/ Object.freeze({ exports.ns1 = helpers; exports.ns2 = helpers; //# sourceMappingURL=index-browser-current-lib.js.map -", -] +" `; -exports[`Namespaces swc transforms example test case: browser-current-umd 1`] = ` -[ - "umd/index-browser-current-umd.js", - "(function(global, factory) { +exports[`Namespaces > swc > transforms example test case: browser-current-umd > umd/index-browser-current-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports); else if (typeof define === "function" && define.amd) define([ "exports" @@ -969,14 +841,11 @@ exports[`Namespaces swc transforms example test case: browser-current-umd 1`] = }); }); //# sourceMappingURL=index-browser-current-umd.js.map -", -] +" `; -exports[`Namespaces swc transforms example test case: browser-experimental-esm 1`] = ` -[ - "esm/index-browser-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > swc > transforms example test case: browser-experimental-esm > esm/index-browser-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: esm function foo() {} function bar() {} @@ -989,14 +858,11 @@ const helpers = /*#__PURE__*/ Object.freeze(/*#__PURE__*/ Object.defineProperty( })); export { helpers as ns1, helpers as ns2 }; //# sourceMappingURL=index-browser-experimental-esm.js.map -", -] +" `; -exports[`Namespaces swc transforms example test case: browser-experimental-lib 1`] = ` -[ - "lib/index-browser-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > swc > transforms example test case: browser-experimental-lib > lib/index-browser-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: lib "use strict"; function foo() {} @@ -1009,14 +875,11 @@ const helpers = /*#__PURE__*/ Object.freeze({ exports.ns1 = helpers; exports.ns2 = helpers; //# sourceMappingURL=index-browser-experimental-lib.js.map -", -] +" `; -exports[`Namespaces swc transforms example test case: browser-experimental-umd 1`] = ` -[ - "umd/index-browser-experimental-umd.js", - "(function(global, factory) { +exports[`Namespaces > swc > transforms example test case: browser-experimental-umd > umd/index-browser-experimental-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports); else if (typeof define === "function" && define.amd) define([ "exports" @@ -1050,14 +913,11 @@ exports[`Namespaces swc transforms example test case: browser-experimental-umd 1 }); }); //# sourceMappingURL=index-browser-experimental-umd.js.map -", -] +" `; -exports[`Namespaces swc transforms example test case: browser-legacy-esm 1`] = ` -[ - "esm/index-browser-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > swc > transforms example test case: browser-legacy-esm > esm/index-browser-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: esm function foo() {} function bar() {} @@ -1070,14 +930,11 @@ var helpers = /*#__PURE__*/ Object.freeze(/*#__PURE__*/ Object.defineProperty({ })); export { helpers as ns1, helpers as ns2 }; //# sourceMappingURL=index-browser-legacy-esm.js.map -", -] +" `; -exports[`Namespaces swc transforms example test case: browser-legacy-lib 1`] = ` -[ - "lib/index-browser-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > swc > transforms example test case: browser-legacy-lib > lib/index-browser-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: lib "use strict"; function foo() {} @@ -1090,14 +947,11 @@ var helpers = /*#__PURE__*/ Object.freeze({ exports.ns1 = helpers; exports.ns2 = helpers; //# sourceMappingURL=index-browser-legacy-lib.js.map -", -] +" `; -exports[`Namespaces swc transforms example test case: browser-legacy-umd 1`] = ` -[ - "umd/index-browser-legacy-umd.js", - "(function(global, factory) { +exports[`Namespaces > swc > transforms example test case: browser-legacy-umd > umd/index-browser-legacy-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports); else if (typeof define === "function" && define.amd) define([ "exports" @@ -1131,14 +985,11 @@ exports[`Namespaces swc transforms example test case: browser-legacy-umd 1`] = ` }); }); //# sourceMappingURL=index-browser-legacy-umd.js.map -", -] +" `; -exports[`Namespaces swc transforms example test case: browser-stable-esm 1`] = ` -[ - "esm/index-browser-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > swc > transforms example test case: browser-stable-esm > esm/index-browser-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: esm function foo() {} function bar() {} @@ -1151,14 +1002,11 @@ const helpers = /*#__PURE__*/ Object.freeze(/*#__PURE__*/ Object.defineProperty( })); export { helpers as ns1, helpers as ns2 }; //# sourceMappingURL=index-browser-stable-esm.js.map -", -] +" `; -exports[`Namespaces swc transforms example test case: browser-stable-lib 1`] = ` -[ - "lib/index-browser-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > swc > transforms example test case: browser-stable-lib > lib/index-browser-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: lib "use strict"; function foo() {} @@ -1171,14 +1019,11 @@ const helpers = /*#__PURE__*/ Object.freeze({ exports.ns1 = helpers; exports.ns2 = helpers; //# sourceMappingURL=index-browser-stable-lib.js.map -", -] +" `; -exports[`Namespaces swc transforms example test case: browser-stable-umd 1`] = ` -[ - "umd/index-browser-stable-umd.js", - "(function(global, factory) { +exports[`Namespaces > swc > transforms example test case: browser-stable-umd > umd/index-browser-stable-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports); else if (typeof define === "function" && define.amd) define([ "exports" @@ -1212,14 +1057,11 @@ exports[`Namespaces swc transforms example test case: browser-stable-umd 1`] = ` }); }); //# sourceMappingURL=index-browser-stable-umd.js.map -", -] +" `; -exports[`Namespaces swc transforms example test case: electron-current-esm 1`] = ` -[ - "esm/index-electron-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > swc > transforms example test case: electron-current-esm > esm/index-electron-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: esm function foo() {} function bar() {} @@ -1232,14 +1074,11 @@ const helpers = /*#__PURE__*/ Object.freeze(/*#__PURE__*/ Object.defineProperty( })); export { helpers as ns1, helpers as ns2 }; //# sourceMappingURL=index-electron-current-esm.js.map -", -] +" `; -exports[`Namespaces swc transforms example test case: electron-current-lib 1`] = ` -[ - "lib/index-electron-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > swc > transforms example test case: electron-current-lib > lib/index-electron-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: lib "use strict"; function foo() {} @@ -1252,14 +1091,11 @@ const helpers = /*#__PURE__*/ Object.freeze({ exports.ns1 = helpers; exports.ns2 = helpers; //# sourceMappingURL=index-electron-current-lib.js.map -", -] +" `; -exports[`Namespaces swc transforms example test case: electron-experimental-esm 1`] = ` -[ - "esm/index-electron-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > swc > transforms example test case: electron-experimental-esm > esm/index-electron-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: esm function foo() {} function bar() {} @@ -1272,14 +1108,11 @@ const helpers = /*#__PURE__*/ Object.freeze(/*#__PURE__*/ Object.defineProperty( })); export { helpers as ns1, helpers as ns2 }; //# sourceMappingURL=index-electron-experimental-esm.js.map -", -] +" `; -exports[`Namespaces swc transforms example test case: electron-experimental-lib 1`] = ` -[ - "lib/index-electron-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > swc > transforms example test case: electron-experimental-lib > lib/index-electron-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: lib "use strict"; function foo() {} @@ -1292,14 +1125,11 @@ const helpers = /*#__PURE__*/ Object.freeze({ exports.ns1 = helpers; exports.ns2 = helpers; //# sourceMappingURL=index-electron-experimental-lib.js.map -", -] +" `; -exports[`Namespaces swc transforms example test case: electron-legacy-esm 1`] = ` -[ - "esm/index-electron-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > swc > transforms example test case: electron-legacy-esm > esm/index-electron-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: esm function foo() {} function bar() {} @@ -1312,14 +1142,11 @@ const helpers = /*#__PURE__*/ Object.freeze(/*#__PURE__*/ Object.defineProperty( })); export { helpers as ns1, helpers as ns2 }; //# sourceMappingURL=index-electron-legacy-esm.js.map -", -] +" `; -exports[`Namespaces swc transforms example test case: electron-legacy-lib 1`] = ` -[ - "lib/index-electron-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > swc > transforms example test case: electron-legacy-lib > lib/index-electron-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: lib "use strict"; function foo() {} @@ -1332,14 +1159,11 @@ const helpers = /*#__PURE__*/ Object.freeze({ exports.ns1 = helpers; exports.ns2 = helpers; //# sourceMappingURL=index-electron-legacy-lib.js.map -", -] +" `; -exports[`Namespaces swc transforms example test case: electron-stable-esm 1`] = ` -[ - "esm/index-electron-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > swc > transforms example test case: electron-stable-esm > esm/index-electron-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: esm function foo() {} function bar() {} @@ -1352,14 +1176,11 @@ const helpers = /*#__PURE__*/ Object.freeze(/*#__PURE__*/ Object.defineProperty( })); export { helpers as ns1, helpers as ns2 }; //# sourceMappingURL=index-electron-stable-esm.js.map -", -] +" `; -exports[`Namespaces swc transforms example test case: electron-stable-lib 1`] = ` -[ - "lib/index-electron-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > swc > transforms example test case: electron-stable-lib > lib/index-electron-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: lib "use strict"; function foo() {} @@ -1372,14 +1193,11 @@ const helpers = /*#__PURE__*/ Object.freeze({ exports.ns1 = helpers; exports.ns2 = helpers; //# sourceMappingURL=index-electron-stable-lib.js.map -", -] +" `; -exports[`Namespaces swc transforms example test case: native-current-lib 1`] = ` -[ - "lib/index-native-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > swc > transforms example test case: native-current-lib > lib/index-native-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: current, Format: lib "use strict"; function foo() {} @@ -1392,14 +1210,11 @@ const helpers = /*#__PURE__*/ Object.freeze({ exports.ns1 = helpers; exports.ns2 = helpers; //# sourceMappingURL=index-native-current-lib.js.map -", -] +" `; -exports[`Namespaces swc transforms example test case: native-experimental-lib 1`] = ` -[ - "lib/index-native-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > swc > transforms example test case: native-experimental-lib > lib/index-native-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: experimental, Format: lib "use strict"; function foo() {} @@ -1412,14 +1227,11 @@ const helpers = /*#__PURE__*/ Object.freeze({ exports.ns1 = helpers; exports.ns2 = helpers; //# sourceMappingURL=index-native-experimental-lib.js.map -", -] +" `; -exports[`Namespaces swc transforms example test case: native-legacy-lib 1`] = ` -[ - "lib/index-native-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > swc > transforms example test case: native-legacy-lib > lib/index-native-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: legacy, Format: lib "use strict"; function foo() {} @@ -1432,14 +1244,11 @@ const helpers = /*#__PURE__*/ Object.freeze({ exports.ns1 = helpers; exports.ns2 = helpers; //# sourceMappingURL=index-native-legacy-lib.js.map -", -] +" `; -exports[`Namespaces swc transforms example test case: native-stable-lib 1`] = ` -[ - "lib/index-native-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > swc > transforms example test case: native-stable-lib > lib/index-native-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: stable, Format: lib "use strict"; function foo() {} @@ -1452,26 +1261,11 @@ const helpers = /*#__PURE__*/ Object.freeze({ exports.ns1 = helpers; exports.ns2 = helpers; //# sourceMappingURL=index-native-stable-lib.js.map -", -] +" `; -exports[`Namespaces swc transforms example test case: node-current-cjs 1`] = ` -[ - "cjs/index-node-current-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-current-cjs.cjs'; - -export const { ns1, ns2 } = data;", -] -`; - -exports[`Namespaces swc transforms example test case: node-current-cjs 2`] = ` -[ - "cjs/index-node-current-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > swc > transforms example test case: node-current-cjs > cjs/index-node-current-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: cjs "use strict"; function foo() {} @@ -1484,14 +1278,20 @@ const helpers = /*#__PURE__*/ Object.freeze({ exports.ns1 = helpers; exports.ns2 = helpers; //# sourceMappingURL=index-node-current-cjs.cjs.map -", -] +" +`; + +exports[`Namespaces > swc > transforms example test case: node-current-cjs > cjs/index-node-current-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-current-cjs.cjs'; + +export const { ns1, ns2 } = data;" `; -exports[`Namespaces swc transforms example test case: node-current-lib 1`] = ` -[ - "lib/index-node-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > swc > transforms example test case: node-current-lib > lib/index-node-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: lib "use strict"; function foo() {} @@ -1504,14 +1304,11 @@ const helpers = /*#__PURE__*/ Object.freeze({ exports.ns1 = helpers; exports.ns2 = helpers; //# sourceMappingURL=index-node-current-lib.js.map -", -] +" `; -exports[`Namespaces swc transforms example test case: node-current-mjs 1`] = ` -[ - "mjs/index-node-current-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > swc > transforms example test case: node-current-mjs > mjs/index-node-current-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: mjs function foo() {} function bar() {} @@ -1524,26 +1321,11 @@ const helpers = /*#__PURE__*/ Object.freeze(/*#__PURE__*/ Object.defineProperty( })); export { helpers as ns1, helpers as ns2 }; //# sourceMappingURL=index-node-current-mjs.mjs.map -", -] +" `; -exports[`Namespaces swc transforms example test case: node-experimental-cjs 1`] = ` -[ - "cjs/index-node-experimental-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-experimental-cjs.cjs'; - -export const { ns1, ns2 } = data;", -] -`; - -exports[`Namespaces swc transforms example test case: node-experimental-cjs 2`] = ` -[ - "cjs/index-node-experimental-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > swc > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: cjs "use strict"; function foo() {} @@ -1556,14 +1338,20 @@ const helpers = /*#__PURE__*/ Object.freeze({ exports.ns1 = helpers; exports.ns2 = helpers; //# sourceMappingURL=index-node-experimental-cjs.cjs.map -", -] +" +`; + +exports[`Namespaces > swc > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-experimental-cjs.cjs'; + +export const { ns1, ns2 } = data;" `; -exports[`Namespaces swc transforms example test case: node-experimental-lib 1`] = ` -[ - "lib/index-node-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > swc > transforms example test case: node-experimental-lib > lib/index-node-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: lib "use strict"; function foo() {} @@ -1576,14 +1364,11 @@ const helpers = /*#__PURE__*/ Object.freeze({ exports.ns1 = helpers; exports.ns2 = helpers; //# sourceMappingURL=index-node-experimental-lib.js.map -", -] +" `; -exports[`Namespaces swc transforms example test case: node-experimental-mjs 1`] = ` -[ - "mjs/index-node-experimental-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > swc > transforms example test case: node-experimental-mjs > mjs/index-node-experimental-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: mjs function foo() {} function bar() {} @@ -1596,26 +1381,11 @@ const helpers = /*#__PURE__*/ Object.freeze(/*#__PURE__*/ Object.defineProperty( })); export { helpers as ns1, helpers as ns2 }; //# sourceMappingURL=index-node-experimental-mjs.mjs.map -", -] +" `; -exports[`Namespaces swc transforms example test case: node-legacy-cjs 1`] = ` -[ - "cjs/index-node-legacy-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-legacy-cjs.cjs'; - -export const { ns1, ns2 } = data;", -] -`; - -exports[`Namespaces swc transforms example test case: node-legacy-cjs 2`] = ` -[ - "cjs/index-node-legacy-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > swc > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: cjs "use strict"; function foo() {} @@ -1628,14 +1398,20 @@ const helpers = /*#__PURE__*/ Object.freeze({ exports.ns1 = helpers; exports.ns2 = helpers; //# sourceMappingURL=index-node-legacy-cjs.cjs.map -", -] +" +`; + +exports[`Namespaces > swc > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-legacy-cjs.cjs'; + +export const { ns1, ns2 } = data;" `; -exports[`Namespaces swc transforms example test case: node-legacy-lib 1`] = ` -[ - "lib/index-node-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > swc > transforms example test case: node-legacy-lib > lib/index-node-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: lib "use strict"; function foo() {} @@ -1648,14 +1424,11 @@ const helpers = /*#__PURE__*/ Object.freeze({ exports.ns1 = helpers; exports.ns2 = helpers; //# sourceMappingURL=index-node-legacy-lib.js.map -", -] +" `; -exports[`Namespaces swc transforms example test case: node-legacy-mjs 1`] = ` -[ - "mjs/index-node-legacy-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > swc > transforms example test case: node-legacy-mjs > mjs/index-node-legacy-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: mjs function foo() {} function bar() {} @@ -1668,26 +1441,11 @@ const helpers = /*#__PURE__*/ Object.freeze(/*#__PURE__*/ Object.defineProperty( })); export { helpers as ns1, helpers as ns2 }; //# sourceMappingURL=index-node-legacy-mjs.mjs.map -", -] +" `; -exports[`Namespaces swc transforms example test case: node-stable-cjs 1`] = ` -[ - "cjs/index-node-stable-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-stable-cjs.cjs'; - -export const { ns1, ns2 } = data;", -] -`; - -exports[`Namespaces swc transforms example test case: node-stable-cjs 2`] = ` -[ - "cjs/index-node-stable-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > swc > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: cjs "use strict"; function foo() {} @@ -1700,14 +1458,20 @@ const helpers = /*#__PURE__*/ Object.freeze({ exports.ns1 = helpers; exports.ns2 = helpers; //# sourceMappingURL=index-node-stable-cjs.cjs.map -", -] +" +`; + +exports[`Namespaces > swc > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-stable-cjs.cjs'; + +export const { ns1, ns2 } = data;" `; -exports[`Namespaces swc transforms example test case: node-stable-lib 1`] = ` -[ - "lib/index-node-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > swc > transforms example test case: node-stable-lib > lib/index-node-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: lib "use strict"; function foo() {} @@ -1720,14 +1484,11 @@ const helpers = /*#__PURE__*/ Object.freeze({ exports.ns1 = helpers; exports.ns2 = helpers; //# sourceMappingURL=index-node-stable-lib.js.map -", -] +" `; -exports[`Namespaces swc transforms example test case: node-stable-mjs 1`] = ` -[ - "mjs/index-node-stable-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Namespaces > swc > transforms example test case: node-stable-mjs > mjs/index-node-stable-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: mjs function foo() {} function bar() {} @@ -1740,6 +1501,5 @@ const helpers = /*#__PURE__*/ Object.freeze(/*#__PURE__*/ Object.defineProperty( })); export { helpers as ns1, helpers as ns2 }; //# sourceMappingURL=index-node-stable-mjs.mjs.map -", -] +" `; diff --git a/packages/packemon/tests/examples/__snapshots__/newSyntax.test.ts.snap b/packages/packemon/tests/examples/__snapshots__/newSyntax.test.ts.snap index 9d4ca45f1..cf1ce764d 100644 --- a/packages/packemon/tests/examples/__snapshots__/newSyntax.test.ts.snap +++ b/packages/packemon/tests/examples/__snapshots__/newSyntax.test.ts.snap @@ -1,9 +1,7 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`New syntax babel transforms example test case: browser-current-esm 1`] = ` -[ - "esm/index-browser-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > babel > transforms example test case: browser-current-esm > esm/index-browser-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: esm const foo = {}; @@ -13,14 +11,11 @@ foo.bar ??= 'bar'; foo.baz ||= 'baz'; export { foo, nullCoalesc, optionalChain }; //# sourceMappingURL=index-browser-current-esm.js.map -", -] +" `; -exports[`New syntax babel transforms example test case: browser-current-lib 1`] = ` -[ - "lib/index-browser-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > babel > transforms example test case: browser-current-lib > lib/index-browser-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: lib 'use strict'; @@ -34,14 +29,11 @@ exports.foo = foo; exports.nullCoalesc = nullCoalesc; exports.optionalChain = optionalChain; //# sourceMappingURL=index-browser-current-lib.js.map -", -] +" `; -exports[`New syntax babel transforms example test case: browser-current-umd 1`] = ` -[ - "umd/index-browser-current-umd.js", - "(function (global, factory) { +exports[`New syntax > babel > transforms example test case: browser-current-umd > umd/index-browser-current-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports"], factory); } else if (typeof exports !== "undefined") { @@ -70,14 +62,11 @@ exports[`New syntax babel transforms example test case: browser-current-umd 1`] foo.baz ||= 'baz'; }); //# sourceMappingURL=index-browser-current-umd.js.map -", -] +" `; -exports[`New syntax babel transforms example test case: browser-experimental-esm 1`] = ` -[ - "esm/index-browser-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > babel > transforms example test case: browser-experimental-esm > esm/index-browser-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: esm const foo = {}; @@ -87,14 +76,11 @@ foo.bar ??= 'bar'; foo.baz ||= 'baz'; export { foo, nullCoalesc, optionalChain }; //# sourceMappingURL=index-browser-experimental-esm.js.map -", -] +" `; -exports[`New syntax babel transforms example test case: browser-experimental-lib 1`] = ` -[ - "lib/index-browser-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > babel > transforms example test case: browser-experimental-lib > lib/index-browser-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: lib 'use strict'; @@ -108,14 +94,11 @@ exports.foo = foo; exports.nullCoalesc = nullCoalesc; exports.optionalChain = optionalChain; //# sourceMappingURL=index-browser-experimental-lib.js.map -", -] +" `; -exports[`New syntax babel transforms example test case: browser-experimental-umd 1`] = ` -[ - "umd/index-browser-experimental-umd.js", - "(function (global, factory) { +exports[`New syntax > babel > transforms example test case: browser-experimental-umd > umd/index-browser-experimental-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports"], factory); } else if (typeof exports !== "undefined") { @@ -144,14 +127,11 @@ exports[`New syntax babel transforms example test case: browser-experimental-umd foo.baz ||= 'baz'; }); //# sourceMappingURL=index-browser-experimental-umd.js.map -", -] +" `; -exports[`New syntax babel transforms example test case: browser-legacy-esm 1`] = ` -[ - "esm/index-browser-legacy-esm.js", - "var _foo$bar; +exports[`New syntax > babel > transforms example test case: browser-legacy-esm > esm/index-browser-legacy-esm.js 1`] = ` +"var _foo$bar; // Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: esm @@ -162,14 +142,11 @@ var nullCoalesc = foo !== null && foo !== void 0 ? foo : 0; foo.baz || (foo.baz = 'baz'); export { foo, nullCoalesc, optionalChain }; //# sourceMappingURL=index-browser-legacy-esm.js.map -", -] +" `; -exports[`New syntax babel transforms example test case: browser-legacy-lib 1`] = ` -[ - "lib/index-browser-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > babel > transforms example test case: browser-legacy-lib > lib/index-browser-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: lib 'use strict'; @@ -184,14 +161,11 @@ exports.foo = foo; exports.nullCoalesc = nullCoalesc; exports.optionalChain = optionalChain; //# sourceMappingURL=index-browser-legacy-lib.js.map -", -] +" `; -exports[`New syntax babel transforms example test case: browser-legacy-umd 1`] = ` -[ - "umd/index-browser-legacy-umd.js", - "(function (global, factory) { +exports[`New syntax > babel > transforms example test case: browser-legacy-umd > umd/index-browser-legacy-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports"], factory); } else if (typeof exports !== "undefined") { @@ -221,14 +195,11 @@ exports[`New syntax babel transforms example test case: browser-legacy-umd 1`] = foo.baz || (foo.baz = 'baz'); }); //# sourceMappingURL=index-browser-legacy-umd.js.map -", -] +" `; -exports[`New syntax babel transforms example test case: browser-stable-esm 1`] = ` -[ - "esm/index-browser-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > babel > transforms example test case: browser-stable-esm > esm/index-browser-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: esm const foo = {}; @@ -238,14 +209,11 @@ foo.bar ??= 'bar'; foo.baz ||= 'baz'; export { foo, nullCoalesc, optionalChain }; //# sourceMappingURL=index-browser-stable-esm.js.map -", -] +" `; -exports[`New syntax babel transforms example test case: browser-stable-lib 1`] = ` -[ - "lib/index-browser-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > babel > transforms example test case: browser-stable-lib > lib/index-browser-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: lib 'use strict'; @@ -259,14 +227,11 @@ exports.foo = foo; exports.nullCoalesc = nullCoalesc; exports.optionalChain = optionalChain; //# sourceMappingURL=index-browser-stable-lib.js.map -", -] +" `; -exports[`New syntax babel transforms example test case: browser-stable-umd 1`] = ` -[ - "umd/index-browser-stable-umd.js", - "(function (global, factory) { +exports[`New syntax > babel > transforms example test case: browser-stable-umd > umd/index-browser-stable-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports"], factory); } else if (typeof exports !== "undefined") { @@ -295,14 +260,11 @@ exports[`New syntax babel transforms example test case: browser-stable-umd 1`] = foo.baz ||= 'baz'; }); //# sourceMappingURL=index-browser-stable-umd.js.map -", -] +" `; -exports[`New syntax babel transforms example test case: electron-current-esm 1`] = ` -[ - "esm/index-electron-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > babel > transforms example test case: electron-current-esm > esm/index-electron-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: esm const foo = {}; @@ -312,14 +274,11 @@ foo.bar ??= 'bar'; foo.baz ||= 'baz'; export { foo, nullCoalesc, optionalChain }; //# sourceMappingURL=index-electron-current-esm.js.map -", -] +" `; -exports[`New syntax babel transforms example test case: electron-current-lib 1`] = ` -[ - "lib/index-electron-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > babel > transforms example test case: electron-current-lib > lib/index-electron-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: lib 'use strict'; @@ -333,14 +292,11 @@ exports.foo = foo; exports.nullCoalesc = nullCoalesc; exports.optionalChain = optionalChain; //# sourceMappingURL=index-electron-current-lib.js.map -", -] +" `; -exports[`New syntax babel transforms example test case: electron-experimental-esm 1`] = ` -[ - "esm/index-electron-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > babel > transforms example test case: electron-experimental-esm > esm/index-electron-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: esm const foo = {}; @@ -350,14 +306,11 @@ foo.bar ??= 'bar'; foo.baz ||= 'baz'; export { foo, nullCoalesc, optionalChain }; //# sourceMappingURL=index-electron-experimental-esm.js.map -", -] +" `; -exports[`New syntax babel transforms example test case: electron-experimental-lib 1`] = ` -[ - "lib/index-electron-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > babel > transforms example test case: electron-experimental-lib > lib/index-electron-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: lib 'use strict'; @@ -371,14 +324,11 @@ exports.foo = foo; exports.nullCoalesc = nullCoalesc; exports.optionalChain = optionalChain; //# sourceMappingURL=index-electron-experimental-lib.js.map -", -] +" `; -exports[`New syntax babel transforms example test case: electron-legacy-esm 1`] = ` -[ - "esm/index-electron-legacy-esm.js", - "var _foo$bar; +exports[`New syntax > babel > transforms example test case: electron-legacy-esm > esm/index-electron-legacy-esm.js 1`] = ` +"var _foo$bar; // Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: esm @@ -389,14 +339,11 @@ const nullCoalesc = foo !== null && foo !== void 0 ? foo : 0; foo.baz || (foo.baz = 'baz'); export { foo, nullCoalesc, optionalChain }; //# sourceMappingURL=index-electron-legacy-esm.js.map -", -] +" `; -exports[`New syntax babel transforms example test case: electron-legacy-lib 1`] = ` -[ - "lib/index-electron-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > babel > transforms example test case: electron-legacy-lib > lib/index-electron-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: lib 'use strict'; @@ -411,14 +358,11 @@ exports.foo = foo; exports.nullCoalesc = nullCoalesc; exports.optionalChain = optionalChain; //# sourceMappingURL=index-electron-legacy-lib.js.map -", -] +" `; -exports[`New syntax babel transforms example test case: electron-stable-esm 1`] = ` -[ - "esm/index-electron-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > babel > transforms example test case: electron-stable-esm > esm/index-electron-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: esm const foo = {}; @@ -428,14 +372,11 @@ foo.bar ??= 'bar'; foo.baz ||= 'baz'; export { foo, nullCoalesc, optionalChain }; //# sourceMappingURL=index-electron-stable-esm.js.map -", -] +" `; -exports[`New syntax babel transforms example test case: electron-stable-lib 1`] = ` -[ - "lib/index-electron-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > babel > transforms example test case: electron-stable-lib > lib/index-electron-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: lib 'use strict'; @@ -449,14 +390,11 @@ exports.foo = foo; exports.nullCoalesc = nullCoalesc; exports.optionalChain = optionalChain; //# sourceMappingURL=index-electron-stable-lib.js.map -", -] +" `; -exports[`New syntax babel transforms example test case: native-current-lib 1`] = ` -[ - "lib/index-native-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > babel > transforms example test case: native-current-lib > lib/index-native-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: current, Format: lib 'use strict'; @@ -470,14 +408,11 @@ exports.foo = foo; exports.nullCoalesc = nullCoalesc; exports.optionalChain = optionalChain; //# sourceMappingURL=index-native-current-lib.js.map -", -] +" `; -exports[`New syntax babel transforms example test case: native-experimental-lib 1`] = ` -[ - "lib/index-native-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > babel > transforms example test case: native-experimental-lib > lib/index-native-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: experimental, Format: lib 'use strict'; @@ -491,14 +426,11 @@ exports.foo = foo; exports.nullCoalesc = nullCoalesc; exports.optionalChain = optionalChain; //# sourceMappingURL=index-native-experimental-lib.js.map -", -] +" `; -exports[`New syntax babel transforms example test case: native-legacy-lib 1`] = ` -[ - "lib/index-native-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > babel > transforms example test case: native-legacy-lib > lib/index-native-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: legacy, Format: lib 'use strict'; @@ -513,14 +445,11 @@ exports.foo = foo; exports.nullCoalesc = nullCoalesc; exports.optionalChain = optionalChain; //# sourceMappingURL=index-native-legacy-lib.js.map -", -] +" `; -exports[`New syntax babel transforms example test case: native-stable-lib 1`] = ` -[ - "lib/index-native-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > babel > transforms example test case: native-stable-lib > lib/index-native-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: stable, Format: lib 'use strict'; @@ -534,26 +463,11 @@ exports.foo = foo; exports.nullCoalesc = nullCoalesc; exports.optionalChain = optionalChain; //# sourceMappingURL=index-native-stable-lib.js.map -", -] +" `; -exports[`New syntax babel transforms example test case: node-current-cjs 1`] = ` -[ - "cjs/index-node-current-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-current-cjs.cjs'; - -export const { foo, nullCoalesc, optionalChain } = data;", -] -`; - -exports[`New syntax babel transforms example test case: node-current-cjs 2`] = ` -[ - "cjs/index-node-current-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > babel > transforms example test case: node-current-cjs > cjs/index-node-current-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: cjs 'use strict'; @@ -567,14 +481,20 @@ exports.foo = foo; exports.nullCoalesc = nullCoalesc; exports.optionalChain = optionalChain; //# sourceMappingURL=index-node-current-cjs.cjs.map -", -] +" +`; + +exports[`New syntax > babel > transforms example test case: node-current-cjs > cjs/index-node-current-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-current-cjs.cjs'; + +export const { foo, nullCoalesc, optionalChain } = data;" `; -exports[`New syntax babel transforms example test case: node-current-lib 1`] = ` -[ - "lib/index-node-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > babel > transforms example test case: node-current-lib > lib/index-node-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: lib 'use strict'; @@ -588,14 +508,11 @@ exports.foo = foo; exports.nullCoalesc = nullCoalesc; exports.optionalChain = optionalChain; //# sourceMappingURL=index-node-current-lib.js.map -", -] +" `; -exports[`New syntax babel transforms example test case: node-current-mjs 1`] = ` -[ - "mjs/index-node-current-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > babel > transforms example test case: node-current-mjs > mjs/index-node-current-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: mjs const foo = {}; @@ -605,26 +522,11 @@ foo.bar ??= 'bar'; foo.baz ||= 'baz'; export { foo, nullCoalesc, optionalChain }; //# sourceMappingURL=index-node-current-mjs.mjs.map -", -] +" `; -exports[`New syntax babel transforms example test case: node-experimental-cjs 1`] = ` -[ - "cjs/index-node-experimental-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-experimental-cjs.cjs'; - -export const { foo, nullCoalesc, optionalChain } = data;", -] -`; - -exports[`New syntax babel transforms example test case: node-experimental-cjs 2`] = ` -[ - "cjs/index-node-experimental-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > babel > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: cjs 'use strict'; @@ -638,14 +540,20 @@ exports.foo = foo; exports.nullCoalesc = nullCoalesc; exports.optionalChain = optionalChain; //# sourceMappingURL=index-node-experimental-cjs.cjs.map -", -] +" +`; + +exports[`New syntax > babel > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-experimental-cjs.cjs'; + +export const { foo, nullCoalesc, optionalChain } = data;" `; -exports[`New syntax babel transforms example test case: node-experimental-lib 1`] = ` -[ - "lib/index-node-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > babel > transforms example test case: node-experimental-lib > lib/index-node-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: lib 'use strict'; @@ -659,14 +567,11 @@ exports.foo = foo; exports.nullCoalesc = nullCoalesc; exports.optionalChain = optionalChain; //# sourceMappingURL=index-node-experimental-lib.js.map -", -] +" `; -exports[`New syntax babel transforms example test case: node-experimental-mjs 1`] = ` -[ - "mjs/index-node-experimental-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > babel > transforms example test case: node-experimental-mjs > mjs/index-node-experimental-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: mjs const foo = {}; @@ -676,26 +581,11 @@ foo.bar ??= 'bar'; foo.baz ||= 'baz'; export { foo, nullCoalesc, optionalChain }; //# sourceMappingURL=index-node-experimental-mjs.mjs.map -", -] +" `; -exports[`New syntax babel transforms example test case: node-legacy-cjs 1`] = ` -[ - "cjs/index-node-legacy-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-legacy-cjs.cjs'; - -export const { foo, nullCoalesc, optionalChain } = data;", -] -`; - -exports[`New syntax babel transforms example test case: node-legacy-cjs 2`] = ` -[ - "cjs/index-node-legacy-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > babel > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: cjs 'use strict'; @@ -710,14 +600,20 @@ exports.foo = foo; exports.nullCoalesc = nullCoalesc; exports.optionalChain = optionalChain; //# sourceMappingURL=index-node-legacy-cjs.cjs.map -", -] +" +`; + +exports[`New syntax > babel > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-legacy-cjs.cjs'; + +export const { foo, nullCoalesc, optionalChain } = data;" `; -exports[`New syntax babel transforms example test case: node-legacy-lib 1`] = ` -[ - "lib/index-node-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > babel > transforms example test case: node-legacy-lib > lib/index-node-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: lib 'use strict'; @@ -732,14 +628,11 @@ exports.foo = foo; exports.nullCoalesc = nullCoalesc; exports.optionalChain = optionalChain; //# sourceMappingURL=index-node-legacy-lib.js.map -", -] +" `; -exports[`New syntax babel transforms example test case: node-legacy-mjs 1`] = ` -[ - "mjs/index-node-legacy-mjs.mjs", - "var _foo$bar; +exports[`New syntax > babel > transforms example test case: node-legacy-mjs > mjs/index-node-legacy-mjs.mjs 1`] = ` +"var _foo$bar; // Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: mjs @@ -750,26 +643,11 @@ const nullCoalesc = foo !== null && foo !== void 0 ? foo : 0; foo.baz || (foo.baz = 'baz'); export { foo, nullCoalesc, optionalChain }; //# sourceMappingURL=index-node-legacy-mjs.mjs.map -", -] +" `; -exports[`New syntax babel transforms example test case: node-stable-cjs 1`] = ` -[ - "cjs/index-node-stable-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-stable-cjs.cjs'; - -export const { foo, nullCoalesc, optionalChain } = data;", -] -`; - -exports[`New syntax babel transforms example test case: node-stable-cjs 2`] = ` -[ - "cjs/index-node-stable-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > babel > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: cjs 'use strict'; @@ -783,14 +661,20 @@ exports.foo = foo; exports.nullCoalesc = nullCoalesc; exports.optionalChain = optionalChain; //# sourceMappingURL=index-node-stable-cjs.cjs.map -", -] +" +`; + +exports[`New syntax > babel > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-stable-cjs.cjs'; + +export const { foo, nullCoalesc, optionalChain } = data;" `; -exports[`New syntax babel transforms example test case: node-stable-lib 1`] = ` -[ - "lib/index-node-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > babel > transforms example test case: node-stable-lib > lib/index-node-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: lib 'use strict'; @@ -804,14 +688,11 @@ exports.foo = foo; exports.nullCoalesc = nullCoalesc; exports.optionalChain = optionalChain; //# sourceMappingURL=index-node-stable-lib.js.map -", -] +" `; -exports[`New syntax babel transforms example test case: node-stable-mjs 1`] = ` -[ - "mjs/index-node-stable-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > babel > transforms example test case: node-stable-mjs > mjs/index-node-stable-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: mjs const foo = {}; @@ -821,14 +702,11 @@ foo.bar ??= 'bar'; foo.baz ||= 'baz'; export { foo, nullCoalesc, optionalChain }; //# sourceMappingURL=index-node-stable-mjs.mjs.map -", -] +" `; -exports[`New syntax swc transforms example test case: browser-current-esm 1`] = ` -[ - "esm/index-browser-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > swc > transforms example test case: browser-current-esm > esm/index-browser-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: esm const foo = {}; const optionalChain = foo?.bar; @@ -837,14 +715,11 @@ foo.bar ??= "bar"; foo.baz ||= "baz"; export { foo, nullCoalesc, optionalChain }; //# sourceMappingURL=index-browser-current-esm.js.map -", -] +" `; -exports[`New syntax swc transforms example test case: browser-current-lib 1`] = ` -[ - "lib/index-browser-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > swc > transforms example test case: browser-current-lib > lib/index-browser-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: lib "use strict"; const foo = {}; @@ -856,14 +731,11 @@ exports.foo = foo; exports.nullCoalesc = nullCoalesc; exports.optionalChain = optionalChain; //# sourceMappingURL=index-browser-current-lib.js.map -", -] +" `; -exports[`New syntax swc transforms example test case: browser-current-umd 1`] = ` -[ - "umd/index-browser-current-umd.js", - "(function(global, factory) { +exports[`New syntax > swc > transforms example test case: browser-current-umd > umd/index-browser-current-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports); else if (typeof define === "function" && define.amd) define([ "exports" @@ -898,14 +770,11 @@ exports[`New syntax swc transforms example test case: browser-current-umd 1`] = foo.baz ||= "baz"; }); //# sourceMappingURL=index-browser-current-umd.js.map -", -] +" `; -exports[`New syntax swc transforms example test case: browser-experimental-esm 1`] = ` -[ - "esm/index-browser-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > swc > transforms example test case: browser-experimental-esm > esm/index-browser-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: esm const foo = {}; const optionalChain = foo?.bar; @@ -914,14 +783,11 @@ foo.bar ??= "bar"; foo.baz ||= "baz"; export { foo, nullCoalesc, optionalChain }; //# sourceMappingURL=index-browser-experimental-esm.js.map -", -] +" `; -exports[`New syntax swc transforms example test case: browser-experimental-lib 1`] = ` -[ - "lib/index-browser-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > swc > transforms example test case: browser-experimental-lib > lib/index-browser-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: lib "use strict"; const foo = {}; @@ -933,14 +799,11 @@ exports.foo = foo; exports.nullCoalesc = nullCoalesc; exports.optionalChain = optionalChain; //# sourceMappingURL=index-browser-experimental-lib.js.map -", -] +" `; -exports[`New syntax swc transforms example test case: browser-experimental-umd 1`] = ` -[ - "umd/index-browser-experimental-umd.js", - "(function(global, factory) { +exports[`New syntax > swc > transforms example test case: browser-experimental-umd > umd/index-browser-experimental-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports); else if (typeof define === "function" && define.amd) define([ "exports" @@ -975,14 +838,11 @@ exports[`New syntax swc transforms example test case: browser-experimental-umd 1 foo.baz ||= "baz"; }); //# sourceMappingURL=index-browser-experimental-umd.js.map -", -] +" `; -exports[`New syntax swc transforms example test case: browser-legacy-esm 1`] = ` -[ - "esm/index-browser-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > swc > transforms example test case: browser-legacy-esm > esm/index-browser-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: esm var _foo, _foo1; var foo = {}; @@ -993,14 +853,11 @@ var _bar; (_foo1 = foo).baz || (_foo1.baz = "baz"); export { foo, nullCoalesc, optionalChain }; //# sourceMappingURL=index-browser-legacy-esm.js.map -", -] +" `; -exports[`New syntax swc transforms example test case: browser-legacy-lib 1`] = ` -[ - "lib/index-browser-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > swc > transforms example test case: browser-legacy-lib > lib/index-browser-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: lib "use strict"; var _foo, _foo1; @@ -1014,14 +871,11 @@ exports.foo = foo; exports.nullCoalesc = nullCoalesc; exports.optionalChain = optionalChain; //# sourceMappingURL=index-browser-legacy-lib.js.map -", -] +" `; -exports[`New syntax swc transforms example test case: browser-legacy-umd 1`] = ` -[ - "umd/index-browser-legacy-umd.js", - "(function(global, factory) { +exports[`New syntax > swc > transforms example test case: browser-legacy-umd > umd/index-browser-legacy-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports); else if (typeof define === "function" && define.amd) define([ "exports" @@ -1058,14 +912,11 @@ exports[`New syntax swc transforms example test case: browser-legacy-umd 1`] = ` (_foo1 = foo).baz || (_foo1.baz = "baz"); }); //# sourceMappingURL=index-browser-legacy-umd.js.map -", -] +" `; -exports[`New syntax swc transforms example test case: browser-stable-esm 1`] = ` -[ - "esm/index-browser-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > swc > transforms example test case: browser-stable-esm > esm/index-browser-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: esm const foo = {}; const optionalChain = foo?.bar; @@ -1074,14 +925,11 @@ foo.bar ??= "bar"; foo.baz ||= "baz"; export { foo, nullCoalesc, optionalChain }; //# sourceMappingURL=index-browser-stable-esm.js.map -", -] +" `; -exports[`New syntax swc transforms example test case: browser-stable-lib 1`] = ` -[ - "lib/index-browser-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > swc > transforms example test case: browser-stable-lib > lib/index-browser-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: lib "use strict"; const foo = {}; @@ -1093,14 +941,11 @@ exports.foo = foo; exports.nullCoalesc = nullCoalesc; exports.optionalChain = optionalChain; //# sourceMappingURL=index-browser-stable-lib.js.map -", -] +" `; -exports[`New syntax swc transforms example test case: browser-stable-umd 1`] = ` -[ - "umd/index-browser-stable-umd.js", - "(function(global, factory) { +exports[`New syntax > swc > transforms example test case: browser-stable-umd > umd/index-browser-stable-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports); else if (typeof define === "function" && define.amd) define([ "exports" @@ -1135,14 +980,11 @@ exports[`New syntax swc transforms example test case: browser-stable-umd 1`] = ` foo.baz ||= "baz"; }); //# sourceMappingURL=index-browser-stable-umd.js.map -", -] +" `; -exports[`New syntax swc transforms example test case: electron-current-esm 1`] = ` -[ - "esm/index-electron-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > swc > transforms example test case: electron-current-esm > esm/index-electron-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: esm const foo = {}; const optionalChain = foo?.bar; @@ -1151,14 +993,11 @@ foo.bar ??= "bar"; foo.baz ||= "baz"; export { foo, nullCoalesc, optionalChain }; //# sourceMappingURL=index-electron-current-esm.js.map -", -] +" `; -exports[`New syntax swc transforms example test case: electron-current-lib 1`] = ` -[ - "lib/index-electron-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > swc > transforms example test case: electron-current-lib > lib/index-electron-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: lib "use strict"; const foo = {}; @@ -1170,14 +1009,11 @@ exports.foo = foo; exports.nullCoalesc = nullCoalesc; exports.optionalChain = optionalChain; //# sourceMappingURL=index-electron-current-lib.js.map -", -] +" `; -exports[`New syntax swc transforms example test case: electron-experimental-esm 1`] = ` -[ - "esm/index-electron-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > swc > transforms example test case: electron-experimental-esm > esm/index-electron-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: esm const foo = {}; const optionalChain = foo?.bar; @@ -1186,14 +1022,11 @@ foo.bar ??= "bar"; foo.baz ||= "baz"; export { foo, nullCoalesc, optionalChain }; //# sourceMappingURL=index-electron-experimental-esm.js.map -", -] +" `; -exports[`New syntax swc transforms example test case: electron-experimental-lib 1`] = ` -[ - "lib/index-electron-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > swc > transforms example test case: electron-experimental-lib > lib/index-electron-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: lib "use strict"; const foo = {}; @@ -1205,14 +1038,11 @@ exports.foo = foo; exports.nullCoalesc = nullCoalesc; exports.optionalChain = optionalChain; //# sourceMappingURL=index-electron-experimental-lib.js.map -", -] +" `; -exports[`New syntax swc transforms example test case: electron-legacy-esm 1`] = ` -[ - "esm/index-electron-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > swc > transforms example test case: electron-legacy-esm > esm/index-electron-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: esm var _foo, _foo1; const foo = {}; @@ -1223,14 +1053,11 @@ var _bar; (_foo1 = foo).baz || (_foo1.baz = "baz"); export { foo, nullCoalesc, optionalChain }; //# sourceMappingURL=index-electron-legacy-esm.js.map -", -] +" `; -exports[`New syntax swc transforms example test case: electron-legacy-lib 1`] = ` -[ - "lib/index-electron-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > swc > transforms example test case: electron-legacy-lib > lib/index-electron-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: lib "use strict"; var _foo, _foo1; @@ -1244,14 +1071,11 @@ exports.foo = foo; exports.nullCoalesc = nullCoalesc; exports.optionalChain = optionalChain; //# sourceMappingURL=index-electron-legacy-lib.js.map -", -] +" `; -exports[`New syntax swc transforms example test case: electron-stable-esm 1`] = ` -[ - "esm/index-electron-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > swc > transforms example test case: electron-stable-esm > esm/index-electron-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: esm const foo = {}; const optionalChain = foo?.bar; @@ -1260,14 +1084,11 @@ foo.bar ??= "bar"; foo.baz ||= "baz"; export { foo, nullCoalesc, optionalChain }; //# sourceMappingURL=index-electron-stable-esm.js.map -", -] +" `; -exports[`New syntax swc transforms example test case: electron-stable-lib 1`] = ` -[ - "lib/index-electron-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > swc > transforms example test case: electron-stable-lib > lib/index-electron-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: lib "use strict"; const foo = {}; @@ -1279,14 +1100,11 @@ exports.foo = foo; exports.nullCoalesc = nullCoalesc; exports.optionalChain = optionalChain; //# sourceMappingURL=index-electron-stable-lib.js.map -", -] +" `; -exports[`New syntax swc transforms example test case: native-current-lib 1`] = ` -[ - "lib/index-native-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > swc > transforms example test case: native-current-lib > lib/index-native-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: current, Format: lib "use strict"; const foo = {}; @@ -1298,14 +1116,11 @@ exports.foo = foo; exports.nullCoalesc = nullCoalesc; exports.optionalChain = optionalChain; //# sourceMappingURL=index-native-current-lib.js.map -", -] +" `; -exports[`New syntax swc transforms example test case: native-experimental-lib 1`] = ` -[ - "lib/index-native-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > swc > transforms example test case: native-experimental-lib > lib/index-native-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: experimental, Format: lib "use strict"; const foo = {}; @@ -1317,14 +1132,11 @@ exports.foo = foo; exports.nullCoalesc = nullCoalesc; exports.optionalChain = optionalChain; //# sourceMappingURL=index-native-experimental-lib.js.map -", -] +" `; -exports[`New syntax swc transforms example test case: native-legacy-lib 1`] = ` -[ - "lib/index-native-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > swc > transforms example test case: native-legacy-lib > lib/index-native-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: legacy, Format: lib "use strict"; var _foo, _foo1; @@ -1338,14 +1150,11 @@ exports.foo = foo; exports.nullCoalesc = nullCoalesc; exports.optionalChain = optionalChain; //# sourceMappingURL=index-native-legacy-lib.js.map -", -] +" `; -exports[`New syntax swc transforms example test case: native-stable-lib 1`] = ` -[ - "lib/index-native-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > swc > transforms example test case: native-stable-lib > lib/index-native-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: stable, Format: lib "use strict"; const foo = {}; @@ -1357,26 +1166,11 @@ exports.foo = foo; exports.nullCoalesc = nullCoalesc; exports.optionalChain = optionalChain; //# sourceMappingURL=index-native-stable-lib.js.map -", -] +" `; -exports[`New syntax swc transforms example test case: node-current-cjs 1`] = ` -[ - "cjs/index-node-current-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-current-cjs.cjs'; - -export const { foo, nullCoalesc, optionalChain } = data;", -] -`; - -exports[`New syntax swc transforms example test case: node-current-cjs 2`] = ` -[ - "cjs/index-node-current-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > swc > transforms example test case: node-current-cjs > cjs/index-node-current-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: cjs "use strict"; const foo = {}; @@ -1388,14 +1182,20 @@ exports.foo = foo; exports.nullCoalesc = nullCoalesc; exports.optionalChain = optionalChain; //# sourceMappingURL=index-node-current-cjs.cjs.map -", -] +" +`; + +exports[`New syntax > swc > transforms example test case: node-current-cjs > cjs/index-node-current-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-current-cjs.cjs'; + +export const { foo, nullCoalesc, optionalChain } = data;" `; -exports[`New syntax swc transforms example test case: node-current-lib 1`] = ` -[ - "lib/index-node-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > swc > transforms example test case: node-current-lib > lib/index-node-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: lib "use strict"; const foo = {}; @@ -1407,14 +1207,11 @@ exports.foo = foo; exports.nullCoalesc = nullCoalesc; exports.optionalChain = optionalChain; //# sourceMappingURL=index-node-current-lib.js.map -", -] +" `; -exports[`New syntax swc transforms example test case: node-current-mjs 1`] = ` -[ - "mjs/index-node-current-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > swc > transforms example test case: node-current-mjs > mjs/index-node-current-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: mjs const foo = {}; const optionalChain = foo?.bar; @@ -1423,26 +1220,11 @@ foo.bar ??= "bar"; foo.baz ||= "baz"; export { foo, nullCoalesc, optionalChain }; //# sourceMappingURL=index-node-current-mjs.mjs.map -", -] +" `; -exports[`New syntax swc transforms example test case: node-experimental-cjs 1`] = ` -[ - "cjs/index-node-experimental-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-experimental-cjs.cjs'; - -export const { foo, nullCoalesc, optionalChain } = data;", -] -`; - -exports[`New syntax swc transforms example test case: node-experimental-cjs 2`] = ` -[ - "cjs/index-node-experimental-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > swc > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: cjs "use strict"; const foo = {}; @@ -1454,14 +1236,20 @@ exports.foo = foo; exports.nullCoalesc = nullCoalesc; exports.optionalChain = optionalChain; //# sourceMappingURL=index-node-experimental-cjs.cjs.map -", -] +" +`; + +exports[`New syntax > swc > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-experimental-cjs.cjs'; + +export const { foo, nullCoalesc, optionalChain } = data;" `; -exports[`New syntax swc transforms example test case: node-experimental-lib 1`] = ` -[ - "lib/index-node-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > swc > transforms example test case: node-experimental-lib > lib/index-node-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: lib "use strict"; const foo = {}; @@ -1473,14 +1261,11 @@ exports.foo = foo; exports.nullCoalesc = nullCoalesc; exports.optionalChain = optionalChain; //# sourceMappingURL=index-node-experimental-lib.js.map -", -] +" `; -exports[`New syntax swc transforms example test case: node-experimental-mjs 1`] = ` -[ - "mjs/index-node-experimental-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > swc > transforms example test case: node-experimental-mjs > mjs/index-node-experimental-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: mjs const foo = {}; const optionalChain = foo?.bar; @@ -1489,26 +1274,11 @@ foo.bar ??= "bar"; foo.baz ||= "baz"; export { foo, nullCoalesc, optionalChain }; //# sourceMappingURL=index-node-experimental-mjs.mjs.map -", -] +" `; -exports[`New syntax swc transforms example test case: node-legacy-cjs 1`] = ` -[ - "cjs/index-node-legacy-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-legacy-cjs.cjs'; - -export const { foo, nullCoalesc, optionalChain } = data;", -] -`; - -exports[`New syntax swc transforms example test case: node-legacy-cjs 2`] = ` -[ - "cjs/index-node-legacy-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > swc > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: cjs "use strict"; var _foo, _foo1; @@ -1521,14 +1291,20 @@ exports.foo = foo; exports.nullCoalesc = nullCoalesc; exports.optionalChain = optionalChain; //# sourceMappingURL=index-node-legacy-cjs.cjs.map -", -] +" +`; + +exports[`New syntax > swc > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-legacy-cjs.cjs'; + +export const { foo, nullCoalesc, optionalChain } = data;" `; -exports[`New syntax swc transforms example test case: node-legacy-lib 1`] = ` -[ - "lib/index-node-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > swc > transforms example test case: node-legacy-lib > lib/index-node-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: lib "use strict"; var _foo, _foo1; @@ -1541,14 +1317,11 @@ exports.foo = foo; exports.nullCoalesc = nullCoalesc; exports.optionalChain = optionalChain; //# sourceMappingURL=index-node-legacy-lib.js.map -", -] +" `; -exports[`New syntax swc transforms example test case: node-legacy-mjs 1`] = ` -[ - "mjs/index-node-legacy-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > swc > transforms example test case: node-legacy-mjs > mjs/index-node-legacy-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: mjs var _foo, _foo1; const foo = {}; @@ -1558,26 +1331,11 @@ const nullCoalesc = foo ?? 0; (_foo1 = foo).baz || (_foo1.baz = "baz"); export { foo, nullCoalesc, optionalChain }; //# sourceMappingURL=index-node-legacy-mjs.mjs.map -", -] +" `; -exports[`New syntax swc transforms example test case: node-stable-cjs 1`] = ` -[ - "cjs/index-node-stable-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-stable-cjs.cjs'; - -export const { foo, nullCoalesc, optionalChain } = data;", -] -`; - -exports[`New syntax swc transforms example test case: node-stable-cjs 2`] = ` -[ - "cjs/index-node-stable-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > swc > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: cjs "use strict"; const foo = {}; @@ -1589,14 +1347,20 @@ exports.foo = foo; exports.nullCoalesc = nullCoalesc; exports.optionalChain = optionalChain; //# sourceMappingURL=index-node-stable-cjs.cjs.map -", -] +" +`; + +exports[`New syntax > swc > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-stable-cjs.cjs'; + +export const { foo, nullCoalesc, optionalChain } = data;" `; -exports[`New syntax swc transforms example test case: node-stable-lib 1`] = ` -[ - "lib/index-node-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > swc > transforms example test case: node-stable-lib > lib/index-node-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: lib "use strict"; const foo = {}; @@ -1608,14 +1372,11 @@ exports.foo = foo; exports.nullCoalesc = nullCoalesc; exports.optionalChain = optionalChain; //# sourceMappingURL=index-node-stable-lib.js.map -", -] +" `; -exports[`New syntax swc transforms example test case: node-stable-mjs 1`] = ` -[ - "mjs/index-node-stable-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`New syntax > swc > transforms example test case: node-stable-mjs > mjs/index-node-stable-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: mjs const foo = {}; const optionalChain = foo?.bar; @@ -1624,6 +1385,5 @@ foo.bar ??= "bar"; foo.baz ||= "baz"; export { foo, nullCoalesc, optionalChain }; //# sourceMappingURL=index-node-stable-mjs.mjs.map -", -] +" `; diff --git a/packages/packemon/tests/examples/__snapshots__/nodePolyfills.test.ts.snap b/packages/packemon/tests/examples/__snapshots__/nodePolyfills.test.ts.snap index 5f0036c4c..f97fbe28f 100644 --- a/packages/packemon/tests/examples/__snapshots__/nodePolyfills.test.ts.snap +++ b/packages/packemon/tests/examples/__snapshots__/nodePolyfills.test.ts.snap @@ -1,9 +1,7 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`Node polyfills babel transforms example test case: browser-current-esm 1`] = ` -[ - "esm/index-browser-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > babel > transforms example test case: browser-current-esm > esm/index-browser-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: esm var domain; @@ -585,14 +583,11 @@ class Example extends EventEmitter { } export { Example, emitter, test }; //# sourceMappingURL=index-browser-current-esm.js.map -", -] +" `; -exports[`Node polyfills babel transforms example test case: browser-current-lib 1`] = ` -[ - "lib/index-browser-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > babel > transforms example test case: browser-current-lib > lib/index-browser-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: lib 'use strict'; @@ -1178,14 +1173,11 @@ exports.Example = Example; exports.emitter = emitter; exports.test = test; //# sourceMappingURL=index-browser-current-lib.js.map -", -] +" `; -exports[`Node polyfills babel transforms example test case: browser-current-umd 1`] = ` -[ - "umd/index-browser-current-umd.js", - "(function (global, factory) { +exports[`Node polyfills > babel > transforms example test case: browser-current-umd > umd/index-browser-current-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports"], factory); } else if (typeof exports !== "undefined") { @@ -1787,14 +1779,11 @@ exports[`Node polyfills babel transforms example test case: browser-current-umd _exports.Example = Example; }); //# sourceMappingURL=index-browser-current-umd.js.map -", -] +" `; -exports[`Node polyfills babel transforms example test case: browser-experimental-esm 1`] = ` -[ - "esm/index-browser-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > babel > transforms example test case: browser-experimental-esm > esm/index-browser-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: esm var domain; @@ -2376,14 +2365,11 @@ class Example extends EventEmitter { } export { Example, emitter, test }; //# sourceMappingURL=index-browser-experimental-esm.js.map -", -] +" `; -exports[`Node polyfills babel transforms example test case: browser-experimental-lib 1`] = ` -[ - "lib/index-browser-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > babel > transforms example test case: browser-experimental-lib > lib/index-browser-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: lib 'use strict'; @@ -2969,14 +2955,11 @@ exports.Example = Example; exports.emitter = emitter; exports.test = test; //# sourceMappingURL=index-browser-experimental-lib.js.map -", -] +" `; -exports[`Node polyfills babel transforms example test case: browser-experimental-umd 1`] = ` -[ - "umd/index-browser-experimental-umd.js", - "(function (global, factory) { +exports[`Node polyfills > babel > transforms example test case: browser-experimental-umd > umd/index-browser-experimental-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports"], factory); } else if (typeof exports !== "undefined") { @@ -3578,14 +3561,11 @@ exports[`Node polyfills babel transforms example test case: browser-experimental _exports.Example = Example; }); //# sourceMappingURL=index-browser-experimental-umd.js.map -", -] +" `; -exports[`Node polyfills babel transforms example test case: browser-legacy-esm 1`] = ` -[ - "esm/index-browser-legacy-esm.js", - "function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +exports[`Node polyfills > babel > transforms example test case: browser-legacy-esm > esm/index-browser-legacy-esm.js 1`] = ` +"function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); } @@ -4188,14 +4168,11 @@ var Example = /*#__PURE__*/function (_EventEmitter) { }(EventEmitter); export { Example, emitter, test }; //# sourceMappingURL=index-browser-legacy-esm.js.map -", -] +" `; -exports[`Node polyfills babel transforms example test case: browser-legacy-lib 1`] = ` -[ - "lib/index-browser-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > babel > transforms example test case: browser-legacy-lib > lib/index-browser-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: lib 'use strict'; @@ -4802,14 +4779,11 @@ exports.Example = Example; exports.emitter = emitter; exports.test = test; //# sourceMappingURL=index-browser-legacy-lib.js.map -", -] +" `; -exports[`Node polyfills babel transforms example test case: browser-legacy-umd 1`] = ` -[ - "umd/index-browser-legacy-umd.js", - "(function (global, factory) { +exports[`Node polyfills > babel > transforms example test case: browser-legacy-umd > umd/index-browser-legacy-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports"], factory); } else if (typeof exports !== "undefined") { @@ -5431,14 +5405,11 @@ exports[`Node polyfills babel transforms example test case: browser-legacy-umd 1 }(EventEmitter); }); //# sourceMappingURL=index-browser-legacy-umd.js.map -", -] +" `; -exports[`Node polyfills babel transforms example test case: browser-stable-esm 1`] = ` -[ - "esm/index-browser-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > babel > transforms example test case: browser-stable-esm > esm/index-browser-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: esm var domain; @@ -6020,14 +5991,11 @@ class Example extends EventEmitter { } export { Example, emitter, test }; //# sourceMappingURL=index-browser-stable-esm.js.map -", -] +" `; -exports[`Node polyfills babel transforms example test case: browser-stable-lib 1`] = ` -[ - "lib/index-browser-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > babel > transforms example test case: browser-stable-lib > lib/index-browser-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: lib 'use strict'; @@ -6613,14 +6581,11 @@ exports.Example = Example; exports.emitter = emitter; exports.test = test; //# sourceMappingURL=index-browser-stable-lib.js.map -", -] +" `; -exports[`Node polyfills babel transforms example test case: browser-stable-umd 1`] = ` -[ - "umd/index-browser-stable-umd.js", - "(function (global, factory) { +exports[`Node polyfills > babel > transforms example test case: browser-stable-umd > umd/index-browser-stable-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports"], factory); } else if (typeof exports !== "undefined") { @@ -7222,14 +7187,11 @@ exports[`Node polyfills babel transforms example test case: browser-stable-umd 1 _exports.Example = Example; }); //# sourceMappingURL=index-browser-stable-umd.js.map -", -] +" `; -exports[`Node polyfills babel transforms example test case: electron-current-esm 1`] = ` -[ - "esm/index-electron-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > babel > transforms example test case: electron-current-esm > esm/index-electron-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: esm var domain; @@ -7811,14 +7773,11 @@ class Example extends EventEmitter { } export { Example, emitter, test }; //# sourceMappingURL=index-electron-current-esm.js.map -", -] +" `; -exports[`Node polyfills babel transforms example test case: electron-current-lib 1`] = ` -[ - "lib/index-electron-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > babel > transforms example test case: electron-current-lib > lib/index-electron-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: lib 'use strict'; @@ -8404,14 +8363,11 @@ exports.Example = Example; exports.emitter = emitter; exports.test = test; //# sourceMappingURL=index-electron-current-lib.js.map -", -] +" `; -exports[`Node polyfills babel transforms example test case: electron-experimental-esm 1`] = ` -[ - "esm/index-electron-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > babel > transforms example test case: electron-experimental-esm > esm/index-electron-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: esm var domain; @@ -8993,14 +8949,11 @@ class Example extends EventEmitter { } export { Example, emitter, test }; //# sourceMappingURL=index-electron-experimental-esm.js.map -", -] +" `; -exports[`Node polyfills babel transforms example test case: electron-experimental-lib 1`] = ` -[ - "lib/index-electron-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > babel > transforms example test case: electron-experimental-lib > lib/index-electron-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: lib 'use strict'; @@ -9586,14 +9539,11 @@ exports.Example = Example; exports.emitter = emitter; exports.test = test; //# sourceMappingURL=index-electron-experimental-lib.js.map -", -] +" `; -exports[`Node polyfills babel transforms example test case: electron-legacy-esm 1`] = ` -[ - "esm/index-electron-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > babel > transforms example test case: electron-legacy-esm > esm/index-electron-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: esm var domain; @@ -10175,14 +10125,11 @@ class Example extends EventEmitter { } export { Example, emitter, test }; //# sourceMappingURL=index-electron-legacy-esm.js.map -", -] +" `; -exports[`Node polyfills babel transforms example test case: electron-legacy-lib 1`] = ` -[ - "lib/index-electron-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > babel > transforms example test case: electron-legacy-lib > lib/index-electron-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: lib 'use strict'; @@ -10768,14 +10715,11 @@ exports.Example = Example; exports.emitter = emitter; exports.test = test; //# sourceMappingURL=index-electron-legacy-lib.js.map -", -] +" `; -exports[`Node polyfills babel transforms example test case: electron-stable-esm 1`] = ` -[ - "esm/index-electron-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > babel > transforms example test case: electron-stable-esm > esm/index-electron-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: esm var domain; @@ -11357,14 +11301,11 @@ class Example extends EventEmitter { } export { Example, emitter, test }; //# sourceMappingURL=index-electron-stable-esm.js.map -", -] +" `; -exports[`Node polyfills babel transforms example test case: electron-stable-lib 1`] = ` -[ - "lib/index-electron-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > babel > transforms example test case: electron-stable-lib > lib/index-electron-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: lib 'use strict'; @@ -11950,14 +11891,11 @@ exports.Example = Example; exports.emitter = emitter; exports.test = test; //# sourceMappingURL=index-electron-stable-lib.js.map -", -] +" `; -exports[`Node polyfills babel transforms example test case: native-current-lib 1`] = ` -[ - "lib/index-native-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > babel > transforms example test case: native-current-lib > lib/index-native-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: current, Format: lib 'use strict'; @@ -12543,14 +12481,11 @@ exports.Example = Example; exports.emitter = emitter; exports.test = test; //# sourceMappingURL=index-native-current-lib.js.map -", -] +" `; -exports[`Node polyfills babel transforms example test case: native-experimental-lib 1`] = ` -[ - "lib/index-native-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > babel > transforms example test case: native-experimental-lib > lib/index-native-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: experimental, Format: lib 'use strict'; @@ -13136,14 +13071,11 @@ exports.Example = Example; exports.emitter = emitter; exports.test = test; //# sourceMappingURL=index-native-experimental-lib.js.map -", -] +" `; -exports[`Node polyfills babel transforms example test case: native-legacy-lib 1`] = ` -[ - "lib/index-native-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > babel > transforms example test case: native-legacy-lib > lib/index-native-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: legacy, Format: lib 'use strict'; @@ -13729,14 +13661,11 @@ exports.Example = Example; exports.emitter = emitter; exports.test = test; //# sourceMappingURL=index-native-legacy-lib.js.map -", -] +" `; -exports[`Node polyfills babel transforms example test case: native-stable-lib 1`] = ` -[ - "lib/index-native-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > babel > transforms example test case: native-stable-lib > lib/index-native-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: stable, Format: lib 'use strict'; @@ -14322,26 +14251,11 @@ exports.Example = Example; exports.emitter = emitter; exports.test = test; //# sourceMappingURL=index-native-stable-lib.js.map -", -] +" `; -exports[`Node polyfills babel transforms example test case: node-current-cjs 1`] = ` -[ - "cjs/index-node-current-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-current-cjs.cjs'; - -export const { Example, emitter, test } = data;", -] -`; - -exports[`Node polyfills babel transforms example test case: node-current-cjs 2`] = ` -[ - "cjs/index-node-current-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > babel > transforms example test case: node-current-cjs > cjs/index-node-current-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: cjs 'use strict'; @@ -14361,14 +14275,20 @@ exports.Example = Example; exports.emitter = emitter; exports.test = test; //# sourceMappingURL=index-node-current-cjs.cjs.map -", -] +" +`; + +exports[`Node polyfills > babel > transforms example test case: node-current-cjs > cjs/index-node-current-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-current-cjs.cjs'; + +export const { Example, emitter, test } = data;" `; -exports[`Node polyfills babel transforms example test case: node-current-lib 1`] = ` -[ - "lib/index-node-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > babel > transforms example test case: node-current-lib > lib/index-node-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: lib 'use strict'; @@ -14388,14 +14308,11 @@ exports.Example = Example; exports.emitter = emitter; exports.test = test; //# sourceMappingURL=index-node-current-lib.js.map -", -] +" `; -exports[`Node polyfills babel transforms example test case: node-current-mjs 1`] = ` -[ - "mjs/index-node-current-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > babel > transforms example test case: node-current-mjs > mjs/index-node-current-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: mjs import { EventEmitter } from 'node:events'; @@ -14407,26 +14324,11 @@ class Example extends EventEmitter { } export { Example, emitter, test }; //# sourceMappingURL=index-node-current-mjs.mjs.map -", -] +" `; -exports[`Node polyfills babel transforms example test case: node-experimental-cjs 1`] = ` -[ - "cjs/index-node-experimental-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-experimental-cjs.cjs'; - -export const { Example, emitter, test } = data;", -] -`; - -exports[`Node polyfills babel transforms example test case: node-experimental-cjs 2`] = ` -[ - "cjs/index-node-experimental-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > babel > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: cjs 'use strict'; @@ -14446,14 +14348,20 @@ exports.Example = Example; exports.emitter = emitter; exports.test = test; //# sourceMappingURL=index-node-experimental-cjs.cjs.map -", -] +" +`; + +exports[`Node polyfills > babel > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-experimental-cjs.cjs'; + +export const { Example, emitter, test } = data;" `; -exports[`Node polyfills babel transforms example test case: node-experimental-lib 1`] = ` -[ - "lib/index-node-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > babel > transforms example test case: node-experimental-lib > lib/index-node-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: lib 'use strict'; @@ -14473,14 +14381,11 @@ exports.Example = Example; exports.emitter = emitter; exports.test = test; //# sourceMappingURL=index-node-experimental-lib.js.map -", -] +" `; -exports[`Node polyfills babel transforms example test case: node-experimental-mjs 1`] = ` -[ - "mjs/index-node-experimental-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > babel > transforms example test case: node-experimental-mjs > mjs/index-node-experimental-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: mjs import { EventEmitter } from 'node:events'; @@ -14492,26 +14397,11 @@ class Example extends EventEmitter { } export { Example, emitter, test }; //# sourceMappingURL=index-node-experimental-mjs.mjs.map -", -] +" `; -exports[`Node polyfills babel transforms example test case: node-legacy-cjs 1`] = ` -[ - "cjs/index-node-legacy-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-legacy-cjs.cjs'; - -export const { Example, emitter, test } = data;", -] -`; - -exports[`Node polyfills babel transforms example test case: node-legacy-cjs 2`] = ` -[ - "cjs/index-node-legacy-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > babel > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: cjs 'use strict'; @@ -14531,14 +14421,20 @@ exports.Example = Example; exports.emitter = emitter; exports.test = test; //# sourceMappingURL=index-node-legacy-cjs.cjs.map -", -] +" +`; + +exports[`Node polyfills > babel > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-legacy-cjs.cjs'; + +export const { Example, emitter, test } = data;" `; -exports[`Node polyfills babel transforms example test case: node-legacy-lib 1`] = ` -[ - "lib/index-node-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > babel > transforms example test case: node-legacy-lib > lib/index-node-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: lib 'use strict'; @@ -14558,14 +14454,11 @@ exports.Example = Example; exports.emitter = emitter; exports.test = test; //# sourceMappingURL=index-node-legacy-lib.js.map -", -] +" `; -exports[`Node polyfills babel transforms example test case: node-legacy-mjs 1`] = ` -[ - "mjs/index-node-legacy-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > babel > transforms example test case: node-legacy-mjs > mjs/index-node-legacy-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: mjs import { EventEmitter } from 'events'; @@ -14577,26 +14470,11 @@ class Example extends EventEmitter { } export { Example, emitter, test }; //# sourceMappingURL=index-node-legacy-mjs.mjs.map -", -] +" `; -exports[`Node polyfills babel transforms example test case: node-stable-cjs 1`] = ` -[ - "cjs/index-node-stable-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-stable-cjs.cjs'; - -export const { Example, emitter, test } = data;", -] -`; - -exports[`Node polyfills babel transforms example test case: node-stable-cjs 2`] = ` -[ - "cjs/index-node-stable-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > babel > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: cjs 'use strict'; @@ -14616,14 +14494,20 @@ exports.Example = Example; exports.emitter = emitter; exports.test = test; //# sourceMappingURL=index-node-stable-cjs.cjs.map -", -] +" +`; + +exports[`Node polyfills > babel > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-stable-cjs.cjs'; + +export const { Example, emitter, test } = data;" `; -exports[`Node polyfills babel transforms example test case: node-stable-lib 1`] = ` -[ - "lib/index-node-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > babel > transforms example test case: node-stable-lib > lib/index-node-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: lib 'use strict'; @@ -14643,14 +14527,11 @@ exports.Example = Example; exports.emitter = emitter; exports.test = test; //# sourceMappingURL=index-node-stable-lib.js.map -", -] +" `; -exports[`Node polyfills babel transforms example test case: node-stable-mjs 1`] = ` -[ - "mjs/index-node-stable-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > babel > transforms example test case: node-stable-mjs > mjs/index-node-stable-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: mjs import { EventEmitter } from 'node:events'; @@ -14662,14 +14543,11 @@ class Example extends EventEmitter { } export { Example, emitter, test }; //# sourceMappingURL=index-node-stable-mjs.mjs.map -", -] +" `; -exports[`Node polyfills swc transforms example test case: browser-current-esm 1`] = ` -[ - "esm/index-browser-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > swc > transforms example test case: browser-current-esm > esm/index-browser-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: esm var domain; // This constructor is used to store event handlers. Instantiating this is @@ -15241,14 +15119,11 @@ let Example = class Example extends EventEmitter { }; export { Example, emitter, test }; //# sourceMappingURL=index-browser-current-esm.js.map -", -] +" `; -exports[`Node polyfills swc transforms example test case: browser-current-lib 1`] = ` -[ - "lib/index-browser-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > swc > transforms example test case: browser-current-lib > lib/index-browser-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: lib "use strict"; var domain; @@ -15823,14 +15698,11 @@ exports.Example = Example; exports.emitter = emitter; exports.test = test; //# sourceMappingURL=index-browser-current-lib.js.map -", -] +" `; -exports[`Node polyfills swc transforms example test case: browser-current-umd 1`] = ` -[ - "umd/index-browser-current-umd.js", - "(function(global, factory) { +exports[`Node polyfills > swc > transforms example test case: browser-current-umd > umd/index-browser-current-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports); else if (typeof define === "function" && define.amd) define([ "exports" @@ -16428,14 +16300,11 @@ exports[`Node polyfills swc transforms example test case: browser-current-umd 1` }; }); //# sourceMappingURL=index-browser-current-umd.js.map -", -] +" `; -exports[`Node polyfills swc transforms example test case: browser-experimental-esm 1`] = ` -[ - "esm/index-browser-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > swc > transforms example test case: browser-experimental-esm > esm/index-browser-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: esm var domain; // This constructor is used to store event handlers. Instantiating this is @@ -17007,14 +16876,11 @@ let Example = class Example extends EventEmitter { }; export { Example, emitter, test }; //# sourceMappingURL=index-browser-experimental-esm.js.map -", -] +" `; -exports[`Node polyfills swc transforms example test case: browser-experimental-lib 1`] = ` -[ - "lib/index-browser-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > swc > transforms example test case: browser-experimental-lib > lib/index-browser-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: lib "use strict"; var domain; @@ -17589,14 +17455,11 @@ exports.Example = Example; exports.emitter = emitter; exports.test = test; //# sourceMappingURL=index-browser-experimental-lib.js.map -", -] +" `; -exports[`Node polyfills swc transforms example test case: browser-experimental-umd 1`] = ` -[ - "umd/index-browser-experimental-umd.js", - "(function(global, factory) { +exports[`Node polyfills > swc > transforms example test case: browser-experimental-umd > umd/index-browser-experimental-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports); else if (typeof define === "function" && define.amd) define([ "exports" @@ -18194,14 +18057,11 @@ exports[`Node polyfills swc transforms example test case: browser-experimental-u }; }); //# sourceMappingURL=index-browser-experimental-umd.js.map -", -] +" `; -exports[`Node polyfills swc transforms example test case: browser-legacy-esm 1`] = ` -[ - "esm/index-browser-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > swc > transforms example test case: browser-legacy-esm > esm/index-browser-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: esm function _assert_this_initialized(self) { if (self === void 0) { @@ -18871,14 +18731,11 @@ var Example = /*#__PURE__*/ function(EventEmitter) { }(EventEmitter); export { Example, emitter, test }; //# sourceMappingURL=index-browser-legacy-esm.js.map -", -] +" `; -exports[`Node polyfills swc transforms example test case: browser-legacy-lib 1`] = ` -[ - "lib/index-browser-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > swc > transforms example test case: browser-legacy-lib > lib/index-browser-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: lib "use strict"; function _assert_this_initialized(self) { @@ -19550,14 +19407,11 @@ exports.Example = Example; exports.emitter = emitter; exports.test = test; //# sourceMappingURL=index-browser-legacy-lib.js.map -", -] +" `; -exports[`Node polyfills swc transforms example test case: browser-legacy-umd 1`] = ` -[ - "umd/index-browser-legacy-umd.js", - "(function(global, factory) { +exports[`Node polyfills > swc > transforms example test case: browser-legacy-umd > umd/index-browser-legacy-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports); else if (typeof define === "function" && define.amd) define([ "exports" @@ -20253,14 +20107,11 @@ exports[`Node polyfills swc transforms example test case: browser-legacy-umd 1`] }(EventEmitter); }); //# sourceMappingURL=index-browser-legacy-umd.js.map -", -] +" `; -exports[`Node polyfills swc transforms example test case: browser-stable-esm 1`] = ` -[ - "esm/index-browser-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > swc > transforms example test case: browser-stable-esm > esm/index-browser-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: esm var domain; // This constructor is used to store event handlers. Instantiating this is @@ -20832,14 +20683,11 @@ let Example = class Example extends EventEmitter { }; export { Example, emitter, test }; //# sourceMappingURL=index-browser-stable-esm.js.map -", -] +" `; -exports[`Node polyfills swc transforms example test case: browser-stable-lib 1`] = ` -[ - "lib/index-browser-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > swc > transforms example test case: browser-stable-lib > lib/index-browser-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: lib "use strict"; var domain; @@ -21414,14 +21262,11 @@ exports.Example = Example; exports.emitter = emitter; exports.test = test; //# sourceMappingURL=index-browser-stable-lib.js.map -", -] +" `; -exports[`Node polyfills swc transforms example test case: browser-stable-umd 1`] = ` -[ - "umd/index-browser-stable-umd.js", - "(function(global, factory) { +exports[`Node polyfills > swc > transforms example test case: browser-stable-umd > umd/index-browser-stable-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports); else if (typeof define === "function" && define.amd) define([ "exports" @@ -22019,14 +21864,11 @@ exports[`Node polyfills swc transforms example test case: browser-stable-umd 1`] }; }); //# sourceMappingURL=index-browser-stable-umd.js.map -", -] +" `; -exports[`Node polyfills swc transforms example test case: electron-current-esm 1`] = ` -[ - "esm/index-electron-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > swc > transforms example test case: electron-current-esm > esm/index-electron-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: esm var domain; // This constructor is used to store event handlers. Instantiating this is @@ -22598,14 +22440,11 @@ let Example = class Example extends EventEmitter { }; export { Example, emitter, test }; //# sourceMappingURL=index-electron-current-esm.js.map -", -] +" `; -exports[`Node polyfills swc transforms example test case: electron-current-lib 1`] = ` -[ - "lib/index-electron-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > swc > transforms example test case: electron-current-lib > lib/index-electron-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: lib "use strict"; var domain; @@ -23180,14 +23019,11 @@ exports.Example = Example; exports.emitter = emitter; exports.test = test; //# sourceMappingURL=index-electron-current-lib.js.map -", -] +" `; -exports[`Node polyfills swc transforms example test case: electron-experimental-esm 1`] = ` -[ - "esm/index-electron-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > swc > transforms example test case: electron-experimental-esm > esm/index-electron-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: esm var domain; // This constructor is used to store event handlers. Instantiating this is @@ -23759,14 +23595,11 @@ let Example = class Example extends EventEmitter { }; export { Example, emitter, test }; //# sourceMappingURL=index-electron-experimental-esm.js.map -", -] +" `; -exports[`Node polyfills swc transforms example test case: electron-experimental-lib 1`] = ` -[ - "lib/index-electron-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > swc > transforms example test case: electron-experimental-lib > lib/index-electron-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: lib "use strict"; var domain; @@ -24341,14 +24174,11 @@ exports.Example = Example; exports.emitter = emitter; exports.test = test; //# sourceMappingURL=index-electron-experimental-lib.js.map -", -] +" `; -exports[`Node polyfills swc transforms example test case: electron-legacy-esm 1`] = ` -[ - "esm/index-electron-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > swc > transforms example test case: electron-legacy-esm > esm/index-electron-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: esm var domain; // This constructor is used to store event handlers. Instantiating this is @@ -24920,14 +24750,11 @@ let Example = class Example extends EventEmitter { }; export { Example, emitter, test }; //# sourceMappingURL=index-electron-legacy-esm.js.map -", -] +" `; -exports[`Node polyfills swc transforms example test case: electron-legacy-lib 1`] = ` -[ - "lib/index-electron-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > swc > transforms example test case: electron-legacy-lib > lib/index-electron-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: lib "use strict"; var domain; @@ -25502,14 +25329,11 @@ exports.Example = Example; exports.emitter = emitter; exports.test = test; //# sourceMappingURL=index-electron-legacy-lib.js.map -", -] +" `; -exports[`Node polyfills swc transforms example test case: electron-stable-esm 1`] = ` -[ - "esm/index-electron-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > swc > transforms example test case: electron-stable-esm > esm/index-electron-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: esm var domain; // This constructor is used to store event handlers. Instantiating this is @@ -26081,14 +25905,11 @@ let Example = class Example extends EventEmitter { }; export { Example, emitter, test }; //# sourceMappingURL=index-electron-stable-esm.js.map -", -] +" `; -exports[`Node polyfills swc transforms example test case: electron-stable-lib 1`] = ` -[ - "lib/index-electron-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > swc > transforms example test case: electron-stable-lib > lib/index-electron-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: lib "use strict"; var domain; @@ -26663,14 +26484,11 @@ exports.Example = Example; exports.emitter = emitter; exports.test = test; //# sourceMappingURL=index-electron-stable-lib.js.map -", -] +" `; -exports[`Node polyfills swc transforms example test case: native-current-lib 1`] = ` -[ - "lib/index-native-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > swc > transforms example test case: native-current-lib > lib/index-native-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: current, Format: lib "use strict"; var domain; @@ -27245,14 +27063,11 @@ exports.Example = Example; exports.emitter = emitter; exports.test = test; //# sourceMappingURL=index-native-current-lib.js.map -", -] +" `; -exports[`Node polyfills swc transforms example test case: native-experimental-lib 1`] = ` -[ - "lib/index-native-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > swc > transforms example test case: native-experimental-lib > lib/index-native-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: experimental, Format: lib "use strict"; var domain; @@ -27827,14 +27642,11 @@ exports.Example = Example; exports.emitter = emitter; exports.test = test; //# sourceMappingURL=index-native-experimental-lib.js.map -", -] +" `; -exports[`Node polyfills swc transforms example test case: native-legacy-lib 1`] = ` -[ - "lib/index-native-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > swc > transforms example test case: native-legacy-lib > lib/index-native-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: legacy, Format: lib "use strict"; var domain; @@ -28409,14 +28221,11 @@ exports.Example = Example; exports.emitter = emitter; exports.test = test; //# sourceMappingURL=index-native-legacy-lib.js.map -", -] +" `; -exports[`Node polyfills swc transforms example test case: native-stable-lib 1`] = ` -[ - "lib/index-native-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > swc > transforms example test case: native-stable-lib > lib/index-native-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: stable, Format: lib "use strict"; var domain; @@ -28991,26 +28800,11 @@ exports.Example = Example; exports.emitter = emitter; exports.test = test; //# sourceMappingURL=index-native-stable-lib.js.map -", -] +" `; -exports[`Node polyfills swc transforms example test case: node-current-cjs 1`] = ` -[ - "cjs/index-node-current-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-current-cjs.cjs'; - -export const { Example, emitter, test } = data;", -] -`; - -exports[`Node polyfills swc transforms example test case: node-current-cjs 2`] = ` -[ - "cjs/index-node-current-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > swc > transforms example test case: node-current-cjs > cjs/index-node-current-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: cjs "use strict"; const node_events = require("node:events"); @@ -29028,14 +28822,20 @@ exports.Example = Example; exports.emitter = emitter; exports.test = test; //# sourceMappingURL=index-node-current-cjs.cjs.map -", -] +" +`; + +exports[`Node polyfills > swc > transforms example test case: node-current-cjs > cjs/index-node-current-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-current-cjs.cjs'; + +export const { Example, emitter, test } = data;" `; -exports[`Node polyfills swc transforms example test case: node-current-lib 1`] = ` -[ - "lib/index-node-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > swc > transforms example test case: node-current-lib > lib/index-node-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: lib "use strict"; const node_events = require("node:events"); @@ -29053,14 +28853,11 @@ exports.Example = Example; exports.emitter = emitter; exports.test = test; //# sourceMappingURL=index-node-current-lib.js.map -", -] +" `; -exports[`Node polyfills swc transforms example test case: node-current-mjs 1`] = ` -[ - "mjs/index-node-current-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > swc > transforms example test case: node-current-mjs > mjs/index-node-current-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: mjs import { EventEmitter } from "node:events"; import path from "node:path"; @@ -29071,26 +28868,11 @@ let Example = class Example extends EventEmitter { }; export { Example, emitter, test }; //# sourceMappingURL=index-node-current-mjs.mjs.map -", -] +" `; -exports[`Node polyfills swc transforms example test case: node-experimental-cjs 1`] = ` -[ - "cjs/index-node-experimental-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-experimental-cjs.cjs'; - -export const { Example, emitter, test } = data;", -] -`; - -exports[`Node polyfills swc transforms example test case: node-experimental-cjs 2`] = ` -[ - "cjs/index-node-experimental-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > swc > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: cjs "use strict"; const node_events = require("node:events"); @@ -29108,14 +28890,20 @@ exports.Example = Example; exports.emitter = emitter; exports.test = test; //# sourceMappingURL=index-node-experimental-cjs.cjs.map -", -] +" +`; + +exports[`Node polyfills > swc > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-experimental-cjs.cjs'; + +export const { Example, emitter, test } = data;" `; -exports[`Node polyfills swc transforms example test case: node-experimental-lib 1`] = ` -[ - "lib/index-node-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > swc > transforms example test case: node-experimental-lib > lib/index-node-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: lib "use strict"; const node_events = require("node:events"); @@ -29133,14 +28921,11 @@ exports.Example = Example; exports.emitter = emitter; exports.test = test; //# sourceMappingURL=index-node-experimental-lib.js.map -", -] +" `; -exports[`Node polyfills swc transforms example test case: node-experimental-mjs 1`] = ` -[ - "mjs/index-node-experimental-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > swc > transforms example test case: node-experimental-mjs > mjs/index-node-experimental-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: mjs import { EventEmitter } from "node:events"; import path from "node:path"; @@ -29151,26 +28936,11 @@ let Example = class Example extends EventEmitter { }; export { Example, emitter, test }; //# sourceMappingURL=index-node-experimental-mjs.mjs.map -", -] +" `; -exports[`Node polyfills swc transforms example test case: node-legacy-cjs 1`] = ` -[ - "cjs/index-node-legacy-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-legacy-cjs.cjs'; - -export const { Example, emitter, test } = data;", -] -`; - -exports[`Node polyfills swc transforms example test case: node-legacy-cjs 2`] = ` -[ - "cjs/index-node-legacy-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > swc > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: cjs "use strict"; const events = require("events"); @@ -29188,14 +28958,20 @@ exports.Example = Example; exports.emitter = emitter; exports.test = test; //# sourceMappingURL=index-node-legacy-cjs.cjs.map -", -] +" +`; + +exports[`Node polyfills > swc > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-legacy-cjs.cjs'; + +export const { Example, emitter, test } = data;" `; -exports[`Node polyfills swc transforms example test case: node-legacy-lib 1`] = ` -[ - "lib/index-node-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > swc > transforms example test case: node-legacy-lib > lib/index-node-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: lib "use strict"; const events = require("events"); @@ -29213,14 +28989,11 @@ exports.Example = Example; exports.emitter = emitter; exports.test = test; //# sourceMappingURL=index-node-legacy-lib.js.map -", -] +" `; -exports[`Node polyfills swc transforms example test case: node-legacy-mjs 1`] = ` -[ - "mjs/index-node-legacy-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > swc > transforms example test case: node-legacy-mjs > mjs/index-node-legacy-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: mjs import { EventEmitter } from "events"; import path from "path"; @@ -29231,26 +29004,11 @@ let Example = class Example extends EventEmitter { }; export { Example, emitter, test }; //# sourceMappingURL=index-node-legacy-mjs.mjs.map -", -] +" `; -exports[`Node polyfills swc transforms example test case: node-stable-cjs 1`] = ` -[ - "cjs/index-node-stable-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-stable-cjs.cjs'; - -export const { Example, emitter, test } = data;", -] -`; - -exports[`Node polyfills swc transforms example test case: node-stable-cjs 2`] = ` -[ - "cjs/index-node-stable-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > swc > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: cjs "use strict"; const node_events = require("node:events"); @@ -29268,14 +29026,20 @@ exports.Example = Example; exports.emitter = emitter; exports.test = test; //# sourceMappingURL=index-node-stable-cjs.cjs.map -", -] +" +`; + +exports[`Node polyfills > swc > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-stable-cjs.cjs'; + +export const { Example, emitter, test } = data;" `; -exports[`Node polyfills swc transforms example test case: node-stable-lib 1`] = ` -[ - "lib/index-node-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > swc > transforms example test case: node-stable-lib > lib/index-node-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: lib "use strict"; const node_events = require("node:events"); @@ -29293,14 +29057,11 @@ exports.Example = Example; exports.emitter = emitter; exports.test = test; //# sourceMappingURL=index-node-stable-lib.js.map -", -] +" `; -exports[`Node polyfills swc transforms example test case: node-stable-mjs 1`] = ` -[ - "mjs/index-node-stable-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Node polyfills > swc > transforms example test case: node-stable-mjs > mjs/index-node-stable-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: mjs import { EventEmitter } from "node:events"; import path from "node:path"; @@ -29311,6 +29072,5 @@ let Example = class Example extends EventEmitter { }; export { Example, emitter, test }; //# sourceMappingURL=index-node-stable-mjs.mjs.map -", -] +" `; diff --git a/packages/packemon/tests/examples/__snapshots__/react.test.ts.snap b/packages/packemon/tests/examples/__snapshots__/react.test.ts.snap index e3bf0915f..91c0c371e 100644 --- a/packages/packemon/tests/examples/__snapshots__/react.test.ts.snap +++ b/packages/packemon/tests/examples/__snapshots__/react.test.ts.snap @@ -1,9 +1,7 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`React/JSX babel transforms example test case: browser-current-esm 1`] = ` -[ - "esm/index-browser-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > babel > transforms example test case: browser-current-esm > esm/index-browser-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: esm import { jsx } from 'react/jsx-runtime'; @@ -12,14 +10,11 @@ function Button() { } export { Button as default }; //# sourceMappingURL=index-browser-current-esm.js.map -", -] +" `; -exports[`React/JSX babel transforms example test case: browser-current-lib 1`] = ` -[ - "lib/index-browser-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > babel > transforms example test case: browser-current-lib > lib/index-browser-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: lib 'use strict'; @@ -30,14 +25,11 @@ function Button() { } module.exports = Button; //# sourceMappingURL=index-browser-current-lib.js.map -", -] +" `; -exports[`React/JSX babel transforms example test case: browser-current-umd 1`] = ` -[ - "umd/index-browser-current-umd.js", - "(function (global, factory) { +exports[`React/JSX > babel > transforms example test case: browser-current-umd > umd/index-browser-current-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports", "react/jsx-runtime"], factory); } else if (typeof exports !== "undefined") { @@ -64,14 +56,11 @@ exports[`React/JSX babel transforms example test case: browser-current-umd 1`] = } }); //# sourceMappingURL=index-browser-current-umd.js.map -", -] +" `; -exports[`React/JSX babel transforms example test case: browser-experimental-esm 1`] = ` -[ - "esm/index-browser-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > babel > transforms example test case: browser-experimental-esm > esm/index-browser-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: esm import { jsx } from 'react/jsx-runtime'; @@ -80,14 +69,11 @@ function Button() { } export { Button as default }; //# sourceMappingURL=index-browser-experimental-esm.js.map -", -] +" `; -exports[`React/JSX babel transforms example test case: browser-experimental-lib 1`] = ` -[ - "lib/index-browser-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > babel > transforms example test case: browser-experimental-lib > lib/index-browser-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: lib 'use strict'; @@ -98,14 +84,11 @@ function Button() { } module.exports = Button; //# sourceMappingURL=index-browser-experimental-lib.js.map -", -] +" `; -exports[`React/JSX babel transforms example test case: browser-experimental-umd 1`] = ` -[ - "umd/index-browser-experimental-umd.js", - "(function (global, factory) { +exports[`React/JSX > babel > transforms example test case: browser-experimental-umd > umd/index-browser-experimental-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports", "react/jsx-runtime"], factory); } else if (typeof exports !== "undefined") { @@ -132,14 +115,11 @@ exports[`React/JSX babel transforms example test case: browser-experimental-umd } }); //# sourceMappingURL=index-browser-experimental-umd.js.map -", -] +" `; -exports[`React/JSX babel transforms example test case: browser-legacy-esm 1`] = ` -[ - "esm/index-browser-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > babel > transforms example test case: browser-legacy-esm > esm/index-browser-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: esm import { jsx } from 'react/jsx-runtime'; @@ -148,14 +128,11 @@ function Button() { } export { Button as default }; //# sourceMappingURL=index-browser-legacy-esm.js.map -", -] +" `; -exports[`React/JSX babel transforms example test case: browser-legacy-lib 1`] = ` -[ - "lib/index-browser-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > babel > transforms example test case: browser-legacy-lib > lib/index-browser-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: lib 'use strict'; @@ -166,14 +143,11 @@ function Button() { } module.exports = Button; //# sourceMappingURL=index-browser-legacy-lib.js.map -", -] +" `; -exports[`React/JSX babel transforms example test case: browser-legacy-umd 1`] = ` -[ - "umd/index-browser-legacy-umd.js", - "(function (global, factory) { +exports[`React/JSX > babel > transforms example test case: browser-legacy-umd > umd/index-browser-legacy-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports", "react/jsx-runtime"], factory); } else if (typeof exports !== "undefined") { @@ -200,14 +174,11 @@ exports[`React/JSX babel transforms example test case: browser-legacy-umd 1`] = } }); //# sourceMappingURL=index-browser-legacy-umd.js.map -", -] +" `; -exports[`React/JSX babel transforms example test case: browser-stable-esm 1`] = ` -[ - "esm/index-browser-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > babel > transforms example test case: browser-stable-esm > esm/index-browser-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: esm import { jsx } from 'react/jsx-runtime'; @@ -216,14 +187,11 @@ function Button() { } export { Button as default }; //# sourceMappingURL=index-browser-stable-esm.js.map -", -] +" `; -exports[`React/JSX babel transforms example test case: browser-stable-lib 1`] = ` -[ - "lib/index-browser-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > babel > transforms example test case: browser-stable-lib > lib/index-browser-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: lib 'use strict'; @@ -234,14 +202,11 @@ function Button() { } module.exports = Button; //# sourceMappingURL=index-browser-stable-lib.js.map -", -] +" `; -exports[`React/JSX babel transforms example test case: browser-stable-umd 1`] = ` -[ - "umd/index-browser-stable-umd.js", - "(function (global, factory) { +exports[`React/JSX > babel > transforms example test case: browser-stable-umd > umd/index-browser-stable-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports", "react/jsx-runtime"], factory); } else if (typeof exports !== "undefined") { @@ -268,14 +233,11 @@ exports[`React/JSX babel transforms example test case: browser-stable-umd 1`] = } }); //# sourceMappingURL=index-browser-stable-umd.js.map -", -] +" `; -exports[`React/JSX babel transforms example test case: electron-current-esm 1`] = ` -[ - "esm/index-electron-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > babel > transforms example test case: electron-current-esm > esm/index-electron-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: esm import { jsx } from 'react/jsx-runtime'; @@ -284,14 +246,11 @@ function Button() { } export { Button as default }; //# sourceMappingURL=index-electron-current-esm.js.map -", -] +" `; -exports[`React/JSX babel transforms example test case: electron-current-lib 1`] = ` -[ - "lib/index-electron-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > babel > transforms example test case: electron-current-lib > lib/index-electron-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: lib 'use strict'; @@ -302,14 +261,11 @@ function Button() { } module.exports = Button; //# sourceMappingURL=index-electron-current-lib.js.map -", -] +" `; -exports[`React/JSX babel transforms example test case: electron-experimental-esm 1`] = ` -[ - "esm/index-electron-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > babel > transforms example test case: electron-experimental-esm > esm/index-electron-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: esm import { jsx } from 'react/jsx-runtime'; @@ -318,14 +274,11 @@ function Button() { } export { Button as default }; //# sourceMappingURL=index-electron-experimental-esm.js.map -", -] +" `; -exports[`React/JSX babel transforms example test case: electron-experimental-lib 1`] = ` -[ - "lib/index-electron-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > babel > transforms example test case: electron-experimental-lib > lib/index-electron-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: lib 'use strict'; @@ -336,14 +289,11 @@ function Button() { } module.exports = Button; //# sourceMappingURL=index-electron-experimental-lib.js.map -", -] +" `; -exports[`React/JSX babel transforms example test case: electron-legacy-esm 1`] = ` -[ - "esm/index-electron-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > babel > transforms example test case: electron-legacy-esm > esm/index-electron-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: esm import { jsx } from 'react/jsx-runtime'; @@ -352,14 +302,11 @@ function Button() { } export { Button as default }; //# sourceMappingURL=index-electron-legacy-esm.js.map -", -] +" `; -exports[`React/JSX babel transforms example test case: electron-legacy-lib 1`] = ` -[ - "lib/index-electron-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > babel > transforms example test case: electron-legacy-lib > lib/index-electron-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: lib 'use strict'; @@ -370,14 +317,11 @@ function Button() { } module.exports = Button; //# sourceMappingURL=index-electron-legacy-lib.js.map -", -] +" `; -exports[`React/JSX babel transforms example test case: electron-stable-esm 1`] = ` -[ - "esm/index-electron-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > babel > transforms example test case: electron-stable-esm > esm/index-electron-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: esm import { jsx } from 'react/jsx-runtime'; @@ -386,14 +330,11 @@ function Button() { } export { Button as default }; //# sourceMappingURL=index-electron-stable-esm.js.map -", -] +" `; -exports[`React/JSX babel transforms example test case: electron-stable-lib 1`] = ` -[ - "lib/index-electron-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > babel > transforms example test case: electron-stable-lib > lib/index-electron-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: lib 'use strict'; @@ -404,14 +345,11 @@ function Button() { } module.exports = Button; //# sourceMappingURL=index-electron-stable-lib.js.map -", -] +" `; -exports[`React/JSX babel transforms example test case: native-current-lib 1`] = ` -[ - "lib/index-native-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > babel > transforms example test case: native-current-lib > lib/index-native-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: current, Format: lib 'use strict'; @@ -422,14 +360,11 @@ function Button() { } module.exports = Button; //# sourceMappingURL=index-native-current-lib.js.map -", -] +" `; -exports[`React/JSX babel transforms example test case: native-experimental-lib 1`] = ` -[ - "lib/index-native-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > babel > transforms example test case: native-experimental-lib > lib/index-native-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: experimental, Format: lib 'use strict'; @@ -440,14 +375,11 @@ function Button() { } module.exports = Button; //# sourceMappingURL=index-native-experimental-lib.js.map -", -] +" `; -exports[`React/JSX babel transforms example test case: native-legacy-lib 1`] = ` -[ - "lib/index-native-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > babel > transforms example test case: native-legacy-lib > lib/index-native-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: legacy, Format: lib 'use strict'; @@ -458,14 +390,11 @@ function Button() { } module.exports = Button; //# sourceMappingURL=index-native-legacy-lib.js.map -", -] +" `; -exports[`React/JSX babel transforms example test case: native-stable-lib 1`] = ` -[ - "lib/index-native-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > babel > transforms example test case: native-stable-lib > lib/index-native-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: stable, Format: lib 'use strict'; @@ -476,26 +405,11 @@ function Button() { } module.exports = Button; //# sourceMappingURL=index-native-stable-lib.js.map -", -] +" `; -exports[`React/JSX babel transforms example test case: node-current-cjs 1`] = ` -[ - "cjs/index-node-current-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-current-cjs.cjs'; - -export default data;", -] -`; - -exports[`React/JSX babel transforms example test case: node-current-cjs 2`] = ` -[ - "cjs/index-node-current-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > babel > transforms example test case: node-current-cjs > cjs/index-node-current-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: cjs 'use strict'; @@ -506,14 +420,20 @@ function Button() { } module.exports = Button; //# sourceMappingURL=index-node-current-cjs.cjs.map -", -] +" +`; + +exports[`React/JSX > babel > transforms example test case: node-current-cjs > cjs/index-node-current-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-current-cjs.cjs'; + +export default data;" `; -exports[`React/JSX babel transforms example test case: node-current-lib 1`] = ` -[ - "lib/index-node-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > babel > transforms example test case: node-current-lib > lib/index-node-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: lib 'use strict'; @@ -524,14 +444,11 @@ function Button() { } module.exports = Button; //# sourceMappingURL=index-node-current-lib.js.map -", -] +" `; -exports[`React/JSX babel transforms example test case: node-current-mjs 1`] = ` -[ - "mjs/index-node-current-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > babel > transforms example test case: node-current-mjs > mjs/index-node-current-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: mjs import { jsx } from 'react/jsx-runtime'; @@ -540,26 +457,11 @@ function Button() { } export { Button as default }; //# sourceMappingURL=index-node-current-mjs.mjs.map -", -] +" `; -exports[`React/JSX babel transforms example test case: node-experimental-cjs 1`] = ` -[ - "cjs/index-node-experimental-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-experimental-cjs.cjs'; - -export default data;", -] -`; - -exports[`React/JSX babel transforms example test case: node-experimental-cjs 2`] = ` -[ - "cjs/index-node-experimental-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > babel > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: cjs 'use strict'; @@ -570,14 +472,20 @@ function Button() { } module.exports = Button; //# sourceMappingURL=index-node-experimental-cjs.cjs.map -", -] +" +`; + +exports[`React/JSX > babel > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-experimental-cjs.cjs'; + +export default data;" `; -exports[`React/JSX babel transforms example test case: node-experimental-lib 1`] = ` -[ - "lib/index-node-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > babel > transforms example test case: node-experimental-lib > lib/index-node-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: lib 'use strict'; @@ -588,14 +496,11 @@ function Button() { } module.exports = Button; //# sourceMappingURL=index-node-experimental-lib.js.map -", -] +" `; -exports[`React/JSX babel transforms example test case: node-experimental-mjs 1`] = ` -[ - "mjs/index-node-experimental-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > babel > transforms example test case: node-experimental-mjs > mjs/index-node-experimental-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: mjs import { jsx } from 'react/jsx-runtime'; @@ -604,26 +509,11 @@ function Button() { } export { Button as default }; //# sourceMappingURL=index-node-experimental-mjs.mjs.map -", -] +" `; -exports[`React/JSX babel transforms example test case: node-legacy-cjs 1`] = ` -[ - "cjs/index-node-legacy-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-legacy-cjs.cjs'; - -export default data;", -] -`; - -exports[`React/JSX babel transforms example test case: node-legacy-cjs 2`] = ` -[ - "cjs/index-node-legacy-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > babel > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: cjs 'use strict'; @@ -634,14 +524,20 @@ function Button() { } module.exports = Button; //# sourceMappingURL=index-node-legacy-cjs.cjs.map -", -] +" +`; + +exports[`React/JSX > babel > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-legacy-cjs.cjs'; + +export default data;" `; -exports[`React/JSX babel transforms example test case: node-legacy-lib 1`] = ` -[ - "lib/index-node-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > babel > transforms example test case: node-legacy-lib > lib/index-node-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: lib 'use strict'; @@ -652,14 +548,11 @@ function Button() { } module.exports = Button; //# sourceMappingURL=index-node-legacy-lib.js.map -", -] +" `; -exports[`React/JSX babel transforms example test case: node-legacy-mjs 1`] = ` -[ - "mjs/index-node-legacy-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > babel > transforms example test case: node-legacy-mjs > mjs/index-node-legacy-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: mjs import { jsx } from 'react/jsx-runtime'; @@ -668,26 +561,11 @@ function Button() { } export { Button as default }; //# sourceMappingURL=index-node-legacy-mjs.mjs.map -", -] +" `; -exports[`React/JSX babel transforms example test case: node-stable-cjs 1`] = ` -[ - "cjs/index-node-stable-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-stable-cjs.cjs'; - -export default data;", -] -`; - -exports[`React/JSX babel transforms example test case: node-stable-cjs 2`] = ` -[ - "cjs/index-node-stable-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > babel > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: cjs 'use strict'; @@ -698,14 +576,20 @@ function Button() { } module.exports = Button; //# sourceMappingURL=index-node-stable-cjs.cjs.map -", -] +" +`; + +exports[`React/JSX > babel > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-stable-cjs.cjs'; + +export default data;" `; -exports[`React/JSX babel transforms example test case: node-stable-lib 1`] = ` -[ - "lib/index-node-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > babel > transforms example test case: node-stable-lib > lib/index-node-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: lib 'use strict'; @@ -716,14 +600,11 @@ function Button() { } module.exports = Button; //# sourceMappingURL=index-node-stable-lib.js.map -", -] +" `; -exports[`React/JSX babel transforms example test case: node-stable-mjs 1`] = ` -[ - "mjs/index-node-stable-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > babel > transforms example test case: node-stable-mjs > mjs/index-node-stable-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: mjs import { jsx } from 'react/jsx-runtime'; @@ -732,14 +613,11 @@ function Button() { } export { Button as default }; //# sourceMappingURL=index-node-stable-mjs.mjs.map -", -] +" `; -exports[`React/JSX swc transforms example test case: browser-current-esm 1`] = ` -[ - "esm/index-browser-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > swc > transforms example test case: browser-current-esm > esm/index-browser-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: esm import { jsx } from "react/jsx-runtime"; function Button() { @@ -747,14 +625,11 @@ function Button() { } export { Button as default }; //# sourceMappingURL=index-browser-current-esm.js.map -", -] +" `; -exports[`React/JSX swc transforms example test case: browser-current-lib 1`] = ` -[ - "lib/index-browser-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > swc > transforms example test case: browser-current-lib > lib/index-browser-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: lib "use strict"; const jsxRuntime = require("react/jsx-runtime"); @@ -763,14 +638,11 @@ function Button() { } module.exports = Button; //# sourceMappingURL=index-browser-current-lib.js.map -", -] +" `; -exports[`React/JSX swc transforms example test case: browser-current-umd 1`] = ` -[ - "umd/index-browser-current-umd.js", - "(function(global, factory) { +exports[`React/JSX > swc > transforms example test case: browser-current-umd > umd/index-browser-current-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports, require("react/jsx-runtime")); else if (typeof define === "function" && define.amd) define([ "exports", @@ -793,14 +665,11 @@ exports[`React/JSX swc transforms example test case: browser-current-umd 1`] = ` } }); //# sourceMappingURL=index-browser-current-umd.js.map -", -] +" `; -exports[`React/JSX swc transforms example test case: browser-experimental-esm 1`] = ` -[ - "esm/index-browser-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > swc > transforms example test case: browser-experimental-esm > esm/index-browser-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: esm import { jsx } from "react/jsx-runtime"; function Button() { @@ -808,14 +677,11 @@ function Button() { } export { Button as default }; //# sourceMappingURL=index-browser-experimental-esm.js.map -", -] +" `; -exports[`React/JSX swc transforms example test case: browser-experimental-lib 1`] = ` -[ - "lib/index-browser-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > swc > transforms example test case: browser-experimental-lib > lib/index-browser-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: lib "use strict"; const jsxRuntime = require("react/jsx-runtime"); @@ -824,14 +690,11 @@ function Button() { } module.exports = Button; //# sourceMappingURL=index-browser-experimental-lib.js.map -", -] +" `; -exports[`React/JSX swc transforms example test case: browser-experimental-umd 1`] = ` -[ - "umd/index-browser-experimental-umd.js", - "(function(global, factory) { +exports[`React/JSX > swc > transforms example test case: browser-experimental-umd > umd/index-browser-experimental-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports, require("react/jsx-runtime")); else if (typeof define === "function" && define.amd) define([ "exports", @@ -854,14 +717,11 @@ exports[`React/JSX swc transforms example test case: browser-experimental-umd 1` } }); //# sourceMappingURL=index-browser-experimental-umd.js.map -", -] +" `; -exports[`React/JSX swc transforms example test case: browser-legacy-esm 1`] = ` -[ - "esm/index-browser-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > swc > transforms example test case: browser-legacy-esm > esm/index-browser-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: esm import { jsx } from "react/jsx-runtime"; function Button() { @@ -869,14 +729,11 @@ function Button() { } export { Button as default }; //# sourceMappingURL=index-browser-legacy-esm.js.map -", -] +" `; -exports[`React/JSX swc transforms example test case: browser-legacy-lib 1`] = ` -[ - "lib/index-browser-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > swc > transforms example test case: browser-legacy-lib > lib/index-browser-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: lib "use strict"; var jsxRuntime = require("react/jsx-runtime"); @@ -885,14 +742,11 @@ function Button() { } module.exports = Button; //# sourceMappingURL=index-browser-legacy-lib.js.map -", -] +" `; -exports[`React/JSX swc transforms example test case: browser-legacy-umd 1`] = ` -[ - "umd/index-browser-legacy-umd.js", - "(function(global, factory) { +exports[`React/JSX > swc > transforms example test case: browser-legacy-umd > umd/index-browser-legacy-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports, require("react/jsx-runtime")); else if (typeof define === "function" && define.amd) define([ "exports", @@ -915,14 +769,11 @@ exports[`React/JSX swc transforms example test case: browser-legacy-umd 1`] = ` } }); //# sourceMappingURL=index-browser-legacy-umd.js.map -", -] +" `; -exports[`React/JSX swc transforms example test case: browser-stable-esm 1`] = ` -[ - "esm/index-browser-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > swc > transforms example test case: browser-stable-esm > esm/index-browser-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: esm import { jsx } from "react/jsx-runtime"; function Button() { @@ -930,14 +781,11 @@ function Button() { } export { Button as default }; //# sourceMappingURL=index-browser-stable-esm.js.map -", -] +" `; -exports[`React/JSX swc transforms example test case: browser-stable-lib 1`] = ` -[ - "lib/index-browser-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > swc > transforms example test case: browser-stable-lib > lib/index-browser-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: lib "use strict"; const jsxRuntime = require("react/jsx-runtime"); @@ -946,14 +794,11 @@ function Button() { } module.exports = Button; //# sourceMappingURL=index-browser-stable-lib.js.map -", -] +" `; -exports[`React/JSX swc transforms example test case: browser-stable-umd 1`] = ` -[ - "umd/index-browser-stable-umd.js", - "(function(global, factory) { +exports[`React/JSX > swc > transforms example test case: browser-stable-umd > umd/index-browser-stable-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports, require("react/jsx-runtime")); else if (typeof define === "function" && define.amd) define([ "exports", @@ -976,14 +821,11 @@ exports[`React/JSX swc transforms example test case: browser-stable-umd 1`] = ` } }); //# sourceMappingURL=index-browser-stable-umd.js.map -", -] +" `; -exports[`React/JSX swc transforms example test case: electron-current-esm 1`] = ` -[ - "esm/index-electron-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > swc > transforms example test case: electron-current-esm > esm/index-electron-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: esm import { jsx } from "react/jsx-runtime"; function Button() { @@ -991,14 +833,11 @@ function Button() { } export { Button as default }; //# sourceMappingURL=index-electron-current-esm.js.map -", -] +" `; -exports[`React/JSX swc transforms example test case: electron-current-lib 1`] = ` -[ - "lib/index-electron-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > swc > transforms example test case: electron-current-lib > lib/index-electron-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: lib "use strict"; const jsxRuntime = require("react/jsx-runtime"); @@ -1007,14 +846,11 @@ function Button() { } module.exports = Button; //# sourceMappingURL=index-electron-current-lib.js.map -", -] +" `; -exports[`React/JSX swc transforms example test case: electron-experimental-esm 1`] = ` -[ - "esm/index-electron-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > swc > transforms example test case: electron-experimental-esm > esm/index-electron-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: esm import { jsx } from "react/jsx-runtime"; function Button() { @@ -1022,14 +858,11 @@ function Button() { } export { Button as default }; //# sourceMappingURL=index-electron-experimental-esm.js.map -", -] +" `; -exports[`React/JSX swc transforms example test case: electron-experimental-lib 1`] = ` -[ - "lib/index-electron-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > swc > transforms example test case: electron-experimental-lib > lib/index-electron-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: lib "use strict"; const jsxRuntime = require("react/jsx-runtime"); @@ -1038,14 +871,11 @@ function Button() { } module.exports = Button; //# sourceMappingURL=index-electron-experimental-lib.js.map -", -] +" `; -exports[`React/JSX swc transforms example test case: electron-legacy-esm 1`] = ` -[ - "esm/index-electron-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > swc > transforms example test case: electron-legacy-esm > esm/index-electron-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: esm import { jsx } from "react/jsx-runtime"; function Button() { @@ -1053,14 +883,11 @@ function Button() { } export { Button as default }; //# sourceMappingURL=index-electron-legacy-esm.js.map -", -] +" `; -exports[`React/JSX swc transforms example test case: electron-legacy-lib 1`] = ` -[ - "lib/index-electron-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > swc > transforms example test case: electron-legacy-lib > lib/index-electron-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: lib "use strict"; const jsxRuntime = require("react/jsx-runtime"); @@ -1069,14 +896,11 @@ function Button() { } module.exports = Button; //# sourceMappingURL=index-electron-legacy-lib.js.map -", -] +" `; -exports[`React/JSX swc transforms example test case: electron-stable-esm 1`] = ` -[ - "esm/index-electron-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > swc > transforms example test case: electron-stable-esm > esm/index-electron-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: esm import { jsx } from "react/jsx-runtime"; function Button() { @@ -1084,14 +908,11 @@ function Button() { } export { Button as default }; //# sourceMappingURL=index-electron-stable-esm.js.map -", -] +" `; -exports[`React/JSX swc transforms example test case: electron-stable-lib 1`] = ` -[ - "lib/index-electron-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > swc > transforms example test case: electron-stable-lib > lib/index-electron-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: lib "use strict"; const jsxRuntime = require("react/jsx-runtime"); @@ -1100,14 +921,11 @@ function Button() { } module.exports = Button; //# sourceMappingURL=index-electron-stable-lib.js.map -", -] +" `; -exports[`React/JSX swc transforms example test case: native-current-lib 1`] = ` -[ - "lib/index-native-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > swc > transforms example test case: native-current-lib > lib/index-native-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: current, Format: lib "use strict"; const jsxRuntime = require("react/jsx-runtime"); @@ -1116,14 +934,11 @@ function Button() { } module.exports = Button; //# sourceMappingURL=index-native-current-lib.js.map -", -] +" `; -exports[`React/JSX swc transforms example test case: native-experimental-lib 1`] = ` -[ - "lib/index-native-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > swc > transforms example test case: native-experimental-lib > lib/index-native-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: experimental, Format: lib "use strict"; const jsxRuntime = require("react/jsx-runtime"); @@ -1132,14 +947,11 @@ function Button() { } module.exports = Button; //# sourceMappingURL=index-native-experimental-lib.js.map -", -] +" `; -exports[`React/JSX swc transforms example test case: native-legacy-lib 1`] = ` -[ - "lib/index-native-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > swc > transforms example test case: native-legacy-lib > lib/index-native-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: legacy, Format: lib "use strict"; const jsxRuntime = require("react/jsx-runtime"); @@ -1148,14 +960,11 @@ function Button() { } module.exports = Button; //# sourceMappingURL=index-native-legacy-lib.js.map -", -] +" `; -exports[`React/JSX swc transforms example test case: native-stable-lib 1`] = ` -[ - "lib/index-native-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > swc > transforms example test case: native-stable-lib > lib/index-native-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: stable, Format: lib "use strict"; const jsxRuntime = require("react/jsx-runtime"); @@ -1164,26 +973,11 @@ function Button() { } module.exports = Button; //# sourceMappingURL=index-native-stable-lib.js.map -", -] +" `; -exports[`React/JSX swc transforms example test case: node-current-cjs 1`] = ` -[ - "cjs/index-node-current-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-current-cjs.cjs'; - -export default data;", -] -`; - -exports[`React/JSX swc transforms example test case: node-current-cjs 2`] = ` -[ - "cjs/index-node-current-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > swc > transforms example test case: node-current-cjs > cjs/index-node-current-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: cjs "use strict"; const jsxRuntime = require("react/jsx-runtime"); @@ -1192,14 +986,20 @@ function Button() { } module.exports = Button; //# sourceMappingURL=index-node-current-cjs.cjs.map -", -] +" +`; + +exports[`React/JSX > swc > transforms example test case: node-current-cjs > cjs/index-node-current-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-current-cjs.cjs'; + +export default data;" `; -exports[`React/JSX swc transforms example test case: node-current-lib 1`] = ` -[ - "lib/index-node-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > swc > transforms example test case: node-current-lib > lib/index-node-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: lib "use strict"; const jsxRuntime = require("react/jsx-runtime"); @@ -1208,14 +1008,11 @@ function Button() { } module.exports = Button; //# sourceMappingURL=index-node-current-lib.js.map -", -] +" `; -exports[`React/JSX swc transforms example test case: node-current-mjs 1`] = ` -[ - "mjs/index-node-current-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > swc > transforms example test case: node-current-mjs > mjs/index-node-current-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: mjs import { jsx } from "react/jsx-runtime"; function Button() { @@ -1223,26 +1020,11 @@ function Button() { } export { Button as default }; //# sourceMappingURL=index-node-current-mjs.mjs.map -", -] +" `; -exports[`React/JSX swc transforms example test case: node-experimental-cjs 1`] = ` -[ - "cjs/index-node-experimental-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-experimental-cjs.cjs'; - -export default data;", -] -`; - -exports[`React/JSX swc transforms example test case: node-experimental-cjs 2`] = ` -[ - "cjs/index-node-experimental-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > swc > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: cjs "use strict"; const jsxRuntime = require("react/jsx-runtime"); @@ -1251,14 +1033,20 @@ function Button() { } module.exports = Button; //# sourceMappingURL=index-node-experimental-cjs.cjs.map -", -] +" +`; + +exports[`React/JSX > swc > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-experimental-cjs.cjs'; + +export default data;" `; -exports[`React/JSX swc transforms example test case: node-experimental-lib 1`] = ` -[ - "lib/index-node-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > swc > transforms example test case: node-experimental-lib > lib/index-node-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: lib "use strict"; const jsxRuntime = require("react/jsx-runtime"); @@ -1267,14 +1055,11 @@ function Button() { } module.exports = Button; //# sourceMappingURL=index-node-experimental-lib.js.map -", -] +" `; -exports[`React/JSX swc transforms example test case: node-experimental-mjs 1`] = ` -[ - "mjs/index-node-experimental-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > swc > transforms example test case: node-experimental-mjs > mjs/index-node-experimental-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: mjs import { jsx } from "react/jsx-runtime"; function Button() { @@ -1282,26 +1067,11 @@ function Button() { } export { Button as default }; //# sourceMappingURL=index-node-experimental-mjs.mjs.map -", -] +" `; -exports[`React/JSX swc transforms example test case: node-legacy-cjs 1`] = ` -[ - "cjs/index-node-legacy-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-legacy-cjs.cjs'; - -export default data;", -] -`; - -exports[`React/JSX swc transforms example test case: node-legacy-cjs 2`] = ` -[ - "cjs/index-node-legacy-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > swc > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: cjs "use strict"; const jsxRuntime = require("react/jsx-runtime"); @@ -1310,14 +1080,20 @@ function Button() { } module.exports = Button; //# sourceMappingURL=index-node-legacy-cjs.cjs.map -", -] +" +`; + +exports[`React/JSX > swc > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-legacy-cjs.cjs'; + +export default data;" `; -exports[`React/JSX swc transforms example test case: node-legacy-lib 1`] = ` -[ - "lib/index-node-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > swc > transforms example test case: node-legacy-lib > lib/index-node-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: lib "use strict"; const jsxRuntime = require("react/jsx-runtime"); @@ -1326,14 +1102,11 @@ function Button() { } module.exports = Button; //# sourceMappingURL=index-node-legacy-lib.js.map -", -] +" `; -exports[`React/JSX swc transforms example test case: node-legacy-mjs 1`] = ` -[ - "mjs/index-node-legacy-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > swc > transforms example test case: node-legacy-mjs > mjs/index-node-legacy-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: mjs import { jsx } from "react/jsx-runtime"; function Button() { @@ -1341,26 +1114,11 @@ function Button() { } export { Button as default }; //# sourceMappingURL=index-node-legacy-mjs.mjs.map -", -] +" `; -exports[`React/JSX swc transforms example test case: node-stable-cjs 1`] = ` -[ - "cjs/index-node-stable-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-stable-cjs.cjs'; - -export default data;", -] -`; - -exports[`React/JSX swc transforms example test case: node-stable-cjs 2`] = ` -[ - "cjs/index-node-stable-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > swc > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: cjs "use strict"; const jsxRuntime = require("react/jsx-runtime"); @@ -1369,14 +1127,20 @@ function Button() { } module.exports = Button; //# sourceMappingURL=index-node-stable-cjs.cjs.map -", -] +" +`; + +exports[`React/JSX > swc > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-stable-cjs.cjs'; + +export default data;" `; -exports[`React/JSX swc transforms example test case: node-stable-lib 1`] = ` -[ - "lib/index-node-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > swc > transforms example test case: node-stable-lib > lib/index-node-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: lib "use strict"; const jsxRuntime = require("react/jsx-runtime"); @@ -1385,14 +1149,11 @@ function Button() { } module.exports = Button; //# sourceMappingURL=index-node-stable-lib.js.map -", -] +" `; -exports[`React/JSX swc transforms example test case: node-stable-mjs 1`] = ` -[ - "mjs/index-node-stable-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`React/JSX > swc > transforms example test case: node-stable-mjs > mjs/index-node-stable-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: mjs import { jsx } from "react/jsx-runtime"; function Button() { @@ -1400,6 +1161,5 @@ function Button() { } export { Button as default }; //# sourceMappingURL=index-node-stable-mjs.mjs.map -", -] +" `; diff --git a/packages/packemon/tests/examples/__snapshots__/solid.test.ts.snap b/packages/packemon/tests/examples/__snapshots__/solid.test.ts.snap index 921e8db0c..fb31cfddf 100644 --- a/packages/packemon/tests/examples/__snapshots__/solid.test.ts.snap +++ b/packages/packemon/tests/examples/__snapshots__/solid.test.ts.snap @@ -1,9 +1,7 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`Solid/JSX babel transforms example test case: browser-current-esm 1`] = ` -[ - "esm/index-browser-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > babel > transforms example test case: browser-current-esm > esm/index-browser-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: esm import { template } from 'solid-js/web'; @@ -16,14 +14,11 @@ function Element() { } export { Button, Element as default }; //# sourceMappingURL=index-browser-current-esm.js.map -", -] +" `; -exports[`Solid/JSX babel transforms example test case: browser-current-lib 1`] = ` -[ - "lib/index-browser-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > babel > transforms example test case: browser-current-lib > lib/index-browser-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: lib 'use strict'; @@ -42,14 +37,11 @@ function Element() { exports.Button = Button; exports.default = Element; //# sourceMappingURL=index-browser-current-lib.js.map -", -] +" `; -exports[`Solid/JSX babel transforms example test case: browser-current-umd 1`] = ` -[ - "umd/index-browser-current-umd.js", - "(function (global, factory) { +exports[`Solid/JSX > babel > transforms example test case: browser-current-umd > umd/index-browser-current-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports", "solid-js/web"], factory); } else if (typeof exports !== "undefined") { @@ -81,14 +73,11 @@ exports[`Solid/JSX babel transforms example test case: browser-current-umd 1`] = } }); //# sourceMappingURL=index-browser-current-umd.js.map -", -] +" `; -exports[`Solid/JSX babel transforms example test case: browser-experimental-esm 1`] = ` -[ - "esm/index-browser-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > babel > transforms example test case: browser-experimental-esm > esm/index-browser-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: esm import { template } from 'solid-js/web'; @@ -101,14 +90,11 @@ function Element() { } export { Button, Element as default }; //# sourceMappingURL=index-browser-experimental-esm.js.map -", -] +" `; -exports[`Solid/JSX babel transforms example test case: browser-experimental-lib 1`] = ` -[ - "lib/index-browser-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > babel > transforms example test case: browser-experimental-lib > lib/index-browser-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: lib 'use strict'; @@ -127,14 +113,11 @@ function Element() { exports.Button = Button; exports.default = Element; //# sourceMappingURL=index-browser-experimental-lib.js.map -", -] +" `; -exports[`Solid/JSX babel transforms example test case: browser-experimental-umd 1`] = ` -[ - "umd/index-browser-experimental-umd.js", - "(function (global, factory) { +exports[`Solid/JSX > babel > transforms example test case: browser-experimental-umd > umd/index-browser-experimental-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports", "solid-js/web"], factory); } else if (typeof exports !== "undefined") { @@ -166,14 +149,11 @@ exports[`Solid/JSX babel transforms example test case: browser-experimental-umd } }); //# sourceMappingURL=index-browser-experimental-umd.js.map -", -] +" `; -exports[`Solid/JSX babel transforms example test case: browser-legacy-esm 1`] = ` -[ - "esm/index-browser-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > babel > transforms example test case: browser-legacy-esm > esm/index-browser-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: esm import { template } from 'solid-js/web'; @@ -186,14 +166,11 @@ function Element() { } export { Button, Element as default }; //# sourceMappingURL=index-browser-legacy-esm.js.map -", -] +" `; -exports[`Solid/JSX babel transforms example test case: browser-legacy-lib 1`] = ` -[ - "lib/index-browser-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > babel > transforms example test case: browser-legacy-lib > lib/index-browser-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: lib 'use strict'; @@ -212,14 +189,11 @@ function Element() { exports.Button = Button; exports.default = Element; //# sourceMappingURL=index-browser-legacy-lib.js.map -", -] +" `; -exports[`Solid/JSX babel transforms example test case: browser-legacy-umd 1`] = ` -[ - "umd/index-browser-legacy-umd.js", - "(function (global, factory) { +exports[`Solid/JSX > babel > transforms example test case: browser-legacy-umd > umd/index-browser-legacy-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports", "solid-js/web"], factory); } else if (typeof exports !== "undefined") { @@ -251,14 +225,11 @@ exports[`Solid/JSX babel transforms example test case: browser-legacy-umd 1`] = } }); //# sourceMappingURL=index-browser-legacy-umd.js.map -", -] +" `; -exports[`Solid/JSX babel transforms example test case: browser-stable-esm 1`] = ` -[ - "esm/index-browser-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > babel > transforms example test case: browser-stable-esm > esm/index-browser-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: esm import { template } from 'solid-js/web'; @@ -271,14 +242,11 @@ function Element() { } export { Button, Element as default }; //# sourceMappingURL=index-browser-stable-esm.js.map -", -] +" `; -exports[`Solid/JSX babel transforms example test case: browser-stable-lib 1`] = ` -[ - "lib/index-browser-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > babel > transforms example test case: browser-stable-lib > lib/index-browser-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: lib 'use strict'; @@ -297,14 +265,11 @@ function Element() { exports.Button = Button; exports.default = Element; //# sourceMappingURL=index-browser-stable-lib.js.map -", -] +" `; -exports[`Solid/JSX babel transforms example test case: browser-stable-umd 1`] = ` -[ - "umd/index-browser-stable-umd.js", - "(function (global, factory) { +exports[`Solid/JSX > babel > transforms example test case: browser-stable-umd > umd/index-browser-stable-umd.js 1`] = ` +"(function (global, factory) { if (typeof define === "function" && define.amd) { define(["exports", "solid-js/web"], factory); } else if (typeof exports !== "undefined") { @@ -336,14 +301,11 @@ exports[`Solid/JSX babel transforms example test case: browser-stable-umd 1`] = } }); //# sourceMappingURL=index-browser-stable-umd.js.map -", -] +" `; -exports[`Solid/JSX babel transforms example test case: electron-current-esm 1`] = ` -[ - "esm/index-electron-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > babel > transforms example test case: electron-current-esm > esm/index-electron-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: esm import { template } from 'solid-js/web'; @@ -356,14 +318,11 @@ function Element() { } export { Button, Element as default }; //# sourceMappingURL=index-electron-current-esm.js.map -", -] +" `; -exports[`Solid/JSX babel transforms example test case: electron-current-lib 1`] = ` -[ - "lib/index-electron-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > babel > transforms example test case: electron-current-lib > lib/index-electron-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: lib 'use strict'; @@ -382,14 +341,11 @@ function Element() { exports.Button = Button; exports.default = Element; //# sourceMappingURL=index-electron-current-lib.js.map -", -] +" `; -exports[`Solid/JSX babel transforms example test case: electron-experimental-esm 1`] = ` -[ - "esm/index-electron-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > babel > transforms example test case: electron-experimental-esm > esm/index-electron-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: esm import { template } from 'solid-js/web'; @@ -402,14 +358,11 @@ function Element() { } export { Button, Element as default }; //# sourceMappingURL=index-electron-experimental-esm.js.map -", -] +" `; -exports[`Solid/JSX babel transforms example test case: electron-experimental-lib 1`] = ` -[ - "lib/index-electron-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > babel > transforms example test case: electron-experimental-lib > lib/index-electron-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: lib 'use strict'; @@ -428,14 +381,11 @@ function Element() { exports.Button = Button; exports.default = Element; //# sourceMappingURL=index-electron-experimental-lib.js.map -", -] +" `; -exports[`Solid/JSX babel transforms example test case: electron-legacy-esm 1`] = ` -[ - "esm/index-electron-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > babel > transforms example test case: electron-legacy-esm > esm/index-electron-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: esm import { template } from 'solid-js/web'; @@ -448,14 +398,11 @@ function Element() { } export { Button, Element as default }; //# sourceMappingURL=index-electron-legacy-esm.js.map -", -] +" `; -exports[`Solid/JSX babel transforms example test case: electron-legacy-lib 1`] = ` -[ - "lib/index-electron-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > babel > transforms example test case: electron-legacy-lib > lib/index-electron-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: lib 'use strict'; @@ -474,14 +421,11 @@ function Element() { exports.Button = Button; exports.default = Element; //# sourceMappingURL=index-electron-legacy-lib.js.map -", -] +" `; -exports[`Solid/JSX babel transforms example test case: electron-stable-esm 1`] = ` -[ - "esm/index-electron-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > babel > transforms example test case: electron-stable-esm > esm/index-electron-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: esm import { template } from 'solid-js/web'; @@ -494,14 +438,11 @@ function Element() { } export { Button, Element as default }; //# sourceMappingURL=index-electron-stable-esm.js.map -", -] +" `; -exports[`Solid/JSX babel transforms example test case: electron-stable-lib 1`] = ` -[ - "lib/index-electron-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > babel > transforms example test case: electron-stable-lib > lib/index-electron-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: lib 'use strict'; @@ -520,14 +461,11 @@ function Element() { exports.Button = Button; exports.default = Element; //# sourceMappingURL=index-electron-stable-lib.js.map -", -] +" `; -exports[`Solid/JSX babel transforms example test case: native-current-lib 1`] = ` -[ - "lib/index-native-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > babel > transforms example test case: native-current-lib > lib/index-native-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: current, Format: lib 'use strict'; @@ -546,14 +484,11 @@ function Element() { exports.Button = Button; exports.default = Element; //# sourceMappingURL=index-native-current-lib.js.map -", -] +" `; -exports[`Solid/JSX babel transforms example test case: native-experimental-lib 1`] = ` -[ - "lib/index-native-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > babel > transforms example test case: native-experimental-lib > lib/index-native-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: experimental, Format: lib 'use strict'; @@ -572,14 +507,11 @@ function Element() { exports.Button = Button; exports.default = Element; //# sourceMappingURL=index-native-experimental-lib.js.map -", -] +" `; -exports[`Solid/JSX babel transforms example test case: native-legacy-lib 1`] = ` -[ - "lib/index-native-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > babel > transforms example test case: native-legacy-lib > lib/index-native-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: legacy, Format: lib 'use strict'; @@ -598,14 +530,11 @@ function Element() { exports.Button = Button; exports.default = Element; //# sourceMappingURL=index-native-legacy-lib.js.map -", -] +" `; -exports[`Solid/JSX babel transforms example test case: native-stable-lib 1`] = ` -[ - "lib/index-native-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > babel > transforms example test case: native-stable-lib > lib/index-native-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: stable, Format: lib 'use strict'; @@ -624,27 +553,11 @@ function Element() { exports.Button = Button; exports.default = Element; //# sourceMappingURL=index-native-stable-lib.js.map -", -] +" `; -exports[`Solid/JSX babel transforms example test case: node-current-cjs 1`] = ` -[ - "cjs/index-node-current-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-current-cjs.cjs'; - -export const { Button } = data; -export default data.default;", -] -`; - -exports[`Solid/JSX babel transforms example test case: node-current-cjs 2`] = ` -[ - "cjs/index-node-current-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > babel > transforms example test case: node-current-cjs > cjs/index-node-current-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: cjs 'use strict'; @@ -663,14 +576,21 @@ function Element() { exports.Button = Button; exports.default = Element; //# sourceMappingURL=index-node-current-cjs.cjs.map -", -] +" +`; + +exports[`Solid/JSX > babel > transforms example test case: node-current-cjs > cjs/index-node-current-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-current-cjs.cjs'; + +export const { Button } = data; +export default data.default;" `; -exports[`Solid/JSX babel transforms example test case: node-current-lib 1`] = ` -[ - "lib/index-node-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > babel > transforms example test case: node-current-lib > lib/index-node-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: lib 'use strict'; @@ -689,14 +609,11 @@ function Element() { exports.Button = Button; exports.default = Element; //# sourceMappingURL=index-node-current-lib.js.map -", -] +" `; -exports[`Solid/JSX babel transforms example test case: node-current-mjs 1`] = ` -[ - "mjs/index-node-current-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > babel > transforms example test case: node-current-mjs > mjs/index-node-current-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: mjs import { template } from 'solid-js/web'; @@ -709,27 +626,11 @@ function Element() { } export { Button, Element as default }; //# sourceMappingURL=index-node-current-mjs.mjs.map -", -] +" `; -exports[`Solid/JSX babel transforms example test case: node-experimental-cjs 1`] = ` -[ - "cjs/index-node-experimental-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-experimental-cjs.cjs'; - -export const { Button } = data; -export default data.default;", -] -`; - -exports[`Solid/JSX babel transforms example test case: node-experimental-cjs 2`] = ` -[ - "cjs/index-node-experimental-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > babel > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: cjs 'use strict'; @@ -748,14 +649,21 @@ function Element() { exports.Button = Button; exports.default = Element; //# sourceMappingURL=index-node-experimental-cjs.cjs.map -", -] +" +`; + +exports[`Solid/JSX > babel > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-experimental-cjs.cjs'; + +export const { Button } = data; +export default data.default;" `; -exports[`Solid/JSX babel transforms example test case: node-experimental-lib 1`] = ` -[ - "lib/index-node-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > babel > transforms example test case: node-experimental-lib > lib/index-node-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: lib 'use strict'; @@ -774,14 +682,11 @@ function Element() { exports.Button = Button; exports.default = Element; //# sourceMappingURL=index-node-experimental-lib.js.map -", -] +" `; -exports[`Solid/JSX babel transforms example test case: node-experimental-mjs 1`] = ` -[ - "mjs/index-node-experimental-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > babel > transforms example test case: node-experimental-mjs > mjs/index-node-experimental-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: mjs import { template } from 'solid-js/web'; @@ -794,27 +699,11 @@ function Element() { } export { Button, Element as default }; //# sourceMappingURL=index-node-experimental-mjs.mjs.map -", -] +" `; -exports[`Solid/JSX babel transforms example test case: node-legacy-cjs 1`] = ` -[ - "cjs/index-node-legacy-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-legacy-cjs.cjs'; - -export const { Button } = data; -export default data.default;", -] -`; - -exports[`Solid/JSX babel transforms example test case: node-legacy-cjs 2`] = ` -[ - "cjs/index-node-legacy-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > babel > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: cjs 'use strict'; @@ -833,14 +722,21 @@ function Element() { exports.Button = Button; exports.default = Element; //# sourceMappingURL=index-node-legacy-cjs.cjs.map -", -] +" +`; + +exports[`Solid/JSX > babel > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-legacy-cjs.cjs'; + +export const { Button } = data; +export default data.default;" `; -exports[`Solid/JSX babel transforms example test case: node-legacy-lib 1`] = ` -[ - "lib/index-node-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > babel > transforms example test case: node-legacy-lib > lib/index-node-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: lib 'use strict'; @@ -859,14 +755,11 @@ function Element() { exports.Button = Button; exports.default = Element; //# sourceMappingURL=index-node-legacy-lib.js.map -", -] +" `; -exports[`Solid/JSX babel transforms example test case: node-legacy-mjs 1`] = ` -[ - "mjs/index-node-legacy-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > babel > transforms example test case: node-legacy-mjs > mjs/index-node-legacy-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: mjs import { template } from 'solid-js/web'; @@ -879,27 +772,11 @@ function Element() { } export { Button, Element as default }; //# sourceMappingURL=index-node-legacy-mjs.mjs.map -", -] +" `; -exports[`Solid/JSX babel transforms example test case: node-stable-cjs 1`] = ` -[ - "cjs/index-node-stable-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-stable-cjs.cjs'; - -export const { Button } = data; -export default data.default;", -] -`; - -exports[`Solid/JSX babel transforms example test case: node-stable-cjs 2`] = ` -[ - "cjs/index-node-stable-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > babel > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: cjs 'use strict'; @@ -918,14 +795,21 @@ function Element() { exports.Button = Button; exports.default = Element; //# sourceMappingURL=index-node-stable-cjs.cjs.map -", -] +" +`; + +exports[`Solid/JSX > babel > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-stable-cjs.cjs'; + +export const { Button } = data; +export default data.default;" `; -exports[`Solid/JSX babel transforms example test case: node-stable-lib 1`] = ` -[ - "lib/index-node-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > babel > transforms example test case: node-stable-lib > lib/index-node-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: lib 'use strict'; @@ -944,14 +828,11 @@ function Element() { exports.Button = Button; exports.default = Element; //# sourceMappingURL=index-node-stable-lib.js.map -", -] +" `; -exports[`Solid/JSX babel transforms example test case: node-stable-mjs 1`] = ` -[ - "mjs/index-node-stable-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > babel > transforms example test case: node-stable-mjs > mjs/index-node-stable-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: mjs import { template } from 'solid-js/web'; @@ -964,14 +845,11 @@ function Element() { } export { Button, Element as default }; //# sourceMappingURL=index-node-stable-mjs.mjs.map -", -] +" `; -exports[`Solid/JSX swc transforms example test case: browser-current-esm 1`] = ` -[ - "esm/index-browser-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > swc > transforms example test case: browser-current-esm > esm/index-browser-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: esm function Button() { return /*#__PURE__*/ React.createElement("button", null); @@ -981,14 +859,11 @@ function Element() { } export { Button, Element as default }; //# sourceMappingURL=index-browser-current-esm.js.map -", -] +" `; -exports[`Solid/JSX swc transforms example test case: browser-current-lib 1`] = ` -[ - "lib/index-browser-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > swc > transforms example test case: browser-current-lib > lib/index-browser-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: current, Format: lib "use strict"; Object.defineProperty(exports, "__esModule", { @@ -1003,14 +878,11 @@ function Element() { exports.Button = Button; exports.default = Element; //# sourceMappingURL=index-browser-current-lib.js.map -", -] +" `; -exports[`Solid/JSX swc transforms example test case: browser-current-umd 1`] = ` -[ - "umd/index-browser-current-umd.js", - "(function(global, factory) { +exports[`Solid/JSX > swc > transforms example test case: browser-current-umd > umd/index-browser-current-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports); else if (typeof define === "function" && define.amd) define([ "exports" @@ -1043,14 +915,11 @@ exports[`Solid/JSX swc transforms example test case: browser-current-umd 1`] = ` } }); //# sourceMappingURL=index-browser-current-umd.js.map -", -] +" `; -exports[`Solid/JSX swc transforms example test case: browser-experimental-esm 1`] = ` -[ - "esm/index-browser-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > swc > transforms example test case: browser-experimental-esm > esm/index-browser-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: esm function Button() { return /*#__PURE__*/ React.createElement("button", null); @@ -1060,14 +929,11 @@ function Element() { } export { Button, Element as default }; //# sourceMappingURL=index-browser-experimental-esm.js.map -", -] +" `; -exports[`Solid/JSX swc transforms example test case: browser-experimental-lib 1`] = ` -[ - "lib/index-browser-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > swc > transforms example test case: browser-experimental-lib > lib/index-browser-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: experimental, Format: lib "use strict"; Object.defineProperty(exports, "__esModule", { @@ -1082,14 +948,11 @@ function Element() { exports.Button = Button; exports.default = Element; //# sourceMappingURL=index-browser-experimental-lib.js.map -", -] +" `; -exports[`Solid/JSX swc transforms example test case: browser-experimental-umd 1`] = ` -[ - "umd/index-browser-experimental-umd.js", - "(function(global, factory) { +exports[`Solid/JSX > swc > transforms example test case: browser-experimental-umd > umd/index-browser-experimental-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports); else if (typeof define === "function" && define.amd) define([ "exports" @@ -1122,14 +985,11 @@ exports[`Solid/JSX swc transforms example test case: browser-experimental-umd 1` } }); //# sourceMappingURL=index-browser-experimental-umd.js.map -", -] +" `; -exports[`Solid/JSX swc transforms example test case: browser-legacy-esm 1`] = ` -[ - "esm/index-browser-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > swc > transforms example test case: browser-legacy-esm > esm/index-browser-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: esm function Button() { return /*#__PURE__*/ React.createElement("button", null); @@ -1139,14 +999,11 @@ function Element() { } export { Button, Element as default }; //# sourceMappingURL=index-browser-legacy-esm.js.map -", -] +" `; -exports[`Solid/JSX swc transforms example test case: browser-legacy-lib 1`] = ` -[ - "lib/index-browser-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > swc > transforms example test case: browser-legacy-lib > lib/index-browser-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: legacy, Format: lib "use strict"; Object.defineProperty(exports, "__esModule", { @@ -1161,14 +1018,11 @@ function Element() { exports.Button = Button; exports.default = Element; //# sourceMappingURL=index-browser-legacy-lib.js.map -", -] +" `; -exports[`Solid/JSX swc transforms example test case: browser-legacy-umd 1`] = ` -[ - "umd/index-browser-legacy-umd.js", - "(function(global, factory) { +exports[`Solid/JSX > swc > transforms example test case: browser-legacy-umd > umd/index-browser-legacy-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports); else if (typeof define === "function" && define.amd) define([ "exports" @@ -1201,14 +1055,11 @@ exports[`Solid/JSX swc transforms example test case: browser-legacy-umd 1`] = ` } }); //# sourceMappingURL=index-browser-legacy-umd.js.map -", -] +" `; -exports[`Solid/JSX swc transforms example test case: browser-stable-esm 1`] = ` -[ - "esm/index-browser-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > swc > transforms example test case: browser-stable-esm > esm/index-browser-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: esm function Button() { return /*#__PURE__*/ React.createElement("button", null); @@ -1218,14 +1069,11 @@ function Element() { } export { Button, Element as default }; //# sourceMappingURL=index-browser-stable-esm.js.map -", -] +" `; -exports[`Solid/JSX swc transforms example test case: browser-stable-lib 1`] = ` -[ - "lib/index-browser-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > swc > transforms example test case: browser-stable-lib > lib/index-browser-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: browser, Support: stable, Format: lib "use strict"; Object.defineProperty(exports, "__esModule", { @@ -1240,14 +1088,11 @@ function Element() { exports.Button = Button; exports.default = Element; //# sourceMappingURL=index-browser-stable-lib.js.map -", -] +" `; -exports[`Solid/JSX swc transforms example test case: browser-stable-umd 1`] = ` -[ - "umd/index-browser-stable-umd.js", - "(function(global, factory) { +exports[`Solid/JSX > swc > transforms example test case: browser-stable-umd > umd/index-browser-stable-umd.js 1`] = ` +"(function(global, factory) { if (typeof module === "object" && typeof module.exports === "object") factory(exports); else if (typeof define === "function" && define.amd) define([ "exports" @@ -1280,14 +1125,11 @@ exports[`Solid/JSX swc transforms example test case: browser-stable-umd 1`] = ` } }); //# sourceMappingURL=index-browser-stable-umd.js.map -", -] +" `; -exports[`Solid/JSX swc transforms example test case: electron-current-esm 1`] = ` -[ - "esm/index-electron-current-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > swc > transforms example test case: electron-current-esm > esm/index-electron-current-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: esm function Button() { return /*#__PURE__*/ React.createElement("button", null); @@ -1297,14 +1139,11 @@ function Element() { } export { Button, Element as default }; //# sourceMappingURL=index-electron-current-esm.js.map -", -] +" `; -exports[`Solid/JSX swc transforms example test case: electron-current-lib 1`] = ` -[ - "lib/index-electron-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > swc > transforms example test case: electron-current-lib > lib/index-electron-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: current, Format: lib "use strict"; Object.defineProperty(exports, "__esModule", { @@ -1319,14 +1158,11 @@ function Element() { exports.Button = Button; exports.default = Element; //# sourceMappingURL=index-electron-current-lib.js.map -", -] +" `; -exports[`Solid/JSX swc transforms example test case: electron-experimental-esm 1`] = ` -[ - "esm/index-electron-experimental-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > swc > transforms example test case: electron-experimental-esm > esm/index-electron-experimental-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: esm function Button() { return /*#__PURE__*/ React.createElement("button", null); @@ -1336,14 +1172,11 @@ function Element() { } export { Button, Element as default }; //# sourceMappingURL=index-electron-experimental-esm.js.map -", -] +" `; -exports[`Solid/JSX swc transforms example test case: electron-experimental-lib 1`] = ` -[ - "lib/index-electron-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > swc > transforms example test case: electron-experimental-lib > lib/index-electron-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: experimental, Format: lib "use strict"; Object.defineProperty(exports, "__esModule", { @@ -1358,14 +1191,11 @@ function Element() { exports.Button = Button; exports.default = Element; //# sourceMappingURL=index-electron-experimental-lib.js.map -", -] +" `; -exports[`Solid/JSX swc transforms example test case: electron-legacy-esm 1`] = ` -[ - "esm/index-electron-legacy-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > swc > transforms example test case: electron-legacy-esm > esm/index-electron-legacy-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: esm function Button() { return /*#__PURE__*/ React.createElement("button", null); @@ -1375,14 +1205,11 @@ function Element() { } export { Button, Element as default }; //# sourceMappingURL=index-electron-legacy-esm.js.map -", -] +" `; -exports[`Solid/JSX swc transforms example test case: electron-legacy-lib 1`] = ` -[ - "lib/index-electron-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > swc > transforms example test case: electron-legacy-lib > lib/index-electron-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: legacy, Format: lib "use strict"; Object.defineProperty(exports, "__esModule", { @@ -1397,14 +1224,11 @@ function Element() { exports.Button = Button; exports.default = Element; //# sourceMappingURL=index-electron-legacy-lib.js.map -", -] +" `; -exports[`Solid/JSX swc transforms example test case: electron-stable-esm 1`] = ` -[ - "esm/index-electron-stable-esm.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > swc > transforms example test case: electron-stable-esm > esm/index-electron-stable-esm.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: esm function Button() { return /*#__PURE__*/ React.createElement("button", null); @@ -1414,14 +1238,11 @@ function Element() { } export { Button, Element as default }; //# sourceMappingURL=index-electron-stable-esm.js.map -", -] +" `; -exports[`Solid/JSX swc transforms example test case: electron-stable-lib 1`] = ` -[ - "lib/index-electron-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > swc > transforms example test case: electron-stable-lib > lib/index-electron-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: electron, Support: stable, Format: lib "use strict"; Object.defineProperty(exports, "__esModule", { @@ -1436,14 +1257,11 @@ function Element() { exports.Button = Button; exports.default = Element; //# sourceMappingURL=index-electron-stable-lib.js.map -", -] +" `; -exports[`Solid/JSX swc transforms example test case: native-current-lib 1`] = ` -[ - "lib/index-native-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > swc > transforms example test case: native-current-lib > lib/index-native-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: current, Format: lib "use strict"; Object.defineProperty(exports, "__esModule", { @@ -1458,14 +1276,11 @@ function Element() { exports.Button = Button; exports.default = Element; //# sourceMappingURL=index-native-current-lib.js.map -", -] +" `; -exports[`Solid/JSX swc transforms example test case: native-experimental-lib 1`] = ` -[ - "lib/index-native-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > swc > transforms example test case: native-experimental-lib > lib/index-native-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: experimental, Format: lib "use strict"; Object.defineProperty(exports, "__esModule", { @@ -1480,14 +1295,11 @@ function Element() { exports.Button = Button; exports.default = Element; //# sourceMappingURL=index-native-experimental-lib.js.map -", -] +" `; -exports[`Solid/JSX swc transforms example test case: native-legacy-lib 1`] = ` -[ - "lib/index-native-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > swc > transforms example test case: native-legacy-lib > lib/index-native-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: legacy, Format: lib "use strict"; Object.defineProperty(exports, "__esModule", { @@ -1502,14 +1314,11 @@ function Element() { exports.Button = Button; exports.default = Element; //# sourceMappingURL=index-native-legacy-lib.js.map -", -] +" `; -exports[`Solid/JSX swc transforms example test case: native-stable-lib 1`] = ` -[ - "lib/index-native-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > swc > transforms example test case: native-stable-lib > lib/index-native-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: native, Support: stable, Format: lib "use strict"; Object.defineProperty(exports, "__esModule", { @@ -1524,27 +1333,11 @@ function Element() { exports.Button = Button; exports.default = Element; //# sourceMappingURL=index-native-stable-lib.js.map -", -] +" `; -exports[`Solid/JSX swc transforms example test case: node-current-cjs 1`] = ` -[ - "cjs/index-node-current-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-current-cjs.cjs'; - -export const { Button } = data; -export default data.default;", -] -`; - -exports[`Solid/JSX swc transforms example test case: node-current-cjs 2`] = ` -[ - "cjs/index-node-current-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > swc > transforms example test case: node-current-cjs > cjs/index-node-current-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: cjs "use strict"; Object.defineProperty(exports, "__esModule", { @@ -1559,14 +1352,21 @@ function Element() { exports.Button = Button; exports.default = Element; //# sourceMappingURL=index-node-current-cjs.cjs.map -", -] +" +`; + +exports[`Solid/JSX > swc > transforms example test case: node-current-cjs > cjs/index-node-current-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-current-cjs.cjs'; + +export const { Button } = data; +export default data.default;" `; -exports[`Solid/JSX swc transforms example test case: node-current-lib 1`] = ` -[ - "lib/index-node-current-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > swc > transforms example test case: node-current-lib > lib/index-node-current-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: lib "use strict"; Object.defineProperty(exports, "__esModule", { @@ -1581,14 +1381,11 @@ function Element() { exports.Button = Button; exports.default = Element; //# sourceMappingURL=index-node-current-lib.js.map -", -] +" `; -exports[`Solid/JSX swc transforms example test case: node-current-mjs 1`] = ` -[ - "mjs/index-node-current-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > swc > transforms example test case: node-current-mjs > mjs/index-node-current-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: current, Format: mjs function Button() { return /*#__PURE__*/ React.createElement("button", null); @@ -1598,27 +1395,11 @@ function Element() { } export { Button, Element as default }; //# sourceMappingURL=index-node-current-mjs.mjs.map -", -] +" `; -exports[`Solid/JSX swc transforms example test case: node-experimental-cjs 1`] = ` -[ - "cjs/index-node-experimental-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-experimental-cjs.cjs'; - -export const { Button } = data; -export default data.default;", -] -`; - -exports[`Solid/JSX swc transforms example test case: node-experimental-cjs 2`] = ` -[ - "cjs/index-node-experimental-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > swc > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: cjs "use strict"; Object.defineProperty(exports, "__esModule", { @@ -1633,14 +1414,21 @@ function Element() { exports.Button = Button; exports.default = Element; //# sourceMappingURL=index-node-experimental-cjs.cjs.map -", -] +" +`; + +exports[`Solid/JSX > swc > transforms example test case: node-experimental-cjs > cjs/index-node-experimental-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-experimental-cjs.cjs'; + +export const { Button } = data; +export default data.default;" `; -exports[`Solid/JSX swc transforms example test case: node-experimental-lib 1`] = ` -[ - "lib/index-node-experimental-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > swc > transforms example test case: node-experimental-lib > lib/index-node-experimental-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: lib "use strict"; Object.defineProperty(exports, "__esModule", { @@ -1655,14 +1443,11 @@ function Element() { exports.Button = Button; exports.default = Element; //# sourceMappingURL=index-node-experimental-lib.js.map -", -] +" `; -exports[`Solid/JSX swc transforms example test case: node-experimental-mjs 1`] = ` -[ - "mjs/index-node-experimental-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > swc > transforms example test case: node-experimental-mjs > mjs/index-node-experimental-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: experimental, Format: mjs function Button() { return /*#__PURE__*/ React.createElement("button", null); @@ -1672,27 +1457,11 @@ function Element() { } export { Button, Element as default }; //# sourceMappingURL=index-node-experimental-mjs.mjs.map -", -] +" `; -exports[`Solid/JSX swc transforms example test case: node-legacy-cjs 1`] = ` -[ - "cjs/index-node-legacy-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-legacy-cjs.cjs'; - -export const { Button } = data; -export default data.default;", -] -`; - -exports[`Solid/JSX swc transforms example test case: node-legacy-cjs 2`] = ` -[ - "cjs/index-node-legacy-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > swc > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: cjs "use strict"; Object.defineProperty(exports, "__esModule", { @@ -1707,14 +1476,21 @@ function Element() { exports.Button = Button; exports.default = Element; //# sourceMappingURL=index-node-legacy-cjs.cjs.map -", -] +" +`; + +exports[`Solid/JSX > swc > transforms example test case: node-legacy-cjs > cjs/index-node-legacy-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-legacy-cjs.cjs'; + +export const { Button } = data; +export default data.default;" `; -exports[`Solid/JSX swc transforms example test case: node-legacy-lib 1`] = ` -[ - "lib/index-node-legacy-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > swc > transforms example test case: node-legacy-lib > lib/index-node-legacy-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: lib "use strict"; Object.defineProperty(exports, "__esModule", { @@ -1729,14 +1505,11 @@ function Element() { exports.Button = Button; exports.default = Element; //# sourceMappingURL=index-node-legacy-lib.js.map -", -] +" `; -exports[`Solid/JSX swc transforms example test case: node-legacy-mjs 1`] = ` -[ - "mjs/index-node-legacy-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > swc > transforms example test case: node-legacy-mjs > mjs/index-node-legacy-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: legacy, Format: mjs function Button() { return /*#__PURE__*/ React.createElement("button", null); @@ -1746,27 +1519,11 @@ function Element() { } export { Button, Element as default }; //# sourceMappingURL=index-node-legacy-mjs.mjs.map -", -] +" `; -exports[`Solid/JSX swc transforms example test case: node-stable-cjs 1`] = ` -[ - "cjs/index-node-stable-cjs-wrapper.mjs", - "// Bundled with Packemon: https://packemon.dev -// This is an MJS wrapper for a sibling CJS file - -import data from './index-node-stable-cjs.cjs'; - -export const { Button } = data; -export default data.default;", -] -`; - -exports[`Solid/JSX swc transforms example test case: node-stable-cjs 2`] = ` -[ - "cjs/index-node-stable-cjs.cjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > swc > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs.cjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: cjs "use strict"; Object.defineProperty(exports, "__esModule", { @@ -1781,14 +1538,21 @@ function Element() { exports.Button = Button; exports.default = Element; //# sourceMappingURL=index-node-stable-cjs.cjs.map -", -] +" +`; + +exports[`Solid/JSX > swc > transforms example test case: node-stable-cjs > cjs/index-node-stable-cjs-wrapper.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev +// This is an MJS wrapper for a sibling CJS file + +import data from './index-node-stable-cjs.cjs'; + +export const { Button } = data; +export default data.default;" `; -exports[`Solid/JSX swc transforms example test case: node-stable-lib 1`] = ` -[ - "lib/index-node-stable-lib.js", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > swc > transforms example test case: node-stable-lib > lib/index-node-stable-lib.js 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: lib "use strict"; Object.defineProperty(exports, "__esModule", { @@ -1803,14 +1567,11 @@ function Element() { exports.Button = Button; exports.default = Element; //# sourceMappingURL=index-node-stable-lib.js.map -", -] +" `; -exports[`Solid/JSX swc transforms example test case: node-stable-mjs 1`] = ` -[ - "mjs/index-node-stable-mjs.mjs", - "// Bundled with Packemon: https://packemon.dev +exports[`Solid/JSX > swc > transforms example test case: node-stable-mjs > mjs/index-node-stable-mjs.mjs 1`] = ` +"// Bundled with Packemon: https://packemon.dev // Platform: node, Support: stable, Format: mjs function Button() { return /*#__PURE__*/ React.createElement("button", null); @@ -1820,6 +1581,5 @@ function Element() { } export { Button, Element as default }; //# sourceMappingURL=index-node-stable-mjs.mjs.map -", -] +" `; diff --git a/packages/packemon/tests/examples/assetImports.test.ts b/packages/packemon/tests/examples/assetImports.test.ts index 23ff97259..a10e8abd1 100644 --- a/packages/packemon/tests/examples/assetImports.test.ts +++ b/packages/packemon/tests/examples/assetImports.test.ts @@ -1,3 +1,4 @@ +import { describe } from 'vitest'; import { testExampleOutput } from '../helpers'; describe('Assets', () => { diff --git a/packages/packemon/tests/examples/asyncAwait.test.ts b/packages/packemon/tests/examples/asyncAwait.test.ts index fdaf95ab0..6f70110ed 100644 --- a/packages/packemon/tests/examples/asyncAwait.test.ts +++ b/packages/packemon/tests/examples/asyncAwait.test.ts @@ -1,3 +1,4 @@ +import { describe } from 'vitest'; import { testExampleOutput } from '../helpers'; describe('Async/await', () => { diff --git a/packages/packemon/tests/examples/cjsEsmInterop.test.ts b/packages/packemon/tests/examples/cjsEsmInterop.test.ts index ea89f0bc6..9da120d7c 100644 --- a/packages/packemon/tests/examples/cjsEsmInterop.test.ts +++ b/packages/packemon/tests/examples/cjsEsmInterop.test.ts @@ -1,3 +1,4 @@ +import { describe } from 'vitest'; import { testExampleOutput } from '../helpers'; describe('CJS/ESM interop', () => { diff --git a/packages/packemon/tests/examples/cjsMjsWrapper.test.ts b/packages/packemon/tests/examples/cjsMjsWrapper.test.ts index 967968cad..2a851bc71 100644 --- a/packages/packemon/tests/examples/cjsMjsWrapper.test.ts +++ b/packages/packemon/tests/examples/cjsMjsWrapper.test.ts @@ -1,3 +1,4 @@ +import { describe } from 'vitest'; import { testExampleOutput } from '../helpers'; describe('CJS -> MJS wrapper', () => { diff --git a/packages/packemon/tests/examples/dynamicImports.test.ts b/packages/packemon/tests/examples/dynamicImports.test.ts index 0e4ca1517..3ac9cb236 100644 --- a/packages/packemon/tests/examples/dynamicImports.test.ts +++ b/packages/packemon/tests/examples/dynamicImports.test.ts @@ -1,3 +1,4 @@ +import { describe } from 'vitest'; import { testExampleOutput } from '../helpers'; describe('Dynamic imports', () => { diff --git a/packages/packemon/tests/examples/externals.test.ts b/packages/packemon/tests/examples/externals.test.ts index 01f18f37d..2ded63f74 100644 --- a/packages/packemon/tests/examples/externals.test.ts +++ b/packages/packemon/tests/examples/externals.test.ts @@ -1,3 +1,4 @@ +import { describe } from 'vitest'; import { testExampleOutput } from '../helpers'; // Dont need to test swc here diff --git a/packages/packemon/tests/examples/generators.test.ts b/packages/packemon/tests/examples/generators.test.ts index 94eeedfea..c98ffddc0 100644 --- a/packages/packemon/tests/examples/generators.test.ts +++ b/packages/packemon/tests/examples/generators.test.ts @@ -1,3 +1,4 @@ +import { describe } from 'vitest'; import { testExampleOutput } from '../helpers'; describe('Generators', () => { diff --git a/packages/packemon/tests/examples/jsonImports.test.ts b/packages/packemon/tests/examples/jsonImports.test.ts index 63df10487..2b66a7819 100644 --- a/packages/packemon/tests/examples/jsonImports.test.ts +++ b/packages/packemon/tests/examples/jsonImports.test.ts @@ -1,3 +1,4 @@ +import { describe } from 'vitest'; import { testExampleOutput } from '../helpers'; describe('JSON imports', () => { diff --git a/packages/packemon/tests/examples/namespaces.test.ts b/packages/packemon/tests/examples/namespaces.test.ts index 532b0f091..b487d416d 100644 --- a/packages/packemon/tests/examples/namespaces.test.ts +++ b/packages/packemon/tests/examples/namespaces.test.ts @@ -1,3 +1,4 @@ +import { describe } from 'vitest'; import { testExampleOutput } from '../helpers'; describe('Namespaces', () => { diff --git a/packages/packemon/tests/examples/newSyntax.test.ts b/packages/packemon/tests/examples/newSyntax.test.ts index 0603272c6..b619bd89a 100644 --- a/packages/packemon/tests/examples/newSyntax.test.ts +++ b/packages/packemon/tests/examples/newSyntax.test.ts @@ -1,3 +1,4 @@ +import { describe } from 'vitest'; import { testExampleOutput } from '../helpers'; describe('New syntax', () => { diff --git a/packages/packemon/tests/examples/nodePolyfills.test.ts b/packages/packemon/tests/examples/nodePolyfills.test.ts index 67c1f74b7..e30f36b78 100644 --- a/packages/packemon/tests/examples/nodePolyfills.test.ts +++ b/packages/packemon/tests/examples/nodePolyfills.test.ts @@ -1,3 +1,4 @@ +import { describe } from 'vitest'; import { testExampleOutput } from '../helpers'; describe('Node polyfills', () => { diff --git a/packages/packemon/tests/examples/react.test.ts b/packages/packemon/tests/examples/react.test.ts index f77dc09b3..7027978d5 100644 --- a/packages/packemon/tests/examples/react.test.ts +++ b/packages/packemon/tests/examples/react.test.ts @@ -1,3 +1,4 @@ +import { describe } from 'vitest'; import { testExampleOutput } from '../helpers'; // Automatic only diff --git a/packages/packemon/tests/examples/solid.test.ts b/packages/packemon/tests/examples/solid.test.ts index 62fa584a2..24b1a6b19 100644 --- a/packages/packemon/tests/examples/solid.test.ts +++ b/packages/packemon/tests/examples/solid.test.ts @@ -1,3 +1,4 @@ +import { describe } from 'vitest'; import { Path } from '@boost/common'; import { getFixturePath, testExampleOutput } from '../helpers'; diff --git a/packages/packemon/tests/helpers.ts b/packages/packemon/tests/helpers.ts index 24885fa87..e015f25ce 100644 --- a/packages/packemon/tests/helpers.ts +++ b/packages/packemon/tests/helpers.ts @@ -1,9 +1,10 @@ -import fs from 'node:fs'; import path from 'node:path'; -import fsx from 'fs-extra'; +import { afterEach, beforeEach, describe, expect, it, type MockInstance, vi } from 'vitest'; import { Path, PortablePath } from '@boost/common'; import { Artifact, + BINARY_ASSETS, + FileSystem, Format, FORMATS, FORMATS_BROWSER, @@ -18,6 +19,7 @@ import { Support, SUPPORTS, } from '../src'; +import { nodeFileSystem } from '../src/FileSystem'; const FIXTURES_DIR = path.join( // eslint-disable-next-line unicorn/prefer-module @@ -26,6 +28,20 @@ const FIXTURES_DIR = path.join( '__fixtures__', ); +export function createStubbedFileSystem(): FileSystem { + return { + copyFile: vi.fn(), + createDirAll: vi.fn(), + exists: vi.fn().mockImplementation(nodeFileSystem.exists), + readFile: vi.fn().mockImplementation(nodeFileSystem.readFile), + readJson: vi.fn().mockImplementation(nodeFileSystem.readJson), + removeDir: vi.fn(), + removeFile: vi.fn(), + writeFile: vi.fn(), + writeJson: vi.fn(), + }; +} + export function normalizeSeparators(part: string) { if (process.platform === 'win32') { return part.replace(/\//g, '\\'); @@ -67,88 +83,41 @@ FORMATS.forEach((format) => { }); }); -export function mockSpy(instance: unknown): jest.SpyInstance { - return instance as jest.SpyInstance; +export function mockSpy(instance: unknown): MockInstance { + return instance as MockInstance; } -export function loadPackageAtPath(pkgPath: PortablePath, workspaceRoot?: PortablePath): Package { +export function loadPackageAtPath( + pkgPath: PortablePath, + workspaceRoot?: PortablePath | null, + fs?: FileSystem, +): Package { const root = Path.create(pkgPath); - const json = fsx.readJsonSync(root.append('package.json').path()) as PackemonPackage; + const json = nodeFileSystem.readJson(root.append('package.json').path()); - return new Package(root, json, workspaceRoot ? Path.create(workspaceRoot) : root); -} - -function formatSnapshotFilePath(file: string, root: string): string { - return new Path(String(file)) - .path() - .replace(String(root), '') - .replace(/^(\/|\\)/, '') - .replace(/\\/g, '/'); -} + const pkg = new Package(root, json, workspaceRoot ? Path.create(workspaceRoot) : root); -export function createSnapshotSpies(root: PortablePath, captureJson: boolean = false) { - let snapshots: [string, unknown][] = []; - const spies: jest.SpyInstance[] = []; - - beforeEach(() => { - const handler = (file: unknown, content: unknown, cb?: unknown) => { - const filePath = formatSnapshotFilePath(String(file), String(root)); + if (fs) { + pkg.fs = fs; + } - if ( - filePath.endsWith('.js') || - filePath.endsWith('.cjs') || - filePath.endsWith('.mjs') || - filePath.endsWith('.d.ts') || - filePath.endsWith('.d.cts') || - filePath.endsWith('.d.mts') || - (captureJson && filePath.endsWith('.json')) - ) { - snapshots.push([filePath, content]); - } + return pkg; +} - if (filePath.endsWith('.css')) { - snapshots.push([filePath, formatSnapshotFilePath(String(content), String(root))]); - } +function formatSnapshotFilePath(file: string): string { + return file.replace(/^(\/|\\)/, '').replace(/\\/g, '/'); +} - if (typeof cb === 'function') { - cb(null); +export function snapshotPackageBuildOutputs(pkg: Package) { + pkg.artifacts.forEach((art) => { + art.buildResult.files.forEach((chunk) => { + if (BINARY_ASSETS.some((ext) => chunk.file.endsWith(ext)) || chunk.file.endsWith('.map')) { + return; } - }; - - // eslint-disable-next-line @typescript-eslint/require-await - const asyncHandler = async (file: unknown, content: unknown) => { - handler(file, content); - }; - - spies.push( - jest.spyOn(console, 'warn').mockImplementation(), - // Rollup - jest.spyOn(fs.promises, 'writeFile').mockImplementation(asyncHandler), - // Packemon - // @ts-expect-error Bad types - jest.spyOn(fsx, 'writeJson').mockImplementation(handler), - // Assets - jest.spyOn(fsx, 'copyFile').mockImplementation(handler), - jest.spyOn(fsx, 'mkdir'), - ); - }); - afterEach(() => { - snapshots = []; - spies.forEach((spy) => void spy.mockRestore()); + expect(chunk.code).toMatchSnapshot(formatSnapshotFilePath(chunk.file)); + }); }); - - return (pkg?: Package) => { - if (pkg) { - pkg.artifacts.forEach((artifact) => { - artifact.buildResult.files.forEach((file) => { - snapshots.push([file.file, file.code]); - }); - }); - } - - return snapshots.sort((a, b) => a[0].localeCompare(b[0])); - }; } export function testExampleOutput( @@ -158,8 +127,9 @@ export function testExampleOutput( customRoot?: Path, ) { describe(transformer, () => { - const root = customRoot ?? getFixturePath('examples'); - const snapshots = createSnapshotSpies(root); + const root = customRoot ?? Path.create(getFixturePath('examples')); + + vi.spyOn(console, 'warn').mockImplementation(() => {}); beforeEach(() => { process.env.PACKEMON_TEST_WRITE = 'true'; @@ -191,14 +161,20 @@ export function testExampleOutput( pkg.artifacts.push(artifact); try { - await pkg.build({}, {}); + await pkg.build( + { + addEngines: false, + addEntries: false, + addExports: false, + addFiles: false, + }, + {}, + ); } catch (error: unknown) { console.error(error); } - snapshots().forEach((ss) => { - expect(ss).toMatchSnapshot(); - }); + snapshotPackageBuildOutputs(pkg); }); }); }); diff --git a/packages/packemon/tests/helpers/loadModule.test.ts b/packages/packemon/tests/helpers/loadModule.test.ts index 50212c3ad..c8c7eb163 100644 --- a/packages/packemon/tests/helpers/loadModule.test.ts +++ b/packages/packemon/tests/helpers/loadModule.test.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from 'vitest'; import { loadModule } from '../../src/helpers/loadModule'; describe('loadModule()', () => { diff --git a/packages/packemon/tests/helpers/sortExportConditions.test.ts b/packages/packemon/tests/helpers/sortExportConditions.test.ts index 0d39746e8..53108c5c2 100644 --- a/packages/packemon/tests/helpers/sortExportConditions.test.ts +++ b/packages/packemon/tests/helpers/sortExportConditions.test.ts @@ -1,3 +1,4 @@ +import { describe, expect, it } from 'vitest'; import { sortExportConditions } from '../../src/helpers/sortExportConditions'; describe('sortExportConditions()', () => { diff --git a/packages/packemon/tests/outputs.test.ts b/packages/packemon/tests/outputs.test.ts index 24d09f1d1..20e205aae 100644 --- a/packages/packemon/tests/outputs.test.ts +++ b/packages/packemon/tests/outputs.test.ts @@ -1,18 +1,23 @@ import fs from 'node:fs'; +import { describe, expect, it, vi } from 'vitest'; import { Path } from '@boost/common'; import { Artifact } from '../src'; import { BUILDS_NO_SUPPORT, - createSnapshotSpies, getFixturePath, loadPackageAtPath, + snapshotPackageBuildOutputs, } from './helpers'; +vi.setConfig({ testTimeout: 30_000 }); + ['babel', 'swc'].forEach((transformer) => { describe(`Outputs (${transformer})`, () => { + vi.spyOn(console, 'info').mockImplementation(() => {}); + vi.spyOn(console, 'warn').mockImplementation(() => {}); + describe('artifacts', () => { const root = new Path(getFixturePath('project-rollup')); - const snapshots = createSnapshotSpies(root, true); it('builds all the artifacts with rollup', async () => { const pkg = loadPackageAtPath(root); @@ -46,11 +51,9 @@ import { pkg.artifacts.push(test); - await pkg.build({}, {}); + await pkg.build({ addEntries: false }, {}); - snapshots(pkg).forEach((ss) => { - expect(ss).toMatchSnapshot(); - }); + snapshotPackageBuildOutputs(pkg); expect(index.builds).toMatchSnapshot(); }); @@ -58,7 +61,6 @@ import { describe('bundle', () => { const root = new Path(getFixturePath('project-bundle')); - const snapshots = createSnapshotSpies(root, true); it('bundles all files into a single file with rollup', async () => { const pkg = loadPackageAtPath(root); @@ -71,17 +73,14 @@ import { pkg.artifacts.push(index); - await pkg.build({}, {}); + await pkg.build({ addEntries: false }, {}); - snapshots(pkg).forEach((ss) => { - expect(ss).toMatchSnapshot(); - }); + snapshotPackageBuildOutputs(pkg); }); }); describe('bundle with assets', () => { const root = new Path(getFixturePath('project-assets')); - const snapshots = createSnapshotSpies(root, true); BUILDS_NO_SUPPORT.forEach((build) => { it(`bundles all files and references assets (${build.platform}, ${build.format})`, async () => { @@ -95,11 +94,9 @@ import { pkg.artifacts.push(index); - await pkg.build({}, {}); + await pkg.build({ addEntries: false }, {}); - snapshots(pkg).forEach((ss) => { - expect(ss).toMatchSnapshot(); - }); + snapshotPackageBuildOutputs(pkg); }); }); @@ -114,17 +111,14 @@ import { pkg.artifacts.push(index); - await pkg.build({}, {}); + await pkg.build({ addEntries: false }, {}); - snapshots(pkg).forEach((ss) => { - expect(ss).toMatchSnapshot(); - }); + snapshotPackageBuildOutputs(pkg); }); }); describe('no bundle', () => { const root = new Path(getFixturePath('project-bundle')); - const snapshots = createSnapshotSpies(root, true); it('creates individual files for every source file', async () => { const pkg = loadPackageAtPath(root); @@ -137,17 +131,14 @@ import { pkg.artifacts.push(index); - await pkg.build({}, {}); + await pkg.build({ addEntries: false }, {}); - snapshots(pkg).forEach((ss) => { - expect(ss).toMatchSnapshot(); - }); + snapshotPackageBuildOutputs(pkg); }); }); describe('no bundle with assets', () => { const root = new Path(getFixturePath('project-assets')); - const snapshots = createSnapshotSpies(root, true); BUILDS_NO_SUPPORT.forEach((build) => { it(`creates individual files and references assets (${build.platform}, ${build.format})`, async () => { @@ -161,11 +152,9 @@ import { pkg.artifacts.push(index); - await pkg.build({}, {}); + await pkg.build({ addEntries: false }, {}); - snapshots(pkg).forEach((ss) => { - expect(ss).toMatchSnapshot(); - }); + snapshotPackageBuildOutputs(pkg); }); }); }); @@ -173,11 +162,8 @@ import { }); describe('Special formats', () => { - jest.setTimeout(30_000); - describe('cjs', () => { const root = new Path(getFixturePath('project-cjs-compat')); - const snapshots = createSnapshotSpies(root, true); it('supports .ts -> .cjs / .d.cts (compat)', async () => { const pkg = loadPackageAtPath(root); @@ -191,11 +177,9 @@ describe('Special formats', () => { pkg.artifacts.push(index); - await pkg.build({}, {}); + await pkg.build({ addEntries: false }, {}); - snapshots(pkg).forEach((ss) => { - expect(ss).toMatchSnapshot(); - }); + snapshotPackageBuildOutputs(pkg); // Declaration snapshots are not captured above because it runs in a child process expect(fs.readFileSync(root.append('cjs/index.d.cts').path(), 'utf8')).toMatchSnapshot(); @@ -205,7 +189,6 @@ describe('Special formats', () => { describe('cts', () => { const root = new Path(getFixturePath('project-cts')); - const snapshots = createSnapshotSpies(root, true); it('supports .cts -> .cjs / .d.cts', async () => { const pkg = loadPackageAtPath(root); @@ -218,11 +201,9 @@ describe('Special formats', () => { pkg.artifacts.push(index); - await pkg.build({}, {}); + await pkg.build({ addEntries: false }, {}); - snapshots(pkg).forEach((ss) => { - expect(ss).toMatchSnapshot(); - }); + snapshotPackageBuildOutputs(pkg); // Declaration snapshots are not captured above because it runs in a child process expect(fs.readFileSync(root.append('cjs/index.d.cts').path(), 'utf8')).toMatchSnapshot(); @@ -231,7 +212,6 @@ describe('Special formats', () => { describe('mts', () => { const root = new Path(getFixturePath('project-mts')); - const snapshots = createSnapshotSpies(root, true); it('supports .mts -> .mjs / .d.mts', async () => { const pkg = loadPackageAtPath(root); @@ -244,11 +224,9 @@ describe('Special formats', () => { pkg.artifacts.push(index); - await pkg.build({}, {}); + await pkg.build({ addEntries: false }, {}); - snapshots(pkg).forEach((ss) => { - expect(ss).toMatchSnapshot(); - }); + snapshotPackageBuildOutputs(pkg); // Declaration snapshots are not captured above because it runs in a child process expect(fs.readFileSync(root.append('mjs/index.d.mts').path(), 'utf8')).toMatchSnapshot(); @@ -258,7 +236,6 @@ describe('Special formats', () => { describe('Feature flags', () => { const root = new Path(getFixturePath('features')); - const snapshots = createSnapshotSpies(root, true); it('compiles', async () => { const pkg = loadPackageAtPath(root); @@ -299,12 +276,8 @@ describe('Feature flags', () => { pkg.artifacts.push(swcExternal); - await pkg.build({}, {}); + await pkg.build({ addEntries: false }, {}); - snapshots(pkg).forEach((ss) => { - if (ss[0].endsWith('.js')) { - expect(ss).toMatchSnapshot(); - } - }); + snapshotPackageBuildOutputs(pkg); }); }); diff --git a/packages/packemon/tests/rollup/config.test.ts b/packages/packemon/tests/rollup/config.test.ts index 1f3c5cfea..824247891 100644 --- a/packages/packemon/tests/rollup/config.test.ts +++ b/packages/packemon/tests/rollup/config.test.ts @@ -1,4 +1,5 @@ /* eslint-disable no-param-reassign */ +import { beforeEach, describe, expect, it, vi } from 'vitest'; import { Path } from '@boost/common'; import { Artifact } from '../../src/Artifact'; import { Package } from '../../src/Package'; @@ -9,18 +10,26 @@ import { } from '../../src/rollup/config'; import { getFixturePath } from '../helpers'; -jest.mock('@rollup/plugin-commonjs', () => () => 'commonjs()'); -jest.mock('@rollup/plugin-json', () => () => 'json()'); -jest.mock('@rollup/plugin-node-resolve', () => () => 'resolve()'); -jest.mock('@rollup/plugin-babel', () => ({ +vi.mock('@rollup/plugin-commonjs', () => ({ + default: () => 'commonjs()', +})); +vi.mock('@rollup/plugin-json', () => ({ + default: () => 'json()', +})); +vi.mock('@rollup/plugin-node-resolve', () => ({ + default: () => 'resolve()', +})); +vi.mock('@rollup/plugin-babel', () => ({ getBabelInputPlugin: (options: any) => `babelInput(${options.filename})`, getBabelOutputPlugin: (options: any) => `babelOutput(${options.filename}, ${options.moduleId || '*'})`, })); -jest.mock('rollup-plugin-node-externals', () => ({ +vi.mock('rollup-plugin-node-externals', () => ({ externals: (options: any) => `externals(${options.packagePath})`, })); -jest.mock('rollup-plugin-polyfill-node', () => () => `polyfillNode()`); +vi.mock('rollup-plugin-polyfill-node', () => ({ + default: () => `polyfillNode()`, +})); const fixturePath = new Path(getFixturePath('project-rollup')); const srcInputFile = fixturePath.append('src/index.ts').path(); @@ -118,7 +127,6 @@ describe('getRollupConfig()', () => { artifact.builds.push({ format: 'lib' }, { format: 'esm' }, { format: 'mjs' }); await expect(getRollupConfig(artifact, {})).resolves.toEqual({ - cache: undefined, external: expect.any(Function), input: { index: srcInputFile, @@ -150,6 +158,7 @@ describe('getRollupConfig()', () => { chunkFileNames: 'bundle-[hash].js', dir: fixturePath.append('esm').path(), entryFileNames: '[name].js', + exports: 'named', format: 'esm', generatedCode: { ...generatedCode, @@ -169,6 +178,7 @@ describe('getRollupConfig()', () => { chunkFileNames: 'bundle-[hash].mjs', dir: fixturePath.append('mjs').path(), entryFileNames: '[name].mjs', + exports: 'named', format: 'esm', generatedCode: { ...generatedCode, @@ -424,7 +434,7 @@ describe('getRollupOutputConfig()', () => { }); it('passes build params to config', () => { - const spy = jest.fn(); + const spy = vi.fn(); getRollupOutputConfig(artifact, {}, 'lib', { rollupOutput: spy, @@ -549,20 +559,20 @@ describe('getRollupOutputConfig()', () => { expect(getRollupOutputConfig(artifact, {}, 'cjs').exports).toBe('auto'); }); - it('disables auto-exports for `mjs` format', () => { - expect(getRollupOutputConfig(artifact, {}, 'mjs').exports).toBeUndefined(); + it('enables auto-exports for `mjs` format', () => { + expect(getRollupOutputConfig(artifact, {}, 'mjs').exports).toBe('named'); }); - it('disables auto-exports for `esm` format', () => { + it('enables auto-exports for `esm` format', () => { artifact.platform = 'browser'; - expect(getRollupOutputConfig(artifact, {}, 'esm').exports).toBeUndefined(); + expect(getRollupOutputConfig(artifact, {}, 'esm').exports).toBe('named'); }); - it('disables auto-exports for `umd` format', () => { + it('enables auto-exports for `umd` format', () => { artifact.platform = 'browser'; - expect(getRollupOutputConfig(artifact, {}, 'umd').exports).toBeUndefined(); + expect(getRollupOutputConfig(artifact, {}, 'umd').exports).toBe('named'); }); }); @@ -577,6 +587,7 @@ describe('getRollupOutputConfig()', () => { chunkFileNames: 'bundle-[hash].js', dir: fixturePath.append('umd').path(), entryFileNames: '[name].js', + exports: 'named', format: 'esm', generatedCode: { ...generatedCode, diff --git a/packages/packemon/tests/rollup/plugins/__fixtures__/src/components/MyComponent/MySubComponent/bar.mjs b/packages/packemon/tests/rollup/plugins/__fixtures__/src/components/MyComponent/MySubComponent/bar.mjs index 42754cdea..1c118b8c1 100644 --- a/packages/packemon/tests/rollup/plugins/__fixtures__/src/components/MyComponent/MySubComponent/bar.mjs +++ b/packages/packemon/tests/rollup/plugins/__fixtures__/src/components/MyComponent/MySubComponent/bar.mjs @@ -1,3 +1,3 @@ -import svg from './icons/test.svg'; +import svg from './test.svg'; export const newSvg = `new: ${svg}`; diff --git a/packages/packemon/tests/rollup/plugins/__fixtures__/src/components/MyComponent/MySubComponent/test.svg b/packages/packemon/tests/rollup/plugins/__fixtures__/src/components/MyComponent/MySubComponent/test.svg index fc77fe353..32086564d 100644 --- a/packages/packemon/tests/rollup/plugins/__fixtures__/src/components/MyComponent/MySubComponent/test.svg +++ b/packages/packemon/tests/rollup/plugins/__fixtures__/src/components/MyComponent/MySubComponent/test.svg @@ -1 +1 @@ -export default 'test.svg test contents'; \ No newline at end of file +export default ''; diff --git a/packages/packemon/tests/rollup/plugins/addBinShebang.test.ts b/packages/packemon/tests/rollup/plugins/addBinShebang.test.ts index 3386e88f8..a18fd49c2 100644 --- a/packages/packemon/tests/rollup/plugins/addBinShebang.test.ts +++ b/packages/packemon/tests/rollup/plugins/addBinShebang.test.ts @@ -1,5 +1,6 @@ import path from 'node:path'; import { InputOption, OutputOptions, rollup } from 'rollup'; +import { describe, expect, it } from 'vitest'; import { addBinShebang } from '../../../src/rollup/plugins/addBinShebang'; async function transform(input: InputOption, options: OutputOptions = {}): Promise { diff --git a/packages/packemon/tests/rollup/plugins/copyAndRefAssets.test.ts b/packages/packemon/tests/rollup/plugins/copyAndRefAssets.test.ts index 25a010212..ec6ee69e2 100644 --- a/packages/packemon/tests/rollup/plugins/copyAndRefAssets.test.ts +++ b/packages/packemon/tests/rollup/plugins/copyAndRefAssets.test.ts @@ -1,59 +1,52 @@ +/* eslint-disable unicorn/prefer-module */ + import path from 'node:path'; -import { InputOption, rollup } from 'rollup'; +import { rollup } from 'rollup'; +import { describe, expect, it, vi } from 'vitest'; import { VirtualPath } from '@boost/common'; import commonjs from '@rollup/plugin-commonjs'; import { copyAndRefAssets } from '../../../src/rollup/plugins/copyAndRefAssets'; - -async function transform( - input: InputOption, - assetsToCopy: Record, -): Promise { - const copyRefPlugin = copyAndRefAssets({ dir: '/root/fakeAssets' }, assetsToCopy); - copyRefPlugin.buildStart = () => Promise.resolve(); - copyRefPlugin.generateBundle = () => Promise.resolve(); - - const bundle = await rollup({ - input, - external: (id) => id.endsWith('.svg'), // treat .svg files as external - plugins: [commonjs(), copyRefPlugin], - }); - - const { output } = await bundle.generate({ - dir: 'out', - format: 'cjs', - }); - - return output[0].code || ''; -} - -jest.mock('fs', () => { - const originalFs = jest.requireActual('fs'); - return { - __esModule: true, - ...originalFs, - mkdir: jest.fn(), - readFileSync: jest.fn((p, options) => { - if (typeof p === 'string' && p.endsWith('.svg')) { - return 'Mock SVG Content'; - } - return originalFs.readFileSync(p, options); - }), - }; -}); +import { createStubbedFileSystem } from '../../helpers'; describe('copyAndRefAssets()', () => { - // eslint-disable-next-line unicorn/prefer-module const fixturePath1 = path.join(__dirname, '__fixtures__/src/components/MyComponent/entry.mjs'); const fixturePath2 = path.join( - // eslint-disable-next-line unicorn/prefer-module __dirname, '__fixtures__/src/components/AnotherComponent/anotherEntry.mjs', ); - it('Should fix overlapping paths', async () => { + + it('should fix overlapping paths', async () => { const assetsToCopy = {}; - await transform({ another: fixturePath1, myComponent: fixturePath2 }, assetsToCopy); - expect(Object.keys(assetsToCopy)[0]).toMatch( - 'packemon/tests/rollup/plugins/__fixtures__/src/components/MyComponent/MySubComponent/icons/test.svg', + const fs = createStubbedFileSystem(); + + const copyRefPlugin = copyAndRefAssets( + { + dir: '/root/fakeAssets', + fs, + root: path.join(__dirname, '__fixtures__'), + }, + assetsToCopy, ); + copyRefPlugin.buildStart = vi.fn(); + copyRefPlugin.generateBundle = vi.fn(); + + const bundle = await rollup({ + input: { another: fixturePath1, myComponent: fixturePath2 }, + // external: (id) => id.endsWith('.svg'), // treat .svg files as external + plugins: [commonjs(), copyRefPlugin], + }); + + await bundle.generate({ + dir: 'out', + format: 'cjs', + }); + + const result = new VirtualPath('/root/fakeAssets/test-7751cc4a.svg'); + result.path(); + + expect(assetsToCopy).toEqual({ + [path.join(__dirname, '__fixtures__/src/components/MyComponent/MySubComponent/test.svg')]: + result, + }); }); }); diff --git a/packages/packemon/tests/swc/__snapshots__/config.test.ts.snap b/packages/packemon/tests/swc/__snapshots__/config.test.ts.snap index e067cff52..525729ce0 100644 --- a/packages/packemon/tests/swc/__snapshots__/config.test.ts.snap +++ b/packages/packemon/tests/swc/__snapshots__/config.test.ts.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`getSwcInputConfig() can mutate config 1`] = ` +exports[`getSwcInputConfig() > can mutate config 1`] = ` { "caller": { "name": "packemon", @@ -31,7 +31,7 @@ exports[`getSwcInputConfig() can mutate config 1`] = ` } `; -exports[`getSwcInputConfig() doesnt include typescript decorators if \`typescript\` feature flag is false 1`] = ` +exports[`getSwcInputConfig() > doesnt include typescript decorators if \`typescript\` feature flag is false 1`] = ` { "caller": { "name": "packemon", @@ -60,7 +60,7 @@ exports[`getSwcInputConfig() doesnt include typescript decorators if \`typescrip } `; -exports[`getSwcInputConfig() includes no parser/transformer options by default 1`] = ` +exports[`getSwcInputConfig() > includes no parser/transformer options by default 1`] = ` { "caller": { "name": "packemon", @@ -89,7 +89,7 @@ exports[`getSwcInputConfig() includes no parser/transformer options by default 1 } `; -exports[`getSwcInputConfig() includes react transformer if \`react\` feature flag is true 1`] = ` +exports[`getSwcInputConfig() > includes react transformer if \`react\` feature flag is true 1`] = ` { "optimizer": undefined, "react": { @@ -99,7 +99,7 @@ exports[`getSwcInputConfig() includes react transformer if \`react\` feature fla } `; -exports[`getSwcInputConfig() includes typescript decorators if \`typescript\` and \`decorators\` feature flag is true 1`] = ` +exports[`getSwcInputConfig() > includes typescript decorators if \`typescript\` and \`decorators\` feature flag is true 1`] = ` { "caller": { "name": "packemon", @@ -130,7 +130,7 @@ exports[`getSwcInputConfig() includes typescript decorators if \`typescript\` an } `; -exports[`getSwcInputConfig() includes typescript parser if \`typescript\` feature flag is true 1`] = ` +exports[`getSwcInputConfig() > includes typescript parser if \`typescript\` feature flag is true 1`] = ` { "dynamicImport": true, "syntax": "typescript", @@ -138,7 +138,7 @@ exports[`getSwcInputConfig() includes typescript parser if \`typescript\` featur } `; -exports[`getSwcInputConfig() supports private properties with decorators if dep exists 1`] = ` +exports[`getSwcInputConfig() > supports private properties with decorators if dep exists 1`] = ` { "caller": { "name": "packemon", @@ -169,7 +169,7 @@ exports[`getSwcInputConfig() supports private properties with decorators if dep } `; -exports[`getSwcOutputConfig() can mutate config 1`] = ` +exports[`getSwcOutputConfig() > can mutate config 1`] = ` { "caller": { "name": "packemon", @@ -210,7 +210,7 @@ exports[`getSwcOutputConfig() can mutate config 1`] = ` } `; -exports[`getSwcOutputConfig() handles preset-env: browser + esm + current 1`] = ` +exports[`getSwcOutputConfig() > handles preset-env: browser + esm + current 1`] = ` { "bugfixes": true, "loose": false, @@ -220,7 +220,7 @@ exports[`getSwcOutputConfig() handles preset-env: browser + esm + current 1`] = } `; -exports[`getSwcOutputConfig() handles preset-env: browser + esm + experimental 1`] = ` +exports[`getSwcOutputConfig() > handles preset-env: browser + esm + experimental 1`] = ` { "bugfixes": true, "loose": false, @@ -230,7 +230,7 @@ exports[`getSwcOutputConfig() handles preset-env: browser + esm + experimental 1 } `; -exports[`getSwcOutputConfig() handles preset-env: browser + esm + legacy 1`] = ` +exports[`getSwcOutputConfig() > handles preset-env: browser + esm + legacy 1`] = ` { "bugfixes": true, "loose": false, @@ -240,7 +240,7 @@ exports[`getSwcOutputConfig() handles preset-env: browser + esm + legacy 1`] = ` } `; -exports[`getSwcOutputConfig() handles preset-env: browser + esm + stable 1`] = ` +exports[`getSwcOutputConfig() > handles preset-env: browser + esm + stable 1`] = ` { "bugfixes": true, "loose": false, @@ -250,7 +250,7 @@ exports[`getSwcOutputConfig() handles preset-env: browser + esm + stable 1`] = ` } `; -exports[`getSwcOutputConfig() handles preset-env: browser + lib + current 1`] = ` +exports[`getSwcOutputConfig() > handles preset-env: browser + lib + current 1`] = ` { "bugfixes": true, "loose": false, @@ -260,7 +260,7 @@ exports[`getSwcOutputConfig() handles preset-env: browser + lib + current 1`] = } `; -exports[`getSwcOutputConfig() handles preset-env: browser + lib + experimental 1`] = ` +exports[`getSwcOutputConfig() > handles preset-env: browser + lib + experimental 1`] = ` { "bugfixes": true, "loose": false, @@ -270,7 +270,7 @@ exports[`getSwcOutputConfig() handles preset-env: browser + lib + experimental 1 } `; -exports[`getSwcOutputConfig() handles preset-env: browser + lib + legacy 1`] = ` +exports[`getSwcOutputConfig() > handles preset-env: browser + lib + legacy 1`] = ` { "bugfixes": true, "loose": false, @@ -280,7 +280,7 @@ exports[`getSwcOutputConfig() handles preset-env: browser + lib + legacy 1`] = ` } `; -exports[`getSwcOutputConfig() handles preset-env: browser + lib + stable 1`] = ` +exports[`getSwcOutputConfig() > handles preset-env: browser + lib + stable 1`] = ` { "bugfixes": true, "loose": false, @@ -290,7 +290,7 @@ exports[`getSwcOutputConfig() handles preset-env: browser + lib + stable 1`] = ` } `; -exports[`getSwcOutputConfig() handles preset-env: browser + umd + current 1`] = ` +exports[`getSwcOutputConfig() > handles preset-env: browser + umd + current 1`] = ` { "bugfixes": true, "loose": false, @@ -300,7 +300,7 @@ exports[`getSwcOutputConfig() handles preset-env: browser + umd + current 1`] = } `; -exports[`getSwcOutputConfig() handles preset-env: browser + umd + experimental 1`] = ` +exports[`getSwcOutputConfig() > handles preset-env: browser + umd + experimental 1`] = ` { "bugfixes": true, "loose": false, @@ -310,7 +310,7 @@ exports[`getSwcOutputConfig() handles preset-env: browser + umd + experimental 1 } `; -exports[`getSwcOutputConfig() handles preset-env: browser + umd + legacy 1`] = ` +exports[`getSwcOutputConfig() > handles preset-env: browser + umd + legacy 1`] = ` { "bugfixes": true, "loose": false, @@ -320,7 +320,7 @@ exports[`getSwcOutputConfig() handles preset-env: browser + umd + legacy 1`] = ` } `; -exports[`getSwcOutputConfig() handles preset-env: browser + umd + stable 1`] = ` +exports[`getSwcOutputConfig() > handles preset-env: browser + umd + stable 1`] = ` { "bugfixes": true, "loose": false, @@ -330,7 +330,7 @@ exports[`getSwcOutputConfig() handles preset-env: browser + umd + stable 1`] = ` } `; -exports[`getSwcOutputConfig() handles preset-env: native + lib + current 1`] = ` +exports[`getSwcOutputConfig() > handles preset-env: native + lib + current 1`] = ` { "bugfixes": true, "loose": false, @@ -340,7 +340,7 @@ exports[`getSwcOutputConfig() handles preset-env: native + lib + current 1`] = ` } `; -exports[`getSwcOutputConfig() handles preset-env: native + lib + experimental 1`] = ` +exports[`getSwcOutputConfig() > handles preset-env: native + lib + experimental 1`] = ` { "bugfixes": true, "loose": false, @@ -350,7 +350,7 @@ exports[`getSwcOutputConfig() handles preset-env: native + lib + experimental 1` } `; -exports[`getSwcOutputConfig() handles preset-env: native + lib + legacy 1`] = ` +exports[`getSwcOutputConfig() > handles preset-env: native + lib + legacy 1`] = ` { "bugfixes": true, "loose": false, @@ -360,7 +360,7 @@ exports[`getSwcOutputConfig() handles preset-env: native + lib + legacy 1`] = ` } `; -exports[`getSwcOutputConfig() handles preset-env: native + lib + stable 1`] = ` +exports[`getSwcOutputConfig() > handles preset-env: native + lib + stable 1`] = ` { "bugfixes": true, "loose": false, @@ -370,7 +370,7 @@ exports[`getSwcOutputConfig() handles preset-env: native + lib + stable 1`] = ` } `; -exports[`getSwcOutputConfig() handles preset-env: node + cjs + current 1`] = ` +exports[`getSwcOutputConfig() > handles preset-env: node + cjs + current 1`] = ` { "bugfixes": true, "loose": false, @@ -382,7 +382,7 @@ exports[`getSwcOutputConfig() handles preset-env: node + cjs + current 1`] = ` } `; -exports[`getSwcOutputConfig() handles preset-env: node + cjs + experimental 1`] = ` +exports[`getSwcOutputConfig() > handles preset-env: node + cjs + experimental 1`] = ` { "bugfixes": true, "loose": false, @@ -394,7 +394,7 @@ exports[`getSwcOutputConfig() handles preset-env: node + cjs + experimental 1`] } `; -exports[`getSwcOutputConfig() handles preset-env: node + cjs + legacy 1`] = ` +exports[`getSwcOutputConfig() > handles preset-env: node + cjs + legacy 1`] = ` { "bugfixes": true, "loose": false, @@ -406,7 +406,7 @@ exports[`getSwcOutputConfig() handles preset-env: node + cjs + legacy 1`] = ` } `; -exports[`getSwcOutputConfig() handles preset-env: node + cjs + stable 1`] = ` +exports[`getSwcOutputConfig() > handles preset-env: node + cjs + stable 1`] = ` { "bugfixes": true, "loose": false, @@ -418,7 +418,7 @@ exports[`getSwcOutputConfig() handles preset-env: node + cjs + stable 1`] = ` } `; -exports[`getSwcOutputConfig() handles preset-env: node + lib + current 1`] = ` +exports[`getSwcOutputConfig() > handles preset-env: node + lib + current 1`] = ` { "bugfixes": true, "loose": false, @@ -430,7 +430,7 @@ exports[`getSwcOutputConfig() handles preset-env: node + lib + current 1`] = ` } `; -exports[`getSwcOutputConfig() handles preset-env: node + lib + experimental 1`] = ` +exports[`getSwcOutputConfig() > handles preset-env: node + lib + experimental 1`] = ` { "bugfixes": true, "loose": false, @@ -442,7 +442,7 @@ exports[`getSwcOutputConfig() handles preset-env: node + lib + experimental 1`] } `; -exports[`getSwcOutputConfig() handles preset-env: node + lib + legacy 1`] = ` +exports[`getSwcOutputConfig() > handles preset-env: node + lib + legacy 1`] = ` { "bugfixes": true, "loose": false, @@ -454,7 +454,7 @@ exports[`getSwcOutputConfig() handles preset-env: node + lib + legacy 1`] = ` } `; -exports[`getSwcOutputConfig() handles preset-env: node + lib + stable 1`] = ` +exports[`getSwcOutputConfig() > handles preset-env: node + lib + stable 1`] = ` { "bugfixes": true, "loose": false, @@ -466,7 +466,7 @@ exports[`getSwcOutputConfig() handles preset-env: node + lib + stable 1`] = ` } `; -exports[`getSwcOutputConfig() handles preset-env: node + mjs + current 1`] = ` +exports[`getSwcOutputConfig() > handles preset-env: node + mjs + current 1`] = ` { "bugfixes": true, "loose": false, @@ -478,7 +478,7 @@ exports[`getSwcOutputConfig() handles preset-env: node + mjs + current 1`] = ` } `; -exports[`getSwcOutputConfig() handles preset-env: node + mjs + experimental 1`] = ` +exports[`getSwcOutputConfig() > handles preset-env: node + mjs + experimental 1`] = ` { "bugfixes": true, "loose": false, @@ -490,7 +490,7 @@ exports[`getSwcOutputConfig() handles preset-env: node + mjs + experimental 1`] } `; -exports[`getSwcOutputConfig() handles preset-env: node + mjs + legacy 1`] = ` +exports[`getSwcOutputConfig() > handles preset-env: node + mjs + legacy 1`] = ` { "bugfixes": true, "loose": false, @@ -502,7 +502,7 @@ exports[`getSwcOutputConfig() handles preset-env: node + mjs + legacy 1`] = ` } `; -exports[`getSwcOutputConfig() handles preset-env: node + mjs + stable 1`] = ` +exports[`getSwcOutputConfig() > handles preset-env: node + mjs + stable 1`] = ` { "bugfixes": true, "loose": false, @@ -514,7 +514,7 @@ exports[`getSwcOutputConfig() handles preset-env: node + mjs + stable 1`] = ` } `; -exports[`getSwcOutputConfig() transforms async/await to promises when \`browser\` or \`native\` 1`] = ` +exports[`getSwcOutputConfig() > transforms async/await to promises when \`browser\` or \`native\` 1`] = ` { "caller": { "name": "packemon", @@ -553,7 +553,7 @@ exports[`getSwcOutputConfig() transforms async/await to promises when \`browser\ } `; -exports[`getSwcOutputConfig() transforms async/await to promises when \`browser\` or \`native\` 2`] = ` +exports[`getSwcOutputConfig() > transforms async/await to promises when \`browser\` or \`native\` 2`] = ` { "caller": { "name": "packemon", @@ -585,14 +585,14 @@ exports[`getSwcOutputConfig() transforms async/await to promises when \`browser\ }, }, "module": { - "ignoreDynamic": false, + "ignoreDynamic": true, "type": "commonjs", }, "swcrc": false, } `; -exports[`getSwcOutputConfig() uses built-in destructuring and object spread when \`current\` or \`experimental\` 1`] = ` +exports[`getSwcOutputConfig() > uses built-in destructuring and object spread when \`current\` or \`experimental\` 1`] = ` { "caller": { "name": "packemon", @@ -633,7 +633,7 @@ exports[`getSwcOutputConfig() uses built-in destructuring and object spread when } `; -exports[`getSwcOutputConfig() uses built-in destructuring and object spread when \`current\` or \`experimental\` 2`] = ` +exports[`getSwcOutputConfig() > uses built-in destructuring and object spread when \`current\` or \`experimental\` 2`] = ` { "caller": { "name": "packemon", diff --git a/packages/packemon/tests/swc/config.test.ts b/packages/packemon/tests/swc/config.test.ts index 942515d3c..ce5e9dd4f 100644 --- a/packages/packemon/tests/swc/config.test.ts +++ b/packages/packemon/tests/swc/config.test.ts @@ -1,5 +1,6 @@ /* eslint-disable no-param-reassign */ +import { describe, expect, it, vi } from 'vitest'; import { getSwcInputConfig, getSwcOutputConfig } from '../../src/swc/config'; import { Format, Platform, Support } from '../../src/types'; @@ -38,7 +39,7 @@ describe('getSwcInputConfig()', () => { }); it('supports private properties with decorators if dep exists', () => { - const spy = jest.spyOn(bundleArtifact.package, 'hasDependency').mockImplementation(() => true); + const spy = vi.spyOn(bundleArtifact.package, 'hasDependency').mockImplementation(() => true); expect( getSwcInputConfig(bundleArtifact, { decorators: true, typescript: true }), @@ -67,7 +68,7 @@ describe('getSwcInputConfig()', () => { }); function renderPresetEnv(platform: Platform, format: Format, support: Support) { - test(`handles preset-env: ${platform} + ${format} + ${support}`, () => { + it(`handles preset-env: ${platform} + ${format} + ${support}`, () => { expect(getSwcOutputConfig(platform, support, format, {})?.env).toMatchSnapshot(); }); } @@ -125,7 +126,7 @@ describe('getSwcOutputConfig()', () => { }); it('passes build params to config', () => { - const spy = jest.fn(); + const spy = vi.fn(); getSwcOutputConfig( 'browser', diff --git a/scenarios/jest/babel.config.js b/scenarios/jest/babel.config.js new file mode 100644 index 000000000..96394ca3a --- /dev/null +++ b/scenarios/jest/babel.config.js @@ -0,0 +1,11 @@ +module.exports = { + presets: [ + [ + 'moon', + { + decorators: true, + react: 'automatic', + }, + ], + ], +}; diff --git a/scenarios/jest/package.json b/scenarios/jest/package.json index 77797b80c..6e9505bb2 100644 --- a/scenarios/jest/package.json +++ b/scenarios/jest/package.json @@ -4,7 +4,9 @@ "test": "jest ." }, "devDependencies": { + "babel-preset-moon": "^2.0.14", "jest": "^29.7.0", - "jest-environment-jsdom": "^29.7.0" + "jest-environment-jsdom": "^29.7.0", + "jest-preset-moon": "^2.0.7" } } diff --git a/scenarios/vite/package.json b/scenarios/vite/package.json index e16c453aa..e26f3ef11 100644 --- a/scenarios/vite/package.json +++ b/scenarios/vite/package.json @@ -4,6 +4,6 @@ "build": "vite build --outDir build" }, "devDependencies": { - "vite": "^5.1.1" + "vite": "^5.1.3" } } diff --git a/scenarios/webpack/package.json b/scenarios/webpack/package.json index ae3eba6bc..32f2659fe 100644 --- a/scenarios/webpack/package.json +++ b/scenarios/webpack/package.json @@ -4,7 +4,7 @@ "build": "webpack build ../index.js --mode development --output-path ./build --no-devtool" }, "devDependencies": { - "webpack": "^5.90.1", + "webpack": "^5.90.3", "webpack-cli": "^5.1.4" } } diff --git a/tests/__fixtures__/examples/package.json b/tests/__fixtures__/examples/package.json index aa8ad6f8d..906ab43ba 100644 --- a/tests/__fixtures__/examples/package.json +++ b/tests/__fixtures__/examples/package.json @@ -1,14 +1,6 @@ { "name": "examples", "packemon": {}, - "files": [ - "cjs/**/*.{cjs,map}", - "esm/**/*.{js,map}", - "lib/**/*.{js,map}", - "mjs/**/*.{mjs,map}", - "src/**/*.{ts,tsx,json}", - "umd/**/*.{js,map}" - ], "peerDependencies": { "react": ">=17.0.0", "typescript": "*" diff --git a/tests/__fixtures__/project-rollup/src/test-utils/base.ts b/tests/__fixtures__/project-rollup/src/test-utils/base.ts index ce87a0346..be84a2bb5 100644 --- a/tests/__fixtures__/project-rollup/src/test-utils/base.ts +++ b/tests/__fixtures__/project-rollup/src/test-utils/base.ts @@ -1,3 +1,5 @@ +import { vi } from 'vitest'; + class Spy { called: boolean = false; @@ -9,7 +11,7 @@ class Spy { export function spy() { const inst = new Spy(); - return jest.fn(inst.mock); + return vi.fn(inst.mock); } export async function wait(): Promise {} diff --git a/vitest.config.ts b/vitest.config.ts new file mode 100644 index 000000000..9e8ef4e63 --- /dev/null +++ b/vitest.config.ts @@ -0,0 +1,15 @@ +/* eslint-disable import/no-default-export */ + +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { defineConfig } from 'vitest/config'; + +export default defineConfig({ + resolve: { + conditions: ['node'], + }, + test: { + passWithNoTests: true, + setupFiles: [path.join(path.dirname(fileURLToPath(import.meta.url)), './tests/setup.ts')], + }, +}); diff --git a/website/docs/features.md b/website/docs/features.md index a90a40b34..34876f9ee 100644 --- a/website/docs/features.md +++ b/website/docs/features.md @@ -45,7 +45,7 @@ The following plugins are enabled when one of their conditions are met. expressions. - [`babel-plugin-conditional-invariant`](#invariant-checks) - Always enabled. Will wrap `invariant()` calls with `process.env.NODE_ENV` conditionals. -- [`babel-plugin-cjs-esm-interop`](#cjs--esm-interoperability) +- [`babel-plugin-cjs-esm-interop`](#commonjs--ecmascript-interoperability) - Enabled when package [platform](./config.md#platforms) is configured to `node`. Will convert ESM code to CJS and vice-versa. diff --git a/website/docs/install.mdx b/website/docs/install.mdx index 66df1fb41..c067b58d4 100644 --- a/website/docs/install.mdx +++ b/website/docs/install.mdx @@ -51,7 +51,7 @@ npx packemon scaffold --packageManager npm ./mylib Scaffolding a new project will... - Align with the [defined file structure](./setup.mdx#package-structure). -- Create config files for common developer tools (Babel, ESLint, Jest, TypeScript, etc), based on +- Create config files for common developer tools (Babel, ESLint, Vitest, TypeScript, etc), based on [moonrepo presets](https://github.com/moonrepo/dev). - Create package specific files like `package.json`, readme's, and licenses. - Create example source and test files. diff --git a/website/docs/scaffold.md b/website/docs/scaffold.md index 3a0baf18b..f36837df7 100644 --- a/website/docs/scaffold.md +++ b/website/docs/scaffold.md @@ -31,7 +31,7 @@ The following templates can be scaffolded. Structures a project to be a monorepo of many packages. -- Creates config files for common developer tools (Babel, ESLint, Jest, TypeScript, etc), based on +- Creates config files for common developer tools (Babel, ESLint, Vitest, TypeScript, etc), based on [moonrepo presets](https://github.com/moonrepo/dev). - Creates a `packages` folder where all packages will exist. Create a package with the `monorepo-package` template. @@ -52,7 +52,7 @@ first! Structures a project to be a polyrepo. Creates a single npm package within the current folder. -- Creates config files for common developer tools (Babel, ESLint, Jest, TypeScript, etc), based on +- Creates config files for common developer tools (Babel, ESLint, Vitest, TypeScript, etc), based on [moonrepo presets](https://github.com/moonrepo/dev). - Creates `src` and `tests` folders with example TypeScript files. - Creates a `package.json` with information gathered from the prompts. diff --git a/website/moon.yml b/website/moon.yml index d190d88b2..ceafc03f3 100644 --- a/website/moon.yml +++ b/website/moon.yml @@ -2,7 +2,7 @@ type: 'application' workspace: inheritedTasks: - exclude: ['build'] + exclude: ['build', 'test'] tasks: build: diff --git a/website/package.json b/website/package.json index c0bfddd9d..c777071e4 100644 --- a/website/package.json +++ b/website/package.json @@ -6,7 +6,7 @@ "@docusaurus/core": "^3.1.1", "@docusaurus/module-type-aliases": "^3.1.1", "@docusaurus/preset-classic": "^3.1.1", - "@mdx-js/react": "^3.0.0", + "@mdx-js/react": "^3.0.1", "clsx": "^2.1.0", "docusaurus-plugin-typedoc-api": "^4.1.0", "react": "^18.2.0", diff --git a/yarn.lock b/yarn.lock index d03514bb8..ff1062036 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3384,15 +3384,15 @@ __metadata: languageName: node linkType: hard -"@mdx-js/react@npm:^3.0.0": - version: 3.0.0 - resolution: "@mdx-js/react@npm:3.0.0" +"@mdx-js/react@npm:^3.0.0, @mdx-js/react@npm:^3.0.1": + version: 3.0.1 + resolution: "@mdx-js/react@npm:3.0.1" dependencies: "@types/mdx": "npm:^2.0.0" peerDependencies: "@types/react": ">=16" react: ">=16" - checksum: 10/6d05cd3871eabbcc86df5042981692eccea55b5c31cbf39952bef0f41b38f2c4abeb357fed456a16c1472a0877b2f7e842341117034a3f1ddcb40b4840c33731 + checksum: 10/d566407af11e76f498f8133fbfa8a9d8a2ad80dc7a66ca109d29fcb92e953a2d2d7aaedc0c28571d126f1967faeb126dd2e4ab4ea474c994bf5c76fa204c5997 languageName: node linkType: hard @@ -3423,17 +3423,17 @@ __metadata: languageName: node linkType: hard -"@moonrepo/cli@npm:^1.21.3": - version: 1.21.3 - resolution: "@moonrepo/cli@npm:1.21.3" +"@moonrepo/cli@npm:^1.21.4": + version: 1.21.4 + resolution: "@moonrepo/cli@npm:1.21.4" dependencies: - "@moonrepo/core-linux-arm64-gnu": "npm:1.21.3" - "@moonrepo/core-linux-arm64-musl": "npm:1.21.3" - "@moonrepo/core-linux-x64-gnu": "npm:1.21.3" - "@moonrepo/core-linux-x64-musl": "npm:1.21.3" - "@moonrepo/core-macos-arm64": "npm:1.21.3" - "@moonrepo/core-macos-x64": "npm:1.21.3" - "@moonrepo/core-windows-x64-msvc": "npm:1.21.3" + "@moonrepo/core-linux-arm64-gnu": "npm:1.21.4" + "@moonrepo/core-linux-arm64-musl": "npm:1.21.4" + "@moonrepo/core-linux-x64-gnu": "npm:1.21.4" + "@moonrepo/core-linux-x64-musl": "npm:1.21.4" + "@moonrepo/core-macos-arm64": "npm:1.21.4" + "@moonrepo/core-macos-x64": "npm:1.21.4" + "@moonrepo/core-windows-x64-msvc": "npm:1.21.4" detect-libc: "npm:^2.0.2" dependenciesMeta: "@moonrepo/core-linux-arm64-gnu": @@ -3452,55 +3452,55 @@ __metadata: optional: true bin: moon: moon - checksum: 10/64cd426d69189310482128916c5f1974bc2f0b0e4ce98af1762f2f274044334312a37458f288c542ddb519b905121dc4fe724f3d4f3a5da482d9722a09045a65 + checksum: 10/78e640d7cb65d158563c035ef883a9f36c56cd19b92232e0a01cf73e11750d8decb50493c378a7af3fa0b9aa61254262ad16eaadbdff0566a9017ffb88c2a9ae languageName: node linkType: hard -"@moonrepo/core-linux-arm64-gnu@npm:1.21.3": - version: 1.21.3 - resolution: "@moonrepo/core-linux-arm64-gnu@npm:1.21.3" +"@moonrepo/core-linux-arm64-gnu@npm:1.21.4": + version: 1.21.4 + resolution: "@moonrepo/core-linux-arm64-gnu@npm:1.21.4" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@moonrepo/core-linux-arm64-musl@npm:1.21.3": - version: 1.21.3 - resolution: "@moonrepo/core-linux-arm64-musl@npm:1.21.3" +"@moonrepo/core-linux-arm64-musl@npm:1.21.4": + version: 1.21.4 + resolution: "@moonrepo/core-linux-arm64-musl@npm:1.21.4" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@moonrepo/core-linux-x64-gnu@npm:1.21.3": - version: 1.21.3 - resolution: "@moonrepo/core-linux-x64-gnu@npm:1.21.3" +"@moonrepo/core-linux-x64-gnu@npm:1.21.4": + version: 1.21.4 + resolution: "@moonrepo/core-linux-x64-gnu@npm:1.21.4" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@moonrepo/core-linux-x64-musl@npm:1.21.3": - version: 1.21.3 - resolution: "@moonrepo/core-linux-x64-musl@npm:1.21.3" +"@moonrepo/core-linux-x64-musl@npm:1.21.4": + version: 1.21.4 + resolution: "@moonrepo/core-linux-x64-musl@npm:1.21.4" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@moonrepo/core-macos-arm64@npm:1.21.3": - version: 1.21.3 - resolution: "@moonrepo/core-macos-arm64@npm:1.21.3" +"@moonrepo/core-macos-arm64@npm:1.21.4": + version: 1.21.4 + resolution: "@moonrepo/core-macos-arm64@npm:1.21.4" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@moonrepo/core-macos-x64@npm:1.21.3": - version: 1.21.3 - resolution: "@moonrepo/core-macos-x64@npm:1.21.3" +"@moonrepo/core-macos-x64@npm:1.21.4": + version: 1.21.4 + resolution: "@moonrepo/core-macos-x64@npm:1.21.4" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@moonrepo/core-windows-x64-msvc@npm:1.21.3": - version: 1.21.3 - resolution: "@moonrepo/core-windows-x64-msvc@npm:1.21.3" +"@moonrepo/core-windows-x64-msvc@npm:1.21.4": + version: 1.21.4 + resolution: "@moonrepo/core-windows-x64-msvc@npm:1.21.4" conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -5471,91 +5471,91 @@ __metadata: languageName: node linkType: hard -"@swc/core-darwin-arm64@npm:1.4.0": - version: 1.4.0 - resolution: "@swc/core-darwin-arm64@npm:1.4.0" +"@swc/core-darwin-arm64@npm:1.4.2": + version: 1.4.2 + resolution: "@swc/core-darwin-arm64@npm:1.4.2" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@swc/core-darwin-x64@npm:1.4.0": - version: 1.4.0 - resolution: "@swc/core-darwin-x64@npm:1.4.0" +"@swc/core-darwin-x64@npm:1.4.2": + version: 1.4.2 + resolution: "@swc/core-darwin-x64@npm:1.4.2" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@swc/core-linux-arm-gnueabihf@npm:1.4.0": - version: 1.4.0 - resolution: "@swc/core-linux-arm-gnueabihf@npm:1.4.0" +"@swc/core-linux-arm-gnueabihf@npm:1.4.2": + version: 1.4.2 + resolution: "@swc/core-linux-arm-gnueabihf@npm:1.4.2" conditions: os=linux & cpu=arm languageName: node linkType: hard -"@swc/core-linux-arm64-gnu@npm:1.4.0": - version: 1.4.0 - resolution: "@swc/core-linux-arm64-gnu@npm:1.4.0" +"@swc/core-linux-arm64-gnu@npm:1.4.2": + version: 1.4.2 + resolution: "@swc/core-linux-arm64-gnu@npm:1.4.2" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@swc/core-linux-arm64-musl@npm:1.4.0": - version: 1.4.0 - resolution: "@swc/core-linux-arm64-musl@npm:1.4.0" +"@swc/core-linux-arm64-musl@npm:1.4.2": + version: 1.4.2 + resolution: "@swc/core-linux-arm64-musl@npm:1.4.2" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@swc/core-linux-x64-gnu@npm:1.4.0": - version: 1.4.0 - resolution: "@swc/core-linux-x64-gnu@npm:1.4.0" +"@swc/core-linux-x64-gnu@npm:1.4.2": + version: 1.4.2 + resolution: "@swc/core-linux-x64-gnu@npm:1.4.2" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@swc/core-linux-x64-musl@npm:1.4.0": - version: 1.4.0 - resolution: "@swc/core-linux-x64-musl@npm:1.4.0" +"@swc/core-linux-x64-musl@npm:1.4.2": + version: 1.4.2 + resolution: "@swc/core-linux-x64-musl@npm:1.4.2" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@swc/core-win32-arm64-msvc@npm:1.4.0": - version: 1.4.0 - resolution: "@swc/core-win32-arm64-msvc@npm:1.4.0" +"@swc/core-win32-arm64-msvc@npm:1.4.2": + version: 1.4.2 + resolution: "@swc/core-win32-arm64-msvc@npm:1.4.2" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@swc/core-win32-ia32-msvc@npm:1.4.0": - version: 1.4.0 - resolution: "@swc/core-win32-ia32-msvc@npm:1.4.0" +"@swc/core-win32-ia32-msvc@npm:1.4.2": + version: 1.4.2 + resolution: "@swc/core-win32-ia32-msvc@npm:1.4.2" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@swc/core-win32-x64-msvc@npm:1.4.0": - version: 1.4.0 - resolution: "@swc/core-win32-x64-msvc@npm:1.4.0" +"@swc/core-win32-x64-msvc@npm:1.4.2": + version: 1.4.2 + resolution: "@swc/core-win32-x64-msvc@npm:1.4.2" conditions: os=win32 & cpu=x64 languageName: node linkType: hard -"@swc/core@npm:^1.3.36, @swc/core@npm:^1.4.0": - version: 1.4.0 - resolution: "@swc/core@npm:1.4.0" - dependencies: - "@swc/core-darwin-arm64": "npm:1.4.0" - "@swc/core-darwin-x64": "npm:1.4.0" - "@swc/core-linux-arm-gnueabihf": "npm:1.4.0" - "@swc/core-linux-arm64-gnu": "npm:1.4.0" - "@swc/core-linux-arm64-musl": "npm:1.4.0" - "@swc/core-linux-x64-gnu": "npm:1.4.0" - "@swc/core-linux-x64-musl": "npm:1.4.0" - "@swc/core-win32-arm64-msvc": "npm:1.4.0" - "@swc/core-win32-ia32-msvc": "npm:1.4.0" - "@swc/core-win32-x64-msvc": "npm:1.4.0" - "@swc/counter": "npm:^0.1.1" +"@swc/core@npm:^1.3.36, @swc/core@npm:^1.4.2": + version: 1.4.2 + resolution: "@swc/core@npm:1.4.2" + dependencies: + "@swc/core-darwin-arm64": "npm:1.4.2" + "@swc/core-darwin-x64": "npm:1.4.2" + "@swc/core-linux-arm-gnueabihf": "npm:1.4.2" + "@swc/core-linux-arm64-gnu": "npm:1.4.2" + "@swc/core-linux-arm64-musl": "npm:1.4.2" + "@swc/core-linux-x64-gnu": "npm:1.4.2" + "@swc/core-linux-x64-musl": "npm:1.4.2" + "@swc/core-win32-arm64-msvc": "npm:1.4.2" + "@swc/core-win32-ia32-msvc": "npm:1.4.2" + "@swc/core-win32-x64-msvc": "npm:1.4.2" + "@swc/counter": "npm:^0.1.2" "@swc/types": "npm:^0.1.5" peerDependencies: "@swc/helpers": ^0.5.0 @@ -5583,11 +5583,11 @@ __metadata: peerDependenciesMeta: "@swc/helpers": optional: true - checksum: 10/2f310f81c24b5688a6d4171b4fdb59987070ecda03aad51d755592607b461ddcd6a9d0488510f47785ce634707fd6f30f986ab1f1138e794972d53ce0e94db80 + checksum: 10/750c09e35fb14317b1ff7f8f528eebd732988ce34736c3404805e70ff44e08a19ec6d0c16b9468fab602b596eb39cc6d2771f0483a62efd614768e046323b5f4 languageName: node linkType: hard -"@swc/counter@npm:^0.1.1, @swc/counter@npm:^0.1.3": +"@swc/counter@npm:^0.1.2, @swc/counter@npm:^0.1.3": version: 0.1.3 resolution: "@swc/counter@npm:0.1.3" checksum: 10/df8f9cfba9904d3d60f511664c70d23bb323b3a0803ec9890f60133954173047ba9bdeabce28cd70ba89ccd3fd6c71c7b0bd58be85f611e1ffbe5d5c18616598 @@ -5900,16 +5900,6 @@ __metadata: languageName: node linkType: hard -"@types/fs-extra@npm:^11.0.4": - version: 11.0.4 - resolution: "@types/fs-extra@npm:11.0.4" - dependencies: - "@types/jsonfile": "npm:*" - "@types/node": "npm:*" - checksum: 10/acc4c1eb0cde7b1f23f3fe6eb080a14832d8fa9dc1761aa444c5e2f0f6b6fa657ed46ebae32fb580a6700fc921b6165ce8ac3e3ba030c3dd15f10ad4dd4cae98 - languageName: node - linkType: hard - "@types/graceful-fs@npm:^4.1.3": version: 4.1.5 resolution: "@types/graceful-fs@npm:4.1.5" @@ -5990,7 +5980,7 @@ __metadata: languageName: node linkType: hard -"@types/jest@npm:^29.5.11, @types/jest@npm:^29.5.12": +"@types/jest@npm:^29.5.11": version: 29.5.12 resolution: "@types/jest@npm:29.5.12" dependencies: @@ -6025,15 +6015,6 @@ __metadata: languageName: node linkType: hard -"@types/jsonfile@npm:*": - version: 6.1.1 - resolution: "@types/jsonfile@npm:6.1.1" - dependencies: - "@types/node": "npm:*" - checksum: 10/0f8fe0a9221a00e8413cffba723dfe16553868724b830237256fb0052ecd5cac96498189d1235a001cfa815f352008261c9ceb373f0aa58227f891e0c7a12c4d - languageName: node - linkType: hard - "@types/keyv@npm:*": version: 3.1.4 resolution: "@types/keyv@npm:3.1.4" @@ -6112,10 +6093,10 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:^16.18.80": - version: 16.18.80 - resolution: "@types/node@npm:16.18.80" - checksum: 10/6ed24736cb15f63fa0f500235ae2e20e40079c0b5cad48829e8bdc34c603984ff0befdfe1ddf72986f8ebf8c94a193981dc76daf087a8e6843e419263219a9f4 +"@types/node@npm:^16.18.82": + version: 16.18.82 + resolution: "@types/node@npm:16.18.82" + checksum: 10/baf1f8bb6f743c7d7bf3da24ccb9cd21676a74a7a03726344fd212db4cff376077cd31df8eeab3d4d4d741d2d3ee0bf2a8cb3f9cf89cca4e4b9e27e53ef1283e languageName: node linkType: hard @@ -6193,14 +6174,14 @@ __metadata: languageName: node linkType: hard -"@types/react@npm:*, @types/react@npm:^18.2.55": - version: 18.2.55 - resolution: "@types/react@npm:18.2.55" +"@types/react@npm:*, @types/react@npm:^18.2.57": + version: 18.2.57 + resolution: "@types/react@npm:18.2.57" dependencies: "@types/prop-types": "npm:*" "@types/scheduler": "npm:*" csstype: "npm:^3.0.2" - checksum: 10/bf8fe19e73575489e63c0726355f164157cd69e75f2a862436ad2c0586e732cb953a7255a6bc73145e8f9506ee7a723f9a569ca9a39c53984e5b12b84e1c718a + checksum: 10/beee45a8ee48862fb5101f6ebdd89ccc20c5a6df29dcd2315560bc3b57ea3af8d09a8e9bb1c58063a70f9010e0d2c7bd300819438e2ca62810285c3d7275ab5a languageName: node linkType: hard @@ -6533,6 +6514,60 @@ __metadata: languageName: node linkType: hard +"@vitest/expect@npm:1.3.0": + version: 1.3.0 + resolution: "@vitest/expect@npm:1.3.0" + dependencies: + "@vitest/spy": "npm:1.3.0" + "@vitest/utils": "npm:1.3.0" + chai: "npm:^4.3.10" + checksum: 10/32bc76108a608acb614dfb46ee9b588fc1a3f1fb68ba400a49d6ab80de463a2ab8a6a5dd51960ca76417b300d7c5ce16e2e346a0b0ebe25ca3b80232a378d6dc + languageName: node + linkType: hard + +"@vitest/runner@npm:1.3.0": + version: 1.3.0 + resolution: "@vitest/runner@npm:1.3.0" + dependencies: + "@vitest/utils": "npm:1.3.0" + p-limit: "npm:^5.0.0" + pathe: "npm:^1.1.1" + checksum: 10/7212e457fa89425c1e0b75e1817b50dc9c7d554617faf2178784a5fe0b97e6e4fe417e20886bd189f5385d01ac3f389d90ebca2a01ea4dee8a26897921db70c1 + languageName: node + linkType: hard + +"@vitest/snapshot@npm:1.3.0": + version: 1.3.0 + resolution: "@vitest/snapshot@npm:1.3.0" + dependencies: + magic-string: "npm:^0.30.5" + pathe: "npm:^1.1.1" + pretty-format: "npm:^29.7.0" + checksum: 10/b39bfee8ba9424e672e1c3076e3ee679d530ab8d38a5ad94ceec109063925caae10d4656d9256e331d2f8ed4a3169bfdc8ae584afe171fd51bbe70892dbce1b9 + languageName: node + linkType: hard + +"@vitest/spy@npm:1.3.0": + version: 1.3.0 + resolution: "@vitest/spy@npm:1.3.0" + dependencies: + tinyspy: "npm:^2.2.0" + checksum: 10/780c6b678aeb3cc1ccd730ff35fb6596e1a0adb78b39934e37bc6ae712b99bcf46a9387b34f8e76265c6805aef1dff72f47a921695ae5c567d59490d097c90a0 + languageName: node + linkType: hard + +"@vitest/utils@npm:1.3.0": + version: 1.3.0 + resolution: "@vitest/utils@npm:1.3.0" + dependencies: + diff-sequences: "npm:^29.6.3" + estree-walker: "npm:^3.0.3" + loupe: "npm:^2.3.7" + pretty-format: "npm:^29.7.0" + checksum: 10/9d544b24e25659d9f715f43906b9e40571450bbc14cb0320487dae67e4561acb61820200f4e185e1f7b805a17225b70802ebace9fb5c313bfff82ee3841278a9 + languageName: node + linkType: hard + "@vscode/codicons@npm:^0.0.35": version: 0.0.35 resolution: "@vscode/codicons@npm:0.0.35" @@ -6851,10 +6886,10 @@ __metadata: languageName: node linkType: hard -"acorn-walk@npm:^8.0.0, acorn-walk@npm:^8.1.1, acorn-walk@npm:^8.2.0": - version: 8.2.0 - resolution: "acorn-walk@npm:8.2.0" - checksum: 10/e69f7234f2adfeb16db3671429a7c80894105bd7534cb2032acf01bb26e6a847952d11a062d071420b43f8d82e33d2e57f26fe87d9cce0853e8143d8910ff1de +"acorn-walk@npm:^8.0.0, acorn-walk@npm:^8.1.1, acorn-walk@npm:^8.2.0, acorn-walk@npm:^8.3.2": + version: 8.3.2 + resolution: "acorn-walk@npm:8.3.2" + checksum: 10/57dbe2fd8cf744f562431775741c5c087196cd7a65ce4ccb3f3981cdfad25cd24ad2bad404997b88464ac01e789a0a61e5e355b2a84876f13deef39fb39686ca languageName: node linkType: hard @@ -6867,12 +6902,12 @@ __metadata: languageName: node linkType: hard -"acorn@npm:^8.0.0, acorn@npm:^8.0.4, acorn@npm:^8.4.1, acorn@npm:^8.7.0, acorn@npm:^8.7.1, acorn@npm:^8.8.2, acorn@npm:^8.9.0": - version: 8.11.2 - resolution: "acorn@npm:8.11.2" +"acorn@npm:^8.0.0, acorn@npm:^8.0.4, acorn@npm:^8.11.3, acorn@npm:^8.4.1, acorn@npm:^8.7.0, acorn@npm:^8.7.1, acorn@npm:^8.8.2, acorn@npm:^8.9.0": + version: 8.11.3 + resolution: "acorn@npm:8.11.3" bin: acorn: bin/acorn - checksum: 10/ff559b891382ad4cd34cc3c493511d0a7075a51f5f9f02a03440e92be3705679367238338566c5fbd3521ecadd565d29301bc8e16cb48379206bffbff3d72500 + checksum: 10/b688e7e3c64d9bfb17b596e1b35e4da9d50553713b3b3630cf5690f2b023a84eac90c56851e6912b483fe60e8b4ea28b254c07e92f17ef83d72d78745a8352dd languageName: node linkType: hard @@ -7381,6 +7416,13 @@ __metadata: languageName: node linkType: hard +"assertion-error@npm:^1.1.0": + version: 1.1.0 + resolution: "assertion-error@npm:1.1.0" + checksum: 10/fd9429d3a3d4fd61782eb3962ae76b6d08aa7383123fca0596020013b3ebd6647891a85b05ce821c47d1471ed1271f00b0545cf6a4326cf2fc91efcc3b0fbecf + languageName: node + linkType: hard + "ast-metadata-inferer@npm:^0.8.0": version: 0.8.0 resolution: "ast-metadata-inferer@npm:0.8.0" @@ -7599,9 +7641,9 @@ __metadata: languageName: node linkType: hard -"babel-plugin-jsx-dom-expressions@npm:^0.37.16": - version: 0.37.16 - resolution: "babel-plugin-jsx-dom-expressions@npm:0.37.16" +"babel-plugin-jsx-dom-expressions@npm:^0.37.17": + version: 0.37.17 + resolution: "babel-plugin-jsx-dom-expressions@npm:0.37.17" dependencies: "@babel/helper-module-imports": "npm:7.18.6" "@babel/plugin-syntax-jsx": "npm:^7.18.6" @@ -7610,7 +7652,7 @@ __metadata: validate-html-nesting: "npm:^1.2.1" peerDependencies: "@babel/core": ^7.20.12 - checksum: 10/bc8bde0a2d006b58f80626ce24ee977c63bd08f49f265e05daf4dab8b660a3efe0f3338ed0b30e5a2f85dcf9c0ae16cb1c89241c55932d8f3dfc7d5e99cb7625 + checksum: 10/0dc77f516218e29dff25ce2166f57d7b0a6c8df1e606da73a460c68d9ecc265eda593582912b0d8eec264bb519fa6dba3f99f9fa780106733571759f1d853cde languageName: node linkType: hard @@ -7705,14 +7747,14 @@ __metadata: languageName: node linkType: hard -"babel-preset-solid@npm:^1.8.12": - version: 1.8.12 - resolution: "babel-preset-solid@npm:1.8.12" +"babel-preset-solid@npm:^1.8.12, babel-preset-solid@npm:^1.8.15": + version: 1.8.15 + resolution: "babel-preset-solid@npm:1.8.15" dependencies: - babel-plugin-jsx-dom-expressions: "npm:^0.37.16" + babel-plugin-jsx-dom-expressions: "npm:^0.37.17" peerDependencies: "@babel/core": ^7.0.0 - checksum: 10/eefd778c4241e54e283624ad034f1b90a9a5cadf0c4b1b69752132fb62554e655d446df22f2d5876db8553ef9df47893680c5104613422361703f52c8b19d33c + checksum: 10/2d56084f810b74a128fab252c4126cf71a66928187df0acc409031eb642ec99c20ddd82207f7e0565cb9d88abdd1c6c9b2cca3623aa420309e1ef4c227bb774a languageName: node linkType: hard @@ -7968,17 +8010,17 @@ __metadata: languageName: node linkType: hard -"browserslist@npm:^4.0.0, browserslist@npm:^4.18.1, browserslist@npm:^4.21.10, browserslist@npm:^4.21.4, browserslist@npm:^4.22.2, browserslist@npm:^4.22.3, browserslist@npm:^4.6.6": - version: 4.22.3 - resolution: "browserslist@npm:4.22.3" +"browserslist@npm:^4.0.0, browserslist@npm:^4.18.1, browserslist@npm:^4.21.10, browserslist@npm:^4.21.4, browserslist@npm:^4.22.2, browserslist@npm:^4.23.0, browserslist@npm:^4.6.6": + version: 4.23.0 + resolution: "browserslist@npm:4.23.0" dependencies: - caniuse-lite: "npm:^1.0.30001580" - electron-to-chromium: "npm:^1.4.648" + caniuse-lite: "npm:^1.0.30001587" + electron-to-chromium: "npm:^1.4.668" node-releases: "npm:^2.0.14" update-browserslist-db: "npm:^1.0.13" bin: browserslist: cli.js - checksum: 10/d46a906c79dfe95d9702c020afbe5b7b4dbe2019b85432e7a020326adff27e63e3c0a52dc8d4e73247060bbe2c13f000714741903cf96a16baae9c216dc74c75 + checksum: 10/496c3862df74565dd942b4ae65f502c575cbeba1fa4a3894dad7aa3b16130dc3033bc502d8848147f7b625154a284708253d9598bcdbef5a1e34cf11dc7bad8e languageName: node linkType: hard @@ -8062,6 +8104,13 @@ __metadata: languageName: node linkType: hard +"cac@npm:^6.7.14": + version: 6.7.14 + resolution: "cac@npm:6.7.14" + checksum: 10/002769a0fbfc51c062acd2a59df465a2a947916b02ac50b56c69ec6c018ee99ac3e7f4dd7366334ea847f1ecacf4defaa61bcd2ac283db50156ce1f1d8c8ad42 + languageName: node + linkType: hard + "cacache@npm:^15.0.0, cacache@npm:^15.0.3, cacache@npm:^15.0.5, cacache@npm:^15.2.0": version: 15.3.0 resolution: "cacache@npm:15.3.0" @@ -8250,10 +8299,10 @@ __metadata: languageName: node linkType: hard -"caniuse-lite@npm:^1.0.0, caniuse-lite@npm:^1.0.30001524, caniuse-lite@npm:^1.0.30001538, caniuse-lite@npm:^1.0.30001580": - version: 1.0.30001585 - resolution: "caniuse-lite@npm:1.0.30001585" - checksum: 10/877e234c13f8db9bde20265f8c0702d1a5d3d0f0b0f726f431c951cf92d4c2b73db6e7b2c8bdf964e49e817037f27691564f56c5e2d557b001097bc8d526d2a1 +"caniuse-lite@npm:^1.0.0, caniuse-lite@npm:^1.0.30001524, caniuse-lite@npm:^1.0.30001538, caniuse-lite@npm:^1.0.30001587": + version: 1.0.30001588 + resolution: "caniuse-lite@npm:1.0.30001588" + checksum: 10/09150ef2daa65c75cb2681832d5bc203760a02d9f71eb033dc0401fbfdbe026d3a84e54a8d2085f730a4f51eb074028b89013dd033841e1a0eb3c7323a50ed45 languageName: node linkType: hard @@ -8271,6 +8320,21 @@ __metadata: languageName: node linkType: hard +"chai@npm:^4.3.10": + version: 4.4.1 + resolution: "chai@npm:4.4.1" + dependencies: + assertion-error: "npm:^1.1.0" + check-error: "npm:^1.0.3" + deep-eql: "npm:^4.1.3" + get-func-name: "npm:^2.0.2" + loupe: "npm:^2.3.6" + pathval: "npm:^1.1.1" + type-detect: "npm:^4.0.8" + checksum: 10/c6d7aba913a67529c68dbec3673f94eb9c586c5474cc5142bd0b587c9c9ec9e5fbaa937e038ecaa6475aea31433752d5fabdd033b9248bde6ae53befcde774ae + languageName: node + linkType: hard + "chalk@npm:4.1.0": version: 4.1.0 resolution: "chalk@npm:4.1.0" @@ -8351,6 +8415,15 @@ __metadata: languageName: node linkType: hard +"check-error@npm:^1.0.3": + version: 1.0.3 + resolution: "check-error@npm:1.0.3" + dependencies: + get-func-name: "npm:^2.0.2" + checksum: 10/e2131025cf059b21080f4813e55b3c480419256914601750b0fee3bd9b2b8315b531e551ef12560419b8b6d92a3636511322752b1ce905703239e7cc451b6399 + languageName: node + linkType: hard + "cheerio-select@npm:^1.5.0": version: 1.5.0 resolution: "cheerio-select@npm:1.5.0" @@ -9624,6 +9697,15 @@ __metadata: languageName: node linkType: hard +"deep-eql@npm:^4.1.3": + version: 4.1.3 + resolution: "deep-eql@npm:4.1.3" + dependencies: + type-detect: "npm:^4.0.0" + checksum: 10/12ce93ae63de187e77b076d3d51bfc28b11f98910a22c18714cce112791195e86a94f97788180994614b14562a86c9763f67c69f785e4586f806b5df39bf9301 + languageName: node + linkType: hard + "deep-extend@npm:^0.6.0": version: 0.6.0 resolution: "deep-extend@npm:0.6.0" @@ -10148,10 +10230,10 @@ __metadata: languageName: node linkType: hard -"electron-to-chromium@npm:^1.4.648, electron-to-chromium@npm:^1.4.665": - version: 1.4.665 - resolution: "electron-to-chromium@npm:1.4.665" - checksum: 10/ed78b2f7516111a17b39c3432eaf9c11470ebe626804396246a73de421769ed7044fce1ea12807de3e7dee0135d1e7fd787d9e0f97b939fec3b06a52445e65fc +"electron-to-chromium@npm:^1.4.668, electron-to-chromium@npm:^1.4.675": + version: 1.4.675 + resolution: "electron-to-chromium@npm:1.4.675" + checksum: 10/9c7dbdd2543085b3b99c2349adefd9ae8ee83df633837c0c758cbb9e2c63aa755ed130ce4f5bc6cc39d8432966da189719163275c71d9d977c1c48933c3c1b73 languageName: node linkType: hard @@ -11152,7 +11234,7 @@ __metadata: languageName: node linkType: hard -"estree-walker@npm:^3.0.0": +"estree-walker@npm:^3.0.0, estree-walker@npm:^3.0.3": version: 3.0.3 resolution: "estree-walker@npm:3.0.3" dependencies: @@ -11860,7 +11942,7 @@ __metadata: languageName: node linkType: hard -"fs-extra@npm:^11.1.0, fs-extra@npm:^11.1.1, fs-extra@npm:^11.2.0": +"fs-extra@npm:^11.1.0, fs-extra@npm:^11.1.1": version: 11.2.0 resolution: "fs-extra@npm:11.2.0" dependencies: @@ -12048,6 +12130,13 @@ __metadata: languageName: node linkType: hard +"get-func-name@npm:^2.0.1, get-func-name@npm:^2.0.2": + version: 2.0.2 + resolution: "get-func-name@npm:2.0.2" + checksum: 10/3f62f4c23647de9d46e6f76d2b3eafe58933a9b3830c60669e4180d6c601ce1b4aa310ba8366143f55e52b139f992087a9f0647274e8745621fa2af7e0acf13b + languageName: node + linkType: hard + "get-intrinsic@npm:^1.0.2, get-intrinsic@npm:^1.1.1, get-intrinsic@npm:^1.1.3, get-intrinsic@npm:^1.2.0, get-intrinsic@npm:^1.2.1": version: 1.2.1 resolution: "get-intrinsic@npm:1.2.1" @@ -14326,8 +14415,10 @@ __metadata: version: 0.0.0-use.local resolution: "jest-618f12@workspace:scenarios/jest" dependencies: + babel-preset-moon: "npm:^2.0.14" jest: "npm:^29.7.0" jest-environment-jsdom: "npm:^29.7.0" + jest-preset-moon: "npm:^2.0.7" languageName: unknown linkType: soft @@ -14845,6 +14936,13 @@ __metadata: languageName: node linkType: hard +"js-tokens@npm:^8.0.2": + version: 8.0.3 + resolution: "js-tokens@npm:8.0.3" + checksum: 10/af5ed8ddbc446a868c026599214f4a482ab52461edb82e547949255f98910a14bd81ddab88a8d570d74bd7dc96c6d4df7f963794ec5aaf13c53918cc46b9caa6 + languageName: node + linkType: hard + "js-yaml@npm:4.1.0, js-yaml@npm:^4.1.0": version: 4.1.0 resolution: "js-yaml@npm:4.1.0" @@ -15543,6 +15641,16 @@ __metadata: languageName: node linkType: hard +"local-pkg@npm:^0.5.0": + version: 0.5.0 + resolution: "local-pkg@npm:0.5.0" + dependencies: + mlly: "npm:^1.4.2" + pkg-types: "npm:^1.0.3" + checksum: 10/20f4caba50dc6fb00ffcc1a78bc94b5acb33995e0aadf4d4edcdeab257e891aa08f50afddf02f3240b2c3d02432bc2078f2a916a280ed716b64753a3d250db70 + languageName: node + linkType: hard + "locate-path@npm:^2.0.0": version: 2.0.0 resolution: "locate-path@npm:2.0.0" @@ -15674,6 +15782,15 @@ __metadata: languageName: node linkType: hard +"loupe@npm:^2.3.6, loupe@npm:^2.3.7": + version: 2.3.7 + resolution: "loupe@npm:2.3.7" + dependencies: + get-func-name: "npm:^2.0.1" + checksum: 10/635c8f0914c2ce7ecfe4e239fbaf0ce1d2c00e4246fafcc4ed000bfdb1b8f89d05db1a220054175cca631ebf3894872a26fffba0124477fcb562f78762848fb1 + languageName: node + linkType: hard + "lower-case@npm:^2.0.2": version: 2.0.2 resolution: "lower-case@npm:2.0.2" @@ -15755,7 +15872,7 @@ __metadata: languageName: node linkType: hard -"magic-string@npm:^0.30.3, magic-string@npm:^0.30.7": +"magic-string@npm:^0.30.3, magic-string@npm:^0.30.5, magic-string@npm:^0.30.7": version: 0.30.7 resolution: "magic-string@npm:0.30.7" dependencies: @@ -17109,6 +17226,18 @@ __metadata: languageName: node linkType: hard +"mlly@npm:^1.2.0, mlly@npm:^1.4.2": + version: 1.5.0 + resolution: "mlly@npm:1.5.0" + dependencies: + acorn: "npm:^8.11.3" + pathe: "npm:^1.1.2" + pkg-types: "npm:^1.0.3" + ufo: "npm:^1.3.2" + checksum: 10/c030ecb7f17a9080f04746cc9bf1a73f55a86dcad55c1597d20349737e07ec66a09ea1bcac0d36984cb1d532b79200c235086ab2291d678224f9082946cf530e + languageName: node + linkType: hard + "modify-values@npm:^1.0.1": version: 1.0.1 resolution: "modify-values@npm:1.0.1" @@ -18258,6 +18387,15 @@ __metadata: languageName: node linkType: hard +"p-limit@npm:^5.0.0": + version: 5.0.0 + resolution: "p-limit@npm:5.0.0" + dependencies: + yocto-queue: "npm:^1.0.0" + checksum: 10/87bf5837dee6942f0dbeff318436179931d9a97848d1b07dbd86140a477a5d2e6b90d9701b210b4e21fe7beaea2979dfde366e4f576fa644a59bd4d6a6371da7 + languageName: node + linkType: hard + "p-locate@npm:^2.0.0": version: 2.0.0 resolution: "p-locate@npm:2.0.0" @@ -18403,28 +18541,25 @@ __metadata: dependencies: "@babel/cli": "npm:^7.23.9" "@babel/core": "npm:^7.23.9" - "@moonrepo/cli": "npm:^1.21.3" + "@moonrepo/cli": "npm:^1.21.4" "@moonrepo/dev": "npm:^2.0.1" "@swc/cli": "npm:^0.3.9" - "@types/fs-extra": "npm:^11.0.4" - "@types/jest": "npm:^29.5.12" "@types/micromatch": "npm:^4.0.6" - "@types/node": "npm:^16.18.80" - "@types/react": "npm:^18.2.55" + "@types/node": "npm:^16.18.82" + "@types/react": "npm:^18.2.57" "@types/semver": "npm:^7.5.7" babel-preset-moon: "npm:^2.0.14" chokidar: "npm:^3.6.0" - electron-to-chromium: "npm:^1.4.665" + electron-to-chromium: "npm:^1.4.675" eslint: "npm:^8.56.0" eslint-config-moon: "npm:^2.1.1" - jest: "npm:^29.7.0" - jest-preset-moon: "npm:^2.0.7" lerna: "npm:^8.1.2" prettier: "npm:^3.2.5" prettier-config-moon: "npm:^1.1.2" ts-node: "npm:^10.9.2" tsconfig-moon: "npm:^1.3.0" typescript: "npm:^5.3.3" + vitest: "npm:^1.3.0" languageName: unknown linkType: soft @@ -18451,19 +18586,18 @@ __metadata: "@rollup/plugin-commonjs": "npm:^25.0.7" "@rollup/plugin-json": "npm:^6.1.0" "@rollup/plugin-node-resolve": "npm:^15.2.3" - "@swc/core": "npm:^1.4.0" + "@swc/core": "npm:^1.4.2" "@swc/helpers": "npm:^0.5.6" "@typescript-eslint/types": "npm:^6.21.0" babel-plugin-cjs-esm-interop: "npm:^3.0.3" babel-plugin-conditional-invariant: "npm:^3.0.1" babel-plugin-env-constants: "npm:^3.0.1" - babel-preset-solid: "npm:^1.8.12" - browserslist: "npm:^4.22.3" + babel-preset-solid: "npm:^1.8.15" + browserslist: "npm:^4.23.0" debug: "npm:^4.3.4" execa: "npm:^8.0.1" fast-glob: "npm:^3.3.2" filesize: "npm:^10.1.0" - fs-extra: "npm:^11.2.0" ink: "npm:^4.4.1" ink-progress-bar: "npm:^3.0.0" ink-spinner: "npm:^5.0.0" @@ -18849,6 +18983,20 @@ __metadata: languageName: node linkType: hard +"pathe@npm:^1.1.0, pathe@npm:^1.1.1, pathe@npm:^1.1.2": + version: 1.1.2 + resolution: "pathe@npm:1.1.2" + checksum: 10/f201d796351bf7433d147b92c20eb154a4e0ea83512017bf4ec4e492a5d6e738fb45798be4259a61aa81270179fce11026f6ff0d3fa04173041de044defe9d80 + languageName: node + linkType: hard + +"pathval@npm:^1.1.1": + version: 1.1.1 + resolution: "pathval@npm:1.1.1" + checksum: 10/b50a4751068aa3a5428f5a0b480deecedc6f537666a3630a0c2ae2d5e7c0f4bf0ee77b48404441ec1220bef0c91625e6030b3d3cf5a32ab0d9764018d1d9dbb6 + languageName: node + linkType: hard + "peek-readable@npm:^5.0.0": version: 5.0.0 resolution: "peek-readable@npm:5.0.0" @@ -18963,6 +19111,17 @@ __metadata: languageName: node linkType: hard +"pkg-types@npm:^1.0.3": + version: 1.0.3 + resolution: "pkg-types@npm:1.0.3" + dependencies: + jsonc-parser: "npm:^3.2.0" + mlly: "npm:^1.2.0" + pathe: "npm:^1.1.0" + checksum: 10/e17e1819ce579c9ea390e4c41a9ed9701d8cff14b463f9577cc4f94688da8917c66dabc40feacd47a21eb3de9b532756a78becd882b76add97053af307c1240a + languageName: node + linkType: hard + "pkg-up@npm:^3.1.0": version: 3.1.0 resolution: "pkg-up@npm:3.1.0" @@ -21269,6 +21428,13 @@ __metadata: languageName: node linkType: hard +"siginfo@npm:^2.0.0": + version: 2.0.0 + resolution: "siginfo@npm:2.0.0" + checksum: 10/e93ff66c6531a079af8fb217240df01f980155b5dc408d2d7bebc398dd284e383eb318153bf8acd4db3c4fe799aa5b9a641e38b0ba3b1975700b1c89547ea4e7 + languageName: node + linkType: hard + "signal-exit@npm:3.0.7, signal-exit@npm:^3.0.0, signal-exit@npm:^3.0.2, signal-exit@npm:^3.0.3, signal-exit@npm:^3.0.7": version: 3.0.7 resolution: "signal-exit@npm:3.0.7" @@ -21833,6 +21999,13 @@ __metadata: languageName: node linkType: hard +"stackback@npm:0.0.2": + version: 0.0.2 + resolution: "stackback@npm:0.0.2" + checksum: 10/2d4dc4e64e2db796de4a3c856d5943daccdfa3dd092e452a1ce059c81e9a9c29e0b9badba91b43ef0d5ff5c04ee62feb3bcc559a804e16faf447bac2d883aa99 + languageName: node + linkType: hard + "statuses@npm:2.0.1": version: 2.0.1 resolution: "statuses@npm:2.0.1" @@ -21847,10 +22020,10 @@ __metadata: languageName: node linkType: hard -"std-env@npm:^3.0.1": - version: 3.0.1 - resolution: "std-env@npm:3.0.1" - checksum: 10/29da6f39910357b00159c795c84495a56bb5f3cfc761ad3c7ed4ff7ab84a8a34040824c2a90d2983d3bd8b783292c6506ade10c4271a3c63a5550a0e635debd3 +"std-env@npm:^3.0.1, std-env@npm:^3.5.0": + version: 3.7.0 + resolution: "std-env@npm:3.7.0" + checksum: 10/6ee0cca1add3fd84656b0002cfbc5bfa20340389d9ba4720569840f1caa34bce74322aef4c93f046391583e50649d0cf81a5f8fe1d411e50b659571690a45f12 languageName: node linkType: hard @@ -22102,6 +22275,15 @@ __metadata: languageName: node linkType: hard +"strip-literal@npm:^2.0.0": + version: 2.0.0 + resolution: "strip-literal@npm:2.0.0" + dependencies: + js-tokens: "npm:^8.0.2" + checksum: 10/efb3197175a7e403d0eaaaf5382b9574be77f8fa006b57b669856a38b58ca9caf76cbc75d9f69d56324dad0b8babe1d4ea7ad1eb12106228830bcdd5d4bf12b5 + languageName: node + linkType: hard + "strip-outer@npm:^2.0.0": version: 2.0.0 resolution: "strip-outer@npm:2.0.0" @@ -22428,6 +22610,27 @@ __metadata: languageName: node linkType: hard +"tinybench@npm:^2.5.1": + version: 2.6.0 + resolution: "tinybench@npm:2.6.0" + checksum: 10/6d35f0540bbf6208e8f47fa88cad733bc4b35b3bea75ec995004a9a44f70b8947eff3d271a3b4a4f7e787a82211df0dec9370fa566ccf50441067c559382b3ed + languageName: node + linkType: hard + +"tinypool@npm:^0.8.2": + version: 0.8.2 + resolution: "tinypool@npm:0.8.2" + checksum: 10/5e2cdddc1caf437e3b8d8c56c1c66dffcb46008be4b2e37d457b0921699c6b79930dd8d652e4890c5e1e24688489259da83fd853bc0ce348d8a0375dedefc2ba + languageName: node + linkType: hard + +"tinyspy@npm:^2.2.0": + version: 2.2.1 + resolution: "tinyspy@npm:2.2.1" + checksum: 10/170d6232e87f9044f537b50b406a38fbfd6f79a261cd12b92879947bd340939a833a678632ce4f5c4a6feab4477e9c21cd43faac3b90b68b77dd0536c4149736 + languageName: node + linkType: hard + "tmp@npm:^0.0.33": version: 0.0.33 resolution: "tmp@npm:0.0.33" @@ -22725,7 +22928,7 @@ __metadata: languageName: node linkType: hard -"type-detect@npm:4.0.8": +"type-detect@npm:4.0.8, type-detect@npm:^4.0.0, type-detect@npm:^4.0.8": version: 4.0.8 resolution: "type-detect@npm:4.0.8" checksum: 10/5179e3b8ebc51fce1b13efb75fdea4595484433f9683bbc2dca6d99789dba4e602ab7922d2656f2ce8383987467f7770131d4a7f06a26287db0615d2f4c4ce7d @@ -22911,6 +23114,13 @@ __metadata: languageName: node linkType: hard +"ufo@npm:^1.3.2": + version: 1.4.0 + resolution: "ufo@npm:1.4.0" + checksum: 10/b7aea8503878dc5ad797d8fc6fe39fec64d9cc7e89fb147ef86ec676e37bb462d99d67c6aad20b15f7d3e6d275d66666b29214422e268f1d98f6eaf707a207a6 + languageName: node + linkType: hard + "uglify-js@npm:^3.1.4": version: 3.17.4 resolution: "uglify-js@npm:3.17.4" @@ -23396,13 +23606,28 @@ __metadata: version: 0.0.0-use.local resolution: "vite-ab9ea0@workspace:scenarios/vite" dependencies: - vite: "npm:^5.1.1" + vite: "npm:^5.1.3" languageName: unknown linkType: soft -"vite@npm:^5.1.1": - version: 5.1.1 - resolution: "vite@npm:5.1.1" +"vite-node@npm:1.3.0": + version: 1.3.0 + resolution: "vite-node@npm:1.3.0" + dependencies: + cac: "npm:^6.7.14" + debug: "npm:^4.3.4" + pathe: "npm:^1.1.1" + picocolors: "npm:^1.0.0" + vite: "npm:^5.0.0" + bin: + vite-node: vite-node.mjs + checksum: 10/39a473a927547416ee72e01310929b02ee6724f1671c20cd1f1bd65494850906624b6a06b813ba2e3f742c42e5e2d2718e4f4248032cf1ad9c95c696659dd832 + languageName: node + linkType: hard + +"vite@npm:^5.0.0, vite@npm:^5.1.3": + version: 5.1.3 + resolution: "vite@npm:5.1.3" dependencies: esbuild: "npm:^0.19.3" fsevents: "npm:~2.3.3" @@ -23436,7 +23661,57 @@ __metadata: optional: true bin: vite: bin/vite.js - checksum: 10/bdb8e683caddaa0a9adcbf40144ca8ea3660836b208862b07d43787ea867845919af16e58745365bd13ed3b7f66bbf9788a6869ee22cfaacac01645b59729c34 + checksum: 10/6ba2223157e2cc2fa62dff9004ccba20fc409c6baf7354c64ed0f8e4bcd853092d08d06ec4dec37143e794a96e061879a870d85bad4f1eb9ee5c6d0a13cef30f + languageName: node + linkType: hard + +"vitest@npm:^1.3.0": + version: 1.3.0 + resolution: "vitest@npm:1.3.0" + dependencies: + "@vitest/expect": "npm:1.3.0" + "@vitest/runner": "npm:1.3.0" + "@vitest/snapshot": "npm:1.3.0" + "@vitest/spy": "npm:1.3.0" + "@vitest/utils": "npm:1.3.0" + acorn-walk: "npm:^8.3.2" + chai: "npm:^4.3.10" + debug: "npm:^4.3.4" + execa: "npm:^8.0.1" + local-pkg: "npm:^0.5.0" + magic-string: "npm:^0.30.5" + pathe: "npm:^1.1.1" + picocolors: "npm:^1.0.0" + std-env: "npm:^3.5.0" + strip-literal: "npm:^2.0.0" + tinybench: "npm:^2.5.1" + tinypool: "npm:^0.8.2" + vite: "npm:^5.0.0" + vite-node: "npm:1.3.0" + why-is-node-running: "npm:^2.2.2" + peerDependencies: + "@edge-runtime/vm": "*" + "@types/node": ^18.0.0 || >=20.0.0 + "@vitest/browser": 1.3.0 + "@vitest/ui": 1.3.0 + happy-dom: "*" + jsdom: "*" + peerDependenciesMeta: + "@edge-runtime/vm": + optional: true + "@types/node": + optional: true + "@vitest/browser": + optional: true + "@vitest/ui": + optional: true + happy-dom: + optional: true + jsdom: + optional: true + bin: + vitest: vitest.mjs + checksum: 10/4aabfb972f5f2c165f1f751a063a07a5be952bc684f93ab19ea617fad633fd3db7473ebc7c59c1afdb902334364710476785f01d1cc3cc071a48fcaaf4bac2fa languageName: node linkType: hard @@ -23560,7 +23835,7 @@ __metadata: version: 0.0.0-use.local resolution: "webpack-3301ab@workspace:scenarios/webpack" dependencies: - webpack: "npm:^5.90.1" + webpack: "npm:^5.90.3" webpack-cli: "npm:^5.1.4" languageName: unknown linkType: soft @@ -23700,9 +23975,9 @@ __metadata: languageName: node linkType: hard -"webpack@npm:^5.88.1, webpack@npm:^5.90.1": - version: 5.90.1 - resolution: "webpack@npm:5.90.1" +"webpack@npm:^5.88.1, webpack@npm:^5.90.3": + version: 5.90.3 + resolution: "webpack@npm:5.90.3" dependencies: "@types/eslint-scope": "npm:^3.7.3" "@types/estree": "npm:^1.0.5" @@ -23733,7 +24008,7 @@ __metadata: optional: true bin: webpack: bin/webpack.js - checksum: 10/6ad23518123f1742238177920cefa61152d981f986adac5901236845c86ba9bb375a3ba75e188925c856c3d2a76a2ba119e95b8a608a51424968389041089075 + checksum: 10/48c9696eca950bfa7c943a24b8235fdf0575acd73a8eb1661f8189d3d1f431362f3a0e158e2941a7e4f0852ea6e32d7d4e89283149247e4389a8aad0fe6c247e languageName: node linkType: hard @@ -23758,7 +24033,7 @@ __metadata: "@docusaurus/core": "npm:^3.1.1" "@docusaurus/module-type-aliases": "npm:^3.1.1" "@docusaurus/preset-classic": "npm:^3.1.1" - "@mdx-js/react": "npm:^3.0.0" + "@mdx-js/react": "npm:^3.0.1" clsx: "npm:^2.1.0" docusaurus-plugin-typedoc-api: "npm:^4.1.0" react: "npm:^18.2.0" @@ -23911,6 +24186,18 @@ __metadata: languageName: node linkType: hard +"why-is-node-running@npm:^2.2.2": + version: 2.2.2 + resolution: "why-is-node-running@npm:2.2.2" + dependencies: + siginfo: "npm:^2.0.0" + stackback: "npm:0.0.2" + bin: + why-is-node-running: cli.js + checksum: 10/f3582e0337f4b25537d492b1d40f00b978ce04b1d1eeea8f310bfa8aae8a7d11d118d672e2f0760c164ce3753a620a70aa29ff3620e340197624940cf9c08615 + languageName: node + linkType: hard + "wide-align@npm:^1.1.0, wide-align@npm:^1.1.5": version: 1.1.5 resolution: "wide-align@npm:1.1.5"