typia 5.3.11 → 6.0.0-dev.20240118

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 (180) hide show
  1. package/lib/IRandomGenerator.d.ts +1 -0
  2. package/lib/functional/$HeadersReader.d.ts +1 -6
  3. package/lib/functional/$HeadersReader.js.map +1 -1
  4. package/lib/functional/$ParameterReader.d.ts +1 -6
  5. package/lib/functional/$ParameterReader.js.map +1 -1
  6. package/lib/functional/$ProtobufReader.d.ts +1 -35
  7. package/lib/functional/$ProtobufReader.js.map +1 -1
  8. package/lib/functional/$ProtobufSizer.d.ts +1 -36
  9. package/lib/functional/$ProtobufSizer.js.map +1 -1
  10. package/lib/functional/$ProtobufWriter.d.ts +1 -45
  11. package/lib/functional/$ProtobufWriter.js.map +1 -1
  12. package/lib/functional/$QueryReader.d.ts +1 -8
  13. package/lib/functional/$QueryReader.js.map +1 -1
  14. package/lib/functional/$camel.js +7 -0
  15. package/lib/functional/$camel.js.map +1 -0
  16. package/lib/functional/$clone.d.ts +1 -2
  17. package/lib/functional/$clone.js +1 -1
  18. package/lib/functional/$clone.js.map +1 -1
  19. package/lib/functional/$convention.d.ts +1 -1
  20. package/lib/functional/$convention.js.map +1 -1
  21. package/lib/functional/$generator.d.ts +1 -0
  22. package/lib/functional/$generator.js +6 -0
  23. package/lib/functional/$generator.js.map +1 -0
  24. package/lib/functional/$is_between.d.ts +1 -1
  25. package/lib/functional/$is_between.js.map +1 -1
  26. package/lib/functional/$join.d.ts +1 -1
  27. package/lib/functional/$join.js.map +1 -1
  28. package/lib/functional/$number.d.ts +1 -1
  29. package/lib/functional/$number.js.map +1 -1
  30. package/lib/functional/$pascal.d.ts +1 -0
  31. package/lib/functional/$pascal.js +7 -0
  32. package/lib/functional/$pascal.js.map +1 -0
  33. package/lib/functional/$report.d.ts +1 -2
  34. package/lib/functional/$report.js.map +1 -1
  35. package/lib/functional/$rest.d.ts +1 -1
  36. package/lib/functional/$rest.js.map +1 -1
  37. package/lib/functional/$snake.d.ts +1 -0
  38. package/lib/functional/$snake.js +7 -0
  39. package/lib/functional/$snake.js.map +1 -0
  40. package/lib/functional/$stoll.d.ts +1 -1
  41. package/lib/functional/$stoll.js.map +1 -1
  42. package/lib/functional/$strlen.d.ts +1 -1
  43. package/lib/functional/$strlen.js.map +1 -1
  44. package/lib/functional/$throws.d.ts +1 -0
  45. package/lib/functional/$throws.js +22 -0
  46. package/lib/functional/$throws.js.map +1 -0
  47. package/lib/functional/IProtobufWriter.d.ts +1 -15
  48. package/lib/http.js +0 -33
  49. package/lib/http.js.map +1 -1
  50. package/lib/json.js +0 -18
  51. package/lib/json.js.map +1 -1
  52. package/lib/misc.js +0 -23
  53. package/lib/misc.js.map +1 -1
  54. package/lib/module.js +0 -19
  55. package/lib/module.js.map +1 -1
  56. package/lib/notations.js +0 -43
  57. package/lib/notations.js.map +1 -1
  58. package/lib/programmers/AssertProgrammer.js +4 -4
  59. package/lib/programmers/AssertProgrammer.js.map +1 -1
  60. package/lib/programmers/CheckerProgrammer.d.ts +1 -1
  61. package/lib/programmers/FeatureProgrammer.d.ts +1 -1
  62. package/lib/programmers/IsProgrammer.d.ts +1 -1
  63. package/lib/programmers/IsProgrammer.js +4 -4
  64. package/lib/programmers/IsProgrammer.js.map +1 -1
  65. package/lib/programmers/RandomProgrammer.js +4 -4
  66. package/lib/programmers/RandomProgrammer.js.map +1 -1
  67. package/lib/programmers/ValidateProgrammer.js +6 -4
  68. package/lib/programmers/ValidateProgrammer.js.map +1 -1
  69. package/lib/programmers/helpers/{FunctionImporeter.d.ts → FunctionImporter.d.ts} +2 -2
  70. package/lib/programmers/helpers/{FunctionImporeter.js → FunctionImporter.js} +15 -8
  71. package/lib/programmers/helpers/FunctionImporter.js.map +1 -0
  72. package/lib/programmers/helpers/StringifyJoinder.d.ts +1 -1
  73. package/lib/programmers/helpers/StringifyJoinder.js +1 -1
  74. package/lib/programmers/helpers/StringifyJoinder.js.map +1 -1
  75. package/lib/programmers/helpers/disable_function_importer_declare.d.ts +1 -1
  76. package/lib/programmers/helpers/disable_function_importer_declare.js +4 -2
  77. package/lib/programmers/helpers/disable_function_importer_declare.js.map +1 -1
  78. package/lib/programmers/http/HttpHeadersProgrammer.js +9 -6
  79. package/lib/programmers/http/HttpHeadersProgrammer.js.map +1 -1
  80. package/lib/programmers/http/HttpParameterProgrammer.js +4 -6
  81. package/lib/programmers/http/HttpParameterProgrammer.js.map +1 -1
  82. package/lib/programmers/http/HttpQueryProgrammer.js +6 -6
  83. package/lib/programmers/http/HttpQueryProgrammer.js.map +1 -1
  84. package/lib/programmers/internal/check_dynamic_key.d.ts +1 -1
  85. package/lib/programmers/json/JsonStringifyProgrammer.js +4 -4
  86. package/lib/programmers/json/JsonStringifyProgrammer.js.map +1 -1
  87. package/lib/programmers/misc/MiscCloneProgrammer.js +5 -7
  88. package/lib/programmers/misc/MiscCloneProgrammer.js.map +1 -1
  89. package/lib/programmers/misc/MiscPruneProgrammer.js +3 -3
  90. package/lib/programmers/misc/MiscPruneProgrammer.js.map +1 -1
  91. package/lib/programmers/notations/NotationGeneralProgrammer.js +177 -169
  92. package/lib/programmers/notations/NotationGeneralProgrammer.js.map +1 -1
  93. package/lib/programmers/protobuf/ProtobufDecodeProgrammer.js +4 -6
  94. package/lib/programmers/protobuf/ProtobufDecodeProgrammer.js.map +1 -1
  95. package/lib/programmers/protobuf/ProtobufEncodeProgrammer.js +6 -8
  96. package/lib/programmers/protobuf/ProtobufEncodeProgrammer.js.map +1 -1
  97. package/lib/protobuf.js +0 -29
  98. package/lib/protobuf.js.map +1 -1
  99. package/lib/schemas/metadata/MetadataObject.js +1 -2
  100. package/lib/schemas/metadata/MetadataObject.js.map +1 -1
  101. package/package.json +1 -1
  102. package/src/IRandomGenerator.ts +2 -0
  103. package/src/functional/$HeadersReader.ts +9 -0
  104. package/src/functional/$ParameterReader.ts +9 -0
  105. package/src/functional/$ProtobufReader.ts +15 -1
  106. package/src/functional/$ProtobufSizer.ts +11 -1
  107. package/src/functional/$ProtobufWriter.ts +26 -1
  108. package/src/functional/$QueryReader.ts +9 -0
  109. package/src/functional/$camel.ts +8 -0
  110. package/src/functional/$clone.ts +4 -1
  111. package/src/functional/$convention.ts +3 -0
  112. package/src/functional/$generator.ts +6 -0
  113. package/src/functional/$is_between.ts +3 -0
  114. package/src/functional/$join.ts +12 -0
  115. package/src/functional/$number.ts +3 -0
  116. package/src/functional/$pascal.ts +8 -0
  117. package/src/functional/$report.ts +3 -0
  118. package/src/functional/$rest.ts +3 -0
  119. package/src/functional/$snake.ts +8 -0
  120. package/src/functional/$stoll.ts +3 -0
  121. package/src/functional/$string.ts +1 -1
  122. package/src/functional/$strlen.ts +3 -0
  123. package/src/functional/$throws.ts +13 -0
  124. package/src/functional/IProtobufWriter.ts +3 -0
  125. package/src/http.ts +0 -37
  126. package/src/json.ts +0 -20
  127. package/src/misc.ts +0 -24
  128. package/src/module.ts +0 -20
  129. package/src/notations.ts +0 -71
  130. package/src/programmers/AssertProgrammer.ts +3 -3
  131. package/src/programmers/CheckerProgrammer.ts +1 -1
  132. package/src/programmers/FeatureProgrammer.ts +1 -1
  133. package/src/programmers/IsProgrammer.ts +2 -2
  134. package/src/programmers/RandomProgrammer.ts +3 -3
  135. package/src/programmers/ValidateProgrammer.ts +11 -8
  136. package/src/programmers/helpers/{FunctionImporeter.ts → FunctionImporter.ts} +21 -18
  137. package/src/programmers/helpers/StringifyJoinder.ts +3 -4
  138. package/src/programmers/helpers/disable_function_importer_declare.ts +4 -3
  139. package/src/programmers/http/HttpHeadersProgrammer.ts +8 -8
  140. package/src/programmers/http/HttpParameterProgrammer.ts +7 -5
  141. package/src/programmers/http/HttpQueryProgrammer.ts +14 -13
  142. package/src/programmers/internal/check_dynamic_key.ts +1 -1
  143. package/src/programmers/internal/check_dynamic_properties.ts +1 -1
  144. package/src/programmers/internal/check_object.ts +1 -1
  145. package/src/programmers/internal/feature_object_entries.ts +1 -1
  146. package/src/programmers/json/JsonStringifyProgrammer.ts +3 -3
  147. package/src/programmers/misc/MiscCloneProgrammer.ts +8 -6
  148. package/src/programmers/misc/MiscPruneProgrammer.ts +2 -2
  149. package/src/programmers/notations/NotationGeneralProgrammer.ts +24 -13
  150. package/src/programmers/protobuf/ProtobufDecodeProgrammer.ts +7 -5
  151. package/src/programmers/protobuf/ProtobufEncodeProgrammer.ts +13 -10
  152. package/src/protobuf.ts +0 -48
  153. package/src/schemas/metadata/IMetadataConstant.ts +0 -7
  154. package/src/schemas/metadata/IMetadataObject.ts +0 -5
  155. package/src/schemas/metadata/MetadataObject.ts +1 -2
  156. package/lib/functional/$any.d.ts +0 -1
  157. package/lib/functional/$any.js +0 -9
  158. package/lib/functional/$any.js.map +0 -1
  159. package/lib/functional/$dictionary.d.ts +0 -2
  160. package/lib/functional/$dictionary.js +0 -15
  161. package/lib/functional/$dictionary.js.map +0 -1
  162. package/lib/functional/$every.d.ts +0 -2
  163. package/lib/functional/$every.js +0 -12
  164. package/lib/functional/$every.js.map +0 -1
  165. package/lib/functional/$varint.d.ts +0 -6
  166. package/lib/functional/$varint.js +0 -99
  167. package/lib/functional/$varint.js.map +0 -1
  168. package/lib/functional/$zigzag.d.ts +0 -4
  169. package/lib/functional/$zigzag.js +0 -34
  170. package/lib/functional/$zigzag.js.map +0 -1
  171. package/lib/functional/Namespace.js +0 -104
  172. package/lib/functional/Namespace.js.map +0 -1
  173. package/lib/programmers/helpers/FunctionImporeter.js.map +0 -1
  174. package/src/functional/$any.ts +0 -4
  175. package/src/functional/$dictionary.ts +0 -22
  176. package/src/functional/$every.ts +0 -11
  177. package/src/functional/$varint.ts +0 -130
  178. package/src/functional/$zigzag.ts +0 -39
  179. package/src/functional/Namespace.ts +0 -167
  180. /package/lib/functional/{Namespace.d.ts → $camel.d.ts} +0 -0
