@powerlines/deepkit 0.7.5 → 0.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/capnp.d.mts +2 -2
- package/dist/{compiler-BUUdv7wG.mjs → compiler-CoBHJbw6.mjs} +2 -2
- package/dist/{compiler-BzOZmhWO.d.mts → compiler-DLeSXEon.d.mts} +3 -3
- package/dist/{compiler-DTp8Jvav.cjs → compiler-TYAnj4GK.cjs} +1 -1
- package/dist/{config-B2hS4_tR.d.mts → config-SjpQNPJf.d.mts} +1 -1
- package/dist/{config-CuXC21KA.mjs → config-ldWMxkkM.mjs} +1 -1
- package/dist/esbuild-plugin.cjs +47 -2
- package/dist/esbuild-plugin.d.mts +1 -1
- package/dist/esbuild-plugin.mjs +47 -2
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/reflect-type.cjs +1 -1
- package/dist/reflect-type.d.mts +1 -1
- package/dist/reflect-type.mjs +1 -1
- package/dist/{reflection-Bhe75GyI.d.mts → reflection-lA4jBKKP.d.mts} +1 -1
- package/dist/transformer.cjs +1 -1
- package/dist/transformer.d.mts +1 -1
- package/dist/transformer.mjs +1 -1
- package/dist/transpile.d.mts +1 -1
- package/dist/{type-DfwJ6GTs.d.mts → type-C4eOl66J.d.mts} +1 -1
- package/dist/{type-BDuj5wg2.d.mts → type-SyDc32SL.d.mts} +3 -3
- package/dist/{types-BO3PJV5p.d.mts → types-DYGcIrk3.d.mts} +1 -1
- package/dist/types.d.mts +2 -2
- package/dist/utilities.cjs +116 -8
- package/dist/utilities.d.mts +1 -1
- package/dist/utilities.mjs +110 -2
- package/dist/vendor/core.d.mts +1 -1
- package/dist/vendor/type-compiler/compiler.cjs +1 -1
- package/dist/vendor/type-compiler/compiler.d.mts +1 -1
- package/dist/vendor/type-compiler/compiler.mjs +1 -1
- package/dist/vendor/type-compiler/config.cjs +1 -1
- package/dist/vendor/type-compiler/config.d.mts +1 -1
- package/dist/vendor/type-compiler/config.mjs +1 -1
- package/dist/vendor/type-compiler/index.cjs +2 -2
- package/dist/vendor/type-compiler/index.d.mts +2 -2
- package/dist/vendor/type-compiler/index.mjs +2 -2
- package/dist/vendor/type-spec.d.mts +1 -1
- package/dist/vendor/type.d.mts +2 -2
- package/package.json +13 -21
- package/dist/esbuild-plugin-BUYqx8_5.cjs +0 -80
- package/dist/esbuild-plugin-CRQUmm86.mjs +0 -75
- package/dist/utilities-CT_jcB5h.mjs +0 -1483
- package/dist/utilities-Dr3TzxMb.cjs +0 -1523
- /package/dist/{config-C0OHvihx.d.mts → config-DDRKbv_W.d.mts} +0 -0
- /package/dist/{config-GVyELKY1.cjs → config-V3ttv0UZ.cjs} +0 -0
package/dist/capnp.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as SimpleSerializedType, _ as SerializedTypePropertySignature, a as SerializedTypeClassType, b as SerializedTypeUnion, c as SerializedTypeInfer, d as SerializedTypeMethod, f as SerializedTypeMethodSignature, g as SerializedTypeProperty, h as SerializedTypeParameter, i as SerializedTypeArray, l as SerializedTypeIntersection, m as SerializedTypeOther, n as IndexAccessOrigin, o as SerializedTypeEnum, p as SerializedTypeObjectLiteral, r as SerializedType, s as SerializedTypeFunction, t as DefaultValueReflection, u as SerializedTypeLiteral, v as SerializedTypeTuple, w as TagsReflection, x as SerializedType_Type, y as SerializedTypeTupleMember } from "./reflection-
|
|
2
|
-
import { Ci as SerializedTypeProperty$1, Mi as SerializedTypes, Oa as TagsReflection$1, Oi as SerializedTypeTuple$1, Pi as SimpleSerializedType$1, Sa as ReflectionKind, Ti as SerializedTypeReference, _i as SerializedTypeLiteral$1, bi as SerializedTypeObjectLiteral$1, di as SerializedTypeClassType$1, fi as SerializedTypeEnum$1, gi as SerializedTypeIntersection$1, hi as SerializedTypeInfer$1, ji as SerializedTypeUnion$1, ki as SerializedTypeTupleMember$1, li as SerializedTypeArray$1, pi as SerializedTypeFunction$1, si as SerializedType$1, vi as SerializedTypeMethod$1, wi as SerializedTypePropertySignature$1, xi as SerializedTypeParameter$1, yi as SerializedTypeMethodSignature$1 } from "./type-
|
|
1
|
+
import { C as SimpleSerializedType, _ as SerializedTypePropertySignature, a as SerializedTypeClassType, b as SerializedTypeUnion, c as SerializedTypeInfer, d as SerializedTypeMethod, f as SerializedTypeMethodSignature, g as SerializedTypeProperty, h as SerializedTypeParameter, i as SerializedTypeArray, l as SerializedTypeIntersection, m as SerializedTypeOther, n as IndexAccessOrigin, o as SerializedTypeEnum, p as SerializedTypeObjectLiteral, r as SerializedType, s as SerializedTypeFunction, t as DefaultValueReflection, u as SerializedTypeLiteral, v as SerializedTypeTuple, w as TagsReflection, x as SerializedType_Type, y as SerializedTypeTupleMember } from "./reflection-lA4jBKKP.mjs";
|
|
2
|
+
import { Ci as SerializedTypeProperty$1, Mi as SerializedTypes, Oa as TagsReflection$1, Oi as SerializedTypeTuple$1, Pi as SimpleSerializedType$1, Sa as ReflectionKind, Ti as SerializedTypeReference, _i as SerializedTypeLiteral$1, bi as SerializedTypeObjectLiteral$1, di as SerializedTypeClassType$1, fi as SerializedTypeEnum$1, gi as SerializedTypeIntersection$1, hi as SerializedTypeInfer$1, ji as SerializedTypeUnion$1, ki as SerializedTypeTupleMember$1, li as SerializedTypeArray$1, pi as SerializedTypeFunction$1, si as SerializedType$1, vi as SerializedTypeMethod$1, wi as SerializedTypePropertySignature$1, xi as SerializedTypeParameter$1, yi as SerializedTypeMethodSignature$1 } from "./type-SyDc32SL.mjs";
|
|
3
3
|
import { List } from "@stryke/capnp";
|
|
4
4
|
|
|
5
5
|
//#region src/capnp.d.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as __require, t as __commonJSMin } from "./chunk-CgI6uo-e.mjs";
|
|
2
2
|
import { n as TypeNumberBrand, t as ReflectionOp } from "./type-BWm74eaQ.mjs";
|
|
3
|
-
import { c as Resolver, l as debug, n as getConfigResolver, o as reflectionModeMatcher, u as debug2 } from "./config-
|
|
3
|
+
import { c as Resolver, l as debug, n as getConfigResolver, o as reflectionModeMatcher, u as debug2 } from "./config-ldWMxkkM.mjs";
|
|
4
4
|
import ts, { isBigIntLiteral } from "typescript";
|
|
5
5
|
|
|
6
6
|
//#region ../../node_modules/.pnpm/@typescript+vfs@1.6.4_typescript@5.9.3/node_modules/@typescript/vfs/dist/vfs.cjs.production.min.js
|
|
@@ -6549,4 +6549,4 @@ const declarationTransformer = function deepkitDeclarationTransformer(context) {
|
|
|
6549
6549
|
|
|
6550
6550
|
//#endregion
|
|
6551
6551
|
export { declarationTransformer as a, packSizeByte as c, debugPackStruct as i, transformer as l, DeclarationTransformer as n, encodeOps as o, ReflectionTransformer as r, packSize as s, Cache as t };
|
|
6552
|
-
//# sourceMappingURL=compiler-
|
|
6552
|
+
//# sourceMappingURL=compiler-CoBHJbw6.mjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as ReflectionOp } from "./type-
|
|
2
|
-
import { c as ReflectionConfig, i as MatchResult, l as ReflectionConfigCache, t as ConfigResolver } from "./config-
|
|
1
|
+
import { n as ReflectionOp } from "./type-C4eOl66J.mjs";
|
|
2
|
+
import { c as ReflectionConfig, i as MatchResult, l as ReflectionConfigCache, t as ConfigResolver } from "./config-SjpQNPJf.mjs";
|
|
3
3
|
import ts, { ArrowFunction, Bundle, ClassDeclaration, ClassExpression, CompilerHost, CompilerOptions, ConstructorDeclaration, CustomTransformer, CustomTransformerFactory, Declaration, EntityName, ExportDeclaration, Expression, ExpressionWithTypeArguments, FunctionDeclaration, FunctionExpression, Identifier, ImportDeclaration, JSDocImportTag, MethodDeclaration, ModuleDeclaration, ModuleExportName, Node, NodeFactory, ParseConfigHost, PropertyAccessExpression, QualifiedName, ResolvedModule, ScriptKind, SourceFile, Statement, StringLiteral, Symbol as Symbol$1, SymbolTable, TransformationContext, TypeAliasDeclaration, TypeChecker, TypeParameterDeclaration, TypeReferenceNode } from "typescript";
|
|
4
4
|
|
|
5
5
|
//#region ../../node_modules/.pnpm/@deepkit+type-compiler@1.0.5_patch_hash=439aa6e683a9a48c3ebbf3529be5811680c45c22d6a265d_be73b50bc43bac944747b8ca0498113a/node_modules/@deepkit/type-compiler/dist/cjs/src/ts-types.d.ts
|
|
@@ -377,4 +377,4 @@ declare const transformer: CustomTransformerFactory;
|
|
|
377
377
|
declare const declarationTransformer: CustomTransformerFactory;
|
|
378
378
|
//#endregion
|
|
379
379
|
export { debugPackStruct as a, packSize as c, TagsReflectionStruct as i, packSizeByte as l, DeclarationTransformer as n, declarationTransformer as o, ReflectionTransformer as r, encodeOps as s, Cache as t, transformer as u };
|
|
380
|
-
//# sourceMappingURL=compiler-
|
|
380
|
+
//# sourceMappingURL=compiler-DLeSXEon.d.mts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-BmvPcxpV.cjs');
|
|
2
2
|
const require_type = require('./type-DhqntM0q.cjs');
|
|
3
|
-
const require_config = require('./config-
|
|
3
|
+
const require_config = require('./config-V3ttv0UZ.cjs');
|
|
4
4
|
let typescript = require("typescript");
|
|
5
5
|
typescript = require_chunk.__toESM(typescript);
|
|
6
6
|
|
|
@@ -113,4 +113,4 @@ declare function getConfigResolver(cache: ReflectionConfigCache, host: ParseConf
|
|
|
113
113
|
}, tsConfigPath?: string): ConfigResolver;
|
|
114
114
|
//#endregion
|
|
115
115
|
export { reflectionModeMatcher as _, Matcher as a, ReflectionConfig as c, TsConfigJson as d, defaultExcluded as f, reflectionLevel as g, parseRawMode as h, MatchResult as i, ReflectionConfigCache as l, isObject as m, CurrentConfig as n, Mode as o, getConfigResolver as p, Level as r, RawMode as s, ConfigResolver as t, ResolvedConfig as u, reflectionModes as v };
|
|
116
|
-
//# sourceMappingURL=config-
|
|
116
|
+
//# sourceMappingURL=config-SjpQNPJf.d.mts.map
|
|
@@ -3608,4 +3608,4 @@ function getConfigResolver(cache, host, compilerOptions, sourceFile, tsConfigPat
|
|
|
3608
3608
|
|
|
3609
3609
|
//#endregion
|
|
3610
3610
|
export { reflectionLevel as a, Resolver as c, parseRawMode as i, debug as l, getConfigResolver as n, reflectionModeMatcher as o, isObject as r, reflectionModes as s, defaultExcluded as t, debug2 as u };
|
|
3611
|
-
//# sourceMappingURL=config-
|
|
3611
|
+
//# sourceMappingURL=config-ldWMxkkM.mjs.map
|
package/dist/esbuild-plugin.cjs
CHANGED
|
@@ -1,4 +1,49 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const
|
|
2
|
+
const require_chunk = require('./chunk-BmvPcxpV.cjs');
|
|
3
|
+
const require_transpile = require('./transpile.cjs');
|
|
4
|
+
let _stryke_type_checks = require("@stryke/type-checks");
|
|
5
|
+
let _stryke_helpers_omit = require("@stryke/helpers/omit");
|
|
6
|
+
let typescript = require("typescript");
|
|
3
7
|
|
|
4
|
-
|
|
8
|
+
//#region src/esbuild-plugin.ts
|
|
9
|
+
/**
|
|
10
|
+
* Esbuild plugin for Deepkit Type reflections.
|
|
11
|
+
*
|
|
12
|
+
* @param context - The Powerlines context.
|
|
13
|
+
* @param options - Optional esbuild onLoad options and reflection configuration.
|
|
14
|
+
* @returns An esbuild plugin instance.
|
|
15
|
+
*/
|
|
16
|
+
const esbuildPlugin = (context, options = {}) => {
|
|
17
|
+
return {
|
|
18
|
+
name: "powerlines:deepkit",
|
|
19
|
+
setup(build) {
|
|
20
|
+
build.onLoad({
|
|
21
|
+
filter: /\.(m|c)?tsx?$/,
|
|
22
|
+
...options.onLoad ?? {}
|
|
23
|
+
}, async (args) => {
|
|
24
|
+
const contents = await context.fs.read(args.path);
|
|
25
|
+
if (!contents) return null;
|
|
26
|
+
if (args.pluginData?.isReflected) return {
|
|
27
|
+
contents,
|
|
28
|
+
loader: "ts",
|
|
29
|
+
pluginData: { isReflected: true }
|
|
30
|
+
};
|
|
31
|
+
const result = require_transpile.transpile(context, contents, args.path, (0, _stryke_helpers_omit.omit)(options, ["onLoad"]));
|
|
32
|
+
if (result.diagnostics && result.diagnostics.length > 0) if (result.diagnostics.some((d) => d.category === typescript.DiagnosticCategory.Error)) {
|
|
33
|
+
const errorMessage = `Deepkit Type reflection transpilation errors: ${args.path} \n ${result.diagnostics.filter((d) => d.category === typescript.DiagnosticCategory.Error).map((d) => `-${d.file ? `${d.file.fileName}:` : ""} ${(0, _stryke_type_checks.isString)(d.messageText) ? d.messageText : d.messageText.messageText} (at ${d.start}:${d.length})`).join("\n")}`;
|
|
34
|
+
context.error(errorMessage);
|
|
35
|
+
throw new Error(errorMessage);
|
|
36
|
+
} else if (result.diagnostics.some((d) => d.category === typescript.DiagnosticCategory.Warning)) context.warn(`Deepkit Type reflection transpilation warnings: ${args.path} \n ${result.diagnostics.filter((d) => d.category === typescript.DiagnosticCategory.Warning).map((d) => `-${d.file ? `${d.file.fileName}:` : ""} ${(0, _stryke_type_checks.isString)(d.messageText) ? d.messageText : d.messageText.messageText} (at ${d.start}:${d.length})`).join("\n")}`);
|
|
37
|
+
else context.debug(`Deepkit Type reflection transpilation diagnostics: ${args.path} \n ${result.diagnostics.map((d) => `-${d.file ? `${d.file.fileName}:` : ""} ${(0, _stryke_type_checks.isString)(d.messageText) ? d.messageText : d.messageText.messageText} (at ${d.start}:${d.length})`).join("\n")}`);
|
|
38
|
+
return {
|
|
39
|
+
contents: result.outputText,
|
|
40
|
+
loader: "ts",
|
|
41
|
+
pluginData: { isReflected: true }
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
//#endregion
|
|
49
|
+
exports.esbuildPlugin = esbuildPlugin;
|
package/dist/esbuild-plugin.mjs
CHANGED
|
@@ -1,3 +1,48 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { transpile } from "./transpile.mjs";
|
|
2
|
+
import { isString } from "@stryke/type-checks";
|
|
3
|
+
import { omit } from "@stryke/helpers/omit";
|
|
4
|
+
import { DiagnosticCategory } from "typescript";
|
|
2
5
|
|
|
3
|
-
|
|
6
|
+
//#region src/esbuild-plugin.ts
|
|
7
|
+
/**
|
|
8
|
+
* Esbuild plugin for Deepkit Type reflections.
|
|
9
|
+
*
|
|
10
|
+
* @param context - The Powerlines context.
|
|
11
|
+
* @param options - Optional esbuild onLoad options and reflection configuration.
|
|
12
|
+
* @returns An esbuild plugin instance.
|
|
13
|
+
*/
|
|
14
|
+
const esbuildPlugin = (context, options = {}) => {
|
|
15
|
+
return {
|
|
16
|
+
name: "powerlines:deepkit",
|
|
17
|
+
setup(build) {
|
|
18
|
+
build.onLoad({
|
|
19
|
+
filter: /\.(m|c)?tsx?$/,
|
|
20
|
+
...options.onLoad ?? {}
|
|
21
|
+
}, async (args) => {
|
|
22
|
+
const contents = await context.fs.read(args.path);
|
|
23
|
+
if (!contents) return null;
|
|
24
|
+
if (args.pluginData?.isReflected) return {
|
|
25
|
+
contents,
|
|
26
|
+
loader: "ts",
|
|
27
|
+
pluginData: { isReflected: true }
|
|
28
|
+
};
|
|
29
|
+
const result = transpile(context, contents, args.path, omit(options, ["onLoad"]));
|
|
30
|
+
if (result.diagnostics && result.diagnostics.length > 0) if (result.diagnostics.some((d) => d.category === DiagnosticCategory.Error)) {
|
|
31
|
+
const errorMessage = `Deepkit Type reflection transpilation errors: ${args.path} \n ${result.diagnostics.filter((d) => d.category === DiagnosticCategory.Error).map((d) => `-${d.file ? `${d.file.fileName}:` : ""} ${isString(d.messageText) ? d.messageText : d.messageText.messageText} (at ${d.start}:${d.length})`).join("\n")}`;
|
|
32
|
+
context.error(errorMessage);
|
|
33
|
+
throw new Error(errorMessage);
|
|
34
|
+
} else if (result.diagnostics.some((d) => d.category === DiagnosticCategory.Warning)) context.warn(`Deepkit Type reflection transpilation warnings: ${args.path} \n ${result.diagnostics.filter((d) => d.category === DiagnosticCategory.Warning).map((d) => `-${d.file ? `${d.file.fileName}:` : ""} ${isString(d.messageText) ? d.messageText : d.messageText.messageText} (at ${d.start}:${d.length})`).join("\n")}`);
|
|
35
|
+
else context.debug(`Deepkit Type reflection transpilation diagnostics: ${args.path} \n ${result.diagnostics.map((d) => `-${d.file ? `${d.file.fileName}:` : ""} ${isString(d.messageText) ? d.messageText : d.messageText.messageText} (at ${d.start}:${d.length})`).join("\n")}`);
|
|
36
|
+
return {
|
|
37
|
+
contents: result.outputText,
|
|
38
|
+
loader: "ts",
|
|
39
|
+
pluginData: { isReflected: true }
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
//#endregion
|
|
47
|
+
export { esbuildPlugin };
|
|
48
|
+
//# sourceMappingURL=esbuild-plugin.mjs.map
|
package/dist/index.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_capnp = require('./capnp-BLCHrDSY.cjs');
|
|
3
|
-
const require_esbuild_plugin = require('./esbuild-plugin-BUYqx8_5.cjs');
|
|
4
3
|
const require_transformer = require('./transformer.cjs');
|
|
5
4
|
const require_transpile = require('./transpile.cjs');
|
|
5
|
+
const require_esbuild_plugin = require('./esbuild-plugin.cjs');
|
|
6
6
|
const require_reflect_type = require('./reflect-type.cjs');
|
|
7
7
|
const require_resolve_reflections = require('./resolve-reflections.cjs');
|
|
8
8
|
const require_rolldown_plugin = require('./rolldown-plugin.cjs');
|
|
9
9
|
require('./types.cjs');
|
|
10
|
-
const require_utilities = require('./utilities
|
|
10
|
+
const require_utilities = require('./utilities.cjs');
|
|
11
11
|
|
|
12
12
|
exports.convertFromCapnp = require_capnp.convertFromCapnp;
|
|
13
13
|
exports.convertFromCapnpArray = require_capnp.convertFromCapnpArray;
|
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { A as convertToCapnpIndexAccessOrigin, B as convertToCapnpPropertySignature, C as convertToCapnp, D as convertToCapnpDefault, E as convertToCapnpClassType, F as convertToCapnpMethodSignature, G as convertToCapnpUnion, H as convertToCapnpTagsReflection, I as convertToCapnpObjectLiteral, L as convertToCapnpOther, M as convertToCapnpIntersection, N as convertToCapnpLiteral, O as convertToCapnpEnum, P as convertToCapnpMethod, R as convertToCapnpParameter, S as convertFromCapnpUnion, T as convertToCapnpBase, U as convertToCapnpTuple, V as convertToCapnpSimple, W as convertToCapnpTupleMember, _ as convertFromCapnpPropertySignature, a as convertFromCapnpDefault, b as convertFromCapnpTuple, c as convertFromCapnpIndexAccessOrigin, d as convertFromCapnpLiteral, f as convertFromCapnpMethodSignature, g as convertFromCapnpProperty, h as convertFromCapnpParameter, i as convertFromCapnpClassType, j as convertToCapnpInfer, k as convertToCapnpFunction, l as convertFromCapnpInfer, m as convertFromCapnpOther, n as convertFromCapnpArray, o as convertFromCapnpEnum, p as convertFromCapnpObjectLiteral, r as convertFromCapnpBase, s as convertFromCapnpFunction, t as convertFromCapnp, u as convertFromCapnpIntersection, v as convertFromCapnpSimple, w as convertToCapnpArray, x as convertFromCapnpTupleMember, y as convertFromCapnpTagsReflection, z as convertToCapnpProperty } from "./capnp-BqAglxrS.mjs";
|
|
2
|
-
import { t as esbuildPlugin } from "./esbuild-plugin-CRQUmm86.mjs";
|
|
3
2
|
import { createDeclarationTransformer, createTransformer } from "./transformer.mjs";
|
|
4
3
|
import { transpile } from "./transpile.mjs";
|
|
4
|
+
import { esbuildPlugin } from "./esbuild-plugin.mjs";
|
|
5
5
|
import { reflectType } from "./reflect-type.mjs";
|
|
6
6
|
import { getReflectionsPath } from "./resolve-reflections.mjs";
|
|
7
7
|
import { rolldownPlugin } from "./rolldown-plugin.mjs";
|
|
8
8
|
import "./types.mjs";
|
|
9
|
-
import {
|
|
9
|
+
import { getEnumReflectionType, getUnionTypes, isStringUnion, kindToName, stringifyDefaultValue, stringifyStringValue, stringifyValue } from "./utilities.mjs";
|
|
10
10
|
|
|
11
11
|
export { convertFromCapnp, convertFromCapnpArray, convertFromCapnpBase, convertFromCapnpClassType, convertFromCapnpDefault, convertFromCapnpEnum, convertFromCapnpFunction, convertFromCapnpIndexAccessOrigin, convertFromCapnpInfer, convertFromCapnpIntersection, convertFromCapnpLiteral, convertFromCapnpMethodSignature, convertFromCapnpObjectLiteral, convertFromCapnpOther, convertFromCapnpParameter, convertFromCapnpProperty, convertFromCapnpPropertySignature, convertFromCapnpSimple, convertFromCapnpTagsReflection, convertFromCapnpTuple, convertFromCapnpTupleMember, convertFromCapnpUnion, convertToCapnp, convertToCapnpArray, convertToCapnpBase, convertToCapnpClassType, convertToCapnpDefault, convertToCapnpEnum, convertToCapnpFunction, convertToCapnpIndexAccessOrigin, convertToCapnpInfer, convertToCapnpIntersection, convertToCapnpLiteral, convertToCapnpMethod, convertToCapnpMethodSignature, convertToCapnpObjectLiteral, convertToCapnpOther, convertToCapnpParameter, convertToCapnpProperty, convertToCapnpPropertySignature, convertToCapnpSimple, convertToCapnpTagsReflection, convertToCapnpTuple, convertToCapnpTupleMember, convertToCapnpUnion, createDeclarationTransformer, createTransformer, esbuildPlugin, getEnumReflectionType, getReflectionsPath, getUnionTypes, isStringUnion, kindToName, reflectType, rolldownPlugin, stringifyDefaultValue, stringifyStringValue, stringifyValue, transpile };
|
package/dist/reflect-type.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_chunk = require('./chunk-BmvPcxpV.cjs');
|
|
3
3
|
const require_type = require('./type-C7UXbXfx.cjs');
|
|
4
|
-
const require_esbuild_plugin = require('./esbuild-plugin
|
|
4
|
+
const require_esbuild_plugin = require('./esbuild-plugin.cjs');
|
|
5
5
|
let defu = require("defu");
|
|
6
6
|
defu = require_chunk.__toESM(defu);
|
|
7
7
|
let _powerlines_plugin_esbuild_helpers_resolve = require("@powerlines/plugin-esbuild/helpers/resolve");
|
package/dist/reflect-type.d.mts
CHANGED
package/dist/reflect-type.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Zt as reflect } from "./type-ma8o4dJG.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { esbuildPlugin } from "./esbuild-plugin.mjs";
|
|
3
3
|
import defu from "defu";
|
|
4
4
|
import { resolve } from "@powerlines/plugin-esbuild/helpers/resolve";
|
|
5
5
|
|
|
@@ -1558,4 +1558,4 @@ declare class SerializedTypes extends $.Struct {
|
|
|
1558
1558
|
} //#endregion
|
|
1559
1559
|
//#endregion
|
|
1560
1560
|
export { SimpleSerializedType as C, SerializedTypes as S, SerializedTypePropertySignature as _, SerializedTypeClassType as a, SerializedTypeUnion as b, SerializedTypeInfer as c, SerializedTypeMethod as d, SerializedTypeMethodSignature as f, SerializedTypeProperty as g, SerializedTypeParameter as h, SerializedTypeArray as i, SerializedTypeIntersection as l, SerializedTypeOther as m, IndexAccessOrigin as n, SerializedTypeEnum as o, SerializedTypeObjectLiteral as p, SerializedType as r, SerializedTypeFunction as s, DefaultValueReflection as t, SerializedTypeLiteral as u, SerializedTypeTuple as v, TagsReflection as w, SerializedType_Type as x, SerializedTypeTupleMember as y };
|
|
1561
|
-
//# sourceMappingURL=reflection-
|
|
1561
|
+
//# sourceMappingURL=reflection-lA4jBKKP.d.mts.map
|
package/dist/transformer.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_chunk = require('./chunk-BmvPcxpV.cjs');
|
|
3
|
-
const require_compiler = require('./compiler-
|
|
3
|
+
const require_compiler = require('./compiler-TYAnj4GK.cjs');
|
|
4
4
|
let defu = require("defu");
|
|
5
5
|
defu = require_chunk.__toESM(defu);
|
|
6
6
|
|
package/dist/transformer.d.mts
CHANGED
package/dist/transformer.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as DeclarationTransformer, r as ReflectionTransformer, t as Cache } from "./compiler-
|
|
1
|
+
import { n as DeclarationTransformer, r as ReflectionTransformer, t as Cache } from "./compiler-CoBHJbw6.mjs";
|
|
2
2
|
import defu from "defu";
|
|
3
3
|
|
|
4
4
|
//#region src/transformer.ts
|
package/dist/transpile.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as AbstractClassType, d as CustomError, f as ExtractClassType, r as TypeAnnotation, s as CompilerContext, u as ClassType } from "./types-
|
|
2
|
-
import { n as ReflectionOp, r as TypeNumberBrand } from "./type-
|
|
1
|
+
import { c as AbstractClassType, d as CustomError, f as ExtractClassType, r as TypeAnnotation, s as CompilerContext, u as ClassType } from "./types-DYGcIrk3.mjs";
|
|
2
|
+
import { n as ReflectionOp, r as TypeNumberBrand } from "./type-C4eOl66J.mjs";
|
|
3
3
|
import { Buffer } from "node:buffer";
|
|
4
4
|
|
|
5
5
|
//#region ../../node_modules/.pnpm/@deepkit+type@1.0.5_patch_hash=b103dd6f0287e0e911c8eda19b8f7147926ed1313aee24aa43566163_7860537665a0856c25274a46f4912f7a/node_modules/@deepkit/type/dist/cjs/src/changes.d.ts
|
|
@@ -2966,4 +2966,4 @@ declare function parametersToTuple(parameters: TypeParameter[]): TypeTuple;
|
|
|
2966
2966
|
declare function extendTemplateLiteral(left: TypeLiteral | TypeTemplateLiteral, right: TypeTemplateLiteral): boolean;
|
|
2967
2967
|
//#endregion
|
|
2968
2968
|
export { resolvePath as $, TypeParameter as $a, Entity as $i, PositiveNoZero as $n, getMember as $o, serializePropertyOrParameter as $r, primaryKeyAnnotation as $s, ReflectionProperty as $t, JSONPartial as A, TypeAnnotations as Aa, SerializedTypeTypeParameter as Ai, AfterDate as An, dataAnnotation as Ao, deserializeEmbedded as Ar, isMember as As, TypedArray as At, ReferenceItemInfo as B, TypeEnumMember as Ba, AutoIncrement as Bi, Excludes as Bn, float as Bo, getNameExpression as Br, isRuntime as Bs, typeSettings as Bt, getPatchSerializeFunction as C, ReflectionVisibility as Ca, NumberFields as Cc, SerializedTypeProperty as Ci, encodeOps as Cn, assertType as Co, TypeGuardRegistry as Cr, isDateType as Cs, createClassDecoratorContext as Ct, validatedDeserialize as D, SqliteOptions as Da, SerializedTypeTemplateLiteral as Di, resolveRuntimeType as Dn, binaryTypes as Do, createConverterJSForMember as Dr, isIntegerType as Ds, isDecoratorContext as Dt, serializeFunction as E, SignedBinaryBigInt as Ea, changeSetSymbol as Ec, SerializedTypeRest as Ei, resolvePacked as En, binaryBigIntAnnotation as Eo, collapsePath as Er, isIgnore as Es, createPropertyDecoratorContext as Et, stringifyUuid as F, TypeBoolean as Fa, deserializeType as Fi, BeforeDate as Fn, entityAnnotation as Fo, forwardSetToArray as Fr, isPrimitive as Fs, arrayBufferToBase64 as Ft, getReferenceItemInfo as G, TypeLiteral as Ga, BinaryBigIntType as Gi, Maximum as Gn, getAnnotations as Go, getSetTypeToArray as Gr, isTypeIncluded as Gs, genericEqual as Gt, createReferenceClass as H, TypeIndexSignature as Ha, BackReferenceOptions as Hi, ExclusiveMinimum as Hn, float64 as Ho, getPartialType as Hr, isSetType as Hs, typedArrayToBuffer as Ht, uuid as I, TypeCallSignature as Ia, serializeType as Ii, BeforeNow as In, excludedAnnotation as Io, getEmbeddedProperty as Ir, isPropertyMemberType as Is, base64ToArrayBuffer as It, markAsHydrated as J, TypeNever as Ja, DatabaseField as Ji, MultipleOf as Jn, getConstructorProperties as Jo, inAccessor as Jr, mapNameAnnotation as Js, ReceiveType as Jt, isReferenceHydrated as K, TypeMethod as Ka, CartesianProduct as Ki, MinLength as Kn, getBackReferenceType as Ko, getStaticDefaultCodeForProperty as Kr, isUUIDType as Ks, getChangeDetector as Kt, writeUuid as L, TypeClass as La, AnnotationDefinition as Li, Decimal as Ln, findMember as Lo, getIndexCheck as Lr, isPropertyType as Ls, base64ToTypedArray as Lt, JSONSingle as M, TypeArray as Ma, SerializedTypes as Mi, Alpha as Mn, defaultAnnotation as Mo, executeTypeArgumentAsArray as Mr, isNullable as Ms, UnpopulatedCheck as Mt, NoTypeReceived as N, TypeBaseMember as Na, SerializerState as Ni, Alphanumeric as Nn, embeddedAnnotation as No, extractStateToFunctionAndCallIt as Nr, isOptional as Ns, arrayBufferFrom as Nt, Binary as O, TagsReflection as Oa, SerializedTypeTuple as Oi, typeInfer as On, clearTypeJitContainer as Oo, createSerializeFunction as Or, isInternal as Os, mergeDecorator as Ot, regExpFromString as P, TypeBigInt as Pa, SimpleSerializedType as Pi, Ascii as Pn, emptyObject as Po, forwardMapToArray as Pr, isPrimaryKeyType as Ps, arrayBufferTo as Pt, pathResolver as Q, TypeObjectLiteral as Qa, EmbeddedOptions as Qi, Positive as Qn, getKeyType as Qo, serializeObjectLiteral as Qr, narrowOriginalLiteral as Qs, ReflectionParameter as Qt, TypeRegistry as R, TypeDecorator as Ra, AnnotationType as Ri, EMAIL_REGEX as Rn, flatten as Ro, getMapTypeToArray as Rr, isReadonly as Rs, nodeBufferToArrayBuffer as Rt, deserializeFunction as S, ReflectionKind as Sa, ItemChanges as Sc, SerializedTypePromise as Si, RuntimeStackEntry as Sn, applyScheduledAnnotations as So, TemplateState as Sr, isCustomTypeClass as Ss, UnionToIntersection$1 as St, serialize as T, SQLite as Ta, atomicChange as Tc, SerializedTypeReference as Ti, pack as Tn, backReferenceAnnotation as To, callExtractedFunctionIfAvailable as Tr, isHidden as Ts, createFreeDecoratorContext as Tt, getOrCreateReferenceItemInfo as U, TypeInfer as Ua, BackReferenceOptionsResolved as Ui, Includes as Un, getAlias as Uo, getPropertyNameString as Ur, isType as Us, unpopulatedSymbol as Ut, createReference as V, TypeFunction as Va, BackReference as Vi, ExclusiveMaximum as Vn, float32 as Vo, getPartialSerializeFunction as Vr, isSameType as Vs, typedArrayToBase64 as Vt, getReferenceInfo as W, TypeIntersection as Wa, BinaryBigInt as Wi, MaxLength as Wn, getAnnotationMeta as Wo, getSerializeFunction as Wr, isTypeClassOf as Ws, buildChanges as Wt, referenceSymbol as X, TypeNumber as Xa, Embedded as Xi, NegativeNoZero as Xn, getDomain as Xo, serializableKinds as Xr, merge as Xs, ReflectionFunction as Xt, referenceItemSymbol as Y, TypeNull as Ya, DatabaseFieldOptions as Yi, Negative as Yn, getDeepConstructorProperties as Yo, noopTemplate as Yr, memberNameToString as Ys, ReflectionClass as Yt, Resolver as Z, TypeObject as Za, EmbeddedMeta as Zi, Pattern as Zn, getEnumValueIndexMatcher as Zo, serializeArray as Zr, mongoIdAnnotation as Zs, ReflectionMethod as Zt, snapshotSerializer as _, PrimaryKeyType as _a, AtomicChangeInstance as _c, SerializedTypeLiteral as _i, visit as _n, Unique as _o, SerializeFunction as _r, integer as _s, FreeFluidDecorator as _t, parametersToTuple as a, IndexOptions as aa, stringifyShortResolvedType as ac, underscoreNamingStrategy as ai, propertiesOf as an, TypeString as ao, ValidatorMeta as ar, getTypeObjectLiteralFromTypeClass as as, APIClass as at, cloneClass as b, ReferenceFields as ba, DeepPartial as bc, SerializedTypeObjectLiteral as bi, Processor as bn, addType as bo, TemplateHook as br, isBinary as bs, PropertyDecoratorFn as bt, assert as c, MapName as ca, typeDecorators as cc, SerializedTypeAnnotations as ci, reflectionClassSymbol as cn, TypeTuple as co, validates as cr, hasDefaultValue as cs, ClassDecoratorFn as ct, is as d, MySQLOptions as da, uint32 as dc, SerializedTypeClassType as di, resolveClassType as dn, TypeUndefined as do, Guard as dr, hasTypeInformation as ds, DualDecorator as dt, EntityOptions as ea, referenceAnnotation as ec, serializer as ei, SerializerFn as en, TypePromise as eo, Validate as er, getPermission as es, mixin as et, createSnapshot as f, ParentLessType as fa, uint8 as fc, SerializedTypeEnum as fi, resolveForeignReflectionClass as fn, TypeUnion as fo, JitStack as fr, indexAccess as fs, ExtractApiDataType as ft, getSimplePrimaryKeyHashGenerator as g, PrimaryKeyFields as ga, widenLiteral as gc, SerializedTypeIntersection as gi, valuesOf as gn, UUIDAnnotation as go, SerializationOptions as gr, int8 as gs, FreeDecoratorResult as gt, getPrimaryKeyHashGenerator as h, PrimaryKey as ha, validationAnnotation as hc, SerializedTypeInfer as hi, typeOf as hn, UUID as ho, SerializationError as hr, int32 as hs, FreeDecoratorFn as ht, isExtendable as i, Index as ia, stringifyResolvedType as ic, typeGuardObjectLiteral as ii, hasCircularReference as in, TypeRest as io, ValidatorError as ir, getTypeJitContainer as is, t as it, JSONPartialObject as j, TypeAny as ja, SerializedTypeUnion as ji, AfterNow as jn, databaseAnnotation as jo, executeTemplates as jr, isMongoIdType as js, TypedArrayClassType as jt, JSONEntity as k, Type as ka, SerializedTypeTupleMember as ki, unpack as kn, copyAndSetParent as ko, createTypeGuardFunction as kr, isMapType as ks, TypeSettings as kt, getValidatorFunction as l, MongoId as la, typeToObject as lc, SerializedTypeArray as li, removeNominal as ln, TypeTupleMember as lo, ContainerAccessor as lr, hasEmbedded as ls, ClassDecoratorResult as lt, getPrimaryKeyExtractor as m, PostgresOptions as ma, uuidAnnotation as mc, SerializedTypeIndexSignature as mi, toSignature as mn, TypeVoid as mo, RuntimeCode as mr, int16 as ms, FluidDecorator as mt, createPromiseObjectLiteral as n, FindType as na, resolveProperty as nc, typeGuardArray as ni, getNominalId as nn, TypePropertySignature as no, ValidationError as nr, getTags as ns, entity as nt, validators as o, InlineRuntimeType as oa, stringifyType as oc, validatePropertyOrParameter as oi, reflect as on, TypeSymbol as oo, validate as or, getValueType as os, APIProperty as ot, getConverterForSnapshot as p, Postgres as pa, unboxUnion as pc, SerializedTypeFunction as pi, resolveReceiveType as pn, TypeUnknown as po, NamingStrategy as pr, indexAnnotation as ps, ExtractClass as pt, isReferenceInstance as q, TypeMethodSignature as qa, Data as qi, Minimum as qn, getClassType as qo, handleUnion as qr, isWithAnnotations as qs, EntityData as qt, extendTemplateLiteral as r, Group as ra, resolveTypeMembers as rc, typeGuardEmbedded as ri, getProperty as rn, TypeRegexp as ro, ValidationErrorItem as rr, getTitle as rs, isWithDeferredDecorators as rt, AutoId as s, JitContainer as sa, typeAnnotation as sc, SerializedType as si, reflectOrUndefined as sn, TypeTemplateLiteral as so, validateFunction as sr, groupAnnotation as ss, ClassApiTypeInterface as st, _isExtendable as t, Excluded as ta, registerTypeDecorator as tc, sortSignatures as ti, TData as tn, TypeProperty as to, ValidateFunction as tr, getReferenceType as ts, defaultValue as tt, guard as u, MySQL as ua, uint16 as uc, SerializedTypeBaseMember as ui, removeTypeName as un, TypeTypeParameter as uo, EmptySerializer as ur, hasMember as us, DecoratorAndFetchSignature as ut, cast as v, Reference as va, Changes as vc, SerializedTypeMethod as vi, PackStruct as vn, Widen as vo, Serializer as vr, isAutoIncrementType as vs, Merge as vt, patch as w, ResetAnnotation as wa, Partial$1 as wc, SerializedTypePropertySignature as wi, getEnumType as wn, autoIncrementAnnotation as wo, buildFunction as wr, isGlobalTypeClass as ws, createFluidDecorator as wt, deserialize as x, ReferenceOptions as xa, Expression as xc, SerializedTypeParameter as xi, ReflectOptions as xn, annotateClass as xo, TemplateRegistry as xr, isBinaryBigIntType as xs, PropertyDecoratorResult as xt, castFunction as y, ReferenceActions as ya, ChangesInterface as yc, SerializedTypeMethodSignature as yi, Packed as yn, WithAnnotations as yo, Template as yr, isBackReferenceType as ys, PropertyApiTypeInterface as yt, ReferenceInfo as z, TypeEnum as za, Annotations as zi, Email as zn, flattenUnionTypes as zo, getNTypeToArray as zr, isReferenceType as zs, nodeBufferToTypedArray as zt };
|
|
2969
|
-
//# sourceMappingURL=type-
|
|
2969
|
+
//# sourceMappingURL=type-SyDc32SL.d.mts.map
|
|
@@ -508,4 +508,4 @@ declare type __ΩInjectMeta = any[];
|
|
|
508
508
|
declare type __ΩInject = any[];
|
|
509
509
|
//#endregion
|
|
510
510
|
export { isClassInstance as $, ensureError as A, zip as At, getCurrentFileName as B, changeClass as C, range as Ct, createStack as D, sleep as Dt, createDynamicClass as E, size as Et, formatError as F, hasProperty as G, getObjectKeysSize as H, forwardTypeArguments as I, inDebugMode as J, humanBytes as K, getClassName as L, first as M, firstKey as N, deletePathValue as O, stringifyValueWithType as Ot, fixAsyncOperation as P, isClass as Q, getClassPropertyName as R, average as S, prettyPrintObject as St, copy as T, setPathValue as Tt, getParentClass as U, getInheritanceChain as V, getPathValue as W, isArray as X, indexOf as Y, isAsyncFunction as Z, appendObject as _, last as _t, __ΩInjectMeta as a, isNull as at, assertInstanceOf as b, mergeStack as bt, AbstractClassType as c, isObject as ct, CustomError as d, isPromise as dt, isConstructable as et, ExtractClassType as f, isPrototypeOfBase as ft, __ΩExtractClassType as g, iterableSize as gt, __ΩCustomError as h, isUndefined as ht, __ΩInject as i, isIterable as it, escapeRegExp as j, empty as k, time as kt, AsyncFunction as l, isObjectLiteral as lt, __ΩClassType as m, isString as mt, InjectMeta as n, isGlobalClass as nt, __ΩTypeAnnotation as o, isNumber as ot, __ΩAbstractClassType as p, isSet as pt, identifyType as q, TypeAnnotation as r, isInteger as rt, CompilerContext as s, isNumeric as st, Inject as t, isFunction as tt, ClassType as u, isPlainObject as ut, applyDefaults as v, lastKey as vt, collectForMicrotask as w, rangeArray as wt, asyncOperation as x, prependObjectKeys as xt, assertDefined as y, mergePromiseStack as yt, getClassTypeFromInstance as z };
|
|
511
|
-
//# sourceMappingURL=types-
|
|
511
|
+
//# sourceMappingURL=types-DYGcIrk3.d.mts.map
|
package/dist/types.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as SerializedTypes } from "./reflection-
|
|
2
|
-
import { Yt as ReflectionClass } from "./type-
|
|
1
|
+
import { S as SerializedTypes } from "./reflection-lA4jBKKP.mjs";
|
|
2
|
+
import { Yt as ReflectionClass } from "./type-SyDc32SL.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/types.d.ts
|
|
5
5
|
type Reflection<T extends Record<string, any> = Record<string, any>> = ReflectionClass<T> & {
|
package/dist/utilities.cjs
CHANGED
|
@@ -1,10 +1,118 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const
|
|
2
|
+
const require_chunk = require('./chunk-BmvPcxpV.cjs');
|
|
3
|
+
const require_type = require('./type-C7UXbXfx.cjs');
|
|
4
|
+
let _stryke_type_checks = require("@stryke/type-checks");
|
|
5
|
+
let _stryke_helpers_get_unique = require("@stryke/helpers/get-unique");
|
|
6
|
+
let _stryke_json_storm_json = require("@stryke/json/storm-json");
|
|
7
|
+
let _stryke_type_checks_is_null = require("@stryke/type-checks/is-null");
|
|
8
|
+
let _stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
|
|
9
|
+
let _stryke_type_checks_is_undefined = require("@stryke/type-checks/is-undefined");
|
|
3
10
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
//#region src/utilities.ts
|
|
12
|
+
/**
|
|
13
|
+
* Converts any {@link ReflectionProperty}, {@link ReflectionParameter}, or {@link ReflectionKind}'s value to string representation.
|
|
14
|
+
*
|
|
15
|
+
* @param property - The {@link ReflectionProperty}, {@link ReflectionParameter}, or {@link ReflectionKind} containing the value to stringify.
|
|
16
|
+
* @param value - The value to stringify.
|
|
17
|
+
* @returns A string representation of the value.
|
|
18
|
+
*/
|
|
19
|
+
function stringifyDefaultValue(property, value) {
|
|
20
|
+
return (0, _stryke_type_checks.isSetObject)(property) ? stringifyValue(property.type, value ?? property.getDefaultValue()) : stringifyValue({ kind: property }, value);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Stringifies a value as a string.
|
|
24
|
+
*
|
|
25
|
+
* @param value - The value to stringify.
|
|
26
|
+
* @returns A string representation of the value.
|
|
27
|
+
*/
|
|
28
|
+
function stringifyStringValue(value) {
|
|
29
|
+
return `"${String(value).replaceAll("\"", "\\\"")}"`;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Converts any {@link Type}'s actual value to string representation.
|
|
33
|
+
*
|
|
34
|
+
* @param type - The {@link Type} of the value to stringify.
|
|
35
|
+
* @param value - The value to stringify.
|
|
36
|
+
* @returns A string representation of the value.
|
|
37
|
+
*/
|
|
38
|
+
function stringifyValue(type, value) {
|
|
39
|
+
return (0, _stryke_type_checks_is_undefined.isUndefined)(value) ? "undefined" : (0, _stryke_type_checks_is_null.isNull)(value) ? "null" : type.kind === require_type.ReflectionKind.boolean ? String(value).trim().toLowerCase() === "true" ? "true" : "false" : type.kind === require_type.ReflectionKind.string || type.kind === require_type.ReflectionKind.literal && (0, _stryke_type_checks_is_string.isString)(type.literal) ? stringifyStringValue(value) : type.kind === require_type.ReflectionKind.enum ? getEnumReflectionType(type).kind === require_type.ReflectionKind.string ? stringifyStringValue(value) : `${String(value)}` : type.kind === require_type.ReflectionKind.union ? isStringUnion(type) ? stringifyStringValue(value) : `${String(value)}` : type.kind === require_type.ReflectionKind.array ? stringifyStringValue(_stryke_json_storm_json.StormJSON.stringify(value)) : type.kind === require_type.ReflectionKind.object || type.kind === require_type.ReflectionKind.objectLiteral ? _stryke_json_storm_json.StormJSON.stringify(value) : (type.kind === require_type.ReflectionKind.property || type.kind === require_type.ReflectionKind.parameter) && type.type?.kind ? stringifyValue(type.type, value) : String(value)?.includes("\"") || String(value)?.includes("'") ? stringifyStringValue(value) : String(value);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Converts a {@link TypeEnum} to its underlying primitive type representation.
|
|
43
|
+
*
|
|
44
|
+
* @param type - The {@link TypeEnum} to evaluate.
|
|
45
|
+
* @returns A string representation of the primitive type.
|
|
46
|
+
*/
|
|
47
|
+
function getEnumReflectionType(type) {
|
|
48
|
+
if (type.kind !== require_type.ReflectionKind.enum) throw new Error(`Expected a TypeEnum, but received ${type.kind}.`);
|
|
49
|
+
const unique = (0, _stryke_helpers_get_unique.getUniqueBy)(type.values.filter((value) => value !== void 0 && value !== null), (enumMember) => (0, _stryke_type_checks_is_string.isString)(enumMember) ? { kind: require_type.ReflectionKind.string } : { kind: require_type.ReflectionKind.number });
|
|
50
|
+
if (unique.length === 0) throw new Error(`No valid enum members could be found.`);
|
|
51
|
+
return unique[0] && (0, _stryke_type_checks_is_string.isString)(unique[0]) ? { kind: require_type.ReflectionKind.string } : { kind: require_type.ReflectionKind.number };
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Converts a {@link TypeUnion} to its underlying primitive type representation.
|
|
55
|
+
*
|
|
56
|
+
* @param type - The {@link TypeUnion} to evaluate.
|
|
57
|
+
* @returns A string representation of the primitive type.
|
|
58
|
+
*/
|
|
59
|
+
function getUnionTypes(type) {
|
|
60
|
+
if (type.kind === require_type.ReflectionKind.union && type.types.length > 0) return (0, _stryke_helpers_get_unique.getUniqueBy)(type.types, (member) => member.kind);
|
|
61
|
+
throw new Error(`Expected a TypeUnion, but received ${type.kind}.`);
|
|
62
|
+
}
|
|
63
|
+
function isStringUnion(type) {
|
|
64
|
+
return getUnionTypes(type).some((member) => member.kind === require_type.ReflectionKind.string || member.kind === require_type.ReflectionKind.literal && (0, _stryke_type_checks_is_string.isString)(member.literal));
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Converts a ReflectionKind to its string representation.
|
|
68
|
+
*
|
|
69
|
+
* @param kind - The {@link ReflectionKind} to convert.
|
|
70
|
+
* @returns A string representation of the kind.
|
|
71
|
+
*/
|
|
72
|
+
function kindToName(kind) {
|
|
73
|
+
if (kind === require_type.ReflectionKind.void) return "void";
|
|
74
|
+
else if (kind === require_type.ReflectionKind.never) return "never";
|
|
75
|
+
else if (kind === require_type.ReflectionKind.null) return "null";
|
|
76
|
+
else if (kind === require_type.ReflectionKind.undefined) return "undefined";
|
|
77
|
+
else if (kind === require_type.ReflectionKind.symbol) return "symbol";
|
|
78
|
+
else if (kind === require_type.ReflectionKind.bigint) return "bigint";
|
|
79
|
+
else if (kind === require_type.ReflectionKind.number) return "number";
|
|
80
|
+
else if (kind === require_type.ReflectionKind.string) return "string";
|
|
81
|
+
else if (kind === require_type.ReflectionKind.boolean) return "boolean";
|
|
82
|
+
else if (kind === require_type.ReflectionKind.literal) return "literal";
|
|
83
|
+
else if (kind === require_type.ReflectionKind.class) return "class";
|
|
84
|
+
else if (kind === require_type.ReflectionKind.array) return "array";
|
|
85
|
+
else if (kind === require_type.ReflectionKind.object) return "object";
|
|
86
|
+
else if (kind === require_type.ReflectionKind.objectLiteral) return "objectLiteral";
|
|
87
|
+
else if (kind === require_type.ReflectionKind.union) return "union";
|
|
88
|
+
else if (kind === require_type.ReflectionKind.enum) return "enum";
|
|
89
|
+
else if (kind === require_type.ReflectionKind.regexp) return "regexp";
|
|
90
|
+
else if (kind === require_type.ReflectionKind.templateLiteral) return "templateLiteral";
|
|
91
|
+
else if (kind === require_type.ReflectionKind.property) return "property";
|
|
92
|
+
else if (kind === require_type.ReflectionKind.method) return "method";
|
|
93
|
+
else if (kind === require_type.ReflectionKind.function) return "function";
|
|
94
|
+
else if (kind === require_type.ReflectionKind.parameter) return "parameter";
|
|
95
|
+
else if (kind === require_type.ReflectionKind.promise) return "promise";
|
|
96
|
+
else if (kind === require_type.ReflectionKind.typeParameter) return "typeParameter";
|
|
97
|
+
else if (kind === require_type.ReflectionKind.tuple) return "tuple";
|
|
98
|
+
else if (kind === require_type.ReflectionKind.tupleMember) return "tupleMember";
|
|
99
|
+
else if (kind === require_type.ReflectionKind.enumMember) return "enumMember";
|
|
100
|
+
else if (kind === require_type.ReflectionKind.rest) return "rest";
|
|
101
|
+
else if (kind === require_type.ReflectionKind.indexSignature) return "indexSignature";
|
|
102
|
+
else if (kind === require_type.ReflectionKind.propertySignature) return "propertySignature";
|
|
103
|
+
else if (kind === require_type.ReflectionKind.methodSignature) return "methodSignature";
|
|
104
|
+
else if (kind === require_type.ReflectionKind.infer) return "infer";
|
|
105
|
+
else if (kind === require_type.ReflectionKind.callSignature) return "callSignature";
|
|
106
|
+
else if (kind === require_type.ReflectionKind.any) return "any";
|
|
107
|
+
else if (kind === require_type.ReflectionKind.intersection) return "intersection";
|
|
108
|
+
return "unknown";
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
//#endregion
|
|
112
|
+
exports.getEnumReflectionType = getEnumReflectionType;
|
|
113
|
+
exports.getUnionTypes = getUnionTypes;
|
|
114
|
+
exports.isStringUnion = isStringUnion;
|
|
115
|
+
exports.kindToName = kindToName;
|
|
116
|
+
exports.stringifyDefaultValue = stringifyDefaultValue;
|
|
117
|
+
exports.stringifyStringValue = stringifyStringValue;
|
|
118
|
+
exports.stringifyValue = stringifyValue;
|
package/dist/utilities.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $t as ReflectionProperty, Qt as ReflectionParameter, Sa as ReflectionKind, Xa as TypeNumber, ao as TypeString, ka as Type } from "./type-
|
|
1
|
+
import { $t as ReflectionProperty, Qt as ReflectionParameter, Sa as ReflectionKind, Xa as TypeNumber, ao as TypeString, ka as Type } from "./type-SyDc32SL.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/utilities.d.ts
|
|
4
4
|
/**
|
package/dist/utilities.mjs
CHANGED
|
@@ -1,3 +1,111 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { vn as ReflectionKind } from "./type-ma8o4dJG.mjs";
|
|
2
|
+
import { isSetObject } from "@stryke/type-checks";
|
|
3
|
+
import { getUniqueBy } from "@stryke/helpers/get-unique";
|
|
4
|
+
import { StormJSON } from "@stryke/json/storm-json";
|
|
5
|
+
import { isNull } from "@stryke/type-checks/is-null";
|
|
6
|
+
import { isString as isString$1 } from "@stryke/type-checks/is-string";
|
|
7
|
+
import { isUndefined as isUndefined$1 } from "@stryke/type-checks/is-undefined";
|
|
2
8
|
|
|
3
|
-
|
|
9
|
+
//#region src/utilities.ts
|
|
10
|
+
/**
|
|
11
|
+
* Converts any {@link ReflectionProperty}, {@link ReflectionParameter}, or {@link ReflectionKind}'s value to string representation.
|
|
12
|
+
*
|
|
13
|
+
* @param property - The {@link ReflectionProperty}, {@link ReflectionParameter}, or {@link ReflectionKind} containing the value to stringify.
|
|
14
|
+
* @param value - The value to stringify.
|
|
15
|
+
* @returns A string representation of the value.
|
|
16
|
+
*/
|
|
17
|
+
function stringifyDefaultValue(property, value) {
|
|
18
|
+
return isSetObject(property) ? stringifyValue(property.type, value ?? property.getDefaultValue()) : stringifyValue({ kind: property }, value);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Stringifies a value as a string.
|
|
22
|
+
*
|
|
23
|
+
* @param value - The value to stringify.
|
|
24
|
+
* @returns A string representation of the value.
|
|
25
|
+
*/
|
|
26
|
+
function stringifyStringValue(value) {
|
|
27
|
+
return `"${String(value).replaceAll("\"", "\\\"")}"`;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Converts any {@link Type}'s actual value to string representation.
|
|
31
|
+
*
|
|
32
|
+
* @param type - The {@link Type} of the value to stringify.
|
|
33
|
+
* @param value - The value to stringify.
|
|
34
|
+
* @returns A string representation of the value.
|
|
35
|
+
*/
|
|
36
|
+
function stringifyValue(type, value) {
|
|
37
|
+
return isUndefined$1(value) ? "undefined" : isNull(value) ? "null" : type.kind === ReflectionKind.boolean ? String(value).trim().toLowerCase() === "true" ? "true" : "false" : type.kind === ReflectionKind.string || type.kind === ReflectionKind.literal && isString$1(type.literal) ? stringifyStringValue(value) : type.kind === ReflectionKind.enum ? getEnumReflectionType(type).kind === ReflectionKind.string ? stringifyStringValue(value) : `${String(value)}` : type.kind === ReflectionKind.union ? isStringUnion(type) ? stringifyStringValue(value) : `${String(value)}` : type.kind === ReflectionKind.array ? stringifyStringValue(StormJSON.stringify(value)) : type.kind === ReflectionKind.object || type.kind === ReflectionKind.objectLiteral ? StormJSON.stringify(value) : (type.kind === ReflectionKind.property || type.kind === ReflectionKind.parameter) && type.type?.kind ? stringifyValue(type.type, value) : String(value)?.includes("\"") || String(value)?.includes("'") ? stringifyStringValue(value) : String(value);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Converts a {@link TypeEnum} to its underlying primitive type representation.
|
|
41
|
+
*
|
|
42
|
+
* @param type - The {@link TypeEnum} to evaluate.
|
|
43
|
+
* @returns A string representation of the primitive type.
|
|
44
|
+
*/
|
|
45
|
+
function getEnumReflectionType(type) {
|
|
46
|
+
if (type.kind !== ReflectionKind.enum) throw new Error(`Expected a TypeEnum, but received ${type.kind}.`);
|
|
47
|
+
const unique = getUniqueBy(type.values.filter((value) => value !== void 0 && value !== null), (enumMember) => isString$1(enumMember) ? { kind: ReflectionKind.string } : { kind: ReflectionKind.number });
|
|
48
|
+
if (unique.length === 0) throw new Error(`No valid enum members could be found.`);
|
|
49
|
+
return unique[0] && isString$1(unique[0]) ? { kind: ReflectionKind.string } : { kind: ReflectionKind.number };
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Converts a {@link TypeUnion} to its underlying primitive type representation.
|
|
53
|
+
*
|
|
54
|
+
* @param type - The {@link TypeUnion} to evaluate.
|
|
55
|
+
* @returns A string representation of the primitive type.
|
|
56
|
+
*/
|
|
57
|
+
function getUnionTypes(type) {
|
|
58
|
+
if (type.kind === ReflectionKind.union && type.types.length > 0) return getUniqueBy(type.types, (member) => member.kind);
|
|
59
|
+
throw new Error(`Expected a TypeUnion, but received ${type.kind}.`);
|
|
60
|
+
}
|
|
61
|
+
function isStringUnion(type) {
|
|
62
|
+
return getUnionTypes(type).some((member) => member.kind === ReflectionKind.string || member.kind === ReflectionKind.literal && isString$1(member.literal));
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Converts a ReflectionKind to its string representation.
|
|
66
|
+
*
|
|
67
|
+
* @param kind - The {@link ReflectionKind} to convert.
|
|
68
|
+
* @returns A string representation of the kind.
|
|
69
|
+
*/
|
|
70
|
+
function kindToName(kind) {
|
|
71
|
+
if (kind === ReflectionKind.void) return "void";
|
|
72
|
+
else if (kind === ReflectionKind.never) return "never";
|
|
73
|
+
else if (kind === ReflectionKind.null) return "null";
|
|
74
|
+
else if (kind === ReflectionKind.undefined) return "undefined";
|
|
75
|
+
else if (kind === ReflectionKind.symbol) return "symbol";
|
|
76
|
+
else if (kind === ReflectionKind.bigint) return "bigint";
|
|
77
|
+
else if (kind === ReflectionKind.number) return "number";
|
|
78
|
+
else if (kind === ReflectionKind.string) return "string";
|
|
79
|
+
else if (kind === ReflectionKind.boolean) return "boolean";
|
|
80
|
+
else if (kind === ReflectionKind.literal) return "literal";
|
|
81
|
+
else if (kind === ReflectionKind.class) return "class";
|
|
82
|
+
else if (kind === ReflectionKind.array) return "array";
|
|
83
|
+
else if (kind === ReflectionKind.object) return "object";
|
|
84
|
+
else if (kind === ReflectionKind.objectLiteral) return "objectLiteral";
|
|
85
|
+
else if (kind === ReflectionKind.union) return "union";
|
|
86
|
+
else if (kind === ReflectionKind.enum) return "enum";
|
|
87
|
+
else if (kind === ReflectionKind.regexp) return "regexp";
|
|
88
|
+
else if (kind === ReflectionKind.templateLiteral) return "templateLiteral";
|
|
89
|
+
else if (kind === ReflectionKind.property) return "property";
|
|
90
|
+
else if (kind === ReflectionKind.method) return "method";
|
|
91
|
+
else if (kind === ReflectionKind.function) return "function";
|
|
92
|
+
else if (kind === ReflectionKind.parameter) return "parameter";
|
|
93
|
+
else if (kind === ReflectionKind.promise) return "promise";
|
|
94
|
+
else if (kind === ReflectionKind.typeParameter) return "typeParameter";
|
|
95
|
+
else if (kind === ReflectionKind.tuple) return "tuple";
|
|
96
|
+
else if (kind === ReflectionKind.tupleMember) return "tupleMember";
|
|
97
|
+
else if (kind === ReflectionKind.enumMember) return "enumMember";
|
|
98
|
+
else if (kind === ReflectionKind.rest) return "rest";
|
|
99
|
+
else if (kind === ReflectionKind.indexSignature) return "indexSignature";
|
|
100
|
+
else if (kind === ReflectionKind.propertySignature) return "propertySignature";
|
|
101
|
+
else if (kind === ReflectionKind.methodSignature) return "methodSignature";
|
|
102
|
+
else if (kind === ReflectionKind.infer) return "infer";
|
|
103
|
+
else if (kind === ReflectionKind.callSignature) return "callSignature";
|
|
104
|
+
else if (kind === ReflectionKind.any) return "any";
|
|
105
|
+
else if (kind === ReflectionKind.intersection) return "intersection";
|
|
106
|
+
return "unknown";
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
//#endregion
|
|
110
|
+
export { getEnumReflectionType, getUnionTypes, isStringUnion, kindToName, stringifyDefaultValue, stringifyStringValue, stringifyValue };
|
|
111
|
+
//# sourceMappingURL=utilities.mjs.map
|
package/dist/vendor/core.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as isClassInstance, A as ensureError, At as zip, B as getCurrentFileName, C as changeClass, Ct as range, D as createStack, Dt as sleep, E as createDynamicClass, Et as size, F as formatError, G as hasProperty, H as getObjectKeysSize, I as forwardTypeArguments, J as inDebugMode, K as humanBytes, L as getClassName, M as first, N as firstKey, O as deletePathValue, Ot as stringifyValueWithType, P as fixAsyncOperation, Q as isClass, R as getClassPropertyName, S as average, St as prettyPrintObject, T as copy, Tt as setPathValue, U as getParentClass, V as getInheritanceChain, W as getPathValue, X as isArray, Y as indexOf, Z as isAsyncFunction, _ as appendObject, _t as last, a as __ΩInjectMeta, at as isNull, b as assertInstanceOf, bt as mergeStack, c as AbstractClassType, ct as isObject, d as CustomError, dt as isPromise, et as isConstructable, f as ExtractClassType, ft as isPrototypeOfBase, g as __ΩExtractClassType, gt as iterableSize, h as __ΩCustomError, ht as isUndefined, i as __ΩInject, it as isIterable, j as escapeRegExp, k as empty, kt as time, l as AsyncFunction, lt as isObjectLiteral, m as __ΩClassType, mt as isString, n as InjectMeta, nt as isGlobalClass, o as __ΩTypeAnnotation, ot as isNumber, p as __ΩAbstractClassType, pt as isSet, q as identifyType, r as TypeAnnotation, rt as isInteger, s as CompilerContext, st as isNumeric, t as Inject, tt as isFunction, u as ClassType, ut as isPlainObject, v as applyDefaults, vt as lastKey, w as collectForMicrotask, wt as rangeArray, x as asyncOperation, xt as prependObjectKeys, y as assertDefined, yt as mergePromiseStack, z as getClassTypeFromInstance } from "../types-
|
|
1
|
+
import { $ as isClassInstance, A as ensureError, At as zip, B as getCurrentFileName, C as changeClass, Ct as range, D as createStack, Dt as sleep, E as createDynamicClass, Et as size, F as formatError, G as hasProperty, H as getObjectKeysSize, I as forwardTypeArguments, J as inDebugMode, K as humanBytes, L as getClassName, M as first, N as firstKey, O as deletePathValue, Ot as stringifyValueWithType, P as fixAsyncOperation, Q as isClass, R as getClassPropertyName, S as average, St as prettyPrintObject, T as copy, Tt as setPathValue, U as getParentClass, V as getInheritanceChain, W as getPathValue, X as isArray, Y as indexOf, Z as isAsyncFunction, _ as appendObject, _t as last, a as __ΩInjectMeta, at as isNull, b as assertInstanceOf, bt as mergeStack, c as AbstractClassType, ct as isObject, d as CustomError, dt as isPromise, et as isConstructable, f as ExtractClassType, ft as isPrototypeOfBase, g as __ΩExtractClassType, gt as iterableSize, h as __ΩCustomError, ht as isUndefined, i as __ΩInject, it as isIterable, j as escapeRegExp, k as empty, kt as time, l as AsyncFunction, lt as isObjectLiteral, m as __ΩClassType, mt as isString, n as InjectMeta, nt as isGlobalClass, o as __ΩTypeAnnotation, ot as isNumber, p as __ΩAbstractClassType, pt as isSet, q as identifyType, r as TypeAnnotation, rt as isInteger, s as CompilerContext, st as isNumeric, t as Inject, tt as isFunction, u as ClassType, ut as isPlainObject, v as applyDefaults, vt as lastKey, w as collectForMicrotask, wt as rangeArray, x as asyncOperation, xt as prependObjectKeys, y as assertDefined, yt as mergePromiseStack, z as getClassTypeFromInstance } from "../types-DYGcIrk3.mjs";
|
|
2
2
|
|
|
3
3
|
//#region ../../node_modules/.pnpm/@deepkit+core@1.0.5_patch_hash=8c3beca4372c6a8941162780ddd0f977ef3d461c2018f0809f86f416260ba440/node_modules/@deepkit/core/dist/cjs/src/decorators.d.ts
|
|
4
4
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_compiler = require('../../compiler-
|
|
2
|
+
const require_compiler = require('../../compiler-TYAnj4GK.cjs');
|
|
3
3
|
|
|
4
4
|
exports.Cache = require_compiler.Cache;
|
|
5
5
|
exports.DeclarationTransformer = require_compiler.DeclarationTransformer;
|