WIP: bootstrap and partial real Solana watcher implementation

This commit is contained in:
2026-08-16 09:17:45 +00:00
commit dc23412c3f
7232 changed files with 1687637 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
import type { LibDefinition } from '../variable';
export declare const es2020_bigint: LibDefinition;

View File

@@ -0,0 +1,91 @@
{
"name": "@eslint-community/regexpp",
"version": "4.12.2",
"description": "Regular expression parser for ECMAScript.",
"keywords": [
"regexp",
"regular",
"expression",
"parser",
"validator",
"ast",
"abstract",
"syntax",
"tree",
"ecmascript",
"es2015",
"es2016",
"es2017",
"es2018",
"es2019",
"es2020",
"es2021",
"annexB"
],
"homepage": "https://github.com/eslint-community/regexpp#readme",
"bugs": {
"url": "https://github.com/eslint-community/regexpp/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/eslint-community/regexpp"
},
"license": "MIT",
"author": "Toru Nagashima",
"exports": {
".": {
"types": "./index.d.ts",
"import": "./index.mjs",
"default": "./index.js"
},
"./package.json": "./package.json"
},
"main": "index",
"files": [
"index.*"
],
"scripts": {
"prebuild": "npm run -s clean",
"build": "run-s build:*",
"build:tsc": "tsc --module es2015",
"build:rollup": "rollup -c",
"build:dts": "npm run -s build:tsc -- --removeComments false && dts-bundle --name @eslint-community/regexpp --main .temp/index.d.ts --out ../index.d.ts && prettier --write index.d.ts",
"clean": "rimraf .temp index.*",
"lint": "eslint . --ext .ts",
"test": "nyc _mocha \"test/*.ts\" --reporter dot --timeout 10000",
"debug": "mocha --require ts-node/register/transpile-only \"test/*.ts\" --reporter dot --timeout 10000",
"update:test": "ts-node scripts/update-fixtures.ts",
"update:unicode": "run-s update:unicode:*",
"update:unicode:ids": "ts-node scripts/update-unicode-ids.ts",
"update:unicode:props": "ts-node scripts/update-unicode-properties.ts",
"update:test262:extract": "ts-node -T scripts/extract-test262.ts",
"preversion": "npm test && npm run -s build",
"postversion": "git push && git push --tags",
"prewatch": "npm run -s clean",
"watch": "_mocha \"test/*.ts\" --require ts-node/register --reporter dot --timeout 10000 --watch-extensions ts --watch --growl"
},
"dependencies": {},
"devDependencies": {
"@eslint-community/eslint-plugin-mysticatea": "^15.5.1",
"@rollup/plugin-node-resolve": "^14.1.0",
"@types/eslint": "^8.44.3",
"@types/jsdom": "^16.2.15",
"@types/mocha": "^9.1.1",
"@types/node": "^12.20.55",
"dts-bundle": "^0.7.3",
"eslint": "^8.50.0",
"js-tokens": "^8.0.2",
"jsdom": "^19.0.0",
"mocha": "^9.2.2",
"npm-run-all2": "^6.2.2",
"nyc": "^14.1.1",
"rimraf": "^3.0.2",
"rollup": "^2.79.1",
"rollup-plugin-sourcemaps": "^0.6.3",
"ts-node": "^10.9.1",
"typescript": "~5.0.2"
},
"engines": {
"node": "^12.0.0 || ^14.0.0 || >=16.0.0"
}
}

View File

@@ -0,0 +1,115 @@
/**
* License for programmatically and manually incorporated
* documentation aka. `JSDoc` from https://github.com/nodejs/node/tree/master/doc
*
* Copyright Node.js contributors. All rights reserved.
* 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.
*/
// NOTE: These definitions support Node.js and TypeScript 5.8+.
// Reference required TypeScript libraries:
/// <reference lib="es2020" />
/// <reference lib="esnext.disposable" />
/// <reference lib="esnext.float16" />
// Definitions for Node.js modules specific to TypeScript 5.7+:
/// <reference path="globals.typedarray.d.ts" />
/// <reference path="buffer.buffer.d.ts" />
// Definitions for Node.js modules that are not specific to any version of TypeScript:
/// <reference path="globals.d.ts" />
/// <reference path="web-globals/abortcontroller.d.ts" />
/// <reference path="web-globals/blob.d.ts" />
/// <reference path="web-globals/console.d.ts" />
/// <reference path="web-globals/crypto.d.ts" />
/// <reference path="web-globals/domexception.d.ts" />
/// <reference path="web-globals/encoding.d.ts" />
/// <reference path="web-globals/events.d.ts" />
/// <reference path="web-globals/fetch.d.ts" />
/// <reference path="web-globals/importmeta.d.ts" />
/// <reference path="web-globals/messaging.d.ts" />
/// <reference path="web-globals/navigator.d.ts" />
/// <reference path="web-globals/performance.d.ts" />
/// <reference path="web-globals/storage.d.ts" />
/// <reference path="web-globals/streams.d.ts" />
/// <reference path="web-globals/timers.d.ts" />
/// <reference path="web-globals/url.d.ts" />
/// <reference path="assert.d.ts" />
/// <reference path="assert/strict.d.ts" />
/// <reference path="async_hooks.d.ts" />
/// <reference path="buffer.d.ts" />
/// <reference path="child_process.d.ts" />
/// <reference path="cluster.d.ts" />
/// <reference path="console.d.ts" />
/// <reference path="constants.d.ts" />
/// <reference path="crypto.d.ts" />
/// <reference path="dgram.d.ts" />
/// <reference path="diagnostics_channel.d.ts" />
/// <reference path="dns.d.ts" />
/// <reference path="dns/promises.d.ts" />
/// <reference path="domain.d.ts" />
/// <reference path="events.d.ts" />
/// <reference path="ffi.d.ts" />
/// <reference path="fs.d.ts" />
/// <reference path="fs/promises.d.ts" />
/// <reference path="http.d.ts" />
/// <reference path="http2.d.ts" />
/// <reference path="https.d.ts" />
/// <reference path="inspector.d.ts" />
/// <reference path="inspector.generated.d.ts" />
/// <reference path="inspector/promises.d.ts" />
/// <reference path="module.d.ts" />
/// <reference path="net.d.ts" />
/// <reference path="os.d.ts" />
/// <reference path="path.d.ts" />
/// <reference path="path/posix.d.ts" />
/// <reference path="path/win32.d.ts" />
/// <reference path="perf_hooks.d.ts" />
/// <reference path="process.d.ts" />
/// <reference path="punycode.d.ts" />
/// <reference path="querystring.d.ts" />
/// <reference path="quic.d.ts" />
/// <reference path="readline.d.ts" />
/// <reference path="readline/promises.d.ts" />
/// <reference path="repl.d.ts" />
/// <reference path="sea.d.ts" />
/// <reference path="sqlite.d.ts" />
/// <reference path="stream.d.ts" />
/// <reference path="stream/consumers.d.ts" />
/// <reference path="stream/iter.d.ts" />
/// <reference path="stream/promises.d.ts" />
/// <reference path="stream/web.d.ts" />
/// <reference path="string_decoder.d.ts" />
/// <reference path="test.d.ts" />
/// <reference path="test/reporters.d.ts" />
/// <reference path="timers.d.ts" />
/// <reference path="timers/promises.d.ts" />
/// <reference path="tls.d.ts" />
/// <reference path="trace_events.d.ts" />
/// <reference path="tty.d.ts" />
/// <reference path="url.d.ts" />
/// <reference path="util.d.ts" />
/// <reference path="util/types.d.ts" />
/// <reference path="v8.d.ts" />
/// <reference path="vm.d.ts" />
/// <reference path="wasi.d.ts" />
/// <reference path="worker_threads.d.ts" />
/// <reference path="zlib.d.ts" />
/// <reference path="zlib/iter.d.ts" />

View File

@@ -0,0 +1,21 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NullThrowsReasons = void 0;
exports.nullThrows = nullThrows;
/**
* A set of common reasons for calling nullThrows
*/
exports.NullThrowsReasons = {
MissingParent: 'Expected node to have a parent.',
MissingToken: (token, thing) => `Expected to find a ${token} for the ${thing}.`,
};
/**
* Assert that a value must not be null or undefined.
* This is a nice explicit alternative to the non-null assertion operator.
*/
function nullThrows(value, message) {
if (value == null) {
throw new Error(`Non-null Assertion Failed: ${message}`);
}
return value;
}

View File

@@ -0,0 +1,11 @@
import type { TSESTree } from '@typescript-eslint/utils';
import type { InferMessageIdsTypeFromRule, InferOptionsTypeFromRule } from '../util';
declare const baseRule: import("@typescript-eslint/utils/ts-eslint").RuleModule<"noUselessConstructor" | "removeConstructor", [], unknown, {
MethodDefinition(node: TSESTree.MethodDefinition): void;
}>;
export type Options = InferOptionsTypeFromRule<typeof baseRule>;
export type MessageIds = InferMessageIdsTypeFromRule<typeof baseRule>;
declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"noUselessConstructor" | "removeConstructor", [], import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
name: string;
};
export default _default;

View File

@@ -0,0 +1,87 @@
import { FixedSizeCodec, FixedSizeDecoder, FixedSizeEncoder } from '@solana/codecs-core';
import { NumberCodecConfig } from './common';
/**
* Returns an encoder for 32-bit signed integers (`i32`).
*
* This encoder serializes `i32` values using 4 bytes.
* Values can be provided as either `number` or `bigint`.
*
* For more details, see {@link getI32Codec}.
*
* @param config - Optional configuration to specify endianness (little by default).
* @returns A `FixedSizeEncoder<number | bigint, 4>` for encoding `i32` values.
*
* @example
* Encoding an `i32` value.
* ```ts
* const encoder = getI32Encoder();
* const bytes = encoder.encode(-42); // 0xd6ffffff
* ```
*
* @see {@link getI32Codec}
*/
export declare const getI32Encoder: (config?: NumberCodecConfig) => FixedSizeEncoder<bigint | number, 4>;
/**
* Returns a decoder for 32-bit signed integers (`i32`).
*
* This decoder deserializes `i32` values from 4 bytes.
* The decoded value is always a `number`.
*
* For more details, see {@link getI32Codec}.
*
* @param config - Optional configuration to specify endianness (little by default).
* @returns A `FixedSizeDecoder<number, 4>` for decoding `i32` values.
*
* @example
* Decoding an `i32` value.
* ```ts
* const decoder = getI32Decoder();
* const value = decoder.decode(new Uint8Array([0xd6, 0xff, 0xff, 0xff])); // -42
* ```
*
* @see {@link getI32Codec}
*/
export declare const getI32Decoder: (config?: NumberCodecConfig) => FixedSizeDecoder<number, 4>;
/**
* Returns a codec for encoding and decoding 32-bit signed integers (`i32`).
*
* This codec serializes `i32` values using 4 bytes.
* Values can be provided as either `number` or `bigint`, but the decoded value is always a `number`.
*
* @param config - Optional configuration to specify endianness (little by default).
* @returns A `FixedSizeCodec<number | bigint, number, 4>` for encoding and decoding `i32` values.
*
* @example
* Encoding and decoding an `i32` value.
* ```ts
* const codec = getI32Codec();
* const bytes = codec.encode(-42); // 0xd6ffffff
* const value = codec.decode(bytes); // -42
* ```
*
* @example
* Using big-endian encoding.
* ```ts
* const codec = getI32Codec({ endian: Endian.Big });
* const bytes = codec.encode(-42); // 0xffffffd6
* ```
*
* @remarks
* This codec supports values between `-2^31` (`-2,147,483,648`) and `2^31 - 1` (`2,147,483,647`).
*
* - If you need a smaller signed integer, consider using {@link getI16Codec} or {@link getI8Codec}.
* - If you need a larger signed integer, consider using {@link getI64Codec}.
* - If you need unsigned integers, consider using {@link getU32Codec}.
*
* Separate {@link getI32Encoder} and {@link getI32Decoder} functions are available.
*
* ```ts
* const bytes = getI32Encoder().encode(-42);
* const value = getI32Decoder().decode(bytes);
* ```
*
* @see {@link getI32Encoder}
* @see {@link getI32Decoder}
*/
export declare const getI32Codec: (config?: NumberCodecConfig) => FixedSizeCodec<bigint | number, number, 4>;
//# sourceMappingURL=i32.d.ts.map

