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,33 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/// <reference no-default-lib="true"/>
/// <reference lib="es2015.iterable" />
interface ObjectConstructor {
/**
* Returns an object created by key-value entries for properties and methods
* @param entries An iterable object that contains key-value entries for properties and methods.
*/
fromEntries<T = any>(entries: Iterable<readonly [PropertyKey, T]>): { [k: string]: T; };
/**
* Returns an object created by key-value entries for properties and methods
* @param entries An iterable object that contains key-value entries for properties and methods.
*/
fromEntries(entries: Iterable<readonly any[]>): any;
}

View File

@@ -0,0 +1,67 @@
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* See LICENSE file in root directory for full license.
*/
import KEYS from "./visitor-keys.js";
/**
* @typedef {import('./visitor-keys.js').VisitorKeys} VisitorKeys
*/
// List to ignore keys.
const KEY_BLACKLIST = new Set([
"parent",
"leadingComments",
"trailingComments",
]);
/**
* Check whether a given key should be used or not.
* @param {string} key The key to check.
* @returns {boolean} `true` if the key should be used.
*/
function filterKey(key) {
return !KEY_BLACKLIST.has(key) && key[0] !== "_";
}
/* eslint-disable jsdoc/valid-types -- doesn't allow `readonly`.
TODO: remove eslint-disable when https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/164 is fixed
*/
/**
* Get visitor keys of a given node.
* @param {Object} node The AST node to get keys.
* @returns {readonly string[]} Visitor keys of the node.
*/
export function getKeys(node) {
return Object.keys(node).filter(filterKey);
}
/* eslint-enable jsdoc/valid-types -- doesn't allow `readonly` */
/**
* Make the union set with `KEYS` and given keys.
* @param {VisitorKeys} additionalKeys The additional keys.
* @returns {VisitorKeys} The union set.
*/
export function unionWith(additionalKeys) {
const retv =
/** @type {{ [type: string]: ReadonlyArray<string> }} */
(Object.assign({}, KEYS));
for (const type of Object.keys(additionalKeys)) {
if (Object.hasOwn(retv, type)) {
const keys = new Set(additionalKeys[type]);
for (const key of retv[type]) {
keys.add(key);
}
retv[type] = Object.freeze(Array.from(keys));
} else {
retv[type] = Object.freeze(Array.from(additionalKeys[type]));
}
}
return Object.freeze(retv);
}
export { KEYS };

View File

@@ -0,0 +1,15 @@
import type { TSESTree } from '@typescript-eslint/utils';
export declare const enum NodeComparisonResult {
/** the two nodes are comparably the same */
Equal = "Equal",
/** the left node is a subset of the right node */
Subset = "Subset",
/** the left node is not the same or is a superset of the right node */
Invalid = "Invalid"
}
type CompareNodesArgument = TSESTree.Node | null | undefined;
/**
* Compares two nodes' ASTs to determine if the A is equal to or a subset of B
*/
export declare function compareNodes(nodeA: CompareNodesArgument, nodeB: CompareNodesArgument): NodeComparisonResult;
export {};

View File

@@ -0,0 +1,19 @@
// Code generated by Herebyfile.mjs generate:enums from internal/core/compileroptions.go. DO NOT EDIT.
export var ModuleKind;
(function (ModuleKind) {
ModuleKind[ModuleKind["None"] = 0] = "None";
ModuleKind[ModuleKind["CommonJS"] = 1] = "CommonJS";
ModuleKind[ModuleKind["AMD"] = 2] = "AMD";
ModuleKind[ModuleKind["UMD"] = 3] = "UMD";
ModuleKind[ModuleKind["System"] = 4] = "System";
ModuleKind[ModuleKind["ES2015"] = 5] = "ES2015";
ModuleKind[ModuleKind["ES2020"] = 6] = "ES2020";
ModuleKind[ModuleKind["ES2022"] = 7] = "ES2022";
ModuleKind[ModuleKind["ESNext"] = 99] = "ESNext";
ModuleKind[ModuleKind["Node16"] = 100] = "Node16";
ModuleKind[ModuleKind["Node18"] = 101] = "Node18";
ModuleKind[ModuleKind["Node20"] = 102] = "Node20";
ModuleKind[ModuleKind["NodeNext"] = 199] = "NodeNext";
ModuleKind[ModuleKind["Preserve"] = 200] = "Preserve";
})(ModuleKind || (ModuleKind = {}));
//# sourceMappingURL=moduleKind.enum.js.map

View File

@@ -0,0 +1,16 @@
var siginfo = require('.')
var pkg = require('./package.json')
var stop = siginfo(function () {
console.dir({
version: pkg.version,
uptime: process.uptime()
})
})
process.stdout.resume()
setTimeout(function () {
stop()
process.exit(0)
}, 2000)

View File

@@ -0,0 +1,135 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.p521_hasher = exports.secp521r1 = exports.secp384r1 = exports.secp256r1 = exports.p521 = exports.p384_hasher = exports.p384 = exports.p256_hasher = exports.p256 = void 0;
/**
* Internal module for NIST P256, P384, P521 curves.
* Do not use for now.
* @module
*/
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
const sha2_js_1 = require("@noble/hashes/sha2.js");
const _shortw_utils_ts_1 = require("./_shortw_utils.js");
const hash_to_curve_ts_1 = require("./abstract/hash-to-curve.js");
const modular_ts_1 = require("./abstract/modular.js");
const weierstrass_ts_1 = require("./abstract/weierstrass.js");
// p = 2n**224n * (2n**32n-1n) + 2n**192n + 2n**96n - 1n
// a = Fp256.create(BigInt('-3'));
const p256_CURVE = {
p: BigInt('0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff'),
n: BigInt('0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551'),
h: BigInt(1),
a: BigInt('0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc'),
b: BigInt('0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b'),
Gx: BigInt('0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296'),
Gy: BigInt('0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5'),
};
// p = 2n**384n - 2n**128n - 2n**96n + 2n**32n - 1n
const p384_CURVE = {
p: BigInt('0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff'),
n: BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973'),
h: BigInt(1),
a: BigInt('0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffc'),
b: BigInt('0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef'),
Gx: BigInt('0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7'),
Gy: BigInt('0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f'),
};
// p = 2n**521n - 1n
const p521_CURVE = {
p: BigInt('0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'),
n: BigInt('0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409'),
h: BigInt(1),
a: BigInt('0x1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc'),
b: BigInt('0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00'),
Gx: BigInt('0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66'),
Gy: BigInt('0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650'),
};
const Fp256 = (0, modular_ts_1.Field)(p256_CURVE.p);
const Fp384 = (0, modular_ts_1.Field)(p384_CURVE.p);
const Fp521 = (0, modular_ts_1.Field)(p521_CURVE.p);
function createSWU(Point, opts) {
const map = (0, weierstrass_ts_1.mapToCurveSimpleSWU)(Point.Fp, opts);
return (scalars) => map(scalars[0]);
}
/** NIST P256 (aka secp256r1, prime256v1) curve, ECDSA and ECDH methods. */
exports.p256 = (0, _shortw_utils_ts_1.createCurve)({ ...p256_CURVE, Fp: Fp256, lowS: false }, sha2_js_1.sha256);
/** Hashing / encoding to p256 points / field. RFC 9380 methods. */
exports.p256_hasher = (() => {
return (0, hash_to_curve_ts_1.createHasher)(exports.p256.Point, createSWU(exports.p256.Point, {
A: p256_CURVE.a,
B: p256_CURVE.b,
Z: exports.p256.Point.Fp.create(BigInt('-10')),
}), {
DST: 'P256_XMD:SHA-256_SSWU_RO_',
encodeDST: 'P256_XMD:SHA-256_SSWU_NU_',
p: p256_CURVE.p,
m: 1,
k: 128,
expand: 'xmd',
hash: sha2_js_1.sha256,
});
})();
// export const p256_oprf: OPRF = createORPF({
// name: 'P256-SHA256',
// Point: p256.Point,
// hash: sha256,
// hashToGroup: p256_hasher.hashToCurve,
// hashToScalar: p256_hasher.hashToScalar,
// });
/** NIST P384 (aka secp384r1) curve, ECDSA and ECDH methods. */
exports.p384 = (0, _shortw_utils_ts_1.createCurve)({ ...p384_CURVE, Fp: Fp384, lowS: false }, sha2_js_1.sha384);
/** Hashing / encoding to p384 points / field. RFC 9380 methods. */
exports.p384_hasher = (() => {
return (0, hash_to_curve_ts_1.createHasher)(exports.p384.Point, createSWU(exports.p384.Point, {
A: p384_CURVE.a,
B: p384_CURVE.b,
Z: exports.p384.Point.Fp.create(BigInt('-12')),
}), {
DST: 'P384_XMD:SHA-384_SSWU_RO_',
encodeDST: 'P384_XMD:SHA-384_SSWU_NU_',
p: p384_CURVE.p,
m: 1,
k: 192,
expand: 'xmd',
hash: sha2_js_1.sha384,
});
})();
// export const p384_oprf: OPRF = createORPF({
// name: 'P384-SHA384',
// Point: p384.Point,
// hash: sha384,
// hashToGroup: p384_hasher.hashToCurve,
// hashToScalar: p384_hasher.hashToScalar,
// });
// const Fn521 = Field(p521_CURVE.n, { allowedScalarLengths: [65, 66] });
/** NIST P521 (aka secp521r1) curve, ECDSA and ECDH methods. */
exports.p521 = (0, _shortw_utils_ts_1.createCurve)({ ...p521_CURVE, Fp: Fp521, lowS: false, allowedPrivateKeyLengths: [130, 131, 132] }, sha2_js_1.sha512);
/** @deprecated use `p256` for consistency with `p256_hasher` */
exports.secp256r1 = exports.p256;
/** @deprecated use `p384` for consistency with `p384_hasher` */
exports.secp384r1 = exports.p384;
/** @deprecated use `p521` for consistency with `p521_hasher` */
exports.secp521r1 = exports.p521;
/** Hashing / encoding to p521 points / field. RFC 9380 methods. */
exports.p521_hasher = (() => {
return (0, hash_to_curve_ts_1.createHasher)(exports.p521.Point, createSWU(exports.p521.Point, {
A: p521_CURVE.a,
B: p521_CURVE.b,
Z: exports.p521.Point.Fp.create(BigInt('-4')),
}), {
DST: 'P521_XMD:SHA-512_SSWU_RO_',
encodeDST: 'P521_XMD:SHA-512_SSWU_NU_',
p: p521_CURVE.p,
m: 1,
k: 256,
expand: 'xmd',
hash: sha2_js_1.sha512,
});
})();
// export const p521_oprf: OPRF = createORPF({
// name: 'P521-SHA512',
// Point: p521.Point,
// hash: sha512,
// hashToGroup: p521_hasher.hashToCurve,
// hashToScalar: p521_hasher.hashToScalar, // produces L=98 just like in RFC
// });
//# sourceMappingURL=nist.js.map

View File

