@storm-stack/core
Version:
A build toolkit and runtime used by Storm Software in TypeScript applications
1,128 lines (1,121 loc) • 175 kB
JavaScript
import { __commonJS, __name, __esm, __require, __toCommonJS } from './chunk-43IZMM3W.js';
// ../../node_modules/.pnpm/@deepkit+type-spec@1.0.1_patch_hash=7fa2429e62a71cec39858642e4ec2e45671dd3b26152068677fd7c38279bdcbe/node_modules/@deepkit/type-spec/dist/cjs/src/type.js
var require_type = __commonJS({
"../../node_modules/.pnpm/@deepkit+type-spec@1.0.1_patch_hash=7fa2429e62a71cec39858642e4ec2e45671dd3b26152068677fd7c38279bdcbe/node_modules/@deepkit/type-spec/dist/cjs/src/type.js"(exports2) {
Object.defineProperty(exports2, "__esModule", {
value: true
});
exports2.ReflectionOp = exports2.TypeNumberBrand = void 0;
var TypeNumberBrand;
(function(TypeNumberBrand2) {
TypeNumberBrand2[TypeNumberBrand2["integer"] = 0] = "integer";
TypeNumberBrand2[TypeNumberBrand2["int8"] = 1] = "int8";
TypeNumberBrand2[TypeNumberBrand2["int16"] = 2] = "int16";
TypeNumberBrand2[TypeNumberBrand2["int32"] = 3] = "int32";
TypeNumberBrand2[TypeNumberBrand2["uint8"] = 4] = "uint8";
TypeNumberBrand2[TypeNumberBrand2["uint16"] = 5] = "uint16";
TypeNumberBrand2[TypeNumberBrand2["uint32"] = 6] = "uint32";
TypeNumberBrand2[TypeNumberBrand2["float"] = 7] = "float";
TypeNumberBrand2[TypeNumberBrand2["float32"] = 8] = "float32";
TypeNumberBrand2[TypeNumberBrand2["float64"] = 9] = "float64";
})(TypeNumberBrand || (exports2.TypeNumberBrand = TypeNumberBrand = {}));
var ReflectionOp;
(function(ReflectionOp2) {
ReflectionOp2[ReflectionOp2["never"] = 0] = "never";
ReflectionOp2[ReflectionOp2["any"] = 1] = "any";
ReflectionOp2[ReflectionOp2["unknown"] = 2] = "unknown";
ReflectionOp2[ReflectionOp2["void"] = 3] = "void";
ReflectionOp2[ReflectionOp2["object"] = 4] = "object";
ReflectionOp2[ReflectionOp2["string"] = 5] = "string";
ReflectionOp2[ReflectionOp2["number"] = 6] = "number";
ReflectionOp2[ReflectionOp2["numberBrand"] = 7] = "numberBrand";
ReflectionOp2[ReflectionOp2["boolean"] = 8] = "boolean";
ReflectionOp2[ReflectionOp2["bigint"] = 9] = "bigint";
ReflectionOp2[ReflectionOp2["symbol"] = 10] = "symbol";
ReflectionOp2[ReflectionOp2["null"] = 11] = "null";
ReflectionOp2[ReflectionOp2["undefined"] = 12] = "undefined";
ReflectionOp2[ReflectionOp2["literal"] = 13] = "literal";
ReflectionOp2[ReflectionOp2["function"] = 14] = "function";
ReflectionOp2[ReflectionOp2["method"] = 15] = "method";
ReflectionOp2[ReflectionOp2["methodSignature"] = 16] = "methodSignature";
ReflectionOp2[ReflectionOp2["parameter"] = 17] = "parameter";
ReflectionOp2[ReflectionOp2["property"] = 18] = "property";
ReflectionOp2[ReflectionOp2["propertySignature"] = 19] = "propertySignature";
ReflectionOp2[ReflectionOp2["class"] = 20] = "class";
ReflectionOp2[ReflectionOp2["classExtends"] = 21] = "classExtends";
ReflectionOp2[ReflectionOp2["classReference"] = 22] = "classReference";
ReflectionOp2[ReflectionOp2["optional"] = 23] = "optional";
ReflectionOp2[ReflectionOp2["readonly"] = 24] = "readonly";
ReflectionOp2[ReflectionOp2["public"] = 25] = "public";
ReflectionOp2[ReflectionOp2["private"] = 26] = "private";
ReflectionOp2[ReflectionOp2["protected"] = 27] = "protected";
ReflectionOp2[ReflectionOp2["abstract"] = 28] = "abstract";
ReflectionOp2[ReflectionOp2["defaultValue"] = 29] = "defaultValue";
ReflectionOp2[ReflectionOp2["description"] = 30] = "description";
ReflectionOp2[ReflectionOp2["rest"] = 31] = "rest";
ReflectionOp2[ReflectionOp2["regexp"] = 32] = "regexp";
ReflectionOp2[ReflectionOp2["enum"] = 33] = "enum";
ReflectionOp2[ReflectionOp2["enumMember"] = 34] = "enumMember";
ReflectionOp2[ReflectionOp2["set"] = 35] = "set";
ReflectionOp2[ReflectionOp2["map"] = 36] = "map";
ReflectionOp2[ReflectionOp2["array"] = 37] = "array";
ReflectionOp2[ReflectionOp2["tuple"] = 38] = "tuple";
ReflectionOp2[ReflectionOp2["tupleMember"] = 39] = "tupleMember";
ReflectionOp2[ReflectionOp2["namedTupleMember"] = 40] = "namedTupleMember";
ReflectionOp2[ReflectionOp2["union"] = 41] = "union";
ReflectionOp2[ReflectionOp2["intersection"] = 42] = "intersection";
ReflectionOp2[ReflectionOp2["indexSignature"] = 43] = "indexSignature";
ReflectionOp2[ReflectionOp2["objectLiteral"] = 44] = "objectLiteral";
ReflectionOp2[ReflectionOp2["mappedType"] = 45] = "mappedType";
ReflectionOp2[ReflectionOp2["in"] = 46] = "in";
ReflectionOp2[ReflectionOp2["frame"] = 47] = "frame";
ReflectionOp2[ReflectionOp2["moveFrame"] = 48] = "moveFrame";
ReflectionOp2[ReflectionOp2["return"] = 49] = "return";
ReflectionOp2[ReflectionOp2["templateLiteral"] = 50] = "templateLiteral";
ReflectionOp2[ReflectionOp2["date"] = 51] = "date";
ReflectionOp2[ReflectionOp2["int8Array"] = 52] = "int8Array";
ReflectionOp2[ReflectionOp2["uint8ClampedArray"] = 53] = "uint8ClampedArray";
ReflectionOp2[ReflectionOp2["uint8Array"] = 54] = "uint8Array";
ReflectionOp2[ReflectionOp2["int16Array"] = 55] = "int16Array";
ReflectionOp2[ReflectionOp2["uint16Array"] = 56] = "uint16Array";
ReflectionOp2[ReflectionOp2["int32Array"] = 57] = "int32Array";
ReflectionOp2[ReflectionOp2["uint32Array"] = 58] = "uint32Array";
ReflectionOp2[ReflectionOp2["float32Array"] = 59] = "float32Array";
ReflectionOp2[ReflectionOp2["float64Array"] = 60] = "float64Array";
ReflectionOp2[ReflectionOp2["bigInt64Array"] = 61] = "bigInt64Array";
ReflectionOp2[ReflectionOp2["arrayBuffer"] = 62] = "arrayBuffer";
ReflectionOp2[ReflectionOp2["promise"] = 63] = "promise";
ReflectionOp2[ReflectionOp2["arg"] = 64] = "arg";
ReflectionOp2[ReflectionOp2["typeParameter"] = 65] = "typeParameter";
ReflectionOp2[ReflectionOp2["typeParameterDefault"] = 66] = "typeParameterDefault";
ReflectionOp2[ReflectionOp2["var"] = 67] = "var";
ReflectionOp2[ReflectionOp2["loads"] = 68] = "loads";
ReflectionOp2[ReflectionOp2["indexAccess"] = 69] = "indexAccess";
ReflectionOp2[ReflectionOp2["keyof"] = 70] = "keyof";
ReflectionOp2[ReflectionOp2["infer"] = 71] = "infer";
ReflectionOp2[ReflectionOp2["typeof"] = 72] = "typeof";
ReflectionOp2[ReflectionOp2["condition"] = 73] = "condition";
ReflectionOp2[ReflectionOp2["jumpCondition"] = 74] = "jumpCondition";
ReflectionOp2[ReflectionOp2["jump"] = 75] = "jump";
ReflectionOp2[ReflectionOp2["call"] = 76] = "call";
ReflectionOp2[ReflectionOp2["inline"] = 77] = "inline";
ReflectionOp2[ReflectionOp2["inlineCall"] = 78] = "inlineCall";
ReflectionOp2[ReflectionOp2["distribute"] = 79] = "distribute";
ReflectionOp2[ReflectionOp2["extends"] = 80] = "extends";
ReflectionOp2[ReflectionOp2["widen"] = 81] = "widen";
ReflectionOp2[ReflectionOp2["static"] = 82] = "static";
ReflectionOp2[ReflectionOp2["mappedType2"] = 83] = "mappedType2";
ReflectionOp2[ReflectionOp2["functionReference"] = 84] = "functionReference";
ReflectionOp2[ReflectionOp2["callSignature"] = 85] = "callSignature";
ReflectionOp2[ReflectionOp2["typeName"] = 86] = "typeName";
ReflectionOp2[ReflectionOp2["implements"] = 87] = "implements";
ReflectionOp2[ReflectionOp2["nominal"] = 88] = "nominal";
ReflectionOp2[ReflectionOp2["tags"] = 89] = "tags";
})(ReflectionOp || (exports2.ReflectionOp = ReflectionOp = {}));
}
});
// ../../node_modules/.pnpm/@deepkit+type-spec@1.0.1_patch_hash=7fa2429e62a71cec39858642e4ec2e45671dd3b26152068677fd7c38279bdcbe/node_modules/@deepkit/type-spec/dist/cjs/index.js
var require_cjs = __commonJS({
"../../node_modules/.pnpm/@deepkit+type-spec@1.0.1_patch_hash=7fa2429e62a71cec39858642e4ec2e45671dd3b26152068677fd7c38279bdcbe/node_modules/@deepkit/type-spec/dist/cjs/index.js"(exports2) {
var __createBinding3 = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) {
if (k2 === void 0) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = {
enumerable: true,
get: /* @__PURE__ */ __name(function() {
return m[k];
}, "get")
};
}
Object.defineProperty(o, k2, desc);
} : function(o, m, k, k2) {
if (k2 === void 0) k2 = k;
o[k2] = m[k];
});
var __exportStar2 = exports2 && exports2.__exportStar || function(m, exports1) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports1, p)) __createBinding3(exports1, m, p);
};
Object.defineProperty(exports2, "__esModule", {
value: true
});
__exportStar2(require_type(), exports2);
}
});
// ../../node_modules/.pnpm/@deepkit+type-compiler@1.0.5_patch_hash=19245411fbebae976fdfdab12529a230d23998d97efe63c_bdfcede75619db8c4c2bdcf201ca576c/node_modules/@deepkit/type-compiler/dist/esm/src/debug.js
var debug_exports = {};
function isDebug(level = 1) {
const expected = "deepkit" + (level > 1 ? "+".repeat(level - 1) : "");
return "undefined" !== typeof process && "string" === typeof process.env.DEBUG && process.env.DEBUG.includes(expected);
}
function debug(...message) {
if (isDebug(1)) {
console.debug(...message);
}
}
function debug2(...message) {
if (isDebug(2)) {
console.debug(...message);
}
}
var init_debug = __esm({
"../../node_modules/.pnpm/@deepkit+type-compiler@1.0.5_patch_hash=19245411fbebae976fdfdab12529a230d23998d97efe63c_bdfcede75619db8c4c2bdcf201ca576c/node_modules/@deepkit/type-compiler/dist/esm/src/debug.js"() {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isDebug = isDebug;
exports.debug = debug;
exports.debug2 = debug2;
__name(isDebug, "isDebug");
__name(debug, "debug");
__name(debug2, "debug2");
}
});
// ../../node_modules/.pnpm/@deepkit+type-compiler@1.0.5_patch_hash=19245411fbebae976fdfdab12529a230d23998d97efe63c_bdfcede75619db8c4c2bdcf201ca576c/node_modules/@deepkit/type-compiler/dist/esm/src/resolver.js
var resolver_exports = {};
function patternMatch(path, patterns, base) {
const include = patterns.filter((pattern) => pattern[0] !== "!");
const exclude = patterns.filter((pattern) => pattern[0] === "!").map((pattern) => pattern.substring(1));
return micromatch_1.default.isMatch(path, include, {
ignore: exclude
});
}
var __importDefault, micromatch_1, typescript_1, createSourceFile, resolveModuleName, isStringLiteral, JSDocParsingMode, ScriptTarget, Resolver;
var init_resolver = __esm({
"../../node_modules/.pnpm/@deepkit+type-compiler@1.0.5_patch_hash=19245411fbebae976fdfdab12529a230d23998d97efe63c_bdfcede75619db8c4c2bdcf201ca576c/node_modules/@deepkit/type-compiler/dist/esm/src/resolver.js"() {
__importDefault = function(mod) {
return mod && mod.__esModule ? mod : {
"default": mod
};
};
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Resolver = void 0;
exports.patternMatch = patternMatch;
micromatch_1 = __importDefault(__require("micromatch"));
typescript_1 = __importDefault(__require("typescript"));
({ createSourceFile, resolveModuleName, isStringLiteral, JSDocParsingMode, ScriptTarget } = typescript_1.default);
__name(patternMatch, "patternMatch");
Resolver = class Resolver2 {
static {
__name(this, "Resolver");
}
constructor(compilerOptions, host, sourceFiles) {
this.compilerOptions = compilerOptions;
this.host = host;
this.sourceFiles = sourceFiles;
}
resolve(from, importOrExportNode) {
const moduleSpecifier = importOrExportNode.moduleSpecifier;
if (!moduleSpecifier) return;
if (!isStringLiteral(moduleSpecifier)) return;
return this.resolveSourceFile(from, moduleSpecifier);
}
resolveImpl(modulePath, sourceFile) {
if (this.host.resolveModuleNameLiterals !== void 0) {
const results = this.host.resolveModuleNameLiterals(
[
modulePath
],
sourceFile.fileName,
/*reusedNames*/
void 0,
this.compilerOptions,
sourceFile,
void 0
);
if (results[0]) return results[0].resolvedModule;
return;
}
if (this.host.resolveModuleNames !== void 0) {
return this.host.resolveModuleNames(
[
modulePath.text
],
sourceFile.fileName,
/*reusedNames*/
void 0,
/*redirectedReference*/
void 0,
this.compilerOptions
)[0];
}
const result = resolveModuleName(modulePath.text, sourceFile.fileName, this.compilerOptions, this.host);
return result.resolvedModule;
}
/**
* Tries to resolve the .ts/d.ts file path for a given module path.
* Scans relative paths. Looks into package.json "types" and "exports" (with new 4.7 support)
*
* @param sourceFile the SourceFile of the file that contains the import. modulePath is relative to that.
* @param modulePath the x in 'from x'.
*/
resolveSourceFile(sourceFile, modulePath) {
const result = this.resolveImpl(modulePath, sourceFile);
if (!result) return;
if (!result.resolvedFileName.endsWith(".ts") && !result.resolvedFileName.endsWith(".tsx") && !result.resolvedFileName.endsWith(".d.ts")) {
return;
}
const fileName = result.resolvedFileName;
if (this.sourceFiles[fileName]) return this.sourceFiles[fileName];
const source = this.host.readFile(result.resolvedFileName);
if (!source) return;
const moduleSourceFile = this.sourceFiles[fileName] = createSourceFile(fileName, source, {
languageVersion: this.compilerOptions.target || ScriptTarget.ES2018,
// JSDocParsingMode is not available in TS < 5.3
jsDocParsingMode: JSDocParsingMode ? JSDocParsingMode.ParseNone : void 0
}, true);
this.sourceFiles[fileName] = moduleSourceFile;
typescript_1.default.bindSourceFile(moduleSourceFile, this.compilerOptions);
return moduleSourceFile;
}
};
exports.Resolver = Resolver;
}
});
// ../../node_modules/.pnpm/@deepkit+type-compiler@1.0.5_patch_hash=19245411fbebae976fdfdab12529a230d23998d97efe63c_bdfcede75619db8c4c2bdcf201ca576c/node_modules/@deepkit/type-compiler/dist/esm/src/config.js
var config_exports = {};
function isObject(obj) {
if (!obj) {
return false;
}
return typeof obj === "object" && !Array.isArray(obj);
}
function readTsConfig(parseConfigHost, path) {
const configFile = typescript_12.default.readConfigFile(path, (path2) => parseConfigHost.readFile(path2));
if (configFile.error) {
(0, debug_js_1.debug)(`Failed to read tsconfig ${path}: ${configFile.error.messageText}`);
return;
}
const parsed = typescript_12.default.parseJsonConfigFileContent(configFile.config, parseConfigHost, (0, path_1.dirname)(path));
const ignoredErrors = [
18003
// No inputs were found in config file.
];
const softErrors = [
18e3
// Circularity detected while resolving configuration
];
const errors = parsed.errors.filter((v) => !ignoredErrors.includes(v.code));
if (errors.length) {
(0, debug_js_1.debug)(`Failed to parse tsconfig ${path}: ${parsed.errors.map((v) => v.messageText).join(", ")}`);
}
const hardErrors = errors.filter((v) => !softErrors.includes(v.code));
if (hardErrors.length) {
return;
}
return Object.assign(configFile.config, {
compilerOptions: parsed.options
});
}
function reflectionModeMatcher(config, filePath) {
if (Array.isArray(config.exclude)) {
if ((0, resolver_js_1.patternMatch)(filePath, config.exclude)) return "never";
}
if (Array.isArray(config.reflection)) {
return (0, resolver_js_1.patternMatch)(filePath, config.reflection) ? "default" : "never";
}
if (config.reflection === "default" || config.reflection === "explicit") return config.reflection;
return "never";
}
function ensureStringArray(value) {
if (Array.isArray(value)) return value.map((v) => "" + v);
if ("string" === typeof value) return [
value
];
return [];
}
function parseRawMode(mode) {
if ("boolean" === typeof mode) return mode ? "default" : "never";
if (mode === "default" || mode === "explicit") return mode;
return ensureStringArray(mode);
}
function resolvePaths(baseDir, paths) {
if (!paths || !Array.isArray(paths)) return;
for (let i = 0; i < paths.length; i++) {
if ("string" !== typeof paths[i]) continue;
if ((0, path_1.isAbsolute)(paths[i])) continue;
let path = paths[i];
let exclude = false;
if (path.startsWith("!")) {
exclude = true;
path = path.substring(1);
}
if (path.startsWith("./") || path.includes("/")) {
path = (0, path_1.join)(baseDir, path);
}
path = path.replace(/\\/g, "/");
if (exclude) path = "!" + path;
paths[i] = path;
}
}
function appendPaths(strategy = defaultMergeStrategy, parent, existing) {
if (strategy === "replace") {
return [
...existing || parent
];
}
if (!existing) return [
...parent
];
return [
...parent,
...existing
];
}
function applyConfigValues(existing, parent, baseDir) {
const parentReflection = isObject(parent.deepkitCompilerOptions) ? parent.deepkitCompilerOptions?.reflection : parent.reflection;
if (isObject(parent.deepkitCompilerOptions) && "undefined" === typeof existing.mergeStrategy) {
existing.mergeStrategy = parent.deepkitCompilerOptions.mergeStrategy;
}
if ("undefined" !== typeof parentReflection) {
const next = parseRawMode(parentReflection);
if ("undefined" === typeof existing.reflection) {
existing.reflection = next;
} else if ("string" === typeof existing.reflection) ; else if (Array.isArray(next) && Array.isArray(existing.reflection)) {
existing.reflection = appendPaths(existing.mergeStrategy, next, existing.reflection);
} else if ("string" === typeof next && Array.isArray(existing.reflection)) ;
}
if (isObject(parent.deepkitCompilerOptions)) {
if (`undefined` !== typeof parent.deepkitCompilerOptions.exclude) {
const next = ensureStringArray(parent.deepkitCompilerOptions.exclude);
existing.exclude = appendPaths(existing.mergeStrategy, next, existing.exclude);
}
}
resolvePaths(baseDir, existing.reflection);
resolvePaths(baseDir, existing.exclude);
if (parent.compilerOptions) {
if (Object.keys(existing.compilerOptions).length === 0) {
Object.assign(existing.compilerOptions, parent.compilerOptions);
}
}
existing.extends = parent.extends;
}
function getConfigResolver(cache2, host, compilerOptions, sourceFile, tsConfigPath = "") {
let config = {
// We use the parameter `compilerOptions` only for compilerOptions.configFilePath.
// We load the compilerOptions manually since transformers don't get the full picture
// (path aliases are missing for example).
// It's important to load compilerOptions manually if there is compilerOptions.configFilePath
// since not all build tools provide the full compilerOptions.
compilerOptions: {}
};
tsConfigPath = tsConfigPath || ("string" === typeof compilerOptions.configFilePath ? compilerOptions.configFilePath : "");
if (tsConfigPath) {
if (cache2[tsConfigPath]) return cache2[tsConfigPath];
const configFile = readTsConfig(host, tsConfigPath);
if (configFile) applyConfigValues(config, configFile, (0, path_1.dirname)(tsConfigPath));
} else {
if (!tsConfigPath && sourceFile) {
const baseDir = (0, path_1.dirname)(sourceFile.fileName);
const configPath = typescript_12.default.findConfigFile(baseDir, (path) => {
path = (0, path_1.isAbsolute)(path) ? path : (0, path_1.join)(baseDir, path);
return host.fileExists(path);
});
(0, debug_js_1.debug2)(`No tsConfigPath|compilerOptions.configFilePath provided. Manually searching for tsconfig.json in ${baseDir} returned ${configPath}`);
if (configPath) {
tsConfigPath = (0, path_1.isAbsolute)(configPath) ? configPath : (0, path_1.join)(baseDir, configPath);
}
}
if (tsConfigPath) {
if (cache2[tsConfigPath]) return cache2[tsConfigPath];
const configFile = readTsConfig(host, tsConfigPath);
if (configFile) applyConfigValues(config, configFile, (0, path_1.dirname)(tsConfigPath));
}
}
if (tsConfigPath) {
let basePath = (0, path_1.dirname)(tsConfigPath);
let currentConfig = config;
const seen = /* @__PURE__ */ new Set();
seen.add(tsConfigPath);
while (currentConfig.extends) {
const path = (0, path_1.join)(basePath, currentConfig.extends);
if (seen.has(path)) break;
seen.add(path);
const nextConfig = typescript_12.default.readConfigFile(path, (path2) => host.readFile(path2));
if (!nextConfig) break;
basePath = (0, path_1.dirname)(path);
applyConfigValues(currentConfig, nextConfig.config, basePath);
}
} else {
throw new Error(`No tsconfig found for ${sourceFile?.fileName}, that is weird. Either provide a tsconfig or compilerOptions.configFilePath`);
}
config.exclude = config.exclude ? [
...exports.defaultExcluded,
...config.exclude
] : [
...exports.defaultExcluded
];
config.compilerOptions.configFilePath = tsConfigPath;
const resolvedConfig = {
path: tsConfigPath,
// we want to maintain options passed from tsc API (transpile, Program)
compilerOptions: Object.assign(config.compilerOptions, compilerOptions),
exclude: config.exclude,
reflection: config.reflection,
reflectionLevel: config.reflectionLevel || "normal",
mergeStrategy: config.mergeStrategy || defaultMergeStrategy
};
if ((0, debug_js_1.isDebug)()) {
(0, debug_js_1.debug)(`Found config ${resolvedConfig.path}:
reflection:`, resolvedConfig.reflection, `
exclude:`, resolvedConfig.exclude, `
paths:`, resolvedConfig.compilerOptions.paths);
}
const match = /* @__PURE__ */ __name((path) => {
const mode = reflectionModeMatcher(config, path);
return {
mode,
tsConfigPath,
level: resolvedConfig.reflectionLevel
};
}, "match");
return cache2[tsConfigPath] = {
config: resolvedConfig,
match
};
}
var __importDefault2, path_1, typescript_12, debug_js_1, resolver_js_1, defaultMergeStrategy;
var init_config = __esm({
"../../node_modules/.pnpm/@deepkit+type-compiler@1.0.5_patch_hash=19245411fbebae976fdfdab12529a230d23998d97efe63c_bdfcede75619db8c4c2bdcf201ca576c/node_modules/@deepkit/type-compiler/dist/esm/src/config.js"() {
__importDefault2 = function(mod) {
return mod && mod.__esModule ? mod : {
"default": mod
};
};
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.defaultExcluded = exports.reflectionLevel = exports.reflectionModes = void 0;
exports.isObject = isObject;
exports.reflectionModeMatcher = reflectionModeMatcher;
exports.parseRawMode = parseRawMode;
exports.getConfigResolver = getConfigResolver;
path_1 = __require("path");
typescript_12 = __importDefault2(__require("typescript"));
debug_js_1 = (init_debug(), __toCommonJS(debug_exports));
resolver_js_1 = (init_resolver(), __toCommonJS(resolver_exports));
exports.reflectionModes = [
"default",
"explicit",
"never"
];
__name(isObject, "isObject");
defaultMergeStrategy = "merge";
exports.reflectionLevel = [
"minimal",
"normal",
"verbose"
];
__name(readTsConfig, "readTsConfig");
__name(reflectionModeMatcher, "reflectionModeMatcher");
__name(ensureStringArray, "ensureStringArray");
__name(parseRawMode, "parseRawMode");
__name(resolvePaths, "resolvePaths");
__name(appendPaths, "appendPaths");
__name(applyConfigValues, "applyConfigValues");
exports.defaultExcluded = [
"lib.dom*.d.ts",
"*typedarrays.d.ts",
"lib.webworker*.d.ts",
"lib.decorator*.d.ts",
"lib.es2015.proxy.d.ts",
"lib.es2020.sharedmemory.d.ts",
"lib.es2015.core.d.ts"
];
__name(getConfigResolver, "getConfigResolver");
}
});
// ../../node_modules/.pnpm/@deepkit+type-compiler@1.0.5_patch_hash=19245411fbebae976fdfdab12529a230d23998d97efe63c_bdfcede75619db8c4c2bdcf201ca576c/node_modules/@deepkit/type-compiler/dist/esm/src/reflection-ast.js
var reflection_ast_exports = {};
function is__String(value) {
return typeof value === "string";
}
function getIdentifierName(node) {
if (is__String(node)) return node;
if (isIdentifier(node) || isPrivateIdentifier(node)) {
return typescript_13.default.unescapeLeadingUnderscores(node.escapedText);
}
if (isStringLiteral2(node)) return node.text;
return "";
}
function getEscapedText(node) {
if (is__String(node)) return node;
if (isIdentifier(node) || isPrivateIdentifier(node)) return node.escapedText;
return getIdentifierName(node);
}
function findSourceFile(node) {
if (node.kind === SyntaxKind.SourceFile) return node;
let current = node.parent;
while (current && current.kind !== SyntaxKind.SourceFile) {
current = current.parent;
}
return current;
}
function joinQualifiedName(name) {
if (isIdentifier(name)) return getIdentifierName(name);
return joinQualifiedName(name.left) + "_" + getIdentifierName(name.right);
}
function getCommentOfNode(sourceFile, node) {
const commentLines = getLeadingCommentRanges(sourceFile.text, node.pos);
if (!commentLines || commentLines.length === 0) return;
const commentLine = commentLines.slice(-1)[0];
if (!commentLine) return;
const comment = sourceFile.text.slice(commentLine.pos, commentLine.end);
if (comment.match(BANNER_REGEX)) {
return void 0;
}
return comment;
}
function parseJSDocAttributeFromText(comment, attribute) {
const attributeStr = `@${attribute} `;
const index = comment.indexOf(attributeStr);
if (index === -1) {
let start2 = 0;
while (true) {
const withoutContent = comment.indexOf(`@${attribute}`, start2);
if (withoutContent === -1) {
return [
void 0,
-1
];
}
const nextCharacter = comment[withoutContent + attribute.length + 1];
if (!nextCharacter || nextCharacter === " " || nextCharacter === "\n" || nextCharacter === "\r" || nextCharacter === " ") {
return [
void 0,
withoutContent + attribute.length + 1
];
}
start2 = withoutContent + attribute.length + 1;
}
}
const start = index + attributeStr.length;
const nextAttribute = comment.indexOf("@", start);
const endOfComment = comment.indexOf("*/", start);
const end = nextAttribute === -1 ? endOfComment : Math.min(nextAttribute, endOfComment);
const content = comment.substring(start, end).trim();
return [
content.split("\n").map((v) => {
const indexOfStar = v.indexOf("*");
if (indexOfStar === -1) {
return v.trim();
}
return v.substring(indexOfStar + 1).trim();
}).join("\n").replace(/\n*$/g, ""),
end + 1
];
}
function parseJSDocBooleanFromText(comment, attribute) {
return new RegExp(`^s*@(${attribute?.trim()})s*(false|False|FALSE|0|n|N|no|No|NO)s*$`, "gm").test(comment?.trim()) ? false : new RegExp(`^s*@(${attribute?.trim()})s*(true|True|TRUE|1|y|Y|yes|Yes|YES)?s*$`, "gm").test(comment?.trim()) ? true : void 0;
}
function parseJSDocDescription(comment) {
let lines = comment.split("\n").filter((line) => line && !line.includes("/**") && !line.includes("*/")).map((line) => line.replace(/^\s*\*\s*/g, "").replace(/^\*\s*/g, "").trim());
const attribute = lines.findIndex((line) => line.startsWith("@"));
if (attribute !== -1) {
lines = lines.slice(0, attribute);
}
return lines.join("\n").trim() || void 0;
}
function extractJSDocAttribute(sourceFile, node, attribute) {
if (!node) return void 0;
const comment = getCommentOfNode(sourceFile, node);
if (!comment) return void 0;
let result = parseJSDocAttributeFromText(comment, attribute);
if (!result[0] && attribute === "description") {
result[0] = parseJSDocDescription(comment);
}
return result[0];
}
function extractJSDocArray(sourceFile, node, attribute) {
if (!node) return void 0;
const comment = getCommentOfNode(sourceFile, node);
if (!comment) return void 0;
const results = [];
try {
let result = parseJSDocAttributeFromText(comment, attribute);
if (result.length < 2) {
return void 0;
}
if (result[0] && result[1] > -1) {
results.push(result[0]);
}
let currentComment = comment;
while (result[1] > -1 && currentComment.length > result[1]) {
currentComment = currentComment.substring(result[1]);
result = parseJSDocAttributeFromText(currentComment, attribute);
if (result[0]) {
results.push(result[0]);
}
}
} catch (error) {
console.error("Error parsing JSDoc attribute:", attribute, "in comment:", comment);
console.error(error);
}
return results;
}
function extractJSDocBoolean(sourceFile, node, attribute) {
if (!node) {
return void 0;
}
const comment = getCommentOfNode(sourceFile, node);
if (!comment) {
return void 0;
}
return parseJSDocBooleanFromText(comment, attribute);
}
function getPropertyName(f, node) {
if (!node) return "";
if (isIdentifier(node)) return getIdentifierName(node);
if (isStringLiteral2(node)) return node.text;
if (isNumericLiteral(node)) return +node.text;
if (isNoSubstitutionTemplateLiteral(node)) return node.text;
if (isComputedPropertyName(node)) {
return f.createArrowFunction(void 0, void 0, [], void 0, void 0, node.expression);
}
if (isPrivateIdentifier(node)) return getIdentifierName(node);
return "";
}
function getNameAsString(node) {
if (!node) return "";
if (isIdentifier(node)) return getIdentifierName(node);
if (isStringLiteral2(node)) return node.text;
if (isNumericLiteral(node)) return node.text;
if ((0, typescript_13.isBigIntLiteral)(node)) return node.text;
if (isNoSubstitutionTemplateLiteral(node)) return node.text;
if (isComputedPropertyName(node)) {
if (isStringLiteralLike(node) || isNumericLiteral(node)) return node.text;
return "";
}
if (isPrivateIdentifier(node)) return getIdentifierName(node);
return joinQualifiedName(node);
}
function hasModifier(node, modifier) {
if (!node.modifiers) return false;
return node.modifiers.some((v) => v.kind === modifier);
}
function isExternalOrCommonJsModule(file) {
return (file.externalModuleIndicator || file.commonJsModuleIndicator) !== void 0;
}
function isNodeWithLocals(node) {
return "locals" in node;
}
function getGlobalsOfSourceFile(file) {
if (file.redirectInfo) return;
if (!isNodeWithLocals(file)) return;
if (!isExternalOrCommonJsModule(file)) return file.locals;
if (file.jsGlobalAugmentations) return file.jsGlobalAugmentations;
if (file.symbol && file.symbol.globalExports) return file.symbol.globalExports;
}
function ensureImportIsEmitted(importDeclaration, specifierName) {
if (specifierName && importDeclaration.importClause && importDeclaration.importClause.namedBindings) {
if (isNamedImports(importDeclaration.importClause.namedBindings)) {
for (const element of importDeclaration.importClause.namedBindings.elements) {
if (element.name.escapedText === specifierName.escapedText) {
element.flags |= NodeFlags.Synthesized;
return;
}
}
}
}
importDeclaration.flags |= NodeFlags.Synthesized;
}
function serializeEntityNameAsExpression(f, node) {
switch (node.kind) {
case SyntaxKind.Identifier:
return finish(node, f.createIdentifier(getIdentifierName(node)));
case SyntaxKind.QualifiedName:
return finish(node, serializeQualifiedNameAsExpression(f, node));
}
return node;
}
function serializeQualifiedNameAsExpression(f, node) {
return f.createPropertyAccessExpression(serializeEntityNameAsExpression(f, node.left), node.right);
}
function finish(oldNode, newNode) {
setOriginalNode(newNode, oldNode);
newNode._original = newNode.original;
newNode._symbol = oldNode._symbol ?? oldNode.symbol;
newNode.symbol = newNode._symbol;
return newNode;
}
var __createBinding, __setModuleDefault, __importStar, ts_clone_node_1, typescript_13, isArrowFunction, isComputedPropertyName, isIdentifier, isNamedImports, isNumericLiteral, isPrivateIdentifier, isStringLiteral2, isStringLiteralLike, setOriginalNode, getLeadingCommentRanges, isNoSubstitutionTemplateLiteral, NodeFlags, SyntaxKind, BANNER_REGEX, cloneHook, NodeConverter;
var init_reflection_ast = __esm({
"../../node_modules/.pnpm/@deepkit+type-compiler@1.0.5_patch_hash=19245411fbebae976fdfdab12529a230d23998d97efe63c_bdfcede75619db8c4c2bdcf201ca576c/node_modules/@deepkit/type-compiler/dist/esm/src/reflection-ast.js"() {
__createBinding = Object.create ? function(o, m, k, k2) {
if (k2 === void 0) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = {
enumerable: true,
get: /* @__PURE__ */ __name(function() {
return m[k];
}, "get")
};
}
Object.defineProperty(o, k2, desc);
} : function(o, m, k, k2) {
if (k2 === void 0) k2 = k;
o[k2] = m[k];
};
__setModuleDefault = Object.create ? function(o, v) {
Object.defineProperty(o, "default", {
enumerable: true,
value: v
});
} : function(o, v) {
o["default"] = v;
};
__importStar = /* @__PURE__ */ (function() {
var ownKeys = /* @__PURE__ */ __name(function(o) {
ownKeys = Object.getOwnPropertyNames || function(o2) {
var ar = [];
for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
}, "ownKeys");
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.NodeConverter = void 0;
exports.getIdentifierName = getIdentifierName;
exports.getEscapedText = getEscapedText;
exports.findSourceFile = findSourceFile;
exports.joinQualifiedName = joinQualifiedName;
exports.getCommentOfNode = getCommentOfNode;
exports.parseJSDocAttributeFromText = parseJSDocAttributeFromText;
exports.parseJSDocBooleanFromText = parseJSDocBooleanFromText;
exports.parseJSDocDescription = parseJSDocDescription;
exports.extractJSDocAttribute = extractJSDocAttribute;
exports.extractJSDocArray = extractJSDocArray;
exports.extractJSDocBoolean = extractJSDocBoolean;
exports.getPropertyName = getPropertyName;
exports.getNameAsString = getNameAsString;
exports.hasModifier = hasModifier;
exports.isNodeWithLocals = isNodeWithLocals;
exports.getGlobalsOfSourceFile = getGlobalsOfSourceFile;
exports.ensureImportIsEmitted = ensureImportIsEmitted;
exports.serializeEntityNameAsExpression = serializeEntityNameAsExpression;
ts_clone_node_1 = __require("@marcj/ts-clone-node");
typescript_13 = __importStar(__require("typescript"));
({ isArrowFunction, isComputedPropertyName, isIdentifier, isNamedImports, isNumericLiteral, isPrivateIdentifier, isStringLiteral: isStringLiteral2, isStringLiteralLike, setOriginalNode, getLeadingCommentRanges, isNoSubstitutionTemplateLiteral, NodeFlags, SyntaxKind } = typescript_13.default);
__name(is__String, "is__String");
__name(getIdentifierName, "getIdentifierName");
__name(getEscapedText, "getEscapedText");
__name(findSourceFile, "findSourceFile");
__name(joinQualifiedName, "joinQualifiedName");
BANNER_REGEX = /^\/\*\s---.*\n[\s\S]*\s*---\s*\*\//;
__name(getCommentOfNode, "getCommentOfNode");
__name(parseJSDocAttributeFromText, "parseJSDocAttributeFromText");
__name(parseJSDocBooleanFromText, "parseJSDocBooleanFromText");
__name(parseJSDocDescription, "parseJSDocDescription");
__name(extractJSDocAttribute, "extractJSDocAttribute");
__name(extractJSDocArray, "extractJSDocArray");
__name(extractJSDocBoolean, "extractJSDocBoolean");
__name(getPropertyName, "getPropertyName");
__name(getNameAsString, "getNameAsString");
__name(hasModifier, "hasModifier");
cloneHook = /* @__PURE__ */ __name((node, payload) => {
if (isIdentifier(node)) {
return {
text: /* @__PURE__ */ __name(() => {
return getIdentifierName(node);
}, "text")
};
}
return;
}, "cloneHook");
NodeConverter = class NodeConverter2 {
static {
__name(this, "NodeConverter");
}
constructor(f) {
this.f = f;
}
toExpression(node) {
if (node === void 0) return this.f.createIdentifier("undefined");
if (Array.isArray(node)) {
return this.f.createArrayLiteralExpression(this.f.createNodeArray(node.map((v) => this.toExpression(v))));
}
if ("string" === typeof node) return this.f.createStringLiteral(node, true);
if ("number" === typeof node) return this.f.createNumericLiteral(node);
if ("bigint" === typeof node) return this.f.createBigIntLiteral(String(node));
if ("boolean" === typeof node) return node ? this.f.createTrue() : this.f.createFalse();
if (node.pos === -1 && node.end === -1 && node.parent === void 0) {
if (isArrowFunction(node)) {
if (node.body.pos === -1 && node.body.end === -1 && node.body.parent === void 0) return node;
return this.f.createArrowFunction(node.modifiers, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, this.toExpression(node.body));
}
return node;
}
switch (node.kind) {
case SyntaxKind.Identifier:
return finish(node, this.f.createIdentifier(getIdentifierName(node)));
case SyntaxKind.StringLiteral:
return finish(node, this.f.createStringLiteral(node.text));
case SyntaxKind.NumericLiteral:
return finish(node, this.f.createNumericLiteral(node.text));
case SyntaxKind.BigIntLiteral:
return finish(node, this.f.createBigIntLiteral(node.text));
case SyntaxKind.TrueKeyword:
return finish(node, this.f.createTrue());
case SyntaxKind.FalseKeyword:
return finish(node, this.f.createFalse());
}
try {
return (0, ts_clone_node_1.cloneNode)(node, {
preserveComments: false,
factory: this.f,
setOriginalNodes: true,
preserveSymbols: true,
setParents: true,
hook: cloneHook
});
} catch (error) {
console.error("could not clone node", node);
throw error;
}
}
};
exports.NodeConverter = NodeConverter;
__name(isExternalOrCommonJsModule, "isExternalOrCommonJsModule");
__name(isNodeWithLocals, "isNodeWithLocals");
__name(getGlobalsOfSourceFile, "getGlobalsOfSourceFile");
__name(ensureImportIsEmitted, "ensureImportIsEmitted");
__name(serializeEntityNameAsExpression, "serializeEntityNameAsExpression");
__name(serializeQualifiedNameAsExpression, "serializeQualifiedNameAsExpression");
__name(finish, "finish");
}
});
// ../../node_modules/.pnpm/@deepkit+type-compiler@1.0.5_patch_hash=19245411fbebae976fdfdab12529a230d23998d97efe63c_bdfcede75619db8c4c2bdcf201ca576c/node_modules/@deepkit/type-compiler/dist/esm/src/compiler.js
var compiler_exports = {};
function encodeOps(ops) {
return ops.map((v) => String.fromCharCode(v + 33)).join("");
}
function filterUndefined(object) {
return Object.fromEntries(Object.entries(object).filter(([, v]) => v !== void 0));
}
function debugPackStruct(sourceFile, forType, pack) {
const items = [];
for (let i = 0; i < pack.ops.length; i++) {
const op = pack.ops[i];
const opInfo = OPs[op];
items.push(type_spec_1.ReflectionOp[op]);
if (opInfo && opInfo.params > 0) {
for (let j = 0; j < opInfo.params; j++) {
const address = pack.ops[++i];
items.push(address);
}
}
}
const printer = createPrinter();
const stack = [];
for (const s of pack.stack) {
if ("object" === typeof s && "getText" in s) {
stack.push(printer.printNode(EmitHint.Unspecified, s, sourceFile));
} else {
stack.push(JSON.stringify(s));
}
}
console.log(stack.join(","), "|", ...items);
}
function findVariable(frame, name, frameOffset = 0) {
const variable = frame.variables.find((v) => v.name === name);
if (variable) {
return {
frameOffset,
stackIndex: variable.index
};
}
if (frame.previous) return findVariable(frame.previous, name, frameOffset + 1);
return;
}
function findConditionalFrame(frame) {
if (frame.conditional) return frame;
if (frame.previous) return findConditionalFrame(frame.previous);
return;
}
function getAssignTypeExpression(call) {
if (isParenthesizedExpression(call) && isCallExpression(call.expression)) {
call = call.expression;
}
if (isCallExpression(call) && isIdentifier2(call.expression) && (0, reflection_ast_js_1.getIdentifierName)(call.expression) === "__assignType" && call.arguments.length > 0) {
return call.arguments[0];
}
return;
}
function getReceiveTypeParameter(type) {
if (isUnionTypeNode(type)) {
for (const t of type.types) {
const rfn = getReceiveTypeParameter(t);
if (rfn) return rfn;
}
} else if (isTypeReferenceNode(type) && isIdentifier2(type.typeName) && (0, reflection_ast_js_1.getIdentifierName)(type.typeName) === "ReceiveType" && !!type.typeArguments && type.typeArguments.length === 1) return type;
return;
}
var __importDefault3, typescript_14, type_spec_1, vfs_1, config_js_1, debug_js_12, reflection_ast_js_1, resolver_js_12, visitEachChild, visitNode, isPropertyAssignment, isArrayTypeNode, isArrowFunction2, isBlock, isCallExpression, isCallSignatureDeclaration, isClassDeclaration, isClassExpression, isConstructorDeclaration, isConstructorTypeNode, isConstructSignatureDeclaration, isEnumDeclaration, isExportDeclaration, isExpression, isExpressionWithTypeArguments, isFunctionDeclaration, isFunctionExpression, isFunctionLike, isIdentifier2, isImportClause, isImportDeclaration, isImportSpecifier, isInferTypeNode, isInterfaceDeclaration, isMethodDeclaration, isMethodSignature, isModuleDeclaration, isNamedExports, isNamedTupleMember, isNewExpression, isObjectLiteralExpression, isOptionalTypeNode, isParameter, isParenthesizedExpression, isParenthesizedTypeNode, isPropertyAccessExpression, isQualifiedName, isSourceFile, isStringLiteral3, isTypeAliasDeclaration, isTypeLiteralNode, isTypeParameterDeclaration, isTypeQueryNode, isTypeReferenceNode, isUnionTypeNode, isExpressionStatement, isVariableDeclaration, getEffectiveConstraintOfTypeParameter, addSyntheticLeadingComment, createCompilerHost, createPrinter, escapeLeadingUnderscores, EmitHint, NodeFlags2, SyntaxKind2, ScriptTarget2, ModifierFlags, ScriptKind, OPs, CompilerProgram, Cache, ReflectionTransformer, DeclarationTransformer, loaded, cache, transformer, declarationTransformer;
var init_compiler = __esm({
"../../node_modules/.pnpm/@deepkit+type-compiler@1.0.5_patch_hash=19245411fbebae976fdfdab12529a230d23998d97efe63c_bdfcede75619db8c4c2bdcf201ca576c/node_modules/@deepkit/type-compiler/dist/esm/src/compiler.js"() {
__importDefault3 = function(mod) {
return mod && mod.__esModule ? mod : {
"default": mod
};
};
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.declarationTransformer = exports.transformer = exports.DeclarationTransformer = exports.ReflectionTransformer = exports.Cache = exports.packSize = exports.packSizeByte = void 0;
exports.encodeOps = encodeOps;
exports.debugPackStruct = debugPackStruct;
typescript_14 = __importDefault3(__require("typescript"));
type_spec_1 = require_cjs();
vfs_1 = __require("@typescript/vfs");
config_js_1 = (init_config(), __toCommonJS(config_exports));
debug_js_12 = (init_debug(), __toCommonJS(debug_exports));
reflection_ast_js_1 = (init_reflection_ast(), __toCommonJS(reflection_ast_exports));
resolver_js_12 = (init_resolver(), __toCommonJS(resolver_exports));
({ visitEachChild, visitNode, isPropertyAssignment, isArrayTypeNode, isArrowFunction: isArrowFunction2, isBlock, isCallExpression, isCallSignatureDeclaration, isClassDeclaration, isClassExpression, isConstructorDeclaration, isConstructorTypeNode, isConstructSignatureDeclaration, isEnumDeclaration, isExportDeclaration, isExpression, isExpressionWithTypeArguments, isFunctionDeclaration, isFunctionExpression, isFunctionLike, isIdentifier: isIdentifier2, isImportClause, isImportDeclaration, isImportSpecifier, isInferTypeNode, isInterfaceDeclaration, isMethodDeclaration, isMethodSignature, isModuleDeclaration, isNamedExports, isNamedTupleMember, isNewExpression, isObjectLiteralExpression, isOptionalTypeNode, isParameter, isParenthesizedExpression, isParenthesizedTypeNode, isPropertyAccessExpression, isQualifiedName, isSourceFile, isStringLiteral: isStringLiteral3, isTypeAliasDeclaration, isTypeLiteralNode, isTypeParameterDeclaration, isTypeQueryNode, isTypeReferenceNode, isUnionTypeNode, isExpressionStatement, isVariableDeclaration, getEffectiveConstraintOfTypeParameter, addSyntheticLeadingComment, createCompilerHost, createPrinter, escapeLeadingUnderscores, EmitHint, NodeFlags: NodeFlags2, SyntaxKind: SyntaxKind2, ScriptTarget: ScriptTarget2, ModifierFlags, ScriptKind } = typescript_14.default);
__name(encodeOps, "encodeOps");
__name(filterUndefined, "filterUndefined");
exports.packSizeByte = 6;
exports.packSize = 2 ** exports.packSizeByte;
OPs = {
[type_spec_1.ReflectionOp.literal]: {
params: 1
},
// [ReflectionOp.pointer]: { params: 1 },
// [ReflectionOp.arg]: { params: 1 },
[type_spec_1.ReflectionOp.classReference]: {
params: 1
},
[type_spec_1.ReflectionOp.propertySignature]: {
params: 1
},
[type_spec_1.ReflectionOp.property]: {
params: 1
},
[type_spec_1.ReflectionOp.jump]: {
params: 1
},
[type_spec_1.ReflectionOp.enum]: {
params: 0
},
[type_spec_1.ReflectionOp.enumMember]: {
params: 1
},
[type_spec_1.ReflectionOp.typeParameter]: {
params: 1
},
[type_spec_1.ReflectionOp.typeParameterDefault]: {
params: 1
},
[type_spec_1.ReflectionOp.mappedType]: {
params: 2
},
[type_spec_1.ReflectionOp.call]: {
params: 1
},
[type_spec_1.ReflectionOp.inline]: {
params: 1
},
[type_spec_1.ReflectionOp.inlineCall]: {
params: 2
},
[type_spec_1.ReflectionOp.loads]: {
params: 2
},
[type_spec_1.ReflectionOp.extends]: {
params: 0
},
[type_spec_1.ReflectionOp.infer]: {
params: 2
},
[type_spec_1.ReflectionOp.defaultValue]: {
params: 1
},
[type_spec_1.ReflectionOp.parameter]: {
params: 1
},
[type_spec_1.ReflectionOp.method]: {
params: 1
},
[type_spec_1.ReflectionOp.function]: {
params: 1
},
[type_spec_1.ReflectionOp.description]: {
params: 1
},
[type_spec_1.ReflectionOp.numberBrand]: {
params: 1
},
[type_spec_1.ReflectionOp.typeof]: {
params: 1
},
[type_spec_1.ReflectionOp.classExtends]: {
params: 1
},
[type_spec_1.ReflectionOp.distribute]: {
params: 1
},
[type_spec_1.ReflectionOp.jumpCondition]: {
params: 2
},
[type_spec_1.ReflectionOp.typeName]: {
params: 1
},
[type_spec_1.ReflectionOp.implements]: {
params: 1
},
[type_spec_1.ReflectionOp.tags]: {
params: 1
}
};
__name(debugPackStruct, "debugPackStruct");
__name(findVariable, "findVariable");
__name(findConditionalFrame, "findConditionalFrame");
CompilerProgram = class CompilerProgram2 {
static {
__name(this, "CompilerProgram");
}
constructor(forNode, sourceFile) {
this.forNode = forNode;
this.sourceFile = sourceFile;
this.ops = [];
this.stack = [];
this.mainOffset = 0;
this.stackPosition = 0;
this.frame = {
variables: [],
opIndex: 0
};
this.activeCoRoutines = [];
this.coRoutines = [];
this.resolveFunctionParameters = /* @__PURE__ */ new Map();
}
buildPackStruct() {
const ops = [
...this.ops
];
if (this.coRoutines.length) {
for (let i = this.coRoutines.length - 1; i >= 0; i--) {
ops.unshift(...this.coRoutines[i].ops);
}
}
if (this.mainOffset) {
ops.unshift(type_spec_1.ReflectionOp.jump, this.mainOffset);
}
return {
ops,
stack: this.sta