View File

@@ -0,0 +1,115 @@
/**
* @fileoverview Really small utility functions that didn't deserve their own files
*/
import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
import type { RuleContext } from '@typescript-eslint/utils/ts-eslint';
import * as ts from 'typescript';
/**
* Check if the context file name is *.d.ts or *.d.tsx
*/
export declare function isDefinitionFile(fileName: string): boolean;
/**
* Upper cases the first character or the string
*/
export declare function upperCaseFirst(str: string): string;
export declare function arrayGroupByToMap<T, Key extends number | string>(array: T[], getKey: (item: T) => Key): Map<Key, T[]>;
/** Return true if both parameters are equal. */
export type Equal<T> = (a: T, b: T) => boolean;
export declare function arraysAreEqual<T>(a: T[] | undefined, b: T[] | undefined, eq: (a: T, b: T) => boolean): boolean;
/** Returns the first non-`undefined` result. */
export declare function findFirstResult<T, U>(inputs: T[], getResult: (t: T) => U | undefined): U | undefined;
/**
* Gets a string representation of the name of the index signature.
*/
export declare function getNameFromIndexSignature(node: TSESTree.TSIndexSignature): string;
export declare enum MemberNameType {
Private = 1,
Quoted = 2,
Normal = 3,
Expression = 4
}
/**
* Gets a string name representation of the name of the given MethodDefinition
* or PropertyDefinition node, with handling for computed property names.
*/
export declare function getNameFromMember(member: TSESTree.AccessorProperty | TSESTree.MethodDefinition | TSESTree.Property | TSESTree.PropertyDefinition | TSESTree.TSAbstractAccessorProperty | TSESTree.TSAbstractMethodDefinition | TSESTree.TSAbstractPropertyDefinition | TSESTree.TSMethodSignature | TSESTree.TSPropertySignature, sourceCode: TSESLint.SourceCode): {
name: string;
type: MemberNameType;
};
export type ExcludeKeys<Obj extends Record<string, unknown>, Keys extends keyof Obj> = {
[k in Exclude<keyof Obj, Keys>]: Obj[k];
};
export type RequireKeys<Obj extends Record<string, unknown>, Keys extends keyof Obj> = {
[k in Keys]-?: Exclude<Obj[k], undefined>;
} & ExcludeKeys<Obj, Keys>;
export declare function getEnumNames<T extends string>(myEnum: Record<T, unknown>): T[];
/**
* Given an array of words, returns an English-friendly concatenation, separated with commas, with
* the `and` clause inserted before the last item.
*
* Example: ['foo', 'bar', 'baz' ] returns the string "foo, bar, and baz".
*/
export declare function formatWordList(words: string[]): string;
/**
* Iterates the array in reverse and returns the index of the first element it
* finds which passes the predicate function.
*
* @returns Returns the index of the element if it finds it or -1 otherwise.
*/
export declare function findLastIndex<T>(members: T[], predicate: (member: T) => boolean | null | undefined): number;
export declare function typeNodeRequiresParentheses(node: TSESTree.TypeNode, text: string): boolean;
export declare function isRestParameterDeclaration(decl: ts.Declaration): boolean;
export declare function isParenlessArrowFunction(node: TSESTree.ArrowFunctionExpression, sourceCode: TSESLint.SourceCode): boolean;
export type NodeWithKey = TSESTree.AccessorProperty | TSESTree.MemberExpression | TSESTree.MethodDefinition | TSESTree.Property | TSESTree.PropertyDefinition | TSESTree.TSAbstractMethodDefinition | TSESTree.TSAbstractPropertyDefinition;
/**
* Gets a member being accessed or declared if its value can be determined statically, and
* resolves it to the string or symbol value that will be used as the actual member
* access key at runtime. Otherwise, returns `undefined`.
*
* ```ts
* x.member // returns 'member'
* ^^^^^^^^
*
* x?.member // returns 'member' (optional chaining is treated the same)
* ^^^^^^^^^
*
* x['value'] // returns 'value'
* ^^^^^^^^^^
*
* x[Math.random()] // returns undefined (not a static value)
* ^^^^^^^^^^^^^^^^
*
* arr[0] // returns '0' (NOT 0)
* ^^^^^^
*
* arr[0n] // returns '0' (NOT 0n)
* ^^^^^^^
*
* const s = Symbol.for('symbolName')
* x[s] // returns `Symbol.for('symbolName')` (since it's a static/global symbol)
* ^^^^
*
* const us = Symbol('symbolName')
* x[us] // returns undefined (since it's a unique symbol, so not statically analyzable)
* ^^^^^
*
* var object = {
* 1234: '4567', // returns '1234' (NOT 1234)
* ^^^^^^^^^^^^
* method() { } // returns 'method'
* ^^^^^^^^^^^^
* }
*
* class WithMembers {
* foo: string // returns 'foo'
* ^^^^^^^^^^^
* }
* ```
*/
export declare function getStaticMemberAccessValue(node: NodeWithKey, { sourceCode }: RuleContext<string, unknown[]>): string | symbol | undefined;
/**
* Answers whether the member expression looks like
* `x.value`, `x['value']`,
* or even `const v = 'value'; x[v]` (or optional variants thereof).
*/
export declare const isStaticMemberAccessOfValue: (memberExpression: NodeWithKey, context: RuleContext<string, unknown[]>, ...values: (string | symbol)[]) => boolean;

View File

@@ -0,0 +1,186 @@
/**
* @fileoverview Rule to disallow async functions which have no `await` expression.
* @author Toru Nagashima
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
/**
* Capitalize the 1st letter of the given text.
* @param {string} text The text to capitalize.
* @returns {string} The text that the 1st letter was capitalized.
*/
function capitalizeFirstLetter(text) {
return text[0].toUpperCase() + text.slice(1);
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
docs: {
description:
"Disallow async functions which have no `await` expression",
recommended: false,
url: "https://eslint.org/docs/latest/rules/require-await",
},
schema: [],
messages: {
missingAwait: "{{name}} has no 'await' expression.",
removeAsync: "Remove 'async'.",
},
hasSuggestions: true,
},
create(context) {
const sourceCode = context.sourceCode;
let scopeInfo = null;
/**
* Push the scope info object to the stack.
* @returns {void}
*/
function enterFunction() {
scopeInfo = {
upper: scopeInfo,
hasAwait: false,
};
}
/**
* Pop the top scope info object from the stack.
* Also, it reports the function if needed.
* @param {ASTNode} node The node to report.
* @returns {void}
*/
function exitFunction(node) {
if (
!node.generator &&
node.async &&
!scopeInfo.hasAwait &&
!astUtils.isEmptyFunction(node)
) {
/*
* If the function belongs to a method definition or
* property, then the function's range may not include the
* `async` keyword and we should look at the parent instead.
*/
const nodeWithAsyncKeyword =
(node.parent.type === "MethodDefinition" &&
node.parent.value === node) ||
(node.parent.type === "Property" &&
node.parent.method &&
node.parent.value === node)
? node.parent
: node;
const asyncToken = sourceCode.getFirstToken(
nodeWithAsyncKeyword,
token => token.value === "async",
);
const asyncRange = [
asyncToken.range[0],
sourceCode.getTokenAfter(asyncToken, {
includeComments: true,
}).range[0],
];
/*
* Removing the `async` keyword can cause parsing errors if the current
* statement is relying on automatic semicolon insertion. If ASI is currently
* being used, then we should replace the `async` keyword with a semicolon.
*/
const nextToken = sourceCode.getTokenAfter(asyncToken);
const addSemiColon =
((astUtils.isOpeningParenToken(nextToken) &&
astUtils.isStartOfExpressionStatement(
nodeWithAsyncKeyword,
)) ||
(nodeWithAsyncKeyword.type === "MethodDefinition" &&
astUtils.canContinueExpressionInClassBody(
nextToken,
))) &&
astUtils.needsPrecedingSemicolon(
sourceCode,
nodeWithAsyncKeyword,
);
context.report({
node,
loc: astUtils.getFunctionHeadLoc(node, sourceCode),
messageId: "missingAwait",
data: {
name: capitalizeFirstLetter(
astUtils.getFunctionNameWithKind(node),
),
},
suggest: [
{
messageId: "removeAsync",
fix: fixer =>
fixer.replaceTextRange(
asyncRange,
addSemiColon ? ";" : "",
),
},
],
});
}
scopeInfo = scopeInfo.upper;
}
return {
FunctionDeclaration: enterFunction,
FunctionExpression: enterFunction,
ArrowFunctionExpression: enterFunction,
"FunctionDeclaration:exit": exitFunction,
"FunctionExpression:exit": exitFunction,
"ArrowFunctionExpression:exit": exitFunction,
AwaitExpression() {
if (!scopeInfo) {
return;
}
scopeInfo.hasAwait = true;
},
ForOfStatement(node) {
if (!scopeInfo) {
return;
}
if (node.await) {
scopeInfo.hasAwait = true;
}
},
VariableDeclaration(node) {
if (!scopeInfo) {
return;
}
if (node.kind === "await using") {
scopeInfo.hasAwait = true;
}
},
};
},
};

View File

@@ -0,0 +1,31 @@
'use strict';
const Benchmark = require('benchmark');
const suite = new Benchmark.Suite;
const testData = require('./test.json');
const stringifyPackages = {
// 'JSON.stringify': JSON.stringify,
'fast-json-stable-stringify': require('../index'),
'json-stable-stringify': true,
'fast-stable-stringify': true,
'faster-stable-stringify': true
};
for (const name in stringifyPackages) {
let func = stringifyPackages[name];
if (func === true) func = require(name);
suite.add(name, function() {
func(testData);
});
}
suite
.on('cycle', (event) => console.log(String(event.target)))
.on('complete', function () {
console.log('The fastest is ' + this.filter('fastest').map('name'));
})
.run({async: true});

View File

@@ -0,0 +1,5 @@
import {PublicKey} from './publickey';
export const BPF_LOADER_DEPRECATED_PROGRAM_ID = new PublicKey(
'BPFLoader1111111111111111111111111111111111',
);

View File