@@ -0,0 +1,120 @@
/**
* @fileoverview Rule to flag when using constructor without parentheses
* @author Ilya Volodin
* @deprecated in ESLint v8.53.0
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
deprecated: {
message: "Formatting rules are being moved out of ESLint core.",
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
deprecatedSince: "8.53.0",
availableUntil: "11.0.0",
replacedBy: [
{
message:
"ESLint Stylistic now maintains deprecated stylistic core rules.",
url: "https://eslint.style/guide/migration",
plugin: {
name: "@stylistic/eslint-plugin",
url: "https://eslint.style",
},
rule: {
name: "new-parens",
url: "https://eslint.style/rules/new-parens",
},
},
],
},
type: "layout",
docs: {
description:
"Enforce or disallow parentheses when invoking a constructor with no arguments",
recommended: false,
url: "https://eslint.org/docs/latest/rules/new-parens",
},
fixable: "code",
schema: [
{
enum: ["always", "never"],
},
],
messages: {
missing: "Missing '()' invoking a constructor.",
unnecessary:
"Unnecessary '()' invoking a constructor with no arguments.",
},
},
create(context) {
const options = context.options;
const always = options[0] !== "never"; // Default is always
const sourceCode = context.sourceCode;
return {
NewExpression(node) {
if (node.arguments.length !== 0) {
return; // if there are arguments, there have to be parens
}
const lastToken = sourceCode.getLastToken(node);
const hasLastParen =
lastToken && astUtils.isClosingParenToken(lastToken);
// `hasParens` is true only if the new expression ends with its own parens, e.g., new new foo() does not end with its own parens
const hasParens =
hasLastParen &&
astUtils.isOpeningParenToken(
sourceCode.getTokenBefore(lastToken),
) &&
node.callee.range[1] < node.range[1];
if (always) {
if (!hasParens) {
context.report({
node,
messageId: "missing",
fix: fixer => fixer.insertTextAfter(node, "()"),
});
}
} else {
if (hasParens) {
context.report({
node,
messageId: "unnecessary",
fix: fixer => [
fixer.remove(
sourceCode.getTokenBefore(lastToken),
),
fixer.remove(lastToken),
fixer.insertTextBefore(node, "("),
fixer.insertTextAfter(node, ")"),
],
});
}
}
},
};
},
};

View File

@@ -0,0 +1,17 @@
"use strict";
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib repo
Object.defineProperty(exports, "__esModule", { value: true });
exports.es2015_generator = void 0;
const base_config_1 = require("./base-config");
const es2015_iterable_1 = require("./es2015.iterable");
exports.es2015_generator = {
libs: [es2015_iterable_1.es2015_iterable],
variables: [
['Generator', base_config_1.TYPE],
['GeneratorFunction', base_config_1.TYPE],
['GeneratorFunctionConstructor', base_config_1.TYPE],
],
};

View File

@@ -0,0 +1,87 @@
/**
* @fileoverview Emits warnings for ESLint.
* @author Francesco Trotta
*/
"use strict";
//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------
/**
* A service that emits warnings for ESLint.
*/
class WarningService {
/**
* Creates a new instance of the service.
* @param {{ emitWarning?: ((warning: string, type: string) => void) | undefined }} [options] A function called internally to emit warnings using API provided by the runtime.
*/
constructor({
emitWarning = globalThis.process?.emitWarning ?? (() => {}),
} = {}) {
this.emitWarning = emitWarning;
}
/**
* Emits a warning when circular fixes are detected while fixing a file.
* This method is used by the Linter and is safe to call outside Node.js.
* @param {string} filename The name of the file being fixed.
* @returns {void}
*/
emitCircularFixesWarning(filename) {
this.emitWarning(
`Circular fixes detected while fixing ${filename}. It is likely that you have conflicting rules in your configuration.`,
"ESLintCircularFixesWarning",
);
}
/**
* Emits a warning when an empty config file has been loaded.
* @param {string} configFilePath The path to the config file.
* @returns {void}
*/
emitEmptyConfigWarning(configFilePath) {
this.emitWarning(
`Running ESLint with an empty config (from ${configFilePath}). Please double-check that this is what you want. If you want to run ESLint with an empty config, export [{}] to remove this warning.`,
"ESLintEmptyConfigWarning",
);
}
/**
* Emits a warning when an ".eslintignore" file is found.
* @returns {void}
*/
emitESLintIgnoreWarning() {
this.emitWarning(
'The ".eslintignore" file is no longer supported. Switch to using the "ignores" property in "eslint.config.js": https://eslint.org/docs/latest/use/configure/migration-guide#ignore-files',
"ESLintIgnoreWarning",
);
}
/**
* Emits a warning when an inactive flag is used.
* This method is used by the Linter and is safe to call outside Node.js.
* @param {string} flag The name of the flag.
* @param {string} message The warning message.
* @returns {void}
*/
emitInactiveFlagWarning(flag, message) {
this.emitWarning(message, `ESLintInactiveFlag_${flag}`);
}
/**
* Emits a warning when a suboptimal concurrency setting is detected.
* Currently, this is only used to warn when the net linting ratio is low.
* @param {string} notice A notice about how to improve performance.
* @returns {void}
*/
emitPoorConcurrencyWarning(notice) {
this.emitWarning(
`You may ${notice} to improve performance.`,
"ESLintPoorConcurrencyWarning",
);
}
}
module.exports = { WarningService };

View File

@@ -0,0 +1,4 @@
{
"main": "../../cjs/_using.cjs",
"module": "../../esm/_using.js"
}

View File

