Initial commit: Crypto trader application

This commit is contained in:
2025-12-25 20:20:40 -05:00
commit 07a04c1bb8
47895 changed files with 2042266 additions and 0 deletions

278
frontend/node_modules/ast-v8-to-istanbul/README.md generated vendored Normal file
View File

@@ -0,0 +1,278 @@
# `ast-v8-to-istanbul`
[![Version][version-badge]][npm-url]
[![Downloads][downloads-url]][npm-url]
> - Speed of V8 coverage 🏎
> - Accuracy of Istanbul coverage 🔍
[Ignoring code](#ignoring-code) | [Source maps](#source-maps) | [Istanbul Compatibility](#istanbul-compatibility) | [Limitations](#limitations)
---
AST-aware [`v8-to-istanbul`](https://www.npmjs.com/package/v8-to-istanbul).
Unopinionated - _bring-your-own_ AST parser and source maps.
Passes all 195 tests<sup>[*](#istanbul-compatibility)</sup> of [`istanbul-lib-instrument`](https://github.com/istanbuljs/istanbuljs/tree/main/packages/istanbul-lib-instrument/test/specs). ✅
Test cases run against:
- `vite/parseAst`
- `acorn`
- `oxc-parser`
- `@babel/parser`
See example report at https://ariperkkio.github.io/ast-v8-to-istanbul.
```ts
import { convert } from "ast-v8-to-istanbul";
import { parseAstAsync } from "vite";
import type { CoverageMapData } from "istanbul-lib-coverage";
const data: CoverageMapData = await convert({
// Bring-your-own AST parser
ast: parseAstAsync(<code>),
// Code of the executed file (not the source file)
code: "function sum(a, b) {\n return a + b ...",
// Execution wrapper offset
wrapperLength: 0,
// Script coverage of the executed file
coverage: {
scriptId: "123",
url: "file:///absolute/path/to/dist/index.js",
functions: [
{
functionName: "sum",
ranges: [{ startOffset: 223, endOffset: 261, count: 0 }],
isBlockCoverage: false,
},
// ... etc
],
},
// Source map of the executed file
sourceMap: {
version: 3,
sources: ["../sources.ts"],
sourcesContent: ["export function sum(a: number, b: number) {\n..."],
mappings: ";AAAO,SAAS,...",
names: [],
},
});
```
## Ignoring code
### Ignoring source code
#### Ignore hints
See live example at https://ariperkkio.github.io/ast-v8-to-istanbul/ignore-examples.html.
The typical ignore hints from `nyc` are supported: https://github.com/istanbuljs/nyc?tab=readme-ov-file#parsing-hints-ignoring-lines:
> * `/* istanbul ignore if */`: ignore the next if statement.
> * `/* istanbul ignore else */`: ignore the else portion of an if statement.
> * `/* istanbul ignore next */`: ignore the next _thing_ in the source-code (functions, if statements, classes, you name it).
> * `/* istanbul ignore file */`: ignore an entire source-file (this should be placed at the top of the file).
In addition to `istanbul` keyword, you can use `v8`, `c8` and `node:coverage`:
- `/* istanbul ignore if */`
- `/* v8 ignore else */`
- `/* c8 ignore file */`
- `/* node:coverage ignore next */`
Also `start` and `stop` ignore hints from original [`v8-to-istanbul`](https://www.npmjs.com/package/v8-to-istanbul) are supported.
These ignore hints are checked from the original sources instead of transpiled code.
> * `/* v8 ignore start */`: start ignoring lines
> * `/* v8 ignore stop */`: stop ignoring lines
> * `<!-- /* v8 ignore start */ -->`: start ignoring lines
> * `<!-- /* v8 ignore stop */ -->`: stop ignoring lines
> * `anything /* v8 ignore start */ anything`: start ignoring lines
> * `anything /* v8 ignore stop */ anything`: stop ignoring lines
#### Class methods
The `ignore-class-method` from `nyc` is also supported: https://github.com/istanbuljs/nyc?tab=readme-ov-file#ignoring-methods
> You can ignore every instance of a method simply by adding its name to the `ignore-class-method` array in your `nyc` config.
```ts
import { convert } from "ast-v8-to-istanbul";
await convert({
ignoreClassMethods: ['render']
});
```
#### Ignore after remapping
You can ignore source code after coverage results have been remapped back to original sources using `ignoreSourceCode`.
This is a high level API that can be exposed to end-users by tooling developers.
It's mostly intended for excluding code that is incorrectly shown in coverage report when compilers add generated code in the source maps.
Note that as the exclusion happens after remapping, this option is slower than [`ignoreNode`](#ignoring-generated-code) option.
```ts
function ignoreSourceCode(
code: string,
type: "function" | "statement" | "branch",
location: Record<"start" | "end", { line: number; column: number }>,
): boolean | void;
```
```ts
import { convert } from "ast-v8-to-istanbul";
await convert({
ignoreSourceCode: (code, type, location) => {
// Ignore all "noop()" calls
if(type === "function" && code.includes("noop(")) {
return true;
}
// In Vue "<script>" tags generate code that is incorrectly left in source maps - exclude it
if(code === '<script>') {
return true;
}
// Ignore anything above line 5
return location.start.line < 5;
},
});
```
### Ignoring generated code
This API is mostly for developers integrating `ast-v8-to-istanbul` with other tooling.
If your code transform pipeline is adding generated code that's included in the source maps, it will be included in coverage too.
You can exclude these known patterns by defining `ignoreNode` for filtering such nodes.
By returning `"ignore-this-and-nested-nodes"` from the handler, you can ignore all nested nodes too.
This can be useful when you need to ignore everything a certain node wraps, e.g. `IfStatement`.
```ts
function ignoreNode(
node: Node,
type: "branch" | "function" | "statement"
): boolean | "ignore-this-and-nested-nodes" | void;
```
```ts
import { convert } from "ast-v8-to-istanbul";
await convert({
ignoreNode: (node, type) => {
// Ignore all `await __vite_ssr_import__( ... )` calls that Vite SSR transform adds
return (
type === "statement" &&
node.type === "AwaitExpression" &&
node.argument.type === "CallExpression" &&
node.argument.callee.type === "Identifier" &&
node.argument.callee.name === "__vite_ssr_import__"
);
},
});
```
## Source maps
Source maps are optional and supported by various ways:
- Pass directly to `convert` as argument:
```ts
import { convert } from "ast-v8-to-istanbul";
await convert({
sourceMap: {
version: 3,
sources: ["../sources.ts"],
sourcesContent: ["export function sum(a: number, b: number) {\n..."],
mappings: ";AAAO,SAAS,...",
names: [],
}
});
```
- Include base64 encoded inline maps in `code`:
```ts
await convert({
code: `\
function hello() {}
//# sourceMappingURL=data:application/json;base64,eyJzb3VyY2VzIjpbIi9zb21lL...
`
});
```
- Include inline maps with filename in `code`:
```ts
await convert({
code: `\
function hello() {}
//# sourceMappingURL=some-file-on-file-system.js.map
`
});
```
- Don't use source maps at all, and pass original source code in `code`:
```ts
await convert({
code: `function hello() {}`,
sourceMap: undefined,
});
```
## Istanbul Compatibility
This project tests itself against test cases of `istanbul-lib-instrument` and verifies coverage maps are 100% identical. Some cases, like [deprecated `with()` statement](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/with) and edge cases of strict mode are skipped, as all tests are run in strict mode.
100% istanbul compatibility guarantees that coverage reports between V8 and Istanbul can be merged together.
<img src="https://github.com/user-attachments/assets/f74f129c-d63a-403e-8091-aefa53f6f97e" width="400" />
## Limitations
The way how V8 reports runtime coverage has some limitations when compared to pre-instrumented coverage:
- Unable to detect uncovered `AssignmentPattern`'s if line is otherwise covered
- https://github.com/nodejs/node/issues/57435
- Unable to detect uncovered parts when block execution stops due to function throwing:
- ```js
function first() {
throws()
// unreachable, but incorrectly covered
return "first";
}
const throws = () => { throw new Error() }
try { first(1) } catch {}
```
- ```json
[
{
"ranges": [{ "startOffset": 0, "endOffset": 165, "count": 1 }],
"isBlockCoverage": true
},
{
"functionName": "first",
"ranges": [{ "startOffset": 0, "endOffset": 92, "count": 1 }],
"isBlockCoverage": true
},
{
"functionName": "throws",
"ranges": [{ "startOffset": 109, "endOffset": 137, "count": 1 }],
"isBlockCoverage": true
}
]
```
[version-badge]: https://img.shields.io/npm/v/ast-v8-to-istanbul
[npm-url]: https://www.npmjs.com/package/ast-v8-to-istanbul
[downloads-url]: https://img.shields.io/npm/dm/ast-v8-to-istanbul

View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024 Simon Lydell
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@@ -0,0 +1,14 @@
# js-tokens
The tiny, regex powered, lenient, _almost_ spec-compliant JavaScript tokenizer that never fails.
```js
const jsTokens = require("js-tokens");
const jsString = 'JSON.stringify({k:3.14**2}, null /*replacer*/, "\\t")';
Array.from(jsTokens(jsString), (token) => token.value).join("|");
// JSON|.|stringify|(|{|k|:|3.14|**|2|}|,| |null| |/*replacer*/|,| |"\t"|)
```
**[➡️ Full readme](https://github.com/lydell/js-tokens/)**

View File

@@ -0,0 +1,37 @@
export declare type Token =
| { type: "StringLiteral"; value: string; closed: boolean }
| { type: "NoSubstitutionTemplate"; value: string; closed: boolean }
| { type: "TemplateHead"; value: string }
| { type: "TemplateMiddle"; value: string }
| { type: "TemplateTail"; value: string; closed: boolean }
| { type: "RegularExpressionLiteral"; value: string; closed: boolean }
| { type: "MultiLineComment"; value: string; closed: boolean }
| { type: "SingleLineComment"; value: string }
| { type: "HashbangComment"; value: string }
| { type: "IdentifierName"; value: string }
| { type: "PrivateIdentifier"; value: string }
| { type: "NumericLiteral"; value: string }
| { type: "Punctuator"; value: string }
| { type: "WhiteSpace"; value: string }
| { type: "LineTerminatorSequence"; value: string }
| { type: "Invalid"; value: string };
export declare type JSXToken =
| { type: "JSXString"; value: string; closed: boolean }
| { type: "JSXText"; value: string }
| { type: "JSXIdentifier"; value: string }
| { type: "JSXPunctuator"; value: string }
| { type: "JSXInvalid"; value: string };
declare function jsTokens(
input: string,
options: { jsx: true },
): Iterable<Token | JSXToken>;
declare function jsTokens(
input: string,
options?: { jsx?: boolean },
): Iterable<Token>;
// @ts-expect-error TypeScript complains about _both_ exporting types _and_ using `export =` but it seems to work fine in practice.
export = jsTokens;

View File

@@ -0,0 +1,396 @@
// Copyright 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Simon Lydell
// License: MIT.
var HashbangComment, Identifier, JSXIdentifier, JSXPunctuator, JSXString, JSXText, KeywordsWithExpressionAfter, KeywordsWithNoLineTerminatorAfter, LineTerminatorSequence, MultiLineComment, Newline, NumericLiteral, Punctuator, RegularExpressionLiteral, SingleLineComment, StringLiteral, Template, TokensNotPrecedingObjectLiteral, TokensPrecedingExpression, WhiteSpace, jsTokens;
RegularExpressionLiteral = /\/(?![*\/])(?:\[(?:[^\]\\\n\r\u2028\u2029]+|\\.)*\]?|[^\/[\\\n\r\u2028\u2029]+|\\.)*(\/[$_\u200C\u200D\p{ID_Continue}]*|\\)?/yu;
Punctuator = /--|\+\+|=>|\.{3}|\??\.(?!\d)|(?:&&|\|\||\?\?|[+\-%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2}|\/(?![\/*]))=?|[?~,:;[\](){}]/y;
Identifier = /(\x23?)(?=[$_\p{ID_Start}\\])(?:[$_\u200C\u200D\p{ID_Continue}]+|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+/yu;
StringLiteral = /(['"])(?:[^'"\\\n\r]+|(?!\1)['"]|\\(?:\r\n|[^]))*(\1)?/y;
NumericLiteral = /(?:0[xX][\da-fA-F](?:_?[\da-fA-F])*|0[oO][0-7](?:_?[0-7])*|0[bB][01](?:_?[01])*)n?|0n|[1-9](?:_?\d)*n|(?:(?:0(?!\d)|0\d*[89]\d*|[1-9](?:_?\d)*)(?:\.(?:\d(?:_?\d)*)?)?|\.\d(?:_?\d)*)(?:[eE][+-]?\d(?:_?\d)*)?|0[0-7]+/y;
Template = /[`}](?:[^`\\$]+|\\[^]|\$(?!\{))*(`|\$\{)?/y;
WhiteSpace = /[\t\v\f\ufeff\p{Zs}]+/yu;
LineTerminatorSequence = /\r?\n|[\r\u2028\u2029]/y;
MultiLineComment = /\/\*(?:[^*]+|\*(?!\/))*(\*\/)?/y;
SingleLineComment = /\/\/.*/y;
HashbangComment = /^#!.*/;
JSXPunctuator = /[<>.:={}]|\/(?![\/*])/y;
JSXIdentifier = /[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}-]*/yu;
JSXString = /(['"])(?:[^'"]+|(?!\1)['"])*(\1)?/y;
JSXText = /[^<>{}]+/y;
TokensPrecedingExpression = /^(?:[\/+-]|\.{3}|\?(?:InterpolationIn(?:JSX|Template)|NoLineTerminatorHere|NonExpressionParenEnd|UnaryIncDec))?$|[{}([,;<>=*%&|^!~?:]$/;
TokensNotPrecedingObjectLiteral = /^(?:=>|[;\]){}]|else|\?(?:NoLineTerminatorHere|NonExpressionParenEnd))?$/;
KeywordsWithExpressionAfter = /^(?:await|case|default|delete|do|else|instanceof|new|return|throw|typeof|void|yield)$/;
KeywordsWithNoLineTerminatorAfter = /^(?:return|throw|yield)$/;
Newline = RegExp(LineTerminatorSequence.source);
module.exports = jsTokens = function*(input, {jsx = false} = {}) {
var braces, firstCodePoint, isExpression, lastIndex, lastSignificantToken, length, match, mode, nextLastIndex, nextLastSignificantToken, parenNesting, postfixIncDec, punctuator, stack;
({length} = input);
lastIndex = 0;
lastSignificantToken = "";
stack = [
{tag: "JS"}
];
braces = [];
parenNesting = 0;
postfixIncDec = false;
if (match = HashbangComment.exec(input)) {
yield ({
type: "HashbangComment",
value: match[0]
});
lastIndex = match[0].length;
}
while (lastIndex < length) {
mode = stack[stack.length - 1];
switch (mode.tag) {
case "JS":
case "JSNonExpressionParen":
case "InterpolationInTemplate":
case "InterpolationInJSX":
if (input[lastIndex] === "/" && (TokensPrecedingExpression.test(lastSignificantToken) || KeywordsWithExpressionAfter.test(lastSignificantToken))) {
RegularExpressionLiteral.lastIndex = lastIndex;
if (match = RegularExpressionLiteral.exec(input)) {
lastIndex = RegularExpressionLiteral.lastIndex;
lastSignificantToken = match[0];
postfixIncDec = true;
yield ({
type: "RegularExpressionLiteral",
value: match[0],
closed: match[1] !== void 0 && match[1] !== "\\"
});
continue;
}
}
Punctuator.lastIndex = lastIndex;
if (match = Punctuator.exec(input)) {
punctuator = match[0];
nextLastIndex = Punctuator.lastIndex;
nextLastSignificantToken = punctuator;
switch (punctuator) {
case "(":
if (lastSignificantToken === "?NonExpressionParenKeyword") {
stack.push({
tag: "JSNonExpressionParen",
nesting: parenNesting
});
}
parenNesting++;
postfixIncDec = false;
break;
case ")":
parenNesting--;
postfixIncDec = true;
if (mode.tag === "JSNonExpressionParen" && parenNesting === mode.nesting) {
stack.pop();
nextLastSignificantToken = "?NonExpressionParenEnd";
postfixIncDec = false;
}
break;
case "{":
Punctuator.lastIndex = 0;
isExpression = !TokensNotPrecedingObjectLiteral.test(lastSignificantToken) && (TokensPrecedingExpression.test(lastSignificantToken) || KeywordsWithExpressionAfter.test(lastSignificantToken));
braces.push(isExpression);
postfixIncDec = false;
break;
case "}":
switch (mode.tag) {
case "InterpolationInTemplate":
if (braces.length === mode.nesting) {
Template.lastIndex = lastIndex;
match = Template.exec(input);
lastIndex = Template.lastIndex;
lastSignificantToken = match[0];
if (match[1] === "${") {
lastSignificantToken = "?InterpolationInTemplate";
postfixIncDec = false;
yield ({
type: "TemplateMiddle",
value: match[0]
});
} else {
stack.pop();
postfixIncDec = true;
yield ({
type: "TemplateTail",
value: match[0],
closed: match[1] === "`"
});
}
continue;
}
break;
case "InterpolationInJSX":
if (braces.length === mode.nesting) {
stack.pop();
lastIndex += 1;
lastSignificantToken = "}";
yield ({
type: "JSXPunctuator",
value: "}"
});
continue;
}
}
postfixIncDec = braces.pop();
nextLastSignificantToken = postfixIncDec ? "?ExpressionBraceEnd" : "}";
break;
case "]":
postfixIncDec = true;
break;
case "++":
case "--":
nextLastSignificantToken = postfixIncDec ? "?PostfixIncDec" : "?UnaryIncDec";
break;
case "<":
if (jsx && (TokensPrecedingExpression.test(lastSignificantToken) || KeywordsWithExpressionAfter.test(lastSignificantToken))) {
stack.push({tag: "JSXTag"});
lastIndex += 1;
lastSignificantToken = "<";
yield ({
type: "JSXPunctuator",
value: punctuator
});
continue;
}
postfixIncDec = false;
break;
default:
postfixIncDec = false;
}
lastIndex = nextLastIndex;
lastSignificantToken = nextLastSignificantToken;
yield ({
type: "Punctuator",
value: punctuator
});
continue;
}
Identifier.lastIndex = lastIndex;
if (match = Identifier.exec(input)) {
lastIndex = Identifier.lastIndex;
nextLastSignificantToken = match[0];
switch (match[0]) {
case "for":
case "if":
case "while":
case "with":
if (lastSignificantToken !== "." && lastSignificantToken !== "?.") {
nextLastSignificantToken = "?NonExpressionParenKeyword";
}
}
lastSignificantToken = nextLastSignificantToken;
postfixIncDec = !KeywordsWithExpressionAfter.test(match[0]);
yield ({
type: match[1] === "#" ? "PrivateIdentifier" : "IdentifierName",
value: match[0]
});
continue;
}
StringLiteral.lastIndex = lastIndex;
if (match = StringLiteral.exec(input)) {
lastIndex = StringLiteral.lastIndex;
lastSignificantToken = match[0];
postfixIncDec = true;
yield ({
type: "StringLiteral",
value: match[0],
closed: match[2] !== void 0
});
continue;
}
NumericLiteral.lastIndex = lastIndex;
if (match = NumericLiteral.exec(input)) {
lastIndex = NumericLiteral.lastIndex;
lastSignificantToken = match[0];
postfixIncDec = true;
yield ({
type: "NumericLiteral",
value: match[0]
});
continue;
}
Template.lastIndex = lastIndex;
if (match = Template.exec(input)) {
lastIndex = Template.lastIndex;
lastSignificantToken = match[0];
if (match[1] === "${") {
lastSignificantToken = "?InterpolationInTemplate";
stack.push({
tag: "InterpolationInTemplate",
nesting: braces.length
});
postfixIncDec = false;
yield ({
type: "TemplateHead",
value: match[0]
});
} else {
postfixIncDec = true;
yield ({
type: "NoSubstitutionTemplate",
value: match[0],
closed: match[1] === "`"
});
}
continue;
}
break;
case "JSXTag":
case "JSXTagEnd":
JSXPunctuator.lastIndex = lastIndex;
if (match = JSXPunctuator.exec(input)) {
lastIndex = JSXPunctuator.lastIndex;
nextLastSignificantToken = match[0];
switch (match[0]) {
case "<":
stack.push({tag: "JSXTag"});
break;
case ">":
stack.pop();
if (lastSignificantToken === "/" || mode.tag === "JSXTagEnd") {
nextLastSignificantToken = "?JSX";
postfixIncDec = true;
} else {
stack.push({tag: "JSXChildren"});
}
break;
case "{":
stack.push({
tag: "InterpolationInJSX",
nesting: braces.length
});
nextLastSignificantToken = "?InterpolationInJSX";
postfixIncDec = false;
break;
case "/":
if (lastSignificantToken === "<") {
stack.pop();
if (stack[stack.length - 1].tag === "JSXChildren") {
stack.pop();
}
stack.push({tag: "JSXTagEnd"});
}
}
lastSignificantToken = nextLastSignificantToken;
yield ({
type: "JSXPunctuator",
value: match[0]
});
continue;
}
JSXIdentifier.lastIndex = lastIndex;
if (match = JSXIdentifier.exec(input)) {
lastIndex = JSXIdentifier.lastIndex;
lastSignificantToken = match[0];
yield ({
type: "JSXIdentifier",
value: match[0]
});
continue;
}
JSXString.lastIndex = lastIndex;
if (match = JSXString.exec(input)) {
lastIndex = JSXString.lastIndex;
lastSignificantToken = match[0];
yield ({
type: "JSXString",
value: match[0],
closed: match[2] !== void 0
});
continue;
}
break;
case "JSXChildren":
JSXText.lastIndex = lastIndex;
if (match = JSXText.exec(input)) {
lastIndex = JSXText.lastIndex;
lastSignificantToken = match[0];
yield ({
type: "JSXText",
value: match[0]
});
continue;
}
switch (input[lastIndex]) {
case "<":
stack.push({tag: "JSXTag"});
lastIndex++;
lastSignificantToken = "<";
yield ({
type: "JSXPunctuator",
value: "<"
});
continue;
case "{":
stack.push({
tag: "InterpolationInJSX",
nesting: braces.length
});
lastIndex++;
lastSignificantToken = "?InterpolationInJSX";
postfixIncDec = false;
yield ({
type: "JSXPunctuator",
value: "{"
});
continue;
}
}
WhiteSpace.lastIndex = lastIndex;
if (match = WhiteSpace.exec(input)) {
lastIndex = WhiteSpace.lastIndex;
yield ({
type: "WhiteSpace",
value: match[0]
});
continue;
}
LineTerminatorSequence.lastIndex = lastIndex;
if (match = LineTerminatorSequence.exec(input)) {
lastIndex = LineTerminatorSequence.lastIndex;
postfixIncDec = false;
if (KeywordsWithNoLineTerminatorAfter.test(lastSignificantToken)) {
lastSignificantToken = "?NoLineTerminatorHere";
}
yield ({
type: "LineTerminatorSequence",
value: match[0]
});
continue;
}
MultiLineComment.lastIndex = lastIndex;
if (match = MultiLineComment.exec(input)) {
lastIndex = MultiLineComment.lastIndex;
if (Newline.test(match[0])) {
postfixIncDec = false;
if (KeywordsWithNoLineTerminatorAfter.test(lastSignificantToken)) {
lastSignificantToken = "?NoLineTerminatorHere";
}
}
yield ({
type: "MultiLineComment",
value: match[0],
closed: match[1] !== void 0
});
continue;
}
SingleLineComment.lastIndex = lastIndex;
if (match = SingleLineComment.exec(input)) {
lastIndex = SingleLineComment.lastIndex;
postfixIncDec = false;
yield ({
type: "SingleLineComment",
value: match[0]
});
continue;
}
firstCodePoint = String.fromCodePoint(input.codePointAt(lastIndex));
lastIndex += firstCodePoint.length;
lastSignificantToken = firstCodePoint;
postfixIncDec = false;
yield ({
type: mode.tag.startsWith("JSX") ? "JSXInvalid" : "Invalid",
value: firstCodePoint
});
}
return void 0;
};

View File

@@ -0,0 +1,22 @@
{
"name": "js-tokens",
"version": "9.0.1",
"author": "Simon Lydell",
"license": "MIT",
"description": "Tiny JavaScript tokenizer.",
"repository": "lydell/js-tokens",
"type": "commonjs",
"exports": "./index.js",
"keywords": [
"JavaScript",
"js",
"ECMAScript",
"es",
"token",
"tokens",
"tokenize",
"tokenizer",
"regex",
"regexp"
]
}

76
frontend/node_modules/ast-v8-to-istanbul/package.json generated vendored Normal file
View File

@@ -0,0 +1,76 @@
{
"name": "ast-v8-to-istanbul",
"version": "0.3.9",
"description": "AST-aware v8-to-istanbul",
"author": "Ari Perkkiö <ari.perkkio@gmail.com>",
"license": "MIT",
"type": "module",
"exports": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"homepage": "https://github.com/AriPerkkio/ast-v8-to-istanbul",
"bugs": "https://github.com/AriPerkkio/ast-v8-to-istanbul",
"repository": {
"type": "git",
"url": "git+https://github.com/AriPerkkio/ast-v8-to-istanbul.git"
},
"dependencies": {
"@jridgewell/trace-mapping": "^0.3.31",
"estree-walker": "^3.0.3",
"js-tokens": "^9.0.1"
},
"devDependencies": {
"@babel/parser": "^7.28.5",
"@babel/types": "^7.28.5",
"@eslint/js": "^9.39.2",
"@sveltejs/vite-plugin-svelte": "^6.2.1",
"@types/estree": "^1.0.8",
"@types/istanbul-lib-coverage": "^2.0.6",
"@types/istanbul-lib-instrument": "^1.7.8",
"@types/istanbul-lib-report": "^3.0.3",
"@types/istanbul-lib-source-maps": "^4.0.4",
"@types/istanbul-reports": "^3.0.4",
"@types/node": "^24.10.4",
"@vitejs/plugin-vue": "^6.0.3",
"@vitest/coverage-istanbul": "^4.0.15",
"@vitest/coverage-v8": "^4.0.15",
"acorn": "^8.15.0",
"eslint": "^9.39.2",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-import-x": "^4.16.1",
"eslint-plugin-prettier": "^5.5.4",
"eslint-plugin-unicorn": "^62.0.0",
"gh-pages": "^6.3.0",
"istanbul-lib-coverage": "^3.2.2",
"istanbul-lib-instrument": "^6.0.3",
"istanbul-lib-report": "^3.0.1",
"istanbul-lib-source-maps": "^5.0.6",
"istanbul-reports": "^3.2.0",
"magic-string": "^0.30.21",
"oxc-parser": "^0.102.0",
"prettier": "^3.7.4",
"rollup": "^4.53.3",
"tinyrainbow": "^3.0.3",
"tsdown": "^0.17.4",
"typescript": "^5.9.3",
"typescript-eslint": "^8.49.0",
"vite": "^7.2.7",
"vitest": "^4.0.15",
"vue": "^3.5.25",
"yaml": "^2.8.2"
},
"prettier": {},
"scripts": {
"dev": "tsdown --watch --sourcemap",
"build": "tsdown",
"deploy": "touch coverage/.nojekyll && gh-pages --dist coverage --dotfiles",
"test": "vitest",
"test:dev": "vitest --project 'vite/parseAstAsync'",
"lint": "eslint --max-warnings 0",
"typecheck": "tsc --noEmit",
"debug": "open fixture-coverage/index.html istanbul-coverage/index.html",
"verify": "pnpm build; pnpm lint; pnpm typecheck; pnpm run test --run; pnpm bench"
}
}