@@ -0,0 +1,124 @@
'use strict';
module.exports = function generate_ref(it, $keyword, $ruleType) {
var out = ' ';
var $lvl = it.level;
var $dataLvl = it.dataLevel;
var $schema = it.schema[$keyword];
var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
var $breakOnError = !it.opts.allErrors;
var $data = 'data' + ($dataLvl || '');
var $valid = 'valid' + $lvl;
var $async, $refCode;
if ($schema == '#' || $schema == '#/') {
if (it.isRoot) {
$async = it.async;
$refCode = 'validate';
} else {
$async = it.root.schema.$async === true;
$refCode = 'root.refVal[0]';
}
} else {
var $refVal = it.resolveRef(it.baseId, $schema, it.isRoot);
if ($refVal === undefined) {
var $message = it.MissingRefError.message(it.baseId, $schema);
if (it.opts.missingRefs == 'fail') {
it.logger.error($message);
var $$outStack = $$outStack || [];
$$outStack.push(out);
out = ''; /* istanbul ignore else */
if (it.createErrors !== false) {
out += ' { keyword: \'' + ('$ref') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { ref: \'' + (it.util.escapeQuotes($schema)) + '\' } ';
if (it.opts.messages !== false) {
out += ' , message: \'can\\\'t resolve reference ' + (it.util.escapeQuotes($schema)) + '\' ';
}
if (it.opts.verbose) {
out += ' , schema: ' + (it.util.toQuotedString($schema)) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
}
out += ' } ';
} else {
out += ' {} ';
}
var __err = out;
out = $$outStack.pop();
if (!it.compositeRule && $breakOnError) {
/* istanbul ignore if */
if (it.async) {
out += ' throw new ValidationError([' + (__err) + ']); ';
} else {
out += ' validate.errors = [' + (__err) + ']; return false; ';
}
} else {
out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
}
if ($breakOnError) {
out += ' if (false) { ';
}
} else if (it.opts.missingRefs == 'ignore') {
it.logger.warn($message);
if ($breakOnError) {
out += ' if (true) { ';
}
} else {
throw new it.MissingRefError(it.baseId, $schema, $message);
}
} else if ($refVal.inline) {
var $it = it.util.copy(it);
$it.level++;
var $nextValid = 'valid' + $it.level;
$it.schema = $refVal.schema;
$it.schemaPath = '';
$it.errSchemaPath = $schema;
var $code = it.validate($it).replace(/validate\.schema/g, $refVal.code);
out += ' ' + ($code) + ' ';
if ($breakOnError) {
out += ' if (' + ($nextValid) + ') { ';
}
} else {
$async = $refVal.$async === true || (it.async && $refVal.$async !== false);
$refCode = $refVal.code;
}
}
if ($refCode) {
var $$outStack = $$outStack || [];
$$outStack.push(out);
out = '';
if (it.opts.passContext) {
out += ' ' + ($refCode) + '.call(this, ';
} else {
out += ' ' + ($refCode) + '( ';
}
out += ' ' + ($data) + ', (dataPath || \'\')';
if (it.errorPath != '""') {
out += ' + ' + (it.errorPath);
}
var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData',
$parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty';
out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ', rootData) ';
var __callValidate = out;
out = $$outStack.pop();
if ($async) {
if (!it.async) throw new Error('async schema referenced by sync schema');
if ($breakOnError) {
out += ' var ' + ($valid) + '; ';
}
out += ' try { await ' + (__callValidate) + '; ';
if ($breakOnError) {
out += ' ' + ($valid) + ' = true; ';
}
out += ' } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ';
if ($breakOnError) {
out += ' ' + ($valid) + ' = false; ';
}
out += ' } ';
if ($breakOnError) {
out += ' if (' + ($valid) + ') { ';
}
} else {
out += ' if (!' + (__callValidate) + ') { if (vErrors === null) vErrors = ' + ($refCode) + '.errors; else vErrors = vErrors.concat(' + ($refCode) + '.errors); errors = vErrors.length; } ';
if ($breakOnError) {
out += ' else { ';
}
}
}
return out;
}

View File

@@ -0,0 +1,42 @@
var wrappy = require('wrappy')
module.exports = wrappy(once)
module.exports.strict = wrappy(onceStrict)
once.proto = once(function () {
Object.defineProperty(Function.prototype, 'once', {
value: function () {
return once(this)
},
configurable: true
})
Object.defineProperty(Function.prototype, 'onceStrict', {
value: function () {
return onceStrict(this)
},
configurable: true
})
})
function once (fn) {
var f = function () {
if (f.called) return f.value
f.called = true
return f.value = fn.apply(this, arguments)
}
f.called = false
return f
}
function onceStrict (fn) {
var f = function () {
if (f.called)
throw new Error(f.onceError)
f.called = true
return f.value = fn.apply(this, arguments)
}
var name = fn.name || 'Function wrapped with `once`'
f.onceError = name + " shouldn't be called more than once"
f.called = false
return f
}

View File

@@ -0,0 +1,133 @@
#!/usr/bin/env zx
import { $, fs, glob } from "zx";
import { ast_grep } from "./ast_grep.js";
import { errors } from "./errors.js";
import { root } from "./utils.js";
// clear generated content
await Promise.all([
fs.remove(root("cjs")),
fs.remove(root("_")),
fs.remove(root("src")),
]);
let modules = await glob("*.js", { cwd: root("esm") });
const task_queue = [];
const NO_MODIFY = [
"/* This file is automatically generated and should not be manually edited. */",
"/* To modify this file, please run the `npm run build` command instead. */",
];
// generate index.js
const indexESM = [...NO_MODIFY, ""];
const indexCJS = [`"use strict";`, "", ...NO_MODIFY, ""];
const cjs_export_list = [];
const cjs_module_lexer = [];
const main_package_json = fs.readJSONSync(root("package.json"));
main_package_json.exports = {
"./package.json": "./package.json",
"./esm/*": "./esm/*",
"./cjs/*": "./cjs/*",
"./src/*": "./src/*",
".": {
"module-sync": "./esm/index.js",
webpack: "./esm/index.js",
import: "./esm/index.js",
default: "./cjs/index.cjs",
},
"./_": {
"module-sync": "./esm/index.js",
webpack: "./esm/index.js",
import: "./esm/index.js",
default: "./cjs/index.cjs",
},
};
modules.forEach((p) => {
const importBinding = p.slice(0, -3);
main_package_json.exports[`./_/${importBinding}`] = {
"module-sync": `./esm/${importBinding}.js`,
webpack: `./esm/${importBinding}.js`,
import: `./esm/${importBinding}.js`,
default: `./cjs/${importBinding}.cjs`,
};
const alias_package = {
main: `../../cjs/${importBinding}.cjs`,
module: `../../esm/${importBinding}.js`,
};
task_queue.push(
fs.outputJSON(root("_", importBinding, "package.json"), alias_package, {
encoding: "utf-8",
spaces: 4,
}),
);
if (importBinding === "index") {
return;
}
task_queue.push(
fs.outputFile(root("src", `${importBinding}.mjs`), re_export_esm(importBinding), {
encoding: "utf-8",
}),
);
indexESM.push(`export { _ as ${importBinding} } from "./${importBinding}.js";`);
cjs_module_lexer.push(`${importBinding}: null,`);
cjs_export_list.push(`get ${importBinding}() {
return require("./${importBinding}.cjs")._;
},`);
});
indexCJS.push(
`0 && (module.exports = {`,
"/* @Annotate_start: the CommonJS named exports for ESM import in node */",
...cjs_module_lexer,
"/* @Annotate_end */",
`});`,
`module.exports = {`,
...cjs_export_list,
`};`,
);
task_queue.push(
fs.outputJSON(root("package.json"), main_package_json, { spaces: 4 }),
fs.outputFile(root("esm", "index.js"), indexESM.join("\n") + "\n", {
encoding: "utf-8",
}),
fs.outputFile(root("cjs", "index.cjs"), indexCJS.join("\n") + "\n", {
encoding: "utf-8",
}),
fs.outputFile(root("src", "index.mjs"), `export * from "../esm/index.js"`, {
encoding: "utf-8",
}),
);
task_queue.push(...ast_grep());
await Promise.all(task_queue);
if (errors.length > 0) {
errors.forEach((e) => {
console.error(e);
});
process.exitCode = 1;
} else {
$.cwd = root(".");
await $`dprint fmt`;
await $`dprint fmt "scripts/*.js" -c scripts/.dprint.json`;
}
function re_export_esm(importBinding) {
return `export { _ as default } from "../esm/${importBinding}.js"`;
}

View File

@@ -0,0 +1,4 @@
'use strict'
// XXX remove in v8 or beyond
module.exports = require('./index.js')

View File

@@ -0,0 +1,66 @@
import * as core from "../core/index.js";
import * as schemas from "./schemas.js";
// iso time
export interface ZodMiniISODateTime extends schemas.ZodMiniStringFormat<"datetime"> {
_zod: core.$ZodISODateTimeInternals;
}
export const ZodMiniISODateTime: core.$constructor<ZodMiniISODateTime> = /*@__PURE__*/ core.$constructor(
"ZodMiniISODateTime",
(inst, def) => {
core.$ZodISODateTime.init(inst, def);
schemas.ZodMiniStringFormat.init(inst, def);
}
);
// @__NO_SIDE_EFFECTS__
export function datetime(params?: string | core.$ZodISODateTimeParams): ZodMiniISODateTime {
return core._isoDateTime(ZodMiniISODateTime, params);
}
// iso date
export interface ZodMiniISODate extends schemas.ZodMiniStringFormat<"date"> {
_zod: core.$ZodISODateInternals;
}
export const ZodMiniISODate: core.$constructor<ZodMiniISODate> = /*@__PURE__*/ core.$constructor(
"ZodMiniISODate",
(inst, def) => {
core.$ZodISODate.init(inst, def);
schemas.ZodMiniStringFormat.init(inst, def);
}
);
// @__NO_SIDE_EFFECTS__
export function date(params?: string | core.$ZodISODateParams): ZodMiniISODate {
return core._isoDate(ZodMiniISODate, params);
}
// iso time
export interface ZodMiniISOTime extends schemas.ZodMiniStringFormat<"time"> {
_zod: core.$ZodISOTimeInternals;
}
export const ZodMiniISOTime: core.$constructor<ZodMiniISOTime> = /*@__PURE__*/ core.$constructor(
"ZodMiniISOTime",
(inst, def) => {
core.$ZodISOTime.init(inst, def);
schemas.ZodMiniStringFormat.init(inst, def);
}
);
// @__NO_SIDE_EFFECTS__
export function time(params?: string | core.$ZodISOTimeParams): ZodMiniISOTime {
return core._isoTime(ZodMiniISOTime, params);
}
// iso duration
export interface ZodMiniISODuration extends schemas.ZodMiniStringFormat<"duration"> {
_zod: core.$ZodISODurationInternals;
}
export const ZodMiniISODuration: core.$constructor<ZodMiniISODuration> = /*@__PURE__*/ core.$constructor(
"ZodMiniISODuration",
(inst, def) => {
core.$ZodISODuration.init(inst, def);
schemas.ZodMiniStringFormat.init(inst, def);
}
);
// @__NO_SIDE_EFFECTS__
export function duration(params?: string | core.$ZodISODurationParams): ZodMiniISODuration {
return core._isoDuration(ZodMiniISODuration, params);
}

View File

@@ -0,0 +1,8 @@
"use strict";
var _overload_yield = require("./_overload_yield.cjs");
function _await_async_generator(value) {
return new _overload_yield._(value, /* kind: await */ 0);
}
exports._ = _await_async_generator;

View File

@@ -0,0 +1,242 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
const regexpp_1 = require("@eslint-community/regexpp");
const utils_1 = require("@typescript-eslint/utils");
const ts = __importStar(require("typescript"));
const util_1 = require("../util");
exports.default = (0, util_1.createRule)({
name: 'prefer-includes',
meta: {
type: 'suggestion',
docs: {
description: 'Enforce `includes` method over `indexOf` method',
recommended: 'stylistic',
requiresTypeChecking: true,
},
fixable: 'code',
messages: {
preferIncludes: "Use 'includes()' method instead.",
preferStringIncludes: 'Use `String#includes()` method with a string instead.',
},
schema: [],
},
defaultOptions: [],
create(context) {
const globalScope = context.sourceCode.getScope(context.sourceCode.ast);
const services = (0, util_1.getParserServices)(context);
const checker = services.program.getTypeChecker();
function isNumber(node, value) {
const evaluated = (0, util_1.getStaticValue)(node, globalScope);
return evaluated?.value === value;
}
function isPositiveCheck(node) {
switch (node.operator) {
case '!==':
case '!=':
case '>':
return isNumber(node.right, -1);
case '>=':
return isNumber(node.right, 0);
default:
return false;
}
}
function isNegativeCheck(node) {
switch (node.operator) {
case '===':
case '==':
case '<=':
return isNumber(node.right, -1);
case '<':
return isNumber(node.right, 0);
default:
return false;
}
}
function hasSameParameters(nodeA, nodeB) {
if (!ts.isFunctionLike(nodeA) || !ts.isFunctionLike(nodeB)) {
return false;
}
const paramsA = nodeA.parameters;
const paramsB = nodeB.parameters;
if (paramsA.length !== paramsB.length) {
return false;
}
for (let i = 0; i < paramsA.length; ++i) {
const paramA = paramsA[i];
const paramB = paramsB[i];
// Check name, type, and question token once.
if (paramA.getText() !== paramB.getText()) {
return false;
}
}
return true;
}
/**
* Parse a given node if it's a `RegExp` instance.
* @param node The node to parse.
*/
function parseRegExp(node) {
const evaluated = (0, util_1.getStaticValue)(node, globalScope);
if (evaluated == null || !(evaluated.value instanceof RegExp)) {
return null;
}
const { flags, pattern } = (0, regexpp_1.parseRegExpLiteral)(evaluated.value);
if (pattern.alternatives.length !== 1 ||
flags.ignoreCase ||
flags.global) {
return null;
}
// Check if it can determine a unique string.
const chars = pattern.alternatives[0].elements;
if (!chars.every(c => c.type === 'Character')) {
return null;
}
// To string.
return String.fromCodePoint(...chars.map(c => c.value));
}
function escapeString(str) {
const EscapeMap = {
'\0': '\\0',
'\t': '\\t',
'\n': '\\n',
'\v': '\\v',
'\f': '\\f',
'\r': '\\r',
"'": "\\'",
'\\': '\\\\',
// "\b" cause unexpected replacements
// '\b': '\\b',
};
const replaceRegex = new RegExp(Object.values(EscapeMap).join('|'), 'g');
return str.replaceAll(replaceRegex, char => EscapeMap[char]);
}
function checkArrayIndexOf(node, allowFixing) {
if (!(0, util_1.isStaticMemberAccessOfValue)(node, context, 'indexOf')) {
return;
}
// Check if the comparison is equivalent to `includes()`.
const callNode = node.parent;
const compareNode = (callNode.parent.type === utils_1.AST_NODE_TYPES.ChainExpression
? callNode.parent.parent
: callNode.parent);
const negative = isNegativeCheck(compareNode);
if (!negative && !isPositiveCheck(compareNode)) {
return;
}
// Get the symbol of `indexOf` method.
const indexofMethodDeclarations = services
.getSymbolAtLocation(node.property)
?.getDeclarations();
if (indexofMethodDeclarations == null ||
indexofMethodDeclarations.length === 0) {
return;
}
// Check if every declaration of `indexOf` method has `includes` method
// and the two methods have the same parameters.
for (const instanceofMethodDecl of indexofMethodDeclarations) {
const typeDecl = instanceofMethodDecl.parent;
const type = checker.getTypeAtLocation(typeDecl);
const includesMethodDecl = type
.getProperty('includes')
?.getDeclarations();
if (!includesMethodDecl?.some(includesMethodDecl => hasSameParameters(includesMethodDecl, instanceofMethodDecl))) {
return;
}
}
// Report it.
context.report({
node: compareNode,
messageId: 'preferIncludes',
...(allowFixing && {
*fix(fixer) {
if (negative) {
yield fixer.insertTextBefore(callNode, '!');
}
yield fixer.replaceText(node.property, 'includes');
yield fixer.removeRange([callNode.range[1], compareNode.range[1]]);
},
}),
});
}
return {
// a.indexOf(b) !== 1
'BinaryExpression > CallExpression.left > MemberExpression'(node) {
checkArrayIndexOf(node, /* allowFixing */ true);
},
// a?.indexOf(b) !== 1
'BinaryExpression > ChainExpression.left > CallExpression > MemberExpression'(node) {
checkArrayIndexOf(node, /* allowFixing */ false);
},
// /bar/.test(foo)
'CallExpression[arguments.length=1] > MemberExpression.callee[property.name="test"][computed=false]'(node) {
const callNode = node.parent;
const text = parseRegExp(node.object);
if (text == null) {
return;
}
//check the argument type of test methods
const argument = callNode.arguments[0];
const type = (0, util_1.getConstrainedTypeAtLocation)(services, argument);
const includesMethodDecl = type
.getProperty('includes')
?.getDeclarations();
if (includesMethodDecl == null) {
return;
}
context.report({
node: callNode,
messageId: 'preferStringIncludes',
*fix(fixer) {
const argNode = callNode.arguments[0];
const needsParen = argNode.type !== utils_1.AST_NODE_TYPES.Literal &&
argNode.type !== utils_1.AST_NODE_TYPES.TemplateLiteral &&
argNode.type !== utils_1.AST_NODE_TYPES.Identifier &&
argNode.type !== utils_1.AST_NODE_TYPES.MemberExpression &&
argNode.type !== utils_1.AST_NODE_TYPES.CallExpression;
yield fixer.removeRange([callNode.range[0], argNode.range[0]]);
yield fixer.removeRange([argNode.range[1], callNode.range[1]]);
if (needsParen) {
yield fixer.insertTextBefore(argNode, '(');
yield fixer.insertTextAfter(argNode, ')');
}
yield fixer.insertTextAfter(argNode, `${node.optional ? '?.' : '.'}includes('${escapeString(text)}')`);
},
});
},
};
},
});

View File

@@ -0,0 +1,47 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.JSONSchema = exports.JSONSchemaGenerator = exports.toJSONSchema = exports.locales = exports.regexes = exports.util = void 0;
__exportStar(require("./core.cjs"), exports);
__exportStar(require("./parse.cjs"), exports);
__exportStar(require("./errors.cjs"), exports);
__exportStar(require("./schemas.cjs"), exports);
__exportStar(require("./checks.cjs"), exports);
__exportStar(require("./versions.cjs"), exports);
exports.util = __importStar(require("./util.cjs"));
exports.regexes = __importStar(require("./regexes.cjs"));
exports.locales = __importStar(require("../locales/index.cjs"));
__exportStar(require("./registries.cjs"), exports);
__exportStar(require("./doc.cjs"), exports);
__exportStar(require("./api.cjs"), exports);
__exportStar(require("./to-json-schema.cjs"), exports);
var json_schema_processors_js_1 = require("./json-schema-processors.cjs");
Object.defineProperty(exports, "toJSONSchema", { enumerable: true, get: function () { return json_schema_processors_js_1.toJSONSchema; } });
var json_schema_generator_js_1 = require("./json-schema-generator.cjs");
Object.defineProperty(exports, "JSONSchemaGenerator", { enumerable: true, get: function () { return json_schema_generator_js_1.JSONSchemaGenerator; } });
exports.JSONSchema = __importStar(require("./json-schema.cjs"));

View File

@@ -0,0 +1,391 @@
// Code generated by Herebyfile.mjs generate:enums from internal/ast/kind_generated.go. DO NOT EDIT.
export var SyntaxKind;
(function (SyntaxKind) {
SyntaxKind[SyntaxKind["Unknown"] = 0] = "Unknown";
SyntaxKind[SyntaxKind["EndOfFile"] = 1] = "EndOfFile";
SyntaxKind[SyntaxKind["SingleLineCommentTrivia"] = 2] = "SingleLineCommentTrivia";
SyntaxKind[SyntaxKind["MultiLineCommentTrivia"] = 3] = "MultiLineCommentTrivia";
SyntaxKind[SyntaxKind["NewLineTrivia"] = 4] = "NewLineTrivia";
SyntaxKind[SyntaxKind["WhitespaceTrivia"] = 5] = "WhitespaceTrivia";
SyntaxKind[SyntaxKind["ConflictMarkerTrivia"] = 6] = "ConflictMarkerTrivia";
SyntaxKind[SyntaxKind["NonTextFileMarkerTrivia"] = 7] = "NonTextFileMarkerTrivia";
SyntaxKind[SyntaxKind["NumericLiteral"] = 8] = "NumericLiteral";
SyntaxKind[SyntaxKind["BigIntLiteral"] = 9] = "BigIntLiteral";
SyntaxKind[SyntaxKind["StringLiteral"] = 10] = "StringLiteral";
SyntaxKind[SyntaxKind["JsxText"] = 11] = "JsxText";
SyntaxKind[SyntaxKind["JsxTextAllWhiteSpaces"] = 12] = "JsxTextAllWhiteSpaces";
SyntaxKind[SyntaxKind["RegularExpressionLiteral"] = 13] = "RegularExpressionLiteral";
SyntaxKind[SyntaxKind["NoSubstitutionTemplateLiteral"] = 14] = "NoSubstitutionTemplateLiteral";
SyntaxKind[SyntaxKind["TemplateHead"] = 15] = "TemplateHead";
SyntaxKind[SyntaxKind["TemplateMiddle"] = 16] = "TemplateMiddle";
SyntaxKind[SyntaxKind["TemplateTail"] = 17] = "TemplateTail";
SyntaxKind[SyntaxKind["OpenBraceToken"] = 18] = "OpenBraceToken";
SyntaxKind[SyntaxKind["CloseBraceToken"] = 19] = "CloseBraceToken";
SyntaxKind[SyntaxKind["OpenParenToken"] = 20] = "OpenParenToken";
SyntaxKind[SyntaxKind["CloseParenToken"] = 21] = "CloseParenToken";
SyntaxKind[SyntaxKind["OpenBracketToken"] = 22] = "OpenBracketToken";
SyntaxKind[SyntaxKind["CloseBracketToken"] = 23] = "CloseBracketToken";
SyntaxKind[SyntaxKind["DotToken"] = 24] = "DotToken";
SyntaxKind[SyntaxKind["DotDotDotToken"] = 25] = "DotDotDotToken";
SyntaxKind[SyntaxKind["SemicolonToken"] = 26] = "SemicolonToken";
SyntaxKind[SyntaxKind["CommaToken"] = 27] = "CommaToken";
SyntaxKind[SyntaxKind["QuestionDotToken"] = 28] = "QuestionDotToken";
SyntaxKind[SyntaxKind["LessThanToken"] = 29] = "LessThanToken";
SyntaxKind[SyntaxKind["LessThanSlashToken"] = 30] = "LessThanSlashToken";
SyntaxKind[SyntaxKind["GreaterThanToken"] = 31] = "GreaterThanToken";
SyntaxKind[SyntaxKind["LessThanEqualsToken"] = 32] = "LessThanEqualsToken";
SyntaxKind[SyntaxKind["GreaterThanEqualsToken"] = 33] = "GreaterThanEqualsToken";
SyntaxKind[SyntaxKind["EqualsEqualsToken"] = 34] = "EqualsEqualsToken";
SyntaxKind[SyntaxKind["ExclamationEqualsToken"] = 35] = "ExclamationEqualsToken";
SyntaxKind[SyntaxKind["EqualsEqualsEqualsToken"] = 36] = "EqualsEqualsEqualsToken";
SyntaxKind[SyntaxKind["ExclamationEqualsEqualsToken"] = 37] = "ExclamationEqualsEqualsToken";
SyntaxKind[SyntaxKind["EqualsGreaterThanToken"] = 38] = "EqualsGreaterThanToken";
SyntaxKind[SyntaxKind["PlusToken"] = 39] = "PlusToken";
SyntaxKind[SyntaxKind["MinusToken"] = 40] = "MinusToken";
SyntaxKind[SyntaxKind["AsteriskToken"] = 41] = "AsteriskToken";
SyntaxKind[SyntaxKind["AsteriskAsteriskToken"] = 42] = "AsteriskAsteriskToken";
SyntaxKind[SyntaxKind["SlashToken"] = 43] = "SlashToken";
SyntaxKind[SyntaxKind["PercentToken"] = 44] = "PercentToken";
SyntaxKind[SyntaxKind["PlusPlusToken"] = 45] = "PlusPlusToken";
SyntaxKind[SyntaxKind["MinusMinusToken"] = 46] = "MinusMinusToken";
SyntaxKind[SyntaxKind["LessThanLessThanToken"] = 47] = "LessThanLessThanToken";
SyntaxKind[SyntaxKind["GreaterThanGreaterThanToken"] = 48] = "GreaterThanGreaterThanToken";
SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanToken"] = 49] = "GreaterThanGreaterThanGreaterThanToken";
SyntaxKind[SyntaxKind["AmpersandToken"] = 50] = "AmpersandToken";
SyntaxKind[SyntaxKind["BarToken"] = 51] = "BarToken";
SyntaxKind[SyntaxKind["CaretToken"] = 52] = "CaretToken";
SyntaxKind[SyntaxKind["ExclamationToken"] = 53] = "ExclamationToken";
SyntaxKind[SyntaxKind["TildeToken"] = 54] = "TildeToken";
SyntaxKind[SyntaxKind["AmpersandAmpersandToken"] = 55] = "AmpersandAmpersandToken";
SyntaxKind[SyntaxKind["BarBarToken"] = 56] = "BarBarToken";
SyntaxKind[SyntaxKind["QuestionToken"] = 57] = "QuestionToken";
SyntaxKind[SyntaxKind["ColonToken"] = 58] = "ColonToken";
SyntaxKind[SyntaxKind["AtToken"] = 59] = "AtToken";
SyntaxKind[SyntaxKind["QuestionQuestionToken"] = 60] = "QuestionQuestionToken";
SyntaxKind[SyntaxKind["BacktickToken"] = 61] = "BacktickToken";
SyntaxKind[SyntaxKind["HashToken"] = 62] = "HashToken";
SyntaxKind[SyntaxKind["EqualsToken"] = 63] = "EqualsToken";
SyntaxKind[SyntaxKind["PlusEqualsToken"] = 64] = "PlusEqualsToken";
SyntaxKind[SyntaxKind["MinusEqualsToken"] = 65] = "MinusEqualsToken";
SyntaxKind[SyntaxKind["AsteriskEqualsToken"] = 66] = "AsteriskEqualsToken";
SyntaxKind[SyntaxKind["AsteriskAsteriskEqualsToken"] = 67] = "AsteriskAsteriskEqualsToken";
SyntaxKind[SyntaxKind["SlashEqualsToken"] = 68] = "SlashEqualsToken";
SyntaxKind[SyntaxKind["PercentEqualsToken"] = 69] = "PercentEqualsToken";
SyntaxKind[SyntaxKind["LessThanLessThanEqualsToken"] = 70] = "LessThanLessThanEqualsToken";
SyntaxKind[SyntaxKind["GreaterThanGreaterThanEqualsToken"] = 71] = "GreaterThanGreaterThanEqualsToken";
SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanEqualsToken"] = 72] = "GreaterThanGreaterThanGreaterThanEqualsToken";
SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 73] = "AmpersandEqualsToken";
SyntaxKind[SyntaxKind["BarEqualsToken"] = 74] = "BarEqualsToken";
SyntaxKind[SyntaxKind["BarBarEqualsToken"] = 75] = "BarBarEqualsToken";
SyntaxKind[SyntaxKind["AmpersandAmpersandEqualsToken"] = 76] = "AmpersandAmpersandEqualsToken";
SyntaxKind[SyntaxKind["QuestionQuestionEqualsToken"] = 77] = "QuestionQuestionEqualsToken";
SyntaxKind[SyntaxKind["CaretEqualsToken"] = 78] = "CaretEqualsToken";
SyntaxKind[SyntaxKind["Identifier"] = 79] = "Identifier";
SyntaxKind[SyntaxKind["PrivateIdentifier"] = 80] = "PrivateIdentifier";
SyntaxKind[SyntaxKind["JSDocCommentTextToken"] = 81] = "JSDocCommentTextToken";
SyntaxKind[SyntaxKind["BreakKeyword"] = 82] = "BreakKeyword";
SyntaxKind[SyntaxKind["CaseKeyword"] = 83] = "CaseKeyword";
SyntaxKind[SyntaxKind["CatchKeyword"] = 84] = "CatchKeyword";
SyntaxKind[SyntaxKind["ClassKeyword"] = 85] = "ClassKeyword";
SyntaxKind[SyntaxKind["ConstKeyword"] = 86] = "ConstKeyword";
SyntaxKind[SyntaxKind["ContinueKeyword"] = 87] = "ContinueKeyword";
SyntaxKind[SyntaxKind["DebuggerKeyword"] = 88] = "DebuggerKeyword";
SyntaxKind[SyntaxKind["DefaultKeyword"] = 89] = "DefaultKeyword";
SyntaxKind[SyntaxKind["DeleteKeyword"] = 90] = "DeleteKeyword";
SyntaxKind[SyntaxKind["DoKeyword"] = 91] = "DoKeyword";
SyntaxKind[SyntaxKind["ElseKeyword"] = 92] = "ElseKeyword";
SyntaxKind[SyntaxKind["EnumKeyword"] = 93] = "EnumKeyword";
SyntaxKind[SyntaxKind["ExportKeyword"] = 94] = "ExportKeyword";
SyntaxKind[SyntaxKind["ExtendsKeyword"] = 95] = "ExtendsKeyword";
SyntaxKind[SyntaxKind["FalseKeyword"] = 96] = "FalseKeyword";
SyntaxKind[SyntaxKind["FinallyKeyword"] = 97] = "FinallyKeyword";
SyntaxKind[SyntaxKind["ForKeyword"] = 98] = "ForKeyword";
SyntaxKind[SyntaxKind["FunctionKeyword"] = 99] = "FunctionKeyword";
SyntaxKind[SyntaxKind["IfKeyword"] = 100] = "IfKeyword";
SyntaxKind[SyntaxKind["ImportKeyword"] = 101] = "ImportKeyword";
SyntaxKind[SyntaxKind["InKeyword"] = 102] = "InKeyword";
SyntaxKind[SyntaxKind["InstanceOfKeyword"] = 103] = "InstanceOfKeyword";
SyntaxKind[SyntaxKind["NewKeyword"] = 104] = "NewKeyword";
SyntaxKind[SyntaxKind["NullKeyword"] = 105] = "NullKeyword";
SyntaxKind[SyntaxKind["ReturnKeyword"] = 106] = "ReturnKeyword";
SyntaxKind[SyntaxKind["SuperKeyword"] = 107] = "SuperKeyword";
SyntaxKind[SyntaxKind["SwitchKeyword"] = 108] = "SwitchKeyword";
SyntaxKind[SyntaxKind["ThisKeyword"] = 109] = "ThisKeyword";
SyntaxKind[SyntaxKind["ThrowKeyword"] = 110] = "ThrowKeyword";
SyntaxKind[SyntaxKind["TrueKeyword"] = 111] = "TrueKeyword";
SyntaxKind[SyntaxKind["TryKeyword"] = 112] = "TryKeyword";
SyntaxKind[SyntaxKind["TypeOfKeyword"] = 113] = "TypeOfKeyword";
SyntaxKind[SyntaxKind["VarKeyword"] = 114] = "VarKeyword";
SyntaxKind[SyntaxKind["VoidKeyword"] = 115] = "VoidKeyword";
SyntaxKind[SyntaxKind["WhileKeyword"] = 116] = "WhileKeyword";
SyntaxKind[SyntaxKind["WithKeyword"] = 117] = "WithKeyword";
SyntaxKind[SyntaxKind["ImplementsKeyword"] = 118] = "ImplementsKeyword";
SyntaxKind[SyntaxKind["InterfaceKeyword"] = 119] = "InterfaceKeyword";
SyntaxKind[SyntaxKind["LetKeyword"] = 120] = "LetKeyword";
SyntaxKind[SyntaxKind["PackageKeyword"] = 121] = "PackageKeyword";
SyntaxKind[SyntaxKind["PrivateKeyword"] = 122] = "PrivateKeyword";
SyntaxKind[SyntaxKind["ProtectedKeyword"] = 123] = "ProtectedKeyword";
SyntaxKind[SyntaxKind["PublicKeyword"] = 124] = "PublicKeyword";
SyntaxKind[SyntaxKind["StaticKeyword"] = 125] = "StaticKeyword";
SyntaxKind[SyntaxKind["YieldKeyword"] = 126] = "YieldKeyword";
SyntaxKind[SyntaxKind["AbstractKeyword"] = 127] = "AbstractKeyword";
SyntaxKind[SyntaxKind["AccessorKeyword"] = 128] = "AccessorKeyword";
SyntaxKind[SyntaxKind["AsKeyword"] = 129] = "AsKeyword";
SyntaxKind[SyntaxKind["AssertsKeyword"] = 130] = "AssertsKeyword";
SyntaxKind[SyntaxKind["AssertKeyword"] = 131] = "AssertKeyword";
SyntaxKind[SyntaxKind["AnyKeyword"] = 132] = "AnyKeyword";
SyntaxKind[SyntaxKind["AsyncKeyword"] = 133] = "AsyncKeyword";
SyntaxKind[SyntaxKind["AwaitKeyword"] = 134] = "AwaitKeyword";
SyntaxKind[SyntaxKind["BooleanKeyword"] = 135] = "BooleanKeyword";
SyntaxKind[SyntaxKind["ConstructorKeyword"] = 136] = "ConstructorKeyword";
SyntaxKind[SyntaxKind["DeclareKeyword"] = 137] = "DeclareKeyword";
SyntaxKind[SyntaxKind["GetKeyword"] = 138] = "GetKeyword";
SyntaxKind[SyntaxKind["ImmediateKeyword"] = 139] = "ImmediateKeyword";
SyntaxKind[SyntaxKind["InferKeyword"] = 140] = "InferKeyword";
SyntaxKind[SyntaxKind["IntrinsicKeyword"] = 141] = "IntrinsicKeyword";
SyntaxKind[SyntaxKind["IsKeyword"] = 142] = "IsKeyword";
SyntaxKind[SyntaxKind["KeyOfKeyword"] = 143] = "KeyOfKeyword";
SyntaxKind[SyntaxKind["ModuleKeyword"] = 144] = "ModuleKeyword";
SyntaxKind[SyntaxKind["NamespaceKeyword"] = 145] = "NamespaceKeyword";
SyntaxKind[SyntaxKind["NeverKeyword"] = 146] = "NeverKeyword";
SyntaxKind[SyntaxKind["OutKeyword"] = 147] = "OutKeyword";
SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 148] = "ReadonlyKeyword";
SyntaxKind[SyntaxKind["RequireKeyword"] = 149] = "RequireKeyword";
SyntaxKind[SyntaxKind["NumberKeyword"] = 150] = "NumberKeyword";
SyntaxKind[SyntaxKind["ObjectKeyword"] = 151] = "ObjectKeyword";
SyntaxKind[SyntaxKind["SatisfiesKeyword"] = 152] = "SatisfiesKeyword";
SyntaxKind[SyntaxKind["SetKeyword"] = 153] = "SetKeyword";
SyntaxKind[SyntaxKind["StringKeyword"] = 154] = "StringKeyword";
SyntaxKind[SyntaxKind["SymbolKeyword"] = 155] = "SymbolKeyword";
SyntaxKind[SyntaxKind["TypeKeyword"] = 156] = "TypeKeyword";
SyntaxKind[SyntaxKind["UndefinedKeyword"] = 157] = "UndefinedKeyword";
SyntaxKind[SyntaxKind["UniqueKeyword"] = 158] = "UniqueKeyword";
SyntaxKind[SyntaxKind["UnknownKeyword"] = 159] = "UnknownKeyword";
SyntaxKind[SyntaxKind["UsingKeyword"] = 160] = "UsingKeyword";
SyntaxKind[SyntaxKind["FromKeyword"] = 161] = "FromKeyword";
SyntaxKind[SyntaxKind["GlobalKeyword"] = 162] = "GlobalKeyword";
SyntaxKind[SyntaxKind["BigIntKeyword"] = 163] = "BigIntKeyword";
SyntaxKind[SyntaxKind["OverrideKeyword"] = 164] = "OverrideKeyword";
SyntaxKind[SyntaxKind["OfKeyword"] = 165] = "OfKeyword";
SyntaxKind[SyntaxKind["DeferKeyword"] = 166] = "DeferKeyword";
SyntaxKind[SyntaxKind["QualifiedName"] = 167] = "QualifiedName";
SyntaxKind[SyntaxKind["ComputedPropertyName"] = 168] = "ComputedPropertyName";
SyntaxKind[SyntaxKind["TypeParameter"] = 169] = "TypeParameter";
SyntaxKind[SyntaxKind["Parameter"] = 170] = "Parameter";
SyntaxKind[SyntaxKind["Decorator"] = 171] = "Decorator";
SyntaxKind[SyntaxKind["PropertySignature"] = 172] = "PropertySignature";
SyntaxKind[SyntaxKind["PropertyDeclaration"] = 173] = "PropertyDeclaration";
SyntaxKind[SyntaxKind["MethodSignature"] = 174] = "MethodSignature";
SyntaxKind[SyntaxKind["MethodDeclaration"] = 175] = "MethodDeclaration";
SyntaxKind[SyntaxKind["ClassStaticBlockDeclaration"] = 176] = "ClassStaticBlockDeclaration";
SyntaxKind[SyntaxKind["Constructor"] = 177] = "Constructor";
SyntaxKind[SyntaxKind["GetAccessor"] = 178] = "GetAccessor";
SyntaxKind[SyntaxKind["SetAccessor"] = 179] = "SetAccessor";
SyntaxKind[SyntaxKind["CallSignature"] = 180] = "CallSignature";
SyntaxKind[SyntaxKind["ConstructSignature"] = 181] = "ConstructSignature";
SyntaxKind[SyntaxKind["IndexSignature"] = 182] = "IndexSignature";
SyntaxKind[SyntaxKind["TypePredicate"] = 183] = "TypePredicate";
SyntaxKind[SyntaxKind["TypeReference"] = 184] = "TypeReference";
SyntaxKind[SyntaxKind["FunctionType"] = 185] = "FunctionType";
SyntaxKind[SyntaxKind["ConstructorType"] = 186] = "ConstructorType";
SyntaxKind[SyntaxKind["TypeQuery"] = 187] = "TypeQuery";
SyntaxKind[SyntaxKind["TypeLiteral"] = 188] = "TypeLiteral";
SyntaxKind[SyntaxKind["ArrayType"] = 189] = "ArrayType";
SyntaxKind[SyntaxKind["TupleType"] = 190] = "TupleType";
SyntaxKind[SyntaxKind["OptionalType"] = 191] = "OptionalType";
SyntaxKind[SyntaxKind["RestType"] = 192] = "RestType";
SyntaxKind[SyntaxKind["UnionType"] = 193] = "UnionType";
SyntaxKind[SyntaxKind["IntersectionType"] = 194] = "IntersectionType";
SyntaxKind[SyntaxKind["ConditionalType"] = 195] = "ConditionalType";
SyntaxKind[SyntaxKind["InferType"] = 196] = "InferType";
SyntaxKind[SyntaxKind["ParenthesizedType"] = 197] = "ParenthesizedType";
SyntaxKind[SyntaxKind["ThisType"] = 198] = "ThisType";
SyntaxKind[SyntaxKind["TypeOperator"] = 199] = "TypeOperator";
SyntaxKind[SyntaxKind["IndexedAccessType"] = 200] = "IndexedAccessType";
SyntaxKind[SyntaxKind["MappedType"] = 201] = "MappedType";
SyntaxKind[SyntaxKind["LiteralType"] = 202] = "LiteralType";
SyntaxKind[SyntaxKind["NamedTupleMember"] = 203] = "NamedTupleMember";
SyntaxKind[SyntaxKind["TemplateLiteralType"] = 204] = "TemplateLiteralType";
SyntaxKind[SyntaxKind["TemplateLiteralTypeSpan"] = 205] = "TemplateLiteralTypeSpan";
SyntaxKind[SyntaxKind["ImportType"] = 206] = "ImportType";
SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 207] = "ObjectBindingPattern";
SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 208] = "ArrayBindingPattern";
SyntaxKind[SyntaxKind["BindingElement"] = 209] = "BindingElement";
SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 210] = "ArrayLiteralExpression";
SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 211] = "ObjectLiteralExpression";
SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 212] = "PropertyAccessExpression";
SyntaxKind[SyntaxKind["ElementAccessExpression"] = 213] = "ElementAccessExpression";
SyntaxKind[SyntaxKind["CallExpression"] = 214] = "CallExpression";
SyntaxKind[SyntaxKind["NewExpression"] = 215] = "NewExpression";
SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 216] = "TaggedTemplateExpression";
SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 217] = "TypeAssertionExpression";
SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 218] = "ParenthesizedExpression";
SyntaxKind[SyntaxKind["FunctionExpression"] = 219] = "FunctionExpression";
SyntaxKind[SyntaxKind["ArrowFunction"] = 220] = "ArrowFunction";
SyntaxKind[SyntaxKind["DeleteExpression"] = 221] = "DeleteExpression";
SyntaxKind[SyntaxKind["TypeOfExpression"] = 222] = "TypeOfExpression";
SyntaxKind[SyntaxKind["VoidExpression"] = 223] = "VoidExpression";
SyntaxKind[SyntaxKind["AwaitExpression"] = 224] = "AwaitExpression";
SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 225] = "PrefixUnaryExpression";
SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 226] = "PostfixUnaryExpression";
SyntaxKind[SyntaxKind["BinaryExpression"] = 227] = "BinaryExpression";
SyntaxKind[SyntaxKind["ConditionalExpression"] = 228] = "ConditionalExpression";
SyntaxKind[SyntaxKind["TemplateExpression"] = 229] = "TemplateExpression";
SyntaxKind[SyntaxKind["YieldExpression"] = 230] = "YieldExpression";
SyntaxKind[SyntaxKind["SpreadElement"] = 231] = "SpreadElement";
SyntaxKind[SyntaxKind["ClassExpression"] = 232] = "ClassExpression";
SyntaxKind[SyntaxKind["OmittedExpression"] = 233] = "OmittedExpression";
SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 234] = "ExpressionWithTypeArguments";
SyntaxKind[SyntaxKind["AsExpression"] = 235] = "AsExpression";
SyntaxKind[SyntaxKind["NonNullExpression"] = 236] = "NonNullExpression";
SyntaxKind[SyntaxKind["MetaProperty"] = 237] = "MetaProperty";
SyntaxKind[SyntaxKind["SyntheticExpression"] = 238] = "SyntheticExpression";
SyntaxKind[SyntaxKind["SatisfiesExpression"] = 239] = "SatisfiesExpression";
SyntaxKind[SyntaxKind["TemplateSpan"] = 240] = "TemplateSpan";
SyntaxKind[SyntaxKind["SemicolonClassElement"] = 241] = "SemicolonClassElement";
SyntaxKind[SyntaxKind["Block"] = 242] = "Block";
SyntaxKind[SyntaxKind["EmptyStatement"] = 243] = "EmptyStatement";
SyntaxKind[SyntaxKind["VariableStatement"] = 244] = "VariableStatement";
SyntaxKind[SyntaxKind["ExpressionStatement"] = 245] = "ExpressionStatement";
SyntaxKind[SyntaxKind["IfStatement"] = 246] = "IfStatement";
SyntaxKind[SyntaxKind["DoStatement"] = 247] = "DoStatement";
SyntaxKind[SyntaxKind["WhileStatement"] = 248] = "WhileStatement";
SyntaxKind[SyntaxKind["ForStatement"] = 249] = "ForStatement";
SyntaxKind[SyntaxKind["ForInStatement"] = 250] = "ForInStatement";
SyntaxKind[SyntaxKind["ForOfStatement"] = 251] = "ForOfStatement";
SyntaxKind[SyntaxKind["ContinueStatement"] = 252] = "ContinueStatement";
SyntaxKind[SyntaxKind["BreakStatement"] = 253] = "BreakStatement";
SyntaxKind[SyntaxKind["ReturnStatement"] = 254] = "ReturnStatement";
SyntaxKind[SyntaxKind["WithStatement"] = 255] = "WithStatement";
SyntaxKind[SyntaxKind["SwitchStatement"] = 256] = "SwitchStatement";
SyntaxKind[SyntaxKind["LabeledStatement"] = 257] = "LabeledStatement";
SyntaxKind[SyntaxKind["ThrowStatement"] = 258] = "ThrowStatement";
SyntaxKind[SyntaxKind["TryStatement"] = 259] = "TryStatement";
SyntaxKind[SyntaxKind["DebuggerStatement"] = 260] = "DebuggerStatement";
SyntaxKind[SyntaxKind["VariableDeclaration"] = 261] = "VariableDeclaration";
SyntaxKind[SyntaxKind["VariableDeclarationList"] = 262] = "VariableDeclarationList";
SyntaxKind[SyntaxKind["FunctionDeclaration"] = 263] = "FunctionDeclaration";
SyntaxKind[SyntaxKind["ClassDeclaration"] = 264] = "ClassDeclaration";
SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 265] = "InterfaceDeclaration";
SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 266] = "TypeAliasDeclaration";
SyntaxKind[SyntaxKind["EnumDeclaration"] = 267] = "EnumDeclaration";
SyntaxKind[SyntaxKind["ModuleDeclaration"] = 268] = "ModuleDeclaration";
SyntaxKind[SyntaxKind["ModuleBlock"] = 269] = "ModuleBlock";
SyntaxKind[SyntaxKind["CaseBlock"] = 270] = "CaseBlock";
SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 271] = "NamespaceExportDeclaration";
SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 272] = "ImportEqualsDeclaration";
SyntaxKind[SyntaxKind["ImportDeclaration"] = 273] = "ImportDeclaration";
SyntaxKind[SyntaxKind["ImportClause"] = 274] = "ImportClause";
SyntaxKind[SyntaxKind["NamespaceImport"] = 275] = "NamespaceImport";
SyntaxKind[SyntaxKind["NamedImports"] = 276] = "NamedImports";
SyntaxKind[SyntaxKind["ImportSpecifier"] = 277] = "ImportSpecifier";
SyntaxKind[SyntaxKind["ExportAssignment"] = 278] = "ExportAssignment";
SyntaxKind[SyntaxKind["ExportDeclaration"] = 279] = "ExportDeclaration";
SyntaxKind[SyntaxKind["NamedExports"] = 280] = "NamedExports";
SyntaxKind[SyntaxKind["NamespaceExport"] = 281] = "NamespaceExport";
SyntaxKind[SyntaxKind["ExportSpecifier"] = 282] = "ExportSpecifier";
SyntaxKind[SyntaxKind["MissingDeclaration"] = 283] = "MissingDeclaration";
SyntaxKind[SyntaxKind["ExternalModuleReference"] = 284] = "ExternalModuleReference";
SyntaxKind[SyntaxKind["JsxElement"] = 285] = "JsxElement";
SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 286] = "JsxSelfClosingElement";
SyntaxKind[SyntaxKind["JsxOpeningElement"] = 287] = "JsxOpeningElement";
SyntaxKind[SyntaxKind["JsxClosingElement"] = 288] = "JsxClosingElement";
SyntaxKind[SyntaxKind["JsxFragment"] = 289] = "JsxFragment";
SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 290] = "JsxOpeningFragment";
SyntaxKind[SyntaxKind["JsxClosingFragment"] = 291] = "JsxClosingFragment";
SyntaxKind[SyntaxKind["JsxAttribute"] = 292] = "JsxAttribute";
SyntaxKind[SyntaxKind["JsxAttributes"] = 293] = "JsxAttributes";
SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 294] = "JsxSpreadAttribute";
SyntaxKind[SyntaxKind["JsxExpression"] = 295] = "JsxExpression";
SyntaxKind[SyntaxKind["JsxNamespacedName"] = 296] = "JsxNamespacedName";
SyntaxKind[SyntaxKind["CaseClause"] = 297] = "CaseClause";
SyntaxKind[SyntaxKind["DefaultClause"] = 298] = "DefaultClause";
SyntaxKind[SyntaxKind["HeritageClause"] = 299] = "HeritageClause";
SyntaxKind[SyntaxKind["CatchClause"] = 300] = "CatchClause";
SyntaxKind[SyntaxKind["ImportAttributes"] = 301] = "ImportAttributes";
SyntaxKind[SyntaxKind["ImportAttribute"] = 302] = "ImportAttribute";
SyntaxKind[SyntaxKind["PropertyAssignment"] = 303] = "PropertyAssignment";
SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 304] = "ShorthandPropertyAssignment";
SyntaxKind[SyntaxKind["SpreadAssignment"] = 305] = "SpreadAssignment";
SyntaxKind[SyntaxKind["EnumMember"] = 306] = "EnumMember";
SyntaxKind[SyntaxKind["SourceFile"] = 307] = "SourceFile";
SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 308] = "JSDocTypeExpression";
SyntaxKind[SyntaxKind["JSDocNameReference"] = 309] = "JSDocNameReference";
SyntaxKind[SyntaxKind["JSDocAllType"] = 310] = "JSDocAllType";
SyntaxKind[SyntaxKind["JSDocNullableType"] = 311] = "JSDocNullableType";
SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 312] = "JSDocNonNullableType";
SyntaxKind[SyntaxKind["JSDocOptionalType"] = 313] = "JSDocOptionalType";
SyntaxKind[SyntaxKind["JSDocVariadicType"] = 314] = "JSDocVariadicType";
SyntaxKind[SyntaxKind["JSDoc"] = 315] = "JSDoc";
SyntaxKind[SyntaxKind["JSDocText"] = 316] = "JSDocText";
SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 317] = "JSDocTypeLiteral";
SyntaxKind[SyntaxKind["JSDocSignature"] = 318] = "JSDocSignature";
SyntaxKind[SyntaxKind["JSDocLink"] = 319] = "JSDocLink";
SyntaxKind[SyntaxKind["JSDocLinkCode"] = 320] = "JSDocLinkCode";
SyntaxKind[SyntaxKind["JSDocLinkPlain"] = 321] = "JSDocLinkPlain";
SyntaxKind[SyntaxKind["JSDocUnknownTag"] = 322] = "JSDocUnknownTag";
SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 323] = "JSDocAugmentsTag";
SyntaxKind[SyntaxKind["JSDocImplementsTag"] = 324] = "JSDocImplementsTag";
SyntaxKind[SyntaxKind["JSDocDeprecatedTag"] = 325] = "JSDocDeprecatedTag";
SyntaxKind[SyntaxKind["JSDocPublicTag"] = 326] = "JSDocPublicTag";
SyntaxKind[SyntaxKind["JSDocPrivateTag"] = 327] = "JSDocPrivateTag";
SyntaxKind[SyntaxKind["JSDocProtectedTag"] = 328] = "JSDocProtectedTag";
SyntaxKind[SyntaxKind["JSDocReadonlyTag"] = 329] = "JSDocReadonlyTag";
SyntaxKind[SyntaxKind["JSDocOverrideTag"] = 330] = "JSDocOverrideTag";
SyntaxKind[SyntaxKind["JSDocCallbackTag"] = 331] = "JSDocCallbackTag";
SyntaxKind[SyntaxKind["JSDocOverloadTag"] = 332] = "JSDocOverloadTag";
SyntaxKind[SyntaxKind["JSDocParameterTag"] = 333] = "JSDocParameterTag";
SyntaxKind[SyntaxKind["JSDocReturnTag"] = 334] = "JSDocReturnTag";
SyntaxKind[SyntaxKind["JSDocThisTag"] = 335] = "JSDocThisTag";
SyntaxKind[SyntaxKind["JSDocTypeTag"] = 336] = "JSDocTypeTag";
SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 337] = "JSDocTemplateTag";
SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 338] = "JSDocTypedefTag";
SyntaxKind[SyntaxKind["JSDocSeeTag"] = 339] = "JSDocSeeTag";
SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 340] = "JSDocPropertyTag";
SyntaxKind[SyntaxKind["JSDocThrowsTag"] = 341] = "JSDocThrowsTag";
SyntaxKind[SyntaxKind["JSDocSatisfiesTag"] = 342] = "JSDocSatisfiesTag";
SyntaxKind[SyntaxKind["JSDocImportTag"] = 343] = "JSDocImportTag";
SyntaxKind[SyntaxKind["SyntaxList"] = 344] = "SyntaxList";
SyntaxKind[SyntaxKind["JSTypeAliasDeclaration"] = 345] = "JSTypeAliasDeclaration";
SyntaxKind[SyntaxKind["JSImportDeclaration"] = 346] = "JSImportDeclaration";
SyntaxKind[SyntaxKind["NotEmittedStatement"] = 347] = "NotEmittedStatement";
SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 348] = "PartiallyEmittedExpression";
SyntaxKind[SyntaxKind["SyntheticReferenceExpression"] = 349] = "SyntheticReferenceExpression";
SyntaxKind[SyntaxKind["NotEmittedTypeElement"] = 350] = "NotEmittedTypeElement";
SyntaxKind[SyntaxKind["Count"] = 351] = "Count";
SyntaxKind[SyntaxKind["FirstAssignment"] = 63] = "FirstAssignment";
SyntaxKind[SyntaxKind["LastAssignment"] = 78] = "LastAssignment";
SyntaxKind[SyntaxKind["FirstCompoundAssignment"] = 64] = "FirstCompoundAssignment";
SyntaxKind[SyntaxKind["LastCompoundAssignment"] = 78] = "LastCompoundAssignment";
SyntaxKind[SyntaxKind["FirstReservedWord"] = 82] = "FirstReservedWord";
SyntaxKind[SyntaxKind["LastReservedWord"] = 117] = "LastReservedWord";
SyntaxKind[SyntaxKind["FirstKeyword"] = 82] = "FirstKeyword";
SyntaxKind[SyntaxKind["LastKeyword"] = 166] = "LastKeyword";
SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 118] = "FirstFutureReservedWord";
SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 126] = "LastFutureReservedWord";
SyntaxKind[SyntaxKind["FirstTypeNode"] = 183] = "FirstTypeNode";
SyntaxKind[SyntaxKind["LastTypeNode"] = 206] = "LastTypeNode";
SyntaxKind[SyntaxKind["FirstPunctuation"] = 18] = "FirstPunctuation";
SyntaxKind[SyntaxKind["LastPunctuation"] = 78] = "LastPunctuation";
SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken";
SyntaxKind[SyntaxKind["LastToken"] = 166] = "LastToken";
SyntaxKind[SyntaxKind["FirstLiteralToken"] = 8] = "FirstLiteralToken";
SyntaxKind[SyntaxKind["LastLiteralToken"] = 14] = "LastLiteralToken";
SyntaxKind[SyntaxKind["FirstTemplateToken"] = 14] = "FirstTemplateToken";
SyntaxKind[SyntaxKind["LastTemplateToken"] = 17] = "LastTemplateToken";
SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 29] = "FirstBinaryOperator";
SyntaxKind[SyntaxKind["LastBinaryOperator"] = 78] = "LastBinaryOperator";
SyntaxKind[SyntaxKind["FirstStatement"] = 244] = "FirstStatement";
SyntaxKind[SyntaxKind["LastStatement"] = 260] = "LastStatement";
SyntaxKind[SyntaxKind["FirstNode"] = 167] = "FirstNode";
SyntaxKind[SyntaxKind["FirstJSDocNode"] = 308] = "FirstJSDocNode";
SyntaxKind[SyntaxKind["LastJSDocNode"] = 343] = "LastJSDocNode";
SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 322] = "FirstJSDocTagNode";
SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 343] = "LastJSDocTagNode";
SyntaxKind[SyntaxKind["FirstContextualKeyword"] = 127] = "FirstContextualKeyword";
SyntaxKind[SyntaxKind["LastContextualKeyword"] = 166] = "LastContextualKeyword";
SyntaxKind[SyntaxKind["LastUnaryOperator"] = 54] = "LastUnaryOperator";
SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken";
SyntaxKind[SyntaxKind["LastTriviaToken"] = 6] = "LastTriviaToken";
})(SyntaxKind || (SyntaxKind = {}));
//# sourceMappingURL=syntaxKind.js.map