@@ -0,0 +1,729 @@
import { URL as URL$1 } from 'node:url';
import { Console } from 'node:console';
// SEE https://github.com/jsdom/jsdom/blob/master/lib/jsdom/living/interfaces.js
const LIVING_KEYS = [
"DOMException",
"EventTarget",
"NamedNodeMap",
"Node",
"Attr",
"Element",
"DocumentFragment",
"DOMImplementation",
"Document",
"XMLDocument",
"CharacterData",
"Text",
"CDATASection",
"ProcessingInstruction",
"Comment",
"DocumentType",
"NodeList",
"RadioNodeList",
"HTMLCollection",
"HTMLOptionsCollection",
"DOMStringMap",
"DOMTokenList",
"StyleSheetList",
"HTMLElement",
"HTMLHeadElement",
"HTMLTitleElement",
"HTMLBaseElement",
"HTMLLinkElement",
"HTMLMetaElement",
"HTMLStyleElement",
"HTMLBodyElement",
"HTMLHeadingElement",
"HTMLParagraphElement",
"HTMLHRElement",
"HTMLPreElement",
"HTMLUListElement",
"HTMLOListElement",
"HTMLLIElement",
"HTMLMenuElement",
"HTMLDListElement",
"HTMLDivElement",
"HTMLAnchorElement",
"HTMLAreaElement",
"HTMLBRElement",
"HTMLButtonElement",
"HTMLCanvasElement",
"HTMLDataElement",
"HTMLDataListElement",
"HTMLDetailsElement",
"HTMLDialogElement",
"HTMLDirectoryElement",
"HTMLFieldSetElement",
"HTMLFontElement",
"HTMLFormElement",
"HTMLHtmlElement",
"HTMLImageElement",
"HTMLInputElement",
"HTMLLabelElement",
"HTMLLegendElement",
"HTMLMapElement",
"HTMLMarqueeElement",
"HTMLMediaElement",
"HTMLMeterElement",
"HTMLModElement",
"HTMLOptGroupElement",
"HTMLOptionElement",
"HTMLOutputElement",
"HTMLPictureElement",
"HTMLProgressElement",
"HTMLQuoteElement",
"HTMLScriptElement",
"HTMLSelectElement",
"HTMLSlotElement",
"HTMLSourceElement",
"HTMLSpanElement",
"HTMLTableCaptionElement",
"HTMLTableCellElement",
"HTMLTableColElement",
"HTMLTableElement",
"HTMLTimeElement",
"HTMLTableRowElement",
"HTMLTableSectionElement",
"HTMLTemplateElement",
"HTMLTextAreaElement",
"HTMLUnknownElement",
"HTMLFrameElement",
"HTMLFrameSetElement",
"HTMLIFrameElement",
"HTMLEmbedElement",
"HTMLObjectElement",
"HTMLParamElement",
"HTMLVideoElement",
"HTMLAudioElement",
"HTMLTrackElement",
"HTMLFormControlsCollection",
"SVGElement",
"SVGGraphicsElement",
"SVGSVGElement",
"SVGTitleElement",
"SVGAnimatedString",
"SVGNumber",
"SVGStringList",
"Event",
"CloseEvent",
"CustomEvent",
"MessageEvent",
"ErrorEvent",
"HashChangeEvent",
"PopStateEvent",
"StorageEvent",
"ProgressEvent",
"PageTransitionEvent",
"SubmitEvent",
"UIEvent",
"FocusEvent",
"InputEvent",
"MouseEvent",
"KeyboardEvent",
"TouchEvent",
"CompositionEvent",
"WheelEvent",
"BarProp",
"External",
"Location",
"History",
"Screen",
"Crypto",
"Performance",
"Navigator",
"PluginArray",
"MimeTypeArray",
"Plugin",
"MimeType",
"FileReader",
"FormData",
"Blob",
"File",
"FileList",
"ValidityState",
"DOMParser",
"XMLSerializer",
"XMLHttpRequestEventTarget",
"XMLHttpRequestUpload",
"XMLHttpRequest",
"WebSocket",
"NodeFilter",
"NodeIterator",
"TreeWalker",
"AbstractRange",
"Range",
"StaticRange",
"Selection",
"Storage",
"CustomElementRegistry",
"ShadowRoot",
"MutationObserver",
"MutationRecord",
"Uint8Array",
"Uint16Array",
"Uint32Array",
"Uint8ClampedArray",
"Int8Array",
"Int16Array",
"Int32Array",
"Float32Array",
"Float64Array",
"ArrayBuffer",
"DOMRectReadOnly",
"DOMRect",
"Image",
"Audio",
"Option",
"CSS"
];
const OTHER_KEYS = [
"addEventListener",
"alert",
"blur",
"cancelAnimationFrame",
"close",
"confirm",
"createPopup",
"dispatchEvent",
"document",
"focus",
"frames",
"getComputedStyle",
"history",
"innerHeight",
"innerWidth",
"length",
"location",
"matchMedia",
"moveBy",
"moveTo",
"name",
"navigator",
"open",
"outerHeight",
"outerWidth",
"pageXOffset",
"pageYOffset",
"parent",
"postMessage",
"print",
"prompt",
"removeEventListener",
"requestAnimationFrame",
"resizeBy",
"resizeTo",
"screen",
"screenLeft",
"screenTop",
"screenX",
"screenY",
"scroll",
"scrollBy",
"scrollLeft",
"scrollTo",
"scrollTop",
"scrollX",
"scrollY",
"self",
"stop",
"top",
"Window",
"window"
];
const KEYS = LIVING_KEYS.concat(OTHER_KEYS);
const skipKeys = [
"window",
"self",
"top",
"parent"
];
function getWindowKeys(global, win, additionalKeys = []) {
const keysArray = [...additionalKeys, ...KEYS];
return new Set(keysArray.concat(Object.getOwnPropertyNames(win)).filter((k) => {
if (skipKeys.includes(k)) return false;
if (k in global) return keysArray.includes(k);
return true;
}));
}
function isClassLikeName(name) {
return name[0] === name[0].toUpperCase();
}
function populateGlobal(global, win, options = {}) {
const { bindFunctions = false } = options;
const keys = getWindowKeys(global, win, options.additionalKeys);
const originals = /* @__PURE__ */ new Map();
const overriddenKeys = new Set([...KEYS, ...options.additionalKeys || []]);
const overrideObject = /* @__PURE__ */ new Map();
for (const key of keys) {
const boundFunction = bindFunctions && typeof win[key] === "function" && !isClassLikeName(key) && win[key].bind(win);
if (overriddenKeys.has(key) && key in global) originals.set(key, global[key]);
Object.defineProperty(global, key, {
get() {
if (overrideObject.has(key)) return overrideObject.get(key);
if (boundFunction) return boundFunction;
return win[key];
},
set(v) {
overrideObject.set(key, v);
},
configurable: true
});
}
global.window = global;
global.self = global;
global.top = global;
global.parent = global;
if (global.global) global.global = global;
// rewrite defaultView to reference the same global context
if (global.document && global.document.defaultView) Object.defineProperty(global.document, "defaultView", {
get: () => global,
enumerable: true,
configurable: true
});
skipKeys.forEach((k) => keys.add(k));
return {
keys,
skipKeys,
originals
};
}
var edge = {
name: "edge-runtime",
viteEnvironment: "ssr",
async setupVM() {
const { EdgeVM } = await import('@edge-runtime/vm');
const vm = new EdgeVM({ extend: (context) => {
context.global = context;
context.Buffer = Buffer;
return context;
} });
return {
getVmContext() {
return vm.context;
},
teardown() {
// nothing to teardown
}
};
},
async setup(global) {
const { EdgeVM } = await import('@edge-runtime/vm');
const { keys, originals } = populateGlobal(global, new EdgeVM({ extend: (context) => {
context.global = context;
context.Buffer = Buffer;
KEYS.forEach((key) => {
if (key in global) context[key] = global[key];
});
return context;
} }).context, { bindFunctions: true });
return { teardown(global) {
keys.forEach((key) => delete global[key]);
originals.forEach((v, k) => global[k] = v);
} };
}
};
async function teardownWindow(win) {
if (win.close && win.happyDOM.abort) {
await win.happyDOM.abort();
win.close();
} else win.happyDOM.cancelAsync();
}
var happy = {
name: "happy-dom",
viteEnvironment: "client",
async setupVM({ happyDOM = {} }) {
const { Window } = await import('happy-dom');
let win = new Window({
...happyDOM,
console: console && globalThis.console ? globalThis.console : void 0,
url: happyDOM.url || "http://localhost:3000",
settings: {
...happyDOM.settings,
disableErrorCapturing: true
}
});
// TODO: browser doesn't expose Buffer, but a lot of dependencies use it
win.Buffer = Buffer;
// inject structuredClone if it exists
if (typeof structuredClone !== "undefined" && !win.structuredClone) win.structuredClone = structuredClone;
return {
getVmContext() {
return win;
},
async teardown() {
await teardownWindow(win);
win = void 0;
}
};
},
async setup(global, { happyDOM = {} }) {
// happy-dom v3 introduced a breaking change to Window, but
// provides GlobalWindow as a way to use previous behaviour
const { Window, GlobalWindow } = await import('happy-dom');
const win = new (GlobalWindow || Window)({
...happyDOM,
console: console && global.console ? global.console : void 0,
url: happyDOM.url || "http://localhost:3000",
settings: {
...happyDOM.settings,
disableErrorCapturing: true
}
});
const { keys, originals } = populateGlobal(global, win, {
bindFunctions: true,
additionalKeys: [
"Request",
"Response",
"MessagePort",
"fetch",
"Headers",
"AbortController",
"AbortSignal",
"URL",
"URLSearchParams",
"FormData"
]
});
return { async teardown(global) {
await teardownWindow(win);
keys.forEach((key) => delete global[key]);
originals.forEach((v, k) => global[k] = v);
} };
}
};
function catchWindowErrors(window) {
let userErrorListenerCount = 0;
function throwUnhandlerError(e) {
if (userErrorListenerCount === 0 && e.error != null) {
e.preventDefault();
process.emit("uncaughtException", e.error);
}
}
const addEventListener = window.addEventListener.bind(window);
const removeEventListener = window.removeEventListener.bind(window);
window.addEventListener("error", throwUnhandlerError);
window.addEventListener = function(...args) {
if (args[0] === "error") userErrorListenerCount++;
return addEventListener.apply(this, args);
};
window.removeEventListener = function(...args) {
if (args[0] === "error" && userErrorListenerCount) userErrorListenerCount--;
return removeEventListener.apply(this, args);
};
return function clearErrorHandlers() {
window.removeEventListener("error", throwUnhandlerError);
};
}
let NodeFormData_;
let NodeBlob_;
let NodeRequest_;
var jsdom = {
name: "jsdom",
viteEnvironment: "client",
async setupVM({ jsdom = {} }) {
// delay initialization because it takes ~1s
NodeFormData_ = globalThis.FormData;
NodeBlob_ = globalThis.Blob;
NodeRequest_ = globalThis.Request;
const { CookieJar, JSDOM, ResourceLoader, VirtualConsole } = await import('jsdom');
const { html = "<!DOCTYPE html>", userAgent, url = "http://localhost:3000", contentType = "text/html", pretendToBeVisual = true, includeNodeLocations = false, runScripts = "dangerously", resources, console = false, cookieJar = false, ...restOptions } = jsdom;
let virtualConsole;
if (console && globalThis.console) {
virtualConsole = new VirtualConsole();
// jsdom <27
if ("sendTo" in virtualConsole) virtualConsole.sendTo(globalThis.console);
else virtualConsole.forwardTo(globalThis.console);
}
let dom = new JSDOM(html, {
pretendToBeVisual,
resources: resources ?? (userAgent ? new ResourceLoader({ userAgent }) : void 0),
runScripts,
url,
virtualConsole,
cookieJar: cookieJar ? new CookieJar() : void 0,
includeNodeLocations,
contentType,
userAgent,
...restOptions
});
const clearAddEventListenerPatch = patchAddEventListener(dom.window);
const clearWindowErrors = catchWindowErrors(dom.window);
const utils = createCompatUtils(dom.window);
// TODO: browser doesn't expose Buffer, but a lot of dependencies use it
dom.window.Buffer = Buffer;
dom.window.jsdom = dom;
dom.window.Request = createCompatRequest(utils);
dom.window.URL = createJSDOMCompatURL(utils);
for (const name of [
"structuredClone",
"BroadcastChannel",
"MessageChannel",
"MessagePort",
"TextEncoder",
"TextDecoder"
]) {
const value = globalThis[name];
if (typeof value !== "undefined" && typeof dom.window[name] === "undefined") dom.window[name] = value;
}
for (const name of [
"fetch",
"Response",
"Headers",
"AbortController",
"AbortSignal",
"URLSearchParams"
]) {
const value = globalThis[name];
if (typeof value !== "undefined") dom.window[name] = value;
}
return {
getVmContext() {
return dom.getInternalVMContext();
},
teardown() {
clearAddEventListenerPatch();
clearWindowErrors();
dom.window.close();
dom = void 0;
}
};
},
async setup(global, { jsdom = {} }) {
// delay initialization because it takes ~1s
NodeFormData_ = globalThis.FormData;
NodeBlob_ = globalThis.Blob;
NodeRequest_ = globalThis.Request;
const { CookieJar, JSDOM, ResourceLoader, VirtualConsole } = await import('jsdom');
const { html = "<!DOCTYPE html>", userAgent, url = "http://localhost:3000", contentType = "text/html", pretendToBeVisual = true, includeNodeLocations = false, runScripts = "dangerously", resources, console = false, cookieJar = false, ...restOptions } = jsdom;
let virtualConsole;
if (console && globalThis.console) {
virtualConsole = new VirtualConsole();
// jsdom <27
if ("sendTo" in virtualConsole) virtualConsole.sendTo(globalThis.console);
else virtualConsole.forwardTo(globalThis.console);
}
const dom = new JSDOM(html, {
pretendToBeVisual,
resources: resources ?? (userAgent ? new ResourceLoader({ userAgent }) : void 0),
runScripts,
url,
virtualConsole,
cookieJar: cookieJar ? new CookieJar() : void 0,
includeNodeLocations,
contentType,
userAgent,
...restOptions
});
const clearAddEventListenerPatch = patchAddEventListener(dom.window);
const { keys, originals } = populateGlobal(global, dom.window, { bindFunctions: true });
const clearWindowErrors = catchWindowErrors(global);
const utils = createCompatUtils(dom.window);
global.jsdom = dom;
global.Request = createCompatRequest(utils);
global.URL = createJSDOMCompatURL(utils);
return { teardown(global) {
clearAddEventListenerPatch();
clearWindowErrors();
dom.window.close();
delete global.jsdom;
keys.forEach((key) => delete global[key]);
originals.forEach((v, k) => global[k] = v);
} };
}
};
function createCompatRequest(utils) {
class Request extends NodeRequest_ {
constructor(...args) {
const [input, init] = args;
if (init?.body != null) {
const compatInit = { ...init };
if (init.body instanceof utils.window.Blob) compatInit.body = utils.makeCompatBlob(init.body);
if (init.body instanceof utils.window.FormData) compatInit.body = utils.makeCompatFormData(init.body);
super(input, compatInit);
} else super(...args);
}
static [Symbol.hasInstance](instance) {
return instance instanceof NodeRequest_;
}
}
return Request;
}
function createJSDOMCompatURL(utils) {
class URL extends URL$1 {
static createObjectURL(blob) {
if (blob instanceof utils.window.Blob) {
const compatBlob = utils.makeCompatBlob(blob);
return URL$1.createObjectURL(compatBlob);
}
return URL$1.createObjectURL(blob);
}
static [Symbol.hasInstance](instance) {
return instance instanceof URL$1;
}
}
return URL;
}
function createCompatUtils(window) {
// this returns a hidden Symbol(impl)
// this is cursed, and jsdom should just implement fetch API itself
const implSymbol = Object.getOwnPropertySymbols(Object.getOwnPropertyDescriptors(new window.Blob()))[0];
const utils = {
window,
makeCompatFormData(formData) {
const nodeFormData = new NodeFormData_();
formData.forEach((value, key) => {
if (value instanceof window.Blob) nodeFormData.append(key, utils.makeCompatBlob(value));
else nodeFormData.append(key, value);
});
return nodeFormData;
},
makeCompatBlob(blob) {
const buffer = blob[implSymbol]._buffer;
return new NodeBlob_([buffer], { type: blob.type });
}
};
return utils;
}
function patchAddEventListener(window) {
const abortControllers = /* @__PURE__ */ new WeakMap();
const JSDOMAbortSignal = window.AbortSignal;
const JSDOMAbortController = window.AbortController;
const originalAddEventListener = window.EventTarget.prototype.addEventListener;
function getJsdomAbortController(signal) {
if (!abortControllers.has(signal)) {
const jsdomAbortController = new JSDOMAbortController();
signal.addEventListener("abort", () => {
jsdomAbortController.abort(signal.reason);
});
abortControllers.set(signal, jsdomAbortController);
}
return abortControllers.get(signal);
}
window.EventTarget.prototype.addEventListener = function addEventListener(type, callback, options) {
if (typeof options === "object" && options?.signal != null) {
const { signal, ...otherOptions } = options;
// - this happens because AbortSignal is provided by Node.js,
// but jsdom APIs require jsdom's AbortSignal, while Node APIs
// (like fetch and Request) require a Node.js AbortSignal
// - disable narrow typing with "as any" because we need it later
if (!(signal instanceof JSDOMAbortSignal)) {
const jsdomCompatOptions = Object.create(null);
Object.assign(jsdomCompatOptions, otherOptions);
jsdomCompatOptions.signal = getJsdomAbortController(signal).signal;
return originalAddEventListener.call(this, type, callback, jsdomCompatOptions);
}
}
return originalAddEventListener.call(this, type, callback, options);
};
return () => {
window.EventTarget.prototype.addEventListener = originalAddEventListener;
};
}
// some globals we do not want, either because deprecated or we set it ourselves
const denyList = new Set([
"GLOBAL",
"root",
"global",
"Buffer",
"ArrayBuffer",
"Uint8Array"
]);
const nodeGlobals = /* @__PURE__ */ new Map();
function populateNodeGlobals() {
if (nodeGlobals.size !== 0) return;
const names = Object.getOwnPropertyNames(globalThis);
const length = names.length;
for (let i = 0; i < length; i++) {
const globalName = names[i];
if (!denyList.has(globalName)) {
const descriptor = Object.getOwnPropertyDescriptor(globalThis, globalName);
if (!descriptor) throw new Error(`No property descriptor for ${globalName}, this is a bug in Vitest.`);
nodeGlobals.set(globalName, descriptor);
}
}
}
var node = {
name: "node",
viteEnvironment: "ssr",
async setupVM() {
populateNodeGlobals();
const vm = await import('node:vm');
let context = vm.createContext();
let global = vm.runInContext("this", context);
const contextGlobals = new Set(Object.getOwnPropertyNames(global));
for (const [nodeGlobalsKey, descriptor] of nodeGlobals) if (!contextGlobals.has(nodeGlobalsKey)) if (descriptor.configurable) Object.defineProperty(global, nodeGlobalsKey, {
configurable: true,
enumerable: descriptor.enumerable,
get() {
// @ts-expect-error: no index signature
const val = globalThis[nodeGlobalsKey];
// override lazy getter
Object.defineProperty(global, nodeGlobalsKey, {
configurable: true,
enumerable: descriptor.enumerable,
value: val,
writable: descriptor.writable === true || nodeGlobalsKey === "performance"
});
return val;
},
set(val) {
// override lazy getter
Object.defineProperty(global, nodeGlobalsKey, {
configurable: true,
enumerable: descriptor.enumerable,
value: val,
writable: true
});
}
});
else if ("value" in descriptor) Object.defineProperty(global, nodeGlobalsKey, {
configurable: false,
enumerable: descriptor.enumerable,
value: descriptor.value,
writable: descriptor.writable
});
else Object.defineProperty(global, nodeGlobalsKey, {
configurable: false,
enumerable: descriptor.enumerable,
get: descriptor.get,
set: descriptor.set
});
global.global = global;
global.Buffer = Buffer;
global.ArrayBuffer = ArrayBuffer;
// TextEncoder (global or via 'util') references a Uint8Array constructor
// different than the global one used by users in tests. This makes sure the
// same constructor is referenced by both.
global.Uint8Array = Uint8Array;
return {
getVmContext() {
return context;
},
teardown() {
context = void 0;
global = void 0;
}
};
},
async setup(global) {
global.console.Console = Console;
return { teardown(global) {
delete global.console.Console;
} };
}
};
const environments = {
node,
jsdom,
"happy-dom": happy,
"edge-runtime": edge
};
export { environments as e, populateGlobal as p };

