├── .gitignore ├── .vscode └── settings.json ├── LICENSE ├── README.md ├── examples ├── .gitignore ├── README.md ├── nebu-get-imports │ ├── README.md │ ├── index.js │ ├── package.json │ └── script.js ├── nebu-strip-dev │ ├── README.md │ ├── package.json │ ├── script.js │ ├── src │ │ └── index.ts │ └── tsconfig.json ├── package.json ├── pnpm-lock.yaml └── try ├── package.json ├── pnpm-lock.yaml ├── scripts └── extractTypeGuards.js ├── spec ├── README.md ├── mutation.test.ts └── sourcemap.test.ts ├── src ├── MagicSlice.ts ├── Node.ts ├── NodeProperties.ts ├── Walker.ts ├── builtinHooks.ts ├── composite.ts ├── context.ts ├── hooks.ts ├── nebu.ts ├── replacers.ts ├── types.ts └── utils │ ├── greedyRange.ts │ └── index.ts ├── tsconfig.json ├── tsup.config.ts ├── utils.d.ts └── utils.js /.gitignore: -------------------------------------------------------------------------------- 1 | src/typeGuards.ts 2 | node_modules 3 | vendor 4 | dist 5 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.wordWrapColumn": 100 3 | } 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018-present Alec Larson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # nebu 2 | 3 | [![npm](https://img.shields.io/npm/v/nebu.svg)](https://www.npmjs.com/package/nebu) 4 | [![Code style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier) 5 | [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://paypal.me/alecdotbiz) 6 | 7 | Fast, extensible, statically typed, and light Javascript transformer. (pronounced `nee-boo`) 8 | 9 | **Why bother?** Nebu saves developers from the slow and heavy [Babel][1] compiler. Nebu skips AST-to-code generation, preferring simple string mutations, while keeping sourcemap support. This improves performance, preserves coding style, and makes plugins less clunky. 10 | 11 | If you need to transpile ES6+ to ES5, use [Bublé][2] *after* using Nebu. 12 | 13 | If you believe in Nebu's mission, consider building a Nebu plugin. The ecosystem is practically non-existent. It needs your help! 🤓 14 | 15 | **This is still experimental! Please report bugs and contribute if you can!** 🙂 16 | 17 | [1]: https://github.com/babel/babel 18 | [2]: https://github.com/Rich-Harris/buble 19 | 20 |   21 | 22 | ## Examples 23 | 24 | See the `examples` folder for plugin examples. 25 | 26 | You can test these examples like so: 27 | 28 | ```sh 29 | git clone https://github.com/alloc/nebu 30 | cd nebu && pnpm i 31 | cd examples && pnpm i 32 | ./try nebu-strip-dev 33 | ``` 34 | 35 |   36 | 37 | ## Usage 38 | 39 | ```js 40 | const nebu = require('nebu'); 41 | 42 | nebu.process(code, { 43 | ast: {}, // use an existing ESTree object 44 | plugins: [{ 45 | Identifier(node) { 46 | if (node.name == 'foo') { 47 | node.replace('bar') 48 | } 49 | } 50 | }], 51 | }) 52 | ``` 53 | 54 | The `process` function traverses the AST depth-first, which means children are 55 | visited before neighbors, and parents are visited before children. 56 | 57 | The `process` function has the following options: 58 | - `ast?: object` pre-existing ESTree object 59 | - `state?: object` state passed to each visitor 60 | - `plugins: object[]` array of visitor maps 61 | - `filename?: string` path to the source code 62 | - `sourceMap?: boolean | "inline"` sourcemap type 63 | - `sourceMapTarget?: string` sourcemap path (relative to `filename`) 64 | - `generatedFile?: string` path to the generated code 65 | - `includeContent?: boolean` include source content in sourcemap 66 | - `jsx?: boolean` enable JSX parsing 67 | 68 | The `plugins` array is required. Plugins are objects whose keys are ESTree node types and each value is a function that receives the node and shared state. The `plugins` array supports a plugin being wrapped in `{default: plugin}` for ESM interop. 69 | 70 | The `state` object is useful when a plugin analyzes the structure of your code and needs to communicate this information back to you. Another use case is inter-visitor communication. 71 | 72 | The `sourceMap` option defaults to false, so no sourcemap is generated. Setting `sourceMap` to `true` will generate a `SourceMap` object and return it as the `map` property of the result object. Setting `sourceMap` to `"inline"` will append a `//# sourceMappingURL` comment to the generated code. 73 | 74 | The `includeContent` option defaults to true. You must explicitly specify `false` to exclude source content from the sourcemap. 75 | 76 | ### Utilities 77 | 78 | The `nebu/utils` module exports a few utility functions you may find useful when developing a plugin. 79 | 80 | ```js 81 | import { findParent } from 'nebu/utils' 82 | ``` 83 | 84 | ## Node API 85 | 86 | Every node (except the root node) has these properties: 87 | - `parent: Node` the nearest container node 88 | - `ref: string` the parent property that contains us 89 | 90 | NOTE: Methods that take a `code` argument do *not* validate it for syntax errors. So be careful! 91 | 92 | ### isLiteral(type) 93 | 94 | Check if `node.type` equals `"Literal"` and `typeof node.value` equals the given string. 95 | 96 | ### toString() 97 | 98 | Slice the source code using `node.start` and `node.end` as boundaries. 99 | 100 | NOTE: This does *not* include mutations, so the return value is static. 101 | 102 | ### process(state, plugins) 103 | 104 | Process a node with a separate set of plugins. 105 | 106 | The `state` argument is optional. You may pass null or only the plugins array if your plugins are stateless. 107 | 108 | All changes are included in the result of `nebu.process`. 109 | 110 | The return value is the processed node. 111 | 112 | ### walk(prop, iter) 113 | 114 | Call the `iter` function for each child node that exists at the given property name. Before your function is called, the children have their `parent` and `ref` properties set accordingly. The `iter` argument is optional. 115 | 116 | ### yield(resume) 117 | 118 | Call the `resume` function after all children have been traversed. No arguments are passed. This method may be called multiple times, and by any other node. 119 | 120 | ### set(prop, code) 121 | 122 | Update some property of the node. 123 | 124 | Properties that typically equal a `Node` object or an array of `Node` objects should be compatible with this method. 125 | 126 | Improving the capability of this method is tracked by [#8](https://github.com/aleclarson/nebu/issues/8). 127 | 128 | ### push(prop, code) 129 | 130 | Append a string of code to an array of child nodes. 131 | 132 | ### unshift(prop, code) 133 | 134 | Prepend a string of code to an array of child nodes. 135 | 136 | ### splice(prop, index, n, code) 137 | 138 | Like `[].splice`, you can remove child nodes from an array, insert code at the given index, or both. 139 | 140 | The `n` argument indicates the number of children to remove. 141 | 142 | ### before(code) 143 | 144 | Insert code before the node. 145 | 146 | You should append a line break to `code` if you want it on a separate line. 147 | 148 | ### after(code) 149 | 150 | Insert code after the node. 151 | 152 | You should prepend a line break to `code` if you want it on a separate line. 153 | 154 | ### indent(depth) 155 | 156 | Increase the node's indentation level. 157 | 158 | The tab/space width is auto-detected. 159 | 160 | The `depth` argument defaults to 1. 161 | 162 | ### dedent(depth) 163 | 164 | Decrease the node's indentation level. 165 | 166 | The tab/space width is auto-detected. 167 | 168 | The `depth` argument defaults to 1. 169 | 170 | ### replace(code) 171 | 172 | Replace the node with a string of code. 173 | 174 | ### remove(prop) 175 | 176 | Remove some property of the node. 177 | 178 | When `prop` is undefined, remove the node entirely. 179 | -------------------------------------------------------------------------------- /examples/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules/ 2 | -------------------------------------------------------------------------------- /examples/README.md: -------------------------------------------------------------------------------- 1 | # Example plugins 2 | 3 | This directory contains practical plugin examples to learn from. 4 | 5 | If you have a unique plugin example, please submit a pull request! 6 | 7 | If your plugin example *should* work, but implementation bugs are blocking it, please submit a pull request! I will merge it (if you wish) once it works as expected (ie: the bugs get fixed). Your example will be useful while working on fixes. Otherwise, you can just submit a test case for each bug you're running into. 8 | 9 | -------------------------------------------------------------------------------- /examples/nebu-get-imports/README.md: -------------------------------------------------------------------------------- 1 | # nebu-get-imports 2 | 3 | Collect dependencies of the given module. 4 | 5 | - uses the `state` object to store dependencies 6 | - uses the `yield` method to print dependencies at the end 7 | - uses the `before/after` methods to wrap `require` calls with a try statement 8 | - uses the `indent` method to indent `require` calls in their try statements 9 | 10 | ```sh 11 | ./try nebu-get-imports 12 | ``` 13 | 14 | `require` calls are wrapped with a try statement to avoid runtime errors. 15 | `import` statements are converted into comments to avoid runtime errors. 16 | -------------------------------------------------------------------------------- /examples/nebu-get-imports/index.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = { 3 | Program(node, state) { 4 | state.imports = []; 5 | node.yield(() => { 6 | // Print the imports once finished. 7 | process.nextTick(() => { 8 | inspect(state.imports); 9 | }); 10 | }); 11 | }, 12 | CallExpression(node, state) { 13 | if (node.callee.name == 'require') { 14 | let src = node.arguments[0]; 15 | if (src && src.isLiteral('string')) { 16 | state.imports.push({ 17 | es: false, 18 | ref: src.value, 19 | start: src.start, 20 | end: src.end, 21 | }); 22 | } 23 | 24 | // Wrap the entire variable declaration (if we're in one). 25 | while (/^Variable/.test(node.parent.type)) { 26 | node = node.parent; 27 | } 28 | node.before('try {\n'); 29 | node.indent(); 30 | node.after('\n} catch(e) {}'); 31 | } 32 | }, 33 | ImportDeclaration(node, state) { 34 | const src = node.source; 35 | if (src && src.isLiteral('string')) { 36 | state.imports.push({ 37 | es: true, 38 | ref: src.value, 39 | start: src.start, 40 | end: src.end, 41 | }); 42 | } 43 | // Remove for testing purposes. 44 | node.before('// '); 45 | } 46 | }; 47 | -------------------------------------------------------------------------------- /examples/nebu-get-imports/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nebu-get-imports", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /examples/nebu-get-imports/script.js: -------------------------------------------------------------------------------- 1 | 2 | // Namespace import 3 | import * as lodash from 'lodash'; 4 | 5 | // Default import 6 | import secrets from 'book-of-secrets'; 7 | 8 | // Dynamic import (not supported yet) 9 | // import('dynamo') 10 | 11 | // Static require 12 | const coffee = require('coffeescript'); 13 | 14 | // Dynamic require (not supported) 15 | require(__dirname + '/init'); 16 | -------------------------------------------------------------------------------- /examples/nebu-strip-dev/README.md: -------------------------------------------------------------------------------- 1 | # nebu-strip-dev 2 | 3 | A simple plugin that removes `process.env.NODE_ENV !== 'production'` blocks. 4 | 5 | - uses the `replace` method for multi-condition blocks 6 | - uses the `toString` method when moving conditional branches 7 | 8 | ```sh 9 | ./try nebu-strip-dev 10 | ``` 11 | -------------------------------------------------------------------------------- /examples/nebu-strip-dev/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nebu-strip-dev", 3 | "version": "0.1.0", 4 | "main": "dist/index.js" 5 | } 6 | -------------------------------------------------------------------------------- /examples/nebu-strip-dev/script.js: -------------------------------------------------------------------------------- 1 | 2 | if (process.env.NODE_ENV !== 'production') { 3 | throw Error('wtf'); 4 | } else { 5 | require('./production-only'); 6 | 7 | if (process.env.NODE_ENV !== 'production') { 8 | // This block *should* be removed, but isn't. 9 | } 10 | } 11 | 12 | // Works with != or !== operators. 13 | if (process.env.NODE_ENV != 'production') { 14 | throw Error('wtf'); 15 | } else if (true) { 16 | // This line will always be reached. 17 | } 18 | 19 | if (true) { 20 | // This line will always be reached. 21 | } else if (process.env.NODE_ENV !== 'production') { 22 | throw Error('wtf'); 23 | } else { 24 | // This block should *not* be removed, but is. 25 | } 26 | 27 | if (true && process.env.NODE_ENV !== 'production') { 28 | console.warn('true && NODE_ENV'); 29 | } else { 30 | // This line will always be reached. 31 | } 32 | 33 | if (process.env.NODE_ENV !== 'production' && true) { 34 | console.warn('NODE_ENV && true'); 35 | } else { 36 | // This line will always be reached. 37 | } 38 | 39 | if (true && process.env.NODE_ENV !== 'production' && true) { 40 | console.warn('true && NODE_ENV && true'); 41 | } else { 42 | // This line will always be reached. 43 | } 44 | 45 | if ((false || process.env.NODE_ENV !== 'production') && true) { 46 | console.warn('(false || NODE_ENV) && true'); 47 | } else { 48 | // This line will always be reached. 49 | } 50 | 51 | if (false || (process.env.NODE_ENV !== 'production' && true)) { 52 | console.warn('false || (NODE_ENV && true)'); 53 | } else { 54 | // This line will always be reached. 55 | } 56 | 57 | // Binding NODE_ENV is not supported (yet) 58 | const dev = process.env.NODE_ENV !== 'production'; 59 | if (dev) { 60 | console.warn('Bindings not supported'); 61 | } 62 | -------------------------------------------------------------------------------- /examples/nebu-strip-dev/src/index.ts: -------------------------------------------------------------------------------- 1 | import { Plugin, Node } from '../../..' 2 | 3 | // const re = /(^|(&&|\|\|) )process\.env\.NODE_ENV !==? ['"]production['"]/ 4 | 5 | export default { 6 | IfStatement(node) { 7 | let { test } = node 8 | if (isDevCondition(test)) { 9 | copyAlternate(node) 10 | // TODO: Add closing } when parent is an IfStatement. 11 | // TODO: Avoid removing alternates when parent is an IfStatement. 12 | node.remove() 13 | } else { 14 | findDevConditions(test) 15 | } 16 | }, 17 | } 18 | 19 | function isDevCondition(cond: Node.Expression) { 20 | return ( 21 | cond.isBinaryExpression() && 22 | cond.operator.startsWith('!=') && 23 | cond.right.isLiteral('string') && 24 | cond.right.value == 'production' && 25 | cond.left.toString() == 'process.env.NODE_ENV' 26 | ) 27 | } 28 | 29 | function copyAlternate(cond: Node.IfStatement) { 30 | const alt = cond.alternate 31 | if (!alt) return 32 | if (alt.isBlockStatement()) { 33 | if (alt.body.length) { 34 | // TODO: Preserve blank lines. 35 | alt.body.forEach(alt => { 36 | cond.after('\n' + alt.toString()) 37 | }) 38 | } 39 | } else { 40 | cond.after('\n' + alt.toString()) 41 | } 42 | } 43 | 44 | function findDevConditions(cond: Node.Expression) { 45 | while (cond.isLogicalExpression()) { 46 | // TODO: Remove branch if expression has only && operators. 47 | if (isDevCondition(cond.left)) { 48 | cond.left.replace('false') 49 | } else { 50 | findDevConditions(cond.left) 51 | } 52 | if (isDevCondition(cond.right)) { 53 | return cond.right.replace('false') 54 | } else { 55 | cond = cond.right 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /examples/nebu-strip-dev/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "include": ["src"], 4 | "exclude": [], 5 | "compilerOptions": { 6 | "outDir": "dist" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /examples/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nebu-examples", 3 | "dependencies": { 4 | "changed-lines": "^1.0.0", 5 | "nebu": "link:..", 6 | "typescript": "link:../node_modules/typescript" 7 | }, 8 | "devDependencies": { 9 | "kleur": "^4.1.4" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /examples/pnpm-lock.yaml: -------------------------------------------------------------------------------- 1 | dependencies: 2 | changed-lines: 1.0.0 3 | nebu: link:.. 4 | typescript: link:../node_modules/typescript 5 | devDependencies: 6 | kleur: 4.1.4 7 | lockfileVersion: 5.2 8 | packages: 9 | /changed-lines/1.0.0: 10 | dependencies: 11 | diff-sequences: 22.4.3 12 | dev: false 13 | resolution: 14 | integrity: sha512-lz1Jyw4/6BltfctUd8Ssrzcod9AYCkcaGqWFTPlEtK1kurntAdXVMZIiZwrI5VjFtE3n+qv/Ug6XC0ONFatmIQ== 15 | /diff-sequences/22.4.3: 16 | dev: false 17 | resolution: 18 | integrity: sha512-sMsQetU9mXqUEYpjCOavAKdEs0w1Qg9sbRlfVbaZUFnkJqm4iEQj0H4nocx8PMT+AnPKJW8C+xzU7LuO0s7c8Q== 19 | /kleur/4.1.4: 20 | dev: true 21 | engines: 22 | node: '>=6' 23 | resolution: 24 | integrity: sha512-8QADVssbrFjivHWQU7KkMgptGTl6WAcSdlbBPY4uNF+mWr6DGcKrvY2w4FQJoXch7+fKMjj0dRrL75vk3k23OA== 25 | specifiers: 26 | changed-lines: ^1.0.0 27 | kleur: ^4.1.4 28 | nebu: link:.. 29 | typescript: link:../node_modules/typescript 30 | -------------------------------------------------------------------------------- /examples/try: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | const { nebu } = require('nebu') 3 | 4 | let plugin = process.argv[2] 5 | if (!plugin.startsWith('nebu-')) { 6 | plugin = 'nebu-' + plugin 7 | } 8 | 9 | const fs = require('fs') 10 | const path = require('path') 11 | 12 | const script = path.resolve(plugin, 'script.js') 13 | const input = fs.readFileSync(script, 'utf8') 14 | 15 | // For debugging: 16 | const util = require('util') 17 | global.inspect = function (obj) { 18 | console.log(util.inspect(obj, false, 4, true) + '\n') 19 | } 20 | 21 | const { js: output } = nebu.process(input, { 22 | filename: script, 23 | plugins: [require('./' + plugin)], 24 | }) 25 | 26 | const k = require('kleur') 27 | 28 | // Print the diff before running. 29 | if (input !== output) { 30 | const diff = require('changed-lines') 31 | console.log(diff(input, output, k).join('\n')) 32 | } else { 33 | console.log(k.gray('No changes were made.')) 34 | } 35 | 36 | console.log('') 37 | console.log('Testing:', k.yellow(plugin)) 38 | console.log('') 39 | 40 | const vm = require('vm') 41 | vm.runInThisContext(output, { 42 | filename: script, 43 | displayErrors: true, 44 | }) 45 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nebu", 3 | "version": "2.5.2", 4 | "main": "dist/nebu.js", 5 | "exports": { 6 | ".": { 7 | "browser": "./dist/browser/nebu.mjs", 8 | "types": "./dist/nebu.d.ts", 9 | "default": "./dist/nebu.js" 10 | }, 11 | "./utils": { 12 | "browser": "./dist/browser/utils/index.mjs", 13 | "types": "./dist/utils/index.d.ts", 14 | "default": "./dist/utils/index.js" 15 | } 16 | }, 17 | "license": "MIT", 18 | "description": "Fast, extensible, and light Javascript transformer", 19 | "repository": "https://github.com/aleclarson/nebu.git", 20 | "prettier": "@alloc/prettier-config", 21 | "scripts": { 22 | "dev": "tsc -p . --watch --sourceMap --declarationMap", 23 | "build": "rimraf dist && node scripts/extractTypeGuards && concurrently -n node,browser,types 'pnpm run -s build:node' 'pnpm run -s build:browser' 'pnpm run -s build:types'", 24 | "build:node": "esbuild src/*.ts src/**/*.ts --bundle --splitting --format=esm --platform=node --main-fields=module,main --external:eslint-visitor-keys --external:magic-string --external:meriyah --outdir=dist && esbuild dist/*.js dist/**/*.js --format=cjs --platform=node --outdir=dist --allow-overwrite", 25 | "build:types": "tsc -p . --emitDeclarationOnly", 26 | "build:browser": "tsup", 27 | "prepare": "pnpm run -s build" 28 | }, 29 | "files": [ 30 | "dist", 31 | "utils.js", 32 | "utils.d.ts" 33 | ], 34 | "dependencies": { 35 | "@alloc/types": "^2.0.0", 36 | "eslint-visitor-keys": "^3.3.0", 37 | "magic-string": "^0.30.11", 38 | "meriyah": "^4.3.5" 39 | }, 40 | "devDependencies": { 41 | "@alloc/fast-rimraf": "^1.0.8", 42 | "@alloc/is": "^3.1.3", 43 | "@alloc/prettier-config": "^1.0.0", 44 | "@types/eslint-visitor-keys": "^1.0.0", 45 | "@types/node": "^14.14.35", 46 | "@types/resolve": "^1.20.6", 47 | "concurrently": "^8.2.2", 48 | "endent": "^2.1.0", 49 | "esbuild": "^0.20.1", 50 | "esbuild-plugin-alias": "^0.2.1", 51 | "path-browserify": "^1.0.1", 52 | "prettier": "^2.2.1", 53 | "resolve": "^1.22.8", 54 | "tsup": "^8.0.2", 55 | "typescript": "^5.3.3", 56 | "vitest": "^0.31.0" 57 | }, 58 | "engines": { 59 | "node": ">= 7.6.0" 60 | }, 61 | "pnpm": { 62 | "overrides": { 63 | "esbuild": "$esbuild" 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /pnpm-lock.yaml: -------------------------------------------------------------------------------- 1 | lockfileVersion: '9.0' 2 | 3 | settings: 4 | autoInstallPeers: true 5 | excludeLinksFromLockfile: false 6 | 7 | overrides: 8 | esbuild: ^0.20.1 9 | 10 | importers: 11 | 12 | .: 13 | dependencies: 14 | '@alloc/types': 15 | specifier: ^2.0.0 16 | version: 2.0.0 17 | eslint-visitor-keys: 18 | specifier: ^3.3.0 19 | version: 3.3.0 20 | magic-string: 21 | specifier: ^0.30.11 22 | version: 0.30.11 23 | meriyah: 24 | specifier: ^4.3.5 25 | version: 4.3.5 26 | devDependencies: 27 | '@alloc/fast-rimraf': 28 | specifier: ^1.0.8 29 | version: 1.0.8 30 | '@alloc/is': 31 | specifier: ^3.1.3 32 | version: 3.1.3 33 | '@alloc/prettier-config': 34 | specifier: ^1.0.0 35 | version: 1.0.0 36 | '@types/eslint-visitor-keys': 37 | specifier: ^1.0.0 38 | version: 1.0.0 39 | '@types/node': 40 | specifier: ^14.14.35 41 | version: 14.14.35 42 | '@types/resolve': 43 | specifier: ^1.20.6 44 | version: 1.20.6 45 | concurrently: 46 | specifier: ^8.2.2 47 | version: 8.2.2 48 | endent: 49 | specifier: ^2.1.0 50 | version: 2.1.0 51 | esbuild: 52 | specifier: ^0.20.1 53 | version: 0.20.1 54 | esbuild-plugin-alias: 55 | specifier: ^0.2.1 56 | version: 0.2.1 57 | path-browserify: 58 | specifier: ^1.0.1 59 | version: 1.0.1 60 | prettier: 61 | specifier: ^2.2.1 62 | version: 2.2.1 63 | resolve: 64 | specifier: ^1.22.8 65 | version: 1.22.8 66 | tsup: 67 | specifier: ^8.0.2 68 | version: 8.0.2(postcss@8.4.41)(typescript@5.3.3) 69 | typescript: 70 | specifier: ^5.3.3 71 | version: 5.3.3 72 | vitest: 73 | specifier: ^0.31.0 74 | version: 0.31.0 75 | 76 | packages: 77 | 78 | '@alloc/fast-rimraf@1.0.8': 79 | resolution: {integrity: sha512-TsRTRLLDW6Q4fWBAYlbkcaHQDAANKsI0smrhS/1x7/GHcjVxo+r+2VRbqrWaYpmjdhvCp5v7n2wtwkMYp+Kivw==} 80 | hasBin: true 81 | 82 | '@alloc/is@3.1.3': 83 | resolution: {integrity: sha512-85ISU73G0vPwUuSonwH1YhzfTtXVOqcG6rJSAuq9GdNhtEAABrIxLW6sOT5KHGoi08iW+sWxlECg9SxDRE1gaw==} 84 | 85 | '@alloc/prettier-config@1.0.0': 86 | resolution: {integrity: sha512-xm50V1qxSdTh1O1fKA+gqcU605YSnxfq6HwtYSFU3fRsKMFnUSuSOxqSAPI7y2sRxqPed2EIuGmNn107LVQM6g==} 87 | 88 | '@alloc/types@2.0.0': 89 | resolution: {integrity: sha512-C/sqk7V/tp0nlp59Kb+Eeg5YVlAcNR+ukWY2rzrWtifNLmDu/G383ZrmqFSl3Vxj73lvOZp/3O56kkboft1d7g==} 90 | 91 | '@babel/runtime@7.24.5': 92 | resolution: {integrity: sha512-Nms86NXrsaeU9vbBJKni6gXiEXZ4CVpYVzEjDH9Sb8vmZ3UljyA1GSOJl/6LGPO8EHLuSF9H+IxNXHPX8QHJ4g==} 93 | engines: {node: '>=6.9.0'} 94 | 95 | '@esbuild/aix-ppc64@0.20.1': 96 | resolution: {integrity: sha512-m55cpeupQ2DbuRGQMMZDzbv9J9PgVelPjlcmM5kxHnrBdBx6REaEd7LamYV7Dm8N7rCyR/XwU6rVP8ploKtIkA==} 97 | engines: {node: '>=12'} 98 | cpu: [ppc64] 99 | os: [aix] 100 | 101 | '@esbuild/android-arm64@0.20.1': 102 | resolution: {integrity: sha512-hCnXNF0HM6AjowP+Zou0ZJMWWa1VkD77BXe959zERgGJBBxB+sV+J9f/rcjeg2c5bsukD/n17RKWXGFCO5dD5A==} 103 | engines: {node: '>=12'} 104 | cpu: [arm64] 105 | os: [android] 106 | 107 | '@esbuild/android-arm@0.20.1': 108 | resolution: {integrity: sha512-4j0+G27/2ZXGWR5okcJi7pQYhmkVgb4D7UKwxcqrjhvp5TKWx3cUjgB1CGj1mfdmJBQ9VnUGgUhign+FPF2Zgw==} 109 | engines: {node: '>=12'} 110 | cpu: [arm] 111 | os: [android] 112 | 113 | '@esbuild/android-x64@0.20.1': 114 | resolution: {integrity: sha512-MSfZMBoAsnhpS+2yMFYIQUPs8Z19ajwfuaSZx+tSl09xrHZCjbeXXMsUF/0oq7ojxYEpsSo4c0SfjxOYXRbpaA==} 115 | engines: {node: '>=12'} 116 | cpu: [x64] 117 | os: [android] 118 | 119 | '@esbuild/darwin-arm64@0.20.1': 120 | resolution: {integrity: sha512-Ylk6rzgMD8klUklGPzS414UQLa5NPXZD5tf8JmQU8GQrj6BrFA/Ic9tb2zRe1kOZyCbGl+e8VMbDRazCEBqPvA==} 121 | engines: {node: '>=12'} 122 | cpu: [arm64] 123 | os: [darwin] 124 | 125 | '@esbuild/darwin-x64@0.20.1': 126 | resolution: {integrity: sha512-pFIfj7U2w5sMp52wTY1XVOdoxw+GDwy9FsK3OFz4BpMAjvZVs0dT1VXs8aQm22nhwoIWUmIRaE+4xow8xfIDZA==} 127 | engines: {node: '>=12'} 128 | cpu: [x64] 129 | os: [darwin] 130 | 131 | '@esbuild/freebsd-arm64@0.20.1': 132 | resolution: {integrity: sha512-UyW1WZvHDuM4xDz0jWun4qtQFauNdXjXOtIy7SYdf7pbxSWWVlqhnR/T2TpX6LX5NI62spt0a3ldIIEkPM6RHw==} 133 | engines: {node: '>=12'} 134 | cpu: [arm64] 135 | os: [freebsd] 136 | 137 | '@esbuild/freebsd-x64@0.20.1': 138 | resolution: {integrity: sha512-itPwCw5C+Jh/c624vcDd9kRCCZVpzpQn8dtwoYIt2TJF3S9xJLiRohnnNrKwREvcZYx0n8sCSbvGH349XkcQeg==} 139 | engines: {node: '>=12'} 140 | cpu: [x64] 141 | os: [freebsd] 142 | 143 | '@esbuild/linux-arm64@0.20.1': 144 | resolution: {integrity: sha512-cX8WdlF6Cnvw/DO9/X7XLH2J6CkBnz7Twjpk56cshk9sjYVcuh4sXQBy5bmTwzBjNVZze2yaV1vtcJS04LbN8w==} 145 | engines: {node: '>=12'} 146 | cpu: [arm64] 147 | os: [linux] 148 | 149 | '@esbuild/linux-arm@0.20.1': 150 | resolution: {integrity: sha512-LojC28v3+IhIbfQ+Vu4Ut5n3wKcgTu6POKIHN9Wpt0HnfgUGlBuyDDQR4jWZUZFyYLiz4RBBBmfU6sNfn6RhLw==} 151 | engines: {node: '>=12'} 152 | cpu: [arm] 153 | os: [linux] 154 | 155 | '@esbuild/linux-ia32@0.20.1': 156 | resolution: {integrity: sha512-4H/sQCy1mnnGkUt/xszaLlYJVTz3W9ep52xEefGtd6yXDQbz/5fZE5dFLUgsPdbUOQANcVUa5iO6g3nyy5BJiw==} 157 | engines: {node: '>=12'} 158 | cpu: [ia32] 159 | os: [linux] 160 | 161 | '@esbuild/linux-loong64@0.20.1': 162 | resolution: {integrity: sha512-c0jgtB+sRHCciVXlyjDcWb2FUuzlGVRwGXgI+3WqKOIuoo8AmZAddzeOHeYLtD+dmtHw3B4Xo9wAUdjlfW5yYA==} 163 | engines: {node: '>=12'} 164 | cpu: [loong64] 165 | os: [linux] 166 | 167 | '@esbuild/linux-mips64el@0.20.1': 168 | resolution: {integrity: sha512-TgFyCfIxSujyuqdZKDZ3yTwWiGv+KnlOeXXitCQ+trDODJ+ZtGOzLkSWngynP0HZnTsDyBbPy7GWVXWaEl6lhA==} 169 | engines: {node: '>=12'} 170 | cpu: [mips64el] 171 | os: [linux] 172 | 173 | '@esbuild/linux-ppc64@0.20.1': 174 | resolution: {integrity: sha512-b+yuD1IUeL+Y93PmFZDZFIElwbmFfIKLKlYI8M6tRyzE6u7oEP7onGk0vZRh8wfVGC2dZoy0EqX1V8qok4qHaw==} 175 | engines: {node: '>=12'} 176 | cpu: [ppc64] 177 | os: [linux] 178 | 179 | '@esbuild/linux-riscv64@0.20.1': 180 | resolution: {integrity: sha512-wpDlpE0oRKZwX+GfomcALcouqjjV8MIX8DyTrxfyCfXxoKQSDm45CZr9fanJ4F6ckD4yDEPT98SrjvLwIqUCgg==} 181 | engines: {node: '>=12'} 182 | cpu: [riscv64] 183 | os: [linux] 184 | 185 | '@esbuild/linux-s390x@0.20.1': 186 | resolution: {integrity: sha512-5BepC2Au80EohQ2dBpyTquqGCES7++p7G+7lXe1bAIvMdXm4YYcEfZtQrP4gaoZ96Wv1Ute61CEHFU7h4FMueQ==} 187 | engines: {node: '>=12'} 188 | cpu: [s390x] 189 | os: [linux] 190 | 191 | '@esbuild/linux-x64@0.20.1': 192 | resolution: {integrity: sha512-5gRPk7pKuaIB+tmH+yKd2aQTRpqlf1E4f/mC+tawIm/CGJemZcHZpp2ic8oD83nKgUPMEd0fNanrnFljiruuyA==} 193 | engines: {node: '>=12'} 194 | cpu: [x64] 195 | os: [linux] 196 | 197 | '@esbuild/netbsd-x64@0.20.1': 198 | resolution: {integrity: sha512-4fL68JdrLV2nVW2AaWZBv3XEm3Ae3NZn/7qy2KGAt3dexAgSVT+Hc97JKSZnqezgMlv9x6KV0ZkZY7UO5cNLCg==} 199 | engines: {node: '>=12'} 200 | cpu: [x64] 201 | os: [netbsd] 202 | 203 | '@esbuild/openbsd-x64@0.20.1': 204 | resolution: {integrity: sha512-GhRuXlvRE+twf2ES+8REbeCb/zeikNqwD3+6S5y5/x+DYbAQUNl0HNBs4RQJqrechS4v4MruEr8ZtAin/hK5iw==} 205 | engines: {node: '>=12'} 206 | cpu: [x64] 207 | os: [openbsd] 208 | 209 | '@esbuild/sunos-x64@0.20.1': 210 | resolution: {integrity: sha512-ZnWEyCM0G1Ex6JtsygvC3KUUrlDXqOihw8RicRuQAzw+c4f1D66YlPNNV3rkjVW90zXVsHwZYWbJh3v+oQFM9Q==} 211 | engines: {node: '>=12'} 212 | cpu: [x64] 213 | os: [sunos] 214 | 215 | '@esbuild/win32-arm64@0.20.1': 216 | resolution: {integrity: sha512-QZ6gXue0vVQY2Oon9WyLFCdSuYbXSoxaZrPuJ4c20j6ICedfsDilNPYfHLlMH7vGfU5DQR0czHLmJvH4Nzis/A==} 217 | engines: {node: '>=12'} 218 | cpu: [arm64] 219 | os: [win32] 220 | 221 | '@esbuild/win32-ia32@0.20.1': 222 | resolution: {integrity: sha512-HzcJa1NcSWTAU0MJIxOho8JftNp9YALui3o+Ny7hCh0v5f90nprly1U3Sj1Ldj/CvKKdvvFsCRvDkpsEMp4DNw==} 223 | engines: {node: '>=12'} 224 | cpu: [ia32] 225 | os: [win32] 226 | 227 | '@esbuild/win32-x64@0.20.1': 228 | resolution: {integrity: sha512-0MBh53o6XtI6ctDnRMeQ+xoCN8kD2qI1rY1KgF/xdWQwoFeKou7puvDfV8/Wv4Ctx2rRpET/gGdz3YlNtNACSA==} 229 | engines: {node: '>=12'} 230 | cpu: [x64] 231 | os: [win32] 232 | 233 | '@isaacs/cliui@8.0.2': 234 | resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} 235 | engines: {node: '>=12'} 236 | 237 | '@jridgewell/gen-mapping@0.3.5': 238 | resolution: {integrity: sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==} 239 | engines: {node: '>=6.0.0'} 240 | 241 | '@jridgewell/resolve-uri@3.1.2': 242 | resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} 243 | engines: {node: '>=6.0.0'} 244 | 245 | '@jridgewell/set-array@1.2.1': 246 | resolution: {integrity: sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==} 247 | engines: {node: '>=6.0.0'} 248 | 249 | '@jridgewell/sourcemap-codec@1.4.15': 250 | resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} 251 | 252 | '@jridgewell/sourcemap-codec@1.5.0': 253 | resolution: {integrity: sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==} 254 | 255 | '@jridgewell/trace-mapping@0.3.25': 256 | resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} 257 | 258 | '@nodelib/fs.scandir@2.1.5': 259 | resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} 260 | engines: {node: '>= 8'} 261 | 262 | '@nodelib/fs.stat@2.0.5': 263 | resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} 264 | engines: {node: '>= 8'} 265 | 266 | '@nodelib/fs.walk@1.2.8': 267 | resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} 268 | engines: {node: '>= 8'} 269 | 270 | '@pkgjs/parseargs@0.11.0': 271 | resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} 272 | engines: {node: '>=14'} 273 | 274 | '@rollup/rollup-android-arm-eabi@4.17.2': 275 | resolution: {integrity: sha512-NM0jFxY8bB8QLkoKxIQeObCaDlJKewVlIEkuyYKm5An1tdVZ966w2+MPQ2l8LBZLjR+SgyV+nRkTIunzOYBMLQ==} 276 | cpu: [arm] 277 | os: [android] 278 | 279 | '@rollup/rollup-android-arm64@4.17.2': 280 | resolution: {integrity: sha512-yeX/Usk7daNIVwkq2uGoq2BYJKZY1JfyLTaHO/jaiSwi/lsf8fTFoQW/n6IdAsx5tx+iotu2zCJwz8MxI6D/Bw==} 281 | cpu: [arm64] 282 | os: [android] 283 | 284 | '@rollup/rollup-darwin-arm64@4.17.2': 285 | resolution: {integrity: sha512-kcMLpE6uCwls023+kknm71ug7MZOrtXo+y5p/tsg6jltpDtgQY1Eq5sGfHcQfb+lfuKwhBmEURDga9N0ol4YPw==} 286 | cpu: [arm64] 287 | os: [darwin] 288 | 289 | '@rollup/rollup-darwin-x64@4.17.2': 290 | resolution: {integrity: sha512-AtKwD0VEx0zWkL0ZjixEkp5tbNLzX+FCqGG1SvOu993HnSz4qDI6S4kGzubrEJAljpVkhRSlg5bzpV//E6ysTQ==} 291 | cpu: [x64] 292 | os: [darwin] 293 | 294 | '@rollup/rollup-linux-arm-gnueabihf@4.17.2': 295 | resolution: {integrity: sha512-3reX2fUHqN7sffBNqmEyMQVj/CKhIHZd4y631duy0hZqI8Qoqf6lTtmAKvJFYa6bhU95B1D0WgzHkmTg33In0A==} 296 | cpu: [arm] 297 | os: [linux] 298 | 299 | '@rollup/rollup-linux-arm-musleabihf@4.17.2': 300 | resolution: {integrity: sha512-uSqpsp91mheRgw96xtyAGP9FW5ChctTFEoXP0r5FAzj/3ZRv3Uxjtc7taRQSaQM/q85KEKjKsZuiZM3GyUivRg==} 301 | cpu: [arm] 302 | os: [linux] 303 | 304 | '@rollup/rollup-linux-arm64-gnu@4.17.2': 305 | resolution: {integrity: sha512-EMMPHkiCRtE8Wdk3Qhtciq6BndLtstqZIroHiiGzB3C5LDJmIZcSzVtLRbwuXuUft1Cnv+9fxuDtDxz3k3EW2A==} 306 | cpu: [arm64] 307 | os: [linux] 308 | 309 | '@rollup/rollup-linux-arm64-musl@4.17.2': 310 | resolution: {integrity: sha512-NMPylUUZ1i0z/xJUIx6VUhISZDRT+uTWpBcjdv0/zkp7b/bQDF+NfnfdzuTiB1G6HTodgoFa93hp0O1xl+/UbA==} 311 | cpu: [arm64] 312 | os: [linux] 313 | 314 | '@rollup/rollup-linux-powerpc64le-gnu@4.17.2': 315 | resolution: {integrity: sha512-T19My13y8uYXPw/L/k0JYaX1fJKFT/PWdXiHr8mTbXWxjVF1t+8Xl31DgBBvEKclw+1b00Chg0hxE2O7bTG7GQ==} 316 | cpu: [ppc64] 317 | os: [linux] 318 | 319 | '@rollup/rollup-linux-riscv64-gnu@4.17.2': 320 | resolution: {integrity: sha512-BOaNfthf3X3fOWAB+IJ9kxTgPmMqPPH5f5k2DcCsRrBIbWnaJCgX2ll77dV1TdSy9SaXTR5iDXRL8n7AnoP5cg==} 321 | cpu: [riscv64] 322 | os: [linux] 323 | 324 | '@rollup/rollup-linux-s390x-gnu@4.17.2': 325 | resolution: {integrity: sha512-W0UP/x7bnn3xN2eYMql2T/+wpASLE5SjObXILTMPUBDB/Fg/FxC+gX4nvCfPBCbNhz51C+HcqQp2qQ4u25ok6g==} 326 | cpu: [s390x] 327 | os: [linux] 328 | 329 | '@rollup/rollup-linux-x64-gnu@4.17.2': 330 | resolution: {integrity: sha512-Hy7pLwByUOuyaFC6mAr7m+oMC+V7qyifzs/nW2OJfC8H4hbCzOX07Ov0VFk/zP3kBsELWNFi7rJtgbKYsav9QQ==} 331 | cpu: [x64] 332 | os: [linux] 333 | 334 | '@rollup/rollup-linux-x64-musl@4.17.2': 335 | resolution: {integrity: sha512-h1+yTWeYbRdAyJ/jMiVw0l6fOOm/0D1vNLui9iPuqgRGnXA0u21gAqOyB5iHjlM9MMfNOm9RHCQ7zLIzT0x11Q==} 336 | cpu: [x64] 337 | os: [linux] 338 | 339 | '@rollup/rollup-win32-arm64-msvc@4.17.2': 340 | resolution: {integrity: sha512-tmdtXMfKAjy5+IQsVtDiCfqbynAQE/TQRpWdVataHmhMb9DCoJxp9vLcCBjEQWMiUYxO1QprH/HbY9ragCEFLA==} 341 | cpu: [arm64] 342 | os: [win32] 343 | 344 | '@rollup/rollup-win32-ia32-msvc@4.17.2': 345 | resolution: {integrity: sha512-7II/QCSTAHuE5vdZaQEwJq2ZACkBpQDOmQsE6D6XUbnBHW8IAhm4eTufL6msLJorzrHDFv3CF8oCA/hSIRuZeQ==} 346 | cpu: [ia32] 347 | os: [win32] 348 | 349 | '@rollup/rollup-win32-x64-msvc@4.17.2': 350 | resolution: {integrity: sha512-TGGO7v7qOq4CYmSBVEYpI1Y5xDuCEnbVC5Vth8mOsW0gDSzxNrVERPc790IGHsrT2dQSimgMr9Ub3Y1Jci5/8w==} 351 | cpu: [x64] 352 | os: [win32] 353 | 354 | '@types/chai-subset@1.3.3': 355 | resolution: {integrity: sha512-frBecisrNGz+F4T6bcc+NLeolfiojh5FxW2klu669+8BARtyQv2C/GkNW6FUodVe4BroGMP/wER/YDGc7rEllw==} 356 | 357 | '@types/chai@4.3.5': 358 | resolution: {integrity: sha512-mEo1sAde+UCE6b2hxn332f1g1E8WfYRu6p5SvTKr2ZKC1f7gFJXk4h5PyGP9Dt6gCaG8y8XhwnXWC6Iy2cmBng==} 359 | 360 | '@types/eslint-visitor-keys@1.0.0': 361 | resolution: {integrity: sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==} 362 | 363 | '@types/estree@1.0.5': 364 | resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} 365 | 366 | '@types/node@14.14.35': 367 | resolution: {integrity: sha512-Lt+wj8NVPx0zUmUwumiVXapmaLUcAk3yPuHCFVXras9k5VT9TdhJqKqGVUQCD60OTMCl0qxJ57OiTL0Mic3Iag==} 368 | 369 | '@types/resolve@1.20.6': 370 | resolution: {integrity: sha512-A4STmOXPhMUtHH+S6ymgE2GiBSMqf4oTvcQZMcHzokuTLVYzXTB8ttjcgxOVaAp2lGwEdzZ0J+cRbbeevQj1UQ==} 371 | 372 | '@vitest/expect@0.31.0': 373 | resolution: {integrity: sha512-Jlm8ZTyp6vMY9iz9Ny9a0BHnCG4fqBa8neCF6Pk/c/6vkUk49Ls6UBlgGAU82QnzzoaUs9E/mUhq/eq9uMOv/g==} 374 | 375 | '@vitest/runner@0.31.0': 376 | resolution: {integrity: sha512-H1OE+Ly7JFeBwnpHTrKyCNm/oZgr+16N4qIlzzqSG/YRQDATBYmJb/KUn3GrZaiQQyL7GwpNHVZxSQd6juLCgw==} 377 | 378 | '@vitest/snapshot@0.31.0': 379 | resolution: {integrity: sha512-5dTXhbHnyUMTMOujZPB0wjFjQ6q5x9c8TvAsSPUNKjp1tVU7i9pbqcKPqntyu2oXtmVxKbuHCqrOd+Ft60r4tg==} 380 | 381 | '@vitest/spy@0.31.0': 382 | resolution: {integrity: sha512-IzCEQ85RN26GqjQNkYahgVLLkULOxOm5H/t364LG0JYb3Apg0PsYCHLBYGA006+SVRMWhQvHlBBCyuByAMFmkg==} 383 | 384 | '@vitest/utils@0.31.0': 385 | resolution: {integrity: sha512-kahaRyLX7GS1urekRXN2752X4gIgOGVX4Wo8eDUGUkTWlGpXzf5ZS6N9RUUS+Re3XEE8nVGqNyxkSxF5HXlGhQ==} 386 | 387 | acorn-walk@8.2.0: 388 | resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==} 389 | engines: {node: '>=0.4.0'} 390 | 391 | acorn@8.8.2: 392 | resolution: {integrity: sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==} 393 | engines: {node: '>=0.4.0'} 394 | hasBin: true 395 | 396 | ansi-regex@5.0.1: 397 | resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} 398 | engines: {node: '>=8'} 399 | 400 | ansi-regex@6.0.1: 401 | resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} 402 | engines: {node: '>=12'} 403 | 404 | ansi-styles@4.3.0: 405 | resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} 406 | engines: {node: '>=8'} 407 | 408 | ansi-styles@5.2.0: 409 | resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==} 410 | engines: {node: '>=10'} 411 | 412 | ansi-styles@6.2.1: 413 | resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} 414 | engines: {node: '>=12'} 415 | 416 | any-promise@1.3.0: 417 | resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==} 418 | 419 | anymatch@3.1.3: 420 | resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} 421 | engines: {node: '>= 8'} 422 | 423 | array-union@2.1.0: 424 | resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} 425 | engines: {node: '>=8'} 426 | 427 | assertion-error@1.1.0: 428 | resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==} 429 | 430 | balanced-match@1.0.2: 431 | resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} 432 | 433 | binary-extensions@2.3.0: 434 | resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==} 435 | engines: {node: '>=8'} 436 | 437 | blueimp-md5@2.19.0: 438 | resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} 439 | 440 | brace-expansion@2.0.1: 441 | resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} 442 | 443 | braces@3.0.2: 444 | resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} 445 | engines: {node: '>=8'} 446 | 447 | bundle-require@4.1.0: 448 | resolution: {integrity: sha512-FeArRFM+ziGkRViKRnSTbHZc35dgmR9yNog05Kn0+ItI59pOAISGvnnIwW1WgFZQW59IxD9QpJnUPkdIPfZuXg==} 449 | engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} 450 | peerDependencies: 451 | esbuild: ^0.20.1 452 | 453 | cac@6.7.14: 454 | resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} 455 | engines: {node: '>=8'} 456 | 457 | chai@4.3.7: 458 | resolution: {integrity: sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A==} 459 | engines: {node: '>=4'} 460 | 461 | chalk@4.1.2: 462 | resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} 463 | engines: {node: '>=10'} 464 | 465 | check-error@1.0.2: 466 | resolution: {integrity: sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==} 467 | 468 | chokidar@3.6.0: 469 | resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} 470 | engines: {node: '>= 8.10.0'} 471 | 472 | cliui@8.0.1: 473 | resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} 474 | engines: {node: '>=12'} 475 | 476 | color-convert@2.0.1: 477 | resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} 478 | engines: {node: '>=7.0.0'} 479 | 480 | color-name@1.1.4: 481 | resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} 482 | 483 | commander@4.1.1: 484 | resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==} 485 | engines: {node: '>= 6'} 486 | 487 | concordance@5.0.4: 488 | resolution: {integrity: sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==} 489 | engines: {node: '>=10.18.0 <11 || >=12.14.0 <13 || >=14'} 490 | 491 | concurrently@8.2.2: 492 | resolution: {integrity: sha512-1dP4gpXFhei8IOtlXRE/T/4H88ElHgTiUzh71YUmtjTEHMSRS2Z/fgOxHSxxusGHogsRfxNq1vyAwxSC+EVyDg==} 493 | engines: {node: ^14.13.0 || >=16.0.0} 494 | hasBin: true 495 | 496 | cross-spawn@7.0.3: 497 | resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} 498 | engines: {node: '>= 8'} 499 | 500 | date-fns@2.30.0: 501 | resolution: {integrity: sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==} 502 | engines: {node: '>=0.11'} 503 | 504 | date-time@3.1.0: 505 | resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==} 506 | engines: {node: '>=6'} 507 | 508 | debug@4.3.4: 509 | resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} 510 | engines: {node: '>=6.0'} 511 | peerDependencies: 512 | supports-color: '*' 513 | peerDependenciesMeta: 514 | supports-color: 515 | optional: true 516 | 517 | dedent@0.7.0: 518 | resolution: {integrity: sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=} 519 | 520 | deep-eql@4.1.3: 521 | resolution: {integrity: sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==} 522 | engines: {node: '>=6'} 523 | 524 | dir-glob@3.0.1: 525 | resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} 526 | engines: {node: '>=8'} 527 | 528 | eastasianwidth@0.2.0: 529 | resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} 530 | 531 | emoji-regex@8.0.0: 532 | resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} 533 | 534 | emoji-regex@9.2.2: 535 | resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} 536 | 537 | endent@2.1.0: 538 | resolution: {integrity: sha512-r8VyPX7XL8U01Xgnb1CjZ3XV+z90cXIJ9JPE/R9SEC9vpw2P6CfsRPJmp20DppC5N7ZAMCmjYkJIa744Iyg96w==} 539 | 540 | esbuild-plugin-alias@0.2.1: 541 | resolution: {integrity: sha512-jyfL/pwPqaFXyKnj8lP8iLk6Z0m099uXR45aSN8Av1XD4vhvQutxxPzgA2bTcAwQpa1zCXDcWOlhFgyP3GKqhQ==} 542 | 543 | esbuild@0.20.1: 544 | resolution: {integrity: sha512-OJwEgrpWm/PCMsLVWXKqvcjme3bHNpOgN7Tb6cQnR5n0TPbQx1/Xrn7rqM+wn17bYeT6MGB5sn1Bh5YiGi70nA==} 545 | engines: {node: '>=12'} 546 | hasBin: true 547 | 548 | escalade@3.1.2: 549 | resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} 550 | engines: {node: '>=6'} 551 | 552 | eslint-visitor-keys@3.3.0: 553 | resolution: {integrity: sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==} 554 | engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} 555 | 556 | esutils@2.0.3: 557 | resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} 558 | engines: {node: '>=0.10.0'} 559 | 560 | execa@5.1.1: 561 | resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} 562 | engines: {node: '>=10'} 563 | 564 | fast-diff@1.2.0: 565 | resolution: {integrity: sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==} 566 | 567 | fast-glob@3.3.2: 568 | resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} 569 | engines: {node: '>=8.6.0'} 570 | 571 | fast-json-parse@1.0.3: 572 | resolution: {integrity: sha512-FRWsaZRWEJ1ESVNbDWmsAlqDk96gPQezzLghafp5J4GUKjbCz3OkAHuZs5TuPEtkbVQERysLp9xv6c24fBm8Aw==} 573 | 574 | fastq@1.17.1: 575 | resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} 576 | 577 | fill-range@7.0.1: 578 | resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} 579 | engines: {node: '>=8'} 580 | 581 | foreground-child@3.1.1: 582 | resolution: {integrity: sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==} 583 | engines: {node: '>=14'} 584 | 585 | fsevents@2.3.2: 586 | resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} 587 | engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} 588 | os: [darwin] 589 | 590 | function-bind@1.1.2: 591 | resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} 592 | 593 | get-caller-file@2.0.5: 594 | resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} 595 | engines: {node: 6.* || 8.* || >= 10.*} 596 | 597 | get-func-name@2.0.0: 598 | resolution: {integrity: sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==} 599 | 600 | get-stream@6.0.1: 601 | resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} 602 | engines: {node: '>=10'} 603 | 604 | glob-parent@5.1.2: 605 | resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} 606 | engines: {node: '>= 6'} 607 | 608 | glob@10.3.15: 609 | resolution: {integrity: sha512-0c6RlJt1TICLyvJYIApxb8GsXoai0KUP7AxKKAtsYXdgJR1mGEUa7DgwShbdk1nly0PYoZj01xd4hzbq3fsjpw==} 610 | engines: {node: '>=16 || 14 >=14.18'} 611 | hasBin: true 612 | 613 | globby@11.1.0: 614 | resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} 615 | engines: {node: '>=10'} 616 | 617 | has-flag@4.0.0: 618 | resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} 619 | engines: {node: '>=8'} 620 | 621 | hasown@2.0.2: 622 | resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} 623 | engines: {node: '>= 0.4'} 624 | 625 | human-signals@2.1.0: 626 | resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} 627 | engines: {node: '>=10.17.0'} 628 | 629 | ignore@5.3.1: 630 | resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} 631 | engines: {node: '>= 4'} 632 | 633 | is-binary-path@2.1.0: 634 | resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} 635 | engines: {node: '>=8'} 636 | 637 | is-core-module@2.13.1: 638 | resolution: {integrity: sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==} 639 | 640 | is-extglob@2.1.1: 641 | resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} 642 | engines: {node: '>=0.10.0'} 643 | 644 | is-fullwidth-code-point@3.0.0: 645 | resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} 646 | engines: {node: '>=8'} 647 | 648 | is-glob@4.0.3: 649 | resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} 650 | engines: {node: '>=0.10.0'} 651 | 652 | is-number@7.0.0: 653 | resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} 654 | engines: {node: '>=0.12.0'} 655 | 656 | is-stream@2.0.1: 657 | resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} 658 | engines: {node: '>=8'} 659 | 660 | isexe@2.0.0: 661 | resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} 662 | 663 | jackspeak@2.3.6: 664 | resolution: {integrity: sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==} 665 | engines: {node: '>=14'} 666 | 667 | joycon@3.1.1: 668 | resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==} 669 | engines: {node: '>=10'} 670 | 671 | js-string-escape@1.0.1: 672 | resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} 673 | engines: {node: '>= 0.8'} 674 | 675 | jsonc-parser@3.2.0: 676 | resolution: {integrity: sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==} 677 | 678 | lilconfig@3.1.1: 679 | resolution: {integrity: sha512-O18pf7nyvHTckunPWCV1XUNXU1piu01y2b7ATJ0ppkUkk8ocqVWBrYjJBCwHDjD/ZWcfyrA0P4gKhzWGi5EINQ==} 680 | engines: {node: '>=14'} 681 | 682 | lines-and-columns@1.2.4: 683 | resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} 684 | 685 | load-tsconfig@0.2.5: 686 | resolution: {integrity: sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==} 687 | engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} 688 | 689 | local-pkg@0.4.3: 690 | resolution: {integrity: sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==} 691 | engines: {node: '>=14'} 692 | 693 | lodash.sortby@4.7.0: 694 | resolution: {integrity: sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==} 695 | 696 | lodash@4.17.21: 697 | resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} 698 | 699 | loupe@2.3.6: 700 | resolution: {integrity: sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==} 701 | 702 | lru-cache@10.2.2: 703 | resolution: {integrity: sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==} 704 | engines: {node: 14 || >=16.14} 705 | 706 | lru-cache@6.0.0: 707 | resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} 708 | engines: {node: '>=10'} 709 | 710 | magic-string@0.30.11: 711 | resolution: {integrity: sha512-+Wri9p0QHMy+545hKww7YAu5NyzF8iomPL/RQazugQ9+Ez4Ic3mERMd8ZTX5rfK944j+560ZJi8iAwgak1Ac7A==} 712 | 713 | md5-hex@3.0.1: 714 | resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} 715 | engines: {node: '>=8'} 716 | 717 | merge-stream@2.0.0: 718 | resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} 719 | 720 | merge2@1.4.1: 721 | resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} 722 | engines: {node: '>= 8'} 723 | 724 | meriyah@4.3.5: 725 | resolution: {integrity: sha512-oCOuzPtD4udAYnvxIi4Rp99nEHJWHtAFHEFmS27hQuDNjxTQ39Z/hQ9uWW+ZgJjCmpi0nRo7wwciT7rtQE31Bw==} 726 | engines: {node: '>=10.4.0'} 727 | 728 | micromatch@4.0.5: 729 | resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} 730 | engines: {node: '>=8.6'} 731 | 732 | mimic-fn@2.1.0: 733 | resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} 734 | engines: {node: '>=6'} 735 | 736 | minimatch@9.0.4: 737 | resolution: {integrity: sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==} 738 | engines: {node: '>=16 || 14 >=14.17'} 739 | 740 | minipass@7.1.1: 741 | resolution: {integrity: sha512-UZ7eQ+h8ywIRAW1hIEl2AqdwzJucU/Kp59+8kkZeSvafXhZjul247BvIJjEVFVeON6d7lM46XX1HXCduKAS8VA==} 742 | engines: {node: '>=16 || 14 >=14.17'} 743 | 744 | mlly@1.2.1: 745 | resolution: {integrity: sha512-1aMEByaWgBPEbWV2BOPEMySRrzl7rIHXmQxam4DM8jVjalTQDjpN2ZKOLUrwyhfZQO7IXHml2StcHMhooDeEEQ==} 746 | 747 | ms@2.1.2: 748 | resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} 749 | 750 | mz@2.7.0: 751 | resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==} 752 | 753 | nanoid@3.3.6: 754 | resolution: {integrity: sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==} 755 | engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} 756 | hasBin: true 757 | 758 | nanoid@3.3.7: 759 | resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} 760 | engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} 761 | hasBin: true 762 | 763 | normalize-path@3.0.0: 764 | resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} 765 | engines: {node: '>=0.10.0'} 766 | 767 | npm-run-path@4.0.1: 768 | resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} 769 | engines: {node: '>=8'} 770 | 771 | object-assign@4.1.1: 772 | resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} 773 | engines: {node: '>=0.10.0'} 774 | 775 | objectorarray@1.0.5: 776 | resolution: {integrity: sha512-eJJDYkhJFFbBBAxeh8xW+weHlkI28n2ZdQV/J/DNfWfSKlGEf2xcfAbZTv3riEXHAhL9SVOTs2pRmXiSTf78xg==} 777 | 778 | onetime@5.1.2: 779 | resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} 780 | engines: {node: '>=6'} 781 | 782 | p-limit@4.0.0: 783 | resolution: {integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==} 784 | engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} 785 | 786 | path-browserify@1.0.1: 787 | resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==} 788 | 789 | path-key@3.1.1: 790 | resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} 791 | engines: {node: '>=8'} 792 | 793 | path-parse@1.0.7: 794 | resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} 795 | 796 | path-scurry@1.11.1: 797 | resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==} 798 | engines: {node: '>=16 || 14 >=14.18'} 799 | 800 | path-type@4.0.0: 801 | resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} 802 | engines: {node: '>=8'} 803 | 804 | pathe@1.1.0: 805 | resolution: {integrity: sha512-ODbEPR0KKHqECXW1GoxdDb+AZvULmXjVPy4rt+pGo2+TnjJTIPJQSVS6N63n8T2Ip+syHhbn52OewKicV0373w==} 806 | 807 | pathval@1.1.1: 808 | resolution: {integrity: sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==} 809 | 810 | picocolors@1.0.0: 811 | resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} 812 | 813 | picocolors@1.0.1: 814 | resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} 815 | 816 | picomatch@2.3.1: 817 | resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} 818 | engines: {node: '>=8.6'} 819 | 820 | pirates@4.0.6: 821 | resolution: {integrity: sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==} 822 | engines: {node: '>= 6'} 823 | 824 | pkg-types@1.0.3: 825 | resolution: {integrity: sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==} 826 | 827 | postcss-load-config@4.0.2: 828 | resolution: {integrity: sha512-bSVhyJGL00wMVoPUzAVAnbEoWyqRxkjv64tUl427SKnPrENtq6hJwUojroMz2VB+Q1edmi4IfrAPpami5VVgMQ==} 829 | engines: {node: '>= 14'} 830 | peerDependencies: 831 | postcss: '>=8.0.9' 832 | ts-node: '>=9.0.0' 833 | peerDependenciesMeta: 834 | postcss: 835 | optional: true 836 | ts-node: 837 | optional: true 838 | 839 | postcss@8.4.23: 840 | resolution: {integrity: sha512-bQ3qMcpF6A/YjR55xtoTr0jGOlnPOKAIMdOWiv0EIT6HVPEaJiJB4NLljSbiHoC2RX7DN5Uvjtpbg1NPdwv1oA==} 841 | engines: {node: ^10 || ^12 || >=14} 842 | 843 | postcss@8.4.41: 844 | resolution: {integrity: sha512-TesUflQ0WKZqAvg52PWL6kHgLKP6xB6heTOdoYM0Wt2UHyxNa4K25EZZMgKns3BH1RLVbZCREPpLY0rhnNoHVQ==} 845 | engines: {node: ^10 || ^12 || >=14} 846 | 847 | prettier@2.2.1: 848 | resolution: {integrity: sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==} 849 | engines: {node: '>=10.13.0'} 850 | hasBin: true 851 | 852 | pretty-format@27.5.1: 853 | resolution: {integrity: sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==} 854 | engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} 855 | 856 | punycode@2.3.1: 857 | resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} 858 | engines: {node: '>=6'} 859 | 860 | queue-microtask@1.2.3: 861 | resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} 862 | 863 | react-is@17.0.1: 864 | resolution: {integrity: sha512-NAnt2iGDXohE5LI7uBnLnqvLQMtzhkiAOLXTmv+qnF9Ky7xAPcX8Up/xWIhxvLVGJvuLiNc4xQLtuqDRzb4fSA==} 865 | 866 | readdirp@3.6.0: 867 | resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} 868 | engines: {node: '>=8.10.0'} 869 | 870 | regenerator-runtime@0.14.1: 871 | resolution: {integrity: sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==} 872 | 873 | require-directory@2.1.1: 874 | resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} 875 | engines: {node: '>=0.10.0'} 876 | 877 | resolve-from@5.0.0: 878 | resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} 879 | engines: {node: '>=8'} 880 | 881 | resolve@1.22.8: 882 | resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==} 883 | hasBin: true 884 | 885 | reusify@1.0.4: 886 | resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} 887 | engines: {iojs: '>=1.0.0', node: '>=0.10.0'} 888 | 889 | rollup@3.21.7: 890 | resolution: {integrity: sha512-KXPaEuR8FfUoK2uHwNjxTmJ18ApyvD6zJpYv9FOJSqLStmt6xOY84l1IjK2dSolQmoXknrhEFRaPRgOPdqCT5w==} 891 | engines: {node: '>=14.18.0', npm: '>=8.0.0'} 892 | hasBin: true 893 | 894 | rollup@4.17.2: 895 | resolution: {integrity: sha512-/9ClTJPByC0U4zNLowV1tMBe8yMEAxewtR3cUNX5BoEpGH3dQEWpJLr6CLp0fPdYRF/fzVOgvDb1zXuakwF5kQ==} 896 | engines: {node: '>=18.0.0', npm: '>=8.0.0'} 897 | hasBin: true 898 | 899 | run-parallel@1.2.0: 900 | resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} 901 | 902 | rxjs@7.8.1: 903 | resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} 904 | 905 | semver@7.3.4: 906 | resolution: {integrity: sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==} 907 | engines: {node: '>=10'} 908 | hasBin: true 909 | 910 | shebang-command@2.0.0: 911 | resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} 912 | engines: {node: '>=8'} 913 | 914 | shebang-regex@3.0.0: 915 | resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} 916 | engines: {node: '>=8'} 917 | 918 | shell-quote@1.8.1: 919 | resolution: {integrity: sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==} 920 | 921 | siginfo@2.0.0: 922 | resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} 923 | 924 | signal-exit@3.0.7: 925 | resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} 926 | 927 | signal-exit@4.1.0: 928 | resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} 929 | engines: {node: '>=14'} 930 | 931 | slash@3.0.0: 932 | resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} 933 | engines: {node: '>=8'} 934 | 935 | source-map-js@1.0.2: 936 | resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} 937 | engines: {node: '>=0.10.0'} 938 | 939 | source-map-js@1.2.0: 940 | resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} 941 | engines: {node: '>=0.10.0'} 942 | 943 | source-map@0.8.0-beta.0: 944 | resolution: {integrity: sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==} 945 | engines: {node: '>= 8'} 946 | 947 | spawn-command@0.0.2: 948 | resolution: {integrity: sha512-zC8zGoGkmc8J9ndvml8Xksr1Amk9qBujgbF0JAIWO7kXr43w0h/0GJNM/Vustixu+YE8N/MTrQ7N31FvHUACxQ==} 949 | 950 | stackback@0.0.2: 951 | resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} 952 | 953 | std-env@3.3.3: 954 | resolution: {integrity: sha512-Rz6yejtVyWnVjC1RFvNmYL10kgjC49EOghxWn0RFqlCHGFpQx+Xe7yW3I4ceK1SGrWIGMjD5Kbue8W/udkbMJg==} 955 | 956 | string-width@4.2.3: 957 | resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} 958 | engines: {node: '>=8'} 959 | 960 | string-width@5.1.2: 961 | resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} 962 | engines: {node: '>=12'} 963 | 964 | strip-ansi@6.0.1: 965 | resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} 966 | engines: {node: '>=8'} 967 | 968 | strip-ansi@7.1.0: 969 | resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} 970 | engines: {node: '>=12'} 971 | 972 | strip-final-newline@2.0.0: 973 | resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} 974 | engines: {node: '>=6'} 975 | 976 | strip-literal@1.0.1: 977 | resolution: {integrity: sha512-QZTsipNpa2Ppr6v1AmJHESqJ3Uz247MUS0OjrnnZjFAvEoWqxuyFuXn2xLgMtRnijJShAa1HL0gtJyUs7u7n3Q==} 978 | 979 | sucrase@3.35.0: 980 | resolution: {integrity: sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==} 981 | engines: {node: '>=16 || 14 >=14.17'} 982 | hasBin: true 983 | 984 | supports-color@7.2.0: 985 | resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} 986 | engines: {node: '>=8'} 987 | 988 | supports-color@8.1.1: 989 | resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} 990 | engines: {node: '>=10'} 991 | 992 | supports-preserve-symlinks-flag@1.0.0: 993 | resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} 994 | engines: {node: '>= 0.4'} 995 | 996 | thenify-all@1.6.0: 997 | resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==} 998 | engines: {node: '>=0.8'} 999 | 1000 | thenify@3.3.1: 1001 | resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==} 1002 | 1003 | time-zone@1.0.0: 1004 | resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} 1005 | engines: {node: '>=4'} 1006 | 1007 | tinybench@2.5.0: 1008 | resolution: {integrity: sha512-kRwSG8Zx4tjF9ZiyH4bhaebu+EDz1BOx9hOigYHlUW4xxI/wKIUQUqo018UlU4ar6ATPBsaMrdbKZ+tmPdohFA==} 1009 | 1010 | tinypool@0.5.0: 1011 | resolution: {integrity: sha512-paHQtnrlS1QZYKF/GnLoOM/DN9fqaGOFbCbxzAhwniySnzl9Ebk8w73/dd34DAhe/obUbPAOldTyYXQZxnPBPQ==} 1012 | engines: {node: '>=14.0.0'} 1013 | 1014 | tinyspy@2.1.0: 1015 | resolution: {integrity: sha512-7eORpyqImoOvkQJCSkL0d0mB4NHHIFAy4b1u8PHdDa7SjGS2njzl6/lyGoZLm+eyYEtlUmFGE0rFj66SWxZgQQ==} 1016 | engines: {node: '>=14.0.0'} 1017 | 1018 | to-regex-range@5.0.1: 1019 | resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} 1020 | engines: {node: '>=8.0'} 1021 | 1022 | tr46@1.0.1: 1023 | resolution: {integrity: sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==} 1024 | 1025 | tree-kill@1.2.2: 1026 | resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==} 1027 | hasBin: true 1028 | 1029 | ts-interface-checker@0.1.13: 1030 | resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} 1031 | 1032 | tslib@2.6.2: 1033 | resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} 1034 | 1035 | tsup@8.0.2: 1036 | resolution: {integrity: sha512-NY8xtQXdH7hDUAZwcQdY/Vzlw9johQsaqf7iwZ6g1DOUlFYQ5/AtVAjTvihhEyeRlGo4dLRVHtrRaL35M1daqQ==} 1037 | engines: {node: '>=18'} 1038 | hasBin: true 1039 | peerDependencies: 1040 | '@microsoft/api-extractor': ^7.36.0 1041 | '@swc/core': ^1 1042 | postcss: ^8.4.12 1043 | typescript: '>=4.5.0' 1044 | peerDependenciesMeta: 1045 | '@microsoft/api-extractor': 1046 | optional: true 1047 | '@swc/core': 1048 | optional: true 1049 | postcss: 1050 | optional: true 1051 | typescript: 1052 | optional: true 1053 | 1054 | type-detect@4.0.8: 1055 | resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} 1056 | engines: {node: '>=4'} 1057 | 1058 | typescript@5.3.3: 1059 | resolution: {integrity: sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==} 1060 | engines: {node: '>=14.17'} 1061 | hasBin: true 1062 | 1063 | ufo@1.1.2: 1064 | resolution: {integrity: sha512-TrY6DsjTQQgyS3E3dBaOXf0TpPD8u9FVrVYmKVegJuFw51n/YB9XPt+U6ydzFG5ZIN7+DIjPbNmXoBj9esYhgQ==} 1065 | 1066 | vite-node@0.31.0: 1067 | resolution: {integrity: sha512-8x1x1LNuPvE2vIvkSB7c1mApX5oqlgsxzHQesYF7l5n1gKrEmrClIiZuOFbFDQcjLsmcWSwwmrWrcGWm9Fxc/g==} 1068 | engines: {node: '>=v14.18.0'} 1069 | hasBin: true 1070 | 1071 | vite@4.3.6: 1072 | resolution: {integrity: sha512-cqIyLSbA6gornMS659AXTVKF7cvSHMdKmJJwQ9DXq3lwsT1uZSdktuBRlpHQ8VnOWx0QHtjDwxPpGtyo9Fh/Qg==} 1073 | engines: {node: ^14.18.0 || >=16.0.0} 1074 | hasBin: true 1075 | peerDependencies: 1076 | '@types/node': '>= 14' 1077 | less: '*' 1078 | sass: '*' 1079 | stylus: '*' 1080 | sugarss: '*' 1081 | terser: ^5.4.0 1082 | peerDependenciesMeta: 1083 | '@types/node': 1084 | optional: true 1085 | less: 1086 | optional: true 1087 | sass: 1088 | optional: true 1089 | stylus: 1090 | optional: true 1091 | sugarss: 1092 | optional: true 1093 | terser: 1094 | optional: true 1095 | 1096 | vitest@0.31.0: 1097 | resolution: {integrity: sha512-JwWJS9p3GU9GxkG7eBSmr4Q4x4bvVBSswaCFf1PBNHiPx00obfhHRJfgHcnI0ffn+NMlIh9QGvG75FlaIBdKGA==} 1098 | engines: {node: '>=v14.18.0'} 1099 | hasBin: true 1100 | peerDependencies: 1101 | '@edge-runtime/vm': '*' 1102 | '@vitest/browser': '*' 1103 | '@vitest/ui': '*' 1104 | happy-dom: '*' 1105 | jsdom: '*' 1106 | playwright: '*' 1107 | safaridriver: '*' 1108 | webdriverio: '*' 1109 | peerDependenciesMeta: 1110 | '@edge-runtime/vm': 1111 | optional: true 1112 | '@vitest/browser': 1113 | optional: true 1114 | '@vitest/ui': 1115 | optional: true 1116 | happy-dom: 1117 | optional: true 1118 | jsdom: 1119 | optional: true 1120 | playwright: 1121 | optional: true 1122 | safaridriver: 1123 | optional: true 1124 | webdriverio: 1125 | optional: true 1126 | 1127 | webidl-conversions@4.0.2: 1128 | resolution: {integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==} 1129 | 1130 | well-known-symbols@2.0.0: 1131 | resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==} 1132 | engines: {node: '>=6'} 1133 | 1134 | whatwg-url@7.1.0: 1135 | resolution: {integrity: sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==} 1136 | 1137 | which@2.0.2: 1138 | resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} 1139 | engines: {node: '>= 8'} 1140 | hasBin: true 1141 | 1142 | why-is-node-running@2.2.2: 1143 | resolution: {integrity: sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==} 1144 | engines: {node: '>=8'} 1145 | hasBin: true 1146 | 1147 | wrap-ansi@7.0.0: 1148 | resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} 1149 | engines: {node: '>=10'} 1150 | 1151 | wrap-ansi@8.1.0: 1152 | resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} 1153 | engines: {node: '>=12'} 1154 | 1155 | y18n@5.0.8: 1156 | resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} 1157 | engines: {node: '>=10'} 1158 | 1159 | yallist@4.0.0: 1160 | resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} 1161 | 1162 | yaml@2.4.2: 1163 | resolution: {integrity: sha512-B3VqDZ+JAg1nZpaEmWtTXUlBneoGx6CPM9b0TENK6aoSu5t73dItudwdgmi6tHlIZZId4dZ9skcAQ2UbcyAeVA==} 1164 | engines: {node: '>= 14'} 1165 | hasBin: true 1166 | 1167 | yargs-parser@21.1.1: 1168 | resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} 1169 | engines: {node: '>=12'} 1170 | 1171 | yargs@17.7.2: 1172 | resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} 1173 | engines: {node: '>=12'} 1174 | 1175 | yocto-queue@1.0.0: 1176 | resolution: {integrity: sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==} 1177 | engines: {node: '>=12.20'} 1178 | 1179 | snapshots: 1180 | 1181 | '@alloc/fast-rimraf@1.0.8': {} 1182 | 1183 | '@alloc/is@3.1.3': {} 1184 | 1185 | '@alloc/prettier-config@1.0.0': {} 1186 | 1187 | '@alloc/types@2.0.0': {} 1188 | 1189 | '@babel/runtime@7.24.5': 1190 | dependencies: 1191 | regenerator-runtime: 0.14.1 1192 | 1193 | '@esbuild/aix-ppc64@0.20.1': 1194 | optional: true 1195 | 1196 | '@esbuild/android-arm64@0.20.1': 1197 | optional: true 1198 | 1199 | '@esbuild/android-arm@0.20.1': 1200 | optional: true 1201 | 1202 | '@esbuild/android-x64@0.20.1': 1203 | optional: true 1204 | 1205 | '@esbuild/darwin-arm64@0.20.1': 1206 | optional: true 1207 | 1208 | '@esbuild/darwin-x64@0.20.1': 1209 | optional: true 1210 | 1211 | '@esbuild/freebsd-arm64@0.20.1': 1212 | optional: true 1213 | 1214 | '@esbuild/freebsd-x64@0.20.1': 1215 | optional: true 1216 | 1217 | '@esbuild/linux-arm64@0.20.1': 1218 | optional: true 1219 | 1220 | '@esbuild/linux-arm@0.20.1': 1221 | optional: true 1222 | 1223 | '@esbuild/linux-ia32@0.20.1': 1224 | optional: true 1225 | 1226 | '@esbuild/linux-loong64@0.20.1': 1227 | optional: true 1228 | 1229 | '@esbuild/linux-mips64el@0.20.1': 1230 | optional: true 1231 | 1232 | '@esbuild/linux-ppc64@0.20.1': 1233 | optional: true 1234 | 1235 | '@esbuild/linux-riscv64@0.20.1': 1236 | optional: true 1237 | 1238 | '@esbuild/linux-s390x@0.20.1': 1239 | optional: true 1240 | 1241 | '@esbuild/linux-x64@0.20.1': 1242 | optional: true 1243 | 1244 | '@esbuild/netbsd-x64@0.20.1': 1245 | optional: true 1246 | 1247 | '@esbuild/openbsd-x64@0.20.1': 1248 | optional: true 1249 | 1250 | '@esbuild/sunos-x64@0.20.1': 1251 | optional: true 1252 | 1253 | '@esbuild/win32-arm64@0.20.1': 1254 | optional: true 1255 | 1256 | '@esbuild/win32-ia32@0.20.1': 1257 | optional: true 1258 | 1259 | '@esbuild/win32-x64@0.20.1': 1260 | optional: true 1261 | 1262 | '@isaacs/cliui@8.0.2': 1263 | dependencies: 1264 | string-width: 5.1.2 1265 | string-width-cjs: string-width@4.2.3 1266 | strip-ansi: 7.1.0 1267 | strip-ansi-cjs: strip-ansi@6.0.1 1268 | wrap-ansi: 8.1.0 1269 | wrap-ansi-cjs: wrap-ansi@7.0.0 1270 | 1271 | '@jridgewell/gen-mapping@0.3.5': 1272 | dependencies: 1273 | '@jridgewell/set-array': 1.2.1 1274 | '@jridgewell/sourcemap-codec': 1.4.15 1275 | '@jridgewell/trace-mapping': 0.3.25 1276 | 1277 | '@jridgewell/resolve-uri@3.1.2': {} 1278 | 1279 | '@jridgewell/set-array@1.2.1': {} 1280 | 1281 | '@jridgewell/sourcemap-codec@1.4.15': {} 1282 | 1283 | '@jridgewell/sourcemap-codec@1.5.0': {} 1284 | 1285 | '@jridgewell/trace-mapping@0.3.25': 1286 | dependencies: 1287 | '@jridgewell/resolve-uri': 3.1.2 1288 | '@jridgewell/sourcemap-codec': 1.4.15 1289 | 1290 | '@nodelib/fs.scandir@2.1.5': 1291 | dependencies: 1292 | '@nodelib/fs.stat': 2.0.5 1293 | run-parallel: 1.2.0 1294 | 1295 | '@nodelib/fs.stat@2.0.5': {} 1296 | 1297 | '@nodelib/fs.walk@1.2.8': 1298 | dependencies: 1299 | '@nodelib/fs.scandir': 2.1.5 1300 | fastq: 1.17.1 1301 | 1302 | '@pkgjs/parseargs@0.11.0': 1303 | optional: true 1304 | 1305 | '@rollup/rollup-android-arm-eabi@4.17.2': 1306 | optional: true 1307 | 1308 | '@rollup/rollup-android-arm64@4.17.2': 1309 | optional: true 1310 | 1311 | '@rollup/rollup-darwin-arm64@4.17.2': 1312 | optional: true 1313 | 1314 | '@rollup/rollup-darwin-x64@4.17.2': 1315 | optional: true 1316 | 1317 | '@rollup/rollup-linux-arm-gnueabihf@4.17.2': 1318 | optional: true 1319 | 1320 | '@rollup/rollup-linux-arm-musleabihf@4.17.2': 1321 | optional: true 1322 | 1323 | '@rollup/rollup-linux-arm64-gnu@4.17.2': 1324 | optional: true 1325 | 1326 | '@rollup/rollup-linux-arm64-musl@4.17.2': 1327 | optional: true 1328 | 1329 | '@rollup/rollup-linux-powerpc64le-gnu@4.17.2': 1330 | optional: true 1331 | 1332 | '@rollup/rollup-linux-riscv64-gnu@4.17.2': 1333 | optional: true 1334 | 1335 | '@rollup/rollup-linux-s390x-gnu@4.17.2': 1336 | optional: true 1337 | 1338 | '@rollup/rollup-linux-x64-gnu@4.17.2': 1339 | optional: true 1340 | 1341 | '@rollup/rollup-linux-x64-musl@4.17.2': 1342 | optional: true 1343 | 1344 | '@rollup/rollup-win32-arm64-msvc@4.17.2': 1345 | optional: true 1346 | 1347 | '@rollup/rollup-win32-ia32-msvc@4.17.2': 1348 | optional: true 1349 | 1350 | '@rollup/rollup-win32-x64-msvc@4.17.2': 1351 | optional: true 1352 | 1353 | '@types/chai-subset@1.3.3': 1354 | dependencies: 1355 | '@types/chai': 4.3.5 1356 | 1357 | '@types/chai@4.3.5': {} 1358 | 1359 | '@types/eslint-visitor-keys@1.0.0': {} 1360 | 1361 | '@types/estree@1.0.5': {} 1362 | 1363 | '@types/node@14.14.35': {} 1364 | 1365 | '@types/resolve@1.20.6': {} 1366 | 1367 | '@vitest/expect@0.31.0': 1368 | dependencies: 1369 | '@vitest/spy': 0.31.0 1370 | '@vitest/utils': 0.31.0 1371 | chai: 4.3.7 1372 | 1373 | '@vitest/runner@0.31.0': 1374 | dependencies: 1375 | '@vitest/utils': 0.31.0 1376 | concordance: 5.0.4 1377 | p-limit: 4.0.0 1378 | pathe: 1.1.0 1379 | 1380 | '@vitest/snapshot@0.31.0': 1381 | dependencies: 1382 | magic-string: 0.30.11 1383 | pathe: 1.1.0 1384 | pretty-format: 27.5.1 1385 | 1386 | '@vitest/spy@0.31.0': 1387 | dependencies: 1388 | tinyspy: 2.1.0 1389 | 1390 | '@vitest/utils@0.31.0': 1391 | dependencies: 1392 | concordance: 5.0.4 1393 | loupe: 2.3.6 1394 | pretty-format: 27.5.1 1395 | 1396 | acorn-walk@8.2.0: {} 1397 | 1398 | acorn@8.8.2: {} 1399 | 1400 | ansi-regex@5.0.1: {} 1401 | 1402 | ansi-regex@6.0.1: {} 1403 | 1404 | ansi-styles@4.3.0: 1405 | dependencies: 1406 | color-convert: 2.0.1 1407 | 1408 | ansi-styles@5.2.0: {} 1409 | 1410 | ansi-styles@6.2.1: {} 1411 | 1412 | any-promise@1.3.0: {} 1413 | 1414 | anymatch@3.1.3: 1415 | dependencies: 1416 | normalize-path: 3.0.0 1417 | picomatch: 2.3.1 1418 | 1419 | array-union@2.1.0: {} 1420 | 1421 | assertion-error@1.1.0: {} 1422 | 1423 | balanced-match@1.0.2: {} 1424 | 1425 | binary-extensions@2.3.0: {} 1426 | 1427 | blueimp-md5@2.19.0: {} 1428 | 1429 | brace-expansion@2.0.1: 1430 | dependencies: 1431 | balanced-match: 1.0.2 1432 | 1433 | braces@3.0.2: 1434 | dependencies: 1435 | fill-range: 7.0.1 1436 | 1437 | bundle-require@4.1.0(esbuild@0.20.1): 1438 | dependencies: 1439 | esbuild: 0.20.1 1440 | load-tsconfig: 0.2.5 1441 | 1442 | cac@6.7.14: {} 1443 | 1444 | chai@4.3.7: 1445 | dependencies: 1446 | assertion-error: 1.1.0 1447 | check-error: 1.0.2 1448 | deep-eql: 4.1.3 1449 | get-func-name: 2.0.0 1450 | loupe: 2.3.6 1451 | pathval: 1.1.1 1452 | type-detect: 4.0.8 1453 | 1454 | chalk@4.1.2: 1455 | dependencies: 1456 | ansi-styles: 4.3.0 1457 | supports-color: 7.2.0 1458 | 1459 | check-error@1.0.2: {} 1460 | 1461 | chokidar@3.6.0: 1462 | dependencies: 1463 | anymatch: 3.1.3 1464 | braces: 3.0.2 1465 | glob-parent: 5.1.2 1466 | is-binary-path: 2.1.0 1467 | is-glob: 4.0.3 1468 | normalize-path: 3.0.0 1469 | readdirp: 3.6.0 1470 | optionalDependencies: 1471 | fsevents: 2.3.2 1472 | 1473 | cliui@8.0.1: 1474 | dependencies: 1475 | string-width: 4.2.3 1476 | strip-ansi: 6.0.1 1477 | wrap-ansi: 7.0.0 1478 | 1479 | color-convert@2.0.1: 1480 | dependencies: 1481 | color-name: 1.1.4 1482 | 1483 | color-name@1.1.4: {} 1484 | 1485 | commander@4.1.1: {} 1486 | 1487 | concordance@5.0.4: 1488 | dependencies: 1489 | date-time: 3.1.0 1490 | esutils: 2.0.3 1491 | fast-diff: 1.2.0 1492 | js-string-escape: 1.0.1 1493 | lodash: 4.17.21 1494 | md5-hex: 3.0.1 1495 | semver: 7.3.4 1496 | well-known-symbols: 2.0.0 1497 | 1498 | concurrently@8.2.2: 1499 | dependencies: 1500 | chalk: 4.1.2 1501 | date-fns: 2.30.0 1502 | lodash: 4.17.21 1503 | rxjs: 7.8.1 1504 | shell-quote: 1.8.1 1505 | spawn-command: 0.0.2 1506 | supports-color: 8.1.1 1507 | tree-kill: 1.2.2 1508 | yargs: 17.7.2 1509 | 1510 | cross-spawn@7.0.3: 1511 | dependencies: 1512 | path-key: 3.1.1 1513 | shebang-command: 2.0.0 1514 | which: 2.0.2 1515 | 1516 | date-fns@2.30.0: 1517 | dependencies: 1518 | '@babel/runtime': 7.24.5 1519 | 1520 | date-time@3.1.0: 1521 | dependencies: 1522 | time-zone: 1.0.0 1523 | 1524 | debug@4.3.4: 1525 | dependencies: 1526 | ms: 2.1.2 1527 | 1528 | dedent@0.7.0: {} 1529 | 1530 | deep-eql@4.1.3: 1531 | dependencies: 1532 | type-detect: 4.0.8 1533 | 1534 | dir-glob@3.0.1: 1535 | dependencies: 1536 | path-type: 4.0.0 1537 | 1538 | eastasianwidth@0.2.0: {} 1539 | 1540 | emoji-regex@8.0.0: {} 1541 | 1542 | emoji-regex@9.2.2: {} 1543 | 1544 | endent@2.1.0: 1545 | dependencies: 1546 | dedent: 0.7.0 1547 | fast-json-parse: 1.0.3 1548 | objectorarray: 1.0.5 1549 | 1550 | esbuild-plugin-alias@0.2.1: {} 1551 | 1552 | esbuild@0.20.1: 1553 | optionalDependencies: 1554 | '@esbuild/aix-ppc64': 0.20.1 1555 | '@esbuild/android-arm': 0.20.1 1556 | '@esbuild/android-arm64': 0.20.1 1557 | '@esbuild/android-x64': 0.20.1 1558 | '@esbuild/darwin-arm64': 0.20.1 1559 | '@esbuild/darwin-x64': 0.20.1 1560 | '@esbuild/freebsd-arm64': 0.20.1 1561 | '@esbuild/freebsd-x64': 0.20.1 1562 | '@esbuild/linux-arm': 0.20.1 1563 | '@esbuild/linux-arm64': 0.20.1 1564 | '@esbuild/linux-ia32': 0.20.1 1565 | '@esbuild/linux-loong64': 0.20.1 1566 | '@esbuild/linux-mips64el': 0.20.1 1567 | '@esbuild/linux-ppc64': 0.20.1 1568 | '@esbuild/linux-riscv64': 0.20.1 1569 | '@esbuild/linux-s390x': 0.20.1 1570 | '@esbuild/linux-x64': 0.20.1 1571 | '@esbuild/netbsd-x64': 0.20.1 1572 | '@esbuild/openbsd-x64': 0.20.1 1573 | '@esbuild/sunos-x64': 0.20.1 1574 | '@esbuild/win32-arm64': 0.20.1 1575 | '@esbuild/win32-ia32': 0.20.1 1576 | '@esbuild/win32-x64': 0.20.1 1577 | 1578 | escalade@3.1.2: {} 1579 | 1580 | eslint-visitor-keys@3.3.0: {} 1581 | 1582 | esutils@2.0.3: {} 1583 | 1584 | execa@5.1.1: 1585 | dependencies: 1586 | cross-spawn: 7.0.3 1587 | get-stream: 6.0.1 1588 | human-signals: 2.1.0 1589 | is-stream: 2.0.1 1590 | merge-stream: 2.0.0 1591 | npm-run-path: 4.0.1 1592 | onetime: 5.1.2 1593 | signal-exit: 3.0.7 1594 | strip-final-newline: 2.0.0 1595 | 1596 | fast-diff@1.2.0: {} 1597 | 1598 | fast-glob@3.3.2: 1599 | dependencies: 1600 | '@nodelib/fs.stat': 2.0.5 1601 | '@nodelib/fs.walk': 1.2.8 1602 | glob-parent: 5.1.2 1603 | merge2: 1.4.1 1604 | micromatch: 4.0.5 1605 | 1606 | fast-json-parse@1.0.3: {} 1607 | 1608 | fastq@1.17.1: 1609 | dependencies: 1610 | reusify: 1.0.4 1611 | 1612 | fill-range@7.0.1: 1613 | dependencies: 1614 | to-regex-range: 5.0.1 1615 | 1616 | foreground-child@3.1.1: 1617 | dependencies: 1618 | cross-spawn: 7.0.3 1619 | signal-exit: 4.1.0 1620 | 1621 | fsevents@2.3.2: 1622 | optional: true 1623 | 1624 | function-bind@1.1.2: {} 1625 | 1626 | get-caller-file@2.0.5: {} 1627 | 1628 | get-func-name@2.0.0: {} 1629 | 1630 | get-stream@6.0.1: {} 1631 | 1632 | glob-parent@5.1.2: 1633 | dependencies: 1634 | is-glob: 4.0.3 1635 | 1636 | glob@10.3.15: 1637 | dependencies: 1638 | foreground-child: 3.1.1 1639 | jackspeak: 2.3.6 1640 | minimatch: 9.0.4 1641 | minipass: 7.1.1 1642 | path-scurry: 1.11.1 1643 | 1644 | globby@11.1.0: 1645 | dependencies: 1646 | array-union: 2.1.0 1647 | dir-glob: 3.0.1 1648 | fast-glob: 3.3.2 1649 | ignore: 5.3.1 1650 | merge2: 1.4.1 1651 | slash: 3.0.0 1652 | 1653 | has-flag@4.0.0: {} 1654 | 1655 | hasown@2.0.2: 1656 | dependencies: 1657 | function-bind: 1.1.2 1658 | 1659 | human-signals@2.1.0: {} 1660 | 1661 | ignore@5.3.1: {} 1662 | 1663 | is-binary-path@2.1.0: 1664 | dependencies: 1665 | binary-extensions: 2.3.0 1666 | 1667 | is-core-module@2.13.1: 1668 | dependencies: 1669 | hasown: 2.0.2 1670 | 1671 | is-extglob@2.1.1: {} 1672 | 1673 | is-fullwidth-code-point@3.0.0: {} 1674 | 1675 | is-glob@4.0.3: 1676 | dependencies: 1677 | is-extglob: 2.1.1 1678 | 1679 | is-number@7.0.0: {} 1680 | 1681 | is-stream@2.0.1: {} 1682 | 1683 | isexe@2.0.0: {} 1684 | 1685 | jackspeak@2.3.6: 1686 | dependencies: 1687 | '@isaacs/cliui': 8.0.2 1688 | optionalDependencies: 1689 | '@pkgjs/parseargs': 0.11.0 1690 | 1691 | joycon@3.1.1: {} 1692 | 1693 | js-string-escape@1.0.1: {} 1694 | 1695 | jsonc-parser@3.2.0: {} 1696 | 1697 | lilconfig@3.1.1: {} 1698 | 1699 | lines-and-columns@1.2.4: {} 1700 | 1701 | load-tsconfig@0.2.5: {} 1702 | 1703 | local-pkg@0.4.3: {} 1704 | 1705 | lodash.sortby@4.7.0: {} 1706 | 1707 | lodash@4.17.21: {} 1708 | 1709 | loupe@2.3.6: 1710 | dependencies: 1711 | get-func-name: 2.0.0 1712 | 1713 | lru-cache@10.2.2: {} 1714 | 1715 | lru-cache@6.0.0: 1716 | dependencies: 1717 | yallist: 4.0.0 1718 | 1719 | magic-string@0.30.11: 1720 | dependencies: 1721 | '@jridgewell/sourcemap-codec': 1.5.0 1722 | 1723 | md5-hex@3.0.1: 1724 | dependencies: 1725 | blueimp-md5: 2.19.0 1726 | 1727 | merge-stream@2.0.0: {} 1728 | 1729 | merge2@1.4.1: {} 1730 | 1731 | meriyah@4.3.5: {} 1732 | 1733 | micromatch@4.0.5: 1734 | dependencies: 1735 | braces: 3.0.2 1736 | picomatch: 2.3.1 1737 | 1738 | mimic-fn@2.1.0: {} 1739 | 1740 | minimatch@9.0.4: 1741 | dependencies: 1742 | brace-expansion: 2.0.1 1743 | 1744 | minipass@7.1.1: {} 1745 | 1746 | mlly@1.2.1: 1747 | dependencies: 1748 | acorn: 8.8.2 1749 | pathe: 1.1.0 1750 | pkg-types: 1.0.3 1751 | ufo: 1.1.2 1752 | 1753 | ms@2.1.2: {} 1754 | 1755 | mz@2.7.0: 1756 | dependencies: 1757 | any-promise: 1.3.0 1758 | object-assign: 4.1.1 1759 | thenify-all: 1.6.0 1760 | 1761 | nanoid@3.3.6: {} 1762 | 1763 | nanoid@3.3.7: 1764 | optional: true 1765 | 1766 | normalize-path@3.0.0: {} 1767 | 1768 | npm-run-path@4.0.1: 1769 | dependencies: 1770 | path-key: 3.1.1 1771 | 1772 | object-assign@4.1.1: {} 1773 | 1774 | objectorarray@1.0.5: {} 1775 | 1776 | onetime@5.1.2: 1777 | dependencies: 1778 | mimic-fn: 2.1.0 1779 | 1780 | p-limit@4.0.0: 1781 | dependencies: 1782 | yocto-queue: 1.0.0 1783 | 1784 | path-browserify@1.0.1: {} 1785 | 1786 | path-key@3.1.1: {} 1787 | 1788 | path-parse@1.0.7: {} 1789 | 1790 | path-scurry@1.11.1: 1791 | dependencies: 1792 | lru-cache: 10.2.2 1793 | minipass: 7.1.1 1794 | 1795 | path-type@4.0.0: {} 1796 | 1797 | pathe@1.1.0: {} 1798 | 1799 | pathval@1.1.1: {} 1800 | 1801 | picocolors@1.0.0: {} 1802 | 1803 | picocolors@1.0.1: 1804 | optional: true 1805 | 1806 | picomatch@2.3.1: {} 1807 | 1808 | pirates@4.0.6: {} 1809 | 1810 | pkg-types@1.0.3: 1811 | dependencies: 1812 | jsonc-parser: 3.2.0 1813 | mlly: 1.2.1 1814 | pathe: 1.1.0 1815 | 1816 | postcss-load-config@4.0.2(postcss@8.4.41): 1817 | dependencies: 1818 | lilconfig: 3.1.1 1819 | yaml: 2.4.2 1820 | optionalDependencies: 1821 | postcss: 8.4.41 1822 | 1823 | postcss@8.4.23: 1824 | dependencies: 1825 | nanoid: 3.3.6 1826 | picocolors: 1.0.0 1827 | source-map-js: 1.0.2 1828 | 1829 | postcss@8.4.41: 1830 | dependencies: 1831 | nanoid: 3.3.7 1832 | picocolors: 1.0.1 1833 | source-map-js: 1.2.0 1834 | optional: true 1835 | 1836 | prettier@2.2.1: {} 1837 | 1838 | pretty-format@27.5.1: 1839 | dependencies: 1840 | ansi-regex: 5.0.1 1841 | ansi-styles: 5.2.0 1842 | react-is: 17.0.1 1843 | 1844 | punycode@2.3.1: {} 1845 | 1846 | queue-microtask@1.2.3: {} 1847 | 1848 | react-is@17.0.1: {} 1849 | 1850 | readdirp@3.6.0: 1851 | dependencies: 1852 | picomatch: 2.3.1 1853 | 1854 | regenerator-runtime@0.14.1: {} 1855 | 1856 | require-directory@2.1.1: {} 1857 | 1858 | resolve-from@5.0.0: {} 1859 | 1860 | resolve@1.22.8: 1861 | dependencies: 1862 | is-core-module: 2.13.1 1863 | path-parse: 1.0.7 1864 | supports-preserve-symlinks-flag: 1.0.0 1865 | 1866 | reusify@1.0.4: {} 1867 | 1868 | rollup@3.21.7: 1869 | optionalDependencies: 1870 | fsevents: 2.3.2 1871 | 1872 | rollup@4.17.2: 1873 | dependencies: 1874 | '@types/estree': 1.0.5 1875 | optionalDependencies: 1876 | '@rollup/rollup-android-arm-eabi': 4.17.2 1877 | '@rollup/rollup-android-arm64': 4.17.2 1878 | '@rollup/rollup-darwin-arm64': 4.17.2 1879 | '@rollup/rollup-darwin-x64': 4.17.2 1880 | '@rollup/rollup-linux-arm-gnueabihf': 4.17.2 1881 | '@rollup/rollup-linux-arm-musleabihf': 4.17.2 1882 | '@rollup/rollup-linux-arm64-gnu': 4.17.2 1883 | '@rollup/rollup-linux-arm64-musl': 4.17.2 1884 | '@rollup/rollup-linux-powerpc64le-gnu': 4.17.2 1885 | '@rollup/rollup-linux-riscv64-gnu': 4.17.2 1886 | '@rollup/rollup-linux-s390x-gnu': 4.17.2 1887 | '@rollup/rollup-linux-x64-gnu': 4.17.2 1888 | '@rollup/rollup-linux-x64-musl': 4.17.2 1889 | '@rollup/rollup-win32-arm64-msvc': 4.17.2 1890 | '@rollup/rollup-win32-ia32-msvc': 4.17.2 1891 | '@rollup/rollup-win32-x64-msvc': 4.17.2 1892 | fsevents: 2.3.2 1893 | 1894 | run-parallel@1.2.0: 1895 | dependencies: 1896 | queue-microtask: 1.2.3 1897 | 1898 | rxjs@7.8.1: 1899 | dependencies: 1900 | tslib: 2.6.2 1901 | 1902 | semver@7.3.4: 1903 | dependencies: 1904 | lru-cache: 6.0.0 1905 | 1906 | shebang-command@2.0.0: 1907 | dependencies: 1908 | shebang-regex: 3.0.0 1909 | 1910 | shebang-regex@3.0.0: {} 1911 | 1912 | shell-quote@1.8.1: {} 1913 | 1914 | siginfo@2.0.0: {} 1915 | 1916 | signal-exit@3.0.7: {} 1917 | 1918 | signal-exit@4.1.0: {} 1919 | 1920 | slash@3.0.0: {} 1921 | 1922 | source-map-js@1.0.2: {} 1923 | 1924 | source-map-js@1.2.0: 1925 | optional: true 1926 | 1927 | source-map@0.8.0-beta.0: 1928 | dependencies: 1929 | whatwg-url: 7.1.0 1930 | 1931 | spawn-command@0.0.2: {} 1932 | 1933 | stackback@0.0.2: {} 1934 | 1935 | std-env@3.3.3: {} 1936 | 1937 | string-width@4.2.3: 1938 | dependencies: 1939 | emoji-regex: 8.0.0 1940 | is-fullwidth-code-point: 3.0.0 1941 | strip-ansi: 6.0.1 1942 | 1943 | string-width@5.1.2: 1944 | dependencies: 1945 | eastasianwidth: 0.2.0 1946 | emoji-regex: 9.2.2 1947 | strip-ansi: 7.1.0 1948 | 1949 | strip-ansi@6.0.1: 1950 | dependencies: 1951 | ansi-regex: 5.0.1 1952 | 1953 | strip-ansi@7.1.0: 1954 | dependencies: 1955 | ansi-regex: 6.0.1 1956 | 1957 | strip-final-newline@2.0.0: {} 1958 | 1959 | strip-literal@1.0.1: 1960 | dependencies: 1961 | acorn: 8.8.2 1962 | 1963 | sucrase@3.35.0: 1964 | dependencies: 1965 | '@jridgewell/gen-mapping': 0.3.5 1966 | commander: 4.1.1 1967 | glob: 10.3.15 1968 | lines-and-columns: 1.2.4 1969 | mz: 2.7.0 1970 | pirates: 4.0.6 1971 | ts-interface-checker: 0.1.13 1972 | 1973 | supports-color@7.2.0: 1974 | dependencies: 1975 | has-flag: 4.0.0 1976 | 1977 | supports-color@8.1.1: 1978 | dependencies: 1979 | has-flag: 4.0.0 1980 | 1981 | supports-preserve-symlinks-flag@1.0.0: {} 1982 | 1983 | thenify-all@1.6.0: 1984 | dependencies: 1985 | thenify: 3.3.1 1986 | 1987 | thenify@3.3.1: 1988 | dependencies: 1989 | any-promise: 1.3.0 1990 | 1991 | time-zone@1.0.0: {} 1992 | 1993 | tinybench@2.5.0: {} 1994 | 1995 | tinypool@0.5.0: {} 1996 | 1997 | tinyspy@2.1.0: {} 1998 | 1999 | to-regex-range@5.0.1: 2000 | dependencies: 2001 | is-number: 7.0.0 2002 | 2003 | tr46@1.0.1: 2004 | dependencies: 2005 | punycode: 2.3.1 2006 | 2007 | tree-kill@1.2.2: {} 2008 | 2009 | ts-interface-checker@0.1.13: {} 2010 | 2011 | tslib@2.6.2: {} 2012 | 2013 | tsup@8.0.2(postcss@8.4.41)(typescript@5.3.3): 2014 | dependencies: 2015 | bundle-require: 4.1.0(esbuild@0.20.1) 2016 | cac: 6.7.14 2017 | chokidar: 3.6.0 2018 | debug: 4.3.4 2019 | esbuild: 0.20.1 2020 | execa: 5.1.1 2021 | globby: 11.1.0 2022 | joycon: 3.1.1 2023 | postcss-load-config: 4.0.2(postcss@8.4.41) 2024 | resolve-from: 5.0.0 2025 | rollup: 4.17.2 2026 | source-map: 0.8.0-beta.0 2027 | sucrase: 3.35.0 2028 | tree-kill: 1.2.2 2029 | optionalDependencies: 2030 | postcss: 8.4.41 2031 | typescript: 5.3.3 2032 | transitivePeerDependencies: 2033 | - supports-color 2034 | - ts-node 2035 | 2036 | type-detect@4.0.8: {} 2037 | 2038 | typescript@5.3.3: {} 2039 | 2040 | ufo@1.1.2: {} 2041 | 2042 | vite-node@0.31.0(@types/node@14.14.35): 2043 | dependencies: 2044 | cac: 6.7.14 2045 | debug: 4.3.4 2046 | mlly: 1.2.1 2047 | pathe: 1.1.0 2048 | picocolors: 1.0.0 2049 | vite: 4.3.6(@types/node@14.14.35) 2050 | transitivePeerDependencies: 2051 | - '@types/node' 2052 | - less 2053 | - sass 2054 | - stylus 2055 | - sugarss 2056 | - supports-color 2057 | - terser 2058 | 2059 | vite@4.3.6(@types/node@14.14.35): 2060 | dependencies: 2061 | esbuild: 0.20.1 2062 | postcss: 8.4.23 2063 | rollup: 3.21.7 2064 | optionalDependencies: 2065 | '@types/node': 14.14.35 2066 | fsevents: 2.3.2 2067 | 2068 | vitest@0.31.0: 2069 | dependencies: 2070 | '@types/chai': 4.3.5 2071 | '@types/chai-subset': 1.3.3 2072 | '@types/node': 14.14.35 2073 | '@vitest/expect': 0.31.0 2074 | '@vitest/runner': 0.31.0 2075 | '@vitest/snapshot': 0.31.0 2076 | '@vitest/spy': 0.31.0 2077 | '@vitest/utils': 0.31.0 2078 | acorn: 8.8.2 2079 | acorn-walk: 8.2.0 2080 | cac: 6.7.14 2081 | chai: 4.3.7 2082 | concordance: 5.0.4 2083 | debug: 4.3.4 2084 | local-pkg: 0.4.3 2085 | magic-string: 0.30.11 2086 | pathe: 1.1.0 2087 | picocolors: 1.0.0 2088 | std-env: 3.3.3 2089 | strip-literal: 1.0.1 2090 | tinybench: 2.5.0 2091 | tinypool: 0.5.0 2092 | vite: 4.3.6(@types/node@14.14.35) 2093 | vite-node: 0.31.0(@types/node@14.14.35) 2094 | why-is-node-running: 2.2.2 2095 | transitivePeerDependencies: 2096 | - less 2097 | - sass 2098 | - stylus 2099 | - sugarss 2100 | - supports-color 2101 | - terser 2102 | 2103 | webidl-conversions@4.0.2: {} 2104 | 2105 | well-known-symbols@2.0.0: {} 2106 | 2107 | whatwg-url@7.1.0: 2108 | dependencies: 2109 | lodash.sortby: 4.7.0 2110 | tr46: 1.0.1 2111 | webidl-conversions: 4.0.2 2112 | 2113 | which@2.0.2: 2114 | dependencies: 2115 | isexe: 2.0.0 2116 | 2117 | why-is-node-running@2.2.2: 2118 | dependencies: 2119 | siginfo: 2.0.0 2120 | stackback: 0.0.2 2121 | 2122 | wrap-ansi@7.0.0: 2123 | dependencies: 2124 | ansi-styles: 4.3.0 2125 | string-width: 4.2.3 2126 | strip-ansi: 6.0.1 2127 | 2128 | wrap-ansi@8.1.0: 2129 | dependencies: 2130 | ansi-styles: 6.2.1 2131 | string-width: 5.1.2 2132 | strip-ansi: 7.1.0 2133 | 2134 | y18n@5.0.8: {} 2135 | 2136 | yallist@4.0.0: {} 2137 | 2138 | yaml@2.4.2: {} 2139 | 2140 | yargs-parser@21.1.1: {} 2141 | 2142 | yargs@17.7.2: 2143 | dependencies: 2144 | cliui: 8.0.1 2145 | escalade: 3.1.2 2146 | get-caller-file: 2.0.5 2147 | require-directory: 2.1.1 2148 | string-width: 4.2.3 2149 | y18n: 5.0.8 2150 | yargs-parser: 21.1.1 2151 | 2152 | yocto-queue@1.0.0: {} 2153 | -------------------------------------------------------------------------------- /scripts/extractTypeGuards.js: -------------------------------------------------------------------------------- 1 | const { KEYS } = require('eslint-visitor-keys') 2 | const endent = require('endent').default 3 | const fs = require('fs') 4 | 5 | let lines = [ 6 | '// Generated by ../scripts/extractTypeGuards.js', 7 | 'import { Any } from "@alloc/types"', 8 | 'import { ESTree } from "meriyah"', 9 | 'import { Node } from "./Node"', 10 | '', 11 | 'type SpecificNode = [T] extends [Any] ? Extract : Extract', 12 | '', 13 | 'declare module "./Node" {', 14 | 'export namespace Node {', 15 | ] 16 | 17 | let append = text => lines.push(' ' + endent(text)) 18 | 19 | const lookup = [] 20 | const guards = [] 21 | const staticGuards = [] 22 | 23 | for (let type in KEYS) { 24 | if (type.startsWith('Experimental')) { 25 | continue 26 | } 27 | 28 | lookup.push(` 29 | ${type}: Node.${type} 30 | `) 31 | staticGuards.push(` 32 | is${type}(arg: T): arg is SpecificNode 33 | `) 34 | 35 | if (type == 'Literal') { 36 | continue 37 | } 38 | 39 | append(` 40 | export interface ${type} extends Node {} 41 | `) 42 | guards.push(` 43 | is${type}(): this is Node.${type} 44 | `) 45 | } 46 | 47 | lines.push('}}', '') 48 | 49 | lines.push('export interface TypeLookup {') 50 | lookup.forEach(append) 51 | lines.push('}', '') 52 | 53 | lines.push('export interface TypeGuards {') 54 | guards.forEach(append) 55 | lines.push('}', '') 56 | 57 | lines.push('export interface StaticTypeGuards {') 58 | staticGuards.forEach(append) 59 | lines.push('}') 60 | 61 | fs.writeFileSync('src/typeGuards.ts', lines.join('\n')) 62 | -------------------------------------------------------------------------------- /spec/README.md: -------------------------------------------------------------------------------- 1 | # Test suite 2 | 3 | 100% test coverage is not the goal quite yet. 4 | 5 | We still need a lot of basic test cases for `Node` methods. 6 | 7 | Any help would be greatly appreciated! 8 | 9 | -------------------------------------------------------------------------------- /spec/mutation.test.ts: -------------------------------------------------------------------------------- 1 | import { describe, expect, test } from 'vitest' 2 | import endent from 'endent' 3 | import { nebu } from '../src/nebu' 4 | import util from 'util' 5 | 6 | describe('node.set:', () => { 7 | test('node child', () => { 8 | const input = 'let a = 1' 9 | const output = nebu.process(input, { 10 | VariableDeclarator: node => { 11 | node.set('id', 'b') 12 | }, 13 | }) 14 | 15 | expect(output.js).toBe('let b = 1') 16 | }) 17 | 18 | describe('array child', () => { 19 | test('(array destructuring)', () => { 20 | const input = 'let [a, b] = [1, 2]' 21 | const output = nebu.process(input, { 22 | ArrayPattern: node => { 23 | node.set('elements', 'c, d') 24 | }, 25 | }) 26 | 27 | expect(output.js).toBe('let [c, d] = [1, 2]') 28 | }) 29 | 30 | test('(empty array literal)', () => { 31 | const input = 'let a = []' 32 | const output = nebu.process(input, { 33 | ArrayExpression: node => { 34 | node.set('elements', '1, 2') 35 | }, 36 | }) 37 | 38 | expect(output.js).toBe('let a = [1, 2]') 39 | }) 40 | 41 | test.only('(multi-line array literal)', () => { 42 | const input = endent` 43 | let a = [ 44 | 1, 2, 3, 45 | 4, 5, 6, 46 | ] 47 | ` 48 | const output = nebu.process(input, { 49 | ArrayExpression: node => { 50 | node.set('elements', '') 51 | }, 52 | }) 53 | 54 | expect(output.js).toBe('let a = []') 55 | }) 56 | }) 57 | 58 | test('block statement child', () => { 59 | const input = endent` 60 | try { 61 | a() 62 | b() 63 | } catch(e) {} 64 | ` 65 | const output = nebu.process(input, { 66 | TryStatement: node => { 67 | node.set( 68 | 'block', 69 | endent` 70 | if (a()) { 71 | return b() 72 | } 73 | ` 74 | ) 75 | }, 76 | }) 77 | 78 | expect(output.js).toBe(endent` 79 | try { 80 | if (a()) { 81 | return b() 82 | } 83 | } catch(e) {} 84 | `) 85 | }) 86 | }) 87 | // describe('node.push:', () => { 88 | // }); 89 | 90 | // describe('node.unshift:', () => { 91 | // }); 92 | 93 | // describe('node.splice:', () => { 94 | // }); 95 | 96 | describe('node.before:', () => { 97 | test('one-line block body', () => { 98 | const input = 'if (true) foo()' 99 | const output = nebu.process(input, { 100 | CallExpression: node => { 101 | node.before('bar() && ') 102 | }, 103 | }) 104 | 105 | expect(output.js).toBe('if (true) bar() && foo()') 106 | }) 107 | 108 | test('two calls', () => { 109 | const input = 'x' 110 | const output = nebu.process(input, { 111 | Identifier: node => { 112 | node.before('y') 113 | node.before('z') 114 | }, 115 | }) 116 | 117 | expect(output.js).toBe('zyx') 118 | }) 119 | }) 120 | 121 | describe('node.after:', () => { 122 | test('two calls', () => { 123 | const input = 'x' 124 | const output = nebu.process(input, { 125 | Identifier: node => { 126 | node.after('y') 127 | node.after('z') 128 | }, 129 | }) 130 | 131 | expect(output.js).toBe('xyz') 132 | }) 133 | 134 | test('array element', () => { 135 | const input = 'let a = [1, 2, 3]' 136 | const output = nebu.process(input, { 137 | ArrayExpression: node => { 138 | node.elements[1]!.after('4') 139 | }, 140 | }) 141 | 142 | expect(output.js).toBe('let a = [1, 24, 3]') 143 | }) 144 | }) 145 | 146 | // describe('node.indent:', () => { 147 | // }); 148 | 149 | // describe('node.dedent:', () => { 150 | // }); 151 | 152 | // describe('node.replace:', () => { 153 | // }); 154 | 155 | // describe('node.remove:', () => { 156 | // }); 157 | 158 | function inspect(obj: any) { 159 | console.log(util.inspect(obj, false, 5, true)) 160 | } 161 | -------------------------------------------------------------------------------- /spec/sourcemap.test.ts: -------------------------------------------------------------------------------- 1 | import { describe, expect, test } from 'vitest' 2 | import { nebu } from '../src/nebu' 3 | 4 | const code = 'let a = 1' 5 | const plugins = [{ Program() {} }] 6 | const mapUrlRE = /\/\/# sourceMappingURL=(.+)/ 7 | 8 | describe('sourceMap: true', () => { 9 | test('(no filenames)', () => { 10 | const res = nebu.process(code, { 11 | plugins, 12 | sourceMap: true, 13 | }) 14 | 15 | expect(res && typeof res).toBe('object') 16 | expect(typeof res.js).toBe('string') 17 | expect(mapUrlRE.test(res.js)).toBe(false) 18 | expect(res.map && typeof res.map).toBe('object') 19 | }) 20 | 21 | test('(with filenames)', () => { 22 | const res = nebu.process(code, { 23 | plugins, 24 | filename: 'src/a.js', 25 | sourceMap: true, 26 | sourceMapTarget: 'map/a.js.map', 27 | }) 28 | 29 | expect(res && typeof res).toBe('object') 30 | expect(typeof res.js).toBe('string') 31 | expect(mapUrlRE.exec(res.js)?.[1]).toBe('../map/a.js.map') 32 | expect(res.map && typeof res.map).toBe('object') 33 | expect(res.map!.sources[0]).toBe('../src/a.js') 34 | }) 35 | }) 36 | 37 | test('sourceMap: "inline"', () => { 38 | const res = nebu.process(code, { 39 | plugins, 40 | sourceMap: 'inline', 41 | }) 42 | 43 | expect(typeof res).toBe('object') 44 | const url = mapUrlRE.exec(res.js)! 45 | expect(url).toBeTruthy() 46 | expect(url[1].startsWith('data:application/json;')).toBe(true) 47 | }) 48 | -------------------------------------------------------------------------------- /src/MagicSlice.ts: -------------------------------------------------------------------------------- 1 | import MagicString, { OverwriteOptions } from 'magic-string' 2 | 3 | export class MagicSlice { 4 | readonly sourceStart: number 5 | readonly sourceEnd: number 6 | 7 | constructor( 8 | readonly source: MagicSlice | MagicString, 9 | readonly start: number, 10 | readonly end: number 11 | ) { 12 | const offset = source instanceof MagicSlice ? source.start : 0 13 | this.sourceStart = start - offset 14 | this.sourceEnd = end - offset 15 | } 16 | 17 | get original(): string { 18 | return this.source.original.slice(this.sourceStart, this.sourceEnd) 19 | } 20 | 21 | getIndentString(): string { 22 | return this.source.getIndentString() 23 | } 24 | 25 | append(content: string) { 26 | this.source.appendRight(this.sourceEnd, content) 27 | return this 28 | } 29 | 30 | appendLeft(index: number, content: string) { 31 | this.source.appendLeft(this.sourceStart + index, content) 32 | return this 33 | } 34 | 35 | appendRight(index: number, content: string) { 36 | this.source.appendRight(this.sourceStart + index, content) 37 | return this 38 | } 39 | 40 | move(start: number, end: number, index: number) { 41 | this.source.move(this.sourceStart + start, this.sourceStart + end, index) 42 | return this 43 | } 44 | 45 | overwrite( 46 | start: number, 47 | end: number, 48 | content: string, 49 | options?: boolean | OverwriteOptions 50 | ) { 51 | this.source.overwrite( 52 | this.sourceStart + start, 53 | this.sourceStart + end, 54 | content, 55 | options 56 | ) 57 | return this 58 | } 59 | 60 | prepend(content: string) { 61 | this.source.prependLeft(this.sourceStart, content) 62 | return this 63 | } 64 | 65 | prependLeft(index: number, content: string) { 66 | this.source.prependLeft(this.sourceStart + index, content) 67 | return this 68 | } 69 | 70 | prependRight(index: number, content: string) { 71 | this.source.prependRight(this.sourceStart + index, content) 72 | return this 73 | } 74 | 75 | remove(start: number, end: number) { 76 | this.source.remove(this.sourceStart + start, this.sourceStart + end) 77 | return this 78 | } 79 | 80 | addSourcemapLocation(index: number) { 81 | this.source.addSourcemapLocation(this.sourceStart + index) 82 | } 83 | } 84 | 85 | export function toRelativeIndex( 86 | output: MagicSlice | MagicString, 87 | absoluteIndex: number 88 | ) { 89 | if (output instanceof MagicSlice) { 90 | return absoluteIndex - output.start 91 | } 92 | return absoluteIndex 93 | } 94 | -------------------------------------------------------------------------------- /src/Node.ts: -------------------------------------------------------------------------------- 1 | import { Any } from '@alloc/types' 2 | import { 3 | isArray, 4 | isString, 5 | isNumber, 6 | isBoolean, 7 | isRegExp, 8 | isBigint, 9 | isNull, 10 | } from '@alloc/is' 11 | import { KEYS } from 'eslint-visitor-keys' 12 | import { 13 | ESNode, 14 | NodeConstructor, 15 | ResolveNodeType, 16 | NodeProp, 17 | NodeProps, 18 | NodeType, 19 | Plugin, 20 | Singular, 21 | } from './types' 22 | import { 23 | DeclarationStatement, 24 | ExportDeclaration, 25 | Expression, 26 | IterationStatement, 27 | LeftHandSideExpression, 28 | LiteralExpression, 29 | Parameter, 30 | PrimaryExpression, 31 | Statement, 32 | } from './composite' 33 | import { 34 | findParent, 35 | getArray, 36 | indent, 37 | mergePlugins, 38 | noop, 39 | parseDepth, 40 | stripIndent, 41 | } from './utils' 42 | import { Walker } from './Walker' 43 | import { MagicSlice, toRelativeIndex } from './MagicSlice' 44 | import { getNodeProperties } from './NodeProperties' 45 | import { getContext, popContext, pushContext } from './context' 46 | import { greedyRange } from './utils/greedyRange' 47 | 48 | const literalTypes = { 49 | string: isString, 50 | number: isNumber, 51 | boolean: isBoolean, 52 | null: isNull, 53 | RegExp: isRegExp, 54 | bigint: isBigint, 55 | } 56 | 57 | export class NebuNode { 58 | /** The node type. */ 59 | readonly type: [T] extends [Any] ? NodeType : Extract 60 | /** The character index where this node starts. */ 61 | readonly start: number 62 | /** The character index where this node ends. */ 63 | readonly end: number 64 | /** When true, this node will not exist in the output. */ 65 | removed!: boolean 66 | /** The node that contains this node. */ 67 | parent: Node 68 | /** The key on `parent` that references this node. */ 69 | ref: string 70 | /** @internal */ 71 | yields?: (() => void)[] 72 | /** @internal */ 73 | depth?: number 74 | 75 | constructor(node: T, parent?: Node, ref?: string) { 76 | this.type = node.type as any 77 | this.start = node.start! 78 | this.end = node.end! 79 | this.parent = parent! 80 | this.ref = ref! 81 | 82 | Object.defineProperty(this, 'n', { 83 | value: node, 84 | }) 85 | } 86 | 87 | toString() { 88 | const { input, tab } = getContext() 89 | return stripIndent(input.slice(this.start, this.end), tab) 90 | } 91 | 92 | toJSON() { 93 | return Reflect.get(this, 'n') 94 | } 95 | 96 | process(plugin: Plugin): void 97 | process(plugins: readonly Plugin[]): void 98 | process(state: State, plugins: readonly Plugin[]): void 99 | process(state: any, plugins?: readonly Plugin[]) { 100 | if (!plugins) { 101 | plugins = isArray(state) ? state : [state] 102 | state = null 103 | } 104 | if (!this.removed) { 105 | const { output } = getContext() 106 | const slice = new MagicSlice(output, this.start, this.end) 107 | const visitors = mergePlugins(plugins) 108 | const walker = new Walker(state, visitors as any) 109 | pushContext(slice, walker) 110 | walker.walk(this) 111 | popContext() 112 | } 113 | } 114 | 115 | walk

