xml-model 1.3.0 → 1.3.1

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.
Files changed (39) hide show
  1. package/dist/index.js +2 -42
  2. package/dist/model/index.js +1 -2
  3. package/dist/model/property.js +1 -2
  4. package/package.json +3 -3
  5. package/vite/dist/node_modules/typescript-rtti/dist.esm/common/format.js +2 -0
  6. package/vite/dist/node_modules/typescript-rtti/dist.esm/common/index.js +2 -0
  7. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/api-call-transformer.js +2 -0
  8. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/common/class-analyzer.js +2 -0
  9. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/common/compile-error.js +2 -0
  10. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/common/import-analyzer.js +2 -0
  11. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/common/interface-analyzer.js +2 -0
  12. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/common/visitor-base.js +2 -0
  13. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/declarations-emitter.js +2 -0
  14. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/encode-parameter.js +2 -0
  15. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/find-relative-path.js +2 -0
  16. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/flags.js +2 -0
  17. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/forward-ref.js +2 -0
  18. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/get-exports-for-symbol.js +2 -0
  19. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/index.js +2 -0
  20. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/legacy-decorator.js +2 -0
  21. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/legacy-type-encoder.js +2 -0
  22. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/literal-node.js +2 -0
  23. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/metadata-collector.js +2 -0
  24. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/metadata-decorator.js +2 -0
  25. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/metadata-emitter.js +2 -0
  26. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/metadata-encoder.js +2 -0
  27. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/rt-helper.js +2 -0
  28. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/rtti-visitor-base.js +2 -0
  29. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/serialize.js +2 -0
  30. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/type-encoder.js +2 -0
  31. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/type-literal.js +3 -1
  32. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/utils.js +4 -2
  33. package/vite/dist/node_modules/typescript-rtti/dist.esm/transformer/workarounds.js +2 -0
  34. package/dist/node_modules/typescript-rtti/dist.esm/common/format.js +0 -106
  35. package/dist/node_modules/typescript-rtti/dist.esm/index.js +0 -2
  36. package/dist/node_modules/typescript-rtti/dist.esm/lib/get-parameter-names.js +0 -15
  37. package/dist/node_modules/typescript-rtti/dist.esm/lib/index.js +0 -43
  38. package/dist/node_modules/typescript-rtti/dist.esm/lib/reflect.js +0 -2225
  39. package/dist/node_modules/typescript-rtti/dist.esm/lib/sealed.js +0 -13
package/dist/index.js CHANGED
@@ -1,10 +1,9 @@
1
1
  import { defaults } from "./defaults.js";
2
2
  import { Model, createModel } from "./model/index.js";
3
3
  import { FromXMLConversionError, PropertyFromXMLConversionError, PropertyToXMLConversionError, ToXMLConversionError } from "./errors.js";
4
- import "./node_modules/typescript-rtti/dist.esm/index.js";
4
+ export * from "typescript-rtti";
5
5
  import { default as default2 } from "./xml/index.js";
6
6
  import { Prop } from "./model/property.js";
7
- import { ReflectedAnyRef, ReflectedArrayRef, ReflectedCallSite, ReflectedClass, ReflectedClassRef, ReflectedConstructorParameter, ReflectedEnumRef, ReflectedFalseRef, ReflectedFlags, ReflectedFunction, ReflectedFunctionParameter, ReflectedFunctionRef, ReflectedGenericRef, ReflectedInterfaceRef, ReflectedIntersectionRef, ReflectedLiteralRef, ReflectedMappedRef, ReflectedMember, ReflectedMethod, ReflectedMethodParameter, ReflectedNullRef, ReflectedObjectMember, ReflectedObjectRef, ReflectedParameter, ReflectedProperty, ReflectedTrueRef, ReflectedTupleElement, ReflectedTupleRef, ReflectedTypeRef, ReflectedUndefinedRef, ReflectedUnionRef, ReflectedUnknownRef, ReflectedVoidRef, TYPE_REF_KIND_EXPANSION, implementsInterface, isCallSite, matchesShape, reflect, reify } from "./node_modules/typescript-rtti/dist.esm/lib/reflect.js";
8
7
  import { getModel } from "./model/registry.js";