@@ -24,7 +24,7 @@ import { ArrayUtil } from "../../utils/ArrayUtil";
24
24
  import { FeatureProgrammer } from "../FeatureProgrammer";
25
25
  import { IsProgrammer } from "../IsProgrammer";
26
26
  import { AtomicPredicator } from "../helpers/AtomicPredicator";
27
- import { FunctionImporter } from "../helpers/FunctionImporeter";
27
+ import { FunctionImporter } from "../helpers/FunctionImporter";
28
28
  import { IExpressionEntry } from "../helpers/IExpressionEntry";
29
29
  import { OptionPredicator } from "../helpers/OptionPredicator";
30
30
  import { StringifyJoiner } from "../helpers/StringifyJoinder";
@@ -51,7 +51,7 @@ export namespace JsonStringifyProgrammer {
51
51
  ...IsProgrammer.write_function_statements(project)(importer)(
52
52
  collection,
53
53
  ),
54
- ...importer.declare(modulo),
54
+ ...importer.declare(),
55
55
  ],
56
56
  })(importer);
57
57
  };
@@ -868,7 +868,7 @@ export namespace JsonStringifyProgrammer {
868
868
  (value: ts.Expression) =>
869
869
  ts.factory.createExpressionStatement(
870
870
  ts.factory.createCallExpression(
871
- importer.use("throws"),
871
+ importer.use("throws", true),
872
872
  [],
873
873
  [
874
874
  ts.factory.createObjectLiteralExpression(
@@ -18,7 +18,7 @@ import { TransformerError } from "../../transformers/TransformerError";
18
18
  import { FeatureProgrammer } from "../FeatureProgrammer";
19
19
  import { IsProgrammer } from "../IsProgrammer";
20
20
  import { CloneJoiner } from "../helpers/CloneJoiner";
21
- import { FunctionImporter } from "../helpers/FunctionImporeter";
21
+ import { FunctionImporter } from "../helpers/FunctionImporter";
22
22
  import { UnionExplorer } from "../helpers/UnionExplorer";
23
23
  import { decode_union_object } from "../internal/decode_union_object";
24
24
  import { wrap_metadata_rest_tuple } from "../internal/wrap_metadata_rest_tuple";
@@ -33,7 +33,7 @@ export namespace MiscCloneProgrammer {
33
33
  ...IsProgrammer.write_function_statements(project)(importer)(
34
34
  collection,
35
35
  ),
36
- ...importer.declare(modulo),
36
+ ...importer.declare(),
37
37
  ],
38
38
  })(importer);
39
39
  };
@@ -127,9 +127,11 @@ export namespace MiscCloneProgrammer {
127
127
  !!t.type.elements.length && t.type.elements.every((e) => e.any),
128
128
  )
129
129
  )
130
- return ts.factory.createCallExpression(importer.use("any"), undefined, [
131
- input,
132
- ]);
130
+ return ts.factory.createCallExpression(
131
+ importer.use("clone"),
132
+ undefined,
133
+ [input],
134
+ );
133
135
 
134
136
  interface IUnion {
135
137
  type: string;
@@ -694,7 +696,7 @@ export namespace MiscCloneProgrammer {
694
696
  (value: ts.Expression) =>
695
697
  ts.factory.createExpressionStatement(
696
698
  ts.factory.createCallExpression(
697
- importer.use("throws"),
699
+ importer.use("throws", true),
698
700
  [],
699
701
  [
700
702
  ts.factory.createObjectLiteralExpression(
@@ -17,7 +17,7 @@ import { TransformerError } from "../../transformers/TransformerError";
17
17
 
18
18
  import { FeatureProgrammer } from "../FeatureProgrammer";
19
19
  import { IsProgrammer } from "../IsProgrammer";
20
- import { FunctionImporter } from "../helpers/FunctionImporeter";
20
+ import { FunctionImporter } from "../helpers/FunctionImporter";
21
21
  import { PruneJoiner } from "../helpers/PruneJoiner";
22
22
  import { UnionExplorer } from "../helpers/UnionExplorer";
23
23
  import { decode_union_object } from "../internal/decode_union_object";
@@ -33,7 +33,7 @@ export namespace MiscPruneProgrammer {
33
33
  ...IsProgrammer.write_function_statements(project)(importer)(
34
34
  collection,
35
35
  ),
36
- ...importer.declare(modulo),
36
+ ...importer.declare(),
37
37
  ],
38
38
  })(importer);
39
39
  };
@@ -19,7 +19,7 @@ import { StringUtil } from "../../utils/StringUtil";
19
19
 
20
20
  import { FeatureProgrammer } from "../FeatureProgrammer";
21
21
  import { IsProgrammer } from "../IsProgrammer";
22
- import { FunctionImporter } from "../helpers/FunctionImporeter";
22
+ import { FunctionImporter } from "../helpers/FunctionImporter";
23
23
  import { NotationJoiner } from "../helpers/NotationJoiner";
24
24
  import { UnionExplorer } from "../helpers/UnionExplorer";
25
25
  import { decode_union_object } from "../internal/decode_union_object";
@@ -41,7 +41,7 @@ export namespace NotationGeneralProgrammer {
41
41
  ...IsProgrammer.write_function_statements(project)(importer)(
42
42
  collection,
43
43
  ),
44
- ...importer.declare(modulo),
44
+ ...importer.declare(),
45
45
  ],
46
46
  })(importer);
47
47
  };
@@ -82,6 +82,7 @@ export namespace NotationGeneralProgrammer {
82
82
  );
83
83
 
84
84
  const write_tuple_functions =
85
+ (rename: (str: string) => string) =>
85
86
  (project: IProject) =>
86
87
  (config: FeatureProgrammer.IConfig) =>
87
88
  (importer: FunctionImporter) =>
@@ -100,7 +101,7 @@ export namespace NotationGeneralProgrammer {
100
101
  )(ts.factory.createIdentifier("input")),
101
102
  TypeFactory.keyword("any"),
102
103
  undefined,
103
- decode_tuple_inline(project)(config)(importer)(
104
+ decode_tuple_inline(rename)(project)(config)(importer)(
104
105
  ts.factory.createIdentifier("input"),
105
106
  tuple,
106
107
  {
@@ -118,6 +119,7 @@ export namespace NotationGeneralProgrammer {
118
119
  DECODERS
119
120
  ----------------------------------------------------------- */
120
121
  const decode =
122
+ (rename: (str: string) => string) =>
121
123
  (project: IProject) =>
122
124
  (config: FeatureProgrammer.IConfig) =>
123
125
  (importer: FunctionImporter) =>
@@ -135,9 +137,11 @@ export namespace NotationGeneralProgrammer {
135
137
  !!t.type.elements.length && t.type.elements.every((e) => e.any),
136
138
  )
137
139
  )
138
- return ts.factory.createCallExpression(importer.use("any"), undefined, [
139
- input,
140
- ]);
140
+ return ts.factory.createCallExpression(
141
+ importer.use(rename.name),
142
+ undefined,
143
+ [input],
144
+ );
141
145
 
142
146
  interface IUnion {
143
147
  type: string;
@@ -176,7 +180,11 @@ export namespace NotationGeneralProgrammer {
176
180
  explore,
177
181
  ),
178
182
  value: () =>
179
- decode_tuple(project)(config)(importer)(input, tuple, explore),
183
+ decode_tuple(rename)(project)(config)(importer)(
184
+ input,
185
+ tuple,
186
+ explore,
187
+ ),
180
188
  });
181
189
 
182
190
  // ARRAYS
@@ -301,6 +309,7 @@ export namespace NotationGeneralProgrammer {
301
309
  );
302
310
 
303
311
  const decode_tuple =
312
+ (rename: (str: string) => string) =>
304
313
  (project: IProject) =>
305
314
  (config: FeatureProgrammer.IConfig) =>
306
315
  (importer: FunctionImporter) =>
@@ -320,13 +329,14 @@ export namespace NotationGeneralProgrammer {
320
329
  source: "function",
321
330
  })(input),
322
331
  )
323
- : decode_tuple_inline(project)(config)(importer)(
332
+ : decode_tuple_inline(rename)(project)(config)(importer)(
324
333
  input,
325
334
  tuple.type,
326
335
  explore,
327
336
  );
328
337
 
329
338
  const decode_tuple_inline =
339
+ (rename: (str: string) => string) =>
330
340
  (project: IProject) =>
331
341
  (config: FeatureProgrammer.IConfig) =>
332
342
  (importer: FunctionImporter) =>
@@ -338,7 +348,7 @@ export namespace NotationGeneralProgrammer {
338
348
  const children: ts.Expression[] = tuple.elements
339
349
  .filter((m) => m.rest === null)
340
350
  .map((elem, index) =>
341
- decode(project)(config)(importer)(
351
+ decode(rename)(project)(config)(importer)(
342
352
  ts.factory.createElementAccessExpression(input, index),
343
353
  elem,
344
354
  {
@@ -357,7 +367,7 @@ export namespace NotationGeneralProgrammer {
357
367
  const rest: Metadata | null = last.rest;
358
368
  if (rest === null) return null;
359
369
 
360
- return decode(project)(config)(importer)(
370
+ return decode(rename)(project)(config)(importer)(
361
371
  ts.factory.createCallExpression(
362
372
  IdentifierFactory.access(input)("slice"),
363
373
  undefined,
@@ -583,7 +593,7 @@ export namespace NotationGeneralProgrammer {
583
593
  trace: false,
584
594
  path: false,
585
595
  initializer,
586
- decoder: () => decode(project)(config)(importer),
596
+ decoder: () => decode(rename)(project)(config)(importer),
587
597
  objector: {
588
598
  checker: () => IsProgrammer.decode(project)(importer),
589
599
  decoder: () => decode_object(importer),
@@ -598,7 +608,8 @@ export namespace NotationGeneralProgrammer {
598
608
  },
599
609
  generator: {
600
610
  arrays: () => write_array_functions(config)(importer),
601
- tuples: () => write_tuple_functions(project)(config)(importer),
611
+ tuples: () =>
612
+ write_tuple_functions(rename)(project)(config)(importer),
602
613
  },
603
614
  };
604
615
  return config;
@@ -628,7 +639,7 @@ export namespace NotationGeneralProgrammer {
628
639
  (value: ts.Expression) =>
629
640
  ts.factory.createExpressionStatement(
630
641
  ts.factory.createCallExpression(
631
- importer.use("throws"),
642
+ importer.use("throws", true),
632
643
  [],
633
644
  [
634
645
  ts.factory.createObjectLiteralExpression(
@@ -18,7 +18,7 @@ import { IProject } from "../../transformers/IProject";
18
18
 
19
19
  import { ProtobufAtomic } from "../../typings/ProtobufAtomic";
20
20
 
21
- import { FunctionImporter } from "../helpers/FunctionImporeter";
21
+ import { FunctionImporter } from "../helpers/FunctionImporter";
22
22
  import { ProtobufUtil } from "../helpers/ProtobufUtil";
23
23
 
24
24
  export namespace ProtobufDecodeProgrammer {
@@ -44,9 +44,11 @@ export namespace ProtobufDecodeProgrammer {
44
44
  );
45
45
  const reader = StatementFactory.constant(
46
46
  "reader",
47
- ts.factory.createNewExpression(importer.use("Reader"), undefined, [
48
- ts.factory.createIdentifier("input"),
49
- ]),
47
+ ts.factory.createNewExpression(
48
+ importer.use("ProtobufReader"),
49
+ undefined,
50
+ [ts.factory.createIdentifier("input")],
51
+ ),
50
52
  );
51
53
 
52
54
  return ts.factory.createArrowFunction(
@@ -66,7 +68,7 @@ export namespace ProtobufDecodeProgrammer {
66
68
  undefined,
67
69
  ts.factory.createBlock(
68
70
  [
69
- ...importer.declare(modulo),
71
+ ...importer.declare(),
70
72
  ...functors,
71
73
  reader,
72
74
  ts.factory.createReturnStatement(
@@ -20,7 +20,7 @@ import { ProtobufAtomic } from "../../typings/ProtobufAtomic";
20
20
 
21
21
  import { FeatureProgrammer } from "../FeatureProgrammer";
22
22
  import { IsProgrammer } from "../IsProgrammer";
23
- import { FunctionImporter } from "../helpers/FunctionImporeter";
23
+ import { FunctionImporter } from "../helpers/FunctionImporter";
24
24
  import { ProtobufUtil } from "../helpers/ProtobufUtil";
25
25
  import { ProtobufWire } from "../helpers/ProtobufWire";
26
26
  import { UnionPredicator } from "../helpers/UnionPredicator";
@@ -54,12 +54,18 @@ export namespace ProtobufEncodeProgrammer {
54
54
  write_encoder(project)(importer)(collection)(meta),
55
55
  ),
56
56
  callEncoder("sizer")(
57
- ts.factory.createNewExpression(importer.use("Sizer"), undefined, []),
57
+ ts.factory.createNewExpression(
58
+ importer.use("ProtobufSizer"),
59
+ undefined,
60
+ [],
61
+ ),
58
62
  ),
59
63
  callEncoder("writer")(
60
- ts.factory.createNewExpression(importer.use("Writer"), undefined, [
61
- ts.factory.createIdentifier("sizer"),
62
- ]),
64
+ ts.factory.createNewExpression(
65
+ importer.use("ProtobufWriter"),
66
+ undefined,
67
+ [ts.factory.createIdentifier("sizer")],
68
+ ),
63
69
  ),
64
70
  ts.factory.createReturnStatement(
65
71
  ts.factory.createCallExpression(
@@ -83,10 +89,7 @@ export namespace ProtobufEncodeProgrammer {
83
89
  ],
84
90
  ts.factory.createTypeReferenceNode("Uint8Array"),
85
91
  undefined,
86
- ts.factory.createBlock(
87
- [...importer.declare(modulo, false), ...block],
88
- true,
89
- ),
92
+ ts.factory.createBlock([...importer.declare(false), ...block], true),
90
93
  );
91
94
  };
92
95
 
@@ -792,7 +795,7 @@ export namespace ProtobufEncodeProgrammer {
792
795
  (value: ts.Expression) =>
793
796
  ts.factory.createExpressionStatement(
794
797
  ts.factory.createCallExpression(
795
- importer.use("throws"),
798
+ importer.use("throws", true),
796
799
  [],
797
800
  [
798
801
  ts.factory.createObjectLiteralExpression(
package/src/protobuf.ts CHANGED
@@ -1,5 +1,3 @@
1
- import { Namespace } from "./functional/Namespace";
2
-
3
1
  import { IValidation } from "./IValidation";
4
2
  import { Resolved } from "./Resolved";
5
3
 
@@ -132,7 +130,6 @@ export function decode<T>(input: Uint8Array): Resolved<T>;
132
130
  export function decode(): never {
133
131
  halt("decode");
134
132
  }
135
- Object.assign(decode, Namespace.protobuf.decode("decode"));
136
133
 
137
134
  /**
138
135
  * > You must configure the generic argument `T`.
@@ -200,8 +197,6 @@ export function assertDecode<T>(input: Uint8Array): Resolved<T>;
200
197
  export function assertDecode(): never {
201
198
  halt("assertDecode");
202
199
  }
203
- Object.assign(assertDecode, Namespace.assert("protobuf.assertDecode"));
204
- Object.assign(assertDecode, Namespace.protobuf.decode("assertDecode"));
205
200
 
206
201
  /**
207
202
  * > You must configure the generic argument `T`.
@@ -269,8 +264,6 @@ export function isDecode<T>(input: Uint8Array): Resolved<T> | null;
269
264
  export function isDecode(): never {
270
265
  halt("isDecode");
271
266
  }
272
- Object.assign(isDecode, Namespace.is());
273
- Object.assign(isDecode, Namespace.protobuf.decode("isDecode"));
274
267
 
275
268
  /**
276
269
  * > You must configure the generic argument `T`.
@@ -340,8 +333,6 @@ export function validateDecode<T>(input: Uint8Array): IValidation<Resolved<T>>;
340
333
  export function validateDecode(): never {
341
334
  halt("validateDecode");
342
335
  }
343
- Object.assign(validateDecode, Namespace.validate());
344
- Object.assign(validateDecode, Namespace.protobuf.decode("validateDecode"));
345
336
 
346
337
  /* -----------------------------------------------------------
347
338
  ENCODE
@@ -381,7 +372,6 @@ export function encode<T>(input: T): Uint8Array;
381
372
  export function encode(): never {
382
373
  halt("encode");
383
374
  }
384
- Object.assign(encode, Namespace.protobuf.encode("encode"));
385
375
 
386
376
  /**
387
377
  * Protocol Buffer Encoder with type assertion.
@@ -455,8 +445,6 @@ export function assertEncode<T>(input: unknown): Uint8Array;
455
445
  export function assertEncode(): never {
456
446
  halt("assertEncode");
457
447
  }
458
- Object.assign(assertEncode, Namespace.assert("protobuf.assertEncode"));
459
- Object.assign(assertEncode, Namespace.protobuf.encode("assertEncode"));
460
448
 
461
449
  /**
462
450
  * Protocol Buffer Encoder with type checking.
@@ -530,8 +518,6 @@ export function isEncode<T>(input: unknown): Uint8Array | null;
530
518
  export function isEncode(): never {
531
519
  halt("isEncode");
532
520
  }
533
- Object.assign(isEncode, Namespace.is());
534
- Object.assign(isEncode, Namespace.protobuf.encode("isEncode"));
535
521
 
536
522
  /**
537
523
  * Protocol Buffer Encoder with type validation.
@@ -607,8 +593,6 @@ export function validateEncode<T>(input: unknown): IValidation<Uint8Array>;
607
593
  export function validateEncode(): never {
608
594
  halt("validateEncode");
609
595
  }
610
- Object.assign(validateEncode, Namespace.validate());
611
- Object.assign(validateEncode, Namespace.protobuf.encode("validateEncode"));
612
596
 
613
597
  /* -----------------------------------------------------------
614
598
  FACTORY FUNCTIONS
@@ -640,7 +624,6 @@ export function createDecode<T>(): (input: Uint8Array) => Resolved<T>;
640
624
  export function createDecode<T>(): (input: Uint8Array) => Resolved<T> {
641
625
  halt("createDecode");
642
626
  }
643
- Object.assign(createDecode, Namespace.protobuf.decode("createDecode"));
644
627
 
645
628
  /**
646
629
  * Creates a reusable {@link isDecode} function.
@@ -669,8 +652,6 @@ export function createIsDecode<T>(): (input: Uint8Array) => Resolved<T> | null;
669
652
  export function createIsDecode<T>(): (input: Uint8Array) => Resolved<T> | null {
670
653
  halt("createIsDecode");
671
654
  }
672
- Object.assign(createIsDecode, Namespace.is());
673
- Object.assign(createIsDecode, Namespace.protobuf.decode("createIsDecode"));
674
655
 
675
656
  /**
676
657
  * Creates a reusable {@link assertDecode} function.
@@ -699,14 +680,6 @@ export function createAssertDecode<T>(): (input: Uint8Array) => Resolved<T>;
699
680
  export function createAssertDecode<T>(): (input: Uint8Array) => Resolved<T> {
700
681
  halt("createAssertDecode");
701
682
  }
702
- Object.assign(
703
- createAssertDecode,
704
- Namespace.assert("protobuf.createAssertDecode"),
705
- );
706
- Object.assign(
707
- createAssertDecode,
708
- Namespace.protobuf.decode("createAssertDecode"),
709
- );
710
683
 
711
684
  /**
712
685
  * Creates a reusable {@link validateDecode} function.
@@ -739,11 +712,6 @@ export function createValidateDecode<T>(): (
739
712
  ) => IValidation<Resolved<T>> {
740
713
  halt("createValidateDecode");
741
714
  }
742
- Object.assign(createValidateDecode, Namespace.validate());
743
- Object.assign(
744
- createValidateDecode,
745
- Namespace.protobuf.decode("createValidateDecode"),
746
- );
747
715
 
748
716
  /**
749
717
  * Creates a reusable {@link encode} function.
@@ -772,7 +740,6 @@ export function createEncode<T>(): (input: T) => Uint8Array;
772
740
  export function createEncode<T>(): (input: T) => Uint8Array {
773
741
  halt("createEncode");
774
742
  }
775
- Object.assign(createEncode, Namespace.protobuf.encode("createEncode"));
776
743
 
777
744
  /**
778
745
  * Creates a reusable {@link isEncode} function.
@@ -801,8 +768,6 @@ export function createIsEncode<T>(): (input: T) => Uint8Array | null;
801
768
  export function createIsEncode<T>(): (input: T) => Uint8Array | null {
802
769
  halt("createIsEncode");
803
770
  }
804
- Object.assign(createIsEncode, Namespace.is());
805
- Object.assign(createIsEncode, Namespace.protobuf.encode("createIsEncode"));
806
771
 
807
772
  /**
808
773
  * Creates a reusable {@link assertEncode} function.
@@ -831,14 +796,6 @@ export function createAssertEncode<T>(): (input: T) => Uint8Array;
831
796
  export function createAssertEncode<T>(): (input: T) => Uint8Array {
832
797
  halt("createAssertEncode");
833
798
  }
834
- Object.assign(
835
- createAssertEncode,
836
- Namespace.assert("protobuf.createAssertEncode"),
837
- );
838
- Object.assign(
839
- createAssertEncode,
840
- Namespace.protobuf.encode("createAssertEncode"),
841
- );
842
799
 
843
800
  /**
844
801
  * Creates a reusable {@link validateEncode} function.
@@ -871,11 +828,6 @@ export function createValidateEncode<T>(): (
871
828
  ) => IValidation<Uint8Array> {
872
829
  halt("createValidateEncode");
873
830
  }
874
- Object.assign(createValidateEncode, Namespace.validate());
875
- Object.assign(
876
- createValidateEncode,
877
- Namespace.protobuf.encode("createValidateEncode"),
878
- );
879
831
 
880
832
  /**
881
833
  * @internal
@@ -1,7 +1,5 @@
1
1
  import { Atomic } from "../../typings/Atomic";
2
2
 
3
- import { IMetadataTypeTag } from "./IMetadataTypeTag";
4
-
5
3
  export type IMetadataConstant =
6
4
  | IMetadataConstant.IBase<"boolean", boolean>
7
5
  | IMetadataConstant.IBase<"number", number>
@@ -14,10 +12,5 @@ export namespace IMetadataConstant {
14
12
  > {
15
13
  type: Type;
16
14
  values: Value[];
17
-
18
- /**
19
- * @internal
20
- */
21
- tags?: Type extends "boolean" ? IMetadataTypeTag[][] | undefined : never;
22
15
  }
23
16
  }
@@ -10,9 +10,4 @@ export interface IMetadataObject {
10
10
  index: number;
11
11
  recursive: boolean;
12
12
  nullables: boolean[];
13
-
14
- /**
15
- * @internal
16
- */
17
- validated: boolean;
18
13
  }
@@ -65,7 +65,7 @@ export class MetadataObject {
65
65
  jsDocTags: obj.jsDocTags,
66
66
 
67
67
  index: obj.index,
68
- validated: obj.validated,
68
+ validated: false,
69
69
  recursive: obj.recursive,
70
70
  nullables: obj.nullables.slice(),
71
71
  });
@@ -125,7 +125,6 @@ export class MetadataObject {
125
125
  jsDocTags: this.jsDocTags,
126
126
 
127
127
  index: this.index,
128
- validated: this.validated,
129
128
  recursive: this.recursive,
130
129
  nullables: this.nullables.slice(),
131
130
  };
@@ -1 +0,0 @@
1
- export declare const $any: (val: any) => any;
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.$any = void 0;
4
- var _clone_1 = require("./$clone");
5
- var $any = function (val) {
6
- return val !== undefined ? (0, _clone_1.$clone)(val) : undefined;
7
- };
8
- exports.$any = $any;
9
- //# sourceMappingURL=$any.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"$any.js","sourceRoot":"","sources":["../../src/functional/$any.ts"],"names":[],"mappings":";;;AAAA,mCAAkC;AAE3B,IAAM,IAAI,GAAG,UAAC,GAAQ;IAC3B,OAAA,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,IAAA,eAAM,EAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS;AAA3C,CAA2C,CAAC;AADjC,QAAA,IAAI,QAC6B"}
@@ -1,2 +0,0 @@
1
- import { Customizable } from "../typings/Customizable";
2
- export declare const $dictionary: Map<string, Map<keyof Customizable, (tagText: string) => (value: any) => boolean>>;
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.$dictionary = void 0;
4
- var blackhole = {};
5
- exports.$dictionary = (function () {
6
- var _a;
7
- var glob = typeof global === "object" &&
8
- typeof global.process === "object" &&
9
- typeof global.process.versions === "object" &&
10
- typeof global.process.versions.node !== "undefined"
11
- ? (global !== null && global !== void 0 ? global : blackhole)
12
- : (self !== null && self !== void 0 ? self : blackhole);
13
- return ((_a = glob.__typia_custom_validator) !== null && _a !== void 0 ? _a : (glob.__typia_custom_validator = new Map()));
14
- })();
15
- //# sourceMappingURL=$dictionary.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"$dictionary.js","sourceRoot":"","sources":["../../src/functional/$dictionary.ts"],"names":[],"mappings":";;;AAKA,IAAM,SAAS,GAAQ,EAAE,CAAC;AAEb,QAAA,WAAW,GAAG,CAAC;;IAC1B,IAAM,IAAI,GAMR,OAAO,MAAM,KAAK,QAAQ;QAC1B,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ;QAClC,OAAO,MAAM,CAAC,OAAO,CAAC,QAAQ,KAAK,QAAQ;QAC3C,OAAO,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,KAAK,WAAW;QACjD,CAAC,CAAE,CAAC,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,SAAS,CAAS;QAChC,CAAC,CAAE,CAAC,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,SAAS,CAAS,CAAC;IACnC,OAAO,OAAC,IAAI,CAAC,wBAAwB,oCAA7B,IAAI,CAAC,wBAAwB,GAAK,IAAI,GAAG,EAAE,EAAC,CAAC;AACvD,CAAC,CAAC,EAAE,CAAC"}
@@ -1,2 +0,0 @@
1
- import { TypeGuardError } from "../TypeGuardError";
2
- export declare const $every: <T>(array: T[], pred: (value: T, i: number) => null | Omit<TypeGuardError.IProps, "method">) => null | Omit<TypeGuardError.IProps, "method">;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.$every = void 0;
4
- var $every = function (array, pred) {
5
- var error = null;
6
- for (var i = 0; i < array.length; ++i)
7
- if (null !== (error = pred(array[i], i)))
8
- return error;
9
- return null;
10
- };
11
- exports.$every = $every;
12
- //# sourceMappingURL=$every.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"$every.js","sourceRoot":"","sources":["../../src/functional/$every.ts"],"names":[],"mappings":";;;AAEO,IAAM,MAAM,GAAG,UACpB,KAAU,EACV,IAA2E;IAE3E,IAAI,KAAK,GAAiD,IAAI,CAAC;IAC/D,KAAK,IAAI,CAAC,GAAW,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;QAC3C,IAAI,IAAI,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAE,EAAE,CAAC,CAAC,CAAC;YAAE,OAAO,KAAK,CAAC;IAC1D,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AARW,QAAA,MAAM,UAQjB"}
@@ -1,6 +0,0 @@
1
- export declare function $varint_decode_i32(buf: Uint8Array, offset: number): [value: number, offset: number];
2
- export declare function $varint_decode_u32(buf: Uint8Array, offset: number): [value: number, offset: number];
3
- export declare function $varint_decode_i64(buf: Uint8Array, offset: number): [value: bigint, offset: number];
4
- export declare function $varint_decode_u64(buf: Uint8Array, offset: number): [value: bigint, offset: number];
5
- export declare function $varint_encode(dst: Uint8Array, offset: number, value: number): number;
6
- export declare function $varint_encode(dst: Uint8Array, offset: number, value: bigint): number;