View File

@@ -0,0 +1,403 @@
'use strict'
/* eslint no-prototype-builtins: 0 */
const test = require('node:test')
const assert = require('node:assert')
const os = require('node:os')
const tspl = require('@matteo.collina/tspl')
const { sink, once } = require('./helper')
const pino = require('../')
const { pid } = process
const hostname = os.hostname()
const level = 50
const name = 'error'
test('err is serialized with additional properties set on the Error object', async () => {
const stream = sink()
const err = Object.assign(new Error('myerror'), { foo: 'bar' })
const instance = pino(stream)
instance.level = name
instance[name](err)
const result = await once(stream, 'data')
assert.ok(new Date(result.time) <= new Date(), 'time is greater than Date.now()')
delete result.time
assert.deepEqual(result, {
pid,
hostname,
level,
err: {
type: 'Error',
message: err.message,
stack: err.stack,
foo: err.foo
},
msg: err.message
})
})
test('type should be detected based on constructor', async () => {
class Bar extends Error {}
const stream = sink()
const err = new Bar('myerror')
const instance = pino(stream)
instance.level = name
instance[name](err)
const result = await once(stream, 'data')
assert.ok(new Date(result.time) <= new Date(), 'time is greater than Date.now()')
delete result.time
assert.deepEqual(result, {
pid,
hostname,
level,
err: {
type: 'Bar',
message: err.message,
stack: err.stack
},
msg: err.message
})
})
test('type, message and stack should be first level properties', async () => {
const stream = sink()
const err = Object.assign(new Error('foo'), { foo: 'bar' })
const instance = pino(stream)
instance.level = name
instance[name](err)
const result = await once(stream, 'data')
assert.ok(new Date(result.time) <= new Date(), 'time is greater than Date.now()')
delete result.time
assert.deepEqual(result, {
pid,
hostname,
level,
err: {
type: 'Error',
message: err.message,
stack: err.stack,
foo: err.foo
},
msg: err.message
})
})
test('err serializer', async () => {
const stream = sink()
const err = Object.assign(new Error('myerror'), { foo: 'bar' })
const instance = pino({
serializers: {
err: pino.stdSerializers.err
}
}, stream)
instance.level = name
instance[name]({ err })
const result = await once(stream, 'data')
assert.ok(new Date(result.time) <= new Date(), 'time is greater than Date.now()')
delete result.time
assert.deepEqual(result, {
pid,
hostname,
level,
err: {
type: 'Error',
message: err.message,
stack: err.stack,
foo: err.foo
},
msg: err.message
})
})
test('an error with statusCode property is not confused for a http response', async () => {
const stream = sink()
const err = Object.assign(new Error('StatusCodeErr'), { statusCode: 500 })
const instance = pino(stream)
instance.level = name
instance[name](err)
const result = await once(stream, 'data')
assert.ok(new Date(result.time) <= new Date(), 'time is greater than Date.now()')
delete result.time
assert.deepEqual(result, {
pid,
hostname,
level,
err: {
type: 'Error',
message: err.message,
stack: err.stack,
statusCode: err.statusCode
},
msg: err.message
})
})
test('stack is omitted if it is not set on err', async (t) => {
const plan = tspl(t, { plan: 2 })
const err = new Error('myerror')
delete err.stack
const instance = pino(sink(function (chunk, enc, cb) {
plan.ok(new Date(chunk.time) <= new Date(), 'time is greater than Date.now()')
delete chunk.time
plan.equal(chunk.hasOwnProperty('stack'), false)
cb()
}))
instance.level = name
instance[name](err)
await plan
})
test('correctly ignores toString on errors', async () => {
const err = new Error('myerror')
err.toString = () => undefined
const stream = sink()
const instance = pino({
test: 'this'
}, stream)
instance.fatal(err)
const result = await once(stream, 'data')
delete result.time
assert.deepEqual(result, {
pid,
hostname,
level: 60,
err: {
type: 'Error',
message: err.message,
stack: err.stack
},
msg: err.message
})
})
test('assign mixin()', async () => {
const err = new Error('myerror')
const stream = sink()
const instance = pino({
mixin () {
return { hello: 'world' }
}
}, stream)
instance.fatal(err)
const result = await once(stream, 'data')
delete result.time
assert.deepEqual(result, {
pid,
hostname,
level: 60,
hello: 'world',
err: {
type: 'Error',
message: err.message,
stack: err.stack
},
msg: err.message
})
})
test('no err serializer', async () => {
const err = new Error('myerror')
const stream = sink()
const instance = pino({
serializers: {}
}, stream)
instance.fatal(err)
const result = await once(stream, 'data')
delete result.time
assert.deepEqual(result, {
pid,
hostname,
level: 60,
err: {
type: 'Error',
message: err.message,
stack: err.stack
},
msg: err.message
})
})
test('empty serializer', async () => {
const err = new Error('myerror')
const stream = sink()
const instance = pino({
serializers: {
err () {}
}
}, stream)
instance.fatal(err)
const result = await once(stream, 'data')
delete result.time
assert.deepEqual(result, {
pid,
hostname,
level: 60,
msg: err.message
})
})
test('assign mixin()', async () => {
const err = new Error('myerror')
const stream = sink()
const instance = pino({
mixin () {
return { hello: 'world' }
}
}, stream)
instance.fatal(err)
const result = await once(stream, 'data')
delete result.time
assert.deepEqual(result, {
pid,
hostname,
level: 60,
hello: 'world',
err: {
type: 'Error',
message: err.message,
stack: err.stack
},
msg: err.message
})
})
test('no err serializer', async () => {
const err = new Error('myerror')
const stream = sink()
const instance = pino({
serializers: {}
}, stream)
instance.fatal(err)
const result = await once(stream, 'data')
delete result.time
assert.deepEqual(result, {
pid,
hostname,
level: 60,
err: {
type: 'Error',
message: err.message,
stack: err.stack
},
msg: err.message
})
})
test('empty serializer', async () => {
const err = new Error('myerror')
const stream = sink()
const instance = pino({
serializers: {
err () {}
}
}, stream)
instance.fatal(err)
const result = await once(stream, 'data')
delete result.time
assert.deepEqual(result, {
pid,
hostname,
level: 60,
msg: err.message
})
})
test('correctly adds error information when nestedKey is used', async () => {
const err = new Error('myerror')
err.toString = () => undefined
const stream = sink()
const instance = pino({
test: 'this',
nestedKey: 'obj'
}, stream)
instance.fatal(err)
const result = await once(stream, 'data')
delete result.time
assert.deepEqual(result, {
pid,
hostname,
level: 60,
obj: {
err: {
type: 'Error',
stack: err.stack,
message: err.message
}
},
msg: err.message
})
})
test('correctly adds msg on error when nestedKey is used', async () => {
const err = new Error('myerror')
err.toString = () => undefined
const stream = sink()
const instance = pino({
test: 'this',
nestedKey: 'obj'
}, stream)
instance.fatal(err, 'msg message')
const result = await once(stream, 'data')
delete result.time
assert.deepEqual(result, {
pid,
hostname,
level: 60,
obj: {
err: {
type: 'Error',
stack: err.stack,
message: err.message
}
},
msg: 'msg message'
})
})
test('msg should take precedence over error message on mergingObject', async () => {
const err = new Error('myerror')
const stream = sink()
const instance = pino(stream)
instance.error({ msg: 'my message', err })
const result = await once(stream, 'data')
delete result.time
assert.deepEqual(result, {
pid,
hostname,
level: 50,
err: {
type: 'Error',
stack: err.stack,
message: err.message
},
msg: 'my message'
})
})
test('considers messageKey when giving msg precedence over error', async () => {
const err = new Error('myerror')
const stream = sink()
const instance = pino({ messageKey: 'message' }, stream)
instance.error({ message: 'my message', err })
const result = await once(stream, 'data')
delete result.time
assert.deepEqual(result, {
pid,
hostname,
level: 50,
err: {
type: 'Error',
stack: err.stack,
message: err.message
},
message: 'my message'
})
})

