pax_global_header00006660000000000000000000000064146077432340014524gustar00rootroot0000000000000052 comment=d6b2171d5bb10c6400da85bf34594987f63c44b5 magic-string-0.30.10/000077500000000000000000000000001460774323400142515ustar00rootroot00000000000000magic-string-0.30.10/.eslintrc000066400000000000000000000020411460774323400160720ustar00rootroot00000000000000{ "rules": { "indent": [ 2, "tab", { "SwitchCase": 1 }], "quotes": [ 2, "single" ], "semi": [ 2, "always" ], "keyword-spacing": [ 2, { "before": true, "after": true } ], "space-before-blocks": [ 2, "always" ], "no-mixed-spaces-and-tabs": [ 2, "smart-tabs" ], "object-shorthand": [2, "always" ], "no-const-assign": 2, "no-unused-vars": 2, "no-class-assign": 2, "no-this-before-super": 2, "no-var": 2, "quote-props": [ 2, "as-needed" ], "one-var": [ 2, "never" ], "prefer-arrow-callback": 2, "prefer-const": 2, "arrow-spacing": 2, "no-cond-assign": 0, "no-constant-condition": 0 }, "env": { "es6": true, "browser": true }, "globals": { "DEBUG": true, "process": true, "Buffer": true, "globalThis": true }, "extends": "eslint:recommended", "parserOptions": { "ecmaVersion": 2020, "sourceType": "module" } } magic-string-0.30.10/.github/000077500000000000000000000000001460774323400156115ustar00rootroot00000000000000magic-string-0.30.10/.github/workflows/000077500000000000000000000000001460774323400176465ustar00rootroot00000000000000magic-string-0.30.10/.github/workflows/test.yml000066400000000000000000000013121460774323400213450ustar00rootroot00000000000000name: Test on: push: branches: - main - master pull_request: branches: - main - master jobs: build: runs-on: ${{ matrix.os }} timeout-minutes: 10 strategy: matrix: node_version: [lts/*] os: [ubuntu-latest, windows-latest, macos-latest] fail-fast: false steps: - uses: actions/checkout@v4 - name: Set node version to ${{ matrix.node_version }} uses: actions/setup-node@v4 with: node-version: ${{ matrix.node_version }} - uses: pnpm/action-setup@v3 - name: Install run: pnpm i - name: Lint run: pnpm run lint - name: Test run: pnpm test magic-string-0.30.10/.gitignore000066400000000000000000000001151460774323400162360ustar00rootroot00000000000000.DS_Store node_modules sandbox .gobbl* .tmp !.babelrc coverage dist yarn.lockmagic-string-0.30.10/CHANGELOG.md000066400000000000000000000477661460774323400161060ustar00rootroot00000000000000## [0.30.10](https://github.com/rich-harris/magic-string/compare/v0.30.9...v0.30.10) (2024-04-17) ### Bug Fixes * **types:** improve chainable types ([#278](https://github.com/rich-harris/magic-string/issues/278)) ([072188f](https://github.com/rich-harris/magic-string/commit/072188f84398437bd75f41bf3d5df49aeae1b587)) ## [0.30.9](https://github.com/rich-harris/magic-string/compare/v0.30.8...v0.30.9) (2024-04-04) ### Performance Improvements * avoid create uncessary overrides for `replace` ([a1b857c](https://github.com/rich-harris/magic-string/commit/a1b857cc5a77af1ffae73355d9c467dce058e427)) ## [0.30.8](https://github.com/rich-harris/magic-string/compare/v0.30.7...v0.30.8) (2024-03-03) ### Bug Fixes * handle last empty line correctly when using update/overwrite ([#274](https://github.com/rich-harris/magic-string/issues/274)) ([29c7bfa](https://github.com/rich-harris/magic-string/commit/29c7bfade8e7d91391c89cf913d65de84b19c3e9)) ## [0.30.7](https://github.com/rich-harris/magic-string/compare/v0.30.6...v0.30.7) (2024-02-05) ### Features * new `reset` method ([#218](https://github.com/rich-harris/magic-string/issues/218)) ([#271](https://github.com/rich-harris/magic-string/issues/271)) ([3dc21e2](https://github.com/rich-harris/magic-string/commit/3dc21e26f04ad4c5314602e511afa210f922d433)) ## [0.30.6](https://github.com/rich-harris/magic-string/compare/v0.30.5...v0.30.6) (2024-01-31) ### Features * support Web Workers by using the global `btoa` ([#269](https://github.com/rich-harris/magic-string/issues/269)) ([8679648](https://github.com/rich-harris/magic-string/commit/86796487f30436cd26291834ae7445fc40ce6139)) ## [0.30.5](https://github.com/rich-harris/magic-string/compare/v0.30.4...v0.30.5) (2023-10-12) ### Bug Fixes * update `sourcesContent` type ([#263](https://github.com/rich-harris/magic-string/issues/263)) ([0e2068d](https://github.com/rich-harris/magic-string/commit/0e2068d6cee9d53c7a242b95f56ea99be3248142)) ## [0.30.4](https://github.com/rich-harris/magic-string/compare/v0.30.3...v0.30.4) (2023-09-29) ### Bug Fixes * correct mappings for update containing new line ([#261](https://github.com/rich-harris/magic-string/issues/261)) ([adaece9](https://github.com/rich-harris/magic-string/commit/adaece9f2370fd1266e89f2fc84c294e1f1b935c)) * use global `btoa`, support services worker, close [#258](https://github.com/rich-harris/magic-string/issues/258) ([#259](https://github.com/rich-harris/magic-string/issues/259)) ([2dea20b](https://github.com/rich-harris/magic-string/commit/2dea20bab7ca0f776013826074d474f476d281bc)) ## [0.30.3](https://github.com/rich-harris/magic-string/compare/v0.30.2...v0.30.3) (2023-08-21) ### Bug Fixes * trim replaced content with space ([#257](https://github.com/rich-harris/magic-string/issues/257)) ([8088f53](https://github.com/rich-harris/magic-string/commit/8088f53873da13c81877a05ab4549fce86f537b5)) ## [0.30.2](https://github.com/rich-harris/magic-string/compare/v0.30.1...v0.30.2) (2023-07-28) ### Features * hires boundary ([#255](https://github.com/rich-harris/magic-string/issues/255)) ([a63d5f2](https://github.com/rich-harris/magic-string/commit/a63d5f25308ff1965ae676e2aa5311417279e7d4)) ## [0.30.1](https://github.com/rich-harris/magic-string/compare/v0.30.0...v0.30.1) (2023-07-04) ### Bug Fixes * expose .d.ts as cjs version ([#253](https://github.com/rich-harris/magic-string/issues/253)) ([262e113](https://github.com/rich-harris/magic-string/commit/262e113ee25e9c7d317282b3015102ec932ae2f5)) # [0.30.0](https://github.com/rich-harris/magic-string/compare/v0.29.0...v0.30.0) (2023-02-22) ### Bug Fixes * `null` is invalid for `sources` and `file` ([#242](https://github.com/rich-harris/magic-string/issues/242)) ([d4e9c31](https://github.com/rich-harris/magic-string/commit/d4e9c31082491cfa177b31ce725c9ce39491d549)) ### Features * add the ability to ignore-list sources ([#243](https://github.com/rich-harris/magic-string/issues/243)) ([e238f04](https://github.com/rich-harris/magic-string/commit/e238f04be31ec9a3e19b18b75bb5d859f9cb2654)) # [0.29.0](https://github.com/rich-harris/magic-string/compare/v0.28.0...v0.29.0) (2023-02-11) ### Features * **x_google_ignoreList:** initial support for ignore lists ([3c711cd](https://github.com/rich-harris/magic-string/commit/3c711cd56de6c9735f92e41e457353005c2c0d1c)) # [0.28.0](https://github.com/rich-harris/magic-string/compare/v0.27.0...v0.28.0) (2023-02-11) ### Bug Fixes * **typings:** sourcesContent may contain null ([#235](https://github.com/rich-harris/magic-string/issues/235)) ([c2b652a](https://github.com/rich-harris/magic-string/commit/c2b652a0d353f183ca991d0b59a7ad0250a52735)) # [0.27.0](https://github.com/rich-harris/magic-string/compare/v0.26.7...v0.27.0) (2022-12-03) ### Performance Improvements * use @jridgewell/sourcemap-codec ([e68f3e0](https://github.com/rich-harris/magic-string/commit/e68f3e05fe6d87acc1c41eddae97fc32e004320b)) ## [0.26.7](https://github.com/rich-harris/magic-string/compare/v0.26.6...v0.26.7) (2022-10-09) ### Bug Fixes * avoid mutating provided options ([#227](https://github.com/rich-harris/magic-string/issues/227)) ([01d033e](https://github.com/rich-harris/magic-string/commit/01d033e6e8630ef1d0482d9a3899f1da2bf933d5)) ## [0.26.6](https://github.com/rich-harris/magic-string/compare/v0.26.5...v0.26.6) (2022-10-05) ### Features * add `update` method as safer alternative to `overwrite` ([#212](https://github.com/rich-harris/magic-string/issues/212)) ([9a312e3](https://github.com/rich-harris/magic-string/commit/9a312e37a02629f7496c6cfcf307832e991669a3)) ## [0.26.5](https://github.com/rich-harris/magic-string/compare/v0.26.4...v0.26.5) (2022-09-30) ### Bug Fixes * update typescript definition file to contain `replaceAll()` ([#224](https://github.com/rich-harris/magic-string/issues/224)) ([45a4921](https://github.com/rich-harris/magic-string/commit/45a49214ba244b906f4d20450debc8edcc06e2a8)) ## [0.26.4](https://github.com/rich-harris/magic-string/compare/v0.26.3...v0.26.4) (2022-09-22) ### Features * fix `.replace()` when searching string, add `.replaceAll()` ([#222](https://github.com/rich-harris/magic-string/issues/222)) ([04a05bd](https://github.com/rich-harris/magic-string/commit/04a05bdc9bf56e00e616a0ae07923fbd9b63fbd0)) ### Performance Improvements * avoiding use of Object.defineProperty in Chunk constructor ([#219](https://github.com/rich-harris/magic-string/issues/219)) ([130794b](https://github.com/rich-harris/magic-string/commit/130794bb8bfd9f21eb1f50c36a1da8eb5443d256)) ## [0.26.3](https://github.com/rich-harris/magic-string/compare/v0.26.2...v0.26.3) (2022-08-30) ### Performance Improvements * delay guess encoded ([#216](https://github.com/rich-harris/magic-string/issues/216)) ([69b13c7](https://github.com/rich-harris/magic-string/commit/69b13c7a09af742e4f31cf419e8f96e6db32ab5a)) ## [0.26.2](https://github.com/rich-harris/magic-string/compare/v0.26.1...v0.26.2) (2022-05-11) ### Bug Fixes * specify types in exports ([#214](https://github.com/rich-harris/magic-string/issues/214)) ([985e7b4](https://github.com/rich-harris/magic-string/commit/985e7b4d8a6fd5911d2ad2e6524999e9198a6b9f)) ## [0.26.1](https://github.com/rich-harris/magic-string/compare/v0.26.0...v0.26.1) (2022-03-03) ### Bug Fixes * **replace:** match replacer function signature with spec ([902541f](https://github.com/rich-harris/magic-string/commit/902541fdff3998e3c957908de10769d2af1a3c70)) # [0.26.0](https://github.com/rich-harris/magic-string/compare/v0.25.9...v0.26.0) (2022-03-03) ## BREAKING CHANGES * Support of Node.js v10 is dropped. Now `magic-string` requires Node.js v12 or higher. ([#204](https://github.com/Rich-Harris/magic-string/pull/204)) * ESM bundle is now shipped with `.mjs` extension ([#197](https://github.com/Rich-Harris/magic-string/pull/197)) ```diff - "module": "dist/magic-string.es.js", + "module": "dist/magic-string.es.mjs", + "exports": { + "./package.json": "./package.json", + ".": { + "import": "./dist/magic-string.es.mjs", + "require": "./dist/magic-string.cjs.js" + } + }, ``` ### Features * new `hasChanged` method ([#202](https://github.com/rich-harris/magic-string/issues/202)) ([5f2dba7](https://github.com/rich-harris/magic-string/commit/5f2dba72774c444538ed10aa5f2096104cb0b4bb)) * support `replace` method ([#203](https://github.com/rich-harris/magic-string/issues/203)) ([cd74ea2](https://github.com/rich-harris/magic-string/commit/cd74ea2e374f526079ae1a9b9f29bc9cc2fd2ac3)) ## [0.25.9](https://github.com/rich-harris/magic-string/compare/v0.25.8...v0.25.9) (2022-03-03) ### Bug Fixes * allowed overwrite across moved content preceded by split ([#192](https://github.com/rich-harris/magic-string/issues/192)) ([403fa86](https://github.com/rich-harris/magic-string/commit/403fa86b3dcc73f6b2eff177218b7bd4d3128f63)) * **types:** make options partial by default ([2815e77](https://github.com/rich-harris/magic-string/commit/2815e77dd20ff9f776282420eaacfb4aa9e70cd7)) * use defineProperty for appending prop in `storeName` ([#194](https://github.com/rich-harris/magic-string/issues/194)) ([96b7cd3](https://github.com/rich-harris/magic-string/commit/96b7cd37016c1e3fd7037b3910ae56f806a9c09f)) ## [0.25.8](https://github.com/rich-harris/magic-string/compare/v0.25.7...v0.25.8) (2022-03-02) ### Bug Fixes * **types:** mark `MagicString` options as optional ([#183](https://github.com/rich-harris/magic-string/issues/183)) ([15c3e66](https://github.com/rich-harris/magic-string/commit/15c3e6691a2cce79d5298af15fd8a2b02facef88)) ## 0.25.7 * fix bundle mappings after remove and move in multiple sources ([#172](https://github.com/Rich-Harris/magic-string/issues/172)) ## 0.25.6 * Use bitwise operators for small performance boost ([#171](https://github.com/Rich-Harris/magic-string/pull/171)) ## 0.25.5 * Use a bitset to reduce memory consumption ([#167](https://github.com/Rich-Harris/magic-string/issues/167)) ## 0.25.4 * Clone `intro` and `outro` ([#162](https://github.com/Rich-Harris/magic-string/issues/162)) ## 0.25.3 * Fix typing of `SourceMap.version`. ## 0.25.2 * Remove deprecated `new Buffer(...)` * Handle characters outside Latin1 range when generating a sourcemap in browser ([#154](https://github.com/Rich-Harris/magic-string/issues/154)) ## 0.25.1 * Additional types for index.d.ts ([#148](https://github.com/Rich-Harris/magic-string/pull/148)) ## 0.25.0 * Add `length` method ([#145](https://github.com/Rich-Harris/magic-string/pull/145)) * Fix trimming chunks with intro/outro ([#144](https://github.com/Rich-Harris/magic-string/pull/144)) ## 0.24.1 * Add `lastLine` and `lastChar` methods ([#142](https://github.com/Rich-Harris/magic-string/pull/142)) ## 0.24.0 * Add `isEmpty` methods ([#137](https://github.com/Rich-Harris/magic-string/pull/137)) * Fix a potential race condition ([#136](https://github.com/Rich-Harris/magic-string/pull/136)) * Fix CJS/ES bundles inlining `sourcemap-codec` in 0.23.2. ## 0.23.2 * Add `generateDecodedMap` methods ([#134](https://github.com/Rich-Harris/magic-string/pull/134)) ## 0.23.1 * Performance ([#132](https://github.com/Rich-Harris/magic-string/pull/132)) ## 0.23.0 * Use `sourcemap-codec` for improved performance ([#133](https://github.com/Rich-Harris/magic-string/pull/133)) ## 0.22.5 * Add TypeScript interfaces used by rollup ([#131](https://github.com/Rich-Harris/magic-string/pull/131)) * Remove src directory from npm package ## 0.22.4 * `contentOnly` and `storeName` are both optional ## 0.22.3 * Add `original` to TS definitions ## 0.22.2 * Avoid `declare module` ([#127](https://github.com/Rich-Harris/magic-string/pull/127)) ## 0.22.1 * Update TypeScript definitions ([#124](https://github.com/Rich-Harris/magic-string/pull/124)) ## 0.22.0 * Prevent `overwrite` state corruption ([#115](https://github.com/Rich-Harris/magic-string/issues/115)) * Various bugfixes ([#126](https://github.com/Rich-Harris/magic-string/pull/126)) ## 0.21.3 * Clone `indentExclusionRanges` correctly ([#122](https://github.com/Rich-Harris/magic-string/pull/122)) * Fix more typings ([#122](https://github.com/Rich-Harris/magic-string/pull/122)) ## 0.21.2 * Add `default` property referencing self in index-legacy.js, to work around TypeScript bug ([#121](https://github.com/Rich-Harris/magic-string/pull/121)) ## 0.21.1 * Add typings file to package ## 0.21.0 * Add TypeScript bindings ([#119](https://github.com/Rich-Harris/magic-string/pull/119)) ## 0.20.0 * The fourth argument to `overwrite` is a `{storeName, contentOnly}` options object. `storeName: true` is equivalent to `true` before. `contentOnly` will preserve existing appends/prepends to the chunk in question ## 0.19.1 * Prevent overwrites across a split point (i.e. following a `move`) * Implement `remove` separately to `overwrite` ## 0.19.0 * More accurate bundle sourcemaps ([#114](https://github.com/Rich-Harris/magic-string/pull/114)) ## 0.18.0 * Optimisation – remove empty chunks following `overwrite` or `remove` ([#113](https://github.com/Rich-Harris/magic-string/pull/113)) ## 0.17.0 * Add `appendLeft`, `appendRight`, `prependLeft`, `prependRight` methods ([#109](https://github.com/Rich-Harris/magic-string/issues/109)) * `insertLeft` and `insertRight` are deprecated in favour of `appendLeft` and `prependRight` respectively ## 0.16.0 * Include inserts in range for `overwrite` and `remove` operations ([#89](https://github.com/Rich-Harris/magic-string/pull/89)) * Make options optional for `bundle.generateMap(...)` ([#73](https://github.com/Rich-Harris/magic-string/pull/73)) ## 0.15.2 * Generate correct bundle sourcemap with prepended/appended content ## 0.15.1 * Minor sourcemap fixes ## 0.15.0 * Use named export of `Bundle` in ES build, so ES consumers of magic-string can tree-shake it out ## 0.14.0 * Throw if overwrite of zero-length range is attempted * Correctly handle redundant move operations ## 0.13.1 * Fix a bevy of `s.slice()` issues ([#62](https://github.com/Rich-Harris/magic-string/pull/62)) ## 0.13.0 * Breaking: `insertAfter` is now `insertLeft`, `insertBefore` is now `insertRight` * Breaking: `insert` is no longer available. Use `insertLeft` and `insertRight` * Significant performance improvements ## 0.12.1 * Fix sourcemap generation with `insertAfter` and `insertBefore` ## 0.12.0 * Add `insertAfter` and `insertBefore` methods ## 0.11.4 * Fix two regression bugs with `trim()` * More informative error message on illegal removals ## 0.11.3 * Fix trim methods to ensure correct sourcemaps with trimmed content ([#53](https://github.com/Rich-Harris/magic-string/pull/53)) ## 0.11.2 * Support sourcemaps with moved content ## 0.11.1 * Use `findIndex` helper for 0.12 support ## 0.11.0 * Add experimental `move()` method * Refactor internals to support `move()` ## 0.10.2 * Do not overwrite inserts at the end of patched ranges ([#35](https://github.com/Rich-Harris/magic-string/pull/35)) ## 0.10.1 * Zero-length inserts are not removed on adjacent overwrites ## 0.10.0 * Complete rewrite, resulting in ~40x speed increase ([#30](https://github.com/Rich-Harris/magic-string/pull/30)) * Breaking – `magicString.locate` and `locateOrigin` are deprecated * More forgiving rules about contiguous patches, and which ranges are valid with `magicString.slice(...)` ## 0.9.1 * Update deps ## 0.9.0 * Update build process ## 0.8.0 * Add an ES6 build, change default UMD build to CommonJS (but keeping existing UMD build with bundled dependencies) * Make properties non-enumerable, for cleaner logging * Update dependencies ## 0.7.0 * The `names` array is populated when generating sourcemaps, and mappings include name indices where appropriate ([#16](https://github.com/Rich-Harris/magic-string/issues/16)) * Replaced content is mapped correctly in sourcemaps ([#15](https://github.com/Rich-Harris/magic-string/issues/15)) ## 0.6.6 * Adjust mappings correctly when removing replaced content * Error correctly when removed characters are used as slice anchors ## 0.6.5 * Fix `jsnext:main` in package.json ## 0.6.4 * Fix bug with positive integer coercion ## 0.6.3 * Intro content is correctly indented * Content following an intro with trailing newline is correctly indented ## 0.6.2 * Noop indents are still chainable (fixes bug introduced in 0.6.1) ## 0.6.1 * Indenting with an empty string is a noop ## 0.6.0 * Use rollup for bundling, instead of esperanto ## 0.5.3 * Correct sourcemap generation with bundles containing varied separators * `s.clone()` clones indent exclusion ranges and sourcemap locations ## 0.5.2 * `s.slice()` accepts negative numbers, and the second argument can be omitted (means 'original string length'), just like `String.prototype.slice` * More informative error message when trying to overwrite content illegally ## 0.5.1 * Allow bundle separator to be the empty string * Indenting is handled correctly with empty string separator ## 0.5.0 * `s.replace()` is deprecated in favour of `s.overwrite()` (identical signature) * `bundle.addSource()` can take a `MagicString` instance as its sole argument, for convenience * The `options` in `new MagicString(str, options)` can include `filename` and `indentExclusionRanges` options, which will be used when bundling * New method: `s.snip( start, end )` ## 0.4.9 * `file` option is optional when generating a bundle sourcemap ## 0.4.7 * Repeated insertions at position 0 behave the same as other positions ([#10](https://github.com/Rich-Harris/magic-string/pull/10)) ## 0.4.6 * Overlapping ranges can be removed * Non-string content is rejected ([#9](https://github.com/Rich-Harris/magic-string/pull/9)) ## 0.4.5 * Implement `source.addSourcemapLocation()` ## 0.4.4 * Another Windows fix, this time for file paths when bundling ## 0.4.3 * Handle Windows-style CRLF newlines when determining whether a line is empty ## 0.4.2 * Fix typo in package.json (d'oh again) * Use only relative paths for internal modules - makes bundling with dependents (i.e. esperanto) possible ## 0.4.1 * Includes correct files in npm package (d'oh) ## 0.4.0 * Using experimental Esperanto feature ([esperantojs/esperanto#68](https://github.com/esperantojs/esperanto/issues/68)) to generate version with `vlq` dependency included ## 0.3.1 * Fixes a bug whereby multiple insertions at the same location would cause text to repeat ([#5](https://github.com/Rich-Harris/magic-string/issues/5)) ## 0.3.0 * Breaking change - `source.indentStr` is `null` if no lines are indented. Use `source.getIndentString()` for the old behaviour (guess, and if no lines are indented, return `\t`) * `bundle.getIndentString()` ignores sources with no indented lines when guessing indentation ([#3](https://github.com/Rich-Harris/magic-string/issues/3)) ## 0.2.7 * `source.trimLines()` removes empty lines from start/end of source, leaving other whitespace untouched * Indentation is not added to an empty source ## 0.2.6 * Performance improvement - adjustments are only made when necessary ## 0.2.5 * Single spaces are ignored when guessing indentation - experience shows these are more likely to be e.g. JSDoc comments than actual indentation * `bundle.addSource()` can take an `indentExclusionRanges` option ## 0.2.4 * Empty lines are not indented ## 0.2.3 * Fixes edge case with bundle sourcemaps ## 0.2.2 * Make `sources` paths in sourcemaps relative to `options.file` ## 0.2.1 * Minor fix for `bundle.indent()` ## 0.2.0 * Implement `MagicString.Bundle` for concatenating magic strings ## 0.1.10 * Fix sourcemap encoding ## 0.1.9 * Better performance when indenting large chunks of code ## 0.1.8 * Sourcemaps generated with `s.generateMap()` have a `toUrl()` method that generates a DataURI ## 0.1.7 * Implement `s.insert( index, content )` - roughly equivalent to `s.replace( index, index, content )` ## 0.1.6 * Version bump for npm's benefit ## 0.1.5 * `s.indent({ exclude: [ x, y ] })` prevents lines between (original) characters `x` and `y` from being indented. Multiple exclusion ranges are also supported (e.g. `exclude: [[a, b], [c, d]]`) ## 0.1.4 * `s.locate()` doesn't throw out-of-bound error if index is equal to original string's length ## 0.1.3 * `s.trim()` returns `this` (i.e. is chainable) ## 0.1.2 * Implement `s.slice()` ## 0.1.1 * Implement `s.trim()` ## 0.1.0 * First release magic-string-0.30.10/LICENSE000066400000000000000000000020331460774323400152540ustar00rootroot00000000000000Copyright 2018 Rich Harris Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. magic-string-0.30.10/README.md000066400000000000000000000275241460774323400155420ustar00rootroot00000000000000# magic-string build status npm version license Suppose you have some source code. You want to make some light modifications to it - replacing a few characters here and there, wrapping it with a header and footer, etc - and ideally you'd like to generate a [source map](https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/) at the end of it. You've thought about using something like [recast](https://github.com/benjamn/recast) (which allows you to generate an AST from some JavaScript, manipulate it, and reprint it with a sourcemap without losing your comments and formatting), but it seems like overkill for your needs (or maybe the source code isn't JavaScript). Your requirements are, frankly, rather niche. But they're requirements that I also have, and for which I made magic-string. It's a small, fast utility for manipulating strings and generating sourcemaps. ## Installation magic-string works in both node.js and browser environments. For node, install with npm: ```bash npm i magic-string ``` To use in browser, grab the [magic-string.umd.js](https://unpkg.com/magic-string/dist/magic-string.umd.js) file and add it to your page: ```html ``` (It also works with various module systems, if you prefer that sort of thing - it has a dependency on [vlq](https://github.com/Rich-Harris/vlq).) ## Usage These examples assume you're in node.js, or something similar: ```js import MagicString from 'magic-string'; import fs from 'fs' const s = new MagicString('problems = 99'); s.update(0, 8, 'answer'); s.toString(); // 'answer = 99' s.update(11, 13, '42'); // character indices always refer to the original string s.toString(); // 'answer = 42' s.prepend('var ').append(';'); // most methods are chainable s.toString(); // 'var answer = 42;' const map = s.generateMap({ source: 'source.js', file: 'converted.js.map', includeContent: true }); // generates a v3 sourcemap fs.writeFileSync('converted.js', s.toString()); fs.writeFileSync('converted.js.map', map.toString()); ``` You can pass an options argument: ```js const s = new MagicString(someCode, { // these options will be used if you later call `bundle.addSource( s )` - see below filename: 'foo.js', indentExclusionRanges: [/*...*/], // mark source as ignore in DevTools, see below #Bundling ignoreList: false }); ``` ## Methods ### s.addSourcemapLocation( index ) Adds the specified character index (with respect to the original string) to sourcemap mappings, if `hires` is `false` (see below). ### s.append( content ) Appends the specified content to the end of the string. Returns `this`. ### s.appendLeft( index, content ) Appends the specified `content` at the `index` in the original string. If a range *ending* with `index` is subsequently moved, the insert will be moved with it. Returns `this`. See also `s.prependLeft(...)`. ### s.appendRight( index, content ) Appends the specified `content` at the `index` in the original string. If a range *starting* with `index` is subsequently moved, the insert will be moved with it. Returns `this`. See also `s.prependRight(...)`. ### s.clone() Does what you'd expect. ### s.generateDecodedMap( options ) Generates a sourcemap object with raw mappings in array form, rather than encoded as a string. See `generateMap` documentation below for options details. Useful if you need to manipulate the sourcemap further, but most of the time you will use `generateMap` instead. ### s.generateMap( options ) Generates a [version 3 sourcemap](https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit). All options are, well, optional: * `file` - the filename where you plan to write the sourcemap * `source` - the filename of the file containing the original source * `includeContent` - whether to include the original content in the map's `sourcesContent` array * `hires` - whether the mapping should be high-resolution. Hi-res mappings map every single character, meaning (for example) your devtools will always be able to pinpoint the exact location of function calls and so on. With lo-res mappings, devtools may only be able to identify the correct line - but they're quicker to generate and less bulky. You can also set `"boundary"` to generate a semi-hi-res mappings segmented per word boundary instead of per character, suitable for string semantics that are separated by words. If sourcemap locations have been specified with `s.addSourcemapLocation()`, they will be used here. The returned sourcemap has two (non-enumerable) methods attached for convenience: * `toString` - returns the equivalent of `JSON.stringify(map)` * `toUrl` - returns a DataURI containing the sourcemap. Useful for doing this sort of thing: ```js code += '\n//# sourceMappingURL=' + map.toUrl(); ``` ### s.hasChanged() Indicates if the string has been changed. ### s.indent( prefix[, options] ) Prefixes each line of the string with `prefix`. If `prefix` is not supplied, the indentation will be guessed from the original content, falling back to a single tab character. Returns `this`. The `options` argument can have an `exclude` property, which is an array of `[start, end]` character ranges. These ranges will be excluded from the indentation - useful for (e.g.) multiline strings. ### s.insertLeft( index, content ) **DEPRECATED** since 0.17 – use `s.appendLeft(...)` instead ### s.insertRight( index, content ) **DEPRECATED** since 0.17 – use `s.prependRight(...)` instead ### s.isEmpty() Returns true if the resulting source is empty (disregarding white space). ### s.locate( index ) **DEPRECATED** since 0.10 – see [#30](https://github.com/Rich-Harris/magic-string/pull/30) ### s.locateOrigin( index ) **DEPRECATED** since 0.10 – see [#30](https://github.com/Rich-Harris/magic-string/pull/30) ### s.move( start, end, index ) Moves the characters from `start` and `end` to `index`. Returns `this`. ### s.overwrite( start, end, content[, options] ) Replaces the characters from `start` to `end` with `content`, along with the appended/prepended content in that range. The same restrictions as `s.remove()` apply. Returns `this`. The fourth argument is optional. It can have a `storeName` property — if `true`, the original name will be stored for later inclusion in a sourcemap's `names` array — and a `contentOnly` property which determines whether only the content is overwritten, or anything that was appended/prepended to the range as well. It may be preferred to use `s.update(...)` instead if you wish to avoid overwriting the appended/prepended content. ### s.prepend( content ) Prepends the string with the specified content. Returns `this`. ### s.prependLeft ( index, content ) Same as `s.appendLeft(...)`, except that the inserted content will go *before* any previous appends or prepends at `index` ### s.prependRight ( index, content ) Same as `s.appendRight(...)`, except that the inserted content will go *before* any previous appends or prepends at `index` ### s.replace( regexpOrString, substitution ) String replacement with RegExp or string. When using a RegExp, replacer function is also supported. Returns `this`. ```ts import MagicString from 'magic-string' const s = new MagicString(source) s.replace('foo', 'bar') s.replace(/foo/g, 'bar') s.replace(/(\w)(\d+)/g, (_, $1, $2) => $1.toUpperCase() + $2) ``` The differences from [`String.replace`]((https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)): - It will always match against the **original string** - It mutates the magic string state (use `.clone()` to be immutable) ### s.replaceAll( regexpOrString, substitution ) Same as `s.replace`, but replace all matched strings instead of just one. If `substitution` is a regex, then it must have the global (`g`) flag set, or a `TypeError` is thrown. Matches the behavior of the builtin [`String.property.replaceAll`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll). ### s.remove( start, end ) Removes the characters from `start` to `end` (of the original string, **not** the generated string). Removing the same content twice, or making removals that partially overlap, will cause an error. Returns `this`. ### s.reset( start, end ) Resets the characters from `start` to `end` (of the original string, **not** the generated string). It can be used to restore previously removed characters and discard unwanted changes. ### s.slice( start, end ) Returns the content of the generated string that corresponds to the slice between `start` and `end` of the original string. Throws error if the indices are for characters that were already removed. ### s.snip( start, end ) Returns a clone of `s`, with all content before the `start` and `end` characters of the original string removed. ### s.toString() Returns the generated string. ### s.trim([ charType ]) Trims content matching `charType` (defaults to `\s`, i.e. whitespace) from the start and end. Returns `this`. ### s.trimStart([ charType ]) Trims content matching `charType` (defaults to `\s`, i.e. whitespace) from the start. Returns `this`. ### s.trimEnd([ charType ]) Trims content matching `charType` (defaults to `\s`, i.e. whitespace) from the end. Returns `this`. ### s.trimLines() Removes empty lines from the start and end. Returns `this`. ### s.update( start, end, content[, options] ) Replaces the characters from `start` to `end` with `content`. The same restrictions as `s.remove()` apply. Returns `this`. The fourth argument is optional. It can have a `storeName` property — if `true`, the original name will be stored for later inclusion in a sourcemap's `names` array — and an `overwrite` property which defaults to `false` and determines whether anything that was appended/prepended to the range will be overwritten along with the original content. `s.update(start, end, content)` is equivalent to `s.overwrite(start, end, content, { contentOnly: true })`. ## Bundling To concatenate several sources, use `MagicString.Bundle`: ```js const bundle = new MagicString.Bundle(); bundle.addSource({ filename: 'foo.js', content: new MagicString('var answer = 42;') }); bundle.addSource({ filename: 'bar.js', content: new MagicString('console.log( answer )') }); // Sources can be marked as ignore-listed, which provides a hint to debuggers // to not step into this code and also don't show the source files depending // on user preferences. bundle.addSource({ filename: 'some-3rdparty-library.js', content: new MagicString('function myLib(){}'), ignoreList: false // <-- }) // Advanced: a source can include an `indentExclusionRanges` property // alongside `filename` and `content`. This will be passed to `s.indent()` // - see documentation above bundle.indent() // optionally, pass an indent string, otherwise it will be guessed .prepend('(function () {\n') .append('}());'); bundle.toString(); // (function () { // var answer = 42; // console.log( answer ); // }()); // options are as per `s.generateMap()` above const map = bundle.generateMap({ file: 'bundle.js', includeContent: true, hires: true }); ``` As an alternative syntax, if you a) don't have `filename` or `indentExclusionRanges` options, or b) passed those in when you used `new MagicString(...)`, you can simply pass the `MagicString` instance itself: ```js const bundle = new MagicString.Bundle(); const source = new MagicString(someCode, { filename: 'foo.js' }); bundle.addSource(source); ``` ## License MIT magic-string-0.30.10/benchmark/000077500000000000000000000000001460774323400162035ustar00rootroot00000000000000magic-string-0.30.10/benchmark/data-min.js000066400000000000000000000432471460774323400202450ustar00rootroot00000000000000/* eslint-disable */ import{encode as k}from"sourcemap-codec";class p{constructor(t){this.bits=t instanceof p?t.bits.slice():[]}add(t){this.bits[t>>5]|=1<<(t&31)}has(t){return!!(this.bits[t>>5]&1<<(t&31))}}class g{constructor(t,e,n){this.start=t,this.end=e,this.original=n,this.intro="",this.outro="",this.content=n,this.storeName=!1,this.edited=!1,Object.defineProperties(this,{previous:{writable:!0,value:null},next:{writable:!0,value:null}})}appendLeft(t){this.outro+=t}appendRight(t){this.intro=this.intro+t}clone(){const t=new g(this.start,this.end,this.original);return t.intro=this.intro,t.outro=this.outro,t.content=this.content,t.storeName=this.storeName,t.edited=this.edited,t}contains(t){return this.start{throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.")};typeof window<"u"&&typeof window.btoa=="function"?w=l=>window.btoa(unescape(encodeURIComponent(l))):typeof Buffer=="function"&&(w=l=>Buffer.from(l,"utf-8").toString("base64"));class b{constructor(t){this.version=3,this.file=t.file,this.sources=t.sources,this.sourcesContent=t.sourcesContent,this.names=t.names,this.mappings=k(t.mappings)}toString(){return JSON.stringify(this)}toUrl(){return"data:application/json;charset=utf-8;base64,"+w(this.toString())}}function L(l){const t=l.split(` `),e=t.filter(r=>/^\t+/.test(r)),n=t.filter(r=>/^ {2,}/.test(r));if(e.length===0&&n.length===0)return null;if(e.length>=n.length)return" ";const i=n.reduce((r,s)=>{const h=/^ +/.exec(s)[0].length;return Math.min(h,r)},1/0);return new Array(i+1).join(" ")}function E(l,t){const e=l.split(/[/\\]/),n=t.split(/[/\\]/);for(e.pop();e[0]===n[0];)e.shift(),n.shift();if(e.length){let i=e.length;for(;i--;)e[i]=".."}return e.concat(n).join("/")}const R=Object.prototype.toString;function x(l){return R.call(l)==="[object Object]"}function C(l){const t=l.split(` `),e=[];for(let n=0,i=0;n>1;i=0&&r.push(i),this.rawSegments.push(r)}else this.pending&&this.rawSegments.push(this.pending);this.advance(e),this.pending=null}addUneditedChunk(t,e,n,i,r){let s=e.start,h=!0;for(;s1){for(let n=0;n{const h=r(s.start);s.intro.length&&i.advance(s.intro),s.edited?i.addEdit(e,s.content,h,s.storeName?n.indexOf(s.original):-1):i.addUneditedChunk(e,s,this.original,h,this.sourcemapLocations),s.outro.length&&i.advance(s.outro)}),{file:t.file?t.file.split(/[/\\]/).pop():null,sources:[t.source?E(t.file||"",t.source):null],sourcesContent:t.includeContent?[this.original]:[null],names:n,mappings:i.raw}}generateMap(t){return new b(this.generateDecodedMap(t))}getIndentString(){return this.indentStr===null?" ":this.indentStr}indent(t,e){const n=/^[^\r\n]/gm;if(x(t)&&(e=t,t=void 0),t=t!==void 0?t:this.indentStr||" ",t==="")return this;e=e||{};const i={};e.exclude&&(typeof e.exclude[0]=="number"?[e.exclude]:e.exclude).forEach(u=>{for(let m=u[0];mr?`${t}${a}`:(r=!0,a);this.intro=this.intro.replace(n,s);let h=0,o=this.firstChunk;for(;o;){const a=o.end;if(o.edited)i[h]||(o.content=o.content.replace(n,s),o.content.length&&(r=o.content[o.content.length-1]===` `));else for(h=o.start;h=t&&n<=e)throw new Error("Cannot move a selection inside itself");this._split(t),this._split(e),this._split(n);const i=this.byStart[t],r=this.byEnd[e],s=i.previous,h=r.next,o=this.byStart[n];if(!o&&r===this.lastChunk)return this;const a=o?o.previous:this.lastChunk;return s&&(s.next=h),h&&(h.previous=s),a&&(a.next=i),o&&(o.previous=r),i.previous||(this.firstChunk=r.next),r.next||(this.lastChunk=i.previous,this.lastChunk.next=null),i.previous=a,r.next=o||null,a||(this.firstChunk=i),o||(this.lastChunk=r),this}overwrite(t,e,n,i){if(typeof n!="string")throw new TypeError("replacement content must be a string");for(;t<0;)t+=this.original.length;for(;e<0;)e+=this.original.length;if(e>this.original.length)throw new Error("end is out of bounds");if(t===e)throw new Error("Cannot overwrite a zero-length range \u2013 use appendLeft or prependRight instead");this._split(t),this._split(e),i===!0&&(c.storeName||(console.warn("The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string"),c.storeName=!0),i={storeName:!0});const r=i!==void 0?i.storeName:!1,s=i!==void 0?i.contentOnly:!1;if(r){const a=this.original.slice(t,e);Object.defineProperty(this.storedNames,a,{writable:!0,value:!0,enumerable:!0})}const h=this.byStart[t],o=this.byEnd[e];if(h){let a=h;for(;a!==o;){if(a.next!==this.byStart[a.end])throw new Error("Cannot overwrite across a split point");a=a.next,a.edit("",!1)}h.edit(n,r,s)}else{const a=new g(t,e,"").edit(n,r);o.next=a,a.previous=o}return this}prepend(t){if(typeof t!="string")throw new TypeError("outro content must be a string");return this.intro=t+this.intro,this}prependLeft(t,e){if(typeof e!="string")throw new TypeError("inserted content must be a string");this._split(t);const n=this.byEnd[t];return n?n.prependLeft(e):this.intro=e+this.intro,this}prependRight(t,e){if(typeof e!="string")throw new TypeError("inserted content must be a string");this._split(t);const n=this.byStart[t];return n?n.prependRight(e):this.outro=e+this.outro,this}remove(t,e){for(;t<0;)t+=this.original.length;for(;e<0;)e+=this.original.length;if(t===e)return this;if(t<0||e>this.original.length)throw new Error("Character is out of bounds");if(t>e)throw new Error("end must be greater than start");this._split(t),this._split(e);let n=this.byStart[t];for(;n;)n.intro="",n.outro="",n.edit(""),n=e>n.end?this.byStart[n.end]:null;return this}lastChar(){if(this.outro.length)return this.outro[this.outro.length-1];let t=this.lastChunk;do{if(t.outro.length)return t.outro[t.outro.length-1];if(t.content.length)return t.content[t.content.length-1];if(t.intro.length)return t.intro[t.intro.length-1]}while(t=t.previous);return this.intro.length?this.intro[this.intro.length-1]:""}lastLine(){let t=this.outro.lastIndexOf(d);if(t!==-1)return this.outro.substr(t+1);let e=this.outro,n=this.lastChunk;do{if(n.outro.length>0){if(t=n.outro.lastIndexOf(d),t!==-1)return n.outro.substr(t+1)+e;e=n.outro+e}if(n.content.length>0){if(t=n.content.lastIndexOf(d),t!==-1)return n.content.substr(t+1)+e;e=n.content+e}if(n.intro.length>0){if(t=n.intro.lastIndexOf(d),t!==-1)return n.intro.substr(t+1)+e;e=n.intro+e}}while(n=n.previous);return t=this.intro.lastIndexOf(d),t!==-1?this.intro.substr(t+1)+e:this.intro+e}slice(t=0,e=this.original.length){for(;t<0;)t+=this.original.length;for(;e<0;)e+=this.original.length;let n="",i=this.firstChunk;for(;i&&(i.start>t||i.end<=t);){if(i.start=e)return n;i=i.next}if(i&&i.edited&&i.start!==t)throw new Error(`Cannot use replaced character ${t} as slice start anchor.`);const r=i;for(;i;){i.intro&&(r!==i||i.start===t)&&(n+=i.intro);const s=i.start=e;if(s&&i.edited&&i.end!==e)throw new Error(`Cannot use replaced character ${e} as slice end anchor.`);const h=r===i?t-i.start:0,o=s?i.content.length+e-i.end:i.content.length;if(n+=i.content.slice(h,o),i.outro&&(!s||i.end===e)&&(n+=i.outro),s)break;i=i.next}return n}snip(t,e){const n=this.clone();return n.remove(0,t),n.remove(e,n.original.length),n}_split(t){if(this.byStart[t]||this.byEnd[t])return;let e=this.lastSearchedChunk;const n=t>e.end;for(;e;){if(e.contains(t))return this._splitChunk(e,t);e=n?this.byStart[e.end]:this.byEnd[e.start]}}_splitChunk(t,e){if(t.edited&&t.content.length){const i=C(this.original)(e);throw new Error(`Cannot split a chunk that has already been edited (${i.line}:${i.column} \u2013 "${t.original}")`)}const n=t.split(e);return this.byEnd[e]=t,this.byStart[e]=n,this.byEnd[n.end]=n,t===this.lastChunk&&(this.lastChunk=n),this.lastSearchedChunk=t,!0}toString(){let t=this.intro,e=this.firstChunk;for(;e;)t+=e.toString(),e=e.next;return t+this.outro}isEmpty(){let t=this.firstChunk;do if(t.intro.length&&t.intro.trim()||t.content.length&&t.content.trim()||t.outro.length&&t.outro.trim())return!1;while(t=t.next);return!0}length(){let t=this.firstChunk,e=0;do e+=t.intro.length+t.content.length+t.outro.length;while(t=t.next);return e}trimLines(){return this.trim("[\\r\\n]")}trim(t){return this.trimStart(t).trimEnd(t)}trimEndAborted(t){const e=new RegExp((t||"\\s")+"+$");if(this.outro=this.outro.replace(e,""),this.outro.length)return!0;let n=this.lastChunk;do{const i=n.end,r=n.trimEnd(e);if(n.end!==i&&(this.lastChunk===n&&(this.lastChunk=n.next),this.byEnd[n.end]=n,this.byStart[n.next.start]=n.next,this.byEnd[n.next.end]=n.next),r)return!0;n=n.previous}while(n);return!1}trimEnd(t){return this.trimEndAborted(t),this}trimStartAborted(t){const e=new RegExp("^"+(t||"\\s")+"+");if(this.intro=this.intro.replace(e,""),this.intro.length)return!0;let n=this.firstChunk;do{const i=n.end,r=n.trimStart(e);if(n.end!==i&&(n===this.lastChunk&&(this.lastChunk=n.next),this.byEnd[n.end]=n,this.byStart[n.next.start]=n.next,this.byEnd[n.next.end]=n.next),r)return!0;n=n.next}while(n);return!1}trimStart(t){return this.trimStartAborted(t),this}hasChanged(){return this.original!==this.toString()}replace(t,e){function n(r,s){return typeof e=="string"?e.replace(/\$(\$|&|\d+)/g,(h,o)=>o==="$"?"$":o==="&"?r[0]:+o{s.index!=null&&this.overwrite(s.index,s.index+s[0].length,n(s,this.original))});else{const r=this.original.match(t);r&&r.index!=null&&this.overwrite(r.index,r.index+r[0].length,n(r,this.original))}return this}}const v=Object.prototype.hasOwnProperty;class S{constructor(t={}){this.intro=t.intro||"",this.separator=t.separator!==void 0?t.separator:` `,this.sources=[],this.uniqueSources=[],this.uniqueSourceIndexByFilename={}}addSource(t){if(t instanceof f)return this.addSource({content:t,filename:t.filename,separator:this.separator});if(!x(t)||!t.content)throw new Error("bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`");if(["filename","indentExclusionRanges","separator"].forEach(e=>{v.call(t,e)||(t[e]=t.content[e])}),t.separator===void 0&&(t.separator=this.separator),t.filename)if(!v.call(this.uniqueSourceIndexByFilename,t.filename))this.uniqueSourceIndexByFilename[t.filename]=this.uniqueSources.length,this.uniqueSources.push({filename:t.filename,content:t.content.original});else{const e=this.uniqueSources[this.uniqueSourceIndexByFilename[t.filename]];if(t.content.original!==e.content)throw new Error(`Illegal source: same filename (${t.filename}), different contents`)}return this.sources.push(t),this}append(t,e){return this.addSource({content:new f(t),separator:e&&e.separator||""}),this}clone(){const t=new S({intro:this.intro,separator:this.separator});return this.sources.forEach(e=>{t.addSource({filename:e.filename,content:e.content.clone(),separator:e.separator})}),t}generateDecodedMap(t={}){const e=[];this.sources.forEach(i=>{Object.keys(i.content.storedNames).forEach(r=>{~e.indexOf(r)||e.push(r)})});const n=new y(t.hires);return this.intro&&n.advance(this.intro),this.sources.forEach((i,r)=>{r>0&&n.advance(this.separator);const s=i.filename?this.uniqueSourceIndexByFilename[i.filename]:-1,h=i.content,o=C(h.original);h.intro&&n.advance(h.intro),h.firstChunk.eachNext(a=>{const u=o(a.start);a.intro.length&&n.advance(a.intro),i.filename?a.edited?n.addEdit(s,a.content,u,a.storeName?e.indexOf(a.original):-1):n.addUneditedChunk(s,a,h.original,u,h.sourcemapLocations):n.advance(a.content),a.outro.length&&n.advance(a.outro)}),h.outro&&n.advance(h.outro)}),{file:t.file?t.file.split(/[/\\]/).pop():null,sources:this.uniqueSources.map(i=>t.file?E(t.file,i.filename):i.filename),sourcesContent:this.uniqueSources.map(i=>t.includeContent?i.content:null),names:e,mappings:n.raw}}generateMap(t){return new b(this.generateDecodedMap(t))}getIndentString(){const t={};return this.sources.forEach(e=>{const n=e.content.indentStr;n!==null&&(t[n]||(t[n]=0),t[n]+=1)}),Object.keys(t).sort((e,n)=>t[e]-t[n])[0]||" "}indent(t){if(arguments.length||(t=this.getIndentString()),t==="")return this;let e=!this.intro||this.intro.slice(-1)===` `;return this.sources.forEach((n,i)=>{const r=n.separator!==void 0?n.separator:this.separator,s=e||i>0&&/\r?\n$/.test(r);n.content.indent(t,{exclude:n.indentExclusionRanges,indentStart:s}),e=n.content.lastChar()===` `}),this.intro&&(this.intro=t+this.intro.replace(/^[^\n]/gm,(n,i)=>i>0?t+n:n)),this}prepend(t){return this.intro=t+this.intro,this}toString(){const t=this.sources.map((e,n)=>{const i=e.separator!==void 0?e.separator:this.separator;return(n>0?i:"")+e.content.toString()}).join("");return this.intro+t}isEmpty(){return!(this.intro.length&&this.intro.trim()||this.sources.some(t=>!t.content.isEmpty()))}length(){return this.sources.reduce((t,e)=>t+e.content.length(),this.intro.length)}trimLines(){return this.trim("[\\r\\n]")}trim(t){return this.trimStart(t).trimEnd(t)}trimStart(t){const e=new RegExp("^"+(t||"\\s")+"+");if(this.intro=this.intro.replace(e,""),!this.intro){let n,i=0;do if(n=this.sources[i++],!n)break;while(!n.content.trimStartAborted(t))}return this}trimEnd(t){const e=new RegExp((t||"\\s")+"+$");let n,i=this.sources.length-1;do if(n=this.sources[i--],!n){this.intro=this.intro.replace(e,"");break}while(!n.content.trimEndAborted(t));return this}}export{S as Bundle,b as SourceMap,f as default}; magic-string-0.30.10/benchmark/data.js000066400000000000000000001012221460774323400174500ustar00rootroot00000000000000/* eslint-disable */ import { encode } from "sourcemap-codec"; class BitSet { constructor(arg) { this.bits = arg instanceof BitSet ? arg.bits.slice() : []; } add(n2) { this.bits[n2 >> 5] |= 1 << (n2 & 31); } has(n2) { return !!(this.bits[n2 >> 5] & 1 << (n2 & 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; Object.defineProperties(this, { previous: { writable: true, value: null }, next: { writable: true, value: 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; } 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) { 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("", void 0, true); } return true; } else { this.edit("", void 0, 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) { this.split(this.end - trimmed.length); this.edit("", void 0, true); } return true; } else { this.edit("", void 0, true); this.outro = this.outro.replace(rx, ""); if (this.outro.length) return true; } } } let _btoa = () => { throw new Error("Unsupported environment: `btoa` or `Buffer` should be supported."); }; if (typeof Buffer === "function") { _btoa = (str) => Buffer.from(str, "utf-8").toString("base64"); } else if (typeof btoa === "function") { _btoa = btoa; } 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); } 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; } if (tabbed.length >= spaced.length) { return " "; } 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(); 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 }; }; } 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) { const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; if (nameIndex >= 0) { segment.push(nameIndex); } this.rawSegments.push(segment); } 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; while (originalCharIndex < chunk.end) { if (this.hires || first || sourcemapLocations.has(originalCharIndex)) { this.rawSegments.push([this.generatedCodeColumn, sourceIndex, loc.line, loc.column]); } 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: guessIndent(string) } }); 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() : null, sources: [options.source ? getRelativePath(options.file || "", options.source) : null], sourcesContent: options.includeContent ? [this.original] : [null], names, mappings: mappings.raw }; } generateMap(options) { return new SourceMap(this.generateDecodedMap(options)); } getIndentString() { return this.indentStr === null ? " " : this.indentStr; } indent(indentStr, options) { const pattern = /^[^\r\n]/gm; if (isObject(indentStr)) { options = indentStr; indentStr = void 0; } indentStr = indentStr !== void 0 ? indentStr : this.indentStr || " "; if (indentStr === "") return this; options = options || {}; 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"); warned.insertLeft = true; } return this.appendLeft(index, content); } insertRight(index, content) { if (!warned.insertRight) { console.warn("magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead"); 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) { 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 \u2013 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"); warned.storeName = true; } options = { storeName: true }; } const storeName = options !== void 0 ? options.storeName : false; const contentOnly = options !== void 0 ? options.contentOnly : 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, contentOnly); } else { const newChunk = new Chunk(start, end, "").edit(content, storeName); 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; } 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 = ""; let chunk = this.firstChunk; while (chunk && (chunk.start > start || chunk.end <= 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; } 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) { const loc = getLocator(this.original)(index); throw new Error(`Cannot split a chunk that has already been edited (${loc.line}:${loc.column} \u2013 "${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.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) { 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(); } replace(searchValue, replacement) { function getReplacement(match, str) { if (typeof replacement === "string") { return replacement.replace(/\$(\$|&|\d+)/g, (_, i) => { 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 (typeof searchValue !== "string" && 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; } } const hasOwnProp = Object.prototype.hasOwnProperty; class Bundle { constructor(options = {}) { this.intro = options.intro || ""; this.separator = options.separator !== void 0 ? options.separator : "\n"; this.sources = []; this.uniqueSources = []; this.uniqueSourceIndexByFilename = {}; } addSource(source) { if (source instanceof MagicString) { return this.addSource({ content: source, filename: source.filename, separator: this.separator }); } if (!isObject(source) || !source.content) { throw new Error("bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`"); } ["filename", "indentExclusionRanges", "separator"].forEach((option) => { if (!hasOwnProp.call(source, option)) source[option] = source.content[option]; }); if (source.separator === void 0) { source.separator = this.separator; } if (source.filename) { if (!hasOwnProp.call(this.uniqueSourceIndexByFilename, source.filename)) { this.uniqueSourceIndexByFilename[source.filename] = this.uniqueSources.length; this.uniqueSources.push({ filename: source.filename, content: source.content.original }); } else { const uniqueSource = this.uniqueSources[this.uniqueSourceIndexByFilename[source.filename]]; if (source.content.original !== uniqueSource.content) { throw new Error(`Illegal source: same filename (${source.filename}), different contents`); } } } this.sources.push(source); return this; } append(str, options) { this.addSource({ content: new MagicString(str), separator: options && options.separator || "" }); return this; } clone() { const bundle = new Bundle({ intro: this.intro, separator: this.separator }); this.sources.forEach((source) => { bundle.addSource({ filename: source.filename, content: source.content.clone(), separator: source.separator }); }); return bundle; } generateDecodedMap(options = {}) { const names = []; this.sources.forEach((source) => { Object.keys(source.content.storedNames).forEach((name) => { if (!~names.indexOf(name)) names.push(name); }); }); const mappings = new Mappings(options.hires); if (this.intro) { mappings.advance(this.intro); } this.sources.forEach((source, i) => { if (i > 0) { mappings.advance(this.separator); } const sourceIndex = source.filename ? this.uniqueSourceIndexByFilename[source.filename] : -1; const magicString = source.content; const locate = getLocator(magicString.original); if (magicString.intro) { mappings.advance(magicString.intro); } magicString.firstChunk.eachNext((chunk) => { const loc = locate(chunk.start); if (chunk.intro.length) mappings.advance(chunk.intro); if (source.filename) { if (chunk.edited) { mappings.addEdit(sourceIndex, chunk.content, loc, chunk.storeName ? names.indexOf(chunk.original) : -1); } else { mappings.addUneditedChunk(sourceIndex, chunk, magicString.original, loc, magicString.sourcemapLocations); } } else { mappings.advance(chunk.content); } if (chunk.outro.length) mappings.advance(chunk.outro); }); if (magicString.outro) { mappings.advance(magicString.outro); } }); return { file: options.file ? options.file.split(/[/\\]/).pop() : null, sources: this.uniqueSources.map((source) => { return options.file ? getRelativePath(options.file, source.filename) : source.filename; }), sourcesContent: this.uniqueSources.map((source) => { return options.includeContent ? source.content : null; }), names, mappings: mappings.raw }; } generateMap(options) { return new SourceMap(this.generateDecodedMap(options)); } getIndentString() { const indentStringCounts = {}; this.sources.forEach((source) => { const indentStr = source.content.indentStr; if (indentStr === null) return; if (!indentStringCounts[indentStr]) indentStringCounts[indentStr] = 0; indentStringCounts[indentStr] += 1; }); return Object.keys(indentStringCounts).sort((a, b) => { return indentStringCounts[a] - indentStringCounts[b]; })[0] || " "; } indent(indentStr) { if (!arguments.length) { indentStr = this.getIndentString(); } if (indentStr === "") return this; let trailingNewline = !this.intro || this.intro.slice(-1) === "\n"; this.sources.forEach((source, i) => { const separator = source.separator !== void 0 ? source.separator : this.separator; const indentStart = trailingNewline || i > 0 && /\r?\n$/.test(separator); source.content.indent(indentStr, { exclude: source.indentExclusionRanges, indentStart }); trailingNewline = source.content.lastChar() === "\n"; }); if (this.intro) { this.intro = indentStr + this.intro.replace(/^[^\n]/gm, (match, index) => { return index > 0 ? indentStr + match : match; }); } return this; } prepend(str) { this.intro = str + this.intro; return this; } toString() { const body = this.sources.map((source, i) => { const separator = source.separator !== void 0 ? source.separator : this.separator; const str = (i > 0 ? separator : "") + source.content.toString(); return str; }).join(""); return this.intro + body; } isEmpty() { if (this.intro.length && this.intro.trim()) return false; if (this.sources.some((source) => !source.content.isEmpty())) return false; return true; } length() { return this.sources.reduce((length, source) => length + source.content.length(), this.intro.length); } trimLines() { return this.trim("[\\r\\n]"); } trim(charType) { return this.trimStart(charType).trimEnd(charType); } trimStart(charType) { const rx = new RegExp("^" + (charType || "\\s") + "+"); this.intro = this.intro.replace(rx, ""); if (!this.intro) { let source; let i = 0; do { source = this.sources[i++]; if (!source) { break; } } while (!source.content.trimStartAborted(charType)); } return this; } trimEnd(charType) { const rx = new RegExp((charType || "\\s") + "+$"); let source; let i = this.sources.length - 1; do { source = this.sources[i--]; if (!source) { this.intro = this.intro.replace(rx, ""); break; } } while (!source.content.trimEndAborted(charType)); return this; } } export { Bundle, SourceMap, MagicString as default }; magic-string-0.30.10/benchmark/index.mjs000066400000000000000000000035711460774323400200330ustar00rootroot00000000000000import Benchmark from 'benchmark'; import MagicString from '../dist/magic-string.es.mjs'; import fs from 'fs/promises'; Benchmark.support.decompilation = false; console.log(`node ${process.version}\n`); function runWithInstance(name, inputs, func, setup) { const ss = []; new Benchmark( name, { setup: () => { for (const [i, input] of inputs.entries()) { ss[i] = new MagicString(input); if (setup) { setup(ss[i]); } } }, fn: () => { for (const i of inputs.keys()) { func(ss[i]); } } } ).on('complete', (event) => { console.log(String(event.target)); }).on('error', (event) => { console.error(event.target.error); }).run(); } async function bench() { const inputs = await Promise.all( ['data.js', 'data-min.js'].map( (file) => fs.readFile(new URL(file, import.meta.url), 'utf-8') ) ); new Benchmark('construct', { fn: () => { for (const input of inputs) { new MagicString(input); } } }).on('complete', (event) => { console.log(String(event.target)); }).on('error', (event) => { console.error(event.target.error); }).run(); runWithInstance('append', inputs, s => { s.append(';"append";'); }); runWithInstance('indent', inputs, s => { s.indent(); }); runWithInstance('generateMap (no edit)', inputs, s => { s.generateMap(); }); runWithInstance('generateMap (edit)', inputs, s => { s.generateMap(); }, s => { s.replace(/replacement/g, 'replacement\nReplacement'); }); runWithInstance('generateDecodedMap (no edit)', inputs, s => { s.generateDecodedMap(); }); runWithInstance('generateDecodedMap (edit)', inputs, s => { s.generateDecodedMap(); }, s => { s.replace(/replacement/g, 'replacement\nReplacement'); }); const size = 1000000; runWithInstance('overwrite', ['a'.repeat(size)], s => { for (let i = 1; i < size; i+=2) { s.overwrite(i, i+1, 'b'); } }); } bench(); magic-string-0.30.10/example/000077500000000000000000000000001460774323400157045ustar00rootroot00000000000000magic-string-0.30.10/example/app.inlinemap.js000066400000000000000000000010421460774323400207720ustar00rootroot00000000000000var answer = 'yes'; console.log( answer ); //# sourceMappingURL=app.js.map //#sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBwLmpzLm1hcCIsInNvdXJjZXMiOlsiYXBwLnNvdXJjZS5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgZm9vID0gJ3llcyc7XG5jb25zb2xlLmxvZyggZm9vICk7Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLENBQUMsQ0FBQyxDQUFDLENBQUMsTUFBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNoQixDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLE1BQUcsQ0FBQyxDQUFDIn0=magic-string-0.30.10/example/app.js000066400000000000000000000001121460774323400170140ustar00rootroot00000000000000var answer = 'yes'; console.log( answer ); //# sourceMappingURL=app.js.mapmagic-string-0.30.10/example/app.js.map000066400000000000000000000004611460774323400175770ustar00rootroot00000000000000{"version":3,"file":"app.js.map","sources":["app.source.js"],"sourcesContent":["var foo = 'yes';\nconsole.log( foo );"],"names":[],"mappings":"AAAA,CAAC,CAAC,CAAC,CAAC,MAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAChB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAG,CAAC,CAAC"}magic-string-0.30.10/example/app.source.js000066400000000000000000000000441460774323400203170ustar00rootroot00000000000000var foo = 'yes'; console.log( foo );magic-string-0.30.10/example/build.js000066400000000000000000000015171460774323400173450ustar00rootroot00000000000000var fs = require( 'fs' ), MagicString = require( '../' ); process.chdir( __dirname ); fs.readFile( 'app.source.js', function ( err, result ) { var source, magicString, pattern = /foo/g, match, transpiled, map; if ( err ) throw err; source = result.toString(); magicString = new MagicString( result.toString() ); while ( match = pattern.exec( source ) ) { magicString.overwrite( match.index, match.index + 3, 'answer' ); } transpiled = magicString.toString() + '\n//# sourceMappingURL=app.js.map'; map = magicString.generateMap({ file: 'app.js.map', source: 'app.source.js', includeContent: true, hires: true }); fs.writeFileSync( 'app.js', transpiled ); fs.writeFileSync( 'app.js.map', JSON.stringify(map) ); fs.writeFileSync( 'app.inlinemap.js', transpiled + '\n//#sourceMappingURL=' + map.toUrl() ); }); magic-string-0.30.10/example/index.html000066400000000000000000000000501460774323400176740ustar00rootroot00000000000000magic-string-0.30.10/package.json000066400000000000000000000035221460774323400165410ustar00rootroot00000000000000{ "name": "magic-string", "version": "0.30.10", "packageManager": "pnpm@9.0.1", "description": "Modify strings, generate sourcemaps", "keywords": [ "string", "string manipulation", "sourcemap", "templating", "transpilation" ], "repository": "https://github.com/rich-harris/magic-string", "license": "MIT", "author": "Rich Harris", "main": "./dist/magic-string.cjs.js", "module": "./dist/magic-string.es.mjs", "jsnext:main": "./dist/magic-string.es.mjs", "types": "./dist/magic-string.cjs.d.ts", "exports": { "./package.json": "./package.json", ".": { "import": "./dist/magic-string.es.mjs", "require": "./dist/magic-string.cjs.js" } }, "files": [ "dist/*", "index.d.ts", "README.md" ], "scripts": { "build": "rollup -c", "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s", "format": "prettier --single-quote --print-width 100 --use-tabs --write src/*.js src/**/*.js", "lint": "eslint src test && publint", "lint:fix": "eslint src test --fix", "prepare": "npm run build", "prepublishOnly": "npm run lint && rm -rf dist && npm test", "release": "bumpp -x \"npm run changelog\" --all --commit --tag --push && npm publish", "pretest": "npm run build", "test": "mocha", "bench": "npm run build && node benchmark/index.mjs", "watch": "rollup -cw" }, "devDependencies": { "@rollup/plugin-node-resolve": "^15.2.3", "@rollup/plugin-replace": "^5.0.5", "benchmark": "^2.1.4", "bumpp": "^9.4.0", "conventional-changelog-cli": "^3.0.0", "eslint": "^8.57.0", "mocha": "^10.4.0", "prettier": "^3.2.5", "publint": "^0.2.7", "rollup": "^3.29.4", "source-map-js": "^1.2.0", "source-map-support": "^0.5.21" }, "dependencies": { "@jridgewell/sourcemap-codec": "^1.4.15" } } magic-string-0.30.10/pnpm-lock.yaml000066400000000000000000002553431460774323400170510ustar00rootroot00000000000000lockfileVersion: '9.0' settings: autoInstallPeers: true excludeLinksFromLockfile: false importers: .: dependencies: '@jridgewell/sourcemap-codec': specifier: ^1.4.15 version: 1.4.15 devDependencies: '@rollup/plugin-node-resolve': specifier: ^15.2.3 version: 15.2.3(rollup@3.29.4) '@rollup/plugin-replace': specifier: ^5.0.5 version: 5.0.5(rollup@3.29.4) benchmark: specifier: ^2.1.4 version: 2.1.4 bumpp: specifier: ^9.4.0 version: 9.4.0 conventional-changelog-cli: specifier: ^3.0.0 version: 3.0.0 eslint: specifier: ^8.57.0 version: 8.57.0 mocha: specifier: ^10.4.0 version: 10.4.0 prettier: specifier: ^3.2.5 version: 3.2.5 publint: specifier: ^0.2.7 version: 0.2.7 rollup: specifier: ^3.29.4 version: 3.29.4 source-map-js: specifier: ^1.2.0 version: 1.2.0 source-map-support: specifier: ^0.5.21 version: 0.5.21 packages: '@aashutoshrathi/word-wrap@1.2.6': resolution: {integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==} engines: {node: '>=0.10.0'} '@babel/code-frame@7.24.2': resolution: {integrity: sha512-y5+tLQyV8pg3fsiln67BVLD1P13Eg4lh5RW9mF0zUuvLrv9uIQ4MCL+CRT+FTsBlBjcIan6PGsLcBN0m3ClUyQ==} engines: {node: '>=6.9.0'} '@babel/helper-validator-identifier@7.22.20': resolution: {integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==} engines: {node: '>=6.9.0'} '@babel/highlight@7.24.2': resolution: {integrity: sha512-Yac1ao4flkTxTteCDZLEvdxg2fZfz1v8M4QpaGypq/WPDqg3ijHYbDfs+LG5hvzSoqaSZ9/Z9lKSP3CjZjv+pA==} engines: {node: '>=6.9.0'} '@eslint-community/eslint-utils@4.4.0': resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 '@eslint-community/regexpp@4.10.0': resolution: {integrity: sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} '@eslint/eslintrc@2.1.4': resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} '@eslint/js@8.57.0': resolution: {integrity: sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} '@humanwhocodes/config-array@0.11.14': resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} engines: {node: '>=10.10.0'} '@humanwhocodes/module-importer@1.0.1': resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} engines: {node: '>=12.22'} '@humanwhocodes/object-schema@2.0.3': resolution: {integrity: sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==} '@hutson/parse-repository-url@3.0.2': resolution: {integrity: sha512-H9XAx3hc0BQHY6l+IFSWHDySypcXsvsuLhgYLUGywmJ5pswRVQJUHpOsobnLYp2ZUaUlKiKDrgWWhosOwAEM8Q==} engines: {node: '>=6.9.0'} '@jridgewell/sourcemap-codec@1.4.15': resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} '@jsdevtools/ez-spawn@3.0.4': resolution: {integrity: sha512-f5DRIOZf7wxogefH03RjMPMdBF7ADTWUMoOs9kaJo06EfwF+aFhMZMDZxHg/Xe12hptN9xoZjGso2fdjapBRIA==} engines: {node: '>=10'} '@nodelib/fs.scandir@2.1.5': resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} '@nodelib/fs.stat@2.0.5': resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} engines: {node: '>= 8'} '@nodelib/fs.walk@1.2.8': resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} engines: {node: '>= 8'} '@rollup/plugin-node-resolve@15.2.3': resolution: {integrity: sha512-j/lym8nf5E21LwBT4Df1VD6hRO2L2iwUeUmP7litikRsVp1H6NWx20NEp0Y7su+7XGc476GnXXc4kFeZNGmaSQ==} engines: {node: '>=14.0.0'} peerDependencies: rollup: ^2.78.0||^3.0.0||^4.0.0 peerDependenciesMeta: rollup: optional: true '@rollup/plugin-replace@5.0.5': resolution: {integrity: sha512-rYO4fOi8lMaTg/z5Jb+hKnrHHVn8j2lwkqwyS4kTRhKyWOLf2wST2sWXr4WzWiTcoHTp2sTjqUbqIj2E39slKQ==} engines: {node: '>=14.0.0'} peerDependencies: rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 peerDependenciesMeta: rollup: optional: true '@rollup/pluginutils@5.1.0': resolution: {integrity: sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==} engines: {node: '>=14.0.0'} peerDependencies: rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 peerDependenciesMeta: rollup: optional: true '@types/estree@1.0.5': resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} '@types/minimist@1.2.5': resolution: {integrity: sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag==} '@types/normalize-package-data@2.4.4': resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} '@types/resolve@1.20.2': resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==} '@ungap/structured-clone@1.2.0': resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} JSONStream@1.3.5: resolution: {integrity: sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==} hasBin: true acorn-jsx@5.3.2: resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 acorn@8.11.3: resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==} engines: {node: '>=0.4.0'} hasBin: true add-stream@1.0.0: resolution: {integrity: sha512-qQLMr+8o0WC4FZGQTcJiKBVC59JylcPSrTtk6usvmIDFUOCKegapy1VHQwRbFMOFyb/inzUVqHs+eMYKDM1YeQ==} ajv@6.12.6: resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} ansi-colors@4.1.1: resolution: {integrity: sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==} engines: {node: '>=6'} ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} ansi-styles@3.2.1: resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} engines: {node: '>=4'} ansi-styles@4.3.0: resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} engines: {node: '>=8'} anymatch@3.1.3: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} engines: {node: '>= 8'} argparse@2.0.1: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} array-ify@1.0.0: resolution: {integrity: sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng==} arrify@1.0.1: resolution: {integrity: sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==} engines: {node: '>=0.10.0'} balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} benchmark@2.1.4: resolution: {integrity: sha512-l9MlfN4M1K/H2fbhfMy3B7vJd6AGKJVQn2h6Sg/Yx+KckoUA7ewS5Vv6TjSq18ooE1kS9hhAlQRH3AkXIh/aOQ==} binary-extensions@2.3.0: resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==} engines: {node: '>=8'} brace-expansion@1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} brace-expansion@2.0.1: resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} braces@3.0.2: resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} engines: {node: '>=8'} browser-stdout@1.3.1: resolution: {integrity: sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==} buffer-from@1.1.2: resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} builtin-modules@3.3.0: resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==} engines: {node: '>=6'} bumpp@9.4.0: resolution: {integrity: sha512-T+N+B5mSSvsTt7kgxGXCKQd957IxmEZwMn2nWirspGUY08u/cBNrpQDMXk43fzLegZtKtXS1v9S06vq2zf6lXQ==} engines: {node: '>=10'} hasBin: true c12@1.10.0: resolution: {integrity: sha512-0SsG7UDhoRWcuSvKWHaXmu5uNjDCDN3nkQLRL4Q42IlFy+ze58FcCoI3uPwINXinkz7ZinbhEgyzYFw9u9ZV8g==} cac@6.7.14: resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} engines: {node: '>=8'} call-me-maybe@1.0.2: resolution: {integrity: sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ==} callsites@3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} camelcase-keys@6.2.2: resolution: {integrity: sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==} engines: {node: '>=8'} camelcase@5.3.1: resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} engines: {node: '>=6'} camelcase@6.3.0: resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} engines: {node: '>=10'} chalk@2.4.2: resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} engines: {node: '>=4'} chalk@4.1.2: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} chokidar@3.5.3: resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==} engines: {node: '>= 8.10.0'} chokidar@3.6.0: resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} engines: {node: '>= 8.10.0'} chownr@2.0.0: resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} engines: {node: '>=10'} citty@0.1.6: resolution: {integrity: sha512-tskPPKEs8D2KPafUypv2gxwJP8h/OaJmC82QQGGDQcHvXX43xF2VDACcJVmZ0EuSxkpO9Kc4MlrA3q0+FG58AQ==} cliui@7.0.4: resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==} color-convert@1.9.3: resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} color-convert@2.0.1: resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} engines: {node: '>=7.0.0'} color-name@1.1.3: resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} color-name@1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} compare-func@2.0.0: resolution: {integrity: sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==} concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} confbox@0.1.6: resolution: {integrity: sha512-ONc4FUXne/1UBN1EuxvQ5rAjjAbo+N4IxrxWI8bzGHbd1PyrFlI/E3G23/yoJZDFBaFFxPGfI0EOq0fa4dgX7A==} consola@3.2.3: resolution: {integrity: sha512-I5qxpzLv+sJhTVEoLYNcTW+bThDCPsit0vLNKShZx6rLtpilNpmmeTPaeqJb9ZE9dV3DGaeby6Vuhrw38WjeyQ==} engines: {node: ^14.18.0 || >=16.10.0} conventional-changelog-angular@6.0.0: resolution: {integrity: sha512-6qLgrBF4gueoC7AFVHu51nHL9pF9FRjXrH+ceVf7WmAfH3gs+gEYOkvxhjMPjZu57I4AGUGoNTY8V7Hrgf1uqg==} engines: {node: '>=14'} conventional-changelog-atom@3.0.0: resolution: {integrity: sha512-pnN5bWpH+iTUWU3FaYdw5lJmfWeqSyrUkG+wyHBI9tC1dLNnHkbAOg1SzTQ7zBqiFrfo55h40VsGXWMdopwc5g==} engines: {node: '>=14'} conventional-changelog-cli@3.0.0: resolution: {integrity: sha512-3zMYi0IrfNd6AAHdPMrcgCg5DbcffiqNaEBf8cYrlntXPbBIXaELTbnRmUy5TQAe0Hkgi0J6+/VmRCkkJQflcQ==} engines: {node: '>=14'} hasBin: true conventional-changelog-codemirror@3.0.0: resolution: {integrity: sha512-wzchZt9HEaAZrenZAUUHMCFcuYzGoZ1wG/kTRMICxsnW5AXohYMRxnyecP9ob42Gvn5TilhC0q66AtTPRSNMfw==} engines: {node: '>=14'} conventional-changelog-conventionalcommits@6.1.0: resolution: {integrity: sha512-3cS3GEtR78zTfMzk0AizXKKIdN4OvSh7ibNz6/DPbhWWQu7LqE/8+/GqSodV+sywUR2gpJAdP/1JFf4XtN7Zpw==} engines: {node: '>=14'} conventional-changelog-core@5.0.2: resolution: {integrity: sha512-RhQOcDweXNWvlRwUDCpaqXzbZemKPKncCWZG50Alth72WITVd6nhVk9MJ6w1k9PFNBcZ3YwkdkChE+8+ZwtUug==} engines: {node: '>=14'} conventional-changelog-ember@3.0.0: resolution: {integrity: sha512-7PYthCoSxIS98vWhVcSphMYM322OxptpKAuHYdVspryI0ooLDehRXWeRWgN+zWSBXKl/pwdgAg8IpLNSM1/61A==} engines: {node: '>=14'} conventional-changelog-eslint@4.0.0: resolution: {integrity: sha512-nEZ9byP89hIU0dMx37JXQkE1IpMmqKtsaR24X7aM3L6Yy/uAtbb+ogqthuNYJkeO1HyvK7JsX84z8649hvp43Q==} engines: {node: '>=14'} conventional-changelog-express@3.0.0: resolution: {integrity: sha512-HqxihpUMfIuxvlPvC6HltA4ZktQEUan/v3XQ77+/zbu8No/fqK3rxSZaYeHYant7zRxQNIIli7S+qLS9tX9zQA==} engines: {node: '>=14'} conventional-changelog-jquery@4.0.0: resolution: {integrity: sha512-TTIN5CyzRMf8PUwyy4IOLmLV2DFmPtasKN+x7EQKzwSX8086XYwo+NeaeA3VUT8bvKaIy5z/JoWUvi7huUOgaw==} engines: {node: '>=14'} conventional-changelog-jshint@3.0.0: resolution: {integrity: sha512-bQof4byF4q+n+dwFRkJ/jGf9dCNUv4/kCDcjeCizBvfF81TeimPZBB6fT4HYbXgxxfxWXNl/i+J6T0nI4by6DA==} engines: {node: '>=14'} conventional-changelog-preset-loader@3.0.0: resolution: {integrity: sha512-qy9XbdSLmVnwnvzEisjxdDiLA4OmV3o8db+Zdg4WiFw14fP3B6XNz98X0swPPpkTd/pc1K7+adKgEDM1JCUMiA==} engines: {node: '>=14'} conventional-changelog-writer@6.0.1: resolution: {integrity: sha512-359t9aHorPw+U+nHzUXHS5ZnPBOizRxfQsWT5ZDHBfvfxQOAik+yfuhKXG66CN5LEWPpMNnIMHUTCKeYNprvHQ==} engines: {node: '>=14'} hasBin: true conventional-changelog@4.0.0: resolution: {integrity: sha512-JbZjwE1PzxQCvm+HUTIr+pbSekS8qdOZzMakdFyPtdkEWwFvwEJYONzjgMm0txCb2yBcIcfKDmg8xtCKTdecNQ==} engines: {node: '>=14'} conventional-commits-filter@3.0.0: resolution: {integrity: sha512-1ymej8b5LouPx9Ox0Dw/qAO2dVdfpRFq28e5Y0jJEU8ZrLdy0vOSkkIInwmxErFGhg6SALro60ZrwYFVTUDo4Q==} engines: {node: '>=14'} conventional-commits-parser@4.0.0: resolution: {integrity: sha512-WRv5j1FsVM5FISJkoYMR6tPk07fkKT0UodruX4je86V4owk451yjXAKzKAPOs9l7y59E2viHUS9eQ+dfUA9NSg==} engines: {node: '>=14'} hasBin: true core-util-is@1.0.3: resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} cross-spawn@7.0.3: resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} engines: {node: '>= 8'} dargs@7.0.0: resolution: {integrity: sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg==} engines: {node: '>=8'} dateformat@3.0.3: resolution: {integrity: sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==} debug@4.3.4: resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} engines: {node: '>=6.0'} peerDependencies: supports-color: '*' peerDependenciesMeta: supports-color: optional: true decamelize-keys@1.1.1: resolution: {integrity: sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==} engines: {node: '>=0.10.0'} decamelize@1.2.0: resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==} engines: {node: '>=0.10.0'} decamelize@4.0.0: resolution: {integrity: sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==} engines: {node: '>=10'} deep-is@0.1.4: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} deepmerge@4.3.1: resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} engines: {node: '>=0.10.0'} defu@6.1.4: resolution: {integrity: sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==} destr@2.0.3: resolution: {integrity: sha512-2N3BOUU4gYMpTP24s5rF5iP7BDr7uNTCs4ozw3kf/eKfvWSIu93GEBi5m427YoyJoeOzQ5smuu4nNAPGb8idSQ==} diff@5.0.0: resolution: {integrity: sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==} engines: {node: '>=0.3.1'} doctrine@3.0.0: resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} engines: {node: '>=6.0.0'} dot-prop@5.3.0: resolution: {integrity: sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==} engines: {node: '>=8'} dotenv@16.4.5: resolution: {integrity: sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==} engines: {node: '>=12'} emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} error-ex@1.3.2: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} escalade@3.1.2: resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} engines: {node: '>=6'} escape-string-regexp@1.0.5: resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} engines: {node: '>=0.8.0'} escape-string-regexp@4.0.0: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} eslint-scope@7.2.2: resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} eslint-visitor-keys@3.4.3: resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} eslint@8.57.0: resolution: {integrity: sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} hasBin: true espree@9.6.1: resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} esquery@1.5.0: resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==} engines: {node: '>=0.10'} esrecurse@4.3.0: resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} engines: {node: '>=4.0'} estraverse@5.3.0: resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} engines: {node: '>=4.0'} estree-walker@2.0.2: resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} esutils@2.0.3: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} engines: {node: '>=0.10.0'} execa@8.0.1: resolution: {integrity: sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==} engines: {node: '>=16.17'} fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} fast-glob@3.3.2: resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} engines: {node: '>=8.6.0'} fast-json-stable-stringify@2.1.0: resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} fast-levenshtein@2.0.6: resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} fastq@1.17.1: resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} file-entry-cache@6.0.1: resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} engines: {node: ^10.12.0 || >=12.0.0} fill-range@7.0.1: resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} engines: {node: '>=8'} find-up@2.1.0: resolution: {integrity: sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==} engines: {node: '>=4'} find-up@4.1.0: resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} engines: {node: '>=8'} find-up@5.0.0: resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} engines: {node: '>=10'} flat-cache@3.2.0: resolution: {integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==} engines: {node: ^10.12.0 || >=12.0.0} flat@5.0.2: resolution: {integrity: sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==} hasBin: true flatted@3.3.1: resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==} fs-minipass@2.1.0: resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} engines: {node: '>= 8'} fs.realpath@1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} fsevents@2.3.3: resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] function-bind@1.1.2: resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} get-caller-file@2.0.5: resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} engines: {node: 6.* || 8.* || >= 10.*} get-pkg-repo@4.2.1: resolution: {integrity: sha512-2+QbHjFRfGB74v/pYWjd5OhU3TDIC2Gv/YKUTk/tCvAz0pkn/Mz6P3uByuBimLOcPvN2jYdScl3xGFSrx0jEcA==} engines: {node: '>=6.9.0'} hasBin: true get-stream@8.0.1: resolution: {integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==} engines: {node: '>=16'} giget@1.2.3: resolution: {integrity: sha512-8EHPljDvs7qKykr6uw8b+lqLiUc/vUg+KVTI0uND4s63TdsZM2Xus3mflvF0DDG9SiM4RlCkFGL+7aAjRmV7KA==} hasBin: true git-raw-commits@3.0.0: resolution: {integrity: sha512-b5OHmZ3vAgGrDn/X0kS+9qCfNKWe4K/jFnhwzVWWg0/k5eLa3060tZShrRg8Dja5kPc+YjS0Gc6y7cRr44Lpjw==} engines: {node: '>=14'} hasBin: true git-remote-origin-url@2.0.0: resolution: {integrity: sha512-eU+GGrZgccNJcsDH5LkXR3PB9M958hxc7sbA8DFJjrv9j4L2P/eZfKhM+QD6wyzpiv+b1BpK0XrYCxkovtjSLw==} engines: {node: '>=4'} git-semver-tags@5.0.1: resolution: {integrity: sha512-hIvOeZwRbQ+7YEUmCkHqo8FOLQZCEn18yevLHADlFPZY02KJGsu5FZt9YW/lybfK2uhWFI7Qg/07LekJiTv7iA==} engines: {node: '>=14'} hasBin: true gitconfiglocal@1.0.0: resolution: {integrity: sha512-spLUXeTAVHxDtKsJc8FkFVgFtMdEN9qPGpL23VfSHx4fP4+Ds097IXLvymbnDH8FnmxX5Nr9bPw3A+AQ6mWEaQ==} glob-parent@5.1.2: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} glob-parent@6.0.2: resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} engines: {node: '>=10.13.0'} glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} glob@8.1.0: resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==} engines: {node: '>=12'} globals@13.24.0: resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==} engines: {node: '>=8'} graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} graphemer@1.4.0: resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} handlebars@4.7.8: resolution: {integrity: sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==} engines: {node: '>=0.4.7'} hasBin: true hard-rejection@2.1.0: resolution: {integrity: sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==} engines: {node: '>=6'} has-flag@3.0.0: resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} engines: {node: '>=4'} has-flag@4.0.0: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} hasown@2.0.2: resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} engines: {node: '>= 0.4'} he@1.2.0: resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} hasBin: true hosted-git-info@2.8.9: resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} hosted-git-info@4.1.0: resolution: {integrity: sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==} engines: {node: '>=10'} human-signals@5.0.0: resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==} engines: {node: '>=16.17.0'} ignore-walk@5.0.1: resolution: {integrity: sha512-yemi4pMf51WKT7khInJqAvsIGzoqYXblnsz0ql8tM+yi1EKYTY1evX4NAbJrLL/Aanr2HyZeluqU+Oi7MGHokw==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} ignore@5.3.1: resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} engines: {node: '>= 4'} import-fresh@3.3.0: resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} engines: {node: '>=6'} imurmurhash@0.1.4: resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} engines: {node: '>=0.8.19'} indent-string@4.0.0: resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} engines: {node: '>=8'} inflight@1.0.6: resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} ini@1.3.8: resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} is-arrayish@0.2.1: resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} is-binary-path@2.1.0: resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} engines: {node: '>=8'} is-builtin-module@3.2.1: resolution: {integrity: sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==} engines: {node: '>=6'} is-core-module@2.13.1: resolution: {integrity: sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==} is-extglob@2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} is-fullwidth-code-point@3.0.0: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} engines: {node: '>=8'} is-glob@4.0.3: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} is-module@1.0.0: resolution: {integrity: sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==} is-number@7.0.0: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} is-obj@2.0.0: resolution: {integrity: sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==} engines: {node: '>=8'} is-path-inside@3.0.3: resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} engines: {node: '>=8'} is-plain-obj@1.1.0: resolution: {integrity: sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==} engines: {node: '>=0.10.0'} is-plain-obj@2.1.0: resolution: {integrity: sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==} engines: {node: '>=8'} is-stream@3.0.0: resolution: {integrity: sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} is-text-path@1.0.1: resolution: {integrity: sha512-xFuJpne9oFz5qDaodwmmG08e3CawH/2ZV8Qqza1Ko7Sk8POWbkRdwIoAWVhqvq0XeUzANEhKo2n0IXUGBm7A/w==} engines: {node: '>=0.10.0'} is-unicode-supported@0.1.0: resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} engines: {node: '>=10'} isarray@1.0.0: resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==} isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} jiti@1.21.0: resolution: {integrity: sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q==} hasBin: true js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} js-yaml@4.1.0: resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} hasBin: true json-buffer@3.0.1: resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} json-parse-better-errors@1.0.2: resolution: {integrity: sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==} json-parse-even-better-errors@2.3.1: resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} json-schema-traverse@0.4.1: resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} json-stable-stringify-without-jsonify@1.0.1: resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} json-stringify-safe@5.0.1: resolution: {integrity: sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==} jsonc-parser@3.2.1: resolution: {integrity: sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==} jsonparse@1.3.1: resolution: {integrity: sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==} engines: {'0': node >= 0.2.0} keyv@4.5.4: resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} kind-of@6.0.3: resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==} engines: {node: '>=0.10.0'} kleur@3.0.3: resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==} engines: {node: '>=6'} levn@0.4.1: resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} engines: {node: '>= 0.8.0'} lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} load-json-file@4.0.0: resolution: {integrity: sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==} engines: {node: '>=4'} locate-path@2.0.0: resolution: {integrity: sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==} engines: {node: '>=4'} locate-path@5.0.0: resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} engines: {node: '>=8'} locate-path@6.0.0: resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} engines: {node: '>=10'} lodash.ismatch@4.4.0: resolution: {integrity: sha512-fPMfXjGQEV9Xsq/8MTSgUf255gawYRbjwMyDbcvDhXgV7enSZA0hynz6vMPnpAb5iONEzBHBPsT+0zes5Z301g==} lodash.merge@4.6.2: resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} lodash@4.17.21: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} log-symbols@4.1.0: resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} engines: {node: '>=10'} lru-cache@6.0.0: resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} engines: {node: '>=10'} magic-string@0.30.9: resolution: {integrity: sha512-S1+hd+dIrC8EZqKyT9DstTH/0Z+f76kmmvZnkfQVmOpDEF9iVgdYif3Q/pIWHmCoo59bQVGW0kVL3e2nl+9+Sw==} engines: {node: '>=12'} map-obj@1.0.1: resolution: {integrity: sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==} engines: {node: '>=0.10.0'} map-obj@4.3.0: resolution: {integrity: sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==} engines: {node: '>=8'} meow@8.1.2: resolution: {integrity: sha512-r85E3NdZ+mpYk1C6RjPFEMSE+s1iZMuHtsHAqY0DT3jZczl0diWUZ8g6oU7h0M9cD2EL+PzaYghhCLzR0ZNn5Q==} engines: {node: '>=10'} merge-stream@2.0.0: resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} merge2@1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} micromatch@4.0.5: resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} engines: {node: '>=8.6'} mimic-fn@4.0.0: resolution: {integrity: sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==} engines: {node: '>=12'} min-indent@1.0.1: resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} engines: {node: '>=4'} minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} minimatch@5.0.1: resolution: {integrity: sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==} engines: {node: '>=10'} minimatch@5.1.6: resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==} engines: {node: '>=10'} minimist-options@4.1.0: resolution: {integrity: sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==} engines: {node: '>= 6'} minimist@1.2.8: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} minipass@3.3.6: resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} engines: {node: '>=8'} minipass@5.0.0: resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} engines: {node: '>=8'} minizlib@2.1.2: resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} engines: {node: '>= 8'} mkdirp@1.0.4: resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} engines: {node: '>=10'} hasBin: true mlly@1.6.1: resolution: {integrity: sha512-vLgaHvaeunuOXHSmEbZ9izxPx3USsk8KCQ8iC+aTlp5sKRSoZvwhHh5L9VbKSaVC6sJDqbyohIS76E2VmHIPAA==} mocha@10.4.0: resolution: {integrity: sha512-eqhGB8JKapEYcC4ytX/xrzKforgEc3j1pGlAXVy3eRwrtAy5/nIfT1SvgGzfN0XZZxeLq0aQWkOUAmqIJiv+bA==} engines: {node: '>= 14.0.0'} hasBin: true modify-values@1.0.1: resolution: {integrity: sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw==} engines: {node: '>=0.10.0'} mri@1.2.0: resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} engines: {node: '>=4'} ms@2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} neo-async@2.6.2: resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} node-fetch-native@1.6.4: resolution: {integrity: sha512-IhOigYzAKHd244OC0JIMIUrjzctirCmPkaIfhDeGcEETWof5zKYUW7e7MYvChGWh/4CJeXEgsRyGzuF334rOOQ==} normalize-package-data@2.5.0: resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} normalize-package-data@3.0.3: resolution: {integrity: sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==} engines: {node: '>=10'} normalize-path@3.0.0: resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} engines: {node: '>=0.10.0'} npm-bundled@2.0.1: resolution: {integrity: sha512-gZLxXdjEzE/+mOstGDqR6b0EkhJ+kM6fxM6vUuckuctuVPh80Q6pw/rSZj9s4Gex9GxWtIicO1pc8DB9KZWudw==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} npm-normalize-package-bin@2.0.0: resolution: {integrity: sha512-awzfKUO7v0FscrSpRoogyNm0sajikhBWpU0QMrW09AMi9n1PoKU6WaIqUzuJSQnpciZZmJ/jMZ2Egfmb/9LiWQ==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} npm-packlist@5.1.3: resolution: {integrity: sha512-263/0NGrn32YFYi4J533qzrQ/krmmrWwhKkzwTuM4f/07ug51odoaNjUexxO4vxlzURHcmYMH1QjvHjsNDKLVg==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} hasBin: true npm-run-path@5.3.0: resolution: {integrity: sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} nypm@0.3.8: resolution: {integrity: sha512-IGWlC6So2xv6V4cIDmoV0SwwWx7zLG086gyqkyumteH2fIgCAM4nDVFB2iDRszDvmdSVW9xb1N+2KjQ6C7d4og==} engines: {node: ^14.16.0 || >=16.10.0} hasBin: true ohash@1.1.3: resolution: {integrity: sha512-zuHHiGTYTA1sYJ/wZN+t5HKZaH23i4yI1HMwbuXm24Nid7Dv0KcuRlKoNKS9UNfAVSBlnGLcuQrnOKWOZoEGaw==} once@1.4.0: resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} onetime@6.0.0: resolution: {integrity: sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==} engines: {node: '>=12'} optionator@0.9.3: resolution: {integrity: sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==} engines: {node: '>= 0.8.0'} p-limit@1.3.0: resolution: {integrity: sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==} engines: {node: '>=4'} p-limit@2.3.0: resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} engines: {node: '>=6'} p-limit@3.1.0: resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} engines: {node: '>=10'} p-locate@2.0.0: resolution: {integrity: sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==} engines: {node: '>=4'} p-locate@4.1.0: resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} engines: {node: '>=8'} p-locate@5.0.0: resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} engines: {node: '>=10'} p-try@1.0.0: resolution: {integrity: sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==} engines: {node: '>=4'} p-try@2.2.0: resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} engines: {node: '>=6'} parent-module@1.0.1: resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} engines: {node: '>=6'} parse-json@4.0.0: resolution: {integrity: sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==} engines: {node: '>=4'} parse-json@5.2.0: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} path-exists@3.0.0: resolution: {integrity: sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==} engines: {node: '>=4'} path-exists@4.0.0: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} engines: {node: '>=8'} path-is-absolute@1.0.1: resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} engines: {node: '>=0.10.0'} path-key@3.1.1: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} path-key@4.0.0: resolution: {integrity: sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==} engines: {node: '>=12'} path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} path-type@3.0.0: resolution: {integrity: sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==} engines: {node: '>=4'} pathe@1.1.2: resolution: {integrity: sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==} perfect-debounce@1.0.0: resolution: {integrity: sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==} picocolors@1.0.0: resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} picomatch@2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} pify@2.3.0: resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==} engines: {node: '>=0.10.0'} pify@3.0.0: resolution: {integrity: sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==} engines: {node: '>=4'} pkg-types@1.0.3: resolution: {integrity: sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==} platform@1.3.6: resolution: {integrity: sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg==} prelude-ls@1.2.1: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} prettier@3.2.5: resolution: {integrity: sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==} engines: {node: '>=14'} hasBin: true process-nextick-args@2.0.1: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} prompts@2.4.2: resolution: {integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==} engines: {node: '>= 6'} publint@0.2.7: resolution: {integrity: sha512-tLU4ee3110BxWfAmCZggJmCUnYWgPTr0QLnx08sqpLYa8JHRiOudd+CgzdpfU5x5eOaW2WMkpmOrFshRFYK7Mw==} engines: {node: '>=16'} hasBin: true punycode@2.3.1: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} quick-lru@4.0.1: resolution: {integrity: sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==} engines: {node: '>=8'} randombytes@2.1.0: resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} rc9@2.1.2: resolution: {integrity: sha512-btXCnMmRIBINM2LDZoEmOogIZU7Qe7zn4BpomSKZ/ykbLObuBdvG+mFq11DL6fjH1DRwHhrlgtYWG96bJiC7Cg==} read-pkg-up@3.0.0: resolution: {integrity: sha512-YFzFrVvpC6frF1sz8psoHDBGF7fLPc+llq/8NB43oagqWkx8ar5zYtsTORtOjw9W2RHLpWP+zTWwBvf1bCmcSw==} engines: {node: '>=4'} read-pkg-up@7.0.1: resolution: {integrity: sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==} engines: {node: '>=8'} read-pkg@3.0.0: resolution: {integrity: sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA==} engines: {node: '>=4'} read-pkg@5.2.0: resolution: {integrity: sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==} engines: {node: '>=8'} readable-stream@2.3.8: resolution: {integrity: sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==} readable-stream@3.6.2: resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} engines: {node: '>= 6'} readdirp@3.6.0: resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} engines: {node: '>=8.10.0'} redent@3.0.0: resolution: {integrity: sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==} engines: {node: '>=8'} require-directory@2.1.1: resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} engines: {node: '>=0.10.0'} resolve-from@4.0.0: resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} engines: {node: '>=4'} resolve@1.22.8: resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==} hasBin: true reusify@1.0.4: resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} rimraf@3.0.2: resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} hasBin: true rollup@3.29.4: resolution: {integrity: sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==} engines: {node: '>=14.18.0', npm: '>=8.0.0'} hasBin: true run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} sade@1.8.1: resolution: {integrity: sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==} engines: {node: '>=6'} safe-buffer@5.1.2: resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} safe-buffer@5.2.1: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} semver@5.7.2: resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==} hasBin: true semver@7.6.0: resolution: {integrity: sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==} engines: {node: '>=10'} hasBin: true serialize-javascript@6.0.0: resolution: {integrity: sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==} shebang-command@2.0.0: resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} engines: {node: '>=8'} shebang-regex@3.0.0: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} engines: {node: '>=8'} signal-exit@4.1.0: resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} engines: {node: '>=14'} sisteransi@1.0.5: resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} source-map-js@1.2.0: resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} engines: {node: '>=0.10.0'} source-map-support@0.5.21: resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==} source-map@0.6.1: resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} engines: {node: '>=0.10.0'} spdx-correct@3.2.0: resolution: {integrity: sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==} spdx-exceptions@2.5.0: resolution: {integrity: sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==} spdx-expression-parse@3.0.1: resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} spdx-license-ids@3.0.17: resolution: {integrity: sha512-sh8PWc/ftMqAAdFiBu6Fy6JUOYjqDJBJvIhpfDMyHrr0Rbp5liZqd4TjtQ/RgfLjKFZb+LMx5hpml5qOWy0qvg==} split2@3.2.2: resolution: {integrity: sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==} split@1.0.1: resolution: {integrity: sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==} string-argv@0.3.2: resolution: {integrity: sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==} engines: {node: '>=0.6.19'} string-width@4.2.3: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} engines: {node: '>=8'} string_decoder@1.1.1: resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==} string_decoder@1.3.0: resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} strip-ansi@6.0.1: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} engines: {node: '>=8'} strip-bom@3.0.0: resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} engines: {node: '>=4'} strip-final-newline@3.0.0: resolution: {integrity: sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==} engines: {node: '>=12'} strip-indent@3.0.0: resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==} engines: {node: '>=8'} strip-json-comments@3.1.1: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} supports-color@5.5.0: resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} engines: {node: '>=4'} supports-color@7.2.0: resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} engines: {node: '>=8'} supports-color@8.1.1: resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} engines: {node: '>=10'} supports-preserve-symlinks-flag@1.0.0: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} tar@6.2.1: resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} engines: {node: '>=10'} temp-dir@2.0.0: resolution: {integrity: sha512-aoBAniQmmwtcKp/7BzsH8Cxzv8OL736p7v1ihGb5e9DJ9kTwGWHrQrVB5+lfVDzfGrdRzXch+ig7LHaY1JTOrg==} engines: {node: '>=8'} tempfile@3.0.0: resolution: {integrity: sha512-uNFCg478XovRi85iD42egu+eSFUmmka750Jy7L5tfHI5hQKKtbPnxaSaXAbBqCDYrw3wx4tXjKwci4/QmsZJxw==} engines: {node: '>=8'} text-extensions@1.9.0: resolution: {integrity: sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ==} engines: {node: '>=0.10'} text-table@0.2.0: resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} through2@2.0.5: resolution: {integrity: sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==} through@2.3.8: resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==} to-regex-range@5.0.1: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} trim-newlines@3.0.1: resolution: {integrity: sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==} engines: {node: '>=8'} type-check@0.4.0: resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} engines: {node: '>= 0.8.0'} type-detect@4.0.8: resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} engines: {node: '>=4'} type-fest@0.18.1: resolution: {integrity: sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==} engines: {node: '>=10'} type-fest@0.20.2: resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} engines: {node: '>=10'} type-fest@0.6.0: resolution: {integrity: sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==} engines: {node: '>=8'} type-fest@0.8.1: resolution: {integrity: sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==} engines: {node: '>=8'} ufo@1.5.3: resolution: {integrity: sha512-Y7HYmWaFwPUmkoQCUIAYpKqkOf+SbVj/2fJJZ4RJMCfZp0rTGwRbzQD+HghfnhKOjL9E01okqz+ncJskGYfBNw==} uglify-js@3.17.4: resolution: {integrity: sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==} engines: {node: '>=0.8.0'} hasBin: true uri-js@4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} uuid@3.4.0: resolution: {integrity: sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==} deprecated: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. hasBin: true validate-npm-package-license@3.0.4: resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} which@2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} engines: {node: '>= 8'} hasBin: true wordwrap@1.0.0: resolution: {integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==} workerpool@6.2.1: resolution: {integrity: sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==} wrap-ansi@7.0.0: resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} engines: {node: '>=10'} wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} xtend@4.0.2: resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==} engines: {node: '>=0.4'} y18n@5.0.8: resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} engines: {node: '>=10'} yallist@4.0.0: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} yargs-parser@20.2.4: resolution: {integrity: sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==} engines: {node: '>=10'} yargs-parser@20.2.9: resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} engines: {node: '>=10'} yargs-unparser@2.0.0: resolution: {integrity: sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==} engines: {node: '>=10'} yargs@16.2.0: resolution: {integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==} engines: {node: '>=10'} yocto-queue@0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} snapshots: '@aashutoshrathi/word-wrap@1.2.6': {} '@babel/code-frame@7.24.2': dependencies: '@babel/highlight': 7.24.2 picocolors: 1.0.0 '@babel/helper-validator-identifier@7.22.20': {} '@babel/highlight@7.24.2': dependencies: '@babel/helper-validator-identifier': 7.22.20 chalk: 2.4.2 js-tokens: 4.0.0 picocolors: 1.0.0 '@eslint-community/eslint-utils@4.4.0(eslint@8.57.0)': dependencies: eslint: 8.57.0 eslint-visitor-keys: 3.4.3 '@eslint-community/regexpp@4.10.0': {} '@eslint/eslintrc@2.1.4': dependencies: ajv: 6.12.6 debug: 4.3.4(supports-color@8.1.1) espree: 9.6.1 globals: 13.24.0 ignore: 5.3.1 import-fresh: 3.3.0 js-yaml: 4.1.0 minimatch: 3.1.2 strip-json-comments: 3.1.1 transitivePeerDependencies: - supports-color '@eslint/js@8.57.0': {} '@humanwhocodes/config-array@0.11.14': dependencies: '@humanwhocodes/object-schema': 2.0.3 debug: 4.3.4(supports-color@8.1.1) minimatch: 3.1.2 transitivePeerDependencies: - supports-color '@humanwhocodes/module-importer@1.0.1': {} '@humanwhocodes/object-schema@2.0.3': {} '@hutson/parse-repository-url@3.0.2': {} '@jridgewell/sourcemap-codec@1.4.15': {} '@jsdevtools/ez-spawn@3.0.4': dependencies: call-me-maybe: 1.0.2 cross-spawn: 7.0.3 string-argv: 0.3.2 type-detect: 4.0.8 '@nodelib/fs.scandir@2.1.5': dependencies: '@nodelib/fs.stat': 2.0.5 run-parallel: 1.2.0 '@nodelib/fs.stat@2.0.5': {} '@nodelib/fs.walk@1.2.8': dependencies: '@nodelib/fs.scandir': 2.1.5 fastq: 1.17.1 '@rollup/plugin-node-resolve@15.2.3(rollup@3.29.4)': dependencies: '@rollup/pluginutils': 5.1.0(rollup@3.29.4) '@types/resolve': 1.20.2 deepmerge: 4.3.1 is-builtin-module: 3.2.1 is-module: 1.0.0 resolve: 1.22.8 optionalDependencies: rollup: 3.29.4 '@rollup/plugin-replace@5.0.5(rollup@3.29.4)': dependencies: '@rollup/pluginutils': 5.1.0(rollup@3.29.4) magic-string: 0.30.9 optionalDependencies: rollup: 3.29.4 '@rollup/pluginutils@5.1.0(rollup@3.29.4)': dependencies: '@types/estree': 1.0.5 estree-walker: 2.0.2 picomatch: 2.3.1 optionalDependencies: rollup: 3.29.4 '@types/estree@1.0.5': {} '@types/minimist@1.2.5': {} '@types/normalize-package-data@2.4.4': {} '@types/resolve@1.20.2': {} '@ungap/structured-clone@1.2.0': {} JSONStream@1.3.5: dependencies: jsonparse: 1.3.1 through: 2.3.8 acorn-jsx@5.3.2(acorn@8.11.3): dependencies: acorn: 8.11.3 acorn@8.11.3: {} add-stream@1.0.0: {} ajv@6.12.6: dependencies: fast-deep-equal: 3.1.3 fast-json-stable-stringify: 2.1.0 json-schema-traverse: 0.4.1 uri-js: 4.4.1 ansi-colors@4.1.1: {} ansi-regex@5.0.1: {} ansi-styles@3.2.1: dependencies: color-convert: 1.9.3 ansi-styles@4.3.0: dependencies: color-convert: 2.0.1 anymatch@3.1.3: dependencies: normalize-path: 3.0.0 picomatch: 2.3.1 argparse@2.0.1: {} array-ify@1.0.0: {} arrify@1.0.1: {} balanced-match@1.0.2: {} benchmark@2.1.4: dependencies: lodash: 4.17.21 platform: 1.3.6 binary-extensions@2.3.0: {} brace-expansion@1.1.11: dependencies: balanced-match: 1.0.2 concat-map: 0.0.1 brace-expansion@2.0.1: dependencies: balanced-match: 1.0.2 braces@3.0.2: dependencies: fill-range: 7.0.1 browser-stdout@1.3.1: {} buffer-from@1.1.2: {} builtin-modules@3.3.0: {} bumpp@9.4.0: dependencies: '@jsdevtools/ez-spawn': 3.0.4 c12: 1.10.0 cac: 6.7.14 escalade: 3.1.2 fast-glob: 3.3.2 js-yaml: 4.1.0 prompts: 2.4.2 semver: 7.6.0 c12@1.10.0: dependencies: chokidar: 3.6.0 confbox: 0.1.6 defu: 6.1.4 dotenv: 16.4.5 giget: 1.2.3 jiti: 1.21.0 mlly: 1.6.1 ohash: 1.1.3 pathe: 1.1.2 perfect-debounce: 1.0.0 pkg-types: 1.0.3 rc9: 2.1.2 cac@6.7.14: {} call-me-maybe@1.0.2: {} callsites@3.1.0: {} camelcase-keys@6.2.2: dependencies: camelcase: 5.3.1 map-obj: 4.3.0 quick-lru: 4.0.1 camelcase@5.3.1: {} camelcase@6.3.0: {} chalk@2.4.2: dependencies: ansi-styles: 3.2.1 escape-string-regexp: 1.0.5 supports-color: 5.5.0 chalk@4.1.2: dependencies: ansi-styles: 4.3.0 supports-color: 7.2.0 chokidar@3.5.3: dependencies: anymatch: 3.1.3 braces: 3.0.2 glob-parent: 5.1.2 is-binary-path: 2.1.0 is-glob: 4.0.3 normalize-path: 3.0.0 readdirp: 3.6.0 optionalDependencies: fsevents: 2.3.3 chokidar@3.6.0: dependencies: anymatch: 3.1.3 braces: 3.0.2 glob-parent: 5.1.2 is-binary-path: 2.1.0 is-glob: 4.0.3 normalize-path: 3.0.0 readdirp: 3.6.0 optionalDependencies: fsevents: 2.3.3 chownr@2.0.0: {} citty@0.1.6: dependencies: consola: 3.2.3 cliui@7.0.4: dependencies: string-width: 4.2.3 strip-ansi: 6.0.1 wrap-ansi: 7.0.0 color-convert@1.9.3: dependencies: color-name: 1.1.3 color-convert@2.0.1: dependencies: color-name: 1.1.4 color-name@1.1.3: {} color-name@1.1.4: {} compare-func@2.0.0: dependencies: array-ify: 1.0.0 dot-prop: 5.3.0 concat-map@0.0.1: {} confbox@0.1.6: {} consola@3.2.3: {} conventional-changelog-angular@6.0.0: dependencies: compare-func: 2.0.0 conventional-changelog-atom@3.0.0: {} conventional-changelog-cli@3.0.0: dependencies: add-stream: 1.0.0 conventional-changelog: 4.0.0 meow: 8.1.2 tempfile: 3.0.0 conventional-changelog-codemirror@3.0.0: {} conventional-changelog-conventionalcommits@6.1.0: dependencies: compare-func: 2.0.0 conventional-changelog-core@5.0.2: dependencies: add-stream: 1.0.0 conventional-changelog-writer: 6.0.1 conventional-commits-parser: 4.0.0 dateformat: 3.0.3 get-pkg-repo: 4.2.1 git-raw-commits: 3.0.0 git-remote-origin-url: 2.0.0 git-semver-tags: 5.0.1 normalize-package-data: 3.0.3 read-pkg: 3.0.0 read-pkg-up: 3.0.0 conventional-changelog-ember@3.0.0: {} conventional-changelog-eslint@4.0.0: {} conventional-changelog-express@3.0.0: {} conventional-changelog-jquery@4.0.0: {} conventional-changelog-jshint@3.0.0: dependencies: compare-func: 2.0.0 conventional-changelog-preset-loader@3.0.0: {} conventional-changelog-writer@6.0.1: dependencies: conventional-commits-filter: 3.0.0 dateformat: 3.0.3 handlebars: 4.7.8 json-stringify-safe: 5.0.1 meow: 8.1.2 semver: 7.6.0 split: 1.0.1 conventional-changelog@4.0.0: dependencies: conventional-changelog-angular: 6.0.0 conventional-changelog-atom: 3.0.0 conventional-changelog-codemirror: 3.0.0 conventional-changelog-conventionalcommits: 6.1.0 conventional-changelog-core: 5.0.2 conventional-changelog-ember: 3.0.0 conventional-changelog-eslint: 4.0.0 conventional-changelog-express: 3.0.0 conventional-changelog-jquery: 4.0.0 conventional-changelog-jshint: 3.0.0 conventional-changelog-preset-loader: 3.0.0 conventional-commits-filter@3.0.0: dependencies: lodash.ismatch: 4.4.0 modify-values: 1.0.1 conventional-commits-parser@4.0.0: dependencies: JSONStream: 1.3.5 is-text-path: 1.0.1 meow: 8.1.2 split2: 3.2.2 core-util-is@1.0.3: {} cross-spawn@7.0.3: dependencies: path-key: 3.1.1 shebang-command: 2.0.0 which: 2.0.2 dargs@7.0.0: {} dateformat@3.0.3: {} debug@4.3.4(supports-color@8.1.1): dependencies: ms: 2.1.2 optionalDependencies: supports-color: 8.1.1 decamelize-keys@1.1.1: dependencies: decamelize: 1.2.0 map-obj: 1.0.1 decamelize@1.2.0: {} decamelize@4.0.0: {} deep-is@0.1.4: {} deepmerge@4.3.1: {} defu@6.1.4: {} destr@2.0.3: {} diff@5.0.0: {} doctrine@3.0.0: dependencies: esutils: 2.0.3 dot-prop@5.3.0: dependencies: is-obj: 2.0.0 dotenv@16.4.5: {} emoji-regex@8.0.0: {} error-ex@1.3.2: dependencies: is-arrayish: 0.2.1 escalade@3.1.2: {} escape-string-regexp@1.0.5: {} escape-string-regexp@4.0.0: {} eslint-scope@7.2.2: dependencies: esrecurse: 4.3.0 estraverse: 5.3.0 eslint-visitor-keys@3.4.3: {} eslint@8.57.0: dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) '@eslint-community/regexpp': 4.10.0 '@eslint/eslintrc': 2.1.4 '@eslint/js': 8.57.0 '@humanwhocodes/config-array': 0.11.14 '@humanwhocodes/module-importer': 1.0.1 '@nodelib/fs.walk': 1.2.8 '@ungap/structured-clone': 1.2.0 ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.3 debug: 4.3.4(supports-color@8.1.1) doctrine: 3.0.0 escape-string-regexp: 4.0.0 eslint-scope: 7.2.2 eslint-visitor-keys: 3.4.3 espree: 9.6.1 esquery: 1.5.0 esutils: 2.0.3 fast-deep-equal: 3.1.3 file-entry-cache: 6.0.1 find-up: 5.0.0 glob-parent: 6.0.2 globals: 13.24.0 graphemer: 1.4.0 ignore: 5.3.1 imurmurhash: 0.1.4 is-glob: 4.0.3 is-path-inside: 3.0.3 js-yaml: 4.1.0 json-stable-stringify-without-jsonify: 1.0.1 levn: 0.4.1 lodash.merge: 4.6.2 minimatch: 3.1.2 natural-compare: 1.4.0 optionator: 0.9.3 strip-ansi: 6.0.1 text-table: 0.2.0 transitivePeerDependencies: - supports-color espree@9.6.1: dependencies: acorn: 8.11.3 acorn-jsx: 5.3.2(acorn@8.11.3) eslint-visitor-keys: 3.4.3 esquery@1.5.0: dependencies: estraverse: 5.3.0 esrecurse@4.3.0: dependencies: estraverse: 5.3.0 estraverse@5.3.0: {} estree-walker@2.0.2: {} esutils@2.0.3: {} execa@8.0.1: dependencies: cross-spawn: 7.0.3 get-stream: 8.0.1 human-signals: 5.0.0 is-stream: 3.0.0 merge-stream: 2.0.0 npm-run-path: 5.3.0 onetime: 6.0.0 signal-exit: 4.1.0 strip-final-newline: 3.0.0 fast-deep-equal@3.1.3: {} fast-glob@3.3.2: dependencies: '@nodelib/fs.stat': 2.0.5 '@nodelib/fs.walk': 1.2.8 glob-parent: 5.1.2 merge2: 1.4.1 micromatch: 4.0.5 fast-json-stable-stringify@2.1.0: {} fast-levenshtein@2.0.6: {} fastq@1.17.1: dependencies: reusify: 1.0.4 file-entry-cache@6.0.1: dependencies: flat-cache: 3.2.0 fill-range@7.0.1: dependencies: to-regex-range: 5.0.1 find-up@2.1.0: dependencies: locate-path: 2.0.0 find-up@4.1.0: dependencies: locate-path: 5.0.0 path-exists: 4.0.0 find-up@5.0.0: dependencies: locate-path: 6.0.0 path-exists: 4.0.0 flat-cache@3.2.0: dependencies: flatted: 3.3.1 keyv: 4.5.4 rimraf: 3.0.2 flat@5.0.2: {} flatted@3.3.1: {} fs-minipass@2.1.0: dependencies: minipass: 3.3.6 fs.realpath@1.0.0: {} fsevents@2.3.3: optional: true function-bind@1.1.2: {} get-caller-file@2.0.5: {} get-pkg-repo@4.2.1: dependencies: '@hutson/parse-repository-url': 3.0.2 hosted-git-info: 4.1.0 through2: 2.0.5 yargs: 16.2.0 get-stream@8.0.1: {} giget@1.2.3: dependencies: citty: 0.1.6 consola: 3.2.3 defu: 6.1.4 node-fetch-native: 1.6.4 nypm: 0.3.8 ohash: 1.1.3 pathe: 1.1.2 tar: 6.2.1 git-raw-commits@3.0.0: dependencies: dargs: 7.0.0 meow: 8.1.2 split2: 3.2.2 git-remote-origin-url@2.0.0: dependencies: gitconfiglocal: 1.0.0 pify: 2.3.0 git-semver-tags@5.0.1: dependencies: meow: 8.1.2 semver: 7.6.0 gitconfiglocal@1.0.0: dependencies: ini: 1.3.8 glob-parent@5.1.2: dependencies: is-glob: 4.0.3 glob-parent@6.0.2: dependencies: is-glob: 4.0.3 glob@7.2.3: dependencies: fs.realpath: 1.0.0 inflight: 1.0.6 inherits: 2.0.4 minimatch: 3.1.2 once: 1.4.0 path-is-absolute: 1.0.1 glob@8.1.0: dependencies: fs.realpath: 1.0.0 inflight: 1.0.6 inherits: 2.0.4 minimatch: 5.0.1 once: 1.4.0 globals@13.24.0: dependencies: type-fest: 0.20.2 graceful-fs@4.2.11: {} graphemer@1.4.0: {} handlebars@4.7.8: dependencies: minimist: 1.2.8 neo-async: 2.6.2 source-map: 0.6.1 wordwrap: 1.0.0 optionalDependencies: uglify-js: 3.17.4 hard-rejection@2.1.0: {} has-flag@3.0.0: {} has-flag@4.0.0: {} hasown@2.0.2: dependencies: function-bind: 1.1.2 he@1.2.0: {} hosted-git-info@2.8.9: {} hosted-git-info@4.1.0: dependencies: lru-cache: 6.0.0 human-signals@5.0.0: {} ignore-walk@5.0.1: dependencies: minimatch: 5.1.6 ignore@5.3.1: {} import-fresh@3.3.0: dependencies: parent-module: 1.0.1 resolve-from: 4.0.0 imurmurhash@0.1.4: {} indent-string@4.0.0: {} inflight@1.0.6: dependencies: once: 1.4.0 wrappy: 1.0.2 inherits@2.0.4: {} ini@1.3.8: {} is-arrayish@0.2.1: {} is-binary-path@2.1.0: dependencies: binary-extensions: 2.3.0 is-builtin-module@3.2.1: dependencies: builtin-modules: 3.3.0 is-core-module@2.13.1: dependencies: hasown: 2.0.2 is-extglob@2.1.1: {} is-fullwidth-code-point@3.0.0: {} is-glob@4.0.3: dependencies: is-extglob: 2.1.1 is-module@1.0.0: {} is-number@7.0.0: {} is-obj@2.0.0: {} is-path-inside@3.0.3: {} is-plain-obj@1.1.0: {} is-plain-obj@2.1.0: {} is-stream@3.0.0: {} is-text-path@1.0.1: dependencies: text-extensions: 1.9.0 is-unicode-supported@0.1.0: {} isarray@1.0.0: {} isexe@2.0.0: {} jiti@1.21.0: {} js-tokens@4.0.0: {} js-yaml@4.1.0: dependencies: argparse: 2.0.1 json-buffer@3.0.1: {} json-parse-better-errors@1.0.2: {} json-parse-even-better-errors@2.3.1: {} json-schema-traverse@0.4.1: {} json-stable-stringify-without-jsonify@1.0.1: {} json-stringify-safe@5.0.1: {} jsonc-parser@3.2.1: {} jsonparse@1.3.1: {} keyv@4.5.4: dependencies: json-buffer: 3.0.1 kind-of@6.0.3: {} kleur@3.0.3: {} levn@0.4.1: dependencies: prelude-ls: 1.2.1 type-check: 0.4.0 lines-and-columns@1.2.4: {} load-json-file@4.0.0: dependencies: graceful-fs: 4.2.11 parse-json: 4.0.0 pify: 3.0.0 strip-bom: 3.0.0 locate-path@2.0.0: dependencies: p-locate: 2.0.0 path-exists: 3.0.0 locate-path@5.0.0: dependencies: p-locate: 4.1.0 locate-path@6.0.0: dependencies: p-locate: 5.0.0 lodash.ismatch@4.4.0: {} lodash.merge@4.6.2: {} lodash@4.17.21: {} log-symbols@4.1.0: dependencies: chalk: 4.1.2 is-unicode-supported: 0.1.0 lru-cache@6.0.0: dependencies: yallist: 4.0.0 magic-string@0.30.9: dependencies: '@jridgewell/sourcemap-codec': 1.4.15 map-obj@1.0.1: {} map-obj@4.3.0: {} meow@8.1.2: dependencies: '@types/minimist': 1.2.5 camelcase-keys: 6.2.2 decamelize-keys: 1.1.1 hard-rejection: 2.1.0 minimist-options: 4.1.0 normalize-package-data: 3.0.3 read-pkg-up: 7.0.1 redent: 3.0.0 trim-newlines: 3.0.1 type-fest: 0.18.1 yargs-parser: 20.2.9 merge-stream@2.0.0: {} merge2@1.4.1: {} micromatch@4.0.5: dependencies: braces: 3.0.2 picomatch: 2.3.1 mimic-fn@4.0.0: {} min-indent@1.0.1: {} minimatch@3.1.2: dependencies: brace-expansion: 1.1.11 minimatch@5.0.1: dependencies: brace-expansion: 2.0.1 minimatch@5.1.6: dependencies: brace-expansion: 2.0.1 minimist-options@4.1.0: dependencies: arrify: 1.0.1 is-plain-obj: 1.1.0 kind-of: 6.0.3 minimist@1.2.8: {} minipass@3.3.6: dependencies: yallist: 4.0.0 minipass@5.0.0: {} minizlib@2.1.2: dependencies: minipass: 3.3.6 yallist: 4.0.0 mkdirp@1.0.4: {} mlly@1.6.1: dependencies: acorn: 8.11.3 pathe: 1.1.2 pkg-types: 1.0.3 ufo: 1.5.3 mocha@10.4.0: dependencies: ansi-colors: 4.1.1 browser-stdout: 1.3.1 chokidar: 3.5.3 debug: 4.3.4(supports-color@8.1.1) diff: 5.0.0 escape-string-regexp: 4.0.0 find-up: 5.0.0 glob: 8.1.0 he: 1.2.0 js-yaml: 4.1.0 log-symbols: 4.1.0 minimatch: 5.0.1 ms: 2.1.3 serialize-javascript: 6.0.0 strip-json-comments: 3.1.1 supports-color: 8.1.1 workerpool: 6.2.1 yargs: 16.2.0 yargs-parser: 20.2.4 yargs-unparser: 2.0.0 modify-values@1.0.1: {} mri@1.2.0: {} ms@2.1.2: {} ms@2.1.3: {} natural-compare@1.4.0: {} neo-async@2.6.2: {} node-fetch-native@1.6.4: {} normalize-package-data@2.5.0: dependencies: hosted-git-info: 2.8.9 resolve: 1.22.8 semver: 5.7.2 validate-npm-package-license: 3.0.4 normalize-package-data@3.0.3: dependencies: hosted-git-info: 4.1.0 is-core-module: 2.13.1 semver: 7.6.0 validate-npm-package-license: 3.0.4 normalize-path@3.0.0: {} npm-bundled@2.0.1: dependencies: npm-normalize-package-bin: 2.0.0 npm-normalize-package-bin@2.0.0: {} npm-packlist@5.1.3: dependencies: glob: 8.1.0 ignore-walk: 5.0.1 npm-bundled: 2.0.1 npm-normalize-package-bin: 2.0.0 npm-run-path@5.3.0: dependencies: path-key: 4.0.0 nypm@0.3.8: dependencies: citty: 0.1.6 consola: 3.2.3 execa: 8.0.1 pathe: 1.1.2 ufo: 1.5.3 ohash@1.1.3: {} once@1.4.0: dependencies: wrappy: 1.0.2 onetime@6.0.0: dependencies: mimic-fn: 4.0.0 optionator@0.9.3: dependencies: '@aashutoshrathi/word-wrap': 1.2.6 deep-is: 0.1.4 fast-levenshtein: 2.0.6 levn: 0.4.1 prelude-ls: 1.2.1 type-check: 0.4.0 p-limit@1.3.0: dependencies: p-try: 1.0.0 p-limit@2.3.0: dependencies: p-try: 2.2.0 p-limit@3.1.0: dependencies: yocto-queue: 0.1.0 p-locate@2.0.0: dependencies: p-limit: 1.3.0 p-locate@4.1.0: dependencies: p-limit: 2.3.0 p-locate@5.0.0: dependencies: p-limit: 3.1.0 p-try@1.0.0: {} p-try@2.2.0: {} parent-module@1.0.1: dependencies: callsites: 3.1.0 parse-json@4.0.0: dependencies: error-ex: 1.3.2 json-parse-better-errors: 1.0.2 parse-json@5.2.0: dependencies: '@babel/code-frame': 7.24.2 error-ex: 1.3.2 json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 path-exists@3.0.0: {} path-exists@4.0.0: {} path-is-absolute@1.0.1: {} path-key@3.1.1: {} path-key@4.0.0: {} path-parse@1.0.7: {} path-type@3.0.0: dependencies: pify: 3.0.0 pathe@1.1.2: {} perfect-debounce@1.0.0: {} picocolors@1.0.0: {} picomatch@2.3.1: {} pify@2.3.0: {} pify@3.0.0: {} pkg-types@1.0.3: dependencies: jsonc-parser: 3.2.1 mlly: 1.6.1 pathe: 1.1.2 platform@1.3.6: {} prelude-ls@1.2.1: {} prettier@3.2.5: {} process-nextick-args@2.0.1: {} prompts@2.4.2: dependencies: kleur: 3.0.3 sisteransi: 1.0.5 publint@0.2.7: dependencies: npm-packlist: 5.1.3 picocolors: 1.0.0 sade: 1.8.1 punycode@2.3.1: {} queue-microtask@1.2.3: {} quick-lru@4.0.1: {} randombytes@2.1.0: dependencies: safe-buffer: 5.2.1 rc9@2.1.2: dependencies: defu: 6.1.4 destr: 2.0.3 read-pkg-up@3.0.0: dependencies: find-up: 2.1.0 read-pkg: 3.0.0 read-pkg-up@7.0.1: dependencies: find-up: 4.1.0 read-pkg: 5.2.0 type-fest: 0.8.1 read-pkg@3.0.0: dependencies: load-json-file: 4.0.0 normalize-package-data: 2.5.0 path-type: 3.0.0 read-pkg@5.2.0: dependencies: '@types/normalize-package-data': 2.4.4 normalize-package-data: 2.5.0 parse-json: 5.2.0 type-fest: 0.6.0 readable-stream@2.3.8: dependencies: core-util-is: 1.0.3 inherits: 2.0.4 isarray: 1.0.0 process-nextick-args: 2.0.1 safe-buffer: 5.1.2 string_decoder: 1.1.1 util-deprecate: 1.0.2 readable-stream@3.6.2: dependencies: inherits: 2.0.4 string_decoder: 1.3.0 util-deprecate: 1.0.2 readdirp@3.6.0: dependencies: picomatch: 2.3.1 redent@3.0.0: dependencies: indent-string: 4.0.0 strip-indent: 3.0.0 require-directory@2.1.1: {} resolve-from@4.0.0: {} resolve@1.22.8: dependencies: is-core-module: 2.13.1 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 reusify@1.0.4: {} rimraf@3.0.2: dependencies: glob: 7.2.3 rollup@3.29.4: optionalDependencies: fsevents: 2.3.3 run-parallel@1.2.0: dependencies: queue-microtask: 1.2.3 sade@1.8.1: dependencies: mri: 1.2.0 safe-buffer@5.1.2: {} safe-buffer@5.2.1: {} semver@5.7.2: {} semver@7.6.0: dependencies: lru-cache: 6.0.0 serialize-javascript@6.0.0: dependencies: randombytes: 2.1.0 shebang-command@2.0.0: dependencies: shebang-regex: 3.0.0 shebang-regex@3.0.0: {} signal-exit@4.1.0: {} sisteransi@1.0.5: {} source-map-js@1.2.0: {} source-map-support@0.5.21: dependencies: buffer-from: 1.1.2 source-map: 0.6.1 source-map@0.6.1: {} spdx-correct@3.2.0: dependencies: spdx-expression-parse: 3.0.1 spdx-license-ids: 3.0.17 spdx-exceptions@2.5.0: {} spdx-expression-parse@3.0.1: dependencies: spdx-exceptions: 2.5.0 spdx-license-ids: 3.0.17 spdx-license-ids@3.0.17: {} split2@3.2.2: dependencies: readable-stream: 3.6.2 split@1.0.1: dependencies: through: 2.3.8 string-argv@0.3.2: {} string-width@4.2.3: dependencies: emoji-regex: 8.0.0 is-fullwidth-code-point: 3.0.0 strip-ansi: 6.0.1 string_decoder@1.1.1: dependencies: safe-buffer: 5.1.2 string_decoder@1.3.0: dependencies: safe-buffer: 5.2.1 strip-ansi@6.0.1: dependencies: ansi-regex: 5.0.1 strip-bom@3.0.0: {} strip-final-newline@3.0.0: {} strip-indent@3.0.0: dependencies: min-indent: 1.0.1 strip-json-comments@3.1.1: {} supports-color@5.5.0: dependencies: has-flag: 3.0.0 supports-color@7.2.0: dependencies: has-flag: 4.0.0 supports-color@8.1.1: dependencies: has-flag: 4.0.0 supports-preserve-symlinks-flag@1.0.0: {} tar@6.2.1: dependencies: chownr: 2.0.0 fs-minipass: 2.1.0 minipass: 5.0.0 minizlib: 2.1.2 mkdirp: 1.0.4 yallist: 4.0.0 temp-dir@2.0.0: {} tempfile@3.0.0: dependencies: temp-dir: 2.0.0 uuid: 3.4.0 text-extensions@1.9.0: {} text-table@0.2.0: {} through2@2.0.5: dependencies: readable-stream: 2.3.8 xtend: 4.0.2 through@2.3.8: {} to-regex-range@5.0.1: dependencies: is-number: 7.0.0 trim-newlines@3.0.1: {} type-check@0.4.0: dependencies: prelude-ls: 1.2.1 type-detect@4.0.8: {} type-fest@0.18.1: {} type-fest@0.20.2: {} type-fest@0.6.0: {} type-fest@0.8.1: {} ufo@1.5.3: {} uglify-js@3.17.4: optional: true uri-js@4.4.1: dependencies: punycode: 2.3.1 util-deprecate@1.0.2: {} uuid@3.4.0: {} validate-npm-package-license@3.0.4: dependencies: spdx-correct: 3.2.0 spdx-expression-parse: 3.0.1 which@2.0.2: dependencies: isexe: 2.0.0 wordwrap@1.0.0: {} workerpool@6.2.1: {} wrap-ansi@7.0.0: dependencies: ansi-styles: 4.3.0 string-width: 4.2.3 strip-ansi: 6.0.1 wrappy@1.0.2: {} xtend@4.0.2: {} y18n@5.0.8: {} yallist@4.0.0: {} yargs-parser@20.2.4: {} yargs-parser@20.2.9: {} yargs-unparser@2.0.0: dependencies: camelcase: 6.3.0 decamelize: 4.0.0 flat: 5.0.2 is-plain-obj: 2.1.0 yargs@16.2.0: dependencies: cliui: 7.0.4 escalade: 3.1.2 get-caller-file: 2.0.5 require-directory: 2.1.1 string-width: 4.2.3 y18n: 5.0.8 yargs-parser: 20.2.4 yocto-queue@0.1.0: {} magic-string-0.30.10/rollup.config.mjs000066400000000000000000000022441460774323400175470ustar00rootroot00000000000000import nodeResolve from '@rollup/plugin-node-resolve'; import replace from '@rollup/plugin-replace'; import fs from 'node:fs'; import path from 'node:path'; const plugins = [ nodeResolve(), replace({ DEBUG: false, preventAssignment: true }) ]; export default [ /* esm */ { input: 'src/index.js', external: ['@jridgewell/sourcemap-codec'], plugins: [ ...plugins, { name: 'copy-typescript-files', closeBundle() { const base = path.resolve('./src/index.d.ts'); fs.copyFileSync(base, path.resolve('./dist/magic-string.es.d.mts')); fs.copyFileSync(base, path.resolve('./dist/magic-string.cjs.d.ts')); } } ], output: { file: 'dist/magic-string.es.mjs', format: 'es', exports: 'named', sourcemap: true } }, /* cjs */ { input: 'src/index-legacy.js', external: ['@jridgewell/sourcemap-codec'], plugins, output: { file: 'dist/magic-string.cjs.js', format: 'cjs', exports: 'default', sourcemap: true } }, /* umd */ { input: 'src/index-legacy.js', plugins, output: { file: 'dist/magic-string.umd.js', format: 'umd', exports: 'default', name: 'MagicString', sourcemap: true } } ]; magic-string-0.30.10/src/000077500000000000000000000000001460774323400150405ustar00rootroot00000000000000magic-string-0.30.10/src/BitSet.js000066400000000000000000000003501460774323400165660ustar00rootroot00000000000000export default 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))); } } magic-string-0.30.10/src/Bundle.js000066400000000000000000000161741460774323400166200ustar00rootroot00000000000000import MagicString from './MagicString.js'; import SourceMap from './SourceMap.js'; import getRelativePath from './utils/getRelativePath.js'; import isObject from './utils/isObject.js'; import getLocator from './utils/getLocator.js'; import Mappings from './utils/Mappings.js'; const hasOwnProp = Object.prototype.hasOwnProperty; export default class Bundle { constructor(options = {}) { this.intro = options.intro || ''; this.separator = options.separator !== undefined ? options.separator : '\n'; this.sources = []; this.uniqueSources = []; this.uniqueSourceIndexByFilename = {}; } addSource(source) { if (source instanceof MagicString) { return this.addSource({ content: source, filename: source.filename, separator: this.separator, }); } if (!isObject(source) || !source.content) { throw new Error( 'bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`', ); } ['filename', 'ignoreList', 'indentExclusionRanges', 'separator'].forEach((option) => { if (!hasOwnProp.call(source, option)) source[option] = source.content[option]; }); if (source.separator === undefined) { // TODO there's a bunch of this sort of thing, needs cleaning up source.separator = this.separator; } if (source.filename) { if (!hasOwnProp.call(this.uniqueSourceIndexByFilename, source.filename)) { this.uniqueSourceIndexByFilename[source.filename] = this.uniqueSources.length; this.uniqueSources.push({ filename: source.filename, content: source.content.original }); } else { const uniqueSource = this.uniqueSources[this.uniqueSourceIndexByFilename[source.filename]]; if (source.content.original !== uniqueSource.content) { throw new Error(`Illegal source: same filename (${source.filename}), different contents`); } } } this.sources.push(source); return this; } append(str, options) { this.addSource({ content: new MagicString(str), separator: (options && options.separator) || '', }); return this; } clone() { const bundle = new Bundle({ intro: this.intro, separator: this.separator, }); this.sources.forEach((source) => { bundle.addSource({ filename: source.filename, content: source.content.clone(), separator: source.separator, }); }); return bundle; } generateDecodedMap(options = {}) { const names = []; let x_google_ignoreList = undefined; this.sources.forEach((source) => { Object.keys(source.content.storedNames).forEach((name) => { if (!~names.indexOf(name)) names.push(name); }); }); const mappings = new Mappings(options.hires); if (this.intro) { mappings.advance(this.intro); } this.sources.forEach((source, i) => { if (i > 0) { mappings.advance(this.separator); } const sourceIndex = source.filename ? this.uniqueSourceIndexByFilename[source.filename] : -1; const magicString = source.content; const locate = getLocator(magicString.original); if (magicString.intro) { mappings.advance(magicString.intro); } magicString.firstChunk.eachNext((chunk) => { const loc = locate(chunk.start); if (chunk.intro.length) mappings.advance(chunk.intro); if (source.filename) { if (chunk.edited) { mappings.addEdit( sourceIndex, chunk.content, loc, chunk.storeName ? names.indexOf(chunk.original) : -1, ); } else { mappings.addUneditedChunk( sourceIndex, chunk, magicString.original, loc, magicString.sourcemapLocations, ); } } else { mappings.advance(chunk.content); } if (chunk.outro.length) mappings.advance(chunk.outro); }); if (magicString.outro) { mappings.advance(magicString.outro); } if (source.ignoreList && sourceIndex !== -1) { if (x_google_ignoreList === undefined) { x_google_ignoreList = []; } x_google_ignoreList.push(sourceIndex); } }); return { file: options.file ? options.file.split(/[/\\]/).pop() : undefined, sources: this.uniqueSources.map((source) => { return options.file ? getRelativePath(options.file, source.filename) : source.filename; }), sourcesContent: this.uniqueSources.map((source) => { return options.includeContent ? source.content : null; }), names, mappings: mappings.raw, x_google_ignoreList, }; } generateMap(options) { return new SourceMap(this.generateDecodedMap(options)); } getIndentString() { const indentStringCounts = {}; this.sources.forEach((source) => { const indentStr = source.content._getRawIndentString(); if (indentStr === null) return; if (!indentStringCounts[indentStr]) indentStringCounts[indentStr] = 0; indentStringCounts[indentStr] += 1; }); return ( Object.keys(indentStringCounts).sort((a, b) => { return indentStringCounts[a] - indentStringCounts[b]; })[0] || '\t' ); } indent(indentStr) { if (!arguments.length) { indentStr = this.getIndentString(); } if (indentStr === '') return this; // noop let trailingNewline = !this.intro || this.intro.slice(-1) === '\n'; this.sources.forEach((source, i) => { const separator = source.separator !== undefined ? source.separator : this.separator; const indentStart = trailingNewline || (i > 0 && /\r?\n$/.test(separator)); source.content.indent(indentStr, { exclude: source.indentExclusionRanges, indentStart, //: trailingNewline || /\r?\n$/.test( separator ) //true///\r?\n/.test( separator ) }); trailingNewline = source.content.lastChar() === '\n'; }); if (this.intro) { this.intro = indentStr + this.intro.replace(/^[^\n]/gm, (match, index) => { return index > 0 ? indentStr + match : match; }); } return this; } prepend(str) { this.intro = str + this.intro; return this; } toString() { const body = this.sources .map((source, i) => { const separator = source.separator !== undefined ? source.separator : this.separator; const str = (i > 0 ? separator : '') + source.content.toString(); return str; }) .join(''); return this.intro + body; } isEmpty() { if (this.intro.length && this.intro.trim()) return false; if (this.sources.some((source) => !source.content.isEmpty())) return false; return true; } length() { return this.sources.reduce( (length, source) => length + source.content.length(), this.intro.length, ); } trimLines() { return this.trim('[\\r\\n]'); } trim(charType) { return this.trimStart(charType).trimEnd(charType); } trimStart(charType) { const rx = new RegExp('^' + (charType || '\\s') + '+'); this.intro = this.intro.replace(rx, ''); if (!this.intro) { let source; let i = 0; do { source = this.sources[i++]; if (!source) { break; } } while (!source.content.trimStartAborted(charType)); } return this; } trimEnd(charType) { const rx = new RegExp((charType || '\\s') + '+$'); let source; let i = this.sources.length - 1; do { source = this.sources[i--]; if (!source) { this.intro = this.intro.replace(rx, ''); break; } } while (!source.content.trimEndAborted(charType)); return this; } } magic-string-0.30.10/src/Chunk.js000066400000000000000000000073551460774323400164600ustar00rootroot00000000000000export default 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; if (DEBUG) { // we make these non-enumerable, for sanity while debugging Object.defineProperties(this, { previous: { writable: true, value: null }, next: { writable: true, value: null }, }); } else { 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; } } } magic-string-0.30.10/src/MagicString.js000066400000000000000000000526231460774323400176150ustar00rootroot00000000000000import BitSet from './BitSet.js'; import Chunk from './Chunk.js'; import SourceMap from './SourceMap.js'; import guessIndent from './utils/guessIndent.js'; import getRelativePath from './utils/getRelativePath.js'; import isObject from './utils/isObject.js'; import getLocator from './utils/getLocator.js'; import Mappings from './utils/Mappings.js'; import Stats from './utils/Stats.js'; const n = '\n'; const warned = { insertLeft: false, insertRight: false, storeName: false, }; export default 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 }, }); if (DEBUG) { Object.defineProperty(this, 'stats', { value: new Stats() }); } 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'); if (DEBUG) this.stats.time('appendLeft'); this._split(index); const chunk = this.byEnd[index]; if (chunk) { chunk.appendLeft(content); } else { this.intro += content; } if (DEBUG) this.stats.timeEnd('appendLeft'); return this; } appendRight(index, content) { if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); if (DEBUG) this.stats.time('appendRight'); this._split(index); const chunk = this.byStart[index]; if (chunk) { chunk.appendRight(content); } else { this.outro += content; } if (DEBUG) this.stats.timeEnd('appendRight'); 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'); if (DEBUG) this.stats.time('move'); 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; if (DEBUG) this.stats.timeEnd('move'); return this; } overwrite(start, end, content, options) { options = options || {}; return this.update(start, end, content, { ...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', ); if (DEBUG) this.stats.time('overwrite'); 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; } if (DEBUG) this.stats.timeEnd('overwrite'); 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'); if (DEBUG) this.stats.time('insertRight'); this._split(index); const chunk = this.byEnd[index]; if (chunk) { chunk.prependLeft(content); } else { this.intro = content + this.intro; } if (DEBUG) this.stats.timeEnd('insertRight'); return this; } prependRight(index, content) { if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); if (DEBUG) this.stats.time('insertRight'); this._split(index); const chunk = this.byStart[index]; if (chunk) { chunk.prependRight(content); } else { this.outro = content + this.outro; } if (DEBUG) this.stats.timeEnd('insertRight'); 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'); if (DEBUG) this.stats.time('remove'); 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; } if (DEBUG) this.stats.timeEnd('remove'); 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'); if (DEBUG) this.stats.time('reset'); this._split(start); this._split(end); let chunk = this.byStart[start]; while (chunk) { chunk.reset(); chunk = end > chunk.end ? this.byStart[chunk.end] : null; } if (DEBUG) this.stats.timeEnd('reset'); 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; if (DEBUG) this.stats.time('_split'); 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; if (DEBUG) this.stats.timeEnd('_split'); 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) { const replacement = getReplacement(match, this.original); if (replacement !== match[0]) { this.overwrite( match.index, match.index + match[0].length, replacement ); } } }); } else { const match = this.original.match(searchValue); if (match && match.index != null) { const replacement = getReplacement(match, this.original); if (replacement !== match[0]) { this.overwrite( match.index, match.index + match[0].length, replacement ); } } } return this; } _replaceString(string, replacement) { const { original } = this; 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; const stringLength = string.length; for ( let index = original.indexOf(string); index !== -1; index = original.indexOf(string, index + stringLength) ) { const previous = original.slice(index, index + stringLength); if (previous !== replacement) 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); } } magic-string-0.30.10/src/SourceMap.js000066400000000000000000000020521460774323400172730ustar00rootroot00000000000000import { encode } from '@jridgewell/sourcemap-codec'; 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(); export default 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()); } } magic-string-0.30.10/src/index-legacy.js000066400000000000000000000005121460774323400177450ustar00rootroot00000000000000import MagicString from './MagicString.js'; import Bundle from './Bundle.js'; import SourceMap from './SourceMap.js'; MagicString.Bundle = Bundle; MagicString.SourceMap = SourceMap; MagicString.default = MagicString; // work around TypeScript bug https://github.com/Rich-Harris/magic-string/pull/121 export default MagicString; magic-string-0.30.10/src/index.d.ts000066400000000000000000000236411460774323400167470ustar00rootroot00000000000000export interface BundleOptions { intro?: string; separator?: string; } export interface SourceMapOptions { /** * Whether the mapping should be high-resolution. * Hi-res mappings map every single character, meaning (for example) your devtools will always * be able to pinpoint the exact location of function calls and so on. * With lo-res mappings, devtools may only be able to identify the correct * line - but they're quicker to generate and less bulky. * You can also set `"boundary"` to generate a semi-hi-res mappings segmented per word boundary * instead of per character, suitable for string semantics that are separated by words. * If sourcemap locations have been specified with s.addSourceMapLocation(), they will be used here. */ hires?: boolean | 'boundary'; /** * The filename where you plan to write the sourcemap. */ file?: string; /** * The filename of the file containing the original source. */ source?: string; /** * Whether to include the original content in the map's sourcesContent array. */ includeContent?: boolean; } export type SourceMapSegment = | [number] | [number, number, number, number] | [number, number, number, number, number]; export interface DecodedSourceMap { file: string; sources: string[]; sourcesContent?: string[]; names: string[]; mappings: SourceMapSegment[][]; x_google_ignoreList?: number[]; } export class SourceMap { constructor(properties: DecodedSourceMap); version: number; file: string; sources: string[]; sourcesContent?: string[]; names: string[]; mappings: string; x_google_ignoreList?: number[]; /** * Returns the equivalent of `JSON.stringify(map)` */ toString(): string; /** * Returns a DataURI containing the sourcemap. Useful for doing this sort of thing: * `generateMap(options?: SourceMapOptions): SourceMap;` */ toUrl(): string; } export class Bundle { constructor(options?: BundleOptions); /** * Adds the specified source to the bundle, which can either be a `MagicString` object directly, * or an options object that holds a magic string `content` property and optionally provides * a `filename` for the source within the bundle, as well as an optional `ignoreList` hint * (which defaults to `false`). The `filename` is used when constructing the source map for the * bundle, to identify this `source` in the source map's `sources` field. The `ignoreList` hint * is used to populate the `x_google_ignoreList` extension field in the source map, which is a * mechanism for tools to signal to debuggers that certain sources should be ignored by default * (depending on user preferences). */ addSource(source: MagicString | { filename?: string, content: MagicString, ignoreList?: boolean }): this; append(str: string, options?: BundleOptions): this; clone(): this; generateMap(options?: SourceMapOptions): Omit & { sourcesContent: Array }; generateDecodedMap(options?: SourceMapOptions): Omit & { sourcesContent: Array }; getIndentString(): string; indent(indentStr?: string): this; indentExclusionRanges: ExclusionRange | Array; prepend(str: string): this; toString(): string; trimLines(): this; trim(charType?: string): this; trimStart(charType?: string): this; trimEnd(charType?: string): this; isEmpty(): boolean; length(): number; } export type ExclusionRange = [ number, number ]; export interface MagicStringOptions { filename?: string, indentExclusionRanges?: ExclusionRange | Array; } export interface IndentOptions { exclude?: ExclusionRange | Array; indentStart?: boolean; } export interface OverwriteOptions { storeName?: boolean; contentOnly?: boolean; } export interface UpdateOptions { storeName?: boolean; overwrite?: boolean; } export default class MagicString { constructor(str: string, options?: MagicStringOptions); /** * Adds the specified character index (with respect to the original string) to sourcemap mappings, if `hires` is false. */ addSourcemapLocation(char: number): void; /** * Appends the specified content to the end of the string. */ append(content: string): this; /** * Appends the specified content at the index in the original string. * If a range *ending* with index is subsequently moved, the insert will be moved with it. * See also `s.prependLeft(...)`. */ appendLeft(index: number, content: string): this; /** * Appends the specified content at the index in the original string. * If a range *starting* with index is subsequently moved, the insert will be moved with it. * See also `s.prependRight(...)`. */ appendRight(index: number, content: string): this; /** * Does what you'd expect. */ clone(): this; /** * Generates a version 3 sourcemap. */ generateMap(options?: SourceMapOptions): SourceMap; /** * Generates a sourcemap object with raw mappings in array form, rather than encoded as a string. * Useful if you need to manipulate the sourcemap further, but most of the time you will use `generateMap` instead. */ generateDecodedMap(options?: SourceMapOptions): DecodedSourceMap; getIndentString(): string; /** * Prefixes each line of the string with prefix. * If prefix is not supplied, the indentation will be guessed from the original content, falling back to a single tab character. */ indent(options?: IndentOptions): this; /** * Prefixes each line of the string with prefix. * If prefix is not supplied, the indentation will be guessed from the original content, falling back to a single tab character. * * The options argument can have an exclude property, which is an array of [start, end] character ranges. * These ranges will be excluded from the indentation - useful for (e.g.) multiline strings. */ indent(indentStr?: string, options?: IndentOptions): this; indentExclusionRanges: ExclusionRange | Array; /** * Moves the characters from `start and `end` to `index`. */ move(start: number, end: number, index: number): this; /** * Replaces the characters from `start` to `end` with `content`, along with the appended/prepended content in * that range. The same restrictions as `s.remove()` apply. * * The fourth argument is optional. It can have a storeName property — if true, the original name will be stored * for later inclusion in a sourcemap's names array — and a contentOnly property which determines whether only * the content is overwritten, or anything that was appended/prepended to the range as well. * * It may be preferred to use `s.update(...)` instead if you wish to avoid overwriting the appended/prepended content. */ overwrite(start: number, end: number, content: string, options?: boolean | OverwriteOptions): this; /** * Replaces the characters from `start` to `end` with `content`. The same restrictions as `s.remove()` apply. * * The fourth argument is optional. It can have a storeName property — if true, the original name will be stored * for later inclusion in a sourcemap's names array — and an overwrite property which determines whether only * the content is overwritten, or anything that was appended/prepended to the range as well. */ update(start: number, end: number, content: string, options?: boolean | UpdateOptions): this; /** * Prepends the string with the specified content. */ prepend(content: string): this; /** * Same as `s.appendLeft(...)`, except that the inserted content will go *before* any previous appends or prepends at index */ prependLeft(index: number, content: string): this; /** * Same as `s.appendRight(...)`, except that the inserted content will go *before* any previous appends or prepends at `index` */ prependRight(index: number, content: string): this; /** * Removes the characters from `start` to `end` (of the original string, **not** the generated string). * Removing the same content twice, or making removals that partially overlap, will cause an error. */ remove(start: number, end: number): this; /** * Reset the modified characters from `start` to `end` (of the original string, **not** the generated string). */ reset(start: number, end: number): this; /** * Returns the content of the generated string that corresponds to the slice between `start` and `end` of the original string. * Throws error if the indices are for characters that were already removed. */ slice(start: number, end: number): string; /** * Returns a clone of `s`, with all content before the `start` and `end` characters of the original string removed. */ snip(start: number, end: number): this; /** * Trims content matching `charType` (defaults to `\s`, i.e. whitespace) from the start and end. */ trim(charType?: string): this; /** * Trims content matching `charType` (defaults to `\s`, i.e. whitespace) from the start. */ trimStart(charType?: string): this; /** * Trims content matching `charType` (defaults to `\s`, i.e. whitespace) from the end. */ trimEnd(charType?: string): this; /** * Removes empty lines from the start and end. */ trimLines(): this; /** * String replacement with RegExp or string. */ replace(regex: RegExp | string, replacement: string | ((substring: string, ...args: any[]) => string)): this; /** * Same as `s.replace`, but replace all matched strings instead of just one. */ replaceAll(regex: RegExp | string, replacement: string | ((substring: string, ...args: any[]) => string)): this; lastChar(): string; lastLine(): string; /** * Returns true if the resulting source is empty (disregarding white space). */ isEmpty(): boolean; length(): number; /** * Indicates if the string has been changed. */ hasChanged(): boolean; original: string; /** * Returns the generated string. */ toString(): string; } magic-string-0.30.10/src/index.js000066400000000000000000000002611460774323400165040ustar00rootroot00000000000000import MagicString from './MagicString.js'; export default MagicString; export { default as Bundle } from './Bundle.js'; export { default as SourceMap } from './SourceMap.js'; magic-string-0.30.10/src/utils/000077500000000000000000000000001460774323400162005ustar00rootroot00000000000000magic-string-0.30.10/src/utils/Mappings.js000066400000000000000000000062751460774323400203260ustar00rootroot00000000000000const wordRegex = /\w/; export default 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) { const contentLengthMinusOne = content.length - 1; let contentLineEnd = content.indexOf('\n', 0); let previousContentLineEnd = -1; // Loop through each line in the content and add a segment, but stop if the last line is empty, // else code afterwards would fill one line too many while (contentLineEnd >= 0 && contentLengthMinusOne > contentLineEnd) { 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; } } magic-string-0.30.10/src/utils/Stats.js000066400000000000000000000005461460774323400176410ustar00rootroot00000000000000export default class Stats { constructor() { Object.defineProperties(this, { startTimes: { value: {} }, }); } time(label) { this.startTimes[label] = process.hrtime(); } timeEnd(label) { const elapsed = process.hrtime(this.startTimes[label]); if (!this[label]) this[label] = 0; this[label] += elapsed[0] * 1e3 + elapsed[1] * 1e-6; } } magic-string-0.30.10/src/utils/getLocator.js000066400000000000000000000010341460774323400206370ustar00rootroot00000000000000export default 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 }; }; } magic-string-0.30.10/src/utils/getRelativePath.js000066400000000000000000000006011460774323400216230ustar00rootroot00000000000000export default 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('/'); } magic-string-0.30.10/src/utils/guessIndent.js000066400000000000000000000012621460774323400210270ustar00rootroot00000000000000export default 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(' '); } magic-string-0.30.10/src/utils/isObject.js000066400000000000000000000002151460774323400202760ustar00rootroot00000000000000const toString = Object.prototype.toString; export default function isObject(thing) { return toString.call(thing) === '[object Object]'; } magic-string-0.30.10/test/000077500000000000000000000000001460774323400152305ustar00rootroot00000000000000magic-string-0.30.10/test/.eslintrc000066400000000000000000000000661460774323400170560ustar00rootroot00000000000000{ "env": { "node": true, "mocha": true } }magic-string-0.30.10/test/MagicString.Bundle.js000066400000000000000000000503231460774323400212100ustar00rootroot00000000000000const assert = require('assert'); const SourceMapConsumer = require('source-map-js').SourceMapConsumer; const MagicString = require('../'); require('source-map-support').install(); describe('MagicString.Bundle', () => { describe('addSource', () => { it('should return this', () => { const b = new MagicString.Bundle(); const source = new MagicString('abcdefghijkl'); assert.strictEqual(b.addSource({ content: source }), b); }); it('should accept MagicString instance as a single argument', () => { const b = new MagicString.Bundle(); const array = []; const source = new MagicString('abcdefghijkl', { filename: 'foo.js', indentExclusionRanges: array }); b.addSource(source); assert.strictEqual(b.sources[0].content, source); assert.strictEqual(b.sources[0].filename, 'foo.js'); assert.strictEqual(b.sources[0].indentExclusionRanges, array); }); it('should accept ignore-list hint', () => { const b = new MagicString.Bundle(); const foo = new MagicString('foo', {filename: 'foo.js'}); const bar = new MagicString('bar', {filename: 'bar.js'}); b.addSource({content: foo, ignoreList: true}); b.addSource({content: bar, ignoreList: false}); assert.strictEqual(b.sources[0].content, foo); assert.strictEqual(b.sources[0].ignoreList, true); assert.strictEqual(b.sources[1].content, bar); assert.strictEqual(b.sources[1].ignoreList, false); }); it('respects MagicString init options with { content: source }', () => { const b = new MagicString.Bundle(); const array = []; const source = new MagicString('abcdefghijkl', { filename: 'foo.js', ignoreList: false, indentExclusionRanges: array }); b.addSource({ content: source }); assert.strictEqual(b.sources[0].content, source); assert.strictEqual(b.sources[0].filename, 'foo.js'); assert.strictEqual(b.sources[0].ignoreList, false); assert.strictEqual(b.sources[0].indentExclusionRanges, array); }); }); describe('append', () => { it('should append content', () => { const b = new MagicString.Bundle(); b.addSource({ content: new MagicString('*') }); b.append('123').append('456'); assert.equal(b.toString(), '*123456'); }); it('should append content before subsequent sources', () => { const b = new MagicString.Bundle(); b.addSource(new MagicString('*')); b.append('123').addSource(new MagicString('-')).append('456'); assert.equal(b.toString(), '*123\n-456'); }); it('should return this', () => { const b = new MagicString.Bundle(); assert.strictEqual(b.append('x'), b); }); }); describe('clone', () => { it('should clone a bundle', () => { const s1 = new MagicString('abcdef'); const s2 = new MagicString('ghijkl'); const b = new MagicString.Bundle() .addSource({ content: s1 }) .addSource({ content: s2 }) .prepend('>>>') .append('<<<'); const clone = b.clone(); assert.equal(clone.toString(), '>>>abcdef\nghijkl<<<'); s1.overwrite(2, 4, 'XX'); assert.equal(b.toString(), '>>>abXXef\nghijkl<<<'); assert.equal(clone.toString(), '>>>abcdef\nghijkl<<<'); }); }); describe('generateMap', () => { it('should generate a sourcemap', () => { const b = new MagicString.Bundle() .addSource({ filename: 'foo.js', content: new MagicString('var answer = 42;') }) .addSource({ filename: 'bar.js', content: new MagicString('console.log( answer );') }); const map = b.generateMap({ file: 'bundle.js', includeContent: true, hires: true }); assert.equal(map.version, 3); assert.equal(map.file, 'bundle.js'); assert.deepEqual(map.sources, ['foo.js', 'bar.js']); assert.deepEqual(map.sourcesContent, ['var answer = 42;', 'console.log( answer );']); const smc = new SourceMapConsumer(map); let loc; loc = smc.originalPositionFor({ line: 1, column: 0 }); assert.equal(loc.line, 1); assert.equal(loc.column, 0); assert.equal(loc.source, 'foo.js'); loc = smc.originalPositionFor({ line: 1, column: 1 }); assert.equal(loc.line, 1); assert.equal(loc.column, 1); assert.equal(loc.source, 'foo.js'); loc = smc.originalPositionFor({ line: 2, column: 0 }); assert.equal(loc.line, 1); assert.equal(loc.column, 0); assert.equal(loc.source, 'bar.js'); loc = smc.originalPositionFor({ line: 2, column: 1 }); assert.equal(loc.line, 1); assert.equal(loc.column, 1); assert.equal(loc.source, 'bar.js'); }); it('should handle Windows-style paths', () => { const b = new MagicString.Bundle() .addSource({ filename: 'path\\to\\foo.js', content: new MagicString('var answer = 42;') }) .addSource({ filename: 'path\\to\\bar.js', content: new MagicString('console.log( answer );') }); const map = b.generateMap({ file: 'bundle.js', includeContent: true, hires: true }); assert.equal(map.version, 3); assert.equal(map.file, 'bundle.js'); assert.deepEqual(map.sources, ['path/to/foo.js', 'path/to/bar.js']); assert.deepEqual(map.sourcesContent, ['var answer = 42;', 'console.log( answer );']); assert.equal(map.toString(), '{"version":3,"file":"bundle.js","sources":["path/to/foo.js","path/to/bar.js"],"sourcesContent":["var answer = 42;","console.log( answer );"],"names":[],"mappings":"AAAA,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;ACAf,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC"}'); const smc = new SourceMapConsumer(map); let loc; loc = smc.originalPositionFor({ line: 1, column: 0 }); assert.equal(loc.line, 1); assert.equal(loc.column, 0); assert.equal(loc.source, 'path/to/foo.js'); loc = smc.originalPositionFor({ line: 1, column: 1 }); assert.equal(loc.line, 1); assert.equal(loc.column, 1); assert.equal(loc.source, 'path/to/foo.js'); loc = smc.originalPositionFor({ line: 2, column: 0 }); assert.equal(loc.line, 1); assert.equal(loc.column, 0); assert.equal(loc.source, 'path/to/bar.js'); loc = smc.originalPositionFor({ line: 2, column: 1 }); assert.equal(loc.line, 1); assert.equal(loc.column, 1); assert.equal(loc.source, 'path/to/bar.js'); }); it('should handle edge case with intro content', () => { const b = new MagicString.Bundle() .addSource({ filename: 'foo.js', content: new MagicString('var answer = 42;') }) .addSource({ filename: 'bar.js', content: new MagicString('\nconsole.log( answer );') }) .indent().prepend('(function () {\n').append('\n}());'); const map = b.generateMap({ file: 'bundle.js', includeContent: true, hires: true }); const smc = new SourceMapConsumer(map); let loc; loc = smc.originalPositionFor({ line: 2, column: 1 }); assert.equal(loc.line, 1); assert.equal(loc.column, 0); assert.equal(loc.source, 'foo.js'); loc = smc.originalPositionFor({ line: 2, column: 2 }); assert.equal(loc.line, 1); assert.equal(loc.column, 1); assert.equal(loc.source, 'foo.js'); loc = smc.originalPositionFor({ line: 4, column: 1 }); assert.equal(loc.line, 2); assert.equal(loc.column, 0); assert.equal(loc.source, 'bar.js'); loc = smc.originalPositionFor({ line: 4, column: 2 }); assert.equal(loc.line, 2); assert.equal(loc.column, 1); assert.equal(loc.source, 'bar.js'); }); it('should allow missing file option when generating map', () => { new MagicString.Bundle() .addSource({ filename: 'foo.js', content: new MagicString('var answer = 42;') }) .generateMap({ includeContent: true, hires: true }); }); it('should handle repeated sources', () => { const b = new MagicString.Bundle(); const foo = new MagicString('var one = 1;\nvar three = 3;', { filename: 'foo.js' }); const bar = new MagicString('var two = 2;\nvar four = 4;', { filename: 'bar.js' }); b.addSource(foo.snip(0, 12)); b.addSource(bar.snip(0, 12)); b.addSource(foo.snip(13, 27)); b.addSource(bar.snip(13, 26)); const code = b.toString(); assert.equal(code, 'var one = 1;\nvar two = 2;\nvar three = 3;\nvar four = 4;'); const map = b.generateMap({ includeContent: true, hires: true }); assert.equal(map.sources.length, 2); assert.equal(map.sourcesContent.length, 2); const smc = new SourceMapConsumer(map); let loc; loc = smc.originalPositionFor({ line: 1, column: 0 }); assert.equal(loc.line, 1); assert.equal(loc.column, 0); assert.equal(loc.source, 'foo.js'); loc = smc.originalPositionFor({ line: 2, column: 0 }); assert.equal(loc.line, 1); assert.equal(loc.column, 0); assert.equal(loc.source, 'bar.js'); loc = smc.originalPositionFor({ line: 3, column: 0 }); assert.equal(loc.line, 2); assert.equal(loc.column, 0); assert.equal(loc.source, 'foo.js'); loc = smc.originalPositionFor({ line: 4, column: 0 }); assert.equal(loc.line, 2); assert.equal(loc.column, 0); assert.equal(loc.source, 'bar.js'); }); it('should recover original names', () => { const b = new MagicString.Bundle(); const one = new MagicString('function one () {}', { filename: 'one.js' }); const two = new MagicString('function two () {}', { filename: 'two.js' }); one.overwrite(9, 12, 'three', { storeName: true }); two.overwrite(9, 12, 'four', { storeName: true }); b.addSource(one); b.addSource(two); const map = b.generateMap({ file: 'output.js', source: 'input.js', includeContent: true }); const smc = new SourceMapConsumer(map); let loc; loc = smc.originalPositionFor({ line: 1, column: 9 }); assert.equal(loc.name, 'one'); loc = smc.originalPositionFor({ line: 2, column: 9 }); assert.equal(loc.name, 'two'); }); it('should exclude sources without filename from sourcemap', () => { const b = new MagicString.Bundle(); const one = new MagicString('function one () {}', { filename: 'one.js' }); const two = new MagicString('function two () {}', { filename: null }); const three = new MagicString('function three () {}', { filename: 'three.js' }); b.addSource(one); b.addSource(two); b.addSource(three); const map = b.generateMap({ file: 'output.js', source: 'input.js', includeContent: true }); const smc = new SourceMapConsumer(map); let loc; loc = smc.originalPositionFor({ line: 1, column: 9 }); assert.equal(loc.source, 'one.js'); loc = smc.originalPositionFor({ line: 2, column: 9 }); assert.equal(loc.source, null); loc = smc.originalPositionFor({ line: 3, column: 9 }); assert.equal(loc.source, 'three.js'); }); it('should generate x_google_ignoreList correctly', () => { const b = new MagicString.Bundle(); const one = new MagicString('function one () {}', { filename: 'one.js' }); const two = new MagicString('function two () {}', { filename: 'two.js' }); const three = new MagicString('function three () {}', { filename: 'three.js' }); const four = new MagicString('function four () {}', { filename: 'four.js' }); b.addSource({ content: one, ignoreList: false }); b.addSource({ content: two, ignoreList: true }); b.addSource({ content: three, ignoreList: true }); b.addSource({ content: four }); const map = b.generateMap({ file: 'output.js' }); assert.deepEqual(map.x_google_ignoreList, [ map.sources.indexOf('two.js'), map.sources.indexOf('three.js') ]); }); it('handles prepended content', () => { const b = new MagicString.Bundle(); const one = new MagicString('function one () {}', { filename: 'one.js' }); const two = new MagicString('function two () {}', { filename: 'two.js' }); two.prepend('function oneAndAHalf() {}\n'); b.addSource(one); b.addSource(two); const map = b.generateMap({ file: 'output.js', source: 'input.js', includeContent: true }); const smc = new SourceMapConsumer(map); let loc; loc = smc.originalPositionFor({ line: 1, column: 9 }); assert.equal(loc.source, 'one.js'); loc = smc.originalPositionFor({ line: 3, column: 9 }); assert.equal(loc.source, 'two.js'); }); it('handles appended content', () => { const b = new MagicString.Bundle(); const one = new MagicString('function one () {}', { filename: 'one.js' }); one.append('\nfunction oneAndAHalf() {}'); const two = new MagicString('function two () {}', { filename: 'two.js' }); b.addSource(one); b.addSource(two); const map = b.generateMap({ file: 'output.js', source: 'input.js', includeContent: true }); const smc = new SourceMapConsumer(map); let loc; loc = smc.originalPositionFor({ line: 1, column: 9 }); assert.equal(loc.source, 'one.js'); loc = smc.originalPositionFor({ line: 3, column: 9 }); assert.equal(loc.source, 'two.js'); }); it('should handle empty separator', () => { const b = new MagicString.Bundle({ separator: '' }); b.addSource({ content: new MagicString('if ( foo ) { ') }); const s = new MagicString('console.log( 42 );'); s.addSourcemapLocation(8); s.addSourcemapLocation(15); b.addSource({ filename: 'input.js', content: s }); b.addSource({ content: new MagicString(' }') }); assert.equal(b.toString(), 'if ( foo ) { console.log( 42 ); }'); const map = b.generateMap({ file: 'output.js', source: 'input.js', includeContent: true }); const smc = new SourceMapConsumer(map); const loc = smc.originalPositionFor({ line: 1, column: 21 }); assert.deepEqual(loc, { source: 'input.js', name: null, line: 1, column: 8 }); }); // TODO tidy this up. is a recreation of a bug in Svelte it('generates a correct sourcemap for a Svelte component', () => { const b = new MagicString.Bundle({ separator: '' }); const s = new MagicString(`
`.trim()); [21, 23, 38, 42, 50, 51, 54, 59, 66, 67, 70, 72, 74, 76, 77, 81, 84, 85].forEach(pos => { s.addSourcemapLocation(pos); }); s.remove(0, 21); s.overwrite(23, 38, 'return '); s.prependRight(21, 'var template = (function () {'); s.appendLeft(85, '}());'); s.overwrite(85, 94, ''); b.addSource({ content: s, filename: 'input.js' }); assert.equal(b.toString(), ` var template = (function () { return { onrender () { console.log( 42 ); } } }());`.trim()); const map = b.generateMap({ file: 'output.js', source: 'input.js', includeContent: true }); const smc = new SourceMapConsumer(map); const loc = smc.originalPositionFor({ line: 4, column: 16 }); assert.deepEqual(loc, { source: 'input.js', name: null, line: 6, column: 16 }); }); }); describe('indent', () => { it('should indent a bundle', () => { const b = new MagicString.Bundle(); b.addSource({ content: new MagicString('abcdef') }); b.addSource({ content: new MagicString('ghijkl') }); b.indent().prepend('>>>\n').append('\n<<<'); assert.equal(b.toString(), '>>>\n\tabcdef\n\tghijkl\n<<<'); }); it('should ignore non-indented sources when guessing indentation', () => { const b = new MagicString.Bundle(); b.addSource({ content: new MagicString('abcdef') }); b.addSource({ content: new MagicString('ghijkl') }); b.addSource({ content: new MagicString(' mnopqr') }); b.indent(); assert.equal(b.toString(), ' abcdef\n ghijkl\n mnopqr'); }); it('should respect indent exclusion ranges', () => { const b = new MagicString.Bundle(); b.addSource({ content: new MagicString('abc\ndef\nghi\njkl'), indentExclusionRanges: [7, 15] }); b.indent(' '); assert.equal(b.toString(), ' abc\n def\nghi\njkl'); b.indent('>>'); assert.equal(b.toString(), '>> abc\n>> def\nghi\njkl'); }); it('does not indent sources with no preceding newline, i.e. append()', () => { const b = new MagicString.Bundle(); b.addSource(new MagicString('abcdef')); b.addSource(new MagicString('ghijkl')); b.prepend('>>>').append('<<<').indent(); assert.equal(b.toString(), '\t>>>abcdef\n\tghijkl<<<'); }); it('should noop with an empty string', () => { const b = new MagicString.Bundle(); b.addSource(new MagicString('abcdef')); b.addSource(new MagicString('ghijkl')); b.indent(''); assert.equal(b.toString(), 'abcdef\nghijkl'); }); it('indents prepended content', () => { const b = new MagicString.Bundle(); b.prepend('a\nb').indent(); assert.equal(b.toString(), '\ta\n\tb'); }); it('indents content immediately following intro with trailing newline', () => { const b = new MagicString.Bundle({ separator: '\n\n' }); const s = new MagicString('2'); b.addSource({ content: s }); b.prepend('1\n'); assert.equal(b.indent().toString(), '\t1\n\t2'); }); it('should return this', () => { const b = new MagicString.Bundle(); assert.strictEqual(b.indent(), b); }); it('should return this on noop', () => { const b = new MagicString.Bundle(); assert.strictEqual(b.indent(''), b); }); }); describe('prepend', () => { it('should append content', () => { const b = new MagicString.Bundle(); b.addSource({ content: new MagicString('*') }); b.prepend('123').prepend('456'); assert.equal(b.toString(), '456123*'); }); it('should return this', () => { const b = new MagicString.Bundle(); assert.strictEqual(b.prepend('x'), b); }); }); describe('trim', () => { it('should trim bundle', () => { const b = new MagicString.Bundle(); b.addSource({ content: new MagicString(' abcdef ') }); b.addSource({ content: new MagicString(' ghijkl ') }); b.trim(); assert.equal(b.toString(), 'abcdef \n ghijkl'); }); it('should handle funky edge cases', () => { const b = new MagicString.Bundle(); b.addSource({ content: new MagicString(' abcdef ') }); b.addSource({ content: new MagicString(' x ') }); b.prepend('\n>>>\n').append(' '); b.trim(); assert.equal(b.toString(), '>>>\n abcdef \n x'); }); it('should return this', () => { const b = new MagicString.Bundle(); assert.strictEqual(b.trim(), b); }); }); describe('toString', () => { it('should separate with a newline by default', () => { const b = new MagicString.Bundle(); b.addSource(new MagicString('abc')); b.addSource(new MagicString('def')); assert.strictEqual(b.toString(), 'abc\ndef'); }); it('should accept separator option', () => { const b = new MagicString.Bundle({ separator: '==' }); b.addSource(new MagicString('abc')); b.addSource(new MagicString('def')); assert.strictEqual(b.toString(), 'abc==def'); }); it('should accept empty string separator option', () => { const b = new MagicString.Bundle({ separator: '' }); b.addSource(new MagicString('abc')); b.addSource(new MagicString('def')); assert.strictEqual(b.toString(), 'abcdef'); }); }); describe('mappings', () => { it('should produce correct mappings after remove and move in multiple sources', () => { const s1 = 'ABCDE'; const ms1 = new MagicString(s1, { filename: 'first' }); const s2 = 'VWXYZ'; const ms2 = new MagicString(s2, { filename: 'second' }); const bundle = new MagicString.Bundle(); bundle.addSource(ms1); bundle.addSource(ms2); ms1.remove(2,4); // ABE ms1.move(0, 1, 5); // BEA ms2.remove(2,4); // VWZ ms2.move(0, 1, 5); // WZV const map = bundle.generateMap({file: 'result', hires: true, includeContent: true}); const smc = new SourceMapConsumer(map); const result1 = ms1.toString(); assert.strictEqual(result1, 'BEA'); const result2 = ms2.toString(); assert.strictEqual(result2, 'WZV'); assert.strictEqual(bundle.toString(), 'BEA\nWZV'); // B = B // E = E // A = A let line = 1; for (let i = 0; i < result1.length; i++) { const loc = smc.originalPositionFor({ line, column: i }); assert.strictEqual(s1[loc.column], result1[i]); } // W = W // Z = Z // V = V line = 2; for (let i = 0; i < result2.length; i++) { const loc = smc.originalPositionFor({ line, column: i }); assert.strictEqual(s2[loc.column], result2[i]); } assert.strictEqual(map.toString(), '{"version":3,"file":"result","sources":["first","second"],"sourcesContent":["ABCDE","VWXYZ"],"names":[],"mappings":"AAAC,CAAG,CAAJ;ACAC,CAAG,CAAJ"}'); }); }); }); magic-string-0.30.10/test/MagicString.SourceMap.js000066400000000000000000000017021460774323400216720ustar00rootroot00000000000000const assert = require('assert'); const MagicString = require('../'); require('source-map-support').install(); describe('MagicString.SourceMap', () => { describe('options', () => { it('preserves ignore list information', () => { const map = new MagicString.SourceMap({ file: 'foo.min.js', sources: ['foo.js'], sourcesContent: ['42'], names: [], mappings: [[0, 0]], x_google_ignoreList: [0] }); assert.deepEqual(map.x_google_ignoreList, [0]); }); }); describe('toString', () => { it('serializes ignore list information', () => { const map = new MagicString.SourceMap({ file: 'foo.min.js', sources: ['foo.js'], sourcesContent: ['42'], names: [], mappings: [[0, 0]], x_google_ignoreList: [0] }); assert.equal(map.toString(), '{"version":3,"file":"foo.min.js","sources":["foo.js"],"sourcesContent":["42"],"names":[],"mappings":"AAAAA,AAAAA","x_google_ignoreList":[0]}'); }); }); }); magic-string-0.30.10/test/MagicString.js000066400000000000000000001435001460774323400200000ustar00rootroot00000000000000const assert = require('assert'); const SourceMapConsumer = require('source-map-js').SourceMapConsumer; const MagicString = require('./utils/IntegrityCheckingMagicString'); require('source-map-support').install(); describe('MagicString', () => { describe('options', () => { it('stores source file information', () => { const s = new MagicString('abc', { filename: 'foo.js' }); assert.equal(s.filename, 'foo.js'); }); it('stores ignore-list hint', () => { const s = new MagicString('abc', { ignoreList: true }); assert.equal(s.ignoreList, true); }); }); describe('append', () => { it('should append content', () => { const s = new MagicString('abcdefghijkl'); s.append('xyz'); assert.equal(s.toString(), 'abcdefghijklxyz'); s.append('xyz'); assert.equal(s.toString(), 'abcdefghijklxyzxyz'); }); it('should return this', () => { const s = new MagicString('abcdefghijkl'); assert.strictEqual(s.append('xyz'), s); }); it('should throw when given non-string content', () => { const s = new MagicString(''); assert.throws(() => s.append([]), TypeError); }); }); describe('(ap|pre)pend(Left|Right)', () => { it('preserves intended order', () => { const s = new MagicString('0123456789'); s.appendLeft(5, 'A'); s.prependRight(5, 'a'); s.prependRight(5, 'b'); s.appendLeft(5, 'B'); s.appendLeft(5, 'C'); s.prependRight(5, 'c'); assert.equal(s.toString(), '01234ABCcba56789'); assert.equal(s.slice(0, 5), '01234ABC'); assert.equal(s.slice(5), 'cba56789'); s.prependLeft(5, '<'); s.prependLeft(5, '{'); assert.equal(s.toString(), '01234{'); s.appendRight(5, '}'); assert.equal(s.toString(), '01234{}56789'); s.appendLeft(5, '('); s.appendLeft(5, '['); assert.equal(s.toString(), '01234{}56789'); s.prependRight(5, ')'); s.prependRight(5, ']'); assert.equal(s.toString(), '01234{}56789'); assert.equal(s.slice(0, 5), '01234{}56789'); }); it('preserves intended order at beginning of string', () => { const s = new MagicString('x'); s.appendLeft(0, '1'); s.prependLeft(0, '2'); s.appendLeft(0, '3'); s.prependLeft(0, '4'); assert.equal(s.toString(), '4213x'); }); it('preserves intended order at end of string', () => { const s = new MagicString('x'); s.appendRight(1, '1'); s.prependRight(1, '2'); s.appendRight(1, '3'); s.prependRight(1, '4'); assert.equal(s.toString(), 'x4213'); }); }); describe('appendLeft', () => { it('should return this', () => { const s = new MagicString('abcdefghijkl'); assert.strictEqual(s.appendLeft(0, 'a'), s); }); }); describe('appendRight', () => { it('should return this', () => { const s = new MagicString('abcdefghijkl'); assert.strictEqual(s.appendRight(0, 'a'), s); }); }); describe('clone', () => { it('should clone a magic string', () => { const s = new MagicString('abcdefghijkl'); s.overwrite(3, 9, 'XYZ'); const c = s.clone(); assert.notEqual(s, c); assert.equal(c.toString(), 'abcXYZjkl'); }); it('should clone filename info', () => { const s = new MagicString('abcdefghijkl', { filename: 'foo.js' }); const c = s.clone(); assert.equal(c.filename, 'foo.js'); }); it('should clone indentExclusionRanges', () => { const array = [3, 6]; const source = new MagicString('abcdefghijkl', { filename: 'foo.js', indentExclusionRanges: array }); const clone = source.clone(); assert.notStrictEqual(source.indentExclusionRanges, clone.indentExclusionRanges); assert.deepEqual(source.indentExclusionRanges, clone.indentExclusionRanges); }); it('should clone complex indentExclusionRanges', () => { const array = [[3, 6], [7, 9]]; const source = new MagicString('abcdefghijkl', { filename: 'foo.js', indentExclusionRanges: array }); const clone = source.clone(); assert.notStrictEqual(source.indentExclusionRanges, clone.indentExclusionRanges); assert.deepEqual(source.indentExclusionRanges, clone.indentExclusionRanges); }); it('should clone sourcemapLocations', () => { const source = new MagicString('abcdefghijkl', { filename: 'foo.js' }); source.addSourcemapLocation(3); const clone = source.clone(); assert.notStrictEqual(source.sourcemapLocations, clone.sourcemapLocations); assert.deepEqual(source.sourcemapLocations, clone.sourcemapLocations); }); it('should clone intro and outro', () => { const source = new MagicString('defghi'); source.prepend('abc'); source.append('jkl'); const clone = source.clone(); assert.equal(source.toString(), clone.toString()); }); }); describe('generateMap', () => { it('should generate a sourcemap', () => { const s = new MagicString('abcdefghijkl').remove(3, 9); const map = s.generateMap({ file: 'output.md', source: 'input.md', includeContent: true, hires: true }); assert.equal(map.version, 3); assert.equal(map.file, 'output.md'); assert.deepEqual(map.sources, ['input.md']); assert.deepEqual(map.sourcesContent, ['abcdefghijkl']); assert.equal(map.mappings, 'AAAA,CAAC,CAAC,CAAO,CAAC,CAAC'); assert.equal(map.toString(), '{"version":3,"file":"output.md","sources":["input.md"],"sourcesContent":["abcdefghijkl"],"names":[],"mappings":"AAAA,CAAC,CAAC,CAAO,CAAC,CAAC"}'); assert.equal(map.toUrl(), 'data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3V0cHV0Lm1kIiwic291cmNlcyI6WyJpbnB1dC5tZCJdLCJzb3VyY2VzQ29udGVudCI6WyJhYmNkZWZnaGlqa2wiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsQ0FBQyxDQUFDLENBQU8sQ0FBQyxDQUFDIn0='); const smc = new SourceMapConsumer(map); let loc; loc = smc.originalPositionFor({ line: 1, column: 0 }); assert.equal(loc.line, 1); assert.equal(loc.column, 0); loc = smc.originalPositionFor({ line: 1, column: 1 }); assert.equal(loc.line, 1); assert.equal(loc.column, 1); loc = smc.originalPositionFor({ line: 1, column: 4 }); assert.equal(loc.line, 1); assert.equal(loc.column, 10); }); it('should generate a correct sourcemap for prepend content when hires = false', () => { const s = new MagicString('x\nq'); s.prepend('y\n'); const map = s.generateMap({ includeContent: true, }); assert.equal(map.mappings,';AAAA;AACA'); }); it('should generate a correct sourcemap for indented content', () => { const s = new MagicString('var answer = 42;\nconsole.log("the answer is %s", answer);'); s.prepend('\'use strict\';\n\n'); s.indent('\t').prepend('(function () {\n').append('\n}).call(global);'); const map = s.generateMap({ source: 'input.md', includeContent: true, hires: true }); const smc = new SourceMapConsumer(map); const originLoc = smc.originalPositionFor({ line: 5, column: 1 }); assert.equal(originLoc.line, 2); assert.equal(originLoc.column, 0); }); it('should generate a sourcemap using specified locations', () => { const s = new MagicString('abcdefghijkl'); s.addSourcemapLocation(0); s.addSourcemapLocation(3); s.addSourcemapLocation(10); s.remove(6, 9); const map = s.generateMap({ file: 'output.md', source: 'input.md', includeContent: true }); assert.equal(map.version, 3); assert.equal(map.file, 'output.md'); assert.deepEqual(map.sources, ['input.md']); assert.deepEqual(map.sourcesContent, ['abcdefghijkl']); assert.equal(map.toString(), '{"version":3,"file":"output.md","sources":["input.md"],"sourcesContent":["abcdefghijkl"],"names":[],"mappings":"AAAA,GAAG,GAAM,CAAC"}'); assert.equal(map.toUrl(), 'data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3V0cHV0Lm1kIiwic291cmNlcyI6WyJpbnB1dC5tZCJdLCJzb3VyY2VzQ29udGVudCI6WyJhYmNkZWZnaGlqa2wiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsR0FBRyxHQUFNLENBQUMifQ=='); const smc = new SourceMapConsumer(map); let loc; loc = smc.originalPositionFor({ line: 1, column: 0 }); assert.equal(loc.line, 1); assert.equal(loc.column, 0); loc = smc.originalPositionFor({ line: 1, column: 3 }); assert.equal(loc.line, 1); assert.equal(loc.column, 3); loc = smc.originalPositionFor({ line: 1, column: 7 }); assert.equal(loc.line, 1); assert.equal(loc.column, 10); }); it('should correctly map inserted content', () => { const s = new MagicString('function Foo () {}'); s.overwrite(9, 12, 'Bar'); const map = s.generateMap({ file: 'output.js', source: 'input.js', includeContent: true }); const smc = new SourceMapConsumer(map); const loc = smc.originalPositionFor({ line: 1, column: 9 }); assert.equal(loc.line, 1); assert.equal(loc.column, 9); }); it('should yield consistent results between appendLeft and prependRight', () => { const s1 = new MagicString('abcdefghijkl'); s1.appendLeft(6, 'X'); const s2 = new MagicString('abcdefghijkl'); s2.prependRight(6, 'X'); const m1 = s1.generateMap({ file: 'output', source: 'input', includeContent: true }); const m2 = s2.generateMap({ file: 'output', source: 'input', includeContent: true }); assert.deepEqual(m1, m2); }); it('should recover original names', () => { const s = new MagicString('function Foo () {}'); s.overwrite(9, 12, 'Bar', { storeName: true }); const map = s.generateMap({ file: 'output.js', source: 'input.js', includeContent: true }); const smc = new SourceMapConsumer(map); const loc = smc.originalPositionFor({ line: 1, column: 9 }); assert.equal(loc.name, 'Foo'); }); it('should generate one segment per replacement', () => { const s = new MagicString('var answer = 42'); s.overwrite(4, 10, 'number', { storeName: true }); const map = s.generateMap({ file: 'output.js', source: 'input.js', includeContent: true }); const smc = new SourceMapConsumer(map); let numMappings = 0; smc.eachMapping(() => numMappings += 1); assert.equal(numMappings, 3); // one at 0, one at the edit, one afterwards }); it('should generate a sourcemap that correctly locates moved content', () => { const s = new MagicString('abcdefghijkl'); s.move(3, 6, 9); const result = s.toString(); const map = s.generateMap({ file: 'output.js', source: 'input.js', includeContent: true, hires: true }); const smc = new SourceMapConsumer(map); 'abcdefghijkl'.split('').forEach((letter, i) => { const column = result.indexOf(letter); const loc = smc.originalPositionFor({ line: 1, column }); assert.equal(loc.line, 1); assert.equal(loc.column, i); }); }); it('generates a map with trimmed content (#53)', () => { const s1 = new MagicString('abcdefghijkl ').trim(); const map1 = s1.generateMap({ file: 'output', source: 'input', includeContent: true, hires: true }); const smc1 = new SourceMapConsumer(map1); const loc1 = smc1.originalPositionFor({ line: 1, column: 11 }); assert.equal(loc1.column, 11); const s2 = new MagicString(' abcdefghijkl').trim(); const map2 = s2.generateMap({ file: 'output', source: 'input', includeContent: true, hires: true }); const smc2 = new SourceMapConsumer(map2); const loc2 = smc2.originalPositionFor({ line: 1, column: 1 }); assert.equal(loc2.column, 2); }); it('skips empty segments at the start', () => { const s = new MagicString('abcdefghijkl'); s.remove(0, 3).remove(3, 6); const map = s.generateMap(); const smc = new SourceMapConsumer(map); const loc = smc.originalPositionFor({ line: 1, column: 6 }); assert.equal(loc.column, 6); }); it('skips indentation at the start', () => { const s = new MagicString('abcdefghijkl'); s.indent(' '); const map = s.generateMap(); assert.equal(map.mappings, 'IAAA'); }); it('generates x_google_ignoreList', () => { const s = new MagicString('function foo(){}', { ignoreList: true }); const map = s.generateMap({ source: 'foo.js' }); assert.deepEqual(map.sources, ['foo.js']); assert.deepEqual(map.x_google_ignoreList, [0]); }); it('generates segments per word boundary with hires "boundary"', () => { const s = new MagicString('function foo(){ console.log("bar") }'); // rename bar to hello s.overwrite(29, 32, 'hello'); const map = s.generateMap({ file: 'output.js', source: 'input.js', includeContent: true, hires: 'boundary' }); assert.equal(map.mappings, 'AAAA,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAG,CAAC,CAAC,CAAC'); const smc = new SourceMapConsumer(map); let loc; loc = smc.originalPositionFor({ line: 1, column: 3 }); assert.equal(loc.line, 1); assert.equal(loc.column, 0); loc = smc.originalPositionFor({ line: 1, column: 11 }); assert.equal(loc.line, 1); assert.equal(loc.column, 9); loc = smc.originalPositionFor({ line: 1, column: 29 }); assert.equal(loc.line, 1); assert.equal(loc.column, 29); loc = smc.originalPositionFor({ line: 1, column: 35 }); assert.equal(loc.line, 1); assert.equal(loc.column, 33); }); it('generates a correct source map with update using a content containing a new line', () => { const s = new MagicString('foobar'); s.update(3, 4, '\nbb'); assert.equal(s.toString(), 'foo\nbbar'); const map = s.generateMap({ hires: true }); const smc = new SourceMapConsumer(map); const loc = smc.originalPositionFor({ line: 1, column: 3 }); assert.equal(loc.line, 1); assert.equal(loc.column, 3); const loc2 = smc.originalPositionFor({ line: 2, column: 0 }); assert.equal(loc2.line, 1); assert.equal(loc2.column, 3); const loc3 = smc.originalPositionFor({ line: 2, column: 1 }); assert.equal(loc3.line, 1); assert.equal(loc3.column, 3); const loc4 = smc.originalPositionFor({ line: 2, column: 2 }); assert.equal(loc4.line, 1); assert.equal(loc4.column, 4); }); it('generates a correct source map with update using content ending with a new line', () => { const s = new MagicString('foobar'); s.update(2, 3, 'od\n'); s.update(4, 5, 'a\nnd\n'); assert.equal(s.toString(), 'food\nba\nnd\nr'); const map = s.generateMap({ hires: true }); const smc = new SourceMapConsumer(map); // od\n const loc = smc.originalPositionFor({ line: 1, column: 3 }); assert.equal(loc.line, 1); assert.equal(loc.column, 2); const loc2 = smc.originalPositionFor({ line: 1, column: 4 }); assert.equal(loc2.line, 1); assert.equal(loc2.column, 2); const loc3 = smc.originalPositionFor({ line: 2, column: 0 }); assert.equal(loc3.line, 1); assert.equal(loc3.column, 3); const loc4 = smc.originalPositionFor({ line: 2, column: 1 }); assert.equal(loc4.line, 1); assert.equal(loc4.column, 4); // a\nnd\n const loc5 = smc.originalPositionFor({ line: 2, column: 2 }); assert.equal(loc5.line, 1); assert.equal(loc5.column, 4); const loc6 = smc.originalPositionFor({ line: 2, column: 3 }); assert.equal(loc6.line, 1); assert.equal(loc6.column, 4); const loc7 = smc.originalPositionFor({ line: 3, column: 0 }); assert.equal(loc7.line, 1); assert.equal(loc7.column, 4); const loc8 = smc.originalPositionFor({ line: 4, column: 0 }); assert.equal(loc8.line, 1); assert.equal(loc8.column, 5); }); }); describe('getIndentString', () => { it('should guess the indent string', () => { const s = new MagicString('abc\n def\nghi'); assert.equal(s.getIndentString(), ' '); }); it('should return a tab if no lines are indented', () => { const s = new MagicString('abc\ndef\nghi'); assert.equal(s.getIndentString(), '\t'); }); }); describe('indent', () => { it('should indent content with a single tab character by default', () => { const s = new MagicString('abc\ndef\nghi\njkl'); s.indent(); assert.equal(s.toString(), '\tabc\n\tdef\n\tghi\n\tjkl'); s.indent(); assert.equal(s.toString(), '\t\tabc\n\t\tdef\n\t\tghi\n\t\tjkl'); }); it('should indent content, using existing indentation as a guide', () => { const s = new MagicString('abc\n def\n ghi\n jkl'); s.indent(); assert.equal(s.toString(), ' abc\n def\n ghi\n jkl'); s.indent(); assert.equal(s.toString(), ' abc\n def\n ghi\n jkl'); }); it('should disregard single-space indentation when auto-indenting', () => { const s = new MagicString('abc\n/**\n *comment\n */'); s.indent(); assert.equal(s.toString(), '\tabc\n\t/**\n\t *comment\n\t */'); }); it('should indent content using the supplied indent string', () => { const s = new MagicString('abc\ndef\nghi\njkl'); s.indent(' '); assert.equal(s.toString(), ' abc\n def\n ghi\n jkl'); s.indent('>>'); assert.equal(s.toString(), '>> abc\n>> def\n>> ghi\n>> jkl'); }); it('should indent content using the empty string if specified (i.e. noop)', () => { const s = new MagicString('abc\ndef\nghi\njkl'); s.indent(''); assert.equal(s.toString(), 'abc\ndef\nghi\njkl'); }); it('should prevent excluded characters from being indented', () => { const s = new MagicString('abc\ndef\nghi\njkl'); s.indent(' ', { exclude: [7, 15] }); assert.equal(s.toString(), ' abc\n def\nghi\njkl'); s.indent('>>', { exclude: [7, 15] }); assert.equal(s.toString(), '>> abc\n>> def\nghi\njkl'); }); it('should not add characters to empty lines', () => { const s = new MagicString('\n\nabc\ndef\n\nghi\njkl'); s.indent(); assert.equal(s.toString(), '\n\n\tabc\n\tdef\n\n\tghi\n\tjkl'); s.indent(); assert.equal(s.toString(), '\n\n\t\tabc\n\t\tdef\n\n\t\tghi\n\t\tjkl'); }); it('should not add characters to empty lines, even on Windows', () => { const s = new MagicString('\r\n\r\nabc\r\ndef\r\n\r\nghi\r\njkl'); s.indent(); assert.equal(s.toString(), '\r\n\r\n\tabc\r\n\tdef\r\n\r\n\tghi\r\n\tjkl'); s.indent(); assert.equal(s.toString(), '\r\n\r\n\t\tabc\r\n\t\tdef\r\n\r\n\t\tghi\r\n\t\tjkl'); }); it('should indent content with removals', () => { const s = new MagicString('/* remove this line */\nvar foo = 1;'); s.remove(0, 23); s.indent(); assert.equal(s.toString(), '\tvar foo = 1;'); }); it('should not indent patches in the middle of a line', () => { const s = new MagicString('class Foo extends Bar {}'); s.overwrite(18, 21, 'Baz'); assert.equal(s.toString(), 'class Foo extends Baz {}'); s.indent(); assert.equal(s.toString(), '\tclass Foo extends Baz {}'); }); it('should return this', () => { const s = new MagicString('abcdefghijkl'); assert.strictEqual(s.indent(), s); }); it('should return this on noop', () => { const s = new MagicString('abcdefghijkl'); assert.strictEqual(s.indent(''), s); }); }); describe('insert', () => { it('is deprecated', () => { const s = new MagicString('abcdefghijkl'); assert.throws(() => s.insert(6, 'X'), /deprecated/); }); // TODO move this into prependRight and appendLeft tests // it( 'should insert characters in the correct location', () => { // const s = new MagicString( 'abcdefghijkl' ); // // s.insert( 0, '>>>' ); // s.insert( 6, '***' ); // s.insert( 12, '<<<' ); // // assert.equal( s.toString(), '>>>abcdef***ghijkl<<<' ); // }); // // it( 'should return this', () => { // const s = new MagicString( 'abcdefghijkl' ); // assert.strictEqual( s.insert( 0, 'a' ), s ); // }); // // it( 'should insert repeatedly at the same position correctly', () => { // const s = new MagicString( 'ab' ); // assert.equal( s.insert(1, '1').toString(), 'a1b' ); // assert.equal( s.insert(1, '2').toString(), 'a12b' ); // }); // // it( 'should insert repeatedly at the beginning correctly', () => { // const s = new MagicString( 'ab' ); // assert.equal( s.insert(0, '1').toString(), '1ab' ); // assert.equal( s.insert(0, '2').toString(), '12ab' ); // }); // // it( 'should throw when given non-string content', () => { // const s = new MagicString( '' ); // assert.throws( // function () { s.insert( 0, [] ); }, // TypeError // ); // }); // // it( 'should allow inserting after removed range', () => { // const s = new MagicString( 'abcd' ); // s.remove( 1, 2 ); // s.insert( 2, 'z' ); // assert.equal( s.toString(), 'azcd' ); // }); }); describe('move', () => { it('moves content from the start', () => { const s = new MagicString('abcdefghijkl'); s.move(0, 3, 6); assert.equal(s.toString(), 'defabcghijkl'); }); it('moves content to the start', () => { const s = new MagicString('abcdefghijkl'); s.move(3, 6, 0); assert.equal(s.toString(), 'defabcghijkl'); }); it('moves content from the end', () => { const s = new MagicString('abcdefghijkl'); s.move(9, 12, 6); assert.equal(s.toString(), 'abcdefjklghi'); }); it('moves content to the end', () => { const s = new MagicString('abcdefghijkl'); s.move(6, 9, 12); assert.equal(s.toString(), 'abcdefjklghi'); }); it('ignores redundant move', () => { const s = new MagicString('abcdefghijkl'); s.prependRight(9, 'X'); s.move(9, 12, 6); s.appendLeft(12, 'Y'); s.move(6, 9, 12); // this is redundant – [6,9] is already after [9,12] assert.equal(s.toString(), 'abcdefXjklYghi'); }); it('moves content to the middle', () => { const s = new MagicString('abcdefghijkl'); s.move(3, 6, 9); assert.equal(s.toString(), 'abcghidefjkl'); }); it('handles multiple moves of the same snippet', () => { const s = new MagicString('abcdefghijkl'); s.move(0, 3, 6); assert.equal(s.toString(), 'defabcghijkl'); s.move(0, 3, 9); assert.equal(s.toString(), 'defghiabcjkl'); }); it('handles moves of adjacent snippets', () => { const s = new MagicString('abcdefghijkl'); s.move(0, 2, 6); assert.equal(s.toString(), 'cdefabghijkl'); s.move(2, 4, 6); assert.equal(s.toString(), 'efabcdghijkl'); }); it('handles moves to same index', () => { const s = new MagicString('abcdefghijkl'); s.move(0, 2, 6).move(3, 5, 6); assert.equal(s.toString(), 'cfabdeghijkl'); }); it('refuses to move a selection to inside itself', () => { const s = new MagicString('abcdefghijkl'); assert.throws(() => s.move(3, 6, 3), /Cannot move a selection inside itself/); assert.throws(() => s.move(3, 6, 4), /Cannot move a selection inside itself/); assert.throws(() => s.move(3, 6, 6), /Cannot move a selection inside itself/); }); it('allows edits of moved content', () => { const s1 = new MagicString('abcdefghijkl'); s1.move(3, 6, 9); s1.overwrite(3, 6, 'DEF'); assert.equal(s1.toString(), 'abcghiDEFjkl'); const s2 = new MagicString('abcdefghijkl'); s2.move(3, 6, 9); s2.overwrite(4, 5, 'E'); assert.equal(s2.toString(), 'abcghidEfjkl'); }); // it( 'move follows inserts', () => { // const s = new MagicString( 'abcdefghijkl' ); // // s.appendLeft( 3, 'X' ).move( 6, 9, 3 ); // assert.equal( s.toString(), 'abcXghidefjkl' ); // }); // // it( 'inserts follow move', () => { // const s = new MagicString( 'abcdefghijkl' ); // // s.insert( 3, 'X' ).move( 6, 9, 3 ).insert( 3, 'Y' ); // assert.equal( s.toString(), 'abcXghiYdefjkl' ); // }); // // it( 'discards inserts at end of move by default', () => { // const s = new MagicString( 'abcdefghijkl' ); // // s.insert( 6, 'X' ).move( 3, 6, 9 ); // assert.equal( s.toString(), 'abcXghidefjkl' ); // }); it('moves content inserted at end of range', () => { const s = new MagicString('abcdefghijkl'); s.appendLeft(6, 'X').move(3, 6, 9); assert.equal(s.toString(), 'abcghidefXjkl'); }); it('returns this', () => { const s = new MagicString('abcdefghijkl'); assert.strictEqual(s.move(3, 6, 9), s); }); }); describe('overwrite', () => { it('should replace characters', () => { const s = new MagicString('abcdefghijkl'); s.overwrite(5, 8, 'FGH'); assert.equal(s.toString(), 'abcdeFGHijkl'); }); it('should throw an error if overlapping replacements are attempted', () => { const s = new MagicString('abcdefghijkl'); s.overwrite(7, 11, 'xx'); assert.throws(() => s.overwrite(8, 12, 'yy'), /Cannot split a chunk that has already been edited/); assert.equal(s.toString(), 'abcdefgxxl'); s.overwrite(6, 12, 'yes'); assert.equal(s.toString(), 'abcdefyes'); }); it('should allow contiguous but non-overlapping replacements', () => { const s = new MagicString('abcdefghijkl'); s.overwrite(3, 6, 'DEF'); assert.equal(s.toString(), 'abcDEFghijkl'); s.overwrite(6, 9, 'GHI'); assert.equal(s.toString(), 'abcDEFGHIjkl'); s.overwrite(0, 3, 'ABC'); assert.equal(s.toString(), 'ABCDEFGHIjkl'); s.overwrite(9, 12, 'JKL'); assert.equal(s.toString(), 'ABCDEFGHIJKL'); }); it('does not replace zero-length inserts at overwrite start location', () => { const s = new MagicString('abcdefghijkl'); s.remove(0, 6); s.appendLeft(6, 'DEF'); s.overwrite(6, 9, 'GHI'); assert.equal(s.toString(), 'DEFGHIjkl'); }); it('replaces zero-length inserts inside overwrite', () => { const s = new MagicString('abcdefghijkl'); s.appendLeft(6, 'XXX'); s.overwrite(3, 9, 'DEFGHI'); assert.equal(s.toString(), 'abcDEFGHIjkl'); }); it('replaces non-zero-length inserts inside overwrite', () => { const s = new MagicString('abcdefghijkl'); s.overwrite(3, 4, 'XXX'); s.overwrite(3, 5, 'DE'); assert.equal(s.toString(), 'abcDEfghijkl'); s.overwrite(7, 8, 'YYY'); s.overwrite(6, 8, 'GH'); assert.equal(s.toString(), 'abcDEfGHijkl'); }); it('should return this', () => { const s = new MagicString('abcdefghijkl'); assert.strictEqual(s.overwrite(3, 4, 'D'), s); }); it('should disallow overwriting zero-length ranges', () => { const s = new MagicString('x'); assert.throws(() => s.overwrite(0, 0, 'anything'), /Cannot overwrite a zero-length range – use appendLeft or prependRight instead/); }); it('should throw when given non-string content', () => { const s = new MagicString(''); assert.throws(() => s.overwrite(0, 1, []), TypeError); }); it('replaces interior inserts', () => { const s = new MagicString('abcdefghijkl'); s.appendLeft(1, '&'); s.prependRight(1, '^'); s.appendLeft(3, '!'); s.prependRight(3, '?'); s.overwrite(1, 3, '...'); assert.equal(s.toString(), 'a&...?defghijkl'); }); it('preserves interior inserts with `contentOnly: true`', () => { const s = new MagicString('abcdefghijkl'); s.appendLeft(1, '&'); s.prependRight(1, '^'); s.appendLeft(3, '!'); s.prependRight(3, '?'); s.overwrite(1, 3, '...', { contentOnly: true }); assert.equal(s.toString(), 'a&^...!?defghijkl'); }); it('disallows overwriting partially overlapping moved content', () => { const s = new MagicString('abcdefghijkl'); s.move(6, 9, 3); assert.throws(() => s.overwrite(5, 7, 'XX'), /Cannot overwrite across a split point/); }); it('disallows overwriting fully surrounding content moved away', () => { const s = new MagicString('abcdefghijkl'); s.move(6, 9, 3); assert.throws(() => s.overwrite(4, 11, 'XX'), /Cannot overwrite across a split point/); }); it('disallows overwriting fully surrounding content moved away even if there is another split', () => { const s = new MagicString('abcdefghijkl'); s.move(6, 9, 3); s.appendLeft(5, 'foo'); assert.throws(() => s.overwrite(4, 11, 'XX'), /Cannot overwrite across a split point/); }); it('allows later insertions at the end', () => { const s = new MagicString('abcdefg'); s.appendLeft(4, '('); s.overwrite(2, 7, ''); s.appendLeft(7, 'h'); assert.equal(s.toString(), 'abh'); }); }); describe('update', () => { it('should replace characters', () => { const s = new MagicString('abcdefghijkl'); s.update(5, 8, 'FGH'); assert.equal(s.toString(), 'abcdeFGHijkl'); }); it('should throw an error if overlapping replacements are attempted', () => { const s = new MagicString('abcdefghijkl'); s.update(7, 11, 'xx'); assert.throws(() => s.update(8, 12, 'yy'), /Cannot split a chunk that has already been edited/); assert.equal(s.toString(), 'abcdefgxxl'); s.update(6, 12, 'yes'); assert.equal(s.toString(), 'abcdefyes'); }); it('should allow contiguous but non-overlapping replacements', () => { const s = new MagicString('abcdefghijkl'); s.update(3, 6, 'DEF'); assert.equal(s.toString(), 'abcDEFghijkl'); s.update(6, 9, 'GHI'); assert.equal(s.toString(), 'abcDEFGHIjkl'); s.update(0, 3, 'ABC'); assert.equal(s.toString(), 'ABCDEFGHIjkl'); s.update(9, 12, 'JKL'); assert.equal(s.toString(), 'ABCDEFGHIJKL'); }); it('does not replace zero-length inserts at update start location', () => { const s = new MagicString('abcdefghijkl'); s.remove(0, 6); s.appendLeft(6, 'DEF'); s.update(6, 9, 'GHI'); assert.equal(s.toString(), 'DEFGHIjkl'); }); it('replaces zero-length inserts inside update with overwrite option', () => { const s = new MagicString('abcdefghijkl'); s.appendLeft(6, 'XXX'); s.update(3, 9, 'DEFGHI', { overwrite: true }); assert.equal(s.toString(), 'abcDEFGHIjkl'); }); it('replaces non-zero-length inserts inside update', () => { const s = new MagicString('abcdefghijkl'); s.update(3, 4, 'XXX'); s.update(3, 5, 'DE'); assert.equal(s.toString(), 'abcDEfghijkl'); s.update(7, 8, 'YYY'); s.update(6, 8, 'GH'); assert.equal(s.toString(), 'abcDEfGHijkl'); }); it('should return this', () => { const s = new MagicString('abcdefghijkl'); assert.strictEqual(s.update(3, 4, 'D'), s); }); it('should disallow updating zero-length ranges', () => { const s = new MagicString('x'); assert.throws(() => s.update(0, 0, 'anything'), /Cannot overwrite a zero-length range – use appendLeft or prependRight instead/); }); it('should throw when given non-string content', () => { const s = new MagicString(''); assert.throws(() => s.update(0, 1, []), TypeError); }); it('replaces interior inserts with overwrite option', () => { const s = new MagicString('abcdefghijkl'); s.appendLeft(1, '&'); s.prependRight(1, '^'); s.appendLeft(3, '!'); s.prependRight(3, '?'); s.update(1, 3, '...', { overwrite: true }); assert.equal(s.toString(), 'a&...?defghijkl'); }); it('preserves interior inserts with `contentOnly: true`', () => { const s = new MagicString('abcdefghijkl'); s.appendLeft(1, '&'); s.prependRight(1, '^'); s.appendLeft(3, '!'); s.prependRight(3, '?'); s.update(1, 3, '...', { contentOnly: true }); assert.equal(s.toString(), 'a&^...!?defghijkl'); }); it('disallows overwriting partially overlapping moved content', () => { const s = new MagicString('abcdefghijkl'); s.move(6, 9, 3); assert.throws(() => s.update(5, 7, 'XX'), /Cannot overwrite across a split point/); }); it('disallows overwriting fully surrounding content moved away', () => { const s = new MagicString('abcdefghijkl'); s.move(6, 9, 3); assert.throws(() => s.update(4, 11, 'XX'), /Cannot overwrite across a split point/); }); it('disallows overwriting fully surrounding content moved away even if there is another split', () => { const s = new MagicString('abcdefghijkl'); s.move(6, 9, 3); s.appendLeft(5, 'foo'); assert.throws(() => s.update(4, 11, 'XX'), /Cannot overwrite across a split point/); }); it('allows later insertions at the end with overwrite option', () => { const s = new MagicString('abcdefg'); s.appendLeft(4, '('); s.update(2, 7, '', { overwrite: true }); s.appendLeft(7, 'h'); assert.equal(s.toString(), 'abh'); }); }); describe('prepend', () => { it('should prepend content', () => { const s = new MagicString('abcdefghijkl'); s.prepend('xyz'); assert.equal(s.toString(), 'xyzabcdefghijkl'); s.prepend('123'); assert.equal(s.toString(), '123xyzabcdefghijkl'); }); it('should return this', () => { const s = new MagicString('abcdefghijkl'); assert.strictEqual(s.prepend('xyz'), s); }); }); describe('prependLeft', () => { it('should return this', () => { const s = new MagicString('abcdefghijkl'); assert.strictEqual(s.prependLeft(0, 'a'), s); }); }); describe('prependRight', () => { it('should return this', () => { const s = new MagicString('abcdefghijkl'); assert.strictEqual(s.prependRight(0, 'a'), s); }); }); describe('remove', () => { it('should remove characters from the original string', () => { const s = new MagicString('abcdefghijkl'); s.remove(1, 5); assert.equal(s.toString(), 'afghijkl'); s.remove(9, 12); assert.equal(s.toString(), 'afghi'); }); it('should remove from the start', () => { const s = new MagicString('abcdefghijkl'); s.remove(0, 6); assert.equal(s.toString(), 'ghijkl'); }); it('should remove from the end', () => { const s = new MagicString('abcdefghijkl'); s.remove(6, 12); assert.equal(s.toString(), 'abcdef'); }); it('should treat zero-length removals as a no-op', () => { const s = new MagicString('abcdefghijkl'); s.remove(0, 0).remove(6, 6).remove(9, -3); assert.equal(s.toString(), 'abcdefghijkl'); }); it('should remove overlapping ranges', () => { const s1 = new MagicString('abcdefghijkl'); s1.remove(3, 7).remove(5, 9); assert.equal(s1.toString(), 'abcjkl'); const s2 = new MagicString('abcdefghijkl'); s2.remove(3, 7).remove(4, 6); assert.equal(s2.toString(), 'abchijkl'); }); it('should remove overlapping ranges, redux', () => { const s = new MagicString('abccde'); s.remove(2, 3); // c s.remove(1, 3); // bc assert.equal(s.toString(), 'acde'); }); it('should remove modified ranges', () => { const s = new MagicString('abcdefghi'); s.overwrite(3, 6, 'DEF'); s.remove(2, 7); // cDEFg assert.equal(s.slice(1, 8), 'bh'); assert.equal(s.toString(), 'abhi'); }); it('should not remove content inserted after the end of removed range', () => { const s = new MagicString('ab.c;'); s.prependRight(0, '('); s.prependRight(4, ')'); s.remove(2, 4); assert.equal(s.toString(), '(ab);'); }); it('should remove interior inserts', () => { const s = new MagicString('abc;'); s.appendLeft(1, '['); s.prependRight(1, '('); s.appendLeft(2, ')'); s.prependRight(2, ']'); s.remove(1, 2); assert.equal(s.toString(), 'a[]c;'); }); it('should provide a useful error when illegal removals are attempted', () => { const s = new MagicString('abcdefghijkl'); s.overwrite(5, 7, 'XX'); assert.throws(() => s.remove(4, 6), /Cannot split a chunk that has already been edited/); }); it('should return this', () => { const s = new MagicString('abcdefghijkl'); assert.strictEqual(s.remove(3, 4), s); }); it('removes across moved content', () => { const s = new MagicString('abcdefghijkl'); s.move(6, 9, 3); s.remove(5, 7); assert.equal(s.toString(), 'abchidejkl'); }); }); describe('reset', () => { it('should reset moved characters from the original string', () => { const s = new MagicString('abcdefghijkl'); s.remove(1, 5); s.reset(2, 4); assert.equal(s.toString(), 'acdfghijkl'); s.reset(4, 5); assert.equal(s.toString(), 'acdefghijkl'); }); it('should reset from the start', () => { const s = new MagicString('abcdefghijkl'); s.remove(0, 6); s.reset(0, 3); assert.equal(s.toString(), 'abcghijkl'); }); it('should reset from the end', () => { const s = new MagicString('abcdefghijkl'); s.remove(6, 12); s.reset(10, 12); assert.equal(s.toString(), 'abcdefkl'); }); it('should treat zero-length resets as a no-op', () => { const s = new MagicString('abcdefghijkl'); s.remove(3, 5); s.reset(0, 0).reset(6, 6).reset(9, -3); assert.equal(s.toString(), 'abcfghijkl'); }); it('should treat not modified resets as a no-op', () => { const s = new MagicString('abcdefghijkl'); s.reset(3, 5); assert.equal(s.toString(), 'abcdefghijkl'); }); it('should reset overlapping ranges', () => { const s1 = new MagicString('abcdefghijkl'); s1.remove(0, 10); s1.reset(1, 7).reset(5, 9); assert.equal(s1.toString(), 'bcdefghikl'); const s2 = new MagicString('abcdefghijkl'); s2.remove(0, 10); s2.reset(3, 7).reset(4, 6); assert.equal(s2.toString(), 'defgkl'); }); it('should reset overlapping ranges, redux', () => { const s = new MagicString('abccde'); s.remove(0, 6); s.reset(2, 3); // c s.reset(1, 3); // bc assert.equal(s.toString(), 'bc'); }); it('should reset modified ranges', () => { const s = new MagicString('abcdefghi'); s.overwrite(3, 6, 'DEF'); s.remove(1, 8); // bcDEFgh s.reset(2, 7); // cDEFg assert.equal(s.slice(1, 8), 'cdefg'); assert.equal(s.toString(), 'acdefgi'); }); it('should reset modified ranges, redux', () => { const s = new MagicString('abcdefghi'); s.remove(1, 8); s.appendLeft(2, 'W'); s.appendRight(2, 'X'); s.prependLeft(3, 'Y'); s.prependRight(5, 'Z'); s.reset(2, 7); assert.equal(s.toString(), 'aWcdefgi'); }); it('should not reset content inserted after the end of range', () => { const s = new MagicString('ab.c;'); s.prependRight(0, '('); s.prependRight(4, ')'); s.remove(1, 4); s.reset(2, 4); assert.equal(s.toString(), '(a.c);'); }); it('should provide a useful error when illegal removals are attempted', () => { const s = new MagicString('abcdefghijkl'); s.remove(4, 8); s.overwrite(5, 7, 'XX'); assert.throws(() => s.reset(4, 6), /Cannot split a chunk that has already been edited/); }); it('should return this', () => { const s = new MagicString('abcdefghijkl'); s.remove(2, 5); assert.strictEqual(s.reset(3, 4), s); }); it('removes across moved content', () => { const s = new MagicString('abcdefghijkl'); s.remove(5, 8); s.move(6, 9, 3); s.reset(7, 8); assert.equal(s.toString(), 'abchidejkl'); }); }); describe('slice', () => { it('should return the generated content between the specified original characters', () => { const s = new MagicString('abcdefghijkl'); assert.equal(s.slice(3, 9), 'defghi'); s.overwrite(4, 8, 'XX'); assert.equal(s.slice(3, 9), 'dXXi'); s.overwrite(2, 10, 'ZZ'); assert.equal(s.slice(1, 11), 'bZZk'); assert.equal(s.slice(2, 10), 'ZZ'); assert.throws(() => s.slice(3, 9)); }); it('defaults `end` to the original string length', () => { const s = new MagicString('abcdefghijkl'); assert.equal(s.slice(3), 'defghijkl'); }); it('allows negative numbers as arguments', () => { const s = new MagicString('abcdefghijkl'); assert.equal(s.slice(-3), 'jkl'); assert.equal(s.slice(0, -3), 'abcdefghi'); }); it('includes inserted characters, respecting insertion direction', () => { const s = new MagicString('abefij'); s.prependRight(2, 'cd'); s.appendLeft(4, 'gh'); assert.equal(s.slice(), 'abcdefghij'); assert.equal(s.slice(1, 5), 'bcdefghi'); assert.equal(s.slice(2, 4), 'cdefgh'); assert.equal(s.slice(3, 4), 'fgh'); assert.equal(s.slice(0, 2), 'ab'); assert.equal(s.slice(0, 3), 'abcde'); assert.equal(s.slice(4, 6), 'ij'); assert.equal(s.slice(3, 6), 'fghij'); }); it('supports characters moved outward', () => { const s = new MagicString('abcdEFghIJklmn'); s.move(4, 6, 2); s.move(8, 10, 12); assert.equal(s.toString(), 'abEFcdghklIJmn'); assert.equal(s.slice(1, -1), 'bEFcdghklIJm'); assert.equal(s.slice(2, -2), 'cdghkl'); assert.equal(s.slice(3, -3), 'dghk'); assert.equal(s.slice(4, -4), 'EFcdghklIJ'); assert.equal(s.slice(5, -5), 'FcdghklI'); assert.equal(s.slice(6, -6), 'gh'); }); it('supports characters moved inward', () => { const s = new MagicString('abCDefghijKLmn'); s.move(2, 4, 6); s.move(10, 12, 8); assert.equal(s.toString(), 'abefCDghKLijmn'); assert.equal(s.slice(1, -1), 'befCDghKLijm'); assert.equal(s.slice(2, -2), 'CDghKL'); assert.equal(s.slice(3, -3), 'DghK'); assert.equal(s.slice(4, -4), 'efCDghKLij'); assert.equal(s.slice(5, -5), 'fCDghKLi'); assert.equal(s.slice(6, -6), 'gh'); }); it('supports characters moved opposing', () => { const s = new MagicString('abCDefghIJkl'); s.move(2, 4, 8); s.move(8, 10, 4); assert.equal(s.toString(), 'abIJefghCDkl'); assert.equal(s.slice(1, -1), 'bIJefghCDk'); assert.equal(s.slice(2, -2), ''); assert.equal(s.slice(3, -3), ''); assert.equal(s.slice(-3, 3), 'JefghC'); assert.equal(s.slice(4, -4), 'efgh'); assert.equal(s.slice(0, 3), 'abIJefghC'); assert.equal(s.slice(3), 'Dkl'); assert.equal(s.slice(0, -3), 'abI'); assert.equal(s.slice(-3), 'JefghCDkl'); }); it('errors if replaced characters are used as slice anchors', () => { const s = new MagicString('abcdef'); s.overwrite(2, 4, 'CD'); assert.throws(() => s.slice(2, 3), /slice end anchor/); assert.throws(() => s.slice(3, 4), /slice start anchor/); assert.throws(() => s.slice(3, 5), /slice start anchor/); assert.equal(s.slice(1, 5), 'bCDe'); }); it('does not error if slice is after removed characters', () => { const s = new MagicString('abcdef'); s.remove(0, 2); assert.equal(s.slice(2, 4), 'cd'); }); }); describe('snip', () => { it('should return a clone with content outside `start` and `end` removed', () => { const s = new MagicString('abcdefghijkl', { filename: 'foo.js' }); s.overwrite(6, 9, 'GHI'); const snippet = s.snip(3, 9); assert.equal(snippet.toString(), 'defGHI'); assert.equal(snippet.filename, 'foo.js'); }); it('should snip from the start', () => { const s = new MagicString('abcdefghijkl'); const snippet = s.snip(0, 6); assert.equal(snippet.toString(), 'abcdef'); }); it('should snip from the end', () => { const s = new MagicString('abcdefghijkl'); const snippet = s.snip(6, 12); assert.equal(snippet.toString(), 'ghijkl'); }); it('should respect original indices', () => { const s = new MagicString('abcdefghijkl'); const snippet = s.snip(3, 9); snippet.overwrite(6, 9, 'GHI'); assert.equal(snippet.toString(), 'defGHI'); }); }); describe('trim', () => { it('should trim original content', () => { assert.equal(new MagicString(' abcdefghijkl ').trim().toString(), 'abcdefghijkl'); assert.equal(new MagicString(' abcdefghijkl').trim().toString(), 'abcdefghijkl'); assert.equal(new MagicString('abcdefghijkl ').trim().toString(), 'abcdefghijkl'); }); it('should trim replaced content', () => { const s = new MagicString('abcdefghijkl'); s.overwrite(0, 3, ' ').overwrite(9, 12, ' ').trim(); assert.equal(s.toString(), 'defghi'); }); it('should trim replaced content with end space', () => { const s = new MagicString(' test '); s.overwrite(2, 6, 'abcd '); s.trimEnd(); assert.equal(s.toString(), ' abcd'); }); it('should trim replaced content with start space', () => { const s = new MagicString(' test '); s.overwrite(0, 6, ' abcd'); s.trimStart(); assert.equal(s.toString(), 'abcd '); }); it('should trim replaced content with start space', () => { const s = new MagicString(' test '); s.overwrite(0, 8, ' abcd '); s.trim(); assert.equal(s.toString(), 'abcd'); }); it('should trim original content before replaced content', () => { const s = new MagicString('abc def'); s.remove(6, 9); assert.equal(s.toString(), 'abc '); s.trim(); assert.equal(s.toString(), 'abc'); }); it('should trim original content after replaced content', () => { const s = new MagicString('abc def'); s.remove(0, 3); assert.equal(s.toString(), ' def'); s.trim(); assert.equal(s.toString(), 'def'); }); it('should trim original content before and after replaced content', () => { const s = new MagicString('abc def ghi'); s.remove(0, 3); s.remove(12, 15); assert.equal(s.toString(), ' def '); s.trim(); assert.equal(s.toString(), 'def'); }); it('should trim appended/prepended content', () => { const s = new MagicString(' abcdefghijkl '); s.prepend(' ').append(' ').trim(); assert.equal(s.toString(), 'abcdefghijkl'); }); it('should trim empty string', () => { const s = new MagicString(' '); assert.equal(s.trim().toString(), ''); }); it('should return this', () => { const s = new MagicString(' abcdefghijkl '); assert.strictEqual(s.trim(), s); }); it('should support trimming chunks with intro and outro', () => { const s = new MagicString(' \n'); s.appendRight(4, 'test'); assert.strictEqual(s.trim().toString(), 'test'); }); }); describe('trimLines', () => { it('should trim original content', () => { const s = new MagicString('\n\n abcdefghijkl \n\n'); s.trimLines(); assert.equal(s.toString(), ' abcdefghijkl '); }); }); describe('isEmpty', () => { it('should support isEmpty', () => { const s = new MagicString(' abcde fghijkl '); assert.equal(s.isEmpty(), false); s.prepend(' '); s.append(' '); s.remove(1, 6); s.remove(9, 15); assert.equal(s.isEmpty(), false); s.remove(15, 16); assert.equal(s.isEmpty(), true); }); }); describe('length', () => { it('should support length', () => { const s = new MagicString(' abcde fghijkl '); assert.equal(s.length(), 17); s.prepend(' '); s.append(' '); s.remove(1, 6); s.remove(9, 15); assert.equal(s.length(), 6); s.remove(15, 16); assert.equal(s.length(), 5); }); }); describe('lastLine', () => { it('should support lastLine', () => { const s = new MagicString(' abcde\nfghijkl '); assert.equal(s.lastLine(), 'fghijkl '); s.prepend(' '); s.append(' '); s.remove(1, 6); s.remove(9, 15); assert.equal(s.lastLine(), 'fg '); s.overwrite(7, 8, '\n'); assert.equal(s.lastLine(), 'g '); s.append('\n//lastline'); assert.equal(s.lastLine(), '//lastline'); }); }); describe('hasChanged', () => { it('should works', () => { const s = new MagicString(' abcde fghijkl '); assert.ok(!s.hasChanged()); assert.ok(s.clone().prepend(' ').hasChanged()); assert.ok(s.clone().overwrite(1, 2, 'b').hasChanged()); assert.ok(s.clone().remove(1, 6).hasChanged()); s.trim(); assert.ok(s.hasChanged()); const clone = s.clone(); assert.ok(clone.hasChanged()); }); }); describe('replace', () => { it('works with string replace', () => { const code = '1 2 1 2'; const s = new MagicString(code); s.replace('2', '3'); assert.strictEqual(s.toString(), '1 3 1 2'); }); it('Should not treat string as regexp', () => { assert.strictEqual( new MagicString('1234').replace('.', '*').toString(), '1234' ); }); it('Should use substitution directly', () => { assert.strictEqual( new MagicString('11').replace('1', '$0$1').toString(), '$0$11' ); }); it('Should not search back', () => { assert.strictEqual( new MagicString('122121').replace('12', '21').toString(), '212121' ); }); it('works with global regex replace', () => { const s = new MagicString('1 2 3 4 a b c'); s.replace(/(\d)/g, 'xx$1$10'); assert.strictEqual(s.toString(), 'xx1$10 xx2$10 xx3$10 xx4$10 a b c'); }); it('works with global regex replace $$', () => { const s = new MagicString('1 2 3 4 a b c'); s.replace(/(\d)/g, '$$'); assert.strictEqual(s.toString(),'$ $ $ $ a b c'); }); it('works with global regex replace function', () => { const code = 'hey this is magic'; const s = new MagicString(code); s.replace(/(\w)(\w+)/g, (_, $1, $2) => `${$1.toUpperCase()}${$2}`); assert.strictEqual(s.toString(),'Hey This Is Magic'); }); it('replace function offset', () => { // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_function_as_a_parameter function replacer(match, p1, p2, p3, offset, string, groups) { // p1 is nondigits, p2 digits, and p3 non-alphanumerics return [match, p1, p2, p3, offset, string, groups].join(' - '); } const code = 'abc12345#$*%'; const regex = /([^\d]*)(\d*)([^\w]*)/; assert.strictEqual( code.replace(regex, replacer), new MagicString(code).replace(regex, replacer).toString() ); }); it('should ignore non-changed replacements', () => { const code = 'a12bc345#$*%'; const matched = []; const s = new MagicString(code); assert.strictEqual(s.firstChunk, s.lastChunk); s.replace(/(\d)/g, (match, $1) => { matched.push($1); return match; }); assert.strictEqual(s.toString(), code); assert.deepStrictEqual(matched, ['1', '2', '3', '4', '5']); assert.strictEqual(s.firstChunk, s.lastChunk); }); }); describe('replaceAll', () => { it('works with string replace', () => { assert.strictEqual( new MagicString('1212').replaceAll('2', '3').toString(), '1313', ); }); it('Should not treat string as regexp', () => { assert.strictEqual( new MagicString('1234').replaceAll('.', '*').toString(), '1234' ); }); it('Should use substitution directly', () => { assert.strictEqual( new MagicString('11').replaceAll('1', '$0$1').toString(), '$0$1$0$1' ); }); it('Should not search back', () => { assert.strictEqual( new MagicString('121212').replaceAll('12', '21').toString(), '212121' ); }); it('global regex result the same as .replace', () => { assert.strictEqual( new MagicString('1 2 3 4 a b c').replaceAll(/(\d)/g, 'xx$1$10').toString(), new MagicString('1 2 3 4 a b c').replace(/(\d)/g, 'xx$1$10').toString(), ); assert.strictEqual( new MagicString('1 2 3 4 a b c').replaceAll(/(\d)/g, '$$').toString(), new MagicString('1 2 3 4 a b c').replace(/(\d)/g, '$$').toString(), ); assert.strictEqual( new MagicString('hey this is magic').replaceAll(/(\w)(\w+)/g, (_, $1, $2) => `${$1.toUpperCase()}${$2}`).toString(), new MagicString('hey this is magic').replace(/(\w)(\w+)/g, (_, $1, $2) => `${$1.toUpperCase()}${$2}`).toString(), ); }); it('rejects with non-global regexp', () => { assert.throws( () => new MagicString('123').replaceAll(/./, ''), { name: 'TypeError', message: 'MagicString.prototype.replaceAll called with a non-global RegExp argument', }, ); }); }); }); magic-string-0.30.10/test/utils/000077500000000000000000000000001460774323400163705ustar00rootroot00000000000000magic-string-0.30.10/test/utils/IntegrityCheckingMagicString.js000066400000000000000000000024731460774323400244760ustar00rootroot00000000000000const MagicString = require('../../'); const assert = require('assert'); class IntegrityCheckingMagicString extends MagicString { checkIntegrity() { let prevChunk = null; let chunk = this.firstChunk; let numNodes = 0; while (chunk) { assert.strictEqual(this.byStart[chunk.start], chunk); assert.strictEqual(this.byEnd[chunk.end], chunk); assert.strictEqual(chunk.previous, prevChunk); if (prevChunk) { assert.strictEqual(prevChunk.next, chunk); } prevChunk = chunk; chunk = chunk.next; numNodes++; } assert.strictEqual(prevChunk, this.lastChunk); assert.strictEqual(this.lastChunk.next, null); assert.strictEqual(Object.keys(this.byStart).length, numNodes); assert.strictEqual(Object.keys(this.byEnd).length, numNodes); } } for (const key in MagicString.prototype) { // eslint-disable-next-line no-prototype-builtins if (!MagicString.prototype.hasOwnProperty(key)) { continue; } const func = MagicString.prototype[key]; if (typeof func === 'function') { IntegrityCheckingMagicString.prototype[key] = function () { const result = func.apply(this, arguments); try { this.checkIntegrity(); } catch (e) { e.message = `Integrity error after invoking ${key}:\n${e.message}`; throw e; } return result; }; } } module.exports = IntegrityCheckingMagicString;