View File

@@ -0,0 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _v = _interopRequireDefault(require("./v35.js"));
var _md = _interopRequireDefault(require("./md5.js"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const v3 = (0, _v.default)('v3', 0x30, _md.default);
var _default = v3;
exports.default = _default;

View File

@@ -0,0 +1,137 @@
'use strict'
const test = require('node:test')
const assert = require('node:assert')
const os = require('node:os')
const { join } = require('node:path')
const { readFile } = require('node:fs').promises
const { watchFileCreated, file } = require('../helper')
const pino = require('../../')
const { DEFAULT_LEVELS } = require('../../lib/constants')
const { pid } = process
const hostname = os.hostname()
test('pino.transport with a pipeline', async (t) => {
const destination = file()
const transport = pino.transport({
pipeline: [{
target: join(__dirname, '..', 'fixtures', 'transport-transform.js')
}, {
target: join(__dirname, '..', 'fixtures', 'to-file-transport.js'),
options: { destination }
}]
})
t.after(transport.end.bind(transport))
const instance = pino(transport)
instance.info('hello')
await watchFileCreated(destination)
const result = JSON.parse(await readFile(destination))
delete result.time
assert.deepEqual(result, {
pid,
hostname,
level: DEFAULT_LEVELS.info,
msg: 'hello',
service: 'pino' // this property was added by the transform
})
})
test('pino.transport with targets containing pipelines', async (t) => {
const destinationA = file()
const destinationB = file()
const transport = pino.transport({
targets: [
{
target: join(__dirname, '..', 'fixtures', 'to-file-transport.js'),
options: { destination: destinationA }
},
{
pipeline: [
{
target: join(__dirname, '..', 'fixtures', 'transport-transform.js')
},
{
target: join(__dirname, '..', 'fixtures', 'to-file-transport.js'),
options: { destination: destinationB }
}
]
}
]
})
t.after(transport.end.bind(transport))
const instance = pino(transport)
instance.info('hello')
await watchFileCreated(destinationA)
await watchFileCreated(destinationB)
const resultA = JSON.parse(await readFile(destinationA))
const resultB = JSON.parse(await readFile(destinationB))
delete resultA.time
delete resultB.time
assert.deepEqual(resultA, {
pid,
hostname,
level: DEFAULT_LEVELS.info,
msg: 'hello'
})
assert.deepEqual(resultB, {
pid,
hostname,
level: DEFAULT_LEVELS.info,
msg: 'hello',
service: 'pino' // this property was added by the transform
})
})
test('pino.transport with targets containing pipelines with levels defined and dedupe', async (t) => {
const destinationA = file()
const destinationB = file()
const transport = pino.transport({
targets: [
{
target: join(__dirname, '..', 'fixtures', 'to-file-transport.js'),
options: { destination: destinationA },
level: DEFAULT_LEVELS.info
},
{
pipeline: [
{
target: join(__dirname, '..', 'fixtures', 'transport-transform.js')
},
{
target: join(__dirname, '..', 'fixtures', 'to-file-transport.js'),
options: { destination: destinationB }
}
],
level: DEFAULT_LEVELS.error
}
],
dedupe: true
})
t.after(transport.end.bind(transport))
const instance = pino(transport)
instance.info('hello info')
instance.error('hello error')
await watchFileCreated(destinationA)
await watchFileCreated(destinationB)
const resultA = JSON.parse(await readFile(destinationA))
const resultB = JSON.parse(await readFile(destinationB))
delete resultA.time
delete resultB.time
assert.deepEqual(resultA, {
pid,
hostname,
level: DEFAULT_LEVELS.info,
msg: 'hello info'
})
assert.deepEqual(resultB, {
pid,
hostname,
level: DEFAULT_LEVELS.error,
msg: 'hello error',
service: 'pino' // this property was added by the transform
})
})

View File

@@ -0,0 +1,62 @@
/**
* @fileoverview Define the cursor which iterates tokens only.
* @author Toru Nagashima
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const Cursor = require("./cursor");
const { getFirstIndex, getLastIndex } = require("./utils");
//------------------------------------------------------------------------------
// Exports
//------------------------------------------------------------------------------
/**
* The cursor which iterates tokens only.
*/
module.exports = class ForwardTokenCursor extends Cursor {
/**
* Initializes this cursor.
* @param {Token[]} tokens The array of tokens.
* @param {Comment[]} comments The array of comments.
* @param {Object} indexMap The map from locations to indices in `tokens`.
* @param {number} startLoc The start location of the iteration range.
* @param {number} endLoc The end location of the iteration range.
*/
constructor(tokens, comments, indexMap, startLoc, endLoc) {
super();
this.tokens = tokens;
this.index = getFirstIndex(tokens, indexMap, startLoc);
this.indexEnd = getLastIndex(tokens, indexMap, endLoc);
}
/** @inheritdoc */
moveNext() {
if (this.index <= this.indexEnd) {
this.current = this.tokens[this.index];
this.index += 1;
return true;
}
return false;
}
/*
*
* Shorthand for performance.
*
*/
/** @inheritdoc */
getOneToken() {
return this.index <= this.indexEnd ? this.tokens[this.index] : null;
}
/** @inheritdoc */
getAllTokens() {
return this.tokens.slice(this.index, this.indexEnd + 1);
}
};

View File

@@ -0,0 +1,17 @@
import { dirname, resolve } from 'pathe';
import { EvaluatedModules } from 'vite/module-runner';
// TODO: this is not needed in Vite 7.2+
class VitestEvaluatedModules extends EvaluatedModules {
getModuleSourceMapById(id) {
const map = super.getModuleSourceMapById(id);
if (map != null && !("_patched" in map)) {
map._patched = true;
const dir = dirname(map.url);
map.resolvedSources = (map.map.sources || []).map((s) => resolve(dir, s || ""));
}
return map;
}
}
export { VitestEvaluatedModules as V };

View File

@@ -0,0 +1,4 @@
function _taggedTemplateLiteralLoose(e, t) {
return t || (t = e.slice(0)), e.raw = t, e;
}
export { _taggedTemplateLiteralLoose as default };

View File

@@ -0,0 +1,51 @@
"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 });
exports.getInnermostScope = exports.findVariable = void 0;
const eslintUtils = __importStar(require("@eslint-community/eslint-utils"));
/**
* Get the variable of a given name.
*
* @see {@link https://eslint-community.github.io/eslint-utils/api/scope-utils.html#findvariable}
*/
exports.findVariable = eslintUtils.findVariable;
/**
* Get the innermost scope which contains a given node.
*
* @see {@link https://eslint-community.github.io/eslint-utils/api/scope-utils.html#getinnermostscope}
* @returns The innermost scope which contains the given node.
* If such scope doesn't exist then it returns the 1st argument `initialScope`.
*/
exports.getInnermostScope = eslintUtils.getInnermostScope;

View File

@@ -0,0 +1,4 @@
import z4 from "./classic/index.js";
export * from "./classic/index.js";
export default z4;

View File

@@ -0,0 +1 @@
{"version":3,"file":"p256.d.ts","sourceRoot":"","sources":["../src/p256.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,sEAAsE;AACtE,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAe,IAAI,IAAI,KAAK,EAAE,MAAM,WAAW,CAAC;AACvD,sEAAsE;AACtE,eAAO,MAAM,IAAI,EAAE,OAAO,KAAa,CAAC;AACxC,sEAAsE;AACtE,eAAO,MAAM,SAAS,EAAE,OAAO,KAAa,CAAC;AAC7C,6EAA6E;AAC7E,eAAO,MAAM,WAAW,EAAE,SAAS,CAAC,MAAM,CAAqD,CAAC;AAChG,6EAA6E;AAC7E,eAAO,MAAM,aAAa,EAAE,SAAS,CAAC,MAAM,CAAuD,CAAC"}

View File

@@ -0,0 +1,12 @@
"use strict";
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib repo
Object.defineProperty(exports, "__esModule", { value: true });
exports.esnext_error = void 0;
const base_config_1 = require("./base-config");
exports.esnext_error = {
libs: [],
variables: [['ErrorConstructor', base_config_1.TYPE]],
};

View File

@@ -0,0 +1,140 @@
'use strict'
const { test } = require('tap')
const fs = require('fs')
const proxyquire = require('proxyquire')
const SonicBoom = require('../')
const { file, runTests } = require('./helper')
runTests(buildTests)
function buildTests (test, sync) {
// Reset the umask for testing
process.umask(0o000)
test('flushSync', (t) => {
t.plan(4)
const dest = file()
const fd = fs.openSync(dest, 'w')
const stream = new SonicBoom({ fd, minLength: 4096, sync })
t.ok(stream.write('hello world\n'))
t.ok(stream.write('something else\n'))
stream.flushSync()
// let the file system settle down things
setImmediate(function () {
stream.end()
const data = fs.readFileSync(dest, 'utf8')
t.equal(data, 'hello world\nsomething else\n')
stream.on('close', () => {
t.pass('close emitted')
})
})
})
}
test('retry in flushSync on EAGAIN', (t) => {
t.plan(7)
const fakeFs = Object.create(fs)
const SonicBoom = proxyquire('../', {
fs: fakeFs
})
const dest = file()
const fd = fs.openSync(dest, 'w')
const stream = new SonicBoom({ fd, sync: false, minLength: 0 })
stream.on('ready', () => {
t.pass('ready emitted')
})
t.ok(stream.write('hello world\n'))
fakeFs.writeSync = function (fd, buf, enc) {
t.pass('fake fs.write called')
fakeFs.writeSync = fs.writeSync
const err = new Error('EAGAIN')
err.code = 'EAGAIN'
throw err
}
t.ok(stream.write('something else\n'))
stream.flushSync()
stream.end()
stream.on('finish', () => {
fs.readFile(dest, 'utf8', (err, data) => {
t.error(err)
t.equal(data, 'hello world\nsomething else\n')
})
})
stream.on('close', () => {
t.pass('close emitted')
})
})
test('throw error in flushSync on EAGAIN', (t) => {
t.plan(12)
const fakeFs = Object.create(fs)
const SonicBoom = proxyquire('../', {
fs: fakeFs
})
const dest = file()
const fd = fs.openSync(dest, 'w')
const stream = new SonicBoom({
fd,
sync: false,
minLength: 1000,
retryEAGAIN: (err, writeBufferLen, remainingBufferLen) => {
t.equal(err.code, 'EAGAIN')
t.equal(writeBufferLen, 12)
t.equal(remainingBufferLen, 0)
return false
}
})
stream.on('ready', () => {
t.pass('ready emitted')
})
const err = new Error('EAGAIN')
err.code = 'EAGAIN'
fakeFs.writeSync = function (fd, buf, enc) {
Error.captureStackTrace(err)
t.pass('fake fs.write called')
fakeFs.writeSync = fs.writeSync
throw err
}
fakeFs.fsyncSync = function (...args) {
t.pass('fake fs.fsyncSync called')
fakeFs.fsyncSync = fs.fsyncSync
return fs.fsyncSync.apply(null, args)
}
t.ok(stream.write('hello world\n'))
t.throws(stream.flushSync.bind(stream), err, 'EAGAIN')
t.ok(stream.write('something else\n'))
stream.flushSync()
stream.end()
stream.on('finish', () => {
fs.readFile(dest, 'utf8', (err, data) => {
t.error(err)
t.equal(data, 'hello world\nsomething else\n')
})
})
stream.on('close', () => {
t.pass('close emitted')
})
})

View File

@@ -0,0 +1 @@
{"version":3,"file":"poseidon.d.ts","sourceRoot":"","sources":["../src/abstract/poseidon.ts"],"names":[],"mappings":"AAUA,OAAO,EAAwB,KAAK,MAAM,EAAiB,MAAM,cAAc,CAAC;AAyBhF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACnB,CAAC,EAAE,MAAM,CAAC;IACV,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AA0DF,MAAM,MAAM,iBAAiB,GAAG,iBAAiB,GAAG;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,KAAK,iBAAiB,GAAG;IAAE,GAAG,EAAE,MAAM,EAAE,EAAE,CAAC;IAAC,cAAc,EAAE,MAAM,EAAE,EAAE,CAAA;CAAE,CAAC;AAIzE,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,EAAE,OAAO,GAAE,MAAU,GAAG,iBAAiB,CAuBjG;AAED,MAAM,MAAM,YAAY,GAAG,iBAAiB,GAC1C,iBAAiB,GAAG;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AAEJ,wBAAgB,YAAY,CAAC,IAAI,EAAE,YAAY,GAAG,QAAQ,CAAC;IACzD,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9B,cAAc,EAAE,MAAM,EAAE,EAAE,CAAC;IAC3B,GAAG,EAAE,MAAM,EAAE,EAAE,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACnB,CAAC,EAAE,MAAM,CAAC;IACV,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC,CAwCD;AAED,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,CAalE;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;IAE7B,cAAc,EAAE,MAAM,EAAE,EAAE,CAAC;CAC5B,CAAC;AACF,kCAAkC;AAClC,wBAAgB,QAAQ,CAAC,IAAI,EAAE,YAAY,GAAG,UAAU,CAmCvD;AAED,qBAAa,cAAc;IACzB,OAAO,CAAC,EAAE,CAAiB;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,OAAO,CAAC,KAAK,CAAW;IACxB,OAAO,CAAC,GAAG,CAAK;IAChB,OAAO,CAAC,WAAW,CAAQ;gBAEf,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU;IAQhF,OAAO,CAAC,OAAO;IAGf,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI;IAgB7B,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE;IAahC,KAAK,IAAI,IAAI;IAKb,KAAK,IAAI,cAAc;CAMxB;AAED,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,YAAY,EAAE,GAAG,CAAC,GAAG;IACzD,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,kBAAkB,GAAG,MAAM,cAAc,CAW7E"}

View File

@@ -0,0 +1,15 @@
import { RequestMessage } from './messages';
import { AbstractCancellationTokenSource } from './cancellation';
import { CancellationId, RequestCancellationReceiverStrategy, CancellationSenderStrategy, MessageConnection } from './connection';
export declare class SharedArraySenderStrategy implements CancellationSenderStrategy {
private readonly buffers;
constructor();
enableCancellation(request: RequestMessage): void;
sendCancellation(_conn: MessageConnection, id: CancellationId): Promise<void>;
cleanup(id: CancellationId): void;
dispose(): void;
}
export declare class SharedArrayReceiverStrategy implements RequestCancellationReceiverStrategy {
readonly kind: "request";
createCancellationTokenSource(request: RequestMessage): AbstractCancellationTokenSource;
}

View File

@@ -0,0 +1,7 @@
providers:
- airtap-playwright
browsers:
- name: chromium
supports:
headless: true

View File

@@ -0,0 +1,2 @@
export declare var RegularExpressionFlags: any;
//# sourceMappingURL=regularExpressionFlags.d.ts.map

View File

@@ -0,0 +1,201 @@
/**
* @fileoverview Counts the cyclomatic complexity of each function of the script. See https://en.wikipedia.org/wiki/Cyclomatic_complexity.
* Counts the number of if, conditional, for, while, try, switch/case,
* @author Patrick Brosset
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
const { upperCaseFirst } = require("../shared/string-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
const THRESHOLD_DEFAULT = 20;
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
defaultOptions: [THRESHOLD_DEFAULT],
docs: {
description:
"Enforce a maximum cyclomatic complexity allowed in a program",
recommended: false,
url: "https://eslint.org/docs/latest/rules/complexity",
},
schema: [
{
oneOf: [
{
type: "integer",
minimum: 0,
},
{
type: "object",
properties: {
maximum: {
type: "integer",
minimum: 0,
},
max: {
type: "integer",
minimum: 0,
},
variant: {
enum: ["classic", "modified"],
},
},
additionalProperties: false,
},
],
},
],
messages: {
complex:
"{{name}} has a complexity of {{complexity}}. Maximum allowed is {{max}}.",
},
},
create(context) {
const sourceCode = context.sourceCode;
const option = context.options[0];
let threshold = THRESHOLD_DEFAULT;
let VARIANT = "classic";
if (typeof option === "object") {
if (
Object.hasOwn(option, "maximum") ||
Object.hasOwn(option, "max")
) {
threshold = option.maximum || option.max;
}
if (Object.hasOwn(option, "variant")) {
VARIANT = option.variant;
}
} else if (typeof option === "number") {
threshold = option;
}
const IS_MODIFIED_COMPLEXITY = VARIANT === "modified";
//--------------------------------------------------------------------------
// Helpers
//--------------------------------------------------------------------------
// Using a stack to store complexity per code path
const complexities = [];
/**
* Increase the complexity of the code path in context
* @returns {void}
* @private
*/
function increaseComplexity() {
complexities[complexities.length - 1]++;
}
//--------------------------------------------------------------------------
// Public API
//--------------------------------------------------------------------------
return {
onCodePathStart() {
// The initial complexity is 1, representing one execution path in the CodePath
complexities.push(1);
},
// Each branching in the code adds 1 to the complexity
CatchClause: increaseComplexity,
ConditionalExpression: increaseComplexity,
LogicalExpression: increaseComplexity,
ForStatement: increaseComplexity,
ForInStatement: increaseComplexity,
ForOfStatement: increaseComplexity,
IfStatement: increaseComplexity,
WhileStatement: increaseComplexity,
DoWhileStatement: increaseComplexity,
AssignmentPattern: increaseComplexity,
// Avoid `default`
"SwitchCase[test]": () =>
IS_MODIFIED_COMPLEXITY || increaseComplexity(),
SwitchStatement: () =>
IS_MODIFIED_COMPLEXITY && increaseComplexity(),
// Logical assignment operators have short-circuiting behavior
AssignmentExpression(node) {
if (astUtils.isLogicalAssignmentOperator(node.operator)) {
increaseComplexity();
}
},
MemberExpression(node) {
if (node.optional === true) {
increaseComplexity();
}
},
CallExpression(node) {
if (node.optional === true) {
increaseComplexity();
}
},
onCodePathEnd(codePath, node) {
const complexity = complexities.pop();
/*
* This rule only evaluates complexity of functions, so "program" is excluded.
* Class field initializers and class static blocks are implicit functions. Therefore,
* they shouldn't contribute to the enclosing function's complexity, but their
* own complexity should be evaluated.
*/
if (
codePath.origin !== "function" &&
codePath.origin !== "class-field-initializer" &&
codePath.origin !== "class-static-block"
) {
return;
}
if (complexity > threshold) {
let name;
let loc = node.loc;
if (codePath.origin === "class-field-initializer") {
name = "class field initializer";
} else if (codePath.origin === "class-static-block") {
name = "class static block";
loc = sourceCode.getFirstToken(node).loc;
} else {
name = astUtils.getFunctionNameWithKind(node);
loc = astUtils.getFunctionHeadLoc(node, sourceCode);
}
context.report({
node,
loc,
messageId: "complex",
data: {
name: upperCaseFirst(name),
complexity,
max: threshold,
},
});
}
},
};
},
};

View File

@@ -0,0 +1,100 @@
import type { AffinePoint } from './abstract/curve.ts';
import { PrimeEdwardsPoint, type CurveFn, type EdwardsPoint, type EdwardsPointCons } from './abstract/edwards.ts';
import { type H2CHasher, type H2CHasherBase, type H2CMethod, type htfBasicOpts } from './abstract/hash-to-curve.ts';
import { type IField } from './abstract/modular.ts';
import { type MontgomeryECDH as XCurveFn } from './abstract/montgomery.ts';
import { type Hex } from './utils.ts';
/**
* ed448 EdDSA curve and methods.
* @example
* import { ed448 } from '@noble/curves/ed448';
* const { secretKey, publicKey } = ed448.keygen();
* const msg = new TextEncoder().encode('hello');
* const sig = ed448.sign(msg, secretKey);
* const isValid = ed448.verify(sig, msg, publicKey);
*/
export declare const ed448: CurveFn;
/** Prehashed version of ed448. Accepts already-hashed messages in sign() and verify(). */
export declare const ed448ph: CurveFn;
/**
* E448 curve, defined by NIST.
* E448 != edwards448 used in ed448.
* E448 is birationally equivalent to edwards448.
*/
export declare const E448: EdwardsPointCons;
/**
* ECDH using curve448 aka x448.
* x448 has 56-byte keys as per RFC 7748, while
* ed448 has 57-byte keys as per RFC 8032.
*/
export declare const x448: XCurveFn;
/** Hashing / encoding to ed448 points / field. RFC 9380 methods. */
export declare const ed448_hasher: H2CHasher<bigint>;
/**
* Each ed448/EdwardsPoint has 4 different equivalent points. This can be
* a source of bugs for protocols like ring signatures. Decaf was created to solve this.
* Decaf point operates in X:Y:Z:T extended coordinates like EdwardsPoint,
* but it should work in its own namespace: do not combine those two.
* See [RFC9496](https://www.rfc-editor.org/rfc/rfc9496).
*/
declare class _DecafPoint extends PrimeEdwardsPoint<_DecafPoint> {
static BASE: _DecafPoint;
static ZERO: _DecafPoint;
static Fp: IField<bigint>;
static Fn: IField<bigint>;
constructor(ep: EdwardsPoint);
static fromAffine(ap: AffinePoint<bigint>): _DecafPoint;
protected assertSame(other: _DecafPoint): void;
protected init(ep: EdwardsPoint): _DecafPoint;
/** @deprecated use `import { decaf448_hasher } from '@noble/curves/ed448.js';` */
static hashToCurve(hex: Hex): _DecafPoint;
static fromBytes(bytes: Uint8Array): _DecafPoint;
/**
* Converts decaf-encoded string to decaf point.
* Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-decode-2).
* @param hex Decaf-encoded 56 bytes. Not every 56-byte string is valid decaf encoding
*/
static fromHex(hex: Hex): _DecafPoint;
/** @deprecated use `import { pippenger } from '@noble/curves/abstract/curve.js';` */
static msm(points: _DecafPoint[], scalars: bigint[]): _DecafPoint;
/**
* Encodes decaf point to Uint8Array.
* Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-encode-2).
*/
toBytes(): Uint8Array;
/**
* Compare one point to another.
* Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-equals-2).
*/
equals(other: _DecafPoint): boolean;
is0(): boolean;
}
export declare const decaf448: {
Point: typeof _DecafPoint;
};
/** Hashing to decaf448 points / field. RFC 9380 methods. */
export declare const decaf448_hasher: H2CHasherBase<bigint>;
/**
* Weird / bogus points, useful for debugging.
* Unlike ed25519, there is no ed448 generator point which can produce full T subgroup.
* Instead, there is a Klein four-group, which spans over 2 independent 2-torsion points:
* (0, 1), (0, -1), (-1, 0), (1, 0).
*/
export declare const ED448_TORSION_SUBGROUP: string[];
type DcfHasher = (msg: Uint8Array, options: htfBasicOpts) => _DecafPoint;
/** @deprecated use `decaf448.Point` */
export declare const DecafPoint: typeof _DecafPoint;
/** @deprecated use `import { ed448_hasher } from '@noble/curves/ed448.js';` */
export declare const hashToCurve: H2CMethod<bigint>;
/** @deprecated use `import { ed448_hasher } from '@noble/curves/ed448.js';` */
export declare const encodeToCurve: H2CMethod<bigint>;
/** @deprecated use `import { decaf448_hasher } from '@noble/curves/ed448.js';` */
export declare const hashToDecaf448: DcfHasher;
/** @deprecated use `import { decaf448_hasher } from '@noble/curves/ed448.js';` */
export declare const hash_to_decaf448: DcfHasher;
/** @deprecated use `ed448.utils.toMontgomery` */
export declare function edwardsToMontgomeryPub(edwardsPub: string | Uint8Array): Uint8Array;
/** @deprecated use `ed448.utils.toMontgomery` */
export declare const edwardsToMontgomery: typeof edwardsToMontgomeryPub;
export {};
//# sourceMappingURL=ed448.d.ts.map

View File

@@ -0,0 +1,19 @@
var argv = require('minimist')(process.argv.slice(2));
var formatTable = require('./format-table');
var glob = require('glob');
var filesToComparisonResults = require('./files-to-comparison-results');
var pattern = argv._.length > 1 ? '{' + argv._.slice(0).join(',') + '}' : argv._[0];
var fileList = glob.sync(pattern, { nodir: true });
//console.log(fileList);
filesToComparisonResults(fileList)
.then(function(comparisonResult) {
return formatTable(comparisonResult, { hideColumns: [], compareTo: 'json-stable-stringify@1.0.1' })
})
.then(function(str) {
console.log(str);
})
.catch(function(err) {
console.error(err);
});

View File

@@ -0,0 +1,705 @@
{
"name": "@swc/helpers",
"version": "0.5.23",
"description": "External helpers for the swc project.",
"module": "esm/index.js",
"main": "cjs/index.cjs",
"sideEffects": false,
"repository": {
"type": "git",
"url": "git+https://github.com/swc-project/swc.git",
"directory": "packages/helpers"
},
"publishConfig": {
"registry": "https://registry.npmjs.org/",
"access": "public"
},
"keywords": [
"swc",
"helpers"
],
"author": "강동윤 <kdy1997.dev@gmail.com>",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/swc-project/swc/issues"
},
"homepage": "https://swc.rs",
"type": "module",
"devDependencies": {
"@ast-grep/napi": "^0.40.3",
"dprint": "^0.35.3",
"zx": "^7.2.1"
},
"dependencies": {
"tslib": "^2.8.0"
},
"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"
},
"./_/_apply_decorated_descriptor": {
"module-sync": "./esm/_apply_decorated_descriptor.js",
"webpack": "./esm/_apply_decorated_descriptor.js",
"import": "./esm/_apply_decorated_descriptor.js",
"default": "./cjs/_apply_decorated_descriptor.cjs"
},
"./_/_apply_decs_2203_r": {
"module-sync": "./esm/_apply_decs_2203_r.js",
"webpack": "./esm/_apply_decs_2203_r.js",
"import": "./esm/_apply_decs_2203_r.js",
"default": "./cjs/_apply_decs_2203_r.cjs"
},
"./_/_apply_decs_2311": {
"module-sync": "./esm/_apply_decs_2311.js",
"webpack": "./esm/_apply_decs_2311.js",
"import": "./esm/_apply_decs_2311.js",
"default": "./cjs/_apply_decs_2311.cjs"
},
"./_/_array_like_to_array": {
"module-sync": "./esm/_array_like_to_array.js",
"webpack": "./esm/_array_like_to_array.js",
"import": "./esm/_array_like_to_array.js",
"default": "./cjs/_array_like_to_array.cjs"
},
"./_/_array_with_holes": {
"module-sync": "./esm/_array_with_holes.js",
"webpack": "./esm/_array_with_holes.js",
"import": "./esm/_array_with_holes.js",
"default": "./cjs/_array_with_holes.cjs"
},
"./_/_array_without_holes": {
"module-sync": "./esm/_array_without_holes.js",
"webpack": "./esm/_array_without_holes.js",
"import": "./esm/_array_without_holes.js",
"default": "./cjs/_array_without_holes.cjs"
},
"./_/_assert_this_initialized": {
"module-sync": "./esm/_assert_this_initialized.js",
"webpack": "./esm/_assert_this_initialized.js",
"import": "./esm/_assert_this_initialized.js",
"default": "./cjs/_assert_this_initialized.cjs"
},
"./_/_async_generator": {
"module-sync": "./esm/_async_generator.js",
"webpack": "./esm/_async_generator.js",
"import": "./esm/_async_generator.js",
"default": "./cjs/_async_generator.cjs"
},
"./_/_async_generator_delegate": {
"module-sync": "./esm/_async_generator_delegate.js",
"webpack": "./esm/_async_generator_delegate.js",
"import": "./esm/_async_generator_delegate.js",
"default": "./cjs/_async_generator_delegate.cjs"
},
"./_/_async_iterator": {
"module-sync": "./esm/_async_iterator.js",
"webpack": "./esm/_async_iterator.js",
"import": "./esm/_async_iterator.js",
"default": "./cjs/_async_iterator.cjs"
},
"./_/_async_to_generator": {
"module-sync": "./esm/_async_to_generator.js",
"webpack": "./esm/_async_to_generator.js",
"import": "./esm/_async_to_generator.js",
"default": "./cjs/_async_to_generator.cjs"
},
"./_/_await_async_generator": {
"module-sync": "./esm/_await_async_generator.js",
"webpack": "./esm/_await_async_generator.js",
"import": "./esm/_await_async_generator.js",
"default": "./cjs/_await_async_generator.cjs"
},
"./_/_await_value": {
"module-sync": "./esm/_await_value.js",
"webpack": "./esm/_await_value.js",
"import": "./esm/_await_value.js",
"default": "./cjs/_await_value.cjs"
},
"./_/_call_super": {
"module-sync": "./esm/_call_super.js",
"webpack": "./esm/_call_super.js",
"import": "./esm/_call_super.js",
"default": "./cjs/_call_super.cjs"
},
"./_/_check_private_redeclaration": {
"module-sync": "./esm/_check_private_redeclaration.js",
"webpack": "./esm/_check_private_redeclaration.js",
"import": "./esm/_check_private_redeclaration.js",
"default": "./cjs/_check_private_redeclaration.cjs"
},
"./_/_class_apply_descriptor_destructure": {
"module-sync": "./esm/_class_apply_descriptor_destructure.js",
"webpack": "./esm/_class_apply_descriptor_destructure.js",
"import": "./esm/_class_apply_descriptor_destructure.js",
"default": "./cjs/_class_apply_descriptor_destructure.cjs"
},
"./_/_class_apply_descriptor_get": {
"module-sync": "./esm/_class_apply_descriptor_get.js",
"webpack": "./esm/_class_apply_descriptor_get.js",
"import": "./esm/_class_apply_descriptor_get.js",
"default": "./cjs/_class_apply_descriptor_get.cjs"
},
"./_/_class_apply_descriptor_set": {
"module-sync": "./esm/_class_apply_descriptor_set.js",
"webpack": "./esm/_class_apply_descriptor_set.js",
"import": "./esm/_class_apply_descriptor_set.js",
"default": "./cjs/_class_apply_descriptor_set.cjs"
},
"./_/_class_apply_descriptor_update": {
"module-sync": "./esm/_class_apply_descriptor_update.js",
"webpack": "./esm/_class_apply_descriptor_update.js",
"import": "./esm/_class_apply_descriptor_update.js",
"default": "./cjs/_class_apply_descriptor_update.cjs"
},
"./_/_class_call_check": {
"module-sync": "./esm/_class_call_check.js",
"webpack": "./esm/_class_call_check.js",
"import": "./esm/_class_call_check.js",
"default": "./cjs/_class_call_check.cjs"
},
"./_/_class_check_private_static_access": {
"module-sync": "./esm/_class_check_private_static_access.js",
"webpack": "./esm/_class_check_private_static_access.js",
"import": "./esm/_class_check_private_static_access.js",
"default": "./cjs/_class_check_private_static_access.cjs"
},
"./_/_class_check_private_static_field_descriptor": {
"module-sync": "./esm/_class_check_private_static_field_descriptor.js",
"webpack": "./esm/_class_check_private_static_field_descriptor.js",
"import": "./esm/_class_check_private_static_field_descriptor.js",
"default": "./cjs/_class_check_private_static_field_descriptor.cjs"
},
"./_/_class_extract_field_descriptor": {
"module-sync": "./esm/_class_extract_field_descriptor.js",
"webpack": "./esm/_class_extract_field_descriptor.js",
"import": "./esm/_class_extract_field_descriptor.js",
"default": "./cjs/_class_extract_field_descriptor.cjs"
},
"./_/_class_name_tdz_error": {
"module-sync": "./esm/_class_name_tdz_error.js",
"webpack": "./esm/_class_name_tdz_error.js",
"import": "./esm/_class_name_tdz_error.js",
"default": "./cjs/_class_name_tdz_error.cjs"
},
"./_/_class_private_field_destructure": {
"module-sync": "./esm/_class_private_field_destructure.js",
"webpack": "./esm/_class_private_field_destructure.js",
"import": "./esm/_class_private_field_destructure.js",
"default": "./cjs/_class_private_field_destructure.cjs"
},
"./_/_class_private_field_get": {
"module-sync": "./esm/_class_private_field_get.js",
"webpack": "./esm/_class_private_field_get.js",
"import": "./esm/_class_private_field_get.js",
"default": "./cjs/_class_private_field_get.cjs"
},
"./_/_class_private_field_init": {
"module-sync": "./esm/_class_private_field_init.js",
"webpack": "./esm/_class_private_field_init.js",
"import": "./esm/_class_private_field_init.js",
"default": "./cjs/_class_private_field_init.cjs"
},
"./_/_class_private_field_loose_base": {
"module-sync": "./esm/_class_private_field_loose_base.js",
"webpack": "./esm/_class_private_field_loose_base.js",
"import": "./esm/_class_private_field_loose_base.js",
"default": "./cjs/_class_private_field_loose_base.cjs"
},
"./_/_class_private_field_loose_key": {
"module-sync": "./esm/_class_private_field_loose_key.js",
"webpack": "./esm/_class_private_field_loose_key.js",
"import": "./esm/_class_private_field_loose_key.js",
"default": "./cjs/_class_private_field_loose_key.cjs"
},
"./_/_class_private_field_set": {
"module-sync": "./esm/_class_private_field_set.js",
"webpack": "./esm/_class_private_field_set.js",
"import": "./esm/_class_private_field_set.js",
"default": "./cjs/_class_private_field_set.cjs"
},
"./_/_class_private_field_update": {
"module-sync": "./esm/_class_private_field_update.js",
"webpack": "./esm/_class_private_field_update.js",
"import": "./esm/_class_private_field_update.js",
"default": "./cjs/_class_private_field_update.cjs"
},
"./_/_class_private_method_get": {
"module-sync": "./esm/_class_private_method_get.js",
"webpack": "./esm/_class_private_method_get.js",
"import": "./esm/_class_private_method_get.js",
"default": "./cjs/_class_private_method_get.cjs"
},
"./_/_class_private_method_init": {
"module-sync": "./esm/_class_private_method_init.js",
"webpack": "./esm/_class_private_method_init.js",
"import": "./esm/_class_private_method_init.js",
"default": "./cjs/_class_private_method_init.cjs"
},
"./_/_class_private_method_set": {
"module-sync": "./esm/_class_private_method_set.js",
"webpack": "./esm/_class_private_method_set.js",
"import": "./esm/_class_private_method_set.js",
"default": "./cjs/_class_private_method_set.cjs"
},
"./_/_class_static_private_field_destructure": {
"module-sync": "./esm/_class_static_private_field_destructure.js",
"webpack": "./esm/_class_static_private_field_destructure.js",
"import": "./esm/_class_static_private_field_destructure.js",
"default": "./cjs/_class_static_private_field_destructure.cjs"
},
"./_/_class_static_private_field_spec_get": {
"module-sync": "./esm/_class_static_private_field_spec_get.js",
"webpack": "./esm/_class_static_private_field_spec_get.js",
"import": "./esm/_class_static_private_field_spec_get.js",
"default": "./cjs/_class_static_private_field_spec_get.cjs"
},
"./_/_class_static_private_field_spec_set": {
"module-sync": "./esm/_class_static_private_field_spec_set.js",
"webpack": "./esm/_class_static_private_field_spec_set.js",
"import": "./esm/_class_static_private_field_spec_set.js",
"default": "./cjs/_class_static_private_field_spec_set.cjs"
},
"./_/_class_static_private_field_update": {
"module-sync": "./esm/_class_static_private_field_update.js",
"webpack": "./esm/_class_static_private_field_update.js",
"import": "./esm/_class_static_private_field_update.js",
"default": "./cjs/_class_static_private_field_update.cjs"
},
"./_/_class_static_private_method_get": {
"module-sync": "./esm/_class_static_private_method_get.js",
"webpack": "./esm/_class_static_private_method_get.js",
"import": "./esm/_class_static_private_method_get.js",
"default": "./cjs/_class_static_private_method_get.cjs"
},
"./_/_construct": {
"module-sync": "./esm/_construct.js",
"webpack": "./esm/_construct.js",
"import": "./esm/_construct.js",
"default": "./cjs/_construct.cjs"
},
"./_/_create_class": {
"module-sync": "./esm/_create_class.js",
"webpack": "./esm/_create_class.js",
"import": "./esm/_create_class.js",
"default": "./cjs/_create_class.cjs"
},
"./_/_create_for_of_iterator_helper_loose": {
"module-sync": "./esm/_create_for_of_iterator_helper_loose.js",
"webpack": "./esm/_create_for_of_iterator_helper_loose.js",
"import": "./esm/_create_for_of_iterator_helper_loose.js",
"default": "./cjs/_create_for_of_iterator_helper_loose.cjs"
},
"./_/_create_super": {
"module-sync": "./esm/_create_super.js",
"webpack": "./esm/_create_super.js",
"import": "./esm/_create_super.js",
"default": "./cjs/_create_super.cjs"
},
"./_/_decorate": {
"module-sync": "./esm/_decorate.js",
"webpack": "./esm/_decorate.js",
"import": "./esm/_decorate.js",
"default": "./cjs/_decorate.cjs"
},
"./_/_defaults": {
"module-sync": "./esm/_defaults.js",
"webpack": "./esm/_defaults.js",
"import": "./esm/_defaults.js",
"default": "./cjs/_defaults.cjs"
},
"./_/_define_enumerable_properties": {
"module-sync": "./esm/_define_enumerable_properties.js",
"webpack": "./esm/_define_enumerable_properties.js",
"import": "./esm/_define_enumerable_properties.js",
"default": "./cjs/_define_enumerable_properties.cjs"
},
"./_/_define_property": {
"module-sync": "./esm/_define_property.js",
"webpack": "./esm/_define_property.js",
"import": "./esm/_define_property.js",
"default": "./cjs/_define_property.cjs"
},
"./_/_dispose": {
"module-sync": "./esm/_dispose.js",
"webpack": "./esm/_dispose.js",
"import": "./esm/_dispose.js",
"default": "./cjs/_dispose.cjs"
},
"./_/_export_star": {
"module-sync": "./esm/_export_star.js",
"webpack": "./esm/_export_star.js",
"import": "./esm/_export_star.js",
"default": "./cjs/_export_star.cjs"
},
"./_/_extends": {
"module-sync": "./esm/_extends.js",
"webpack": "./esm/_extends.js",
"import": "./esm/_extends.js",
"default": "./cjs/_extends.cjs"
},
"./_/_get": {
"module-sync": "./esm/_get.js",
"webpack": "./esm/_get.js",
"import": "./esm/_get.js",
"default": "./cjs/_get.cjs"
},
"./_/_get_prototype_of": {
"module-sync": "./esm/_get_prototype_of.js",
"webpack": "./esm/_get_prototype_of.js",
"import": "./esm/_get_prototype_of.js",
"default": "./cjs/_get_prototype_of.cjs"
},
"./_/_identity": {
"module-sync": "./esm/_identity.js",
"webpack": "./esm/_identity.js",
"import": "./esm/_identity.js",
"default": "./cjs/_identity.cjs"
},
"./_/_inherits": {
"module-sync": "./esm/_inherits.js",
"webpack": "./esm/_inherits.js",
"import": "./esm/_inherits.js",
"default": "./cjs/_inherits.cjs"
},
"./_/_inherits_loose": {
"module-sync": "./esm/_inherits_loose.js",
"webpack": "./esm/_inherits_loose.js",
"import": "./esm/_inherits_loose.js",
"default": "./cjs/_inherits_loose.cjs"
},
"./_/_initializer_define_property": {
"module-sync": "./esm/_initializer_define_property.js",
"webpack": "./esm/_initializer_define_property.js",
"import": "./esm/_initializer_define_property.js",
"default": "./cjs/_initializer_define_property.cjs"
},
"./_/_initializer_warning_helper": {
"module-sync": "./esm/_initializer_warning_helper.js",
"webpack": "./esm/_initializer_warning_helper.js",
"import": "./esm/_initializer_warning_helper.js",
"default": "./cjs/_initializer_warning_helper.cjs"
},
"./_/_instanceof": {
"module-sync": "./esm/_instanceof.js",
"webpack": "./esm/_instanceof.js",
"import": "./esm/_instanceof.js",
"default": "./cjs/_instanceof.cjs"
},
"./_/_interop_require_default": {
"module-sync": "./esm/_interop_require_default.js",
"webpack": "./esm/_interop_require_default.js",
"import": "./esm/_interop_require_default.js",
"default": "./cjs/_interop_require_default.cjs"
},
"./_/_interop_require_wildcard": {
"module-sync": "./esm/_interop_require_wildcard.js",
"webpack": "./esm/_interop_require_wildcard.js",
"import": "./esm/_interop_require_wildcard.js",
"default": "./cjs/_interop_require_wildcard.cjs"
},
"./_/_is_native_function": {
"module-sync": "./esm/_is_native_function.js",
"webpack": "./esm/_is_native_function.js",
"import": "./esm/_is_native_function.js",
"default": "./cjs/_is_native_function.cjs"
},
"./_/_is_native_reflect_construct": {
"module-sync": "./esm/_is_native_reflect_construct.js",
"webpack": "./esm/_is_native_reflect_construct.js",
"import": "./esm/_is_native_reflect_construct.js",
"default": "./cjs/_is_native_reflect_construct.cjs"
},
"./_/_iterable_to_array": {
"module-sync": "./esm/_iterable_to_array.js",
"webpack": "./esm/_iterable_to_array.js",
"import": "./esm/_iterable_to_array.js",
"default": "./cjs/_iterable_to_array.cjs"
},
"./_/_iterable_to_array_limit": {
"module-sync": "./esm/_iterable_to_array_limit.js",
"webpack": "./esm/_iterable_to_array_limit.js",
"import": "./esm/_iterable_to_array_limit.js",
"default": "./cjs/_iterable_to_array_limit.cjs"
},
"./_/_iterable_to_array_limit_loose": {
"module-sync": "./esm/_iterable_to_array_limit_loose.js",
"webpack": "./esm/_iterable_to_array_limit_loose.js",
"import": "./esm/_iterable_to_array_limit_loose.js",
"default": "./cjs/_iterable_to_array_limit_loose.cjs"
},
"./_/_jsx": {
"module-sync": "./esm/_jsx.js",
"webpack": "./esm/_jsx.js",
"import": "./esm/_jsx.js",
"default": "./cjs/_jsx.cjs"
},
"./_/_new_arrow_check": {
"module-sync": "./esm/_new_arrow_check.js",
"webpack": "./esm/_new_arrow_check.js",
"import": "./esm/_new_arrow_check.js",
"default": "./cjs/_new_arrow_check.cjs"
},
"./_/_non_iterable_rest": {
"module-sync": "./esm/_non_iterable_rest.js",
"webpack": "./esm/_non_iterable_rest.js",
"import": "./esm/_non_iterable_rest.js",
"default": "./cjs/_non_iterable_rest.cjs"
},
"./_/_non_iterable_spread": {
"module-sync": "./esm/_non_iterable_spread.js",
"webpack": "./esm/_non_iterable_spread.js",
"import": "./esm/_non_iterable_spread.js",
"default": "./cjs/_non_iterable_spread.cjs"
},
"./_/_object_destructuring_empty": {
"module-sync": "./esm/_object_destructuring_empty.js",
"webpack": "./esm/_object_destructuring_empty.js",
"import": "./esm/_object_destructuring_empty.js",
"default": "./cjs/_object_destructuring_empty.cjs"
},
"./_/_object_spread": {
"module-sync": "./esm/_object_spread.js",
"webpack": "./esm/_object_spread.js",
"import": "./esm/_object_spread.js",
"default": "./cjs/_object_spread.cjs"
},
"./_/_object_spread_props": {
"module-sync": "./esm/_object_spread_props.js",
"webpack": "./esm/_object_spread_props.js",
"import": "./esm/_object_spread_props.js",
"default": "./cjs/_object_spread_props.cjs"
},
"./_/_object_without_properties": {
"module-sync": "./esm/_object_without_properties.js",
"webpack": "./esm/_object_without_properties.js",
"import": "./esm/_object_without_properties.js",
"default": "./cjs/_object_without_properties.cjs"
},
"./_/_object_without_properties_loose": {
"module-sync": "./esm/_object_without_properties_loose.js",
"webpack": "./esm/_object_without_properties_loose.js",
"import": "./esm/_object_without_properties_loose.js",
"default": "./cjs/_object_without_properties_loose.cjs"
},
"./_/_overload_yield": {
"module-sync": "./esm/_overload_yield.js",
"webpack": "./esm/_overload_yield.js",
"import": "./esm/_overload_yield.js",
"default": "./cjs/_overload_yield.cjs"
},
"./_/_possible_constructor_return": {
"module-sync": "./esm/_possible_constructor_return.js",
"webpack": "./esm/_possible_constructor_return.js",
"import": "./esm/_possible_constructor_return.js",
"default": "./cjs/_possible_constructor_return.cjs"
},
"./_/_read_only_error": {
"module-sync": "./esm/_read_only_error.js",
"webpack": "./esm/_read_only_error.js",
"import": "./esm/_read_only_error.js",
"default": "./cjs/_read_only_error.cjs"
},
"./_/_set": {
"module-sync": "./esm/_set.js",
"webpack": "./esm/_set.js",
"import": "./esm/_set.js",
"default": "./cjs/_set.cjs"
},
"./_/_set_prototype_of": {
"module-sync": "./esm/_set_prototype_of.js",
"webpack": "./esm/_set_prototype_of.js",
"import": "./esm/_set_prototype_of.js",
"default": "./cjs/_set_prototype_of.cjs"
},
"./_/_skip_first_generator_next": {
"module-sync": "./esm/_skip_first_generator_next.js",
"webpack": "./esm/_skip_first_generator_next.js",
"import": "./esm/_skip_first_generator_next.js",
"default": "./cjs/_skip_first_generator_next.cjs"
},
"./_/_sliced_to_array": {
"module-sync": "./esm/_sliced_to_array.js",
"webpack": "./esm/_sliced_to_array.js",
"import": "./esm/_sliced_to_array.js",
"default": "./cjs/_sliced_to_array.cjs"
},
"./_/_sliced_to_array_loose": {
"module-sync": "./esm/_sliced_to_array_loose.js",
"webpack": "./esm/_sliced_to_array_loose.js",
"import": "./esm/_sliced_to_array_loose.js",
"default": "./cjs/_sliced_to_array_loose.cjs"
},
"./_/_super_prop_base": {
"module-sync": "./esm/_super_prop_base.js",
"webpack": "./esm/_super_prop_base.js",
"import": "./esm/_super_prop_base.js",
"default": "./cjs/_super_prop_base.cjs"
},
"./_/_tagged_template_literal": {
"module-sync": "./esm/_tagged_template_literal.js",
"webpack": "./esm/_tagged_template_literal.js",
"import": "./esm/_tagged_template_literal.js",
"default": "./cjs/_tagged_template_literal.cjs"
},
"./_/_tagged_template_literal_loose": {
"module-sync": "./esm/_tagged_template_literal_loose.js",
"webpack": "./esm/_tagged_template_literal_loose.js",
"import": "./esm/_tagged_template_literal_loose.js",
"default": "./cjs/_tagged_template_literal_loose.cjs"
},
"./_/_throw": {
"module-sync": "./esm/_throw.js",
"webpack": "./esm/_throw.js",
"import": "./esm/_throw.js",
"default": "./cjs/_throw.cjs"
},
"./_/_to_array": {
"module-sync": "./esm/_to_array.js",
"webpack": "./esm/_to_array.js",
"import": "./esm/_to_array.js",
"default": "./cjs/_to_array.cjs"
},
"./_/_to_consumable_array": {
"module-sync": "./esm/_to_consumable_array.js",
"webpack": "./esm/_to_consumable_array.js",
"import": "./esm/_to_consumable_array.js",
"default": "./cjs/_to_consumable_array.cjs"
},
"./_/_to_primitive": {
"module-sync": "./esm/_to_primitive.js",
"webpack": "./esm/_to_primitive.js",
"import": "./esm/_to_primitive.js",
"default": "./cjs/_to_primitive.cjs"
},
"./_/_to_property_key": {
"module-sync": "./esm/_to_property_key.js",
"webpack": "./esm/_to_property_key.js",
"import": "./esm/_to_property_key.js",
"default": "./cjs/_to_property_key.cjs"
},
"./_/_ts_add_disposable_resource": {
"module-sync": "./esm/_ts_add_disposable_resource.js",
"webpack": "./esm/_ts_add_disposable_resource.js",
"import": "./esm/_ts_add_disposable_resource.js",
"default": "./cjs/_ts_add_disposable_resource.cjs"
},
"./_/_ts_decorate": {
"module-sync": "./esm/_ts_decorate.js",
"webpack": "./esm/_ts_decorate.js",
"import": "./esm/_ts_decorate.js",
"default": "./cjs/_ts_decorate.cjs"
},
"./_/_ts_dispose_resources": {
"module-sync": "./esm/_ts_dispose_resources.js",
"webpack": "./esm/_ts_dispose_resources.js",
"import": "./esm/_ts_dispose_resources.js",
"default": "./cjs/_ts_dispose_resources.cjs"
},
"./_/_ts_generator": {
"module-sync": "./esm/_ts_generator.js",
"webpack": "./esm/_ts_generator.js",
"import": "./esm/_ts_generator.js",
"default": "./cjs/_ts_generator.cjs"
},
"./_/_ts_metadata": {
"module-sync": "./esm/_ts_metadata.js",
"webpack": "./esm/_ts_metadata.js",
"import": "./esm/_ts_metadata.js",
"default": "./cjs/_ts_metadata.cjs"
},
"./_/_ts_param": {
"module-sync": "./esm/_ts_param.js",
"webpack": "./esm/_ts_param.js",
"import": "./esm/_ts_param.js",
"default": "./cjs/_ts_param.cjs"
},
"./_/_ts_rewrite_relative_import_extension": {
"module-sync": "./esm/_ts_rewrite_relative_import_extension.js",
"webpack": "./esm/_ts_rewrite_relative_import_extension.js",
"import": "./esm/_ts_rewrite_relative_import_extension.js",
"default": "./cjs/_ts_rewrite_relative_import_extension.cjs"
},
"./_/_ts_values": {
"module-sync": "./esm/_ts_values.js",
"webpack": "./esm/_ts_values.js",
"import": "./esm/_ts_values.js",
"default": "./cjs/_ts_values.cjs"
},
"./_/_type_of": {
"module-sync": "./esm/_type_of.js",
"webpack": "./esm/_type_of.js",
"import": "./esm/_type_of.js",
"default": "./cjs/_type_of.cjs"
},
"./_/_unsupported_iterable_to_array": {
"module-sync": "./esm/_unsupported_iterable_to_array.js",
"webpack": "./esm/_unsupported_iterable_to_array.js",
"import": "./esm/_unsupported_iterable_to_array.js",
"default": "./cjs/_unsupported_iterable_to_array.cjs"
},
"./_/_update": {
"module-sync": "./esm/_update.js",
"webpack": "./esm/_update.js",
"import": "./esm/_update.js",
"default": "./cjs/_update.cjs"
},
"./_/_using": {
"module-sync": "./esm/_using.js",
"webpack": "./esm/_using.js",
"import": "./esm/_using.js",
"default": "./cjs/_using.cjs"
},
"./_/_using_ctx": {
"module-sync": "./esm/_using_ctx.js",
"webpack": "./esm/_using_ctx.js",
"import": "./esm/_using_ctx.js",
"default": "./cjs/_using_ctx.cjs"
},
"./_/_wrap_async_generator": {
"module-sync": "./esm/_wrap_async_generator.js",
"webpack": "./esm/_wrap_async_generator.js",
"import": "./esm/_wrap_async_generator.js",
"default": "./cjs/_wrap_async_generator.cjs"
},
"./_/_wrap_native_super": {
"module-sync": "./esm/_wrap_native_super.js",
"webpack": "./esm/_wrap_native_super.js",
"import": "./esm/_wrap_native_super.js",
"default": "./cjs/_wrap_native_super.cjs"
},
"./_/_wrap_reg_exp": {
"module-sync": "./esm/_wrap_reg_exp.js",
"webpack": "./esm/_wrap_reg_exp.js",
"import": "./esm/_wrap_reg_exp.js",
"default": "./cjs/_wrap_reg_exp.cjs"
},
"./_/_write_only_error": {
"module-sync": "./esm/_write_only_error.js",
"webpack": "./esm/_write_only_error.js",
"import": "./esm/_write_only_error.js",
"default": "./cjs/_write_only_error.cjs"
},
"./_/index": {
"module-sync": "./esm/index.js",
"webpack": "./esm/index.js",
"import": "./esm/index.js",
"default": "./cjs/index.cjs"
}
},
"scripts": {
"build": "zx ./scripts/build.js"
}
}

