typia 5.0.0-dev.20230711 → 5.0.0-dev.20230713

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 (381) hide show
  1. package/lib/functional/$number.js +2 -2
  2. package/lib/functional/$number.js.map +1 -1
  3. package/lib/json.d.ts +455 -0
  4. package/lib/json.js +85 -0
  5. package/lib/json.js.map +1 -0
  6. package/lib/misc.d.ts +442 -0
  7. package/lib/misc.js +98 -0
  8. package/lib/misc.js.map +1 -0
  9. package/lib/module.d.ts +132 -1024
  10. package/lib/module.js +32 -189
  11. package/lib/module.js.map +1 -1
  12. package/lib/programmers/IsPruneProgrammer.js +2 -2
  13. package/lib/programmers/IsPruneProgrammer.js.map +1 -1
  14. package/lib/programmers/internal/application_alias.d.ts +2 -2
  15. package/lib/programmers/internal/application_alias.js.map +1 -1
  16. package/lib/programmers/internal/application_array.js.map +1 -1
  17. package/lib/programmers/internal/application_native.js.map +1 -1
  18. package/lib/programmers/internal/application_object.js.map +1 -1
  19. package/lib/programmers/internal/application_resolved.d.ts +2 -2
  20. package/lib/programmers/internal/application_resolved.js.map +1 -1
  21. package/lib/programmers/internal/application_schema.js.map +1 -1
  22. package/lib/programmers/internal/application_tuple.js.map +1 -1
  23. package/lib/programmers/json/JsonApplicationProgrammer.d.ts +8 -0
  24. package/lib/programmers/{ApplicationProgrammer.js → json/JsonApplicationProgrammer.js} +8 -8
  25. package/lib/programmers/json/JsonApplicationProgrammer.js.map +1 -0
  26. package/lib/programmers/{AssertStringifyProgrammer.d.ts → json/JsonAssertParseProgrammer.d.ts} +2 -2
  27. package/lib/programmers/{AssertParseProgrammer.js → json/JsonAssertParseProgrammer.js} +10 -10
  28. package/lib/programmers/json/JsonAssertParseProgrammer.js.map +1 -0
  29. package/lib/programmers/json/JsonAssertStringifyProgrammer.d.ts +5 -0
  30. package/lib/programmers/{AssertStringifyProgrammer.js → json/JsonAssertStringifyProgrammer.js} +12 -12
  31. package/lib/programmers/json/JsonAssertStringifyProgrammer.js.map +1 -0
  32. package/lib/programmers/{IsCloneProgrammer.d.ts → json/JsonIsParseProgrammer.d.ts} +2 -2
  33. package/lib/programmers/{IsParseProgrammer.js → json/JsonIsParseProgrammer.js} +10 -10
  34. package/lib/programmers/json/JsonIsParseProgrammer.js.map +1 -0
  35. package/lib/programmers/{IsStringifyProgrammer.d.ts → json/JsonIsStringifyProgrammer.d.ts} +1 -1
  36. package/lib/programmers/{IsStringifyProgrammer.js → json/JsonIsStringifyProgrammer.js} +7 -7
  37. package/lib/programmers/json/JsonIsStringifyProgrammer.js.map +1 -0
  38. package/lib/programmers/{StringifyProgrammer.d.ts → json/JsonStringifyProgrammer.d.ts} +2 -2
  39. package/lib/programmers/{StringifyProgrammer.js → json/JsonStringifyProgrammer.js} +30 -30
  40. package/lib/programmers/json/JsonStringifyProgrammer.js.map +1 -0
  41. package/lib/programmers/json/JsonValidateParseProgrammer.d.ts +5 -0
  42. package/lib/programmers/{ValidateParseProgrammer.js → json/JsonValidateParseProgrammer.js} +10 -10
  43. package/lib/programmers/json/JsonValidateParseProgrammer.js.map +1 -0
  44. package/lib/programmers/json/JsonValidateStringifyProgrammer.d.ts +5 -0
  45. package/lib/programmers/{ValidateStringifyProgrammer.js → json/JsonValidateStringifyProgrammer.js} +12 -12
  46. package/lib/programmers/json/JsonValidateStringifyProgrammer.js.map +1 -0
  47. package/lib/programmers/{AssertPruneProgrammer.d.ts → misc/MiscAssertCloneProgrammer.d.ts} +2 -2
  48. package/lib/programmers/{AssertCloneProgrammer.js → misc/MiscAssertCloneProgrammer.js} +12 -12
  49. package/lib/programmers/misc/MiscAssertCloneProgrammer.js.map +1 -0
  50. package/lib/programmers/{AssertCloneProgrammer.d.ts → misc/MiscAssertPruneProgrammer.d.ts} +2 -2
  51. package/lib/programmers/{AssertPruneProgrammer.js → misc/MiscAssertPruneProgrammer.js} +12 -12
  52. package/lib/programmers/misc/MiscAssertPruneProgrammer.js.map +1 -0
  53. package/lib/programmers/{CloneProgrammer.d.ts → misc/MiscCloneProgrammer.d.ts} +2 -2
  54. package/lib/programmers/{CloneProgrammer.js → misc/MiscCloneProgrammer.js} +20 -20
  55. package/lib/programmers/misc/MiscCloneProgrammer.js.map +1 -0
  56. package/lib/programmers/{AssertParseProgrammer.d.ts → misc/MiscIsCloneProgrammer.d.ts} +2 -2
  57. package/lib/programmers/{IsCloneProgrammer.js → misc/MiscIsCloneProgrammer.js} +12 -12
  58. package/lib/programmers/misc/MiscIsCloneProgrammer.js.map +1 -0
  59. package/lib/programmers/{LiteralsProgrammer.d.ts → misc/MiscLiteralsProgrammer.d.ts} +2 -2
  60. package/lib/programmers/{LiteralsProgrammer.js → misc/MiscLiteralsProgrammer.js} +12 -11
  61. package/lib/programmers/misc/MiscLiteralsProgrammer.js.map +1 -0
  62. package/lib/programmers/{PruneProgrammer.d.ts → misc/MiscPruneProgrammer.d.ts} +2 -2
  63. package/lib/programmers/{PruneProgrammer.js → misc/MiscPruneProgrammer.js} +20 -20
  64. package/lib/programmers/misc/MiscPruneProgrammer.js.map +1 -0
  65. package/lib/programmers/misc/MiscValidateCloneProgrammer.d.ts +5 -0
  66. package/lib/programmers/{ValidateCloneProgrammer.js → misc/MiscValidateCloneProgrammer.js} +12 -12
  67. package/lib/programmers/misc/MiscValidateCloneProgrammer.js.map +1 -0
  68. package/lib/programmers/misc/MiscValidatePruneProgrammer.d.ts +5 -0
  69. package/lib/programmers/{ValidatePruneProgrammer.js → misc/MiscValidatePruneProgrammer.js} +12 -12
  70. package/lib/programmers/misc/MiscValidatePruneProgrammer.js.map +1 -0
  71. package/lib/programmers/{MessageProgrammer.d.ts → protobuf/ProtobufMessageProgrammer.d.ts} +2 -2
  72. package/lib/programmers/{MessageProgrammer.js → protobuf/ProtobufMessageProgrammer.js} +11 -11
  73. package/lib/programmers/protobuf/ProtobufMessageProgrammer.js.map +1 -0
  74. package/lib/protobuf.d.ts +2 -0
  75. package/lib/protobuf.js +11 -0
  76. package/lib/protobuf.js.map +1 -0
  77. package/lib/transformers/CallExpressionTransformer.js +122 -103
  78. package/lib/transformers/CallExpressionTransformer.js.map +1 -1
  79. package/lib/transformers/features/AssertTransformer.d.ts +3 -0
  80. package/lib/transformers/features/{validators/AssertTransformer.js → AssertTransformer.js} +2 -2
  81. package/lib/transformers/features/AssertTransformer.js.map +1 -0
  82. package/lib/transformers/features/CreateAssertTransformer.d.ts +3 -0
  83. package/lib/transformers/features/{validators/CreateAssertTransformer.js → CreateAssertTransformer.js} +2 -2
  84. package/lib/transformers/features/CreateAssertTransformer.js.map +1 -0
  85. package/lib/transformers/features/CreateIsTransformer.d.ts +3 -0
  86. package/lib/transformers/features/{validators/CreateIsTransformer.js → CreateIsTransformer.js} +2 -2
  87. package/lib/transformers/features/CreateIsTransformer.js.map +1 -0
  88. package/lib/transformers/features/{miscellaneous/CreateRandomTransformer.d.ts → CreateRandomTransformer.d.ts} +1 -1
  89. package/lib/transformers/features/{miscellaneous/CreateRandomTransformer.js → CreateRandomTransformer.js} +1 -1
  90. package/lib/transformers/features/CreateRandomTransformer.js.map +1 -0
  91. package/lib/transformers/features/CreateValidateTransformer.d.ts +3 -0
  92. package/lib/transformers/features/{validators/CreateValidateTransformer.js → CreateValidateTransformer.js} +2 -2
  93. package/lib/transformers/features/CreateValidateTransformer.js.map +1 -0
  94. package/lib/transformers/features/IsTransformer.d.ts +3 -0
  95. package/lib/transformers/features/{validators/IsTransformer.js → IsTransformer.js} +2 -2
  96. package/lib/transformers/features/IsTransformer.js.map +1 -0
  97. package/lib/transformers/features/{miscellaneous/RandomTransformer.d.ts → RandomTransformer.d.ts} +1 -1
  98. package/lib/transformers/features/{miscellaneous/RandomTransformer.js → RandomTransformer.js} +1 -1
  99. package/lib/transformers/features/RandomTransformer.js.map +1 -0
  100. package/lib/transformers/features/ValidateTransformer.d.ts +3 -0
  101. package/lib/transformers/features/{validators/ValidateTransformer.js → ValidateTransformer.js} +2 -2
  102. package/lib/transformers/features/ValidateTransformer.js.map +1 -0
  103. package/lib/transformers/features/{parsers → json}/AssertParseTransformer.js +4 -2
  104. package/lib/transformers/features/json/AssertParseTransformer.js.map +1 -0
  105. package/lib/transformers/features/{stringifiers → json}/AssertStringifyTransformer.js +2 -2
  106. package/lib/transformers/features/json/AssertStringifyTransformer.js.map +1 -0
  107. package/lib/transformers/features/{parsers → json}/CreateAssertParseTransformer.js +4 -2
  108. package/lib/transformers/features/json/CreateAssertParseTransformer.js.map +1 -0
  109. package/lib/transformers/features/{stringifiers → json}/CreateAssertStringifyTransformer.js +2 -2
  110. package/lib/transformers/features/json/CreateAssertStringifyTransformer.js.map +1 -0
  111. package/lib/transformers/features/{parsers → json}/CreateIsParseTransformer.js +2 -2
  112. package/lib/transformers/features/json/CreateIsParseTransformer.js.map +1 -0
  113. package/lib/transformers/features/{stringifiers → json}/CreateIsStringifyTransformer.js +2 -2
  114. package/lib/transformers/features/json/CreateIsStringifyTransformer.js.map +1 -0
  115. package/lib/transformers/features/{stringifiers → json}/CreateStringifyTransformer.js +2 -2
  116. package/lib/transformers/features/json/CreateStringifyTransformer.js.map +1 -0
  117. package/lib/transformers/features/{parsers → json}/CreateValidateParseTransformer.js +4 -2
  118. package/lib/transformers/features/json/CreateValidateParseTransformer.js.map +1 -0
  119. package/lib/transformers/features/{stringifiers → json}/CreateValidateStringifyProgrammer.js +2 -2
  120. package/lib/transformers/features/json/CreateValidateStringifyProgrammer.js.map +1 -0
  121. package/lib/transformers/features/{parsers → json}/IsParseTransformer.js +2 -2
  122. package/lib/transformers/features/json/IsParseTransformer.js.map +1 -0
  123. package/lib/transformers/features/{stringifiers → json}/IsStringifyTransformer.js +2 -2
  124. package/lib/transformers/features/json/IsStringifyTransformer.js.map +1 -0
  125. package/lib/transformers/features/{stringifiers → json}/StringifyTransformer.js +2 -2
  126. package/lib/transformers/features/json/StringifyTransformer.js.map +1 -0
  127. package/lib/transformers/features/{parsers → json}/ValidateParseTransformer.js +4 -2
  128. package/lib/transformers/features/json/ValidateParseTransformer.js.map +1 -0
  129. package/lib/transformers/features/{stringifiers → json}/ValidateStringifyTransformer.js +2 -2
  130. package/lib/transformers/features/json/ValidateStringifyTransformer.js.map +1 -0
  131. package/lib/transformers/features/{miscellaneous → misc}/ApplicationTransformer.js +2 -2
  132. package/lib/transformers/features/misc/ApplicationTransformer.js.map +1 -0
  133. package/lib/transformers/features/{miscellaneous → misc}/AssertCloneTransformer.js +4 -2
  134. package/lib/transformers/features/misc/AssertCloneTransformer.js.map +1 -0
  135. package/lib/transformers/features/{miscellaneous → misc}/AssertPruneTransformer.js +4 -2
  136. package/lib/transformers/features/misc/AssertPruneTransformer.js.map +1 -0
  137. package/lib/transformers/features/{miscellaneous → misc}/CloneTransformer.js +2 -2
  138. package/lib/transformers/features/misc/CloneTransformer.js.map +1 -0
  139. package/lib/transformers/features/{miscellaneous → misc}/CreateAssertCloneTransformer.js +4 -2
  140. package/lib/transformers/features/misc/CreateAssertCloneTransformer.js.map +1 -0
  141. package/lib/transformers/features/{miscellaneous → misc}/CreateAssertPruneTransformer.js +4 -2
  142. package/lib/transformers/features/misc/CreateAssertPruneTransformer.js.map +1 -0
  143. package/lib/transformers/features/{miscellaneous → misc}/CreateCloneTransformer.js +2 -2
  144. package/lib/transformers/features/misc/CreateCloneTransformer.js.map +1 -0
  145. package/lib/transformers/features/{miscellaneous → misc}/CreateIsCloneTransformer.js +2 -2
  146. package/lib/transformers/features/misc/CreateIsCloneTransformer.js.map +1 -0
  147. package/lib/transformers/features/misc/CreateIsPruneTransformer.js.map +1 -0
  148. package/lib/transformers/features/{miscellaneous → misc}/CreatePruneTransformer.js +2 -2
  149. package/lib/transformers/features/misc/CreatePruneTransformer.js.map +1 -0
  150. package/lib/transformers/features/{miscellaneous → misc}/CreateValidateCloneTransformer.js +4 -2
  151. package/lib/transformers/features/misc/CreateValidateCloneTransformer.js.map +1 -0
  152. package/lib/transformers/features/{miscellaneous → misc}/CreateValidatePruneTransformer.js +4 -2
  153. package/lib/transformers/features/misc/CreateValidatePruneTransformer.js.map +1 -0
  154. package/lib/transformers/features/{miscellaneous → misc}/IsCloneTransformer.js +2 -2
  155. package/lib/transformers/features/misc/IsCloneTransformer.js.map +1 -0
  156. package/lib/transformers/features/misc/IsPruneTransformer.js.map +1 -0
  157. package/lib/transformers/features/{miscellaneous → misc}/LiteralsTransformer.js +2 -2
  158. package/lib/transformers/features/misc/LiteralsTransformer.js.map +1 -0
  159. package/lib/transformers/features/misc/MetadataTransformer.js.map +1 -0
  160. package/lib/transformers/features/{miscellaneous → misc}/PruneTransformer.js +2 -2
  161. package/lib/transformers/features/misc/PruneTransformer.js.map +1 -0
  162. package/lib/transformers/features/{miscellaneous → misc}/ValidateCloneTransformer.js +4 -2
  163. package/lib/transformers/features/misc/ValidateCloneTransformer.js.map +1 -0
  164. package/lib/transformers/features/{miscellaneous → misc}/ValidatePruneTransformer.js +4 -2
  165. package/lib/transformers/features/misc/ValidatePruneTransformer.js.map +1 -0
  166. package/lib/transformers/features/{protocols → protobuf}/MessageTransformer.js +2 -2
  167. package/lib/transformers/features/protobuf/MessageTransformer.js.map +1 -0
  168. package/package.json +1 -1
  169. package/src/factories/MetadataTagFactory.ts +362 -362
  170. package/src/factories/ProtocolFactory.ts +80 -80
  171. package/src/factories/internal/protocols/ProtocolMetadataUtil.ts +180 -180
  172. package/src/factories/internal/protocols/emplace_protocol_object.ts +25 -25
  173. package/src/factories/internal/protocols/emplace_protocol_property.ts +12 -12
  174. package/src/factories/internal/protocols/iterate_protocol_atomic.ts +34 -34
  175. package/src/factories/internal/protocols/iterate_protocol_constant.ts +27 -27
  176. package/src/factories/internal/protocols/iterate_protocol_main.ts +19 -19
  177. package/src/factories/internal/protocols/iterate_protocol_map.ts +58 -58
  178. package/src/factories/internal/protocols/iterate_protocol_metadata.ts +96 -96
  179. package/src/factories/internal/protocols/iterate_protocol_native.ts +34 -34
  180. package/src/factories/internal/protocols/iterate_protocol_never.ts +1 -1
  181. package/src/factories/internal/protocols/iterate_protocol_object.ts +110 -110
  182. package/src/factories/internal/protocols/iterate_protocol_repeated.ts +34 -34
  183. package/src/factories/internal/protocols/iterate_protocol_tuple.ts +29 -29
  184. package/src/functional/$number.ts +3 -2
  185. package/src/functional/$proto_bytes.ts +25 -25
  186. package/src/functional/$proto_field.ts +30 -30
  187. package/src/functional/$proto_float.ts +37 -37
  188. package/src/functional/$proto_i32.ts +29 -29
  189. package/src/functional/$proto_i64.ts +37 -37
  190. package/src/functional/$proto_size.ts +82 -82
  191. package/src/functional/$proto_string.ts +24 -24
  192. package/src/functional/$varint.ts +130 -130
  193. package/src/functional/$zigzag.ts +39 -39
  194. package/src/json.ts +648 -0
  195. package/src/messages/IProtocolMap.ts +5 -5
  196. package/src/messages/IProtocolMessage.ts +6 -6
  197. package/src/messages/IProtocolProperty.ts +13 -13
  198. package/src/metadata/IMetadataTag.ts +113 -113
  199. package/src/metadata/Metadata.ts +606 -606
  200. package/src/misc.ts +651 -0
  201. package/src/module.ts +781 -2049
  202. package/src/programmers/IsPruneProgrammer.ts +2 -2
  203. package/src/programmers/internal/application_alias.ts +2 -2
  204. package/src/programmers/internal/application_array.ts +2 -2
  205. package/src/programmers/internal/application_native.ts +2 -2
  206. package/src/programmers/internal/application_number.ts +77 -77
  207. package/src/programmers/internal/application_object.ts +3 -3
  208. package/src/programmers/internal/application_resolved.ts +2 -2
  209. package/src/programmers/internal/application_schema.ts +2 -2
  210. package/src/programmers/internal/application_tuple.ts +2 -2
  211. package/src/programmers/{ApplicationProgrammer.ts → json/JsonApplicationProgrammer.ts} +6 -6
  212. package/src/programmers/{AssertParseProgrammer.ts → json/JsonAssertParseProgrammer.ts} +6 -6
  213. package/src/programmers/{AssertStringifyProgrammer.ts → json/JsonAssertStringifyProgrammer.ts} +8 -8
  214. package/src/programmers/{IsParseProgrammer.ts → json/JsonIsParseProgrammer.ts} +6 -6
  215. package/src/programmers/{IsStringifyProgrammer.ts → json/JsonIsStringifyProgrammer.ts} +7 -7
  216. package/src/programmers/{StringifyProgrammer.ts → json/JsonStringifyProgrammer.ts} +40 -39
  217. package/src/programmers/{ValidateParseProgrammer.ts → json/JsonValidateParseProgrammer.ts} +6 -6
  218. package/src/programmers/{ValidateStringifyProgrammer.ts → json/JsonValidateStringifyProgrammer.ts} +8 -8
  219. package/src/programmers/{AssertCloneProgrammer.ts → misc/MiscAssertCloneProgrammer.ts} +8 -8
  220. package/src/programmers/{AssertPruneProgrammer.ts → misc/MiscAssertPruneProgrammer.ts} +8 -8
  221. package/src/programmers/{CloneProgrammer.ts → misc/MiscCloneProgrammer.ts} +24 -24
  222. package/src/programmers/{IsCloneProgrammer.ts → misc/MiscIsCloneProgrammer.ts} +8 -8
  223. package/src/programmers/{LiteralsProgrammer.ts → misc/MiscLiteralsProgrammer.ts} +63 -62
  224. package/src/programmers/{PruneProgrammer.ts → misc/MiscPruneProgrammer.ts} +24 -24
  225. package/src/programmers/{ValidateCloneProgrammer.ts → misc/MiscValidateCloneProgrammer.ts} +8 -8
  226. package/src/programmers/{ValidatePruneProgrammer.ts → misc/MiscValidatePruneProgrammer.ts} +8 -8
  227. package/src/programmers/{MessageProgrammer.ts → protobuf/ProtobufMessageProgrammer.ts} +126 -126
  228. package/src/protobuf.ts +18 -0
  229. package/src/transformers/CallExpressionTransformer.ts +196 -186
  230. package/src/transformers/features/{validators/AssertTransformer.ts → AssertTransformer.ts} +2 -2
  231. package/src/transformers/features/{validators/CreateAssertTransformer.ts → CreateAssertTransformer.ts} +2 -2
  232. package/src/transformers/features/{validators/CreateIsTransformer.ts → CreateIsTransformer.ts} +2 -2
  233. package/src/transformers/features/{miscellaneous/CreateRandomTransformer.ts → CreateRandomTransformer.ts} +2 -2
  234. package/src/transformers/features/{validators/CreateValidateTransformer.ts → CreateValidateTransformer.ts} +2 -2
  235. package/src/transformers/features/{validators/IsTransformer.ts → IsTransformer.ts} +2 -2
  236. package/src/transformers/features/{miscellaneous/RandomTransformer.ts → RandomTransformer.ts} +2 -2
  237. package/src/transformers/features/{validators/ValidateTransformer.ts → ValidateTransformer.ts} +2 -2
  238. package/src/transformers/features/{parsers → json}/AssertParseTransformer.ts +3 -2
  239. package/src/transformers/features/{stringifiers → json}/AssertStringifyTransformer.ts +2 -2
  240. package/src/transformers/features/{parsers → json}/CreateAssertParseTransformer.ts +3 -2
  241. package/src/transformers/features/{stringifiers → json}/CreateAssertStringifyTransformer.ts +2 -2
  242. package/src/transformers/features/{parsers → json}/CreateIsParseTransformer.ts +2 -2
  243. package/src/transformers/features/{stringifiers → json}/CreateIsStringifyTransformer.ts +1 -1
  244. package/src/transformers/features/{stringifiers → json}/CreateStringifyTransformer.ts +2 -2
  245. package/src/transformers/features/{parsers → json}/CreateValidateParseTransformer.ts +3 -2
  246. package/src/transformers/features/{stringifiers → json}/CreateValidateStringifyProgrammer.ts +2 -2
  247. package/src/transformers/features/{parsers → json}/IsParseTransformer.ts +2 -2
  248. package/src/transformers/features/{stringifiers → json}/IsStringifyTransformer.ts +1 -1
  249. package/src/transformers/features/{stringifiers → json}/StringifyTransformer.ts +2 -2
  250. package/src/transformers/features/{parsers → json}/ValidateParseTransformer.ts +3 -2
  251. package/src/transformers/features/{stringifiers → json}/ValidateStringifyTransformer.ts +2 -2
  252. package/src/transformers/features/{miscellaneous → misc}/ApplicationTransformer.ts +102 -102
  253. package/src/transformers/features/{miscellaneous → misc}/AssertCloneTransformer.ts +3 -2
  254. package/src/transformers/features/{miscellaneous → misc}/AssertPruneTransformer.ts +3 -2
  255. package/src/transformers/features/{miscellaneous → misc}/CloneTransformer.ts +2 -2
  256. package/src/transformers/features/{miscellaneous → misc}/CreateAssertCloneTransformer.ts +3 -2
  257. package/src/transformers/features/{miscellaneous → misc}/CreateAssertPruneTransformer.ts +3 -2
  258. package/src/transformers/features/{miscellaneous → misc}/CreateCloneTransformer.ts +2 -2
  259. package/src/transformers/features/{miscellaneous → misc}/CreateIsCloneTransformer.ts +2 -2
  260. package/src/transformers/features/{miscellaneous → misc}/CreatePruneTransformer.ts +2 -2
  261. package/src/transformers/features/{miscellaneous → misc}/CreateValidateCloneTransformer.ts +3 -2
  262. package/src/transformers/features/{miscellaneous → misc}/CreateValidatePruneTransformer.ts +3 -2
  263. package/src/transformers/features/{miscellaneous → misc}/IsCloneTransformer.ts +2 -2
  264. package/src/transformers/features/{miscellaneous → misc}/LiteralsTransformer.ts +2 -2
  265. package/src/transformers/features/{miscellaneous → misc}/PruneTransformer.ts +2 -2
  266. package/src/transformers/features/{miscellaneous → misc}/ValidateCloneTransformer.ts +3 -2
  267. package/src/transformers/features/{miscellaneous → misc}/ValidatePruneTransformer.ts +3 -2
  268. package/src/transformers/features/{protocols → protobuf}/MessageTransformer.ts +31 -31
  269. package/src/utils/Escaper.ts +46 -46
  270. package/src/utils/NameEncoder.ts +32 -32
  271. package/lib/programmers/ApplicationProgrammer.d.ts +0 -8
  272. package/lib/programmers/ApplicationProgrammer.js.map +0 -1
  273. package/lib/programmers/AssertCloneProgrammer.js.map +0 -1
  274. package/lib/programmers/AssertParseProgrammer.js.map +0 -1
  275. package/lib/programmers/AssertPruneProgrammer.js.map +0 -1
  276. package/lib/programmers/AssertStringifyProgrammer.js.map +0 -1
  277. package/lib/programmers/CloneProgrammer.js.map +0 -1
  278. package/lib/programmers/IsCloneProgrammer.js.map +0 -1
  279. package/lib/programmers/IsParseProgrammer.d.ts +0 -5
  280. package/lib/programmers/IsParseProgrammer.js.map +0 -1
  281. package/lib/programmers/IsStringifyProgrammer.js.map +0 -1
  282. package/lib/programmers/LiteralsProgrammer.js.map +0 -1
  283. package/lib/programmers/MessageProgrammer.js.map +0 -1
  284. package/lib/programmers/PruneProgrammer.js.map +0 -1
  285. package/lib/programmers/StringifyProgrammer.js.map +0 -1
  286. package/lib/programmers/ValidateCloneProgrammer.d.ts +0 -5
  287. package/lib/programmers/ValidateCloneProgrammer.js.map +0 -1
  288. package/lib/programmers/ValidateParseProgrammer.d.ts +0 -5
  289. package/lib/programmers/ValidateParseProgrammer.js.map +0 -1
  290. package/lib/programmers/ValidatePruneProgrammer.d.ts +0 -5
  291. package/lib/programmers/ValidatePruneProgrammer.js.map +0 -1
  292. package/lib/programmers/ValidateStringifyProgrammer.d.ts +0 -5
  293. package/lib/programmers/ValidateStringifyProgrammer.js.map +0 -1
  294. package/lib/transformers/features/miscellaneous/ApplicationTransformer.js.map +0 -1
  295. package/lib/transformers/features/miscellaneous/AssertCloneTransformer.js.map +0 -1
  296. package/lib/transformers/features/miscellaneous/AssertPruneTransformer.js.map +0 -1
  297. package/lib/transformers/features/miscellaneous/CloneTransformer.js.map +0 -1
  298. package/lib/transformers/features/miscellaneous/CreateAssertCloneTransformer.js.map +0 -1
  299. package/lib/transformers/features/miscellaneous/CreateAssertPruneTransformer.js.map +0 -1
  300. package/lib/transformers/features/miscellaneous/CreateCloneTransformer.js.map +0 -1
  301. package/lib/transformers/features/miscellaneous/CreateIsCloneTransformer.js.map +0 -1
  302. package/lib/transformers/features/miscellaneous/CreateIsPruneTransformer.js.map +0 -1
  303. package/lib/transformers/features/miscellaneous/CreatePruneTransformer.js.map +0 -1
  304. package/lib/transformers/features/miscellaneous/CreateRandomTransformer.js.map +0 -1
  305. package/lib/transformers/features/miscellaneous/CreateValidateCloneTransformer.js.map +0 -1
  306. package/lib/transformers/features/miscellaneous/CreateValidatePruneTransformer.js.map +0 -1
  307. package/lib/transformers/features/miscellaneous/IsCloneTransformer.js.map +0 -1
  308. package/lib/transformers/features/miscellaneous/IsPruneTransformer.js.map +0 -1
  309. package/lib/transformers/features/miscellaneous/LiteralsTransformer.js.map +0 -1
  310. package/lib/transformers/features/miscellaneous/MetadataTransformer.js.map +0 -1
  311. package/lib/transformers/features/miscellaneous/PruneTransformer.js.map +0 -1
  312. package/lib/transformers/features/miscellaneous/RandomTransformer.js.map +0 -1
  313. package/lib/transformers/features/miscellaneous/ValidateCloneTransformer.js.map +0 -1
  314. package/lib/transformers/features/miscellaneous/ValidatePruneTransformer.js.map +0 -1
  315. package/lib/transformers/features/parsers/AssertParseTransformer.js.map +0 -1
  316. package/lib/transformers/features/parsers/CreateAssertParseTransformer.js.map +0 -1
  317. package/lib/transformers/features/parsers/CreateIsParseTransformer.js.map +0 -1
  318. package/lib/transformers/features/parsers/CreateValidateParseTransformer.js.map +0 -1
  319. package/lib/transformers/features/parsers/IsParseTransformer.js.map +0 -1
  320. package/lib/transformers/features/parsers/ValidateParseTransformer.js.map +0 -1
  321. package/lib/transformers/features/protocols/MessageTransformer.js.map +0 -1
  322. package/lib/transformers/features/stringifiers/AssertStringifyTransformer.js.map +0 -1
  323. package/lib/transformers/features/stringifiers/CreateAssertStringifyTransformer.js.map +0 -1
  324. package/lib/transformers/features/stringifiers/CreateIsStringifyTransformer.js.map +0 -1
  325. package/lib/transformers/features/stringifiers/CreateStringifyTransformer.js.map +0 -1
  326. package/lib/transformers/features/stringifiers/CreateValidateStringifyProgrammer.js.map +0 -1
  327. package/lib/transformers/features/stringifiers/IsStringifyTransformer.js.map +0 -1
  328. package/lib/transformers/features/stringifiers/StringifyTransformer.js.map +0 -1
  329. package/lib/transformers/features/stringifiers/ValidateStringifyTransformer.js.map +0 -1
  330. package/lib/transformers/features/validators/AssertTransformer.d.ts +0 -3
  331. package/lib/transformers/features/validators/AssertTransformer.js.map +0 -1
  332. package/lib/transformers/features/validators/CreateAssertTransformer.d.ts +0 -3
  333. package/lib/transformers/features/validators/CreateAssertTransformer.js.map +0 -1
  334. package/lib/transformers/features/validators/CreateIsTransformer.d.ts +0 -3
  335. package/lib/transformers/features/validators/CreateIsTransformer.js.map +0 -1
  336. package/lib/transformers/features/validators/CreateValidateTransformer.d.ts +0 -3
  337. package/lib/transformers/features/validators/CreateValidateTransformer.js.map +0 -1
  338. package/lib/transformers/features/validators/IsTransformer.d.ts +0 -3
  339. package/lib/transformers/features/validators/IsTransformer.js.map +0 -1
  340. package/lib/transformers/features/validators/ValidateTransformer.d.ts +0 -3
  341. package/lib/transformers/features/validators/ValidateTransformer.js.map +0 -1
  342. /package/lib/transformers/features/{parsers → json}/AssertParseTransformer.d.ts +0 -0
  343. /package/lib/transformers/features/{stringifiers → json}/AssertStringifyTransformer.d.ts +0 -0
  344. /package/lib/transformers/features/{parsers → json}/CreateAssertParseTransformer.d.ts +0 -0
  345. /package/lib/transformers/features/{stringifiers → json}/CreateAssertStringifyTransformer.d.ts +0 -0
  346. /package/lib/transformers/features/{parsers → json}/CreateIsParseTransformer.d.ts +0 -0
  347. /package/lib/transformers/features/{stringifiers → json}/CreateIsStringifyTransformer.d.ts +0 -0
  348. /package/lib/transformers/features/{stringifiers → json}/CreateStringifyTransformer.d.ts +0 -0
  349. /package/lib/transformers/features/{parsers → json}/CreateValidateParseTransformer.d.ts +0 -0
  350. /package/lib/transformers/features/{stringifiers → json}/CreateValidateStringifyProgrammer.d.ts +0 -0
  351. /package/lib/transformers/features/{parsers → json}/IsParseTransformer.d.ts +0 -0
  352. /package/lib/transformers/features/{stringifiers → json}/IsStringifyTransformer.d.ts +0 -0
  353. /package/lib/transformers/features/{stringifiers → json}/StringifyTransformer.d.ts +0 -0
  354. /package/lib/transformers/features/{parsers → json}/ValidateParseTransformer.d.ts +0 -0
  355. /package/lib/transformers/features/{stringifiers → json}/ValidateStringifyTransformer.d.ts +0 -0
  356. /package/lib/transformers/features/{miscellaneous → misc}/ApplicationTransformer.d.ts +0 -0
  357. /package/lib/transformers/features/{miscellaneous → misc}/AssertCloneTransformer.d.ts +0 -0
  358. /package/lib/transformers/features/{miscellaneous → misc}/AssertPruneTransformer.d.ts +0 -0
  359. /package/lib/transformers/features/{miscellaneous → misc}/CloneTransformer.d.ts +0 -0
  360. /package/lib/transformers/features/{miscellaneous → misc}/CreateAssertCloneTransformer.d.ts +0 -0
  361. /package/lib/transformers/features/{miscellaneous → misc}/CreateAssertPruneTransformer.d.ts +0 -0
  362. /package/lib/transformers/features/{miscellaneous → misc}/CreateCloneTransformer.d.ts +0 -0
  363. /package/lib/transformers/features/{miscellaneous → misc}/CreateIsCloneTransformer.d.ts +0 -0
  364. /package/lib/transformers/features/{miscellaneous → misc}/CreateIsPruneTransformer.d.ts +0 -0
  365. /package/lib/transformers/features/{miscellaneous → misc}/CreateIsPruneTransformer.js +0 -0
  366. /package/lib/transformers/features/{miscellaneous → misc}/CreatePruneTransformer.d.ts +0 -0
  367. /package/lib/transformers/features/{miscellaneous → misc}/CreateValidateCloneTransformer.d.ts +0 -0
  368. /package/lib/transformers/features/{miscellaneous → misc}/CreateValidatePruneTransformer.d.ts +0 -0
  369. /package/lib/transformers/features/{miscellaneous → misc}/IsCloneTransformer.d.ts +0 -0
  370. /package/lib/transformers/features/{miscellaneous → misc}/IsPruneTransformer.d.ts +0 -0
  371. /package/lib/transformers/features/{miscellaneous → misc}/IsPruneTransformer.js +0 -0
  372. /package/lib/transformers/features/{miscellaneous → misc}/LiteralsTransformer.d.ts +0 -0
  373. /package/lib/transformers/features/{miscellaneous → misc}/MetadataTransformer.d.ts +0 -0
  374. /package/lib/transformers/features/{miscellaneous → misc}/MetadataTransformer.js +0 -0
  375. /package/lib/transformers/features/{miscellaneous → misc}/PruneTransformer.d.ts +0 -0
  376. /package/lib/transformers/features/{miscellaneous → misc}/ValidateCloneTransformer.d.ts +0 -0
  377. /package/lib/transformers/features/{miscellaneous → misc}/ValidatePruneTransformer.d.ts +0 -0
  378. /package/lib/transformers/features/{protocols → protobuf}/MessageTransformer.d.ts +0 -0
  379. /package/src/transformers/features/{miscellaneous → misc}/CreateIsPruneTransformer.ts +0 -0
  380. /package/src/transformers/features/{miscellaneous → misc}/IsPruneTransformer.ts +0 -0
  381. /package/src/transformers/features/{miscellaneous → misc}/MetadataTransformer.ts +0 -0
