@glutinum/cli 1.0.0-beta.6 → 1.0.0-beta.8

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.
@@ -17,30 +17,64 @@ export function readTypeOperatorNode(reader, node) {
17
17
  switch (matchValue) {
18
18
  case 143: {
19
19
  const operandNode = removeParenthesizedType(node.type);
20
+ const arrayKeys = new GlueType(/* Union */ 7, [new GlueTypeUnion(ofArray([new GlueType(/* Primitive */ 3, [GluePrimitive.String$]), new GlueType(/* Primitive */ 3, [GluePrimitive.Number$])]))]);
20
21
  const matchValue_1 = operandNode.kind;
22
+ let matchResult;
21
23
  switch (matchValue_1) {
22
- case 133:
23
- return new GlueType(/* Union */ 7, [new GlueTypeUnion(ofArray([new GlueType(/* Primitive */ 3, [GluePrimitive.String$]), new GlueType(/* Primitive */ 3, [GluePrimitive.Number$]), new GlueType(/* Primitive */ 3, [GluePrimitive.Symbol$])]))]);
24
+ case 133: {
25
+ matchResult = 3;
26
+ break;
27
+ }
24
28
  case 184: {
29
+ matchResult = 0;
30
+ break;
31
+ }
32
+ case 187: {
33
+ matchResult = 1;
34
+ break;
35
+ }
36
+ case 189: {
37
+ matchResult = 4;
38
+ break;
39
+ }
40
+ case 194:
41
+ case 200: {
42
+ matchResult = 2;
43
+ break;
44
+ }
45
+ case 199: {
46
+ if (operandNode.type.kind === 189) {
47
+ matchResult = 5;
48
+ }
49
+ else {
50
+ matchResult = 6;
51
+ }
52
+ break;
53
+ }
54
+ default:
55
+ matchResult = 6;
56
+ }
57
+ switch (matchResult) {
58
+ case 0: {
25
59
  const typeReferenceNode = operandNode;
26
60
  const symbolOpt = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_checker"]().getSymbolAtLocation(typeReferenceNode.typeName);
27
61
  if (symbolOpt != null) {
28
62
  const symbol = symbolOpt;
29
63
  const matchValue_2 = symbol.declarations;
30
- let matchResult, declarations_1;
64
+ let matchResult_1, declarations_1;
31
65
  if (matchValue_2 != null) {
32
66
  if ((declarations = matchValue_2, declarations.length > 0)) {
33
- matchResult = 0;
67
+ matchResult_1 = 0;
34
68
  declarations_1 = matchValue_2;
35
69
  }
36
70
  else {
37
- matchResult = 1;
71
+ matchResult_1 = 1;
38
72
  }
39
73
  }
40
74
  else {
41
- matchResult = 1;
75
+ matchResult_1 = 1;
42
76
  }
43
- switch (matchResult) {
77
+ switch (matchResult_1) {
44
78
  case 0: {
45
79
  const declaration_1 = defaultArg(tryFind((declaration) => (declaration.kind === 264), declarations_1), item_2(0, declarations_1));
46
80
  if (declaration_1.kind === 169) {
@@ -57,23 +91,28 @@ export function readTypeOperatorNode(reader, node) {
57
91
  }
58
92
  }
59
93
  default:
60
- throw new Exception(Report_readerError_Z19516DCE("type operator (keyof)", "Missing declarations", node, "/_//src/Glutinum.Converter/Reader/TypeOperatorNode.fs", 52));
94
+ throw new Exception(Report_readerError_Z19516DCE("type operator (keyof)", "Missing declarations", node, "/_//src/Glutinum.Converter/Reader/TypeOperatorNode.fs", 61));
61
95
  }
62
96
  }
63
97
  else if (node.pos < 0) {
64
98
  return new GlueType(/* KeyOf */ 9, [GlueType.Discard]);
65
99
  }
66
100
  else {
67
- throw new Exception(Report_readerError_Z19516DCE("type operator (keyof)", "Missing symbol", node, "/_//src/Glutinum.Converter/Reader/TypeOperatorNode.fs", 28));
101
+ throw new Exception(Report_readerError_Z19516DCE("type operator (keyof)", "Missing symbol", node, "/_//src/Glutinum.Converter/Reader/TypeOperatorNode.fs", 37));
68
102
  }
69
103
  }
70
- case 187:
104
+ case 1:
71
105
  return new GlueType(/* KeyOf */ 9, [readTypeQueryNode(reader, operandNode)]);
72
- case 194:
73
- case 200:
106
+ case 2:
74
107
  return new GlueType(/* KeyOf */ 9, [GlueType.Discard]);
108
+ case 3:
109
+ return new GlueType(/* Union */ 7, [new GlueTypeUnion(ofArray([new GlueType(/* Primitive */ 3, [GluePrimitive.String$]), new GlueType(/* Primitive */ 3, [GluePrimitive.Number$]), new GlueType(/* Primitive */ 3, [GluePrimitive.Symbol$])]))]);
110
+ case 4:
111
+ return arrayKeys;
112
+ case 5:
113
+ return arrayKeys;
75
114
  default: {
76
- const item = Report_readerError_Z19516DCE("type operator (keyof)", concat("Was expecting a type reference or a type query instead got a Node of type ", TypeScript_Ts_SyntaxKind__SyntaxKind_get_Name(operandNode.kind)), node, "/_//src/Glutinum.Converter/Reader/TypeOperatorNode.fs", 75);
115
+ const item = Report_readerError_Z19516DCE("type operator (keyof)", concat("Was expecting a type reference or a type query instead got a Node of type ", TypeScript_Ts_SyntaxKind__SyntaxKind_get_Name(operandNode.kind)), node, "/_//src/Glutinum.Converter/Reader/TypeOperatorNode.fs", 91);
77
116
  const objectArg = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_Warnings"]();
78
117
  void (objectArg.push(item));
79
118
  return new GlueType(/* Primitive */ 3, [GluePrimitive.Any]);
@@ -85,7 +124,7 @@ export function readTypeOperatorNode(reader, node) {
85
124
  case 158:
86
125
  return reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.ReadTypeNode24A678AD"](node.type);
87
126
  default: {
88
- const item_1 = Report_readerError_Z19516DCE("type operator", concat("Unsupported operator ", TypeScript_Ts_SyntaxKind__SyntaxKind_get_Name(node.operator)), node, "/_//src/Glutinum.Converter/Reader/TypeOperatorNode.fs", 89);
127
+ const item_1 = Report_readerError_Z19516DCE("type operator", concat("Unsupported operator ", TypeScript_Ts_SyntaxKind__SyntaxKind_get_Name(node.operator)), node, "/_//src/Glutinum.Converter/Reader/TypeOperatorNode.fs", 105);
89
128
  const objectArg_1 = reader["Glutinum.Converter.Reader.Types.ITypeScriptReader.get_Warnings"]();
90
129
  void (objectArg_1.push(item_1));
91
130
  return new GlueType(/* Primitive */ 3, [GluePrimitive.Any]);
@@ -152,6 +152,11 @@ export function PackageContext__TryFindExternalModulePath_Z55EFCE8F(this$, fileN
152
152
  }, this$.Externals);
153
153
  }
154
154
 
155
+ export function PackageContext__IsExternalLibFile_Z721C83C5(this$, fileName) {
156
+ const fileName_1 = normalizePath(fileName);
157
+ return exists((external) => exists((prefix) => (fileName_1.indexOf(prefix) >= 0), external.LibFilePrefixes), this$.Externals);
158
+ }
159
+
155
160
  export function PackageContext__IsExternal_Z721C83C5(this$, fileName) {
156
161
  if (PackageContext__TryFindPackage_Z721C83C5(this$, fileName) == null) {
157
162
  return PackageContext__TryFindExternalModulePath_Z721C83C5(this$, fileName) == null;