View File

@@ -0,0 +1,66 @@
declare module 'tty' {
import * as net from 'net';
function isatty(fd: number): boolean;
class ReadStream extends net.Socket {
constructor(fd: number, options?: net.SocketConstructorOpts);
isRaw: boolean;
setRawMode(mode: boolean): this;
isTTY: boolean;
}
/**
* -1 - to the left from cursor
* 0 - the entire line
* 1 - to the right from cursor
*/
type Direction = -1 | 0 | 1;
class WriteStream extends net.Socket {
constructor(fd: number);
addListener(event: string, listener: (...args: any[]) => void): this;
addListener(event: "resize", listener: () => void): this;
emit(event: string | symbol, ...args: any[]): boolean;
emit(event: "resize"): boolean;
on(event: string, listener: (...args: any[]) => void): this;
on(event: "resize", listener: () => void): this;
once(event: string, listener: (...args: any[]) => void): this;
once(event: "resize", listener: () => void): this;
prependListener(event: string, listener: (...args: any[]) => void): this;
prependListener(event: "resize", listener: () => void): this;
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
prependOnceListener(event: "resize", listener: () => void): this;
/**
* Clears the current line of this WriteStream in a direction identified by `dir`.
*/
clearLine(dir: Direction, callback?: () => void): boolean;
/**
* Clears this `WriteStream` from the current cursor down.
*/
clearScreenDown(callback?: () => void): boolean;
/**
* Moves this WriteStream's cursor to the specified position.
*/
cursorTo(x: number, y?: number, callback?: () => void): boolean;
cursorTo(x: number, callback: () => void): boolean;
/**
* Moves this WriteStream's cursor relative to its current position.
*/
moveCursor(dx: number, dy: number, callback?: () => void): boolean;
/**
* @default `process.env`
*/
getColorDepth(env?: {}): number;
hasColors(depth?: number): boolean;
hasColors(env?: {}): boolean;
hasColors(depth: number, env?: {}): boolean;
getWindowSize(): [number, number];
columns: number;
rows: number;
isTTY: boolean;
}
}