9
8
  export {
10
9
  FromXMLConversionError,
@@ -12,49 +11,10 @@ export {
12
11
  Prop,
13
12
  PropertyFromXMLConversionError,
14
13
  PropertyToXMLConversionError,
15
- ReflectedAnyRef,
16
- ReflectedArrayRef,
17
- ReflectedCallSite,
18
- ReflectedClass,
19
- ReflectedClassRef,
20
- ReflectedConstructorParameter,
21
- ReflectedEnumRef,
22
- ReflectedFalseRef,
23
- ReflectedFlags,
24
- ReflectedFunction,
25
- ReflectedFunctionParameter,
26
- ReflectedFunctionRef,
27
- ReflectedGenericRef,
28
- ReflectedInterfaceRef,
29
- ReflectedIntersectionRef,
30
- ReflectedLiteralRef,
31
- ReflectedMappedRef,
32
- ReflectedMember,
33
- ReflectedMethod,
34
- ReflectedMethodParameter,
35
- ReflectedNullRef,
36
- ReflectedObjectMember,
37
- ReflectedObjectRef,
38
- ReflectedParameter,
39
- ReflectedProperty,
40
- ReflectedTrueRef,
41
- ReflectedTupleElement,
42
- ReflectedTupleRef,
43
- ReflectedTypeRef,
44
- ReflectedUndefinedRef,
45
- ReflectedUnionRef,
46
- ReflectedUnknownRef,
47
- ReflectedVoidRef,
48
- TYPE_REF_KIND_EXPANSION,
49
14
  ToXMLConversionError,
50
15
  default2 as XML,
51
16
  createModel,
52
17
  defaults,
53
- getModel,
54
- implementsInterface,
55
- isCallSite,
56
- matchesShape,
57
- reflect,
58
- reify
18
+ getModel
59
19
  };
60
20
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
3
  import "../_virtual/Reflect.js";
4
- import "../node_modules/typescript-rtti/dist.esm/index.js";
4
+ import { reflect } from "typescript-rtti";
5
5
  import { ToXMLConversionError, PropertyToXMLConversionError, FromXMLConversionError, PropertyFromXMLConversionError } from "../errors.js";
6
6
  import mergeMaps from "../util/merge-maps.js";
7
7
  import { resolve, MiddlewareChain } from "../middleware.js";
@@ -12,7 +12,6 @@ import { defaults } from "../defaults.js";
12
12
  import { findModel, registrerModel } from "./registry.js";
13
13
  import { getModel } from "./registry.js";
14
14
  import registerBuiltIns from "./built-ins.js";
15
- import { reflect } from "../node_modules/typescript-rtti/dist.esm/lib/reflect.js";
16
15
  function* ParentChain(constructor) {
17
16
  let parent = Object.getPrototypeOf(constructor);
18
17
  if (parent === constructor) {
@@ -1,9 +1,8 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
- import "../node_modules/typescript-rtti/dist.esm/index.js";
3
+ import { reflect } from "typescript-rtti";
4
4
  import { defaults } from "../defaults.js";
5
5
  import isRegExp from "../util/is-regexp.js";
6
- import { reflect } from "../node_modules/typescript-rtti/dist.esm/lib/reflect.js";
7
6
  function resolvePropertyConversionOptions(options, constructor, property) {
8
7
  const _options = {
9
8
  name: property,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xml-model",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "allows transparent XML <-> Object conversion in typescript",
5
5
  "license": "MIT",
6
6
  "author": "MathisTLD",
@@ -34,6 +34,7 @@
34
34
  "prepare": "husky"
35
35
  },
36
36
  "dependencies": {
37
+ "typescript-rtti": "0.9.6",
37
38
  "xml-js": "^1.6.11"
38
39
  },
39
40
  "devDependencies": {
@@ -46,13 +47,12 @@
46
47
  "oxlint": "^1.43.0",
47
48
  "reflect-metadata": "^0.1.14",
48
49
  "typescript": "*",
49
- "typescript-rtti": "^0.9.6",
50
50
  "vite": "*",
51
51
  "vitest": "^4.0.18"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "@rollup/plugin-typescript": "^12.3.0",
55
- "typescript": "^5.1.0",
55
+ "typescript": "~5.1.6",
56
56
  "vite": "^7.3.1"
57
57
  },
58
58
  "peerDependenciesMeta": {
@@ -1,3 +1,5 @@
1
+ import { createRequire } from "node:module";
2
+ const require$1 = createRequire(import.meta.url);
1
3
  const F_READONLY = "R";
2
4
  const F_ABSTRACT = "A";
3
5
  const F_PUBLIC = "$";
@@ -1,4 +1,6 @@
1
+ import { createRequire } from "node:module";
1
2
  import { F_ABSTRACT, F_ARRAY_BINDING, F_ARROW_FUNCTION, F_ASYNC, F_CLASS, F_EXPORTED, F_FUNCTION, F_INFERRED, F_INTERFACE, F_METHOD, F_OBJECT_BINDING, F_OMITTED, F_OPTIONAL, F_PRIVATE, F_PROPERTY, F_PROTECTED, F_PUBLIC, F_READONLY, F_REST, F_STATIC, TI_ANY, TI_FALSE, TI_NULL, TI_THIS, TI_TRUE, TI_UNDEFINED, TI_UNKNOWN, TI_VOID, T_ANY, T_ARRAY, T_CALLSITE, T_ENUM, T_FALSE, T_FUNCTION, T_GENERIC, T_INTERSECTION, T_INTRINSICS, T_MAPPED, T_NULL, T_OBJECT, T_STAND_IN, T_THIS, T_TRUE, T_TUPLE, T_UNDEFINED, T_UNION, T_UNKNOWN, T_VOID, isLiteralNode } from "./format.js";
3
+ const require$1 = createRequire(import.meta.url);
2
4
  export {
3
5
  F_ABSTRACT,
4
6
  F_ARRAY_BINDING,
@@ -5,6 +5,7 @@ import { RttiVisitor } from "./rtti-visitor-base.js";
5
5
  import { serialize } from "./serialize.js";
6
6
  import { TypeEncoder } from "./type-encoder.js";
7
7
  import { literalNode } from "./literal-node.js";
8
+ import { createRequire } from "node:module";
8
9
  var __decorate = function(decorators, target, key, desc) {
9
10
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
10
11
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -14,6 +15,7 @@ var __decorate = function(decorators, target, key, desc) {
14
15
  var __metadata = function(k, v) {
15
16
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
16
17
  };
18
+ const require$1 = createRequire(import.meta.url);
17
19
  class ApiCallTransformer extends RttiVisitor {
18
20
  constructor() {
19
21
  super(...arguments);
@@ -1,6 +1,7 @@
1
1
  import { VisitorBase, Visit } from "./visitor-base.js";
2
2
  import ts from "typescript";
3
3
  import { getModifiers } from "../utils.js";
4
+ import { createRequire } from "node:module";
4
5
  var __decorate = function(decorators, target, key, desc) {
5
6
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
6
7
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -10,6 +11,7 @@ var __decorate = function(decorators, target, key, desc) {
10
11
  var __metadata = function(k, v) {
11
12
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
12
13
  };
14
+ const require$1 = createRequire(import.meta.url);
13
15
  class ClassAnalyzer extends VisitorBase {
14
16
  constructor() {
15
17
  super(...arguments);
@@ -1,3 +1,5 @@
1
+ import { createRequire } from "node:module";
2
+ const require$1 = createRequire(import.meta.url);
1
3
  class CompileError extends Error {
2
4
  }
3
5
  export {
@@ -1,6 +1,7 @@
1
1
  import { Visit } from "./visitor-base.js";
2
2
  import ts from "typescript";
3
3
  import { RttiVisitor } from "../rtti-visitor-base.js";
4
+ import { createRequire } from "node:module";
4
5
  var __decorate = function(decorators, target, key, desc) {
5
6
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
6
7
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -10,6 +11,7 @@ var __decorate = function(decorators, target, key, desc) {
10
11
  var __metadata = function(k, v) {
11
12
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
12
13
  };
14
+ const require$1 = createRequire(import.meta.url);
13
15
  class ImportAnalyzer extends RttiVisitor {
14
16
  static analyze(file, ctx) {
15
17
  let analyzer = new ImportAnalyzer(ctx);
@@ -1,5 +1,6 @@
1
1
  import { VisitorBase, Visit } from "./visitor-base.js";
2
2
  import ts from "typescript";
3
+ import { createRequire } from "node:module";
3
4
  var __decorate = function(decorators, target, key, desc) {
4
5
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
5
6
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -9,6 +10,7 @@ var __decorate = function(decorators, target, key, desc) {
9
10
  var __metadata = function(k, v) {
10
11
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
11
12
  };
13
+ const require$1 = createRequire(import.meta.url);
12
14
  class InterfaceAnalyzer extends VisitorBase {
13
15
  constructor() {
14
16
  super(...arguments);
@@ -1,4 +1,5 @@
1
1
  import ts from "typescript";
2
+ import { createRequire } from "node:module";
2
3
  var __classPrivateFieldGet = function(receiver, state, kind, f) {
3
4
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
4
5
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
@@ -11,6 +12,7 @@ var __classPrivateFieldSet = function(receiver, state, value, kind, f) {
11
12
  return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
12
13
  };
13
14
  var _VisitorBase_instances, _VisitorBase_visitationMap, _VisitorBase_buildMap, _VisitorBase_visitor;
15
+ const require$1 = createRequire(import.meta.url);
14
16
  function Visit(kind) {
15
17
  if (!Array.isArray(kind))
16
18
  kind = [kind];
@@ -1,6 +1,7 @@
1
1
  import { Visit } from "./common/visitor-base.js";
2
2
  import { RttiVisitor } from "./rtti-visitor-base.js";
3
3
  import ts from "typescript";
4
+ import { createRequire } from "node:module";
4
5
  var __decorate = function(decorators, target, key, desc) {
5
6
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
6
7
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -10,6 +11,7 @@ var __decorate = function(decorators, target, key, desc) {
10
11
  var __metadata = function(k, v) {
11
12
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
12
13
  };
14
+ const require$1 = createRequire(import.meta.url);
13
15
  class DeclarationsEmitter extends RttiVisitor {
14
16
  static emit(sourceFile, ctx) {
15
17
  return new DeclarationsEmitter(ctx).visitNode(sourceFile);
@@ -3,6 +3,8 @@ import { F_ARRAY_BINDING, F_OBJECT_BINDING, F_OPTIONAL, F_REST, F_READONLY, F_PR
3
3
  import { functionForwardRef, forwardRef } from "./forward-ref.js";
4
4
  import { literalNode } from "./literal-node.js";
5
5
  import { getModifiers } from "./utils.js";
6
+ import { createRequire } from "node:module";
7
+ const require$1 = createRequire(import.meta.url);
6
8
  function encodeParameter(encoder, param) {
7
9
  if (ts.isOmittedExpression(param))
8
10
  return { f: "," };
@@ -1,3 +1,5 @@
1
+ import { createRequire } from "node:module";
2
+ const require$1 = createRequire(import.meta.url);
1
3
  function findRelativePathToFile(fromFile, toFile) {
2
4
  fromFile = fromFile.replace(/\\/g, "/");
3
5
  toFile = toFile.replace(/\\/g, "/");
@@ -1,5 +1,7 @@
1
1
  import ts from "typescript";
2
2
  import { F_PUBLIC, F_PRIVATE, F_PROTECTED, F_READONLY, F_ABSTRACT, F_ASYNC, F_EXPORTED } from "../common/format.js";
3
+ import { createRequire } from "node:module";
4
+ const require$1 = createRequire(import.meta.url);
3
5
  function getVisibility(modifiers) {
4
6
  if (modifiers) {
5
7
  if (modifiers.some((x) => x.kind === ts.SyntaxKind.PublicKeyword))
@@ -1,4 +1,6 @@
1
1
  import ts from "typescript";
2
+ import { createRequire } from "node:module";
3
+ const require$1 = createRequire(import.meta.url);
2
4
  function forwardRef(expr) {
3
5
  if (!expr)
4
6
  throw new Error(`Cannot make forwardRef without an expression`);
@@ -1,4 +1,6 @@
1
1
  import { externalModules, getDirectoryPath, getDefaultLikeExportInfo, skipAlias, isTypeOnlySymbol, hasFilesystemAccess, fileExists } from "./utils.js";
2
+ import { createRequire } from "node:module";
3
+ const require$1 = createRequire(import.meta.url);
2
4
  function getExportsForSymbol(program, importingFile, symbol) {
3
5
  const checker = program.getTypeChecker();
4
6
  const compilerOptions = program.getCompilerOptions();
@@ -5,6 +5,8 @@ import { CompileError } from "./common/compile-error.js";
5
5
  import { ApiCallTransformer } from "./api-call-transformer.js";
6
6
  import { MetadataEmitter } from "./metadata-emitter.js";
7
7
  import { DeclarationsEmitter } from "./declarations-emitter.js";
8
+ import { createRequire } from "node:module";
9
+ const require$1 = createRequire(import.meta.url);
8
10
  const transformer = (program) => {
9
11
  let compilerOptions = program.getCompilerOptions();
10
12
  if (typeof compilerOptions["rtti$emitStandardMetadata"] === "undefined") {
@@ -1,3 +1,5 @@
1
+ import { createRequire } from "node:module";
2
+ const require$1 = createRequire(import.meta.url);
1
3
  function legacyDecorator(decorator) {
2
4
  decorator["__Φlegacy"] = true;
3
5
  return decorator;
@@ -1,6 +1,8 @@
1
1
  import ts from "typescript";
2
2
  import { typeLiteral } from "./type-literal.js";
3
3
  import { hasFlag, hasAnyFlag, isFlagType } from "./utils.js";
4
+ import { createRequire } from "node:module";
5
+ const require$1 = createRequire(import.meta.url);
4
6
  class LegacyTypeEncoder {
5
7
  constructor(ctx) {
6
8
  this.ctx = ctx;
@@ -1,3 +1,5 @@
1
+ import { createRequire } from "node:module";
2
+ const require$1 = createRequire(import.meta.url);
1
3
  function literalNode(expr) {
2
4
  return { $__isTSNode: true, node: expr };
3
5
  }
@@ -1,5 +1,7 @@
1
1
  import ts from "typescript";
2
2
  import { getDecorators, getModifiers } from "./utils.js";
3
+ import { createRequire } from "node:module";
4
+ const require$1 = createRequire(import.meta.url);
3
5
  class InlineMetadataCollector {
4
6
  collect(node, decorators) {
5
7
  if (decorators.length === 0)
@@ -3,6 +3,8 @@ import { legacyDecorator } from "./legacy-decorator.js";
3
3
  import { literalNode } from "./literal-node.js";
4
4
  import { serialize } from "./serialize.js";
5
5
  import { hasModifier, getModifiers, expressionForPropertyName } from "./utils.js";
6
+ import { createRequire } from "node:module";
7
+ const require$1 = createRequire(import.meta.url);
6
8
  function metadataDecorator(key, object) {
7
9
  return ts.factory.createDecorator(ts.factory.createCallExpression(ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier("__RΦ"), "m"), [], [
8
10
  ts.factory.createStringLiteral(key),
@@ -11,6 +11,7 @@ import { serialize } from "./serialize.js";
11
11
  import { literalNode } from "./literal-node.js";
12
12
  import "../common/index.js";
13
13
  import { WORKAROUND_TYPESCRIPT_49794 } from "./workarounds.js";
14
+ import { createRequire } from "node:module";
14
15
  import { T_ENUM } from "../common/format.js";
15
16
  var __decorate = function(decorators, target, key, desc) {
16
17
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -21,6 +22,7 @@ var __decorate = function(decorators, target, key, desc) {
21
22
  var __metadata = function(k, v) {
22
23
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
23
24
  };
25
+ const require$1 = createRequire(import.meta.url);
24
26
  class MetadataEmitter extends RttiVisitor {
25
27
  constructor() {
26
28
  super(...arguments);
@@ -9,6 +9,8 @@ import { metadataDecorator, legacyMetadataDecorator } from "./metadata-decorator
9
9
  import { serialize } from "./serialize.js";
10
10
  import { TypeEncoder } from "./type-encoder.js";
11
11
  import { expressionForPropertyName, hasModifier, getModifiers, propertyNameToString } from "./utils.js";
12
+ import { createRequire } from "node:module";
13
+ const require$1 = createRequire(import.meta.url);
12
14
  class MetadataEncoder {
13
15
  constructor(ctx) {
14
16
  this.ctx = ctx;
@@ -1,6 +1,8 @@
1
1
  import ts from "typescript";
2
2
  import { literalNode } from "./literal-node.js";
3
3
  import { serialize } from "./serialize.js";
4
+ import { createRequire } from "node:module";
5
+ const require$1 = createRequire(import.meta.url);
4
6
  function rtStore(typeMap) {
5
7
  const factory = ts.factory;
6
8
  let typeEntries = Array.from(typeMap.entries()).map(([i, t]) => factory.createPropertyAssignment(factory.createComputedPropertyName(ts.factory.createNumericLiteral(i)), t));
@@ -1,4 +1,6 @@
1
1
  import { VisitorBase } from "./common/visitor-base.js";
2
+ import { createRequire } from "node:module";
3
+ const require$1 = createRequire(import.meta.url);
2
4
  class RttiVisitor extends VisitorBase {
3
5
  constructor(ctx) {
4
6
  super(ctx.transformationContext);
@@ -1,6 +1,8 @@
1
1
  import ts from "typescript";
2
2
  import "../common/index.js";
3
+ import { createRequire } from "node:module";
3
4
  import { isLiteralNode } from "../common/format.js";
5
+ const require$1 = createRequire(import.meta.url);
4
6
  function serialize(object) {
5
7
  if (object === null)
6
8
  return ts.factory.createNull();
@@ -4,6 +4,8 @@ import { literalNode } from "./literal-node.js";
4
4
  import { serialize } from "./serialize.js";
5
5
  import { structuredTypeLiteral, typeLiteral } from "./type-literal.js";
6
6
  import { hasFlag } from "./utils.js";
7
+ import { createRequire } from "node:module";
8
+ const require$1 = createRequire(import.meta.url);
7
9
  class TypeEncoder {
8
10
  constructor(ctx) {
9
11
  this.ctx = ctx;
@@ -7,7 +7,9 @@ import { serialize } from "./serialize.js";
7
7
  import { hasFlag, isFlagType, typeHasValue, getTypeLocality, serializeEntityNameAsExpression, isInterfaceType, propertyPrepend, optionalExportRef, isNodeJS, hasFilesystemAccess, fileExists } from "./utils.js";
8
8
  import { forwardRef } from "./forward-ref.js";
9
9
  import { encodeParameter } from "./encode-parameter.js";
10
+ import { createRequire } from "node:module";
10
11
  import { T_VOID, T_ENUM, T_UNION, T_INTERSECTION, T_NULL, T_UNDEFINED, T_UNKNOWN, T_ANY, T_TRUE, T_FALSE, T_THIS, T_MAPPED, T_TUPLE, T_ARRAY, T_GENERIC, T_FUNCTION, T_OBJECT, F_OPTIONAL, T_STAND_IN } from "../common/format.js";
12
+ const require$1 = createRequire(import.meta.url);
11
13
  function typeLiteral(encoder, type, typeNode, options) {
12
14
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
13
15
  let ctx = encoder.ctx;
@@ -423,7 +425,7 @@ function inferImportPath(ctx, type, symbol) {
423
425
  let requireX = function(path2) {
424
426
  return requireN(path2);
425
427
  };
426
- let requireN = require;
428
+ let requireN = require$1;
427
429
  const fs = requireX("fs");
428
430
  const path = requireX("path");
429
431
  let pkgJsonPath = path.resolve(path.dirname(ctx.sourceFile.fileName), pathToNodeModules, packageName, "package.json");
@@ -1,4 +1,6 @@
1
1
  import ts from "typescript";
2
+ import { createRequire } from "node:module";
3
+ const require$1 = createRequire(import.meta.url);
2
4
  function assert(check) {
3
5
  if (!check())
4
6
  throw new Error(`Assertion failed: ${check.toString().replace(/.*?=> */, "")}`);
@@ -792,7 +794,7 @@ function hasFilesystemAccess() {
792
794
  if (isNodeJS()) {
793
795
  let fsx;
794
796
  try {
795
- fsx = require("fs");
797
+ fsx = require$1("fs");
796
798
  } catch (e) {
797
799
  }
798
800
  return !!fsx;
@@ -803,7 +805,7 @@ function fileExists(filename) {
803
805
  if (isNodeJS()) {
804
806
  let fsx;
805
807
  try {
806
- fsx = require("fs");
808
+ fsx = require$1("fs");
807
809
  } catch (e) {
808
810
  }
809
811
  if (fsx)
@@ -1,3 +1,5 @@
1
+ import { createRequire } from "node:module";
2
+ const require$1 = createRequire(import.meta.url);
1
3
  const WORKAROUND_TYPESCRIPT_49794 = true;
2
4
  export {
3
5
  WORKAROUND_TYPESCRIPT_49794
@@ -1,106 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
- const F_READONLY = "R";
4
- const F_ABSTRACT = "A";
5
- const F_PUBLIC = "$";
6
- const F_PRIVATE = "#";
7
- const F_PROTECTED = "@";
8
- const F_PROPERTY = "P";
9
- const F_METHOD = "M";
10
- const F_STATIC = "S";
11
- const F_CLASS = "C";
12
- const F_INTERFACE = "I";
13
- const F_FUNCTION = "F";
14
- const F_ARROW_FUNCTION = ">";
15
- const F_OPTIONAL = "?";
16
- const F_REST = "3";
17
- const F_ASYNC = "a";
18
- const F_EXPORTED = "e";
19
- const F_INFERRED = ".";
20
- const F_OMITTED = ",";
21
- const F_ARRAY_BINDING = "[";
22
- const F_OBJECT_BINDING = "O";
23
- const T_UNION = "|";
24
- const T_INTERSECTION = "&";
25
- const T_ANY = "~";
26
- const T_UNKNOWN = "U";
27
- const T_VOID = "V";
28
- const T_UNDEFINED = "u";
29
- const T_NULL = "n";
30
- const T_TUPLE = "T";
31
- const T_ARRAY = "[";
32
- const T_THIS = "t";
33
- const T_GENERIC = "g";
34
- const T_MAPPED = "m";
35
- const T_TRUE = "1";
36
- const T_FALSE = "0";
37
- const T_CALLSITE = "c";
38
- const T_STAND_IN = "5";
39
- const T_OBJECT = "O";
40
- const T_ENUM = "e";
41
- const T_FUNCTION = "F";
42
- const T_INTRINSICS = [T_VOID, T_ANY, T_UNKNOWN, T_UNDEFINED, T_TRUE, T_FALSE, T_THIS, T_NULL];
43
- const TI_VOID = { TΦ: T_VOID };
44
- const TI_ANY = { TΦ: T_ANY };
45
- const TI_UNKNOWN = { TΦ: T_UNKNOWN };
46
- const TI_UNDEFINED = { TΦ: T_UNDEFINED };
47
- const TI_TRUE = { TΦ: T_TRUE };
48
- const TI_FALSE = { TΦ: T_FALSE };
49
- const TI_THIS = { TΦ: T_THIS };
50
- const TI_NULL = { TΦ: T_NULL };
51
- function isLiteralNode(node) {
52
- return !!node["$__isTSNode"];
53
- }
54
- __name(isLiteralNode, "isLiteralNode");
55
- export {
56
- F_ABSTRACT,
57
- F_ARRAY_BINDING,
58
- F_ARROW_FUNCTION,
59
- F_ASYNC,
60
- F_CLASS,
61
- F_EXPORTED,
62
- F_FUNCTION,
63
- F_INFERRED,
64
- F_INTERFACE,
65
- F_METHOD,
66
- F_OBJECT_BINDING,
67
- F_OMITTED,
68
- F_OPTIONAL,
69
- F_PRIVATE,
70
- F_PROPERTY,
71
- F_PROTECTED,
72
- F_PUBLIC,
73
- F_READONLY,
74
- F_REST,
75
- F_STATIC,
76
- TI_ANY,
77
- TI_FALSE,
78
- TI_NULL,
79
- TI_THIS,
80
- TI_TRUE,
81
- TI_UNDEFINED,
82
- TI_UNKNOWN,
83
- TI_VOID,
84
- T_ANY,
85
- T_ARRAY,
86
- T_CALLSITE,
87
- T_ENUM,
88
- T_FALSE,
89
- T_FUNCTION,
90
- T_GENERIC,
91
- T_INTERSECTION,
92
- T_INTRINSICS,
93
- T_MAPPED,
94
- T_NULL,
95
- T_OBJECT,
96
- T_STAND_IN,
97
- T_THIS,
98
- T_TRUE,
99
- T_TUPLE,
100
- T_UNDEFINED,
101
- T_UNION,
102
- T_UNKNOWN,
103
- T_VOID,
104
- isLiteralNode
105
- };
106
- //# sourceMappingURL=format.js.map
@@ -1,2 +0,0 @@
1
- import "./lib/index.js";
2
- //# sourceMappingURL=index.js.map
@@ -1,15 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
- const COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
4
- const DEFAULT_PARAMS = /=[^,]+/mg;
5
- const FAT_ARROWS = /=>.*$/mg;
6
- function getParameterNames(fn) {
7
- const code = fn.toString().replace(COMMENTS, "").replace(FAT_ARROWS, "").replace(DEFAULT_PARAMS, "");
8
- const result = code.slice(code.indexOf("(") + 1, code.indexOf(")")).match(/([^\s,]+)/g);
9
- return result === null ? [] : result;
10
- }
11
- __name(getParameterNames, "getParameterNames");
12
- export {
13
- getParameterNames
14
- };
15
- //# sourceMappingURL=get-parameter-names.js.map
@@ -1,43 +0,0 @@
1
- import { ReflectedAnyRef, ReflectedArrayRef, ReflectedCallSite, ReflectedClass, ReflectedClassRef, ReflectedConstructorParameter, ReflectedEnumRef, ReflectedFalseRef, ReflectedFlags, ReflectedFunction, ReflectedFunctionParameter, ReflectedFunctionRef, ReflectedGenericRef, ReflectedInterfaceRef, ReflectedIntersectionRef, ReflectedLiteralRef, ReflectedMappedRef, ReflectedMember, ReflectedMethod, ReflectedMethodParameter, ReflectedNullRef, ReflectedObjectMember, ReflectedObjectRef, ReflectedParameter, ReflectedProperty, ReflectedTrueRef, ReflectedTupleElement, ReflectedTupleRef, ReflectedTypeRef, ReflectedUndefinedRef, ReflectedUnionRef, ReflectedUnknownRef, ReflectedVoidRef, TYPE_REF_KIND_EXPANSION, implementsInterface, isCallSite, matchesShape, reflect, reify } from "./reflect.js";
2
- export {
3
- ReflectedAnyRef,
4
- ReflectedArrayRef,
5
- ReflectedCallSite,
6
- ReflectedClass,
7
- ReflectedClassRef,
8
- ReflectedConstructorParameter,
9
- ReflectedEnumRef,
10
- ReflectedFalseRef,
11
- ReflectedFlags,
12
- ReflectedFunction,
13
- ReflectedFunctionParameter,
14
- ReflectedFunctionRef,
15
- ReflectedGenericRef,
16
- ReflectedInterfaceRef,
17
- ReflectedIntersectionRef,
18
- ReflectedLiteralRef,
19
- ReflectedMappedRef,
20
- ReflectedMember,
21
- ReflectedMethod,
22
- ReflectedMethodParameter,
23
- ReflectedNullRef,
24
- ReflectedObjectMember,
25
- ReflectedObjectRef,
26
- ReflectedParameter,
27
- ReflectedProperty,
28
- ReflectedTrueRef,
29
- ReflectedTupleElement,
30
- ReflectedTupleRef,
31
- ReflectedTypeRef,
32
- ReflectedUndefinedRef,
33
- ReflectedUnionRef,
34
- ReflectedUnknownRef,
35
- ReflectedVoidRef,
36
- TYPE_REF_KIND_EXPANSION,
37
- implementsInterface,
38
- isCallSite,
39
- matchesShape,
40
- reflect,
41
- reify
42
- };
43
- //# sourceMappingURL=index.js.map