& Exclude>( 116 | prop: P, 117 | iter: (node: Singular[P]>, i: number) => void 118 | ): void 119 | 120 | walk

>( 121 | prop: P, 122 | iter: (node: Singular, i: number) => void 123 | ): void 124 | 125 | walk(prop: keyof this, iter: (node: any, i: number) => void = noop) { 126 | const val: any = this[prop] 127 | if (val == null) { 128 | return 129 | } 130 | 131 | if (isArray(val)) { 132 | val.forEach(iter) 133 | } else if (val.type) { 134 | iter(val, 0) 135 | } 136 | } 137 | 138 | yield(resume: () => void) { 139 | if (this.yields) { 140 | this.yields.push(resume) 141 | } else { 142 | this.yields = [resume] 143 | } 144 | } 145 | 146 | findParent(match: (node: Node) => boolean): Node | null 147 | findParent(match: T): ResolveNodeType | null 148 | findParent(match: NodeType | ((node: Node) => boolean)) { 149 | return findParent(this, match) 150 | } 151 | 152 | set(prop: NodeProp, code: string) { 153 | const val: any = this[prop as keyof this] 154 | if (val == null) { 155 | return 156 | } 157 | 158 | if (isArray(val)) { 159 | return this.splice(prop, 0, Infinity, code) 160 | } 161 | 162 | if (Node.isBlockStatement(val)) { 163 | return val.splice('body', 0, Infinity, code) 164 | } 165 | 166 | if (Node.isNode(val)) { 167 | const { output, walker } = getContext() 168 | output.overwrite( 169 | toRelativeIndex(output, val.start), 170 | toRelativeIndex(output, val.end), 171 | code 172 | ) 173 | walker.drop(val) 174 | } 175 | } 176 | 177 | push(prop: NodeProp, code: string) { 178 | const { applyHook, output } = getContext() 179 | const arr = getArray(this, prop) 180 | 181 | if (!arr.length && applyHook('pushFirst', this, prop, code)) { 182 | return 183 | } 184 | 185 | let node = arr[arr.length - 1] 186 | if (Node.isNode(node)) { 187 | node.after(code) 188 | } else { 189 | // By default, if the array property is empty, we assume this node 190 | // has braces and append the code after the opening brace. 191 | const val: any = this[prop as keyof this] 192 | node = arr === val ? this : val 193 | if (Node.isNode(node)) { 194 | output.appendRight(toRelativeIndex(output, node.start) + 1, code) 195 | } 196 | } 197 | } 198 | 199 | unshift(prop: NodeProp, code: string) { 200 | const arr = getArray(this, prop) 201 | 202 | let node = arr[0] 203 | if (Node.isNode(node)) { 204 | node.before(code) 205 | } else { 206 | const val: any = this[prop as keyof this] 207 | node = arr === val ? this : val 208 | if (Node.isNode(node)) { 209 | const { output } = getContext() 210 | output.appendLeft(toRelativeIndex(output, node.start) + 1, code) 211 | } 212 | } 213 | } 214 | 215 | splice(prop: NodeProp, i: number, n: number, code: string) { 216 | const arr = getArray(this, prop) 217 | const len = arr.length 218 | 219 | if (i < 0) { 220 | i = (i % (len + 1)) + len 221 | } else if (i >= len) { 222 | if (code) this.push(prop, code) 223 | return 224 | } 225 | 226 | const { input, output, tab, removeNodes } = getContext() 227 | if (n > 0) { 228 | const val: any = this[prop as keyof this] 229 | if (arr !== val) { 230 | removeNodes(val.body, val, 'body', i, n) 231 | } else { 232 | removeNodes(val, this, prop, i, n) 233 | } 234 | } 235 | 236 | if (code) { 237 | if (i !== 0) { 238 | output.appendLeft(toRelativeIndex(output, arr[i - 1].end), code) 239 | } else { 240 | if (Node.isBlockStatement(this)) { 241 | this.depth ??= parseDepth(this, tab, input) 242 | code = indent('\n' + code, tab, this.depth) 243 | } 244 | this.unshift(prop, code) 245 | } 246 | } 247 | } 248 | 249 | before(code: string, index = this.start) { 250 | const { input, output, tab } = getContext() 251 | this.depth ??= parseDepth(this, tab, input) 252 | output.prependLeft( 253 | toRelativeIndex(output, index), 254 | indent(code, tab, this.depth) 255 | ) 256 | } 257 | 258 | after(code: string, index = this.end) { 259 | const { input, output, tab } = getContext() 260 | this.depth ??= parseDepth(this, tab, input) 261 | output.appendRight( 262 | toRelativeIndex(output, index), 263 | indent(code, tab, this.depth) 264 | ) 265 | } 266 | 267 | indent(depth = 1) { 268 | const { input, output, tab } = getContext() 269 | const [start, end] = Array.from(greedyRange(output, this)) 270 | const prefix = tab.repeat(depth) 271 | let i = start - 1 272 | while (true) { 273 | i = input.indexOf('\n', i + 1) 274 | if (i === -1 || i >= end) { 275 | break 276 | } 277 | output.appendLeft(i + 1, prefix) 278 | } 279 | } 280 | 281 | dedent(depth = 1) { 282 | const { input, output, tab } = getContext() 283 | this.depth ??= parseDepth(this, tab, input) 284 | depth = Math.min(depth, this.depth) 285 | if (depth <= 0) { 286 | return 287 | } 288 | const [start, end] = Array.from(greedyRange(output, this)) 289 | const width = tab.length * depth 290 | let i = start - 1 291 | while (true) { 292 | i = input.indexOf('\n', i + 1) 293 | if (i === -1 || i >= end) { 294 | break 295 | } 296 | output.remove(i, i + width) 297 | } 298 | } 299 | 300 | replace(code: string) { 301 | const { output, walker } = getContext() 302 | output.overwrite( 303 | toRelativeIndex(output, this.start), 304 | toRelativeIndex(output, this.end), 305 | code 306 | ) 307 | walker.drop(this) 308 | } 309 | 310 | remove(prop?: NodeProp) { 311 | if (this.removed) { 312 | return 313 | } 314 | 315 | const { output, walker, removeNodes } = getContext() 316 | if (!prop) { 317 | output.remove(...greedyRange(output, this)) 318 | walker.drop(this) 319 | return 320 | } 321 | 322 | const val: any = this[prop as keyof this] 323 | if (val == null) { 324 | return 325 | } 326 | 327 | if (isArray(val)) { 328 | removeNodes(val, this, prop, 0, Infinity) 329 | } else if (val.type === 'BlockStatement') { 330 | removeNodes(val.body, val, 'body', 0, Infinity) 331 | } else if (typeof val.type === 'string') { 332 | output.remove( 333 | toRelativeIndex(output, val.start), 334 | toRelativeIndex(output, val.end) 335 | ) 336 | walker.drop(val) 337 | } 338 | } 339 | 340 | isLiteral( 341 | type?: 'string' | 'number' | 'boolean' | 'null' | 'RegExp' | 'bigint' 342 | ): this is Node.Literal { 343 | return ( 344 | this.type === 'Literal' && 345 | (type == null || literalTypes[type]((this as any).value)) 346 | ) 347 | } 348 | isDeclarationStatement(): this is Node.DeclarationStatement { 349 | return Node.isDeclarationStatement(this) 350 | } 351 | isExportDeclaration(): this is Node.ExportDeclaration { 352 | return Node.isExportDeclaration(this) 353 | } 354 | isExpression(): this is Node.Expression { 355 | return Node.isExpression(this) 356 | } 357 | isIterationStatement(): this is Node.IterationStatement { 358 | return Node.isIterationStatement(this) 359 | } 360 | isLeftHandSideExpression(): this is Node.LeftHandSideExpression { 361 | return Node.isLeftHandSideExpression(this) 362 | } 363 | isLiteralExpression(): this is Node.LiteralExpression { 364 | return Node.isLiteralExpression(this) 365 | } 366 | isParameter(): this is Node.Parameter { 367 | return Node.isParameter(this) 368 | } 369 | isPrimaryExpression(): this is Node.PrimaryExpression { 370 | return Node.isPrimaryExpression(this) 371 | } 372 | isStatement(): this is Node.Statement { 373 | return Node.isStatement(this) 374 | } 375 | 376 | static isNode(arg: any) { 377 | return Boolean(arg && arg.type) 378 | } 379 | static isDeclarationStatement(arg: any) { 380 | return Boolean(arg) && DeclarationStatement.includes(arg.type) 381 | } 382 | static isExportDeclaration(arg: any) { 383 | return Boolean(arg) && ExportDeclaration.includes(arg.type) 384 | } 385 | static isExpression(arg: any) { 386 | return Boolean(arg) && Expression.includes(arg.type) 387 | } 388 | static isIterationStatement(arg: any) { 389 | return Boolean(arg) && IterationStatement.includes(arg.type) 390 | } 391 | static isLeftHandSideExpression(arg: any) { 392 | return Boolean(arg) && LeftHandSideExpression.includes(arg.type) 393 | } 394 | static isLiteralExpression(arg: any) { 395 | return Boolean(arg) && LiteralExpression.includes(arg.type) 396 | } 397 | static isParameter(arg: any) { 398 | return Boolean(arg) && Parameter.includes(arg.type) 399 | } 400 | static isPrimaryExpression(arg: any) { 401 | return Boolean(arg) && PrimaryExpression.includes(arg.type) 402 | } 403 | static isStatement(arg: any) { 404 | return Boolean(arg) && Statement.includes(arg.type) 405 | } 406 | } 407 | 408 | export interface NebuNode { 409 | /** The underlying ESTree node. */ 410 | readonly n: T 411 | } 412 | 413 | export type Node = [T] extends [Any] 414 | ? NebuNode 415 | : NebuNode & NodeProps 416 | 417 | export const Node: NodeConstructor = NebuNode as any 418 | 419 | // These properties are Nebu-specific. 420 | Object.assign(Node.prototype, { 421 | type: undefined, 422 | start: undefined, 423 | end: undefined, 424 | removed: false, 425 | parent: undefined, 426 | ref: undefined, 427 | yields: undefined, 428 | depth: undefined, 429 | }) 430 | 431 | // Forward all other properties to the ESTree node. 432 | Object.setPrototypeOf(Node.prototype, getNodeProperties()) 433 | 434 | for (const type in KEYS) { 435 | // Add type guards 436 | Object.defineProperty(Node.prototype, 'is' + type, { 437 | value: function (this: Node) { 438 | return this.type == type 439 | }, 440 | }) 441 | // Add static type guards 442 | Object.defineProperty(Node, 'is' + type, { 443 | value: function (arg: any) { 444 | return Boolean(arg) && arg.type == type 445 | }, 446 | }) 447 | } 448 | -------------------------------------------------------------------------------- /src/NodeProperties.ts: -------------------------------------------------------------------------------- 1 | import { isArray } from '@alloc/is' 2 | import { AllNodeProps } from './types' 3 | import { replacers } from './replacers' 4 | import { Node } from './Node' 5 | 6 | export function getNodeProperties() { 7 | return new Proxy(Object.prototype, { 8 | get(_, key: string, node) { 9 | let val = node.n[key] 10 | if (val) { 11 | if (val.type) { 12 | val = new Node(val, node, key) 13 | return replaceProp(node, key, val) 14 | } 15 | if (isArray(val)) { 16 | val = val.map(val => { 17 | return val && val.type // 18 | ? new Node(val, node, key) 19 | : val 20 | }) 21 | return replaceProp(node, key, val) 22 | } 23 | } 24 | return val 25 | }, 26 | set(_, key: string, value, node) { 27 | return setProp.call(node, key, value) 28 | }, 29 | }) 30 | } 31 | 32 | function setProp(this: any, key: string, newValue: any) { 33 | const replacer: any = replacers[key as AllNodeProps] 34 | if (!replacer) { 35 | return false 36 | } 37 | replacer.call(this, this[key], newValue) 38 | replaceProp(this, key, newValue) 39 | return true 40 | } 41 | 42 | function replaceProp(node: any, key: string, value: any) { 43 | Object.defineProperty(node, key, { 44 | get: () => value, 45 | set: setProp.bind(node, key), 46 | enumerable: true, 47 | configurable: true, 48 | }) 49 | return value 50 | } 51 | -------------------------------------------------------------------------------- /src/Walker.ts: -------------------------------------------------------------------------------- 1 | import { isArray } from '@alloc/is' 2 | import type { Lookup } from '@alloc/types' 3 | import { KEYS } from 'eslint-visitor-keys' 4 | import type { VisitorMap } from './types' 5 | import { AnyNode } from './types' 6 | 7 | type WalkableNode = { 8 | type: string 9 | removed?: boolean 10 | yields?: (() => void)[] 11 | } 12 | 13 | export class Walker { 14 | stack: T[] = [] 15 | 16 | constructor( 17 | /** State shared between plugins */ 18 | readonly state: State, 19 | /** Visitor plugins */ 20 | readonly plugins: VisitorMap 21 | ) {} 22 | 23 | // Depth-first traversal, parents first 24 | walk(node: T) { 25 | if (node.removed) { 26 | return 27 | } 28 | 29 | this.stack.push(node) 30 | 31 | const visitors = this.plugins.get(node.type) 32 | if (visitors) { 33 | for (const visitor of visitors) { 34 | visitor(node as any, this.state) 35 | if (node.removed) { 36 | return 37 | } 38 | } 39 | } 40 | 41 | // Visit any children. 42 | this.descend(node) 43 | 44 | if (!node.removed) { 45 | if (node.yields != null) { 46 | node.yields.forEach(resume => resume()) 47 | } 48 | } 49 | 50 | this.stack.pop() 51 | } 52 | 53 | // Traverse deeper. 54 | descend(node: T) { 55 | let k = -1 56 | const keys = KEYS[node.type] 57 | if (!keys) { 58 | throw Error(`Unknown node type: "${node.type}"`) 59 | } 60 | while (++k !== keys.length) { 61 | const key = keys[k] 62 | const val = (node as any)[key] 63 | if (!val) { 64 | continue 65 | } 66 | if (val.type) { 67 | this.walk(val) 68 | if (node.removed) { 69 | return 70 | } 71 | } else if (isArray(val)) { 72 | let i = -1 73 | while (++i !== val.length) { 74 | const elem = val[i] 75 | if (elem) { 76 | this.walk(elem) 77 | } 78 | if (node.removed) { 79 | return 80 | } 81 | } 82 | } 83 | } 84 | } 85 | 86 | // Prevent traversal of a node and its descendants. 87 | drop(node: T) { 88 | const { stack } = this 89 | 90 | let i = stack.indexOf(node) 91 | if (i === -1) { 92 | node.removed = true 93 | return 94 | } 95 | 96 | const { length } = stack 97 | while (true) { 98 | stack[i].removed = true 99 | if (++i === length) { 100 | return 101 | } 102 | } 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /src/builtinHooks.ts: -------------------------------------------------------------------------------- 1 | import { SyntaxHooksVisitor } from './hooks' 2 | import { getContext } from './context' 3 | import { toRelativeIndex } from './MagicSlice' 4 | import { searchString } from './utils/index' 5 | 6 | export const builtinHooks: SyntaxHooksVisitor = { 7 | JSXOpeningElement: { 8 | pushFirst(node, prop, code) { 9 | // Append the attribute after the tag name. 10 | if (prop == 'attributes') { 11 | const { output } = getContext() 12 | output.appendRight(toRelativeIndex(output, node.name.end), code) 13 | return true 14 | } 15 | }, 16 | }, 17 | default: { 18 | removeFromArray(_node, removedRange) { 19 | const { input } = getContext() 20 | 21 | // Absorb all whitespace to the right. 22 | removedRange[1] = 23 | searchString(input, removedRange[1], (char, offset) => 24 | /\s/.test(char) ? false : offset 25 | ) ?? removedRange[1] 26 | }, 27 | }, 28 | } 29 | -------------------------------------------------------------------------------- /src/composite.ts: -------------------------------------------------------------------------------- 1 | export const Parameter = [ 2 | 'ArrayPattern', 3 | 'AssignmentPattern', 4 | 'Identifier', 5 | 'ObjectPattern', 6 | 'RestElement', 7 | ] as const 8 | 9 | export const ExportDeclaration = [ 10 | 'ClassDeclaration', 11 | 'ClassExpression', 12 | 'FunctionDeclaration', 13 | 'VariableDeclaration', 14 | ] as const 15 | 16 | export const LiteralExpression = [ 17 | 'Literal', 18 | 'TemplateLiteral', // 19 | ] as const 20 | 21 | export const PrimaryExpression = [ 22 | 'ArrayExpression', 23 | 'ArrayPattern', 24 | 'ClassExpression', 25 | 'FunctionExpression', 26 | 'Identifier', 27 | 'Import', 28 | 'JSXElement', 29 | 'JSXFragment', 30 | 'JSXOpeningElement', 31 | ...LiteralExpression, 32 | 'MetaProperty', 33 | 'ObjectExpression', 34 | 'ObjectPattern', 35 | 'Super', 36 | 'ThisExpression', 37 | ] as const 38 | 39 | export const LeftHandSideExpression = [ 40 | 'CallExpression', 41 | 'ChainExpression', 42 | 'ClassExpression', 43 | 'ClassDeclaration', 44 | 'FunctionExpression', 45 | 'ImportExpression', 46 | 'MemberExpression', 47 | ...PrimaryExpression, 48 | 'TaggedTemplateExpression', 49 | ] as const 50 | 51 | export const Expression = [ 52 | 'ArrowFunctionExpression', 53 | 'AssignmentExpression', 54 | 'AwaitExpression', 55 | 'BinaryExpression', 56 | 'ConditionalExpression', 57 | 'JSXClosingElement', 58 | 'JSXClosingFragment', 59 | 'JSXExpressionContainer', 60 | 'JSXOpeningElement', 61 | 'JSXOpeningFragment', 62 | 'JSXSpreadChild', 63 | ...LeftHandSideExpression, 64 | 'LogicalExpression', 65 | 'MetaProperty', 66 | 'NewExpression', 67 | 'RestElement', 68 | 'SequenceExpression', 69 | 'SpreadElement', 70 | 'UnaryExpression', 71 | 'UpdateExpression', 72 | 'YieldExpression', 73 | ] as const 74 | 75 | export const DeclarationStatement = [ 76 | 'ClassDeclaration', 77 | 'ClassExpression', 78 | 'ExportDefaultDeclaration', 79 | 'ExportAllDeclaration', 80 | 'ExportNamedDeclaration', 81 | 'FunctionDeclaration', 82 | ] as const 83 | 84 | export const IterationStatement = [ 85 | 'DoWhileStatement', 86 | 'ForInStatement', 87 | 'ForOfStatement', 88 | 'ForStatement', 89 | 'WhileStatement', 90 | ] as const 91 | 92 | export const Statement = [ 93 | 'BlockStatement', 94 | 'BreakStatement', 95 | 'ContinueStatement', 96 | 'DebuggerStatement', 97 | ...DeclarationStatement, 98 | 'EmptyStatement', 99 | 'ExpressionStatement', 100 | 'IfStatement', 101 | ...IterationStatement, 102 | 'ImportDeclaration', 103 | 'LabeledStatement', 104 | 'ReturnStatement', 105 | 'SwitchStatement', 106 | 'ThrowStatement', 107 | 'TryStatement', 108 | 'VariableDeclaration', 109 | 'WithStatement', 110 | ] as const 111 | -------------------------------------------------------------------------------- /src/context.ts: -------------------------------------------------------------------------------- 1 | import type { MagicSlice } from './MagicSlice' 2 | import type { Walker } from './Walker' 3 | import type { Node } from './Node' 4 | import MagicString from 'magic-string' 5 | import { greedyRange } from './utils/greedyRange' 6 | import { SyntaxHooksVisitor, SyntaxHooks, mergeSyntaxHooks } from './hooks' 7 | import { builtinHooks } from './builtinHooks' 8 | import { isArray } from '@alloc/is' 9 | 10 | type HookParams = Hook extends ( 11 | node: Node, 12 | ...params: infer Params 13 | ) => any 14 | ? Params 15 | : never 16 | 17 | export interface NebuContext { 18 | input: string 19 | output: MagicString | MagicSlice 20 | walker: Walker 21 | tab: string 22 | 23 | /** Invoke a syntax hook */ 24 | applyHook( 25 | hookName: K, 26 | node: Node, 27 | ...params: HookParams> 28 | ): boolean | void 29 | 30 | /** Remove a range of nodes */ 31 | removeNodes( 32 | nodes: readonly Node[], 33 | parent: Node, 34 | ref: string, 35 | fromIndex: number, 36 | nodeCount: number 37 | ): void 38 | } 39 | 40 | const contextStack: NebuContext[] = [] 41 | 42 | export function getContext() { 43 | if (contextStack.length) { 44 | return contextStack[contextStack.length - 1] 45 | } 46 | throw Error('Invalid call outside Nebu context') 47 | } 48 | 49 | export function pushContext( 50 | output: MagicString | MagicSlice, 51 | walker: Walker, 52 | customHooks?: SyntaxHooksVisitor 53 | ) { 54 | const hooksVisitor = customHooks 55 | ? mergeSyntaxHooks(builtinHooks, customHooks) 56 | : builtinHooks 57 | 58 | const applyHook: NebuContext['applyHook'] = (hookName, node, ...params) => { 59 | let hooks = hooksVisitor[node.type] 60 | if (hooks) { 61 | const hook = hooks[hookName] as ( 62 | node: Node, 63 | ...params: any[] 64 | ) => boolean | void 65 | 66 | if (hook && hook(node, ...params)) { 67 | return true 68 | } 69 | } 70 | if ((hooks = hooksVisitor.default)) { 71 | const hook = hooks[hookName] as ( 72 | node: Node, 73 | ...params: any[] 74 | ) => boolean | void 75 | 76 | if (hook && hook(node, ...params)) { 77 | return true 78 | } 79 | } 80 | } 81 | 82 | contextStack.push({ 83 | get input() { 84 | return output.original 85 | }, 86 | output, 87 | walker, 88 | tab: output.getIndentString() || ' ', 89 | applyHook, 90 | removeNodes(nodes, parent, ref, i, n) { 91 | const isArrayProp = isArray((parent as any)[ref]) 92 | n = Math.min(i + n, nodes.length) 93 | do { 94 | const node = nodes[i] 95 | if (!node.removed) { 96 | node.parent = parent 97 | node.ref = ref 98 | const removedRange = greedyRange(output, node, i) 99 | if (isArrayProp && applyHook('removeFromArray', node, removedRange)) { 100 | continue 101 | } 102 | output.remove(...removedRange) 103 | walker.drop(node) 104 | } 105 | } while (++i !== n) 106 | }, 107 | }) 108 | } 109 | 110 | export function popContext() { 111 | return contextStack.pop() 112 | } 113 | -------------------------------------------------------------------------------- /src/hooks.ts: -------------------------------------------------------------------------------- 1 | import type { Node } from './Node' 2 | import type { 3 | NodeType, 4 | ResolveNodeType, 5 | AnyNode, 6 | ResolveNodeProp, 7 | } from './types' 8 | 9 | export interface SyntaxHooks { 10 | /** 11 | * Called when code is pushed to an array property that was previously 12 | * empty. 13 | * 14 | * Return true to prevent default behavior. 15 | */ 16 | pushFirst?( 17 | node: U, 18 | prop: ResolveNodeProp, 19 | code: string 20 | ): boolean | void 21 | /** 22 | * Called when a node is removed from an array property. 23 | * 24 | * Return true to prevent default behavior. 25 | */ 26 | removeFromArray?( 27 | node: U, 28 | removedRange: [number, number] 29 | ): boolean | void 30 | } 31 | 32 | export type SyntaxHooksVisitor = { 33 | [P in NodeType]?: SyntaxHooks> 34 | } & { 35 | /** 36 | * These hooks are used when a hook of a specific node type does not 37 | * return true. 38 | */ 39 | default?: SyntaxHooks 40 | } 41 | 42 | type AnySyntaxHook = (...args: any[]) => boolean | void 43 | type AnySyntaxHooks = Record 44 | 45 | export function mergeSyntaxHooks( 46 | leftVisitor: SyntaxHooksVisitor, 47 | rightVisitor: SyntaxHooksVisitor 48 | ) { 49 | const newVisitor = { ...leftVisitor } 50 | for (const key in rightVisitor) { 51 | const rightHooks = rightVisitor[key as NodeType] as AnySyntaxHooks 52 | if (!rightHooks) { 53 | continue 54 | } 55 | const leftHooks = leftVisitor[key as NodeType] as AnySyntaxHooks 56 | if (leftHooks) { 57 | const newHooks = { ...leftHooks } 58 | for (const hookName in rightHooks) { 59 | const rightHook = rightHooks[hookName] 60 | if (rightHook) { 61 | const leftHook = leftHooks[hookName] 62 | if (leftHook) { 63 | newHooks[hookName as keyof SyntaxHooks] = (...args: any[]) => { 64 | return leftHook(...args) || rightHook(...args) 65 | } 66 | } else { 67 | newHooks[hookName as keyof SyntaxHooks] = rightHook 68 | } 69 | } 70 | } 71 | } else { 72 | leftVisitor[key as NodeType] = rightHooks 73 | } 74 | } 75 | return newVisitor 76 | } 77 | -------------------------------------------------------------------------------- /src/nebu.ts: -------------------------------------------------------------------------------- 1 | import { Lookup } from '@alloc/types' 2 | import MagicString, { SourceMap } from 'magic-string' 3 | import { dirname, relative } from 'path' 4 | import { Node } from './Node' 5 | import { Walker } from './Walker' 6 | import { popContext, pushContext } from './context' 7 | import { ESTree, Plugin, PluginOption } from './types' 8 | import { mergePlugins } from './utils' 9 | import { SyntaxHooksVisitor } from './hooks' 10 | 11 | export type { PluginOption, Visitor, AnyNode } from './types' 12 | export { Node, Plugin } 13 | 14 | export interface NebuOptions { 15 | ast?: ESTree.Program 16 | jsx?: boolean 17 | state?: State 18 | hooks?: SyntaxHooksVisitor 19 | plugins: PluginOption[] 20 | sourceMap?: boolean | 'inline' 21 | sourceMapHiRes?: boolean 22 | sourceMapTarget?: string 23 | includeContent?: boolean 24 | generatedFile?: string 25 | filename?: string 26 | } 27 | 28 | export interface NebuResult { 29 | js: string 30 | map?: SourceMap 31 | } 32 | 33 | interface Nebu { 34 | process( 35 | input: string, 36 | plugin: Plugin | PluginOption[] 37 | ): NebuResult 38 | process( 39 | input: string, 40 | opts: NebuOptions 41 | ): NebuResult 42 | process(input: string, plugin: Plugin | PluginOption[]): NebuResult 43 | process(input: string, opts: NebuOptions): NebuResult 44 | 45 | /** 46 | * This method is useful for collecting ESTree nodes before you make 47 | * any changes with `nebu.process`. When you separate the collection 48 | * and mutation phases, you're able to *asynchronously* generate 49 | * metadata needed to inform how you'll mutate the AST. 50 | */ 51 | walk( 52 | rootNode: ESTree.Node, 53 | plugins: Plugin | Plugin[] 54 | ): void 55 | } 56 | 57 | export const nebu: Nebu = { 58 | process( 59 | input: string, 60 | opts: NebuOptions | Plugin | PluginOption[] 61 | ): NebuResult { 62 | if (Array.isArray(opts)) { 63 | opts = { plugins: opts } 64 | } else if (!('plugins' in opts)) { 65 | opts = { plugins: [opts] } 66 | } 67 | 68 | const visitors = mergePlugins(opts.plugins) 69 | if (!visitors.size) { 70 | return { js: input } 71 | } 72 | 73 | const program = new Node( 74 | opts.ast || 75 | require('meriyah').parse(input, { 76 | next: true, 77 | ranges: true, 78 | module: true, 79 | jsx: opts.jsx, 80 | }) 81 | ) 82 | 83 | const output = new MagicString(input) 84 | const walker = new Walker(opts.state || {}, visitors as any) 85 | 86 | program.depth = 0 87 | pushContext(output, walker, opts.hooks) 88 | walker.walk(program) 89 | popContext() 90 | 91 | if (!opts.sourceMap) 92 | return { 93 | js: output.toString(), 94 | } 95 | 96 | const res = { 97 | js: output.toString(), 98 | map: output.generateMap({ 99 | file: opts.generatedFile, 100 | source: opts.filename, 101 | includeContent: opts.includeContent !== false, 102 | hires: opts.sourceMapHiRes, 103 | }), 104 | } 105 | 106 | let mapURL: string | undefined 107 | if (opts.sourceMap == 'inline') { 108 | mapURL = res.map.toUrl() 109 | } else if (opts.filename && opts.sourceMapTarget) { 110 | mapURL = relative(dirname(opts.filename), opts.sourceMapTarget) 111 | } 112 | 113 | if (mapURL) { 114 | res.js += '\n//# sourceMappingURL=' + mapURL 115 | } 116 | 117 | return res 118 | }, 119 | walk(rootNode, plugins) { 120 | const visitors = mergePlugins(Array.isArray(plugins) ? plugins : [plugins]) 121 | if (visitors.size) { 122 | const walker = new Walker(undefined, visitors) 123 | walker.walk(rootNode) 124 | } 125 | }, 126 | } 127 | 128 | declare global { 129 | interface NodeRequire { 130 | (name: 'meriyah'): typeof import('meriyah') 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /src/replacers.ts: -------------------------------------------------------------------------------- 1 | import { AllNodeProps, FindNode } from './types' 2 | 3 | export const replacers: Replacers = { 4 | // TODO 5 | } 6 | 7 | type Replacers = { 8 | [P in AllNodeProps]?: FindNode

extends infer T 9 | ? P extends keyof T 10 | ? (this: T, oldValue: T[P], newValue: T[P]) => void 11 | : never 12 | : never 13 | } 14 | -------------------------------------------------------------------------------- /src/types.ts: -------------------------------------------------------------------------------- 1 | import type { Falsy, Lookup } from '@alloc/types' 2 | import type { ESTree } from 'meriyah' 3 | import type { Node } from './Node' 4 | import type { StaticTypeGuards, TypeGuards, TypeLookup } from './typeGuards' 5 | 6 | export type { ESTree } 7 | 8 | export interface ESNode extends ESTree._Node { 9 | type: string 10 | } 11 | 12 | export type NodeProp = string & 13 | (Exclude extends infer P 14 | ? [P] extends [never] 15 | ? unknown // coerce "never" to "unknown" 16 | : P 17 | : never) 18 | 19 | export type NodeProps = { 20 | [P in NodeProp & keyof T]: Nebufy 21 | } 22 | 23 | // Convert property into Nebu type. 24 | type Nebufy = U extends ESNode 25 | ? ResolveNodeType['type']> 26 | : U extends ReadonlyArray 27 | ? ReadonlyArray> 28 | : U 29 | 30 | export type CompositeNode = T extends ESTree.Node 31 | ? ResolveNodeType 32 | : never 33 | 34 | export interface NodeConstructor extends StaticTypeGuards { 35 | new (node: T, parent?: Node, ref?: string): Node 36 | 37 | isNode(arg: any): arg is AnyNode 38 | isDeclarationStatement(arg: any): arg is Node.DeclarationStatement 39 | isExportDeclaration(arg: any): arg is Node.ExportDeclaration 40 | isExpression(arg: any): arg is Node.Expression 41 | isIterationStatement(arg: any): arg is Node.IterationStatement 42 | isLeftHandSideExpression(arg: any): arg is Node.LeftHandSideExpression 43 | isLiteralExpression(arg: any): arg is Node.LiteralExpression 44 | isParameter(arg: any): arg is Node.Parameter 45 | isPrimaryExpression(arg: any): arg is Node.PrimaryExpression 46 | isStatement(arg: any): arg is Node.Statement 47 | } 48 | 49 | declare module './Node' { 50 | export namespace Node { 51 | type LiteralValue = string | number | boolean | null | RegExp | bigint 52 | 53 | export interface Literal 54 | extends Node { 55 | value: T 56 | } 57 | export interface RegExpLiteral extends Node { 58 | value: RegExp 59 | } 60 | export interface BigIntLiteral extends Node { 61 | value: bigint 62 | } 63 | 64 | // Fix "any" type of callee in meriyah. 65 | export interface CallExpression { 66 | callee: Node.Expression | Node.Super 67 | } 68 | 69 | export type DeclarationStatement = CompositeNode 70 | export type ExportDeclaration = CompositeNode 71 | export type Expression = CompositeNode 72 | export type IterationStatement = CompositeNode 73 | export type LeftHandSideExpression = CompositeNode 74 | export type LiteralExpression = CompositeNode 75 | export type Parameter = CompositeNode 76 | export type PrimaryExpression = CompositeNode 77 | export type Statement = CompositeNode 78 | } 79 | export interface NebuNode extends TypeGuards {} 80 | export interface NebuNode { 81 | isLiteral(type: 'string'): this is Node.Literal 82 | isLiteral(type: 'number'): this is Node.Literal 83 | isLiteral(type: 'boolean'): this is Node.Literal 84 | isLiteral(type: 'null'): this is Node.Literal 85 | isLiteral(type: 'RegExp'): this is Node.RegExpLiteral 86 | isLiteral(type: 'bigint'): this is Node.BigIntLiteral 87 | isLiteral(): this is Node.Literal 88 | } 89 | } 90 | 91 | export type PluginOption< 92 | State = Lookup, 93 | T extends { type: string } = AnyNode 94 | > = { default: Plugin } | Plugin | Falsy 95 | 96 | export type AnyNode = TypeLookup[keyof TypeLookup] 97 | 98 | export type Plugin = { 99 | [P in T['type']]?: Visitor> 100 | } 101 | 102 | export interface Visitor { 103 | (node: T, state: State): void 104 | } 105 | 106 | export type VisitorMap< 107 | State = Lookup, 108 | T extends { type: string } = AnyNode 109 | > = Map[]> 110 | 111 | export type NodeType = ESTree.Node['type'] 112 | export type ResolveNodeType = unknown & 113 | TypeLookup[T & keyof TypeLookup] 114 | 115 | export type ResolveNodeProp = Exclude< 116 | T extends Node ? keyof U : keyof T, 117 | keyof ESNode 118 | > 119 | 120 | // All possible properties of a node. 121 | export type AllNodeProps = ESTree.Node extends infer T 122 | ? T extends infer Node 123 | ? Exclude 124 | : never 125 | : never 126 | 127 | // Find the node types with a specific property. 128 | export type FindNode

= ESTree.Node extends infer T 129 | ? T extends { [K in P]: any } & { type: string } 130 | ? TypeLookup[T['type']] 131 | : never 132 | : never 133 | 134 | export type Singular = T extends ReadonlyArray 135 | ? U 136 | : Exclude 137 | 138 | export type ArrayProp< 139 | T extends ESNode, 140 | P extends NodeProp & keyof T 141 | > = ReadonlyArray< 142 | Nebufy< 143 | T[P] extends infer U 144 | ? U extends ReadonlyArray 145 | ? U[number] 146 | : U extends Node.BlockStatement 147 | ? Node.BlockStatement['body'][number] 148 | : U 149 | : never 150 | > 151 | > 152 | -------------------------------------------------------------------------------- /src/utils/greedyRange.ts: -------------------------------------------------------------------------------- 1 | import MagicString from 'magic-string' 2 | import { MagicSlice, toRelativeIndex } from '../MagicSlice' 3 | import { Node } from '../Node' 4 | 5 | // The node assumes ownership of its starting line, unless other nodes 6 | // exist on the same line. It also assumes ownership of the first 7 | // trailing semicolon or comma. Works with comma-delimited expressions, 8 | // too. 9 | export function greedyRange( 10 | output: MagicSlice | MagicString, 11 | node: Node, 12 | i?: number 13 | ): [number, number] { 14 | const input = output.original 15 | 16 | // Our minimum range. 17 | let sib, sibAfter, sibBefore 18 | let { start, end, parent, ref } = node 19 | 20 | start = toRelativeIndex(output, start) 21 | end = toRelativeIndex(output, end) 22 | 23 | // The trailing newline (or end of input). 24 | let lineEnd = input.indexOf('\n', end) 25 | if (lineEnd === -1) { 26 | lineEnd = input.length 27 | } 28 | 29 | // Be sibling-aware. 30 | let sibs = parent[ref as keyof Node] as Node[] | null 31 | if (!Array.isArray(sibs)) { 32 | i = 0 33 | sibs = null 34 | } else { 35 | if (i == null) { 36 | i = sibs.indexOf(node) 37 | } 38 | const len = sibs.length 39 | if (i !== len - 1) { 40 | // Find a sibling after us that isn't removed yet. 41 | let j = i 42 | while (++j !== len) { 43 | sib = sibs[j] 44 | if (!sib.removed) { 45 | sibAfter = sib 46 | break 47 | } 48 | } 49 | 50 | if (sibAfter) { 51 | // Take ownership until the start of the sibling after us 52 | // if it exists on the same line that we end on. 53 | const sibAfterStart = toRelativeIndex(output, sibAfter.start) 54 | if (sibAfterStart < lineEnd) { 55 | end = sibAfterStart 56 | return [start, end] 57 | } 58 | } 59 | } 60 | } 61 | 62 | // The leading newline. 63 | const lineStart = 1 + input.lastIndexOf('\n', start) 64 | 65 | // Avoid extra work if we are the first node on our starting line. 66 | if (start === lineStart) { 67 | start = Math.max(0, lineStart - 1) 68 | } else { 69 | // Find a sibling before us that isn't removed yet. 70 | if (sibs) { 71 | while (--i !== -1) { 72 | sib = sibs[i] 73 | if (!sib.removed) { 74 | sibBefore = sib 75 | break 76 | } 77 | // Avoid checking every sibling. 78 | const sibEnd = toRelativeIndex(output, sib.end) 79 | if (sibEnd < lineStart) { 80 | break 81 | } 82 | } 83 | } 84 | 85 | // Take ownership of leading whitespace if the sibling before us 86 | // ends on the line we start on. We'll never take ownership of both 87 | // leading and trailing whitespace in the same removal, unless no 88 | // siblings exist on our line(s). 89 | if (sibBefore) { 90 | const sibBeforeEnd = toRelativeIndex(output, sibBefore.end) 91 | start = Math.max(sibBeforeEnd, lineStart - 1) 92 | } 93 | // Take ownership of the leading newline if our parent doesn't start on it. 94 | else { 95 | const parentStart = toRelativeIndex(output, parent.start) 96 | if (parentStart < lineStart) { 97 | start = lineStart - 1 98 | } 99 | } 100 | } 101 | 102 | // Avoid extra work if we are the last node on our ending line. 103 | if (end !== lineEnd) { 104 | if (!sibAfter) { 105 | // Take ownership until the trailing newline 106 | // if our parent doesn't end on it. 107 | const parentEnd = toRelativeIndex(output, parent.end) 108 | if (parentEnd > lineEnd) { 109 | end = lineEnd 110 | } 111 | } 112 | // Preserve trailing whitespace if we own our leading whitespace. 113 | else { 114 | const sibBeforeEnd = !!sibBefore && toRelativeIndex(output, sibBefore.end) 115 | if (sibBeforeEnd == false || start > sibBeforeEnd) { 116 | const sibAfterStart = toRelativeIndex(output, sibAfter.start) 117 | end = Math.min(sibAfterStart, lineEnd) 118 | } 119 | } 120 | } 121 | 122 | return [start, end] 123 | } 124 | -------------------------------------------------------------------------------- /src/utils/index.ts: -------------------------------------------------------------------------------- 1 | import { isArray } from '@alloc/is' 2 | import type { Node } from '../Node' 3 | import { ArrayProp, ESTree, NodeProp, PluginOption, VisitorMap } from '../types' 4 | 5 | const matchType = (type: string) => (node: Node) => node.type === type 6 | 7 | export function noop() {} 8 | 9 | // Find a matching node. Check the given node first. 10 | export function lookup(node: Node, match: string | ((node: Node) => boolean)) { 11 | if (typeof match === 'string') { 12 | match = matchType(match) 13 | } 14 | while (node) { 15 | if (match(node)) { 16 | return node 17 | } 18 | node = node.parent! 19 | } 20 | return null 21 | } 22 | 23 | // Find a matching parent. 24 | export function findParent( 25 | node: Node, 26 | match: string | ((node: Node) => boolean) 27 | ) { 28 | if (typeof match === 'string') { 29 | match = matchType(match) 30 | } 31 | while ((node = node.parent!)) { 32 | if (match(node)) { 33 | return node 34 | } 35 | } 36 | return null 37 | } 38 | 39 | // Is the given node first on its starting line? 40 | export function isFirst(node: Node, input: string) { 41 | const lineStart = 1 + input.lastIndexOf('\n', node.start) 42 | return /^[ \t]*$/.test(input.slice(lineStart, node.start)) 43 | } 44 | 45 | // Compute tab count of a block. 46 | export function parseDepth(node: Node, tab: string, input: string) { 47 | const lineStart = 1 + input.lastIndexOf('\n', node.start) 48 | let lineEnd = input.indexOf('\n', lineStart) 49 | if (lineEnd === -1) { 50 | lineEnd = input.length 51 | } 52 | const prefix = /^[ \t]*/.exec(input.slice(lineStart, lineEnd))![0] 53 | return prefix.length / tab.length 54 | } 55 | 56 | // Increment the indentation level. 57 | export function indent(code: string, tab: string, depth = 1) { 58 | const indent = tab.repeat(depth) 59 | 60 | // Avoid extra work if using same tab string (or none). 61 | const prev = guessTab(code) 62 | if (!prev || prev === tab) { 63 | if (!indent) { 64 | return code 65 | } 66 | return code.replace(/\n/g, '\n' + indent) 67 | } 68 | 69 | // Fix the existing indentation. 70 | const re = new RegExp(`\n((?:${prev})*)`, 'g') 71 | const width = prev.length 72 | return code.replace( 73 | re, 74 | (_, prev) => '\n' + indent + tab.repeat(prev.length / width) 75 | ) 76 | } 77 | 78 | // Reset the indentation level to zero. 79 | // Assume the first line is never indented. 80 | // This is useful when moving/duplicating code. 81 | export function stripIndent(code: string, tab: string) { 82 | let re = new RegExp(`^((?:${tab})*)`) 83 | const width = tab.length 84 | let depth = 0 85 | // Find the first indentation level that isn't zero. 86 | for (let line of code.split('\n')) { 87 | depth = re.exec(line)![1].length / width 88 | if (depth !== 0) { 89 | break 90 | } 91 | } 92 | if (depth > 1) { 93 | re = new RegExp(`\n((?:${tab})*)`, 'g') 94 | return code.replace( 95 | re, 96 | (_, prev) => 97 | '\n' + tab.repeat(Math.max(0, 1 + prev.length / width - depth)) 98 | ) 99 | } else { 100 | return code 101 | } 102 | } 103 | 104 | // Adapted from magic-string (https://goo.gl/pHi5kK) 105 | export function guessTab(code: string) { 106 | const lines = code.split('\n') 107 | const tabbed = lines.filter(line => /^\t+/.test(line)) 108 | const spaced = lines.filter(line => /^ {2,}/.test(line)) 109 | 110 | if (!tabbed.length && !spaced.length) { 111 | return null 112 | } 113 | 114 | if (tabbed.length >= spaced.length) { 115 | return '\t' 116 | } 117 | 118 | // Guess the number of spaces per tab. 119 | return ' '.repeat( 120 | spaced.reduce( 121 | (prev, cur) => Math.min(prev, /^ +/.exec(cur)![0].length), 122 | Infinity 123 | ) 124 | ) 125 | } 126 | 127 | export function getArray< 128 | T extends ESTree.Node, 129 | P extends NodeProp & keyof T 130 | >(node: Node, prop: P): ArrayProp 131 | export function getArray(node: Node, prop: string): readonly any[] 132 | export function getArray(node: Node, prop: string) { 133 | const val = Reflect.get(node, prop) 134 | if (val) { 135 | if (isArray(val)) { 136 | return val 137 | } 138 | if (val.type == 'BlockStatement') { 139 | return val.body 140 | } 141 | } 142 | throw Error(`"${prop}" is not an array or BlockStatement`) 143 | } 144 | 145 | export function mergePlugins( 146 | plugins: readonly PluginOption[] 147 | ): VisitorMap { 148 | const merged: VisitorMap = new Map() 149 | for (let plugin of plugins) { 150 | if (plugin) { 151 | if ('default' in plugin) { 152 | plugin = plugin.default 153 | } 154 | for (const key in plugin) { 155 | // @ts-ignore 156 | const visitor = plugin[key] 157 | const visitors = merged.get(key) 158 | if (visitors) { 159 | // @ts-ignore 160 | visitors.push(visitor) 161 | } else { 162 | merged.set(key, [visitor]) 163 | } 164 | } 165 | } 166 | } 167 | return merged 168 | } 169 | 170 | export function searchString( 171 | str: string, 172 | start: number, 173 | test: (char: string, offset: number) => Result | false | void 174 | ): Result | undefined { 175 | let i = start 176 | let char = str[i] 177 | let result: any 178 | while (char) { 179 | result = test(char, i) 180 | if (result !== false && result !== void 0) { 181 | return result 182 | } 183 | char = str[++i] 184 | } 185 | } 186 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "include": ["src"], 3 | "compilerOptions": { 4 | "declaration": true, 5 | "esModuleInterop": true, 6 | "lib": ["es2018"], 7 | "module": "commonjs", 8 | "moduleResolution": "node", 9 | "noUnusedLocals": true, 10 | "outDir": "dist", 11 | "strict": true, 12 | "target": "es2018" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'tsup' 2 | import alias from 'esbuild-plugin-alias' 3 | import resolve from 'resolve' 4 | 5 | export default defineConfig({ 6 | entry: ['src/nebu.ts', 'src/utils/index.ts'], 7 | format: ['esm'], 8 | noExternal: [/^$/, 'magic-string', 'meriyah', 'eslint-visitor-keys'], 9 | outDir: 'dist/browser', 10 | esbuildPlugins: [ 11 | alias({ 12 | path: resolve.sync('path-browserify'), 13 | }), 14 | ], 15 | }) 16 | -------------------------------------------------------------------------------- /utils.d.ts: -------------------------------------------------------------------------------- 1 | export * from './dist/utils' 2 | -------------------------------------------------------------------------------- /utils.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./dist/utils') 2 | --------------------------------------------------------------------------------