@@ -5,10 +5,10 @@ var TypeGuardError_1 = require("../TypeGuardError");
5
5
  var $number = function (value) {
6
6
  if (isFinite(value) === false)
7
7
  throw new TypeGuardError_1.TypeGuardError({
8
- method: "typia.stringify",
8
+ method: "typia.json.stringify",
9
9
  expected: "number",
10
10
  value: value,
11
- message: "Error on typia.stringify(): infinite or not a number.",
11
+ message: "Error on typia.json.stringify(): infinite or not a number.",
12
12
  });
13
13
  return value;
14
14
  };
@@ -1 +1 @@
1
- {"version":3,"file":"$number.js","sourceRoot":"","sources":["../../src/functional/$number.ts"],"names":[],"mappings":";;;AAAA,oDAAmD;AAE5C,IAAM,OAAO,GAAG,UAAC,KAAa;IACjC,IAAI,QAAQ,CAAC,KAAK,CAAC,KAAK,KAAK;QACzB,MAAM,IAAI,+BAAc,CAAC;YACrB,MAAM,EAAE,iBAAiB;YACzB,QAAQ,EAAE,QAAQ;YAClB,KAAK,OAAA;YACL,OAAO,EAAE,uDAAuD;SACnE,CAAC,CAAC;IACP,OAAO,KAAK,CAAC;AACjB,CAAC,CAAC;AATW,QAAA,OAAO,WASlB"}
1
+ {"version":3,"file":"$number.js","sourceRoot":"","sources":["../../src/functional/$number.ts"],"names":[],"mappings":";;;AAAA,oDAAmD;AAE5C,IAAM,OAAO,GAAG,UAAC,KAAa;IACjC,IAAI,QAAQ,CAAC,KAAK,CAAC,KAAK,KAAK;QACzB,MAAM,IAAI,+BAAc,CAAC;YACrB,MAAM,EAAE,sBAAsB;YAC9B,QAAQ,EAAE,QAAQ;YAClB,KAAK,OAAA;YACL,OAAO,EACH,4DAA4D;SACnE,CAAC,CAAC;IACP,OAAO,KAAK,CAAC;AACjB,CAAC,CAAC;AAVW,QAAA,OAAO,WAUlB"}
package/lib/json.d.ts ADDED
@@ -0,0 +1,455 @@
1
+ import { IJsonApplication } from "./schemas/IJsonApplication";
2
+ import { IValidation } from "./IValidation";
3
+ import { Primitive } from "./Primitive";
4
+ /**
5
+ * > You must configure the generic argument `T`.
6
+ *
7
+ * JSON Schema Application.
8
+ *
9
+ * Creates a JSON schema application which contains both main JSON schemas and
10
+ * components. Note that, all of the object types are stored in the
11
+ * {@link IJsonApplication.components} property for the `$ref` referencing.
12
+ *
13
+ * Also, `typia.json.application()` has additional generic arguments, *Purpose*.
14
+ * As JSON schema definitions used by `swagger` and `ajv` are different a little bit,
15
+ * you should configure the *Purpose* appropriately.
16
+ *
17
+ * For an example, `ajv` has an extra property "$recursiveRef" that are not exists
18
+ * in the standard JSON schema definition spec. Otherwise, `swagger` can't identify
19
+ * the tuple definition.
20
+ *
21
+ * @template Types Tuple of target types
22
+ * @template Purpose Purpose of the JSON schema`
23
+ * @return JSON schema application
24
+ *
25
+ * @author Jeongho Nam - https://github.com/samchon
26
+ */
27
+ export declare function application(): never;
28
+ /**
29
+ * JSON Schema Application.
30
+ *
31
+ * Creates a JSON schema application which contains both main JSON schemas and
32
+ * components. Note that, all of the object types are stored in the
33
+ * {@link IJsonApplication.components} property for the `$ref` referencing.
34
+ *
35
+ * Also, `typia.json.application()` has additional generic arguments, *Purpose*.
36
+ * As JSON schema definitions used by `swagger` and `ajv` are different a little bit,
37
+ * you should configure the *Purpose* appropriately.
38
+ *
39
+ * For an example, `ajv` has an extra property "$recursiveRef" that are not exists
40
+ * in the standard JSON schema definition spec. Otherwise, `swagger` can't identify
41
+ * the tuple definition.
42
+ *
43
+ * @template Types Tuple of target types
44
+ * @template Purpose Purpose of the JSON schema
45
+ * @return JSON schema application
46
+ *
47
+ * @author Jeongho Nam - https://github.com/samchon
48
+ */
49
+ export declare function application<Types extends unknown[], Purpose extends "ajv" | "swagger" = "swagger">(): IJsonApplication;
50
+ /**
51
+ * > You must configure the generic argument `T`.
52
+ *
53
+ * Safe `JSON.parse()` function with type assertion.
54
+ *
55
+ * `typia.json.assertParse()` is a combination function of `JSON.parse()` and
56
+ * {@link assert}. Therefore, it convers a JSON (JavaScript Object Notation) string
57
+ * to a `T` typed instance with type assertion.
58
+ *
59
+ * In such reason, when parsed JSON string value is not matched with the type `T`, it
60
+ * throws {@link TypeGuardError}. Otherwise, there's no problem on the parsed value,
61
+ * the parsed value would be returned.
62
+ *
63
+ * @template T Expected type of parsed value
64
+ * @param input JSON string
65
+ * @returns Parsed value
66
+ *
67
+ * @author Jeongho Nam - https://github.com/samchon
68
+ */
69
+ export declare function assertParse(input: string): never;
70
+ /**
71
+ * Safe `JSON.parse()` function with type assertion.
72
+ *
73
+ * `typia.json.assertParse()` is a combination function of `JSON.parse()` and
74
+ * {@link assert}. Therefore, it convers a JSON (JavaScript Object Notation) string
75
+ * to a `T` typed instance with type assertion.
76
+ *
77
+ * In such reason, when parsed JSON string value is not matched with the type `T`,
78
+ * it throws {@link TypeGuardError}. Otherwise, there's no problem on the parsed
79
+ * value, the parsed value would be returned.
80
+ *
81
+ * @template T Expected type of parsed value
82
+ * @param input JSON string
83
+ * @returns Parsed value
84
+ *
85
+ * @author Jeongho Nam - https://github.com/samchon
86
+ */
87
+ export declare function assertParse<T>(input: string): Primitive<T>;
88
+ /**
89
+ * > You must configure the generic argument `T`.
90
+ *
91
+ * Safe `JSON.parse()` function with type checking.
92
+ *
93
+ * `typia.json.isParse()` is a combination function of `JSON.parse()` and {@link is}.
94
+ * Therefore, it convers a JSON (JavaScript Object Notation) string to a `T` typed
95
+ * instance with type checking.
96
+ *
97
+ * In such reason, when parsed JSON string value is not matched with the type `T`, it
98
+ * returns `null` value. Otherwise, there's no problem on the parsed value, the parsed
99
+ * value would be returned.
100
+ *
101
+ * @template T Expected type of parsed value
102
+ * @param input JSON string
103
+ * @returns Parsed value when exact type, otherwise `null`
104
+ *
105
+ * @author Jeongho Nam - https://github.com/samchon
106
+ */
107
+ export declare function isParse(input: string): never;
108
+ /**
109
+ * Safe `JSON.parse()` function with type checking.
110
+ *
111
+ * `typia.json.isParse()` is a combination function of `JSON.parse()` and {@link is}.
112
+ * Therefore, it convers a JSON (JavaScript Object Notation) string to a `T` typed
113
+ * instance with type checking.
114
+ *
115
+ * In such reason, when parsed JSON string value is not matched with the type `T`, it
116
+ * returns `null` value. Otherwise, there's no problem on the parsed value, the parsed
117
+ * value would be returned.
118
+ *
119
+ * @template T Expected type of parsed value
120
+ * @param input JSON string
121
+ * @returns Parsed value when exact type, otherwise `null`
122
+ *
123
+ * @author Jeongho Nam - https://github.com/samchon
124
+ */
125
+ export declare function isParse<T>(input: string): Primitive<T> | null;
126
+ /**
127
+ * > You must configure the generic argument `T`.
128
+ *
129
+ * Safe `JSON.parse()` function with detailed type validation.
130
+ *
131
+ * `typia.json.validateParse()` is a combination function of `JSON.parse()` and
132
+ * {@link validate}. Therefore, it convers a JSON (JavaScript Object Notation) string
133
+ * to a `T` typed instance with detailed type validation.
134
+ *
135
+ * In such reason, when parsed JSON string value is not matched with the type `T`, it
136
+ * returns {@link IValidation.IFailure} value with detailed error reasons. Otherwise,
137
+ * there's no problem on the parsed value, the parsed value would be stored in `data`
138
+ * property of the output {@link IValidation.ISuccess} instance.
139
+ *
140
+ * @template T Expected type of parsed value
141
+ * @param input JSON string
142
+ * @returns Validation result with JSON parsed value
143
+ *
144
+ * @author Jeongho Nam - https://github.com/samchon
145
+ */
146
+ export declare function validateParse(input: string): never;
147
+ /**
148
+ * Safe `JSON.parse()` function with detailed type validation.
149
+ *
150
+ * `typia.json.validateParse()` is a combination function of `JSON.parse()` and
151
+ * {@link validate}. Therefore, it convers a JSON (JavaScript Object Notation) string
152
+ * to a `T` typed instance with detailed type validation.
153
+ *
154
+ * In such reason, when parsed JSON string value is not matched with the type `T`, it
155
+ * returns {@link IValidation.IFailure} value with detailed error reasons. Otherwise,
156
+ * there's no problem on the parsed value, the parsed value would be stored in `data`
157
+ * property of the output {@link IValidation.ISuccess} instance.
158
+ *
159
+ * @template T Expected type of parsed value
160
+ * @param input JSON string
161
+ * @returns Validation result with JSON parsed value
162
+ *
163
+ * @author Jeongho Nam - https://github.com/samchon
164
+ */
165
+ export declare function validateParse<T>(input: string): IValidation<Primitive<T>>;
166
+ /**
167
+ * 8x faster `JSON.stringify()` function.
168
+ *
169
+ * Converts an input value to a JSON (JavaScript Object Notation) string, about 8x
170
+ * faster than the native `JSON.stringify()` function. The 5x faster principle is
171
+ * because it writes an optimized JSON conversion plan, only for the type `T`.
172
+ *
173
+ * For reference, this `typia.json.stringify()` does not validate the input value type.
174
+ * It just believes that the input value is following the type `T`. Therefore, if you
175
+ * can't ensure the input value type, it would be better to call one of below
176
+ * functions instead.
177
+ *
178
+ * - {@link assertStringify}
179
+ * - {@link isStringify}
180
+ * - {@link validateStringify}
181
+ *
182
+ * @template T Type of the input value
183
+ * @param input A value to be converted
184
+ * @return JSON string value
185
+ *
186
+ * @author Jeongho Nam - https://github.com/samchon
187
+ */
188
+ export declare function stringify<T>(input: T): string;
189
+ /**
190
+ * 5x faster `JSON.stringify()` function with type assertion.
191
+ *
192
+ * `typia.json.assertStringify()` is a combination function of {@link assert} and
193
+ * {@link stringify}. Therefore, it converts an input value to
194
+ * JSON (JavaScript Object Notation) string, with type assertion.
195
+ *
196
+ * In such reason, when `input` value is not matched with the type `T`, it throws an
197
+ * {@link TypeGuardError}. Otherwise, there's no problem on the `input` value, JSON
198
+ * string would be returned.
199
+ *
200
+ * For reference, with type assertion, it is even 5x times faster than the native
201
+ * `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
202
+ * with confidence.
203
+ *
204
+ * @template T Type of the input value
205
+ * @param input A value to be asserted and converted
206
+ * @return JSON string value
207
+ *
208
+ * @author Jeongho Nam - https://github.com/samchon
209
+ */
210
+ export declare function assertStringify<T>(input: T): string;
211
+ /**
212
+ * 5x faster `JSON.stringify()` function with type assertion.
213
+ *
214
+ * `typia.json.assertStringify()` is a combination function of {@link assert} and
215
+ * {@link stringify}. Therefore, it converts an input value to
216
+ * JSON (JavaScript Object Notation) string, with type assertion.
217
+ *
218
+ * In such reason, when `input` value is not matched with the type `T`, it throws an
219
+ * {@link TypeGuardError}. Otherwise, there's no problem on the `input` value, JSON
220
+ * string would be returned.
221
+ *
222
+ * For reference, with type assertion, it is even 5x times faster than the native
223
+ * `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
224
+ * with confidence.
225
+ *
226
+ * @template T Type of the input value
227
+ * @param input A value to be asserted and converted
228
+ * @return JSON string value
229
+ *
230
+ * @author Jeongho Nam - https://github.com/samchon
231
+ */
232
+ export declare function assertStringify<T>(input: T): unknown;
233
+ /**
234
+ * 7x faster `JSON.stringify()` function with type checking.
235
+ *
236
+ * `typia.json.stringify()` is a combination function of {@link is} and
237
+ * {@link stringify}. Therefore, it converts an input value to JSON
238
+ * (JavaScript Object Notation) string, with type checking.
239
+ *
240
+ * In such reason, when `input` value is not matched with the type `T`, it returns
241
+ * `null` value. Otherwise, there's no problem on the `input` value, JSON string
242
+ * would be returned.
243
+ *
244
+ * For reference, with type checking, it is even 7x times faster than the native
245
+ * `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
246
+ * with confidence.
247
+ *
248
+ * @template T Type of the input value
249
+ * @param input A value to be checked and converted
250
+ * @return JSON string value when exact type, otherwise null
251
+ *
252
+ * @author Jeongho Nam - https://github.com/samchon
253
+ */
254
+ export declare function isStringify<T>(input: T): string | null;
255
+ /**
256
+ * 7x faster `JSON.stringify()` function with type checking.
257
+ *
258
+ * `typia.json.isStringify()` is a combination function of {@link is} and
259
+ * {@link stringify}. Therefore, it converts an input value to JSON
260
+ * (JavaScript Object Notation) string, with type checking.
261
+ *f
262
+ * In such reason, when `input` value is not matched with the type `T`, it returns
263
+ * `null` value. Otherwise, there's no problem on the `input` value, JSON string
264
+ * would be returned.
265
+ *
266
+ * For reference, with type checking, it is even 7x times faster than the native
267
+ * `JSON.stringify()` function. So, just enjoy the safe and fast JSON conversion
268
+ * with confidence.
269
+ *
270
+ * @template T Type of the input value
271
+ * @param input A value to be checked and converted
272
+ * @return JSON string value when exact type, otherwise null
273
+ *
274
+ * @author Jeongho Nam - https://github.com/samchon
275
+ */
276
+ export declare function isStringify<T>(input: unknown): string | null;
277
+ /**
278
+ * 5x faster `JSON.stringify()` function with detailed type validation.
279
+ *
280
+ * `typia.json.validateStringify()` is a combination function of {@link validate} and
281
+ * {@link stringify}. Therefore, it converts an input value to JSON (JavaScript Object
282
+ * Notation) string, with detailed type validation.
283
+ *
284
+ * In such reason, when `input` value is not matched with the type `T`, it returns
285
+ * {@link IValidation.IFailure} value with detailed error reasons. Otherwise,
286
+ * there's no problem on the `input` value, JSON string would be stored in `data`
287
+ * property of the output {@link IValidation.ISuccess} instance.
288
+ *
289
+ * For reference, with detailed type validation, it is even 5x times faster than the
290
+ * native `JSON.stringify()` function. So, just enjoy the safe and fast JSON
291
+ * conversion with confidence.
292
+ *
293
+ * @template T Type of the input value
294
+ * @param input A value to be checked and converted
295
+ * @returns Validation result with JSON string value
296
+ *
297
+ * @author Jeongho Nam - https://github.com/samchon
298
+ */
299
+ export declare function validateStringify<T>(input: T): IValidation<string>;
300
+ /**
301
+ * 5x faster `JSON.stringify()` function with detailed type validation.
302
+ *
303
+ * `typia.json.validateStringify()` is a combination function of {@link validate} and
304
+ * {@link stringify}. Therefore, it converts an input value to JSON (JavaScript Object
305
+ * Notation) string, with detailed type validation.
306
+ *
307
+ * In such reason, when `input` value is not matched with the type `T`, it returns
308
+ * {@link IValidation.IFailure} value with detailed error reasons. Otherwise,
309
+ * there's no problem on the `input` value, JSON string would be stored in `data`
310
+ * property of the output {@link IValidation.ISuccess} instance.
311
+ *
312
+ * For reference, with detailed type validation, it is even 5x times faster than the
313
+ * native `JSON.stringify()` function. So, just enjoy the safe and fast JSON
314
+ * conversion with confidence.
315
+ *
316
+ * @template T Type of the input value
317
+ * @param input A value to be checked and converted
318
+ * @returns Validation result with JSON string value
319
+ *
320
+ * @author Jeongho Nam - https://github.com/samchon
321
+ */
322
+ export declare function validateStringify<T>(input: unknown): IValidation<string>;
323
+ /**
324
+ * Creates a reusable {@link isParse} function.
325
+ *
326
+ * @danger You have to specify the generic argument `T`
327
+ * @return Nothing until specifying the generic argument `T`
328
+ * @throws compile error
329
+ *
330
+ * @author Jeongho Nam - https://github.com/samchon
331
+ */
332
+ export declare function createIsParse(): never;
333
+ /**
334
+ * Creates a reusable {@link isParse} function.
335
+ *
336
+ * @template T Expected type of parsed value
337
+ * @returns A reusable `isParse` function
338
+ *
339
+ * @author Jeongho Nam - https://github.com/samchon
340
+ */
341
+ export declare function createIsParse<T>(): (input: string) => Primitive<T> | null;
342
+ /**
343
+ * Creates a reusable {@link assertParse} function.
344
+ *
345
+ * @danger You have to specify the generic argument `T`
346
+ * @return Nothing until specifying the generic argument `T`
347
+ * @throws compile error
348
+ *
349
+ * @author Jeongho Nam - https://github.com/samchon
350
+ */
351
+ export declare function createAssertParse(): never;
352
+ /**
353
+ * Creates a reusable {@link assertParse} function.
354
+ *
355
+ * @template T Expected type of parsed value
356
+ * @returns A reusable `assertParse` function
357
+ *
358
+ * @author Jeongho Nam - https://github.com/samchon
359
+ */
360
+ export declare function createAssertParse<T>(): (input: string) => Primitive<T>;
361
+ /**
362
+ * Creates a reusable {@link validateParse} function.
363
+ *
364
+ * @danger You have to specify the generic argument `T`
365
+ * @return Nothing until specifying the generic argument `T`
366
+ * @throws compile error
367
+ *
368
+ * @author Jeongho Nam - https://github.com/samchon
369
+ */
370
+ export declare function createValidateParse(): never;
371
+ /**
372
+ * Creates a reusable {@link validateParse} function.
373
+ *
374
+ * @template T Expected type of parsed value
375
+ * @returns A reusable `validateParse` function
376
+ *
377
+ * @author Jeongho Nam - https://github.com/samchon
378
+ */
379
+ export declare function createValidateParse<T>(): (input: string) => IValidation<Primitive<T>>;
380
+ /**
381
+ * Creates a reusable {@link stringify} function.
382
+ *
383
+ * @danger You have to specify the generic argument `T`
384
+ * @return Nothing until specifying the generic argument `T`
385
+ * @throws compile error
386
+ *
387
+ * @author Jeongho Nam - https://github.com/samchon
388
+ */
389
+ export declare function createStringify(): never;
390
+ /**
391
+ * Creates a reusable {@link stringify} function.
392
+ *
393
+ * @template T Type of the input value
394
+ * @returns A reusable `stringify` function
395
+ *
396
+ * @author Jeongho Nam - https://github.com/samchon
397
+ */
398
+ export declare function createStringify<T>(): (input: T) => string;
399
+ /**
400
+ * Creates a reusable {@link assertStringify} function.
401
+ *
402
+ * @danger You have to specify the generic argument `T`
403
+ * @return Nothing until specifying the generic argument `T`
404
+ * @throws compile error
405
+ *
406
+ * @author Jeongho Nam - https://github.com/samchon
407
+ */
408
+ export declare function createAssertStringify(): never;
409
+ /**
410
+ * Creates a reusable {@link assertStringify} function.
411
+ *
412
+ * @template T Type of the input value
413
+ * @returns A reusable `assertStringify` function
414
+ *
415
+ * @author Jeongho Nam - https://github.com/samchon
416
+ */
417
+ export declare function createAssertStringify<T>(): (input: unknown) => string;
418
+ /**
419
+ * Creates a reusable {@link isStringify} function.
420
+ *
421
+ * @danger You have to specify the generic argument `T`
422
+ * @return Nothing until specifying the generic argument `T`
423
+ * @throws compile error
424
+ *
425
+ * @author Jeongho Nam - https://github.com/samchon
426
+ */
427
+ export declare function createIsStringify(): never;
428
+ /**
429
+ * Creates a reusable {@link isStringify} function.
430
+ *
431
+ * @template T Type of the input value
432
+ * @returns A reusable `isStringify` function
433
+ *
434
+ * @author Jeongho Nam - https://github.com/samchon
435
+ */
436
+ export declare function createIsStringify<T>(): (input: unknown) => string | null;
437
+ /**
438
+ * Creates a reusable {@link validateStringify} function.
439
+ *
440
+ * @danger You have to specify the generic argument `T`
441
+ * @return Nothing until specifying the generic argument `T`
442
+ * @throws compile error
443
+ *
444
+ * @author Jeongho Nam - https://github.com/samchon
445
+ */
446
+ export declare function createValidateStringify(): never;
447
+ /**
448
+ * Creates a reusable {@link validateStringify} function.
449
+ *
450
+ * @template T Type of the input value
451
+ * @returns A reusable `validateStringify` function
452
+
453
+ * @author Jeongho Nam - https://github.com/samchon
454
+ */
455
+ export declare function createValidateStringify<T>(): (input: unknown) => IValidation<string>;
package/lib/json.js ADDED
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createValidateStringify = exports.createIsStringify = exports.createAssertStringify = exports.createStringify = exports.createValidateParse = exports.createAssertParse = exports.createIsParse = exports.validateStringify = exports.isStringify = exports.assertStringify = exports.stringify = exports.validateParse = exports.isParse = exports.assertParse = exports.application = void 0;
4
+ var Namespace_1 = require("./functional/Namespace");
5
+ function application() {
6
+ halt("application");
7
+ }
8
+ exports.application = application;
9
+ function assertParse() {
10
+ halt("assertParse");
11
+ }
12
+ exports.assertParse = assertParse;
13
+ Object.assign(assertParse, Namespace_1.Namespace.assert("assertParse"));
14
+ function isParse() {
15
+ halt("isParse");
16
+ }
17
+ exports.isParse = isParse;
18
+ Object.assign(isParse, Namespace_1.Namespace.is());
19
+ function validateParse() {
20
+ halt("validateParse");
21
+ }
22
+ exports.validateParse = validateParse;
23
+ Object.assign(validateParse, Namespace_1.Namespace.validate());
24
+ function stringify() {
25
+ halt("stringify");
26
+ }
27
+ exports.stringify = stringify;
28
+ Object.assign(stringify, Namespace_1.Namespace.stringify("stringify"));
29
+ function assertStringify() {
30
+ halt("assertStringify");
31
+ }
32
+ exports.assertStringify = assertStringify;
33
+ Object.assign(assertStringify, Namespace_1.Namespace.assert("assertStringify"));
34
+ Object.assign(assertStringify, Namespace_1.Namespace.stringify("assertStringify"));
35
+ function isStringify() {
36
+ halt("isStringify");
37
+ }
38
+ exports.isStringify = isStringify;
39
+ Object.assign(isStringify, Namespace_1.Namespace.is());
40
+ Object.assign(isStringify, Namespace_1.Namespace.stringify("isStringify"));
41
+ function validateStringify() {
42
+ halt("validateStringify");
43
+ }
44
+ exports.validateStringify = validateStringify;
45
+ Object.assign(validateStringify, Namespace_1.Namespace.validate());
46
+ Object.assign(validateStringify, Namespace_1.Namespace.stringify("validateStringify"));
47
+ function createIsParse() {
48
+ halt("createIsParse");
49
+ }
50
+ exports.createIsParse = createIsParse;
51
+ Object.assign(createIsParse, isParse);
52
+ function createAssertParse() {
53
+ halt("createAssertParse");
54
+ }
55
+ exports.createAssertParse = createAssertParse;
56
+ Object.assign(createAssertParse, assertParse);
57
+ function createValidateParse() {
58
+ halt("createValidateParse");
59
+ }
60
+ exports.createValidateParse = createValidateParse;
61
+ Object.assign(createValidateParse, validateParse);
62
+ function createStringify() {
63
+ halt("createStringify");
64
+ }
65
+ exports.createStringify = createStringify;
66
+ Object.assign(createStringify, stringify);
67
+ function createAssertStringify() {
68
+ halt("createAssertStringify");
69
+ }
70
+ exports.createAssertStringify = createAssertStringify;
71
+ Object.assign(createAssertStringify, assertStringify);
72
+ function createIsStringify() {
73
+ halt("createIsStringify");
74
+ }
75
+ exports.createIsStringify = createIsStringify;
76
+ Object.assign(createIsStringify, isStringify);
77
+ function createValidateStringify() {
78
+ halt("createValidateStringify");
79
+ }
80
+ exports.createValidateStringify = createValidateStringify;
81
+ Object.assign(createValidateStringify, validateStringify);
82
+ function halt(name) {
83
+ throw new Error("Error on typia.json.".concat(name, "(): no transform has been configured. Read and follow https://typia.json.io/docs/setup please."));
84
+ }
85
+ //# sourceMappingURL=json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json.js","sourceRoot":"","sources":["../src/json.ts"],"names":[],"mappings":";;;AAAA,oDAAmD;AAsEnD,SAAgB,WAAW;IACvB,IAAI,CAAC,aAAa,CAAC,CAAC;AACxB,CAAC;AAFD,kCAEC;AAgDD,SAAgB,WAAW;IACvB,IAAI,CAAC,aAAa,CAAC,CAAC;AACxB,CAAC;AAFD,kCAEC;AACD,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,qBAAS,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC;AA6C5D,SAAgB,OAAO;IACnB,IAAI,CAAC,SAAS,CAAC,CAAC;AACpB,CAAC;AAFD,0BAEC;AACD,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,qBAAS,CAAC,EAAE,EAAE,CAAC,CAAC;AA+CvC,SAAgB,aAAa;IACzB,IAAI,CAAC,eAAe,CAAC,CAAC;AAC1B,CAAC;AAFD,sCAEC;AACD,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,qBAAS,CAAC,QAAQ,EAAE,CAAC,CAAC;AAgCnD,SAAgB,SAAS;IACrB,IAAI,CAAC,WAAW,CAAC,CAAC;AACtB,CAAC;AAFD,8BAEC;AACD,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,qBAAS,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC;AAmD3D,SAAgB,eAAe;IAC3B,IAAI,CAAC,iBAAiB,CAAC,CAAC;AAC5B,CAAC;AAFD,0CAEC;AACD,MAAM,CAAC,MAAM,CAAC,eAAe,EAAE,qBAAS,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC;AACpE,MAAM,CAAC,MAAM,CAAC,eAAe,EAAE,qBAAS,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC,CAAC;AAmDvE,SAAgB,WAAW;IACvB,IAAI,CAAC,aAAa,CAAC,CAAC;AACxB,CAAC;AAFD,kCAEC;AAED,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,qBAAS,CAAC,EAAE,EAAE,CAAC,CAAC;AAC3C,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,qBAAS,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC;AAqD/D,SAAgB,iBAAiB;IAC7B,IAAI,CAAC,mBAAmB,CAAC,CAAC;AAC9B,CAAC;AAFD,8CAEC;AACD,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,qBAAS,CAAC,QAAQ,EAAE,CAAC,CAAC;AACvD,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,qBAAS,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC,CAAC;AA6B3E,SAAgB,aAAa;IACzB,IAAI,CAAC,eAAe,CAAC,CAAC;AAC1B,CAAC;AAFD,sCAEC;AACD,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;AA0BtC,SAAgB,iBAAiB;IAC7B,IAAI,CAAC,mBAAmB,CAAC,CAAC;AAC9B,CAAC;AAFD,8CAEC;AACD,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,WAAW,CAAC,CAAC;AA4B9C,SAAgB,mBAAmB;IAG/B,IAAI,CAAC,qBAAqB,CAAC,CAAC;AAChC,CAAC;AAJD,kDAIC;AACD,MAAM,CAAC,MAAM,CAAC,mBAAmB,EAAE,aAAa,CAAC,CAAC;AA0BlD,SAAgB,eAAe;IAC3B,IAAI,CAAC,iBAAiB,CAAC,CAAC;AAC5B,CAAC;AAFD,0CAEC;AACD,MAAM,CAAC,MAAM,CAAC,eAAe,EAAE,SAAS,CAAC,CAAC;AA0B1C,SAAgB,qBAAqB;IACjC,IAAI,CAAC,uBAAuB,CAAC,CAAC;AAClC,CAAC;AAFD,sDAEC;AACD,MAAM,CAAC,MAAM,CAAC,qBAAqB,EAAE,eAAe,CAAC,CAAC;AA0BtD,SAAgB,iBAAiB;IAC7B,IAAI,CAAC,mBAAmB,CAAC,CAAC;AAC9B,CAAC;AAFD,8CAEC;AACD,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,WAAW,CAAC,CAAC;AA4B9C,SAAgB,uBAAuB;IAGnC,IAAI,CAAC,yBAAyB,CAAC,CAAC;AACpC,CAAC;AAJD,0DAIC;AACD,MAAM,CAAC,MAAM,CAAC,uBAAuB,EAAE,iBAAiB,CAAC,CAAC;AAK1D,SAAS,IAAI,CAAC,IAAY;IACtB,MAAM,IAAI,KAAK,CACX,8BAAuB,IAAI,mGAAgG,CAC9H,CAAC;AACN,CAAC"}