View File

@@ -0,0 +1,150 @@
"use strict";
// translate the various posix character classes into unicode properties
// this works across all unicode locales
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseClass = void 0;
// { <posix class>: [<translation>, /u flag required, negated]
const posixClasses = {
'[:alnum:]': ['\\p{L}\\p{Nl}\\p{Nd}', true],
'[:alpha:]': ['\\p{L}\\p{Nl}', true],
'[:ascii:]': ['\\x' + '00-\\x' + '7f', false],
'[:blank:]': ['\\p{Zs}\\t', true],
'[:cntrl:]': ['\\p{Cc}', true],
'[:digit:]': ['\\p{Nd}', true],
'[:graph:]': ['\\p{Z}\\p{C}', true, true],
'[:lower:]': ['\\p{Ll}', true],
'[:print:]': ['\\p{C}', true],
'[:punct:]': ['\\p{P}', true],
'[:space:]': ['\\p{Z}\\t\\r\\n\\v\\f', true],
'[:upper:]': ['\\p{Lu}', true],
'[:word:]': ['\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}', true],
'[:xdigit:]': ['A-Fa-f0-9', false],
};
// only need to escape a few things inside of brace expressions
// escapes: [ \ ] -
const braceEscape = (s) => s.replace(/[[\]\\-]/g, '\\$&');
// escape all regexp magic characters
const regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
// everything has already been escaped, we just have to join
const rangesToString = (ranges) => ranges.join('');
// takes a glob string at a posix brace expression, and returns
// an equivalent regular expression source, and boolean indicating
// whether the /u flag needs to be applied, and the number of chars
// consumed to parse the character class.
// This also removes out of order ranges, and returns ($.) if the
// entire class just no good.
const parseClass = (glob, position) => {
const pos = position;
/* c8 ignore start */
if (glob.charAt(pos) !== '[') {
throw new Error('not in a brace expression');
}
/* c8 ignore stop */
const ranges = [];
const negs = [];
let i = pos + 1;
let sawStart = false;
let uflag = false;
let escaping = false;
let negate = false;
let endPos = pos;
let rangeStart = '';
WHILE: while (i < glob.length) {
const c = glob.charAt(i);
if ((c === '!' || c === '^') && i === pos + 1) {
negate = true;
i++;
continue;
}
if (c === ']' && sawStart && !escaping) {
endPos = i + 1;
break;
}
sawStart = true;
if (c === '\\') {
if (!escaping) {
escaping = true;
i++;
continue;
}
// escaped \ char, fall through and treat like normal char
}
if (c === '[' && !escaping) {
// either a posix class, a collation equivalent, or just a [
for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {
if (glob.startsWith(cls, i)) {
// invalid, [a-[] is fine, but not [a-[:alpha]]
if (rangeStart) {
return ['$.', false, glob.length - pos, true];
}
i += cls.length;
if (neg)
negs.push(unip);
else
ranges.push(unip);
uflag = uflag || u;
continue WHILE;
}
}
}
// now it's just a normal character, effectively
escaping = false;
if (rangeStart) {
// throw this range away if it's not valid, but others
// can still match.
if (c > rangeStart) {
ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c));
}
else if (c === rangeStart) {
ranges.push(braceEscape(c));
}
rangeStart = '';
i++;
continue;
}
// now might be the start of a range.
// can be either c-d or c-] or c<more...>] or c] at this point
if (glob.startsWith('-]', i + 1)) {
ranges.push(braceEscape(c + '-'));
i += 2;
continue;
}
if (glob.startsWith('-', i + 1)) {
rangeStart = c;
i += 2;
continue;
}
// not the start of a range, just a single character
ranges.push(braceEscape(c));
i++;
}
if (endPos < i) {
// didn't see the end of the class, not a valid class,
// but might still be valid as a literal match.
return ['', false, 0, false];
}
// if we got no ranges and no negates, then we have a range that
// cannot possibly match anything, and that poisons the whole glob
if (!ranges.length && !negs.length) {
return ['$.', false, glob.length - pos, true];
}
// if we got one positive range, and it's a single character, then that's
// not actually a magic pattern, it's just that one literal character.
// we should not treat that as "magic", we should just return the literal
// character. [_] is a perfectly valid way to escape glob magic chars.
if (negs.length === 0 &&
ranges.length === 1 &&
/^\\?.$/.test(ranges[0]) &&
!negate) {
const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];
return [regexpEscape(r), false, endPos - pos, false];
}
const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']';
const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']';
const comb = ranges.length && negs.length ? '(' + sranges + '|' + snegs + ')'
: ranges.length ? sranges
: snegs;
return [comb, uflag, endPos - pos, true];
};
exports.parseClass = parseClass;
//# sourceMappingURL=brace-expressions.js.map

View File

@@ -0,0 +1,7 @@
import { expect, test } from "vitest";
import * as z from "zod/v4";
test("test this binding", () => {
const parse = z.string().parse;
expect(parse("asdf")).toBe("asdf");
});