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,16 @@
declare module 'domain' {
import EventEmitter = require('events');
class Domain extends EventEmitter implements NodeJS.Domain {
run<T>(fn: (...args: any[]) => T, ...args: any[]): T;
add(emitter: EventEmitter | NodeJS.Timer): void;
remove(emitter: EventEmitter | NodeJS.Timer): void;
bind<T extends Function>(cb: T): T;
intercept<T extends Function>(cb: T): T;
members: Array<EventEmitter | NodeJS.Timer>;
enter(): void;
exit(): void;
}
function create(): Domain;
}

View File

@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CatchScope = void 0;
const ScopeBase_1 = require("./ScopeBase");
const ScopeType_1 = require("./ScopeType");
class CatchScope extends ScopeBase_1.ScopeBase {
constructor(scopeManager, upperScope, block) {
super(scopeManager, ScopeType_1.ScopeType.catch, upperScope, block, false);
}
}
exports.CatchScope = CatchScope;

View File

@@ -0,0 +1,134 @@
"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 (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.default = default_1;
const util = __importStar(require("../core/util.cjs"));
const error = () => {
const Sizable = {
string: { unit: "caractères", verb: "avoir" },
file: { unit: "octets", verb: "avoir" },
array: { unit: "éléments", verb: "avoir" },
set: { unit: "éléments", verb: "avoir" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const FormatDictionary = {
regex: "entrée",
email: "adresse courriel",
url: "URL",
emoji: "emoji",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "date-heure ISO",
date: "date ISO",
time: "heure ISO",
duration: "durée ISO",
ipv4: "adresse IPv4",
ipv6: "adresse IPv6",
cidrv4: "plage IPv4",
cidrv6: "plage IPv6",
base64: "chaîne encodée en base64",
base64url: "chaîne encodée en base64url",
json_string: "chaîne JSON",
e164: "numéro E.164",
jwt: "JWT",
template_literal: "entrée",
};
const TypeDictionary = {
nan: "NaN",
};
return (issue) => {
switch (issue.code) {
case "invalid_type": {
const expected = TypeDictionary[issue.expected] ?? issue.expected;
const receivedType = util.parsedType(issue.input);
const received = TypeDictionary[receivedType] ?? receivedType;
if (/^[A-Z]/.test(issue.expected)) {
return `Entrée invalide : attendu instanceof ${issue.expected}, reçu ${received}`;
}
return `Entrée invalide : attendu ${expected}, reçu ${received}`;
}
case "invalid_value":
if (issue.values.length === 1)
return `Entrée invalide : attendu ${util.stringifyPrimitive(issue.values[0])}`;
return `Option invalide : attendu l'une des valeurs suivantes ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "≤" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return `Trop grand : attendu que ${issue.origin ?? "la valeur"} ait ${adj}${issue.maximum.toString()} ${sizing.unit}`;
return `Trop grand : attendu que ${issue.origin ?? "la valeur"} soit ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? "≥" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `Trop petit : attendu que ${issue.origin} ait ${adj}${issue.minimum.toString()} ${sizing.unit}`;
}
return `Trop petit : attendu que ${issue.origin} soit ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with") {
return `Chaîne invalide : doit commencer par "${_issue.prefix}"`;
}
if (_issue.format === "ends_with")
return `Chaîne invalide : doit se terminer par "${_issue.suffix}"`;
if (_issue.format === "includes")
return `Chaîne invalide : doit inclure "${_issue.includes}"`;
if (_issue.format === "regex")
return `Chaîne invalide : doit correspondre au motif ${_issue.pattern}`;
return `${FormatDictionary[_issue.format] ?? issue.format} invalide`;
}
case "not_multiple_of":
return `Nombre invalide : doit être un multiple de ${issue.divisor}`;
case "unrecognized_keys":
return `Clé${issue.keys.length > 1 ? "s" : ""} non reconnue${issue.keys.length > 1 ? "s" : ""} : ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Clé invalide dans ${issue.origin}`;
case "invalid_union":
return "Entrée invalide";
case "invalid_element":
return `Valeur invalide dans ${issue.origin}`;
default:
return `Entrée invalide`;
}
};
};
function default_1() {
return {
localeError: error(),
};
}
module.exports = exports.default;

View File

@@ -0,0 +1,6 @@
//#region src/utils/define-config.ts
function defineConfig(config) {
return config;
}
//#endregion
export { defineConfig as t };

View File

@@ -0,0 +1,69 @@
// Generated by LiveScript 1.6.0
var apply, curry, flip, fix, over, memoize, toString$ = {}.toString;
apply = curry$(function(f, list){
return f.apply(null, list);
});
curry = function(f){
return curry$(f);
};
flip = curry$(function(f, x, y){
return f(y, x);
});
fix = function(f){
return function(g){
return function(){
return f(g(g)).apply(null, arguments);
};
}(function(g){
return function(){
return f(g(g)).apply(null, arguments);
};
});
};
over = curry$(function(f, g, x, y){
return f(g(x), g(y));
});
memoize = function(f){
var memo;
memo = {};
return function(){
var args, res$, i$, to$, key, arg;
res$ = [];
for (i$ = 0, to$ = arguments.length; i$ < to$; ++i$) {
res$.push(arguments[i$]);
}
args = res$;
key = (function(){
var i$, ref$, len$, results$ = [];
for (i$ = 0, len$ = (ref$ = args).length; i$ < len$; ++i$) {
arg = ref$[i$];
results$.push(arg + toString$.call(arg).slice(8, -1));
}
return results$;
}()).join('');
return memo[key] = key in memo
? memo[key]
: f.apply(null, args);
};
};
module.exports = {
curry: curry,
flip: flip,
fix: fix,
apply: apply,
over: over,
memoize: memoize
};
function curry$(f, bound){
var context,
_curry = function(args) {
return f.length > 1 ? function(){
var params = args ? args.concat() : [];
context = bound ? context || this : this;
return params.push.apply(params, arguments) <
f.length && arguments.length ?
_curry.call(context, params) : f.apply(context, params);
} : f;
};
return _curry();
}

View File

@@ -0,0 +1 @@
export declare function escapeRegExp(string?: string): string;

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_symbol = void 0;
const base_config_1 = require("./base-config");
exports.esnext_symbol = {
libs: [],
variables: [['Symbol', base_config_1.TYPE]],
};

View File

@@ -0,0 +1,381 @@
import type { Linter } from '../Linter';
import type { RuleMetaData } from '../Rule';
export declare class ESLintBase<Config extends Linter.ConfigType, Options extends ESLintOptions<Config>> {
/**
* Creates a new instance of the main ESLint API.
* @param options The options for this instance.
*/
constructor(options?: Options);
/**
* This method calculates the configuration for a given file, which can be useful for debugging purposes.
* - It resolves and merges extends and overrides settings into the top level configuration.
* - It resolves the parser setting to absolute paths.
* - It normalizes the plugins setting to align short names. (e.g., eslint-plugin-foo → foo)
* - It adds the processor setting if a legacy file extension processor is matched.
* - It doesn't interpret the env setting to the globals and parserOptions settings, so the result object contains
* the env setting as is.
* @param filePath The path to the file whose configuration you would like to calculate. Directory paths are forbidden
* because ESLint cannot handle the overrides setting.
* @returns The promise that will be fulfilled with a configuration object.
*/
calculateConfigForFile(filePath: string): Promise<Config>;
getRulesMetaForResults(results: LintResult[]): Record<string, RuleMetaData<string, Record<string, unknown>>>;
/**
* This method checks if a given file is ignored by your configuration.
* @param filePath The path to the file you want to check.
* @returns The promise that will be fulfilled with whether the file is ignored or not. If the file is ignored, then
* it will return true.
*/
isPathIgnored(filePath: string): Promise<boolean>;
/**
* This method lints the files that match the glob patterns and then returns the results.
* @param patterns The lint target files. This can contain any of file paths, directory paths, and glob patterns.
* @returns The promise that will be fulfilled with an array of LintResult objects.
*/
lintFiles(patterns: string | string[]): Promise<LintResult[]>;
/**
* This method lints the given source code text and then returns the results.
*
* By default, this method uses the configuration that applies to files in the current working directory (the cwd
* constructor option). If you want to use a different configuration, pass options.filePath, and ESLint will load the
* same configuration that eslint.lintFiles() would use for a file at options.filePath.
*
* If the options.filePath value is configured to be ignored, this method returns an empty array. If the
* options.warnIgnored option is set along with the options.filePath option, this method returns a LintResult object.
* In that case, the result may contain a warning that indicates the file was ignored.
* @param code The source code text to check.
* @returns The promise that will be fulfilled with an array of LintResult objects. This is an array (despite there
* being only one lint result) in order to keep the interfaces between this and the eslint.lintFiles()
* method similar.
*/
lintText(code: string, options?: LintTextOptions): Promise<LintResult[]>;
/**
* This method loads a formatter. Formatters convert lint results to a human- or machine-readable string.
* @param name TThe path to the file you want to check.
* The following values are allowed:
* - undefined. In this case, loads the "stylish" built-in formatter.
* - A name of built-in formatters.
* - A name of third-party formatters. For examples:
* -- `foo` will load eslint-formatter-foo.
* -- `@foo` will load `@foo/eslint-formatter`.
* -- `@foo/bar` will load `@foo/eslint-formatter-bar`.
* - A path to the file that defines a formatter. The path must contain one or more path separators (/) in order to distinguish if it's a path or not. For example, start with ./.
* @returns The promise that will be fulfilled with a Formatter object.
*/
loadFormatter(name?: string): Promise<Formatter>;
/**
* This method copies the given results and removes warnings. The returned value contains only errors.
* @param results The LintResult objects to filter.
* @returns The filtered LintResult objects.
*/
static getErrorResults(results: LintResult): LintResult;
/**
* This method writes code modified by ESLint's autofix feature into its respective file. If any of the modified
* files don't exist, this method does nothing.
* @param results The LintResult objects to write.
* @returns The promise that will be fulfilled after all files are written.
*/
static outputFixes(results: LintResult[]): Promise<void>;
/**
* The version text.
*/
static readonly version: string;
/**
* The type of configuration used by this class.
*/
static readonly configType: Linter.ConfigTypeSpecifier;
}
export interface ESLintOptions<Config extends Linter.ConfigType> {
/**
* If false is present, ESLint suppresses comment directives in source code.
* If this option is false, it overrides the noInlineConfig setting in your configurations.
* @default true
*/
allowInlineConfig?: boolean;
/**
* Configuration object, extended by all configurations used with this instance.
* You can use this option to define the default settings that will be used if your configuration files don't
* configure it.
* @default null
*/
baseConfig?: Config | null;
/**
* If `true` is present, the `eslint.lintFiles()` method caches lint results and uses it if each target file is not
* changed. Please mind that ESLint doesn't clear the cache when you upgrade ESLint plugins. In that case, you have
* to remove the cache file manually. The `eslint.lintText()` method doesn't use caches even if you pass the
* options.filePath to the method.
* @default false
*/
cache?: boolean;
/**
* The eslint.lintFiles() method writes caches into this file.
* @default '.eslintcache'
*/
cacheLocation?: string;
/**
* Strategy for the cache to use for detecting changed files.
* @default 'metadata'
*/
cacheStrategy?: 'content' | 'metadata';
/**
* The working directory. This must be an absolute path.
* @default process.cwd()
*/
cwd?: string;
/**
* Unless set to false, the `eslint.lintFiles()` method will throw an error when no target files are found.
* @default true
*/
errorOnUnmatchedPattern?: boolean;
/**
* If `true` is present, the `eslint.lintFiles()` and `eslint.lintText()` methods work in autofix mode.
* If a predicate function is present, the methods pass each lint message to the function, then use only the
* lint messages for which the function returned true.
* @default false
*/
fix?: boolean | ((message: LintMessage) => boolean);
/**
* The types of the rules that the `eslint.lintFiles()` and `eslint.lintText()` methods use for autofix.
* @default null
*/
fixTypes?: ('directive' | 'problem' | 'suggestion')[] | null;
/**
* If false is present, the `eslint.lintFiles()` method doesn't interpret glob patterns.
* @default true
*/
globInputPaths?: boolean;
/**
* Configuration object, overrides all configurations used with this instance.
* You can use this option to define the settings that will be used even if your configuration files configure it.
* @default null
*/
overrideConfig?: Config | null;
/**
* When set to true, missing patterns cause the linting operation to short circuit and not report any failures.
* @default false
*/
passOnNoPatterns?: boolean;
/**
* The plugin implementations that ESLint uses for the plugins setting of your configuration.
* This is a map-like object. Those keys are plugin IDs and each value is implementation.
* @default null
*/
plugins?: Record<string, Linter.Plugin> | null;
}
export interface DeprecatedRuleInfo {
/**
* The rule IDs that replace this deprecated rule.
*/
replacedBy: string[];
/**
* The rule ID.
*/
ruleId: string;
}
/**
* The LintResult value is the information of the linting result of each file.
*/
export interface LintResult {
/**
* The number of errors. This includes fixable errors.
*/
errorCount: number;
/**
* The number of fatal errors.
*/
fatalErrorCount: number;
/**
* The absolute path to the file of this result. This is the string "<text>" if the file path is unknown (when you
* didn't pass the options.filePath option to the eslint.lintText() method).
*/
filePath: string;
/**
* The number of errors that can be fixed automatically by the fix constructor option.
*/
fixableErrorCount: number;
/**
* The number of warnings that can be fixed automatically by the fix constructor option.
*/
fixableWarningCount: number;
/**
* The array of LintMessage objects.
*/
messages: LintMessage[];
/**
* The source code of the file that was linted, with as many fixes applied as possible.
*/
output?: string;
/**
* The original source code text. This property is undefined if any messages didn't exist or the output
* property exists.
*/
source?: string;
/**
* Timing information of the lint run.
* This exists if and only if the `--stats` CLI flag was added or the `stats: true`
* option was passed to the ESLint class
* @since 9.0.0
*/
stats?: LintStats;
/**
* The array of SuppressedLintMessage objects.
*/
suppressedMessages: SuppressedLintMessage[];
/**
* The information about the deprecated rules that were used to check this file.
*/
usedDeprecatedRules: DeprecatedRuleInfo[];
/**
* The number of warnings. This includes fixable warnings.
*/
warningCount: number;
}
export interface LintStats {
/**
* The number of times ESLint has applied at least one fix after linting.
*/
fixPasses: number;
/**
* The times spent on (parsing, fixing, linting) a file, where the linting refers to the timing information for each rule.
*/
times: {
passes: LintStatsTimePass[];
};
}
export interface LintStatsTimePass {
/**
* The total time that is spent on applying fixes to the code.
*/
fix: LintStatsFixTime;
/**
* The total time that is spent when parsing a file.
*/
parse: LintStatsParseTime;
/**
* The total time that is spent on a rule.
*/
rules?: Record<string, LintStatsRuleTime>;
/**
* The cumulative total
*/
total: number;
}
export interface LintStatsParseTime {
total: number;
}
export interface LintStatsRuleTime {
total: number;
}
export interface LintStatsFixTime {
total: number;
}
export interface LintTextOptions {
/**
* The path to the file of the source code text. If omitted, the result.filePath becomes the string "<text>".
*/
filePath?: string;
/**
* If true is present and the options.filePath is a file ESLint should ignore, this method returns a lint result
* contains a warning message.
*/
warnIgnored?: boolean;
}
/**
* The LintMessage value is the information of each linting error.
*/
export interface LintMessage {
/**
* The 1-based column number of the begin point of this message.
*/
column: number | undefined;
/**
* The 1-based column number of the end point of this message. This property is undefined if this message
* is not a range.
*/
endColumn: number | undefined;
/**
* The 1-based line number of the end point of this message. This property is undefined if this
* message is not a range.
*/
endLine: number | undefined;
/**
* `true` if this is a fatal error unrelated to a rule, like a parsing error.
*/
fatal?: boolean | undefined;
/**
* The EditInfo object of autofix. This property is undefined if this message is not fixable.
*/
fix: EditInfo | undefined;
/**
* The 1-based line number of the begin point of this message.
*/
line: number | undefined;
/**
* The error message
*/
message: string;
/**
* The rule name that generates this lint message. If this message is generated by the ESLint core rather than
* rules, this is null.
*/
ruleId: string | null;
/**
* The severity of this message. 1 means warning and 2 means error.
*/
severity: 1 | 2;
/**
* The list of suggestions. Each suggestion is the pair of a description and an EditInfo object to fix code. API
* users such as editor integrations can choose one of them to fix the problem of this message. This property is
* undefined if this message doesn't have any suggestions.
*/
suggestions: {
desc: string;
fix: EditInfo;
}[] | undefined;
}
/**
* The SuppressedLintMessage value is the information of each suppressed linting error.
*/
export interface SuppressedLintMessage extends LintMessage {
/**
* The list of suppressions.
*/
suppressions?: {
/**
* The free text description added after the `--` in the comment
*/
justification: string;
/**
* Right now, this is always `directive`
*/
kind: string;
}[];
}
/**
* The EditInfo value is information to edit text.
*
* This edit information means replacing the range of the range property by the text property value. It's like
* sourceCodeText.slice(0, edit.range[0]) + edit.text + sourceCodeText.slice(edit.range[1]). Therefore, it's an add
* if the range[0] and range[1] property values are the same value, and it's removal if the text property value is
* empty string.
*/
export interface EditInfo {
/**
* The pair of 0-based indices in source code text to remove.
*/
range: [number, number];
/**
* The text to add.
*/
text: string;
}
/**
* The Formatter value is the object to convert the LintResult objects to text.
*/
export interface Formatter {
/**
* The method to convert the LintResult objects to text.
* Promise return supported since 8.4.0
*/
format(results: LintResult[]): string | Promise<string>;
}

View File

@@ -0,0 +1,13 @@
function _defaults(obj, defaults) {
var keys = Object.getOwnPropertyNames(defaults);
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
var value = Object.getOwnPropertyDescriptor(defaults, key);
if (value && value.configurable && obj[key] === undefined) Object.defineProperty(obj, key, value);
}
return obj;
}
export { _defaults as _ };

View File

@@ -0,0 +1,33 @@
interface SafeTimers {
nextTick?: (cb: () => void) => void;
setImmediate?: {
<TArgs extends any[]>(callback: (...args: TArgs) => void, ...args: TArgs): any;
__promisify__: <T = void>(value?: T, options?: any) => Promise<T>;
};
clearImmediate?: (immediateId: any) => void;
setTimeout: typeof setTimeout;
setInterval: typeof setInterval;
clearInterval: typeof clearInterval;
clearTimeout: typeof clearTimeout;
queueMicrotask: typeof queueMicrotask;
}
declare function getSafeTimers(): SafeTimers;
declare function setSafeTimers(): void;
/**
* Returns a promise that resolves after the specified duration.
*
* @param timeout - Delay in milliseconds
* @param scheduler - Timer function to use, defaults to `setTimeout`. Useful for mocked timers.
*
* @example
* await delay(100)
*
* @example
* // With mocked timers
* const { setTimeout } = getSafeTimers()
* await delay(100, setTimeout)
*/
declare function delay(timeout: number, scheduler?: typeof setTimeout): Promise<void>;
export { delay, getSafeTimers, setSafeTimers };
export type { SafeTimers };

View File

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

View File

@@ -0,0 +1,78 @@
"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 tsutils = __importStar(require("ts-api-utils"));
const ts = __importStar(require("typescript"));
const util = __importStar(require("../util"));
exports.default = util.createRule({
name: 'no-unsafe-unary-minus',
meta: {
type: 'problem',
docs: {
description: 'Require unary negation to take a number',
recommended: 'recommended',
requiresTypeChecking: true,
},
messages: {
unaryMinus: 'Argument of unary negation should be assignable to number | bigint but is {{type}} instead.',
},
schema: [],
},
defaultOptions: [],
create(context) {
return {
UnaryExpression(node) {
if (node.operator !== '-') {
return;
}
const services = util.getParserServices(context);
const argType = util.getConstrainedTypeAtLocation(services, node.argument);
const checker = services.program.getTypeChecker();
if (tsutils
.unionConstituents(argType)
.some(type => !tsutils.isTypeFlagSet(type, ts.TypeFlags.Any |
ts.TypeFlags.Never |
ts.TypeFlags.BigIntLike |
ts.TypeFlags.NumberLike))) {
context.report({
node,
messageId: 'unaryMinus',
data: { type: checker.typeToString(argType) },
});
}
},
};
},
});

View File

@@ -0,0 +1,40 @@
{
"name": "imurmurhash",
"version": "0.1.4",
"description": "An incremental implementation of MurmurHash3",
"homepage": "https://github.com/jensyt/imurmurhash-js",
"main": "imurmurhash.js",
"files": [
"imurmurhash.js",
"imurmurhash.min.js",
"package.json",
"README.md"
],
"repository": {
"type": "git",
"url": "https://github.com/jensyt/imurmurhash-js"
},
"bugs": {
"url": "https://github.com/jensyt/imurmurhash-js/issues"
},
"keywords": [
"murmur",
"murmurhash",
"murmurhash3",
"hash",
"incremental"
],
"author": {
"name": "Jens Taylor",
"email": "jensyt@gmail.com",
"url": "https://github.com/homebrewing"
},
"license": "MIT",
"dependencies": {
},
"devDependencies": {
},
"engines": {
"node": ">=0.8.19"
}
}

View File

@@ -0,0 +1,4 @@
function _class_call_check(instance, Constructor) {
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
}
export { _class_call_check as _ };

View File

@@ -0,0 +1,157 @@
/*
Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
import estraverse from "estraverse";
import esrecurse from "esrecurse";
/** @import * as types from "eslint-scope" */
const { Syntax } = estraverse;
/**
* Get last array element
* @param {Array} xs array
* @returns {any} Last elment
*/
function getLast(xs) {
return xs.at(-1) || null;
}
/**
* Visitor for destructuring patterns.
* @implements {types.PatternVisitor}
*/
class PatternVisitor extends esrecurse.Visitor {
static isPattern(node) {
const nodeType = node.type;
return (
nodeType === Syntax.Identifier ||
nodeType === Syntax.ObjectPattern ||
nodeType === Syntax.ArrayPattern ||
nodeType === Syntax.SpreadElement ||
nodeType === Syntax.RestElement ||
nodeType === Syntax.AssignmentPattern
);
}
constructor(options, rootPattern, callback) {
super(null, options);
this.rootPattern = rootPattern;
this.callback = callback;
this.assignments = [];
this.rightHandNodes = [];
this.restElements = [];
}
Identifier(pattern) {
const lastRestElement = getLast(this.restElements);
this.callback(pattern, {
topLevel: pattern === this.rootPattern,
rest:
lastRestElement !== null &&
lastRestElement !== void 0 &&
lastRestElement.argument === pattern,
assignments: this.assignments,
});
}
Property(property) {
// Computed property's key is a right hand node.
if (property.computed) {
this.rightHandNodes.push(property.key);
}
// If it's shorthand, its key is same as its value.
// If it's shorthand and has its default value, its key is same as its value.left (the value is AssignmentPattern).
// If it's not shorthand, the name of new variable is its value's.
this.visit(property.value);
}
ArrayPattern(pattern) {
for (let i = 0, iz = pattern.elements.length; i < iz; ++i) {
const element = pattern.elements[i];
this.visit(element);
}
}
AssignmentPattern(pattern) {
this.assignments.push(pattern);
this.visit(pattern.left);
this.rightHandNodes.push(pattern.right);
this.assignments.pop();
}
RestElement(pattern) {
this.restElements.push(pattern);
this.visit(pattern.argument);
this.restElements.pop();
}
MemberExpression(node) {
// Computed property's key is a right hand node.
if (node.computed) {
this.rightHandNodes.push(node.property);
}
// the object is only read, write to its property.
this.rightHandNodes.push(node.object);
}
//
// ForInStatement.left and AssignmentExpression.left are LeftHandSideExpression.
// By spec, LeftHandSideExpression is Pattern or MemberExpression.
// (see also: https://github.com/estree/estree/pull/20#issuecomment-74584758)
// But espree 2.0 parses to ArrayExpression, ObjectExpression, etc...
//
SpreadElement(node) {
this.visit(node.argument);
}
ArrayExpression(node) {
node.elements.forEach(this.visit, this);
}
AssignmentExpression(node) {
this.assignments.push(node);
this.visit(node.left);
this.rightHandNodes.push(node.right);
this.assignments.pop();
}
CallExpression(node) {
// arguments are right hand nodes.
node.arguments.forEach(a => {
this.rightHandNodes.push(a);
});
this.visit(node.callee);
}
}
export default PatternVisitor;
/* vim: set sw=4 ts=4 et tw=80 : */

View File

@@ -0,0 +1,42 @@
var test = require('tape');
var stringify = require('../');
test('nested', function (t) {
t.plan(1);
var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 };
t.equal(stringify(obj), '{"a":3,"b":[{"x":4,"y":5,"z":6},7],"c":8}');
});
test('cyclic (default)', function (t) {
t.plan(1);
var one = { a: 1 };
var two = { a: 2, one: one };
one.two = two;
try {
stringify(one);
} catch (ex) {
t.equal(ex.toString(), 'TypeError: Converting circular structure to JSON');
}
});
test('cyclic (specifically allowed)', function (t) {
t.plan(1);
var one = { a: 1 };
var two = { a: 2, one: one };
one.two = two;
t.equal(stringify(one, {cycles:true}), '{"a":1,"two":{"a":2,"one":"__cycle__"}}');
});
test('repeated non-cyclic value', function(t) {
t.plan(1);
var one = { x: 1 };
var two = { a: one, b: one };
t.equal(stringify(two), '{"a":{"x":1},"b":{"x":1}}');
});
test('acyclic but with reused obj-property pointers', function (t) {
t.plan(1);
var x = { a: 1 }
var y = { b: x, c: x }
t.equal(stringify(y), '{"b":{"a":1},"c":{"a":1}}');
});

View File

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

View File

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

View File

@@ -0,0 +1,46 @@
{
"JSON.stringify@native": {
"name": "JSON.stringify@native",
"browser": "Chrome 60.0.3112 (Windows 7 0.0.0)",
"suite": "libs",
"hz": 23318.188713986212,
"success": true,
"fastest": false,
"rme": 0.006452566696644349,
"rhz": 2.8306993977343704,
"sampleSize": 172
},
"fast-stable-stringify@a9f81e8": {
"name": "fast-stable-stringify@a9f81e8",
"browser": "Chrome 60.0.3112 (Windows 7 0.0.0)",
"suite": "libs",
"hz": 8237.60683760684,
"success": true,
"fastest": true,
"rme": 0.011894091296418823,
"rhz": 1,
"sampleSize": 158
},
"json-stable-stringify@1.0.1": {
"name": "json-stable-stringify@1.0.1",
"browser": "Chrome 60.0.3112 (Windows 7 0.0.0)",
"suite": "libs",
"hz": 5626.352941176469,
"success": true,
"fastest": false,
"rme": 0.011093377969860959,
"rhz": 0.683008190618019,
"sampleSize": 147
},
"faster-stable-stringify@1.0.0": {
"name": "faster-stable-stringify@1.0.0",
"browser": "Chrome 60.0.3112 (Windows 7 0.0.0)",
"suite": "libs",
"hz": 6259.964985901354,
"success": true,
"fastest": false,
"rme": 0.011160692994486833,
"rhz": 0.7599251954248374,
"sampleSize": 171
}
}

View File

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

View File

@@ -0,0 +1,17 @@
// https://github.com/maxogden/websocket-stream/blob/48dc3ddf943e5ada668c31ccd94e9186f02fafbd/ws-fallback.js
var ws = null
if (typeof WebSocket !== 'undefined') {
ws = WebSocket
} else if (typeof MozWebSocket !== 'undefined') {
ws = MozWebSocket
} else if (typeof global !== 'undefined') {
ws = global.WebSocket || global.MozWebSocket
} else if (typeof window !== 'undefined') {
ws = window.WebSocket || window.MozWebSocket
} else if (typeof self !== 'undefined') {
ws = self.WebSocket || self.MozWebSocket
}
module.exports = ws

View File

@@ -0,0 +1,16 @@
/**
* Utilities for short weierstrass curves, combined with noble-hashes.
* @module
*/
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
import { weierstrass } from "./abstract/weierstrass.js";
/** connects noble-curves to noble-hashes */
export function getHash(hash) {
return { hash };
}
/** @deprecated use new `weierstrass()` and `ecdsa()` methods */
export function createCurve(curveDef, defHash) {
const create = (hash) => weierstrass({ ...curveDef, hash: hash });
return { ...create(defHash), create };
}
//# sourceMappingURL=_shortw_utils.js.map