@gmb/bitmark-parser-generator 3.34.0 → 3.36.0

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 (904) hide show
  1. package/README.md +4 -4
  2. package/dist/browser/bitmark-parser-generator.min.js +1 -1
  3. package/dist/browser/bundle-report.html +2 -2
  4. package/dist/index.cjs +33650 -0
  5. package/dist/index.cjs.map +1 -0
  6. package/dist/index.d.cts +7733 -0
  7. package/dist/index.d.ts +7733 -0
  8. package/dist/index.js +33590 -0
  9. package/dist/index.js.map +1 -0
  10. package/package.json +106 -90
  11. package/dist/cjs/BitmarkParserGenerator.js +0 -776
  12. package/dist/cjs/BitmarkParserGenerator.js.map +0 -1
  13. package/dist/cjs/ast/Ast.js +0 -220
  14. package/dist/cjs/ast/Ast.js.map +0 -1
  15. package/dist/cjs/ast/BaseBuilder.js +0 -193
  16. package/dist/cjs/ast/BaseBuilder.js.map +0 -1
  17. package/dist/cjs/ast/Builder.js +0 -1781
  18. package/dist/cjs/ast/Builder.js.map +0 -1
  19. package/dist/cjs/ast/ResourceBuilder.js +0 -963
  20. package/dist/cjs/ast/ResourceBuilder.js.map +0 -1
  21. package/dist/cjs/ast/rules/NodeValidator.js +0 -184
  22. package/dist/cjs/ast/rules/NodeValidator.js.map +0 -1
  23. package/dist/cjs/ast/writer/FileWriter.js +0 -119
  24. package/dist/cjs/ast/writer/FileWriter.js.map +0 -1
  25. package/dist/cjs/ast/writer/StreamWriter.js +0 -89
  26. package/dist/cjs/ast/writer/StreamWriter.js.map +0 -1
  27. package/dist/cjs/ast/writer/StringWriter.js +0 -115
  28. package/dist/cjs/ast/writer/StringWriter.js.map +0 -1
  29. package/dist/cjs/ast/writer/Writer.js +0 -3
  30. package/dist/cjs/ast/writer/Writer.js.map +0 -1
  31. package/dist/cjs/breakscaping/Breakscape.js +0 -80
  32. package/dist/cjs/breakscaping/Breakscape.js.map +0 -1
  33. package/dist/cjs/breakscaping/BreakscapeLoop.js +0 -305
  34. package/dist/cjs/breakscaping/BreakscapeLoop.js.map +0 -1
  35. package/dist/cjs/breakscaping/BreakscapeOptions.js +0 -3
  36. package/dist/cjs/breakscaping/BreakscapeOptions.js.map +0 -1
  37. package/dist/cjs/breakscaping/BreakscapeRegex.js +0 -213
  38. package/dist/cjs/breakscaping/BreakscapeRegex.js.map +0 -1
  39. package/dist/cjs/breakscaping/RegexConfigs.js +0 -38
  40. package/dist/cjs/breakscaping/RegexConfigs.js.map +0 -1
  41. package/dist/cjs/config/Config.js +0 -352
  42. package/dist/cjs/config/Config.js.map +0 -1
  43. package/dist/cjs/config/ConfigHydrator.js +0 -161
  44. package/dist/cjs/config/ConfigHydrator.js.map +0 -1
  45. package/dist/cjs/config/raw/bits.js +0 -2615
  46. package/dist/cjs/config/raw/bits.js.map +0 -1
  47. package/dist/cjs/config/raw/cardSets.js +0 -549
  48. package/dist/cjs/config/raw/cardSets.js.map +0 -1
  49. package/dist/cjs/config/raw/groups.js +0 -1182
  50. package/dist/cjs/config/raw/groups.js.map +0 -1
  51. package/dist/cjs/config/raw/properties.js +0 -1006
  52. package/dist/cjs/config/raw/properties.js.map +0 -1
  53. package/dist/cjs/config/raw/resources.js +0 -103
  54. package/dist/cjs/config/raw/resources.js.map +0 -1
  55. package/dist/cjs/config/raw/tags.js +0 -48
  56. package/dist/cjs/config/raw/tags.js.map +0 -1
  57. package/dist/cjs/generated/build-info.js +0 -13
  58. package/dist/cjs/generated/build-info.js.map +0 -1
  59. package/dist/cjs/generated/parser/bitmark/bitmark-peggy-parser.js +0 -3168
  60. package/dist/cjs/generated/parser/bitmark/bitmark-peggy-parser.js.map +0 -1
  61. package/dist/cjs/generated/parser/text/text-peggy-parser.js +0 -9659
  62. package/dist/cjs/generated/parser/text/text-peggy-parser.js.map +0 -1
  63. package/dist/cjs/generator/AstWalkerGenerator.js +0 -86
  64. package/dist/cjs/generator/AstWalkerGenerator.js.map +0 -1
  65. package/dist/cjs/generator/Generator.js +0 -3
  66. package/dist/cjs/generator/Generator.js.map +0 -1
  67. package/dist/cjs/generator/bitmark/BitmarkFileGenerator.js +0 -49
  68. package/dist/cjs/generator/bitmark/BitmarkFileGenerator.js.map +0 -1
  69. package/dist/cjs/generator/bitmark/BitmarkGenerator.js +0 -2601
  70. package/dist/cjs/generator/bitmark/BitmarkGenerator.js.map +0 -1
  71. package/dist/cjs/generator/bitmark/BitmarkStringGenerator.js +0 -51
  72. package/dist/cjs/generator/bitmark/BitmarkStringGenerator.js.map +0 -1
  73. package/dist/cjs/generator/json/JsonFileGenerator.js +0 -53
  74. package/dist/cjs/generator/json/JsonFileGenerator.js.map +0 -1
  75. package/dist/cjs/generator/json/JsonGenerator.js +0 -1584
  76. package/dist/cjs/generator/json/JsonGenerator.js.map +0 -1
  77. package/dist/cjs/generator/json/JsonObjectGenerator.js +0 -51
  78. package/dist/cjs/generator/json/JsonObjectGenerator.js.map +0 -1
  79. package/dist/cjs/generator/json/JsonStringGenerator.js +0 -50
  80. package/dist/cjs/generator/json/JsonStringGenerator.js.map +0 -1
  81. package/dist/cjs/generator/text/TextGenerator.js +0 -1199
  82. package/dist/cjs/generator/text/TextGenerator.js.map +0 -1
  83. package/dist/cjs/index.js +0 -79
  84. package/dist/cjs/index.js.map +0 -1
  85. package/dist/cjs/info/InfoBuilder.js +0 -43
  86. package/dist/cjs/info/InfoBuilder.js.map +0 -1
  87. package/dist/cjs/init/init.js +0 -15
  88. package/dist/cjs/init/init.js.map +0 -1
  89. package/dist/cjs/model/ast/BreakscapedString.js +0 -3
  90. package/dist/cjs/model/ast/BreakscapedString.js.map +0 -1
  91. package/dist/cjs/model/ast/NodeType.js +0 -557
  92. package/dist/cjs/model/ast/NodeType.js.map +0 -1
  93. package/dist/cjs/model/ast/Nodes.js +0 -3
  94. package/dist/cjs/model/ast/Nodes.js.map +0 -1
  95. package/dist/cjs/model/ast/StardardString.js +0 -3
  96. package/dist/cjs/model/ast/StardardString.js.map +0 -1
  97. package/dist/cjs/model/ast/TextNodes.js +0 -3
  98. package/dist/cjs/model/ast/TextNodes.js.map +0 -1
  99. package/dist/cjs/model/config/AbstractTagConfig.js +0 -18
  100. package/dist/cjs/model/config/AbstractTagConfig.js.map +0 -1
  101. package/dist/cjs/model/config/BitConfig.js +0 -72
  102. package/dist/cjs/model/config/BitConfig.js.map +0 -1
  103. package/dist/cjs/model/config/CardSetConfig.js +0 -26
  104. package/dist/cjs/model/config/CardSetConfig.js.map +0 -1
  105. package/dist/cjs/model/config/CardVariantConfig.js +0 -32
  106. package/dist/cjs/model/config/CardVariantConfig.js.map +0 -1
  107. package/dist/cjs/model/config/MarkupTagConfig.js +0 -41
  108. package/dist/cjs/model/config/MarkupTagConfig.js.map +0 -1
  109. package/dist/cjs/model/config/PropertyTagConfig.js +0 -50
  110. package/dist/cjs/model/config/PropertyTagConfig.js.map +0 -1
  111. package/dist/cjs/model/config/ResourceTagConfig.js +0 -42
  112. package/dist/cjs/model/config/ResourceTagConfig.js.map +0 -1
  113. package/dist/cjs/model/config/ResourcesConfig.js +0 -31
  114. package/dist/cjs/model/config/ResourcesConfig.js.map +0 -1
  115. package/dist/cjs/model/config/TagConfig.js +0 -3
  116. package/dist/cjs/model/config/TagConfig.js.map +0 -1
  117. package/dist/cjs/model/config/TagsConfig.js +0 -3
  118. package/dist/cjs/model/config/TagsConfig.js.map +0 -1
  119. package/dist/cjs/model/config/TagsConfigWithInfo.js +0 -3
  120. package/dist/cjs/model/config/TagsConfigWithInfo.js.map +0 -1
  121. package/dist/cjs/model/config/_Config.js +0 -3
  122. package/dist/cjs/model/config/_Config.js.map +0 -1
  123. package/dist/cjs/model/config/enum/CardSetConfigKey.js +0 -28
  124. package/dist/cjs/model/config/enum/CardSetConfigKey.js.map +0 -1
  125. package/dist/cjs/model/config/enum/ConfigKey.js +0 -29
  126. package/dist/cjs/model/config/enum/ConfigKey.js.map +0 -1
  127. package/dist/cjs/model/config/enum/GroupConfigKey.js +0 -57
  128. package/dist/cjs/model/config/enum/GroupConfigKey.js.map +0 -1
  129. package/dist/cjs/model/config/enum/GroupConfigType.js +0 -14
  130. package/dist/cjs/model/config/enum/GroupConfigType.js.map +0 -1
  131. package/dist/cjs/model/config/enum/PropertyConfigKey.js +0 -215
  132. package/dist/cjs/model/config/enum/PropertyConfigKey.js.map +0 -1
  133. package/dist/cjs/model/config/enum/ResourceConfigKey.js +0 -40
  134. package/dist/cjs/model/config/enum/ResourceConfigKey.js.map +0 -1
  135. package/dist/cjs/model/config/enum/TagConfigKey.js +0 -26
  136. package/dist/cjs/model/config/enum/TagConfigKey.js.map +0 -1
  137. package/dist/cjs/model/enum/BitTagType.js +0 -13
  138. package/dist/cjs/model/enum/BitTagType.js.map +0 -1
  139. package/dist/cjs/model/enum/BitType.js +0 -576
  140. package/dist/cjs/model/enum/BitType.js.map +0 -1
  141. package/dist/cjs/model/enum/BitmarkGeneratorOutput.js +0 -2
  142. package/dist/cjs/model/enum/BitmarkGeneratorOutput.js.map +0 -1
  143. package/dist/cjs/model/enum/BitmarkParserType.js +0 -9
  144. package/dist/cjs/model/enum/BitmarkParserType.js.map +0 -1
  145. package/dist/cjs/model/enum/BitmarkVersion.js +0 -12
  146. package/dist/cjs/model/enum/BitmarkVersion.js.map +0 -1
  147. package/dist/cjs/model/enum/BodyBitType.js +0 -14
  148. package/dist/cjs/model/enum/BodyBitType.js.map +0 -1
  149. package/dist/cjs/model/enum/BodyTextFormat.js +0 -14
  150. package/dist/cjs/model/enum/BodyTextFormat.js.map +0 -1
  151. package/dist/cjs/model/enum/CardSetVersion.js +0 -10
  152. package/dist/cjs/model/enum/CardSetVersion.js.map +0 -1
  153. package/dist/cjs/model/enum/Count.js +0 -9
  154. package/dist/cjs/model/enum/Count.js.map +0 -1
  155. package/dist/cjs/model/enum/DeprecatedTextFormat.js +0 -9
  156. package/dist/cjs/model/enum/DeprecatedTextFormat.js.map +0 -1
  157. package/dist/cjs/model/enum/ExampleType.js +0 -11
  158. package/dist/cjs/model/enum/ExampleType.js.map +0 -1
  159. package/dist/cjs/model/enum/PropertyAstKey.js +0 -18
  160. package/dist/cjs/model/enum/PropertyAstKey.js.map +0 -1
  161. package/dist/cjs/model/enum/PropertyFormat.js +0 -14
  162. package/dist/cjs/model/enum/PropertyFormat.js.map +0 -1
  163. package/dist/cjs/model/enum/PropertyJsonKey.js +0 -14
  164. package/dist/cjs/model/enum/PropertyJsonKey.js.map +0 -1
  165. package/dist/cjs/model/enum/PropertyTag.js +0 -8
  166. package/dist/cjs/model/enum/PropertyTag.js.map +0 -1
  167. package/dist/cjs/model/enum/ResourceJsonKey.js +0 -27
  168. package/dist/cjs/model/enum/ResourceJsonKey.js.map +0 -1
  169. package/dist/cjs/model/enum/ResourceTag.js +0 -37
  170. package/dist/cjs/model/enum/ResourceTag.js.map +0 -1
  171. package/dist/cjs/model/enum/Tag.js +0 -21
  172. package/dist/cjs/model/enum/Tag.js.map +0 -1
  173. package/dist/cjs/model/enum/TextFormat.js +0 -16
  174. package/dist/cjs/model/enum/TextFormat.js.map +0 -1
  175. package/dist/cjs/model/enum/TextLocation.js +0 -15
  176. package/dist/cjs/model/enum/TextLocation.js.map +0 -1
  177. package/dist/cjs/model/enum/TextMarkType.js +0 -54
  178. package/dist/cjs/model/enum/TextMarkType.js.map +0 -1
  179. package/dist/cjs/model/enum/TextNodeType.js +0 -35
  180. package/dist/cjs/model/enum/TextNodeType.js.map +0 -1
  181. package/dist/cjs/model/enum/TextSection.js +0 -18
  182. package/dist/cjs/model/enum/TextSection.js.map +0 -1
  183. package/dist/cjs/model/info/enum/InfoFormat.js +0 -11
  184. package/dist/cjs/model/info/enum/InfoFormat.js.map +0 -1
  185. package/dist/cjs/model/info/enum/InfoType.js +0 -12
  186. package/dist/cjs/model/info/enum/InfoType.js.map +0 -1
  187. package/dist/cjs/model/json/BitJson.js +0 -3
  188. package/dist/cjs/model/json/BitJson.js.map +0 -1
  189. package/dist/cjs/model/json/BitWrapperJson.js +0 -3
  190. package/dist/cjs/model/json/BitWrapperJson.js.map +0 -1
  191. package/dist/cjs/model/json/BodyBitJson.js +0 -3
  192. package/dist/cjs/model/json/BodyBitJson.js.map +0 -1
  193. package/dist/cjs/model/json/ParserJson.js +0 -3
  194. package/dist/cjs/model/json/ParserJson.js.map +0 -1
  195. package/dist/cjs/model/json/ResourceJson.js +0 -3
  196. package/dist/cjs/model/json/ResourceJson.js.map +0 -1
  197. package/dist/cjs/model/parser/ParserData.js +0 -3
  198. package/dist/cjs/model/parser/ParserData.js.map +0 -1
  199. package/dist/cjs/model/parser/ParserError.js +0 -3
  200. package/dist/cjs/model/parser/ParserError.js.map +0 -1
  201. package/dist/cjs/model/parser/ParserInfo.js +0 -3
  202. package/dist/cjs/model/parser/ParserInfo.js.map +0 -1
  203. package/dist/cjs/model/parser/ParserLocation.js +0 -3
  204. package/dist/cjs/model/parser/ParserLocation.js.map +0 -1
  205. package/dist/cjs/model/parser/ParserLocationRange.js +0 -3
  206. package/dist/cjs/model/parser/ParserLocationRange.js.map +0 -1
  207. package/dist/cjs/model/parser/TagValidationData.js +0 -3
  208. package/dist/cjs/model/parser/TagValidationData.js.map +0 -1
  209. package/dist/cjs/parser/bitmark/BitmarkParser.js +0 -25
  210. package/dist/cjs/parser/bitmark/BitmarkParser.js.map +0 -1
  211. package/dist/cjs/parser/bitmark/peg/BitmarkPegParser.js +0 -7
  212. package/dist/cjs/parser/bitmark/peg/BitmarkPegParser.js.map +0 -1
  213. package/dist/cjs/parser/bitmark/peg/BitmarkPegParserHelper.js +0 -614
  214. package/dist/cjs/parser/bitmark/peg/BitmarkPegParserHelper.js.map +0 -1
  215. package/dist/cjs/parser/bitmark/peg/BitmarkPegParserProcessor.js +0 -716
  216. package/dist/cjs/parser/bitmark/peg/BitmarkPegParserProcessor.js.map +0 -1
  217. package/dist/cjs/parser/bitmark/peg/BitmarkPegParserTypes.js +0 -69
  218. package/dist/cjs/parser/bitmark/peg/BitmarkPegParserTypes.js.map +0 -1
  219. package/dist/cjs/parser/bitmark/peg/BitmarkPegParserValidator.js +0 -745
  220. package/dist/cjs/parser/bitmark/peg/BitmarkPegParserValidator.js.map +0 -1
  221. package/dist/cjs/parser/bitmark/peg/PeggyGrammarLocation.js +0 -82
  222. package/dist/cjs/parser/bitmark/peg/PeggyGrammarLocation.js.map +0 -1
  223. package/dist/cjs/parser/bitmark/peg/contentProcessors/BodyContentProcessor.js +0 -260
  224. package/dist/cjs/parser/bitmark/peg/contentProcessors/BodyContentProcessor.js.map +0 -1
  225. package/dist/cjs/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.js +0 -50
  226. package/dist/cjs/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.js.map +0 -1
  227. package/dist/cjs/parser/bitmark/peg/contentProcessors/CardContentProcessor.js +0 -885
  228. package/dist/cjs/parser/bitmark/peg/contentProcessors/CardContentProcessor.js.map +0 -1
  229. package/dist/cjs/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.js +0 -27
  230. package/dist/cjs/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.js.map +0 -1
  231. package/dist/cjs/parser/bitmark/peg/contentProcessors/ContentProcessorUtils.js +0 -61
  232. package/dist/cjs/parser/bitmark/peg/contentProcessors/ContentProcessorUtils.js.map +0 -1
  233. package/dist/cjs/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.js +0 -63
  234. package/dist/cjs/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.js.map +0 -1
  235. package/dist/cjs/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.js +0 -161
  236. package/dist/cjs/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.js.map +0 -1
  237. package/dist/cjs/parser/bitmark/peg/contentProcessors/FooterContentProcessor.js +0 -55
  238. package/dist/cjs/parser/bitmark/peg/contentProcessors/FooterContentProcessor.js.map +0 -1
  239. package/dist/cjs/parser/bitmark/peg/contentProcessors/GapChainContentProcessor.js +0 -31
  240. package/dist/cjs/parser/bitmark/peg/contentProcessors/GapChainContentProcessor.js.map +0 -1
  241. package/dist/cjs/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.js +0 -59
  242. package/dist/cjs/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.js.map +0 -1
  243. package/dist/cjs/parser/bitmark/peg/contentProcessors/InternalCommentTagContentProcessor.js +0 -16
  244. package/dist/cjs/parser/bitmark/peg/contentProcessors/InternalCommentTagContentProcessor.js.map +0 -1
  245. package/dist/cjs/parser/bitmark/peg/contentProcessors/ItemLeadChainContentProcessor.js +0 -29
  246. package/dist/cjs/parser/bitmark/peg/contentProcessors/ItemLeadChainContentProcessor.js.map +0 -1
  247. package/dist/cjs/parser/bitmark/peg/contentProcessors/ItemLeadTagContentProcessor.js +0 -20
  248. package/dist/cjs/parser/bitmark/peg/contentProcessors/ItemLeadTagContentProcessor.js.map +0 -1
  249. package/dist/cjs/parser/bitmark/peg/contentProcessors/MarkChainContentProcessor.js +0 -45
  250. package/dist/cjs/parser/bitmark/peg/contentProcessors/MarkChainContentProcessor.js.map +0 -1
  251. package/dist/cjs/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.js +0 -44
  252. package/dist/cjs/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.js.map +0 -1
  253. package/dist/cjs/parser/bitmark/peg/contentProcessors/MarkTagContentProcessor.js +0 -11
  254. package/dist/cjs/parser/bitmark/peg/contentProcessors/MarkTagContentProcessor.js.map +0 -1
  255. package/dist/cjs/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.js +0 -57
  256. package/dist/cjs/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.js.map +0 -1
  257. package/dist/cjs/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.js +0 -158
  258. package/dist/cjs/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.js.map +0 -1
  259. package/dist/cjs/parser/bitmark/peg/contentProcessors/RatingLevelChainContentProcessor.js +0 -37
  260. package/dist/cjs/parser/bitmark/peg/contentProcessors/RatingLevelChainContentProcessor.js.map +0 -1
  261. package/dist/cjs/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.js +0 -24
  262. package/dist/cjs/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.js.map +0 -1
  263. package/dist/cjs/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.js +0 -163
  264. package/dist/cjs/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.js.map +0 -1
  265. package/dist/cjs/parser/bitmark/peg/contentProcessors/ServingsChainContentProcessor.js +0 -27
  266. package/dist/cjs/parser/bitmark/peg/contentProcessors/ServingsChainContentProcessor.js.map +0 -1
  267. package/dist/cjs/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.js +0 -28
  268. package/dist/cjs/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.js.map +0 -1
  269. package/dist/cjs/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.js +0 -53
  270. package/dist/cjs/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.js.map +0 -1
  271. package/dist/cjs/parser/bitmark/peg/contentProcessors/TrueFalseChainContentProcessor.js +0 -203
  272. package/dist/cjs/parser/bitmark/peg/contentProcessors/TrueFalseChainContentProcessor.js.map +0 -1
  273. package/dist/cjs/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.js +0 -24
  274. package/dist/cjs/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.js.map +0 -1
  275. package/dist/cjs/parser/json/JsonParser.js +0 -270
  276. package/dist/cjs/parser/json/JsonParser.js.map +0 -1
  277. package/dist/cjs/parser/text/TextParser.js +0 -148
  278. package/dist/cjs/parser/text/TextParser.js.map +0 -1
  279. package/dist/cjs/parser/text/peg/TextPegParser.js +0 -7
  280. package/dist/cjs/parser/text/peg/TextPegParser.js.map +0 -1
  281. package/dist/cjs/utils/ArrayUtils.js +0 -43
  282. package/dist/cjs/utils/ArrayUtils.js.map +0 -1
  283. package/dist/cjs/utils/BitUtils.js +0 -75
  284. package/dist/cjs/utils/BitUtils.js.map +0 -1
  285. package/dist/cjs/utils/BooleanUtils.js +0 -62
  286. package/dist/cjs/utils/BooleanUtils.js.map +0 -1
  287. package/dist/cjs/utils/FileUtils.js +0 -75
  288. package/dist/cjs/utils/FileUtils.js.map +0 -1
  289. package/dist/cjs/utils/NumberUtils.js +0 -62
  290. package/dist/cjs/utils/NumberUtils.js.map +0 -1
  291. package/dist/cjs/utils/ObjectUtils.js +0 -417
  292. package/dist/cjs/utils/ObjectUtils.js.map +0 -1
  293. package/dist/cjs/utils/StringUtils.js +0 -183
  294. package/dist/cjs/utils/StringUtils.js.map +0 -1
  295. package/dist/cjs/utils/UrlUtils.js +0 -37
  296. package/dist/cjs/utils/UrlUtils.js.map +0 -1
  297. package/dist/cjs/utils/env/Env.js +0 -131
  298. package/dist/cjs/utils/env/Env.js.map +0 -1
  299. package/dist/cjs/utils/env/Environment.js +0 -15
  300. package/dist/cjs/utils/env/Environment.js.map +0 -1
  301. package/dist/cjs/utils/env/Os.js +0 -14
  302. package/dist/cjs/utils/env/Os.js.map +0 -1
  303. package/dist/cjs/utils/env/Version.js +0 -12
  304. package/dist/cjs/utils/env/Version.js.map +0 -1
  305. package/dist/cjs/utils/env/userAgent.js +0 -88
  306. package/dist/cjs/utils/env/userAgent.js.map +0 -1
  307. package/dist/cjs/utils/polyfill/fs.js +0 -14
  308. package/dist/cjs/utils/polyfill/fs.js.map +0 -1
  309. package/dist/esm/BitmarkParserGenerator.js +0 -735
  310. package/dist/esm/BitmarkParserGenerator.js.map +0 -1
  311. package/dist/esm/ast/Ast.js +0 -217
  312. package/dist/esm/ast/Ast.js.map +0 -1
  313. package/dist/esm/ast/BaseBuilder.js +0 -190
  314. package/dist/esm/ast/BaseBuilder.js.map +0 -1
  315. package/dist/esm/ast/Builder.js +0 -1775
  316. package/dist/esm/ast/Builder.js.map +0 -1
  317. package/dist/esm/ast/ResourceBuilder.js +0 -960
  318. package/dist/esm/ast/ResourceBuilder.js.map +0 -1
  319. package/dist/esm/ast/rules/NodeValidator.js +0 -181
  320. package/dist/esm/ast/rules/NodeValidator.js.map +0 -1
  321. package/dist/esm/ast/writer/FileWriter.js +0 -80
  322. package/dist/esm/ast/writer/FileWriter.js.map +0 -1
  323. package/dist/esm/ast/writer/StreamWriter.js +0 -83
  324. package/dist/esm/ast/writer/StreamWriter.js.map +0 -1
  325. package/dist/esm/ast/writer/StringWriter.js +0 -112
  326. package/dist/esm/ast/writer/StringWriter.js.map +0 -1
  327. package/dist/esm/ast/writer/Writer.js +0 -2
  328. package/dist/esm/ast/writer/Writer.js.map +0 -1
  329. package/dist/esm/breakscaping/Breakscape.js +0 -77
  330. package/dist/esm/breakscaping/Breakscape.js.map +0 -1
  331. package/dist/esm/breakscaping/BreakscapeLoop.js +0 -302
  332. package/dist/esm/breakscaping/BreakscapeLoop.js.map +0 -1
  333. package/dist/esm/breakscaping/BreakscapeOptions.js +0 -2
  334. package/dist/esm/breakscaping/BreakscapeOptions.js.map +0 -1
  335. package/dist/esm/breakscaping/BreakscapeRegex.js +0 -177
  336. package/dist/esm/breakscaping/BreakscapeRegex.js.map +0 -1
  337. package/dist/esm/breakscaping/RegexConfigs.js +0 -35
  338. package/dist/esm/breakscaping/RegexConfigs.js.map +0 -1
  339. package/dist/esm/config/Config.js +0 -349
  340. package/dist/esm/config/Config.js.map +0 -1
  341. package/dist/esm/config/ConfigHydrator.js +0 -158
  342. package/dist/esm/config/ConfigHydrator.js.map +0 -1
  343. package/dist/esm/config/raw/bits.js +0 -2612
  344. package/dist/esm/config/raw/bits.js.map +0 -1
  345. package/dist/esm/config/raw/cardSets.js +0 -546
  346. package/dist/esm/config/raw/cardSets.js.map +0 -1
  347. package/dist/esm/config/raw/groups.js +0 -1179
  348. package/dist/esm/config/raw/groups.js.map +0 -1
  349. package/dist/esm/config/raw/properties.js +0 -1003
  350. package/dist/esm/config/raw/properties.js.map +0 -1
  351. package/dist/esm/config/raw/resources.js +0 -100
  352. package/dist/esm/config/raw/resources.js.map +0 -1
  353. package/dist/esm/config/raw/tags.js +0 -45
  354. package/dist/esm/config/raw/tags.js.map +0 -1
  355. package/dist/esm/generated/build-info.js +0 -10
  356. package/dist/esm/generated/build-info.js.map +0 -1
  357. package/dist/esm/generated/parser/bitmark/bitmark-peggy-parser.js +0 -3163
  358. package/dist/esm/generated/parser/bitmark/bitmark-peggy-parser.js.map +0 -1
  359. package/dist/esm/generated/parser/text/text-peggy-parser.js +0 -9654
  360. package/dist/esm/generated/parser/text/text-peggy-parser.js.map +0 -1
  361. package/dist/esm/generator/AstWalkerGenerator.js +0 -83
  362. package/dist/esm/generator/AstWalkerGenerator.js.map +0 -1
  363. package/dist/esm/generator/Generator.js +0 -2
  364. package/dist/esm/generator/Generator.js.map +0 -1
  365. package/dist/esm/generator/bitmark/BitmarkFileGenerator.js +0 -46
  366. package/dist/esm/generator/bitmark/BitmarkFileGenerator.js.map +0 -1
  367. package/dist/esm/generator/bitmark/BitmarkGenerator.js +0 -2598
  368. package/dist/esm/generator/bitmark/BitmarkGenerator.js.map +0 -1
  369. package/dist/esm/generator/bitmark/BitmarkStringGenerator.js +0 -48
  370. package/dist/esm/generator/bitmark/BitmarkStringGenerator.js.map +0 -1
  371. package/dist/esm/generator/json/JsonFileGenerator.js +0 -50
  372. package/dist/esm/generator/json/JsonFileGenerator.js.map +0 -1
  373. package/dist/esm/generator/json/JsonGenerator.js +0 -1578
  374. package/dist/esm/generator/json/JsonGenerator.js.map +0 -1
  375. package/dist/esm/generator/json/JsonObjectGenerator.js +0 -48
  376. package/dist/esm/generator/json/JsonObjectGenerator.js.map +0 -1
  377. package/dist/esm/generator/json/JsonStringGenerator.js +0 -47
  378. package/dist/esm/generator/json/JsonStringGenerator.js.map +0 -1
  379. package/dist/esm/generator/text/TextGenerator.js +0 -1196
  380. package/dist/esm/generator/text/TextGenerator.js.map +0 -1
  381. package/dist/esm/index.js +0 -49
  382. package/dist/esm/index.js.map +0 -1
  383. package/dist/esm/info/InfoBuilder.js +0 -40
  384. package/dist/esm/info/InfoBuilder.js.map +0 -1
  385. package/dist/esm/init/init.js +0 -13
  386. package/dist/esm/init/init.js.map +0 -1
  387. package/dist/esm/model/ast/BreakscapedString.js +0 -2
  388. package/dist/esm/model/ast/BreakscapedString.js.map +0 -1
  389. package/dist/esm/model/ast/NodeType.js +0 -554
  390. package/dist/esm/model/ast/NodeType.js.map +0 -1
  391. package/dist/esm/model/ast/Nodes.js +0 -2
  392. package/dist/esm/model/ast/Nodes.js.map +0 -1
  393. package/dist/esm/model/ast/StardardString.js +0 -2
  394. package/dist/esm/model/ast/StardardString.js.map +0 -1
  395. package/dist/esm/model/ast/TextNodes.js +0 -2
  396. package/dist/esm/model/ast/TextNodes.js.map +0 -1
  397. package/dist/esm/model/config/AbstractTagConfig.js +0 -15
  398. package/dist/esm/model/config/AbstractTagConfig.js.map +0 -1
  399. package/dist/esm/model/config/BitConfig.js +0 -69
  400. package/dist/esm/model/config/BitConfig.js.map +0 -1
  401. package/dist/esm/model/config/CardSetConfig.js +0 -23
  402. package/dist/esm/model/config/CardSetConfig.js.map +0 -1
  403. package/dist/esm/model/config/CardVariantConfig.js +0 -29
  404. package/dist/esm/model/config/CardVariantConfig.js.map +0 -1
  405. package/dist/esm/model/config/MarkupTagConfig.js +0 -38
  406. package/dist/esm/model/config/MarkupTagConfig.js.map +0 -1
  407. package/dist/esm/model/config/PropertyTagConfig.js +0 -47
  408. package/dist/esm/model/config/PropertyTagConfig.js.map +0 -1
  409. package/dist/esm/model/config/ResourceTagConfig.js +0 -39
  410. package/dist/esm/model/config/ResourceTagConfig.js.map +0 -1
  411. package/dist/esm/model/config/ResourcesConfig.js +0 -28
  412. package/dist/esm/model/config/ResourcesConfig.js.map +0 -1
  413. package/dist/esm/model/config/TagConfig.js +0 -2
  414. package/dist/esm/model/config/TagConfig.js.map +0 -1
  415. package/dist/esm/model/config/TagsConfig.js +0 -2
  416. package/dist/esm/model/config/TagsConfig.js.map +0 -1
  417. package/dist/esm/model/config/TagsConfigWithInfo.js +0 -2
  418. package/dist/esm/model/config/TagsConfigWithInfo.js.map +0 -1
  419. package/dist/esm/model/config/_Config.js +0 -2
  420. package/dist/esm/model/config/_Config.js.map +0 -1
  421. package/dist/esm/model/config/enum/CardSetConfigKey.js +0 -25
  422. package/dist/esm/model/config/enum/CardSetConfigKey.js.map +0 -1
  423. package/dist/esm/model/config/enum/ConfigKey.js +0 -26
  424. package/dist/esm/model/config/enum/ConfigKey.js.map +0 -1
  425. package/dist/esm/model/config/enum/GroupConfigKey.js +0 -53
  426. package/dist/esm/model/config/enum/GroupConfigKey.js.map +0 -1
  427. package/dist/esm/model/config/enum/GroupConfigType.js +0 -11
  428. package/dist/esm/model/config/enum/GroupConfigType.js.map +0 -1
  429. package/dist/esm/model/config/enum/PropertyConfigKey.js +0 -211
  430. package/dist/esm/model/config/enum/PropertyConfigKey.js.map +0 -1
  431. package/dist/esm/model/config/enum/ResourceConfigKey.js +0 -36
  432. package/dist/esm/model/config/enum/ResourceConfigKey.js.map +0 -1
  433. package/dist/esm/model/config/enum/TagConfigKey.js +0 -22
  434. package/dist/esm/model/config/enum/TagConfigKey.js.map +0 -1
  435. package/dist/esm/model/enum/BitTagType.js +0 -10
  436. package/dist/esm/model/enum/BitTagType.js.map +0 -1
  437. package/dist/esm/model/enum/BitType.js +0 -573
  438. package/dist/esm/model/enum/BitType.js.map +0 -1
  439. package/dist/esm/model/enum/BitmarkGeneratorOutput.js +0 -2
  440. package/dist/esm/model/enum/BitmarkGeneratorOutput.js.map +0 -1
  441. package/dist/esm/model/enum/BitmarkParserType.js +0 -6
  442. package/dist/esm/model/enum/BitmarkParserType.js.map +0 -1
  443. package/dist/esm/model/enum/BitmarkVersion.js +0 -8
  444. package/dist/esm/model/enum/BitmarkVersion.js.map +0 -1
  445. package/dist/esm/model/enum/BodyBitType.js +0 -11
  446. package/dist/esm/model/enum/BodyBitType.js.map +0 -1
  447. package/dist/esm/model/enum/BodyTextFormat.js +0 -11
  448. package/dist/esm/model/enum/BodyTextFormat.js.map +0 -1
  449. package/dist/esm/model/enum/CardSetVersion.js +0 -7
  450. package/dist/esm/model/enum/CardSetVersion.js.map +0 -1
  451. package/dist/esm/model/enum/Count.js +0 -6
  452. package/dist/esm/model/enum/Count.js.map +0 -1
  453. package/dist/esm/model/enum/DeprecatedTextFormat.js +0 -6
  454. package/dist/esm/model/enum/DeprecatedTextFormat.js.map +0 -1
  455. package/dist/esm/model/enum/ExampleType.js +0 -8
  456. package/dist/esm/model/enum/ExampleType.js.map +0 -1
  457. package/dist/esm/model/enum/PropertyAstKey.js +0 -15
  458. package/dist/esm/model/enum/PropertyAstKey.js.map +0 -1
  459. package/dist/esm/model/enum/PropertyFormat.js +0 -11
  460. package/dist/esm/model/enum/PropertyFormat.js.map +0 -1
  461. package/dist/esm/model/enum/PropertyJsonKey.js +0 -11
  462. package/dist/esm/model/enum/PropertyJsonKey.js.map +0 -1
  463. package/dist/esm/model/enum/PropertyTag.js +0 -5
  464. package/dist/esm/model/enum/PropertyTag.js.map +0 -1
  465. package/dist/esm/model/enum/ResourceJsonKey.js +0 -24
  466. package/dist/esm/model/enum/ResourceJsonKey.js.map +0 -1
  467. package/dist/esm/model/enum/ResourceTag.js +0 -34
  468. package/dist/esm/model/enum/ResourceTag.js.map +0 -1
  469. package/dist/esm/model/enum/Tag.js +0 -18
  470. package/dist/esm/model/enum/Tag.js.map +0 -1
  471. package/dist/esm/model/enum/TextFormat.js +0 -13
  472. package/dist/esm/model/enum/TextFormat.js.map +0 -1
  473. package/dist/esm/model/enum/TextLocation.js +0 -12
  474. package/dist/esm/model/enum/TextLocation.js.map +0 -1
  475. package/dist/esm/model/enum/TextMarkType.js +0 -51
  476. package/dist/esm/model/enum/TextMarkType.js.map +0 -1
  477. package/dist/esm/model/enum/TextNodeType.js +0 -32
  478. package/dist/esm/model/enum/TextNodeType.js.map +0 -1
  479. package/dist/esm/model/enum/TextSection.js +0 -15
  480. package/dist/esm/model/enum/TextSection.js.map +0 -1
  481. package/dist/esm/model/info/enum/InfoFormat.js +0 -8
  482. package/dist/esm/model/info/enum/InfoFormat.js.map +0 -1
  483. package/dist/esm/model/info/enum/InfoType.js +0 -9
  484. package/dist/esm/model/info/enum/InfoType.js.map +0 -1
  485. package/dist/esm/model/json/BitJson.js +0 -2
  486. package/dist/esm/model/json/BitJson.js.map +0 -1
  487. package/dist/esm/model/json/BitWrapperJson.js +0 -2
  488. package/dist/esm/model/json/BitWrapperJson.js.map +0 -1
  489. package/dist/esm/model/json/BodyBitJson.js +0 -2
  490. package/dist/esm/model/json/BodyBitJson.js.map +0 -1
  491. package/dist/esm/model/json/ParserJson.js +0 -2
  492. package/dist/esm/model/json/ParserJson.js.map +0 -1
  493. package/dist/esm/model/json/ResourceJson.js +0 -2
  494. package/dist/esm/model/json/ResourceJson.js.map +0 -1
  495. package/dist/esm/model/parser/ParserData.js +0 -2
  496. package/dist/esm/model/parser/ParserData.js.map +0 -1
  497. package/dist/esm/model/parser/ParserError.js +0 -2
  498. package/dist/esm/model/parser/ParserError.js.map +0 -1
  499. package/dist/esm/model/parser/ParserInfo.js +0 -2
  500. package/dist/esm/model/parser/ParserInfo.js.map +0 -1
  501. package/dist/esm/model/parser/ParserLocation.js +0 -2
  502. package/dist/esm/model/parser/ParserLocation.js.map +0 -1
  503. package/dist/esm/model/parser/ParserLocationRange.js +0 -2
  504. package/dist/esm/model/parser/ParserLocationRange.js.map +0 -1
  505. package/dist/esm/model/parser/TagValidationData.js +0 -2
  506. package/dist/esm/model/parser/TagValidationData.js.map +0 -1
  507. package/dist/esm/parser/bitmark/BitmarkParser.js +0 -22
  508. package/dist/esm/parser/bitmark/BitmarkParser.js.map +0 -1
  509. package/dist/esm/parser/bitmark/peg/BitmarkPegParser.js +0 -4
  510. package/dist/esm/parser/bitmark/peg/BitmarkPegParser.js.map +0 -1
  511. package/dist/esm/parser/bitmark/peg/BitmarkPegParserHelper.js +0 -611
  512. package/dist/esm/parser/bitmark/peg/BitmarkPegParserHelper.js.map +0 -1
  513. package/dist/esm/parser/bitmark/peg/BitmarkPegParserProcessor.js +0 -713
  514. package/dist/esm/parser/bitmark/peg/BitmarkPegParserProcessor.js.map +0 -1
  515. package/dist/esm/parser/bitmark/peg/BitmarkPegParserTypes.js +0 -59
  516. package/dist/esm/parser/bitmark/peg/BitmarkPegParserTypes.js.map +0 -1
  517. package/dist/esm/parser/bitmark/peg/BitmarkPegParserValidator.js +0 -742
  518. package/dist/esm/parser/bitmark/peg/BitmarkPegParserValidator.js.map +0 -1
  519. package/dist/esm/parser/bitmark/peg/PeggyGrammarLocation.js +0 -79
  520. package/dist/esm/parser/bitmark/peg/PeggyGrammarLocation.js.map +0 -1
  521. package/dist/esm/parser/bitmark/peg/contentProcessors/BodyContentProcessor.js +0 -257
  522. package/dist/esm/parser/bitmark/peg/contentProcessors/BodyContentProcessor.js.map +0 -1
  523. package/dist/esm/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.js +0 -48
  524. package/dist/esm/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.js.map +0 -1
  525. package/dist/esm/parser/bitmark/peg/contentProcessors/CardContentProcessor.js +0 -883
  526. package/dist/esm/parser/bitmark/peg/contentProcessors/CardContentProcessor.js.map +0 -1
  527. package/dist/esm/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.js +0 -25
  528. package/dist/esm/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.js.map +0 -1
  529. package/dist/esm/parser/bitmark/peg/contentProcessors/ContentProcessorUtils.js +0 -58
  530. package/dist/esm/parser/bitmark/peg/contentProcessors/ContentProcessorUtils.js.map +0 -1
  531. package/dist/esm/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.js +0 -61
  532. package/dist/esm/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.js.map +0 -1
  533. package/dist/esm/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.js +0 -159
  534. package/dist/esm/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.js.map +0 -1
  535. package/dist/esm/parser/bitmark/peg/contentProcessors/FooterContentProcessor.js +0 -52
  536. package/dist/esm/parser/bitmark/peg/contentProcessors/FooterContentProcessor.js.map +0 -1
  537. package/dist/esm/parser/bitmark/peg/contentProcessors/GapChainContentProcessor.js +0 -29
  538. package/dist/esm/parser/bitmark/peg/contentProcessors/GapChainContentProcessor.js.map +0 -1
  539. package/dist/esm/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.js +0 -57
  540. package/dist/esm/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.js.map +0 -1
  541. package/dist/esm/parser/bitmark/peg/contentProcessors/InternalCommentTagContentProcessor.js +0 -14
  542. package/dist/esm/parser/bitmark/peg/contentProcessors/InternalCommentTagContentProcessor.js.map +0 -1
  543. package/dist/esm/parser/bitmark/peg/contentProcessors/ItemLeadChainContentProcessor.js +0 -27
  544. package/dist/esm/parser/bitmark/peg/contentProcessors/ItemLeadChainContentProcessor.js.map +0 -1
  545. package/dist/esm/parser/bitmark/peg/contentProcessors/ItemLeadTagContentProcessor.js +0 -18
  546. package/dist/esm/parser/bitmark/peg/contentProcessors/ItemLeadTagContentProcessor.js.map +0 -1
  547. package/dist/esm/parser/bitmark/peg/contentProcessors/MarkChainContentProcessor.js +0 -43
  548. package/dist/esm/parser/bitmark/peg/contentProcessors/MarkChainContentProcessor.js.map +0 -1
  549. package/dist/esm/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.js +0 -42
  550. package/dist/esm/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.js.map +0 -1
  551. package/dist/esm/parser/bitmark/peg/contentProcessors/MarkTagContentProcessor.js +0 -9
  552. package/dist/esm/parser/bitmark/peg/contentProcessors/MarkTagContentProcessor.js.map +0 -1
  553. package/dist/esm/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.js +0 -55
  554. package/dist/esm/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.js.map +0 -1
  555. package/dist/esm/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.js +0 -156
  556. package/dist/esm/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.js.map +0 -1
  557. package/dist/esm/parser/bitmark/peg/contentProcessors/RatingLevelChainContentProcessor.js +0 -35
  558. package/dist/esm/parser/bitmark/peg/contentProcessors/RatingLevelChainContentProcessor.js.map +0 -1
  559. package/dist/esm/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.js +0 -22
  560. package/dist/esm/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.js.map +0 -1
  561. package/dist/esm/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.js +0 -160
  562. package/dist/esm/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.js.map +0 -1
  563. package/dist/esm/parser/bitmark/peg/contentProcessors/ServingsChainContentProcessor.js +0 -25
  564. package/dist/esm/parser/bitmark/peg/contentProcessors/ServingsChainContentProcessor.js.map +0 -1
  565. package/dist/esm/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.js +0 -26
  566. package/dist/esm/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.js.map +0 -1
  567. package/dist/esm/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.js +0 -50
  568. package/dist/esm/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.js.map +0 -1
  569. package/dist/esm/parser/bitmark/peg/contentProcessors/TrueFalseChainContentProcessor.js +0 -201
  570. package/dist/esm/parser/bitmark/peg/contentProcessors/TrueFalseChainContentProcessor.js.map +0 -1
  571. package/dist/esm/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.js +0 -22
  572. package/dist/esm/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.js.map +0 -1
  573. package/dist/esm/parser/json/JsonParser.js +0 -267
  574. package/dist/esm/parser/json/JsonParser.js.map +0 -1
  575. package/dist/esm/parser/text/TextParser.js +0 -145
  576. package/dist/esm/parser/text/TextParser.js.map +0 -1
  577. package/dist/esm/parser/text/peg/TextPegParser.js +0 -4
  578. package/dist/esm/parser/text/peg/TextPegParser.js.map +0 -1
  579. package/dist/esm/utils/ArrayUtils.js +0 -40
  580. package/dist/esm/utils/ArrayUtils.js.map +0 -1
  581. package/dist/esm/utils/BitUtils.js +0 -72
  582. package/dist/esm/utils/BitUtils.js.map +0 -1
  583. package/dist/esm/utils/BooleanUtils.js +0 -59
  584. package/dist/esm/utils/BooleanUtils.js.map +0 -1
  585. package/dist/esm/utils/FileUtils.js +0 -36
  586. package/dist/esm/utils/FileUtils.js.map +0 -1
  587. package/dist/esm/utils/NumberUtils.js +0 -59
  588. package/dist/esm/utils/NumberUtils.js.map +0 -1
  589. package/dist/esm/utils/ObjectUtils.js +0 -411
  590. package/dist/esm/utils/ObjectUtils.js.map +0 -1
  591. package/dist/esm/utils/StringUtils.js +0 -180
  592. package/dist/esm/utils/StringUtils.js.map +0 -1
  593. package/dist/esm/utils/UrlUtils.js +0 -34
  594. package/dist/esm/utils/UrlUtils.js.map +0 -1
  595. package/dist/esm/utils/env/Env.js +0 -127
  596. package/dist/esm/utils/env/Env.js.map +0 -1
  597. package/dist/esm/utils/env/Environment.js +0 -12
  598. package/dist/esm/utils/env/Environment.js.map +0 -1
  599. package/dist/esm/utils/env/Os.js +0 -11
  600. package/dist/esm/utils/env/Os.js.map +0 -1
  601. package/dist/esm/utils/env/Version.js +0 -9
  602. package/dist/esm/utils/env/Version.js.map +0 -1
  603. package/dist/esm/utils/env/userAgent.js +0 -86
  604. package/dist/esm/utils/env/userAgent.js.map +0 -1
  605. package/dist/esm/utils/polyfill/fs.js +0 -10
  606. package/dist/esm/utils/polyfill/fs.js.map +0 -1
  607. package/dist/types/BitmarkParserGenerator.d.ts +0 -478
  608. package/dist/types/BitmarkParserGenerator.d.ts.map +0 -1
  609. package/dist/types/ast/Ast.d.ts +0 -137
  610. package/dist/types/ast/Ast.d.ts.map +0 -1
  611. package/dist/types/ast/BaseBuilder.d.ts +0 -64
  612. package/dist/types/ast/BaseBuilder.d.ts.map +0 -1
  613. package/dist/types/ast/Builder.d.ts +0 -692
  614. package/dist/types/ast/Builder.d.ts.map +0 -1
  615. package/dist/types/ast/ResourceBuilder.d.ts +0 -384
  616. package/dist/types/ast/ResourceBuilder.d.ts.map +0 -1
  617. package/dist/types/ast/rules/NodeValidator.d.ts +0 -28
  618. package/dist/types/ast/rules/NodeValidator.d.ts.map +0 -1
  619. package/dist/types/ast/writer/FileWriter.d.ts +0 -37
  620. package/dist/types/ast/writer/FileWriter.d.ts.map +0 -1
  621. package/dist/types/ast/writer/StreamWriter.d.ts +0 -29
  622. package/dist/types/ast/writer/StreamWriter.d.ts.map +0 -1
  623. package/dist/types/ast/writer/StringWriter.d.ts +0 -30
  624. package/dist/types/ast/writer/StringWriter.d.ts.map +0 -1
  625. package/dist/types/ast/writer/Writer.d.ts +0 -72
  626. package/dist/types/ast/writer/Writer.d.ts.map +0 -1
  627. package/dist/types/breakscaping/Breakscape.d.ts +0 -44
  628. package/dist/types/breakscaping/Breakscape.d.ts.map +0 -1
  629. package/dist/types/breakscaping/BreakscapeLoop.d.ts +0 -142
  630. package/dist/types/breakscaping/BreakscapeLoop.d.ts.map +0 -1
  631. package/dist/types/breakscaping/BreakscapeOptions.d.ts +0 -30
  632. package/dist/types/breakscaping/BreakscapeOptions.d.ts.map +0 -1
  633. package/dist/types/breakscaping/BreakscapeRegex.d.ts +0 -96
  634. package/dist/types/breakscaping/BreakscapeRegex.d.ts.map +0 -1
  635. package/dist/types/breakscaping/RegexConfigs.d.ts +0 -35
  636. package/dist/types/breakscaping/RegexConfigs.d.ts.map +0 -1
  637. package/dist/types/config/Config.d.ts +0 -115
  638. package/dist/types/config/Config.d.ts.map +0 -1
  639. package/dist/types/config/ConfigHydrator.d.ts +0 -16
  640. package/dist/types/config/ConfigHydrator.d.ts.map +0 -1
  641. package/dist/types/config/raw/bits.d.ts +0 -4
  642. package/dist/types/config/raw/bits.d.ts.map +0 -1
  643. package/dist/types/config/raw/cardSets.d.ts +0 -4
  644. package/dist/types/config/raw/cardSets.d.ts.map +0 -1
  645. package/dist/types/config/raw/groups.d.ts +0 -4
  646. package/dist/types/config/raw/groups.d.ts.map +0 -1
  647. package/dist/types/config/raw/properties.d.ts +0 -4
  648. package/dist/types/config/raw/properties.d.ts.map +0 -1
  649. package/dist/types/config/raw/resources.d.ts +0 -4
  650. package/dist/types/config/raw/resources.d.ts.map +0 -1
  651. package/dist/types/config/raw/tags.d.ts +0 -4
  652. package/dist/types/config/raw/tags.d.ts.map +0 -1
  653. package/dist/types/generated/build-info.d.ts +0 -8
  654. package/dist/types/generated/build-info.d.ts.map +0 -1
  655. package/dist/types/generated/parser/bitmark/bitmark-peggy-parser.d.ts +0 -12
  656. package/dist/types/generated/parser/bitmark/bitmark-peggy-parser.d.ts.map +0 -1
  657. package/dist/types/generated/parser/text/text-peggy-parser.d.ts +0 -12
  658. package/dist/types/generated/parser/text/text-peggy-parser.d.ts.map +0 -1
  659. package/dist/types/generator/AstWalkerGenerator.d.ts +0 -32
  660. package/dist/types/generator/AstWalkerGenerator.d.ts.map +0 -1
  661. package/dist/types/generator/Generator.d.ts +0 -6
  662. package/dist/types/generator/Generator.d.ts.map +0 -1
  663. package/dist/types/generator/bitmark/BitmarkFileGenerator.d.ts +0 -41
  664. package/dist/types/generator/bitmark/BitmarkFileGenerator.d.ts.map +0 -1
  665. package/dist/types/generator/bitmark/BitmarkGenerator.d.ts +0 -401
  666. package/dist/types/generator/bitmark/BitmarkGenerator.d.ts.map +0 -1
  667. package/dist/types/generator/bitmark/BitmarkStringGenerator.d.ts +0 -31
  668. package/dist/types/generator/bitmark/BitmarkStringGenerator.d.ts.map +0 -1
  669. package/dist/types/generator/json/JsonFileGenerator.d.ts +0 -45
  670. package/dist/types/generator/json/JsonFileGenerator.d.ts.map +0 -1
  671. package/dist/types/generator/json/JsonGenerator.d.ts +0 -357
  672. package/dist/types/generator/json/JsonGenerator.d.ts.map +0 -1
  673. package/dist/types/generator/json/JsonObjectGenerator.d.ts +0 -32
  674. package/dist/types/generator/json/JsonObjectGenerator.d.ts.map +0 -1
  675. package/dist/types/generator/json/JsonStringGenerator.d.ts +0 -30
  676. package/dist/types/generator/json/JsonStringGenerator.d.ts.map +0 -1
  677. package/dist/types/generator/text/TextGenerator.d.ts +0 -228
  678. package/dist/types/generator/text/TextGenerator.d.ts.map +0 -1
  679. package/dist/types/index.d.ts +0 -50
  680. package/dist/types/index.d.ts.map +0 -1
  681. package/dist/types/info/InfoBuilder.d.ts +0 -18
  682. package/dist/types/info/InfoBuilder.d.ts.map +0 -1
  683. package/dist/types/init/init.d.ts +0 -4
  684. package/dist/types/init/init.d.ts.map +0 -1
  685. package/dist/types/model/ast/BreakscapedString.d.ts +0 -4
  686. package/dist/types/model/ast/BreakscapedString.d.ts.map +0 -1
  687. package/dist/types/model/ast/NodeType.d.ts +0 -1093
  688. package/dist/types/model/ast/NodeType.d.ts.map +0 -1
  689. package/dist/types/model/ast/Nodes.d.ts +0 -268
  690. package/dist/types/model/ast/Nodes.d.ts.map +0 -1
  691. package/dist/types/model/ast/StardardString.d.ts +0 -4
  692. package/dist/types/model/ast/StardardString.d.ts.map +0 -1
  693. package/dist/types/model/ast/TextNodes.d.ts +0 -130
  694. package/dist/types/model/ast/TextNodes.d.ts.map +0 -1
  695. package/dist/types/model/config/AbstractTagConfig.d.ts +0 -24
  696. package/dist/types/model/config/AbstractTagConfig.d.ts.map +0 -1
  697. package/dist/types/model/config/BitConfig.d.ts +0 -48
  698. package/dist/types/model/config/BitConfig.d.ts.map +0 -1
  699. package/dist/types/model/config/CardSetConfig.d.ts +0 -14
  700. package/dist/types/model/config/CardSetConfig.d.ts.map +0 -1
  701. package/dist/types/model/config/CardVariantConfig.d.ts +0 -16
  702. package/dist/types/model/config/CardVariantConfig.d.ts.map +0 -1
  703. package/dist/types/model/config/MarkupTagConfig.d.ts +0 -17
  704. package/dist/types/model/config/MarkupTagConfig.d.ts.map +0 -1
  705. package/dist/types/model/config/PropertyTagConfig.d.ts +0 -23
  706. package/dist/types/model/config/PropertyTagConfig.d.ts.map +0 -1
  707. package/dist/types/model/config/ResourceTagConfig.d.ts +0 -18
  708. package/dist/types/model/config/ResourceTagConfig.d.ts.map +0 -1
  709. package/dist/types/model/config/ResourcesConfig.d.ts +0 -14
  710. package/dist/types/model/config/ResourcesConfig.d.ts.map +0 -1
  711. package/dist/types/model/config/TagConfig.d.ts +0 -5
  712. package/dist/types/model/config/TagConfig.d.ts.map +0 -1
  713. package/dist/types/model/config/TagsConfig.d.ts +0 -5
  714. package/dist/types/model/config/TagsConfig.d.ts.map +0 -1
  715. package/dist/types/model/config/TagsConfigWithInfo.d.ts +0 -9
  716. package/dist/types/model/config/TagsConfigWithInfo.d.ts.map +0 -1
  717. package/dist/types/model/config/_Config.d.ts +0 -119
  718. package/dist/types/model/config/_Config.d.ts.map +0 -1
  719. package/dist/types/model/config/enum/CardSetConfigKey.d.ts +0 -43
  720. package/dist/types/model/config/enum/CardSetConfigKey.d.ts.map +0 -1
  721. package/dist/types/model/config/enum/ConfigKey.d.ts +0 -578
  722. package/dist/types/model/config/enum/ConfigKey.d.ts.map +0 -1
  723. package/dist/types/model/config/enum/GroupConfigKey.d.ts +0 -144
  724. package/dist/types/model/config/enum/GroupConfigKey.d.ts.map +0 -1
  725. package/dist/types/model/config/enum/GroupConfigType.d.ts +0 -16
  726. package/dist/types/model/config/enum/GroupConfigType.d.ts.map +0 -1
  727. package/dist/types/model/config/enum/PropertyConfigKey.d.ts +0 -618
  728. package/dist/types/model/config/enum/PropertyConfigKey.d.ts.map +0 -1
  729. package/dist/types/model/config/enum/ResourceConfigKey.d.ts +0 -87
  730. package/dist/types/model/config/enum/ResourceConfigKey.d.ts.map +0 -1
  731. package/dist/types/model/config/enum/TagConfigKey.d.ts +0 -51
  732. package/dist/types/model/config/enum/TagConfigKey.d.ts.map +0 -1
  733. package/dist/types/model/enum/BitTagType.d.ts +0 -15
  734. package/dist/types/model/enum/BitTagType.d.ts.map +0 -1
  735. package/dist/types/model/enum/BitType.d.ts +0 -1143
  736. package/dist/types/model/enum/BitType.d.ts.map +0 -1
  737. package/dist/types/model/enum/BitmarkGeneratorOutput.d.ts +0 -1
  738. package/dist/types/model/enum/BitmarkGeneratorOutput.d.ts.map +0 -1
  739. package/dist/types/model/enum/BitmarkParserType.d.ts +0 -7
  740. package/dist/types/model/enum/BitmarkParserType.d.ts.map +0 -1
  741. package/dist/types/model/enum/BitmarkVersion.d.ts +0 -12
  742. package/dist/types/model/enum/BitmarkVersion.d.ts.map +0 -1
  743. package/dist/types/model/enum/BodyBitType.d.ts +0 -25
  744. package/dist/types/model/enum/BodyBitType.d.ts.map +0 -1
  745. package/dist/types/model/enum/BodyTextFormat.d.ts +0 -17
  746. package/dist/types/model/enum/BodyTextFormat.d.ts.map +0 -1
  747. package/dist/types/model/enum/CardSetVersion.d.ts +0 -11
  748. package/dist/types/model/enum/CardSetVersion.d.ts.map +0 -1
  749. package/dist/types/model/enum/Count.d.ts +0 -7
  750. package/dist/types/model/enum/Count.d.ts.map +0 -1
  751. package/dist/types/model/enum/DeprecatedTextFormat.d.ts +0 -7
  752. package/dist/types/model/enum/DeprecatedTextFormat.d.ts.map +0 -1
  753. package/dist/types/model/enum/ExampleType.d.ts +0 -13
  754. package/dist/types/model/enum/ExampleType.d.ts.map +0 -1
  755. package/dist/types/model/enum/PropertyAstKey.d.ts +0 -22
  756. package/dist/types/model/enum/PropertyAstKey.d.ts.map +0 -1
  757. package/dist/types/model/enum/PropertyFormat.d.ts +0 -19
  758. package/dist/types/model/enum/PropertyFormat.d.ts.map +0 -1
  759. package/dist/types/model/enum/PropertyJsonKey.d.ts +0 -10
  760. package/dist/types/model/enum/PropertyJsonKey.d.ts.map +0 -1
  761. package/dist/types/model/enum/PropertyTag.d.ts +0 -419
  762. package/dist/types/model/enum/PropertyTag.d.ts.map +0 -1
  763. package/dist/types/model/enum/ResourceJsonKey.d.ts +0 -45
  764. package/dist/types/model/enum/ResourceJsonKey.d.ts.map +0 -1
  765. package/dist/types/model/enum/ResourceTag.d.ts +0 -63
  766. package/dist/types/model/enum/ResourceTag.d.ts.map +0 -1
  767. package/dist/types/model/enum/Tag.d.ts +0 -33
  768. package/dist/types/model/enum/Tag.d.ts.map +0 -1
  769. package/dist/types/model/enum/TextFormat.d.ts +0 -17
  770. package/dist/types/model/enum/TextFormat.d.ts.map +0 -1
  771. package/dist/types/model/enum/TextLocation.d.ts +0 -16
  772. package/dist/types/model/enum/TextLocation.d.ts.map +0 -1
  773. package/dist/types/model/enum/TextMarkType.d.ts +0 -93
  774. package/dist/types/model/enum/TextMarkType.d.ts.map +0 -1
  775. package/dist/types/model/enum/TextNodeType.d.ts +0 -53
  776. package/dist/types/model/enum/TextNodeType.d.ts.map +0 -1
  777. package/dist/types/model/enum/TextSection.d.ts +0 -27
  778. package/dist/types/model/enum/TextSection.d.ts.map +0 -1
  779. package/dist/types/model/info/enum/InfoFormat.d.ts +0 -13
  780. package/dist/types/model/info/enum/InfoFormat.d.ts.map +0 -1
  781. package/dist/types/model/info/enum/InfoType.d.ts +0 -15
  782. package/dist/types/model/info/enum/InfoType.d.ts.map +0 -1
  783. package/dist/types/model/json/BitJson.d.ts +0 -479
  784. package/dist/types/model/json/BitJson.d.ts.map +0 -1
  785. package/dist/types/model/json/BitWrapperJson.d.ts +0 -8
  786. package/dist/types/model/json/BitWrapperJson.d.ts.map +0 -1
  787. package/dist/types/model/json/BodyBitJson.d.ts +0 -81
  788. package/dist/types/model/json/BodyBitJson.d.ts.map +0 -1
  789. package/dist/types/model/json/ParserJson.d.ts +0 -12
  790. package/dist/types/model/json/ParserJson.d.ts.map +0 -1
  791. package/dist/types/model/json/ResourceJson.d.ts +0 -244
  792. package/dist/types/model/json/ResourceJson.d.ts.map +0 -1
  793. package/dist/types/model/parser/ParserData.d.ts +0 -11
  794. package/dist/types/model/parser/ParserData.d.ts.map +0 -1
  795. package/dist/types/model/parser/ParserError.d.ts +0 -17
  796. package/dist/types/model/parser/ParserError.d.ts.map +0 -1
  797. package/dist/types/model/parser/ParserInfo.d.ts +0 -10
  798. package/dist/types/model/parser/ParserInfo.d.ts.map +0 -1
  799. package/dist/types/model/parser/ParserLocation.d.ts +0 -6
  800. package/dist/types/model/parser/ParserLocation.d.ts.map +0 -1
  801. package/dist/types/model/parser/ParserLocationRange.d.ts +0 -10
  802. package/dist/types/model/parser/ParserLocationRange.d.ts.map +0 -1
  803. package/dist/types/model/parser/TagValidationData.d.ts +0 -24
  804. package/dist/types/model/parser/TagValidationData.d.ts.map +0 -1
  805. package/dist/types/parser/bitmark/BitmarkParser.d.ts +0 -21
  806. package/dist/types/parser/bitmark/BitmarkParser.d.ts.map +0 -1
  807. package/dist/types/parser/bitmark/peg/BitmarkPegParser.d.ts +0 -8
  808. package/dist/types/parser/bitmark/peg/BitmarkPegParser.d.ts.map +0 -1
  809. package/dist/types/parser/bitmark/peg/BitmarkPegParserHelper.d.ts +0 -108
  810. package/dist/types/parser/bitmark/peg/BitmarkPegParserHelper.d.ts.map +0 -1
  811. package/dist/types/parser/bitmark/peg/BitmarkPegParserProcessor.d.ts +0 -137
  812. package/dist/types/parser/bitmark/peg/BitmarkPegParserProcessor.d.ts.map +0 -1
  813. package/dist/types/parser/bitmark/peg/BitmarkPegParserTypes.d.ts +0 -333
  814. package/dist/types/parser/bitmark/peg/BitmarkPegParserTypes.d.ts.map +0 -1
  815. package/dist/types/parser/bitmark/peg/BitmarkPegParserValidator.d.ts +0 -186
  816. package/dist/types/parser/bitmark/peg/BitmarkPegParserValidator.d.ts.map +0 -1
  817. package/dist/types/parser/bitmark/peg/PeggyGrammarLocation.d.ts +0 -61
  818. package/dist/types/parser/bitmark/peg/PeggyGrammarLocation.d.ts.map +0 -1
  819. package/dist/types/parser/bitmark/peg/contentProcessors/BodyContentProcessor.d.ts +0 -37
  820. package/dist/types/parser/bitmark/peg/contentProcessors/BodyContentProcessor.d.ts.map +0 -1
  821. package/dist/types/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.d.ts +0 -5
  822. package/dist/types/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.d.ts.map +0 -1
  823. package/dist/types/parser/bitmark/peg/contentProcessors/CardContentProcessor.d.ts +0 -7
  824. package/dist/types/parser/bitmark/peg/contentProcessors/CardContentProcessor.d.ts.map +0 -1
  825. package/dist/types/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.d.ts +0 -5
  826. package/dist/types/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.d.ts.map +0 -1
  827. package/dist/types/parser/bitmark/peg/contentProcessors/ContentProcessorUtils.d.ts +0 -15
  828. package/dist/types/parser/bitmark/peg/contentProcessors/ContentProcessorUtils.d.ts.map +0 -1
  829. package/dist/types/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.d.ts +0 -5
  830. package/dist/types/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.d.ts.map +0 -1
  831. package/dist/types/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.d.ts +0 -4
  832. package/dist/types/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.d.ts.map +0 -1
  833. package/dist/types/parser/bitmark/peg/contentProcessors/FooterContentProcessor.d.ts +0 -14
  834. package/dist/types/parser/bitmark/peg/contentProcessors/FooterContentProcessor.d.ts.map +0 -1
  835. package/dist/types/parser/bitmark/peg/contentProcessors/GapChainContentProcessor.d.ts +0 -6
  836. package/dist/types/parser/bitmark/peg/contentProcessors/GapChainContentProcessor.d.ts.map +0 -1
  837. package/dist/types/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.d.ts +0 -5
  838. package/dist/types/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.d.ts.map +0 -1
  839. package/dist/types/parser/bitmark/peg/contentProcessors/InternalCommentTagContentProcessor.d.ts +0 -4
  840. package/dist/types/parser/bitmark/peg/contentProcessors/InternalCommentTagContentProcessor.d.ts.map +0 -1
  841. package/dist/types/parser/bitmark/peg/contentProcessors/ItemLeadChainContentProcessor.d.ts +0 -5
  842. package/dist/types/parser/bitmark/peg/contentProcessors/ItemLeadChainContentProcessor.d.ts.map +0 -1
  843. package/dist/types/parser/bitmark/peg/contentProcessors/ItemLeadTagContentProcessor.d.ts +0 -5
  844. package/dist/types/parser/bitmark/peg/contentProcessors/ItemLeadTagContentProcessor.d.ts.map +0 -1
  845. package/dist/types/parser/bitmark/peg/contentProcessors/MarkChainContentProcessor.d.ts +0 -6
  846. package/dist/types/parser/bitmark/peg/contentProcessors/MarkChainContentProcessor.d.ts.map +0 -1
  847. package/dist/types/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.d.ts +0 -5
  848. package/dist/types/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.d.ts.map +0 -1
  849. package/dist/types/parser/bitmark/peg/contentProcessors/MarkTagContentProcessor.d.ts +0 -4
  850. package/dist/types/parser/bitmark/peg/contentProcessors/MarkTagContentProcessor.d.ts.map +0 -1
  851. package/dist/types/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.d.ts +0 -5
  852. package/dist/types/parser/bitmark/peg/contentProcessors/PersonChainContentProcessor.d.ts.map +0 -1
  853. package/dist/types/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.d.ts +0 -5
  854. package/dist/types/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.d.ts.map +0 -1
  855. package/dist/types/parser/bitmark/peg/contentProcessors/RatingLevelChainContentProcessor.d.ts +0 -5
  856. package/dist/types/parser/bitmark/peg/contentProcessors/RatingLevelChainContentProcessor.d.ts.map +0 -1
  857. package/dist/types/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.d.ts +0 -5
  858. package/dist/types/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.d.ts.map +0 -1
  859. package/dist/types/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.d.ts +0 -14
  860. package/dist/types/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.d.ts.map +0 -1
  861. package/dist/types/parser/bitmark/peg/contentProcessors/ServingsChainContentProcessor.d.ts +0 -5
  862. package/dist/types/parser/bitmark/peg/contentProcessors/ServingsChainContentProcessor.d.ts.map +0 -1
  863. package/dist/types/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.d.ts +0 -5
  864. package/dist/types/parser/bitmark/peg/contentProcessors/TechnicalTermChainContentProcessor.d.ts.map +0 -1
  865. package/dist/types/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.d.ts +0 -11
  866. package/dist/types/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.d.ts.map +0 -1
  867. package/dist/types/parser/bitmark/peg/contentProcessors/TrueFalseChainContentProcessor.d.ts +0 -6
  868. package/dist/types/parser/bitmark/peg/contentProcessors/TrueFalseChainContentProcessor.d.ts.map +0 -1
  869. package/dist/types/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.d.ts +0 -4
  870. package/dist/types/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.d.ts.map +0 -1
  871. package/dist/types/parser/json/JsonParser.d.ts +0 -59
  872. package/dist/types/parser/json/JsonParser.d.ts.map +0 -1
  873. package/dist/types/parser/text/TextParser.d.ts +0 -55
  874. package/dist/types/parser/text/TextParser.d.ts.map +0 -1
  875. package/dist/types/parser/text/peg/TextPegParser.d.ts +0 -8
  876. package/dist/types/parser/text/peg/TextPegParser.d.ts.map +0 -1
  877. package/dist/types/utils/ArrayUtils.d.ts +0 -25
  878. package/dist/types/utils/ArrayUtils.d.ts.map +0 -1
  879. package/dist/types/utils/BitUtils.d.ts +0 -30
  880. package/dist/types/utils/BitUtils.d.ts.map +0 -1
  881. package/dist/types/utils/BooleanUtils.d.ts +0 -30
  882. package/dist/types/utils/BooleanUtils.d.ts.map +0 -1
  883. package/dist/types/utils/FileUtils.d.ts +0 -12
  884. package/dist/types/utils/FileUtils.d.ts.map +0 -1
  885. package/dist/types/utils/NumberUtils.d.ts +0 -47
  886. package/dist/types/utils/NumberUtils.d.ts.map +0 -1
  887. package/dist/types/utils/ObjectUtils.d.ts +0 -197
  888. package/dist/types/utils/ObjectUtils.d.ts.map +0 -1
  889. package/dist/types/utils/StringUtils.d.ts +0 -77
  890. package/dist/types/utils/StringUtils.d.ts.map +0 -1
  891. package/dist/types/utils/UrlUtils.d.ts +0 -7
  892. package/dist/types/utils/UrlUtils.d.ts.map +0 -1
  893. package/dist/types/utils/env/Env.d.ts +0 -39
  894. package/dist/types/utils/env/Env.d.ts.map +0 -1
  895. package/dist/types/utils/env/Environment.d.ts +0 -21
  896. package/dist/types/utils/env/Environment.d.ts.map +0 -1
  897. package/dist/types/utils/env/Os.d.ts +0 -19
  898. package/dist/types/utils/env/Os.d.ts.map +0 -1
  899. package/dist/types/utils/env/Version.d.ts +0 -10
  900. package/dist/types/utils/env/Version.d.ts.map +0 -1
  901. package/dist/types/utils/env/userAgent.d.ts +0 -11
  902. package/dist/types/utils/env/userAgent.d.ts.map +0 -1
  903. package/dist/types/utils/polyfill/fs.d.ts +0 -6
  904. package/dist/types/utils/polyfill/fs.d.ts.map +0 -1
@@ -1,1584 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __rest = (this && this.__rest) || function (s, e) {
12
- var t = {};
13
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
14
- t[p] = s[p];
15
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
16
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
17
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
18
- t[p[i]] = s[p[i]];
19
- }
20
- return t;
21
- };
22
- var __importDefault = (this && this.__importDefault) || function (mod) {
23
- return (mod && mod.__esModule) ? mod : { "default": mod };
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.JsonGenerator = void 0;
27
- const structured_clone_1 = __importDefault(require("@ungap/structured-clone"));
28
- const Ast_1 = require("../../ast/Ast");
29
- const Breakscape_1 = require("../../breakscaping/Breakscape");
30
- const Config_1 = require("../../config/Config");
31
- const NodeType_1 = require("../../model/ast/NodeType");
32
- const BitType_1 = require("../../model/enum/BitType");
33
- const BitmarkVersion_1 = require("../../model/enum/BitmarkVersion");
34
- const BodyBitType_1 = require("../../model/enum/BodyBitType");
35
- const ExampleType_1 = require("../../model/enum/ExampleType");
36
- const ResourceTag_1 = require("../../model/enum/ResourceTag");
37
- const TextFormat_1 = require("../../model/enum/TextFormat");
38
- const TextLocation_1 = require("../../model/enum/TextLocation");
39
- const TextNodeType_1 = require("../../model/enum/TextNodeType");
40
- const TextParser_1 = require("../../parser/text/TextParser");
41
- const BooleanUtils_1 = require("../../utils/BooleanUtils");
42
- const NumberUtils_1 = require("../../utils/NumberUtils");
43
- const AstWalkerGenerator_1 = require("../AstWalkerGenerator");
44
- const TextGenerator_1 = require("../text/TextGenerator");
45
- const MOVE_BODY_RECURSION_LIMIT = 5000;
46
- const DEFAULT_OPTIONS = {
47
- // debugGenerationInline: true,
48
- };
49
- /**
50
- * Generate bitmark JSON from a bitmark AST
51
- *
52
- *
53
- */
54
- class JsonGenerator extends AstWalkerGenerator_1.AstWalkerGenerator {
55
- /**
56
- * Generate bitmark JSON from a bitmark AST
57
- *
58
- * @param writer - destination for the output
59
- * @param options - JSON generation options
60
- */
61
- constructor(writer, options) {
62
- var _a, _b;
63
- super();
64
- this.ast = new Ast_1.Ast();
65
- this.textParser = new TextParser_1.TextParser();
66
- // State
67
- this.json = [];
68
- this.bitWrapperJson = {};
69
- this.bitJson = {};
70
- this.textDefault = Breakscape_1.Breakscape.EMPTY_STRING;
71
- this.bodyDefault = Breakscape_1.Breakscape.EMPTY_STRING;
72
- this.bodyJson = this.bodyDefault;
73
- this.placeholderIndex = 0;
74
- // Bind callbacks
75
- this.enter = this.enter.bind(this);
76
- this.between = this.between.bind(this);
77
- this.exit = this.exit.bind(this);
78
- this.leaf = this.leaf.bind(this);
79
- this.bodyBitCallback = this.bodyBitCallback.bind(this);
80
- this.bitmarkVersion = (_a = BitmarkVersion_1.BitmarkVersion.fromValue(options === null || options === void 0 ? void 0 : options.bitmarkVersion)) !== null && _a !== void 0 ? _a : BitmarkVersion_1.DEFAULT_BITMARK_VERSION;
81
- this.textParserVersion = this.textParser.version();
82
- this.options = Object.assign(Object.assign({}, DEFAULT_OPTIONS), options === null || options === void 0 ? void 0 : options.jsonOptions);
83
- this.debugGenerationInline = (_b = this.options.debugGenerationInline) !== null && _b !== void 0 ? _b : false;
84
- this.jsonPrettifySpace = this.options.prettify === true ? 2 : this.options.prettify || undefined;
85
- // Set defaults according to bitmark version
86
- if (this.bitmarkVersion === BitmarkVersion_1.BitmarkVersion.v2) {
87
- if (this.options.textAsPlainText === undefined) {
88
- this.options.textAsPlainText = true;
89
- }
90
- }
91
- else {
92
- if (this.options.textAsPlainText === undefined) {
93
- this.options.textAsPlainText = false;
94
- }
95
- }
96
- // Create the text generator for generating v2 texts
97
- this.textGenerator = new TextGenerator_1.TextGenerator(BitmarkVersion_1.BitmarkVersion.v2, {
98
- // writeCallback: this.write,
99
- bodyBitCallback: this.bodyBitCallback,
100
- debugGenerationInline: this.debugGenerationInline,
101
- });
102
- this.writer = writer;
103
- this.generatePropertyHandlers();
104
- }
105
- /**
106
- * Generate bitmark markup from bitmark AST
107
- *
108
- * @param ast bitmark AST
109
- */
110
- generate(ast) {
111
- return __awaiter(this, void 0, void 0, function* () {
112
- // Reset the state
113
- this.resetState();
114
- // Open the writer
115
- yield this.writer.open();
116
- // Walk the bitmark AST
117
- this.walkAndWrite(ast);
118
- // Write the JSON object to file
119
- this.write(JSON.stringify(this.json, null, this.jsonPrettifySpace));
120
- // Close the writer
121
- yield this.writer.close();
122
- });
123
- }
124
- /**
125
- * Generate text from a bitmark text AST synchronously
126
- *
127
- * @param ast bitmark text AST
128
- */
129
- generateSync(ast) {
130
- // Reset the state
131
- this.resetState();
132
- // Open the writer
133
- this.writer.openSync();
134
- // Walk the bitmark AST
135
- this.walkAndWrite(ast);
136
- // Close the writer
137
- this.writer.closeSync();
138
- }
139
- resetState() {
140
- this.json = [];
141
- this.bitWrapperJson = {};
142
- this.bitJson = {};
143
- this.textDefault = this.options.textAsPlainText ? Breakscape_1.Breakscape.EMPTY_STRING : [];
144
- this.bodyDefault = this.options.textAsPlainText ? Breakscape_1.Breakscape.EMPTY_STRING : [];
145
- this.bodyJson = this.bodyDefault;
146
- this.listItem = undefined;
147
- this.placeholderIndex = 0;
148
- this.printed = false;
149
- }
150
- walkAndWrite(ast) {
151
- // Walk the bitmark AST
152
- this.ast.walk(ast, NodeType_1.NodeType.bitmarkAst, this, undefined);
153
- }
154
- //
155
- // NODE HANDLERS
156
- //
157
- //
158
- // Non-Terminal nodes (branches)
159
- //
160
- // bitmark
161
- enter_bitmarkAst(_node, _route) {
162
- // Reset the JSON
163
- this.json = [];
164
- }
165
- exit_bitmarkAst(_node, _route) {
166
- // Convert all bitmark text to plain text if required
167
- if (this.options.textAsPlainText) {
168
- // Convert all bitmark text to plain text
169
- this.convertAllBitmarkTextsToStringsForPlainText(this.json);
170
- }
171
- // Walk the entire json object and remove all' '_xxx' properties
172
- // (which are used to store temporary data during the generation process)
173
- this.removeTemporaryProperties(this.json);
174
- }
175
- // bitmarkAst -> bits
176
- // bitmarkAst -> bits -> bitsValue
177
- enter_bitsValue(node, _route) {
178
- var _a, _b;
179
- const bit = node.value;
180
- // Reset
181
- this.bitWrapperJson = {
182
- //
183
- };
184
- this.json.push(this.bitWrapperJson);
185
- this.bitJson = this.createBitJson(bit);
186
- this.bitWrapperJson.bit = this.bitJson;
187
- // Handle example at the root level - this is bit dependent; configuration is in the bit metadata
188
- // There is same logic here to select the correct default value of the example is the default is
189
- // required, and this is bit depenedent.
190
- // This is ugly, but it is even uglier if the defaults at set in the AST.
191
- const bitConfig = Config_1.Config.getBitConfig(bit.bitType);
192
- const textFormat = this.getTextFormat(_route);
193
- const hasRootExample = !!bitConfig.rootExampleType;
194
- const isBoolean = bitConfig.rootExampleType === ExampleType_1.ExampleType.boolean;
195
- if (hasRootExample) {
196
- // Calculate the value of the default example
197
- let defaultExample;
198
- if (isBoolean) {
199
- // Boolean example
200
- defaultExample = true;
201
- if (Config_1.Config.isOfBitType(bit.bitType, BitType_1.BitType.trueFalse1)) {
202
- if (((_b = (_a = bit.cardNode) === null || _a === void 0 ? void 0 : _a.statement) === null || _b === void 0 ? void 0 : _b.isCorrect) !== undefined) {
203
- defaultExample = bit.cardNode.statement.isCorrect;
204
- }
205
- }
206
- }
207
- else {
208
- // String example
209
- // Don't use sampleSolution as the default example for conversation bits
210
- // See: https://github.com/getMoreBrain/cosmic/issues/7293
211
- // defaultExample = (ArrayUtils.asSingle(bit.sampleSolution) as string) ?? '';
212
- defaultExample = 'true';
213
- }
214
- const exampleRes = this.toExample(bit, {
215
- defaultExample,
216
- isBoolean,
217
- textFormat,
218
- });
219
- this.bitJson.isExample = exampleRes.isExample;
220
- this.bitJson.example = exampleRes.example;
221
- }
222
- else if (bit.isExample) {
223
- this.bitJson.isExample = true;
224
- }
225
- // Reset the placeholder index
226
- this.placeholderIndex = 0;
227
- }
228
- exit_bitsValue(_node, _route) {
229
- // Move isExample / example to end of bit JSON from beginning
230
- const isExample = this.bitJson.isExample;
231
- const example = this.bitJson.example;
232
- delete this.bitJson.isExample;
233
- delete this.bitJson.example;
234
- this.bitJson.isExample = isExample;
235
- this.bitJson.example = example;
236
- // Clean up the bit JSON, removing any unwanted values
237
- this.cleanBitJson(this.bitJson);
238
- }
239
- // bitmarkAst -> bits -> bitsValue -> imageSource
240
- enter_imageSource(node, route) {
241
- return this.standardHandler(node, route, NodeType_1.NodeType.bitsValue, { array: false });
242
- }
243
- // bitmarkAst -> bits -> bitsValue -> person
244
- enter_person(node, route) {
245
- const bitType = this.getBitType(route);
246
- let keyOverride = 'person';
247
- if (Config_1.Config.isOfBitType(bitType, BitType_1.BitType.conversationLeft1)) {
248
- // Use the legacy partner property in the JSON for conversation bits, so change to person is backwards compatible
249
- keyOverride = 'partner';
250
- }
251
- return this.standardHandler(node, route, NodeType_1.NodeType.bitsValue, { array: false, keyOverride });
252
- }
253
- // bitmarkAst -> bits -> bitsValue -> ratingLevelStart
254
- enter_ratingLevelStart(node, route) {
255
- return this.standardHandler(node, route, NodeType_1.NodeType.bitsValue, { array: false });
256
- }
257
- // bitmarkAst -> bits -> bitsValue -> ratingLevelEnd
258
- enter_ratingLevelEnd(node, route) {
259
- return this.standardHandler(node, route, NodeType_1.NodeType.bitsValue, { array: false });
260
- }
261
- // bitmarkAst -> bits -> bitsValue -> productId
262
- enter_productId(node, route) {
263
- const productIds = node.value;
264
- // Ignore item that is not at the correct level
265
- const parent = this.getParentNode(route);
266
- if ((parent === null || parent === void 0 ? void 0 : parent.key) !== NodeType_1.NodeType.bitsValue)
267
- return true;
268
- const bitType = this.getBitType(route);
269
- if (bitType === BitType_1.BitType.module) {
270
- this.addProperty(this.bitJson, 'productId', productIds, { array: true });
271
- }
272
- else if (productIds.length > 0) {
273
- this.addProperty(this.bitJson, 'productId', productIds[productIds.length - 1], { array: false });
274
- }
275
- // Stop traversal of this branch
276
- return false;
277
- }
278
- // bitmarkAst -> bits -> bitsValue -> markConfig
279
- enter_markConfig(_node, _route) {
280
- // Handler so markConfig is not processed by the default property handler
281
- // Continue traversal
282
- return true;
283
- }
284
- // bitmarkAst -> bits -> bitsValue -> markConfig -> markConfigValue
285
- enter_markConfigValue(node, route) {
286
- const markJson = node.value;
287
- // Ignore item that is not at the correct level
288
- const parent = this.getParentNode(route);
289
- if ((parent === null || parent === void 0 ? void 0 : parent.key) !== NodeType_1.NodeType.markConfig)
290
- return true;
291
- if (!this.bitJson.marks)
292
- this.bitJson.marks = [];
293
- this.bitJson.marks.push(markJson);
294
- // Stop traversal of this branch
295
- return false;
296
- }
297
- // bitmarkAst -> bits -> bitsValue -> item
298
- enter_item(node, route) {
299
- return this.standardHandler(node, route, NodeType_1.NodeType.bitsValue, { array: true });
300
- }
301
- // bitmarkAst -> bits -> bitsValue -> lead
302
- enter_lead(node, route) {
303
- return this.standardHandler(node, route, NodeType_1.NodeType.bitsValue, { array: true });
304
- }
305
- // bitmarkAst -> bits -> bitsValue -> pageNumber
306
- enter_pageNumber(node, route) {
307
- return this.standardHandler(node, route, NodeType_1.NodeType.bitsValue, { array: true });
308
- }
309
- // bitmarkAst -> bits -> bitsValue -> marginNumber
310
- enter_marginNumber(node, route) {
311
- return this.standardHandler(node, route, NodeType_1.NodeType.bitsValue, { array: true });
312
- }
313
- // bitmarkAst -> bits -> bitsValue -> hint
314
- enter_hint(node, route) {
315
- return this.standardHandler(node, route, NodeType_1.NodeType.bitsValue, { array: true });
316
- }
317
- // bitmarkAst -> bits -> bitsValue -> instruction
318
- enter_instruction(node, route) {
319
- return this.standardHandler(node, route, NodeType_1.NodeType.bitsValue, { array: true });
320
- }
321
- // bitmarkAst -> bits -> bitsValue -> title
322
- enter_title(node, route) {
323
- // // Ignore title that are not at the bit or card node level as they are handled elsewhere
324
- // const parent = this.getParentNode(route);
325
- // if (parent?.key !== NodeType.bitsValue && parent?.key !== NodeType.cardNode) return;
326
- // this.bitJson.title = node.value;
327
- return this.standardHandler(node, route, [NodeType_1.NodeType.bitsValue, NodeType_1.NodeType.cardNode], { array: true });
328
- }
329
- // bitmarkAst -> bits -> bitsValue -> subtitle
330
- enter_subtitle(node, route) {
331
- // this.bitJson.subtitle = node.value;
332
- return this.standardHandler(node, route, NodeType_1.NodeType.bitsValue, { array: true });
333
- }
334
- // bitmarkAst -> bits -> bitsValue -> caption
335
- enter_caption(node, route) {
336
- return this.standardHandler(node, route, NodeType_1.NodeType.bitsValue, { array: true });
337
- }
338
- // bitmarkAst -> bits -> bitsValue -> width
339
- enter_width(node, route) {
340
- var _a;
341
- let value = node.value;
342
- const bitType = this.getBitType(route);
343
- const parent = this.getParentNode(route);
344
- if ((parent === null || parent === void 0 ? void 0 : parent.key) === NodeType_1.NodeType.bitsValue && Config_1.Config.isOfBitType(bitType, BitType_1.BitType.extractorBlock)) {
345
- value = (_a = NumberUtils_1.NumberUtils.asNumber(value, 0)) !== null && _a !== void 0 ? _a : 0;
346
- }
347
- // Add the property
348
- return this.standardHandler(node, route, undefined, { array: false, valueOverride: value });
349
- }
350
- // bitmarkAst -> bits -> bitsValue -> height
351
- enter_height(node, route) {
352
- var _a;
353
- let value = node.value;
354
- const bitType = this.getBitType(route);
355
- const parent = this.getParentNode(route);
356
- if ((parent === null || parent === void 0 ? void 0 : parent.key) === NodeType_1.NodeType.bitsValue && Config_1.Config.isOfBitType(bitType, BitType_1.BitType.extractorBlock)) {
357
- value = (_a = NumberUtils_1.NumberUtils.asNumber(value, 0)) !== null && _a !== void 0 ? _a : 0;
358
- }
359
- // Add the property
360
- return this.standardHandler(node, route, undefined, { array: false, valueOverride: value });
361
- }
362
- // bitmarkAst -> bits -> bitsValue -> extraProperties
363
- enter_extraProperties(node, _route) {
364
- const extraProperties = node.value;
365
- if (!this.options.excludeUnknownProperties && extraProperties) {
366
- for (const [key, values] of Object.entries(extraProperties)) {
367
- let k = key;
368
- if (Object.prototype.hasOwnProperty.call(this.bitJson, key)) {
369
- k = `_${key}`;
370
- }
371
- this.addProperty(this.bitJson, k, values, { array: true });
372
- }
373
- }
374
- }
375
- // bitmarkAst -> bits -> bitsValue -> cardNode -> cardBits -> cardBitsValue
376
- enter_cardBitsValue(node, route) {
377
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
378
- const cardBit = node.value;
379
- // How cardBits are handled depends on the bit type
380
- const bitType = this.getBitType(route);
381
- if (!bitType)
382
- return;
383
- let listItems;
384
- if (bitType === BitType_1.BitType.bookReferenceList) {
385
- if (!this.bitJson.bookReferences)
386
- this.bitJson.bookReferences = [];
387
- const bookReference = {};
388
- this.addProperty(bookReference, 'lang', cardBit.lang, { array: false });
389
- this.addProperty(bookReference, 'refAuthor', (_a = cardBit.refAuthor) !== null && _a !== void 0 ? _a : [], { array: true });
390
- this.addProperty(bookReference, 'refBookTitle', (_b = cardBit.refBookTitle) !== null && _b !== void 0 ? _b : [], { array: false });
391
- this.addProperty(bookReference, 'refPublisher', (_c = cardBit.refPublisher) !== null && _c !== void 0 ? _c : [], { array: true });
392
- this.addProperty(bookReference, 'refPublicationYear', (_d = cardBit.refPublicationYear) !== null && _d !== void 0 ? _d : [], { array: false });
393
- this.addProperty(bookReference, 'citationStyle', (_e = cardBit.citationStyle) !== null && _e !== void 0 ? _e : [], { array: false });
394
- this.bitJson.bookReferences.push(bookReference);
395
- }
396
- else {
397
- // Create the listItems / sections if not already created
398
- if (bitType === BitType_1.BitType.pageFooter) {
399
- if (!this.bitJson.sections)
400
- this.bitJson.sections = [];
401
- listItems = this.bitJson.sections;
402
- }
403
- else {
404
- if (!this.bitJson.listItems)
405
- this.bitJson.listItems = [];
406
- listItems = this.bitJson.listItems;
407
- }
408
- // Create this list item
409
- this.listItem = {
410
- item: ((_f = cardBit.item) !== null && _f !== void 0 ? _f : []),
411
- lead: ((_g = cardBit.lead) !== null && _g !== void 0 ? _g : []),
412
- hint: ((_h = cardBit.hint) !== null && _h !== void 0 ? _h : []),
413
- instruction: ((_j = cardBit.instruction) !== null && _j !== void 0 ? _j : []),
414
- // ...this.toItemLeadHintInstruction(node.value),
415
- body: this.bodyDefault,
416
- };
417
- // Delete unwanted properties
418
- // const nv = node.value;
419
- // const li: Partial<ListItemJson> = this.listItem;
420
- listItems.push(this.listItem);
421
- }
422
- }
423
- exit_cardBitsValue(_node, _route) {
424
- this.listItem = undefined;
425
- }
426
- // bitmarkAst -> bits -> bitsValue -> body
427
- enter_body(node, route) {
428
- const value = node.value;
429
- const parent = this.getParentNode(route);
430
- if (!parent)
431
- return false;
432
- const textFormat = this.getTextFormat(route);
433
- const isBitmarkText = textFormat === TextFormat_1.TextFormat.bitmarkText;
434
- this.bodyJson = value.body;
435
- // Set the correct body property
436
- if (parent.key === NodeType_1.NodeType.bitsValue) {
437
- // Body is at the bit level
438
- this.bitJson.body = this.bodyJson;
439
- const bodyIsBitmarkText = isBitmarkText && this.isBitmarkText(this.bodyJson);
440
- // Convert the body to plain text if required
441
- if (this.options.textAsPlainText && bodyIsBitmarkText) {
442
- const textBody = this.textGenerator.generateSync(this.bodyJson, textFormat, TextLocation_1.TextLocation.body, {
443
- noBreakscaping: true,
444
- });
445
- this.bitJson.body = (textBody !== null && textBody !== void 0 ? textBody : '').trim();
446
- }
447
- else if (bodyIsBitmarkText) {
448
- // If the body is bitmark text, convert the body bits to move their attributes to the attrs property
449
- this.bitJson.body = this.moveBodyBitPropertiesToAttrs(this.bodyJson);
450
- }
451
- }
452
- else if (parent.key === NodeType_1.NodeType.cardBitsValue) {
453
- // Body is at the list item (card bit) level
454
- if (this.listItem)
455
- this.listItem.body = this.bodyJson;
456
- }
457
- // Stop traversal of this branch
458
- return false;
459
- }
460
- bodyBitCallback(bodyBit, _index, _route) {
461
- // console.log('bodyBitCallback', bodyBit, index, route);
462
- var _a;
463
- const placeholder = `{${this.placeholderIndex}}`;
464
- this.placeholderIndex++;
465
- this.bitJson.placeholders = (_a = this.bitJson.placeholders) !== null && _a !== void 0 ? _a : {};
466
- this.bitJson.placeholders[placeholder] = bodyBit;
467
- return placeholder;
468
- }
469
- /**
470
- * Move all properties of body bits to the attrs property.
471
- * This function is called recursively to process all body bits in the body tree.
472
- *
473
- * NOTE: Internally, the body bit is stored as it appears in bitmark v2, but in v3 all the properties
474
- * should be in the `attrs` property. The properies are only moved to 'attrs' for the JSON output
475
- *
476
- * The original body bit is not modified.
477
- * The function returns a new body bit with the properties moved.
478
- *
479
- * @param nodes the body to process, or the subtree to process
480
- * @param recursion leave as default, used for recursion only
481
- * @returns
482
- */
483
- moveBodyBitPropertiesToAttrs(nodes, recursion = 0) {
484
- if (recursion === 0) {
485
- nodes = (0, structured_clone_1.default)(nodes);
486
- }
487
- else if (recursion > MOVE_BODY_RECURSION_LIMIT) {
488
- throw new Error('Recursion limit exceeded');
489
- }
490
- for (const node of nodes) {
491
- if (node.type !== BodyBitType_1.BodyBitType.text && BodyBitType_1.BodyBitType.values().includes(node.type)) {
492
- const bodyBit = node;
493
- bodyBit.attrs = {};
494
- // Move all properties except type to the attrs property
495
- for (const [key, value] of Object.entries(bodyBit)) {
496
- if (key === 'type' || key === 'attrs')
497
- continue;
498
- bodyBit.attrs[key] = value;
499
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
500
- delete bodyBit[key];
501
- }
502
- }
503
- else if (Array.isArray(node.content)) {
504
- recursion++;
505
- this.moveBodyBitPropertiesToAttrs(node.content, recursion);
506
- }
507
- }
508
- return nodes;
509
- }
510
- // bitmarkAst -> bits -> bitsValue -> footer
511
- enter_footer(node, route) {
512
- return this.standardHandler(node, route, undefined, { array: true, valueOverride: node.value.footer });
513
- }
514
- // bitmarkAst -> bits -> bitsValue -> cardNode -> elements
515
- enter_elements(node, route) {
516
- return this.standardHandler(node, route, undefined, { array: true });
517
- }
518
- // bitmarkAst -> bits -> bitsValue -> cardNode -> flashcards
519
- enter_flashcards(node, route) {
520
- return this.standardHandler(node, route, NodeType_1.NodeType.cardNode, { array: true, keyOverride: 'cards' });
521
- }
522
- // bitmarkAst -> bits -> bitsValue -> cardNode -> definitions
523
- enter_definitions(node, route) {
524
- return this.standardHandler(node, route, NodeType_1.NodeType.cardNode, { array: true });
525
- }
526
- // bitmarkAst -> bits -> bitsValue -> statement
527
- enter_statement(node, route) {
528
- var _a, _b;
529
- const statement = node.value;
530
- // Ignore statement that is not at the cardNode level as it is handled elsewhere
531
- const parent = this.getParentNode(route);
532
- if ((parent === null || parent === void 0 ? void 0 : parent.key) !== NodeType_1.NodeType.cardNode)
533
- return;
534
- if (statement) {
535
- this.bitJson.statement = (_a = statement.statement) !== null && _a !== void 0 ? _a : '';
536
- this.bitJson.isCorrect = (_b = statement.isCorrect) !== null && _b !== void 0 ? _b : false;
537
- this.bitJson.example = statement.example;
538
- this.bitJson.isExample = statement.isExample;
539
- }
540
- }
541
- // bitmarkAst -> bits -> bitsValue -> cardNode -> statements -> statementsValue
542
- enter_statements(node, route) {
543
- return this.standardHandler(node, route, NodeType_1.NodeType.cardNode, { array: true });
544
- }
545
- // bitmarkAst -> bits -> bitsValue -> choices
546
- // X bitmarkAst -> bits -> bitsValue -> cardNode -> quizzes -> quizzesValue -> choices
547
- // X bitmarkAst -> bits -> bitsValue -> cardNode -> feedbacks -> feedbacksValue -> choices
548
- enter_choices(node, route) {
549
- return this.standardHandler(node, route, NodeType_1.NodeType.cardNode, { array: true });
550
- }
551
- // bitmarkAst -> bits -> bitsValue -> responses
552
- // X bitmarkAst -> bits -> bitsValue -> cardNode -> quizzes -> quizzesValue -> responses
553
- enter_responses(node, route) {
554
- return this.standardHandler(node, route, NodeType_1.NodeType.cardNode, { array: true });
555
- }
556
- // bitmarkAst -> bits -> bitsValue -> cardNode -> feedbacks
557
- enter_feedbacks(node, route) {
558
- return this.standardHandler(node, route, NodeType_1.NodeType.cardNode, { array: true });
559
- }
560
- // bitmarkAst -> bits -> bitsValue -> cardNode -> quizzes
561
- enter_quizzes(node, route) {
562
- return this.standardHandler(node, route, NodeType_1.NodeType.cardNode, { array: true });
563
- }
564
- // bitmarkAst -> bits -> bitsValue -> cardNode -> heading
565
- enter_heading(node, route) {
566
- return this.standardHandler(node, route, undefined, { array: false });
567
- }
568
- // bitmarkAst -> bits -> bitsValue -> cardNode -> pairs
569
- enter_pairs(node, route) {
570
- return this.standardHandler(node, route, NodeType_1.NodeType.cardNode, { array: true });
571
- }
572
- // bitmarkAst -> bits -> bitsValue -> cardNode -> matrix
573
- enter_matrix(node, route) {
574
- return this.standardHandler(node, route, NodeType_1.NodeType.cardNode, { array: true });
575
- }
576
- // bitmarkAst -> bits -> bitsValue -> cardNode -> pronunciationTable
577
- enter_pronunciationTable(node, route) {
578
- return this.standardHandler(node, route, NodeType_1.NodeType.cardNode, { array: false });
579
- }
580
- // bitmarkAst -> bits -> bitsValue -> cardNode -> table
581
- enter_table(node, route) {
582
- return this.standardHandler(node, route, NodeType_1.NodeType.cardNode, { array: false });
583
- }
584
- // bitmarkAst -> bits -> bitsValue -> cardNode -> questions
585
- enter_questions(node, route) {
586
- return this.standardHandler(node, route, NodeType_1.NodeType.cardNode, { array: true });
587
- }
588
- // bitmarkAst -> bits -> bitsValue -> cardNode -> botResponses
589
- enter_botResponses(node, route) {
590
- return this.standardHandler(node, route, NodeType_1.NodeType.cardNode, { array: true, keyOverride: 'responses' });
591
- }
592
- // bitmarkAst -> bits -> bitsValue -> cardNode -> ingredients -> ingredientsValue
593
- enter_ingredients(node, route) {
594
- return this.standardHandler(node, route, NodeType_1.NodeType.cardNode, { array: true });
595
- }
596
- // bitmarkAst -> bits -> bitsValue -> cardNode -> captionDefinitionList
597
- enter_captionDefinitionList(node, route) {
598
- return this.standardHandler(node, route, NodeType_1.NodeType.cardNode, { array: false });
599
- }
600
- // bitmarkAst -> bits -> bitsValue -> backgroundWallpaper
601
- enter_backgroundWallpaper(node, route) {
602
- return this.standardHandler(node, route, NodeType_1.NodeType.bitsValue, { array: false });
603
- }
604
- // bitmarkAst -> bits -> bitsValue -> imagePlaceholder
605
- enter_imagePlaceholder(node, route) {
606
- return this.standardHandler(node, route, NodeType_1.NodeType.bitsValue, { array: false });
607
- }
608
- // bitmarkAst -> bits -> bitsValue -> resources
609
- enter_resources(node, route) {
610
- var _a, _b;
611
- const resources = node.value;
612
- const bitType = this.getBitType(route);
613
- const resourceType = this.getResourceType(route);
614
- if (!resources || !bitType)
615
- return true;
616
- let resourceJson;
617
- const bitConfig = Config_1.Config.getBitConfig(bitType);
618
- const bitResourcesConfig = Config_1.Config.getBitResourcesConfig(bitType, resourceType);
619
- const comboMap = bitResourcesConfig.comboResourceTagTypesMap;
620
- if (bitResourcesConfig.comboResourceTagTypesMap.size > 0) {
621
- // The resource is a combo resource
622
- // Extract the resource types from the combo resource
623
- // NOTE: There should only ever be one combo resource per bit, but the code can handle multiple
624
- // except for overwriting resourceJson
625
- for (const [comboTagType, resourceTags] of comboMap.entries()) {
626
- // Create the combo resource wrapper
627
- const wrapper = {
628
- type: comboTagType,
629
- __typeAlias: comboTagType,
630
- };
631
- // For each of the resources in this combo resource, find the actual resource and add it to the JSON
632
- for (const rt of resourceTags) {
633
- const r = resources.find((r) => r.__typeAlias === rt);
634
- // Extract everything except the type from the resource
635
- if (r) {
636
- const tagConfig = Config_1.Config.getTagConfigForTag(bitConfig.tags, r.__typeAlias);
637
- const key = (_a = tagConfig === null || tagConfig === void 0 ? void 0 : tagConfig.jsonKey) !== null && _a !== void 0 ? _a : r.__typeAlias;
638
- const tag = (_b = tagConfig === null || tagConfig === void 0 ? void 0 : tagConfig.tag) !== null && _b !== void 0 ? _b : r.__typeAlias;
639
- const json = r.__typeAlias === tag ? r : undefined;
640
- if (json) {
641
- for (const [k, v] of Object.entries(json)) {
642
- if (k !== 'type') {
643
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
644
- wrapper[key] = v;
645
- }
646
- }
647
- }
648
- }
649
- }
650
- resourceJson = wrapper;
651
- }
652
- }
653
- else if (Config_1.Config.isOfBitType(bitType, [BitType_1.BitType.imagesLogoGrave, BitType_1.BitType.prototypeImages])) {
654
- // The resource is a logo-grave / prototpye-images resource
655
- const images = [];
656
- for (const r of resources) {
657
- if (r.type === ResourceTag_1.ResourceTag.image) {
658
- images.push(r);
659
- }
660
- }
661
- if (bitType === BitType_1.BitType.imagesLogoGrave) {
662
- this.bitJson.logos = images;
663
- }
664
- else {
665
- this.bitJson.images = images;
666
- }
667
- }
668
- else {
669
- // This is a standard resource. If there is more than one resource, use the first one.
670
- // There should not be more than one because of validation
671
- if (resources.length >= 1) {
672
- resourceJson = resources[0]; // this.parseResourceToJson(bitType, resources[0]);
673
- }
674
- }
675
- this.bitJson.resource = resourceJson;
676
- return false;
677
- }
678
- // bitmarkAst -> bits -> bitsValue -> level
679
- leaf_level(node, route) {
680
- return this.standardHandler(node, route, NodeType_1.NodeType.bitsValue, { array: false });
681
- }
682
- // bitmarkAst -> bits -> bitsValue -> book (array)
683
- enter_book(node, route) {
684
- return this.standardHandler(node, route, NodeType_1.NodeType.bitsValue, { array: true });
685
- }
686
- // bitmarkAst -> bits -> bitsValue -> book (single)
687
- leaf_book(node, route) {
688
- return this.standardHandler(node, route, NodeType_1.NodeType.bitsValue, { array: false });
689
- }
690
- // bitmarkAst -> bits -> bitsValue -> anchor
691
- leaf_anchor(node, route) {
692
- return this.standardHandler(node, route, NodeType_1.NodeType.bitsValue, { array: false });
693
- }
694
- // bitmarkAst -> bits -> bitsValue -> reference
695
- leaf_reference(node, route) {
696
- return this.standardHandler(node, route, NodeType_1.NodeType.bitsValue, { array: false });
697
- }
698
- // bitmarkAst -> bits -> bitsValue -> referenceEnd
699
- leaf_referenceEnd(node, route) {
700
- return this.standardHandler(node, route, NodeType_1.NodeType.bitsValue, { array: false });
701
- }
702
- // bitmarkAst -> bits -> bitsValue -> markup
703
- leaf_markup(node, _route) {
704
- const bitmark = node.value;
705
- if (bitmark)
706
- this.bitWrapperJson.bitmark = bitmark;
707
- // Stop traversal of this branch
708
- return false;
709
- }
710
- // bitmarkAst -> bits -> bitsValue -> * -> internalComment
711
- enter_internalComment(_node, _route) {
712
- // Stop traversal of this branch, handled in enter_parser()
713
- return false;
714
- }
715
- // bitmarkAst -> bits -> bitsValue -> parser
716
- enter_parser(node, route) {
717
- const parser = node.value;
718
- const bitType = this.getBitType(route);
719
- const parent = this.getParentNode(route);
720
- if (parser && bitType) {
721
- const { version, excessResources: parserExcessResources, warnings, errors } = parser, parserRest = __rest(parser, ["version", "excessResources", "warnings", "errors"]);
722
- const bitmarkVersion = `${this.bitmarkVersion}`;
723
- const textParserVersion = this.textParserVersion;
724
- // Parse resources to JSON from AST
725
- let excessResources;
726
- if (Array.isArray(parserExcessResources) && parserExcessResources.length > 0) {
727
- excessResources = [];
728
- for (const r of parserExcessResources) {
729
- excessResources.push(r);
730
- }
731
- }
732
- // Extract internal comments from the AST and add to the parser
733
- const internalComments = this.getInternalComments(route);
734
- if ((parent === null || parent === void 0 ? void 0 : parent.key) === NodeType_1.NodeType.bitsValue) {
735
- // Bit level parser information
736
- this.bitWrapperJson.parser = Object.assign(Object.assign({ version,
737
- bitmarkVersion,
738
- textParserVersion,
739
- internalComments }, parserRest), { warnings,
740
- errors,
741
- excessResources });
742
- if (!this.options.enableWarnings) {
743
- // Remove warnings if not enabled
744
- delete this.bitWrapperJson.parser.warnings;
745
- }
746
- }
747
- else {
748
- // Top level parser information (not specific to a bit)
749
- // TODO - not sure where this error can be written
750
- // this.bitWrapperJson.parser = {
751
- // errors,
752
- // };
753
- }
754
- }
755
- }
756
- // bitmarkAst -> errors
757
- // protected enter_errors(node: NodeInfo, _route: NodeInfo[],
758
- // context: Context): void {
759
- // const errors = node.value as ParserError[] | undefined;
760
- // if (errors && errors.length > 0) {
761
- // // Complete bit is invalid
762
- // // TODO - not sure where this error can be written
763
- // // this.bitWrapperJson.parser = {
764
- // // errors,
765
- // // };
766
- // }
767
- // }
768
- //
769
- // Generated Node Handlers
770
- //
771
- /**
772
- * Generate the handlers for properties, as they are mostly the same, but not quite
773
- */
774
- generatePropertyHandlers() {
775
- var _a;
776
- const propertiesConfig = Config_1.Config.getRawPropertiesConfig();
777
- for (const propertyConfig of Object.values(propertiesConfig)) {
778
- const astKey = (_a = propertyConfig.astKey) !== null && _a !== void 0 ? _a : propertyConfig.tag;
779
- const funcName = `enter_${astKey}`;
780
- // Skip if the function already exists, allows for custom handlers
781
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
782
- if (typeof this[funcName] === 'function') {
783
- continue;
784
- }
785
- // Skip 'example' property as it is non-standard and handled elsewhere
786
- if (astKey === 'example')
787
- continue;
788
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
789
- this[funcName] = (node, route) => {
790
- var _a;
791
- const value = node.value;
792
- if (value == null)
793
- return;
794
- // if (key === 'progress') debugger;
795
- // Ignore any property that is not at the bit level as that will be handled by a different handler
796
- const parent = this.getParentNode(route);
797
- if ((parent === null || parent === void 0 ? void 0 : parent.key) !== NodeType_1.NodeType.bitsValue)
798
- return;
799
- // Convert key as needed
800
- const jsonKey = (_a = propertyConfig.jsonKey) !== null && _a !== void 0 ? _a : propertyConfig.tag;
801
- // Add the property
802
- this.addProperty(this.bitJson, jsonKey, value, { array: !propertyConfig.single });
803
- };
804
- // Bind this
805
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
806
- this[funcName] = this[funcName].bind(this);
807
- }
808
- }
809
- // // END NODE HANDLERS
810
- //
811
- // HELPER FUNCTIONS
812
- //
813
- /**
814
- * Default handler for properties.
815
- *
816
- * @param node the node
817
- * @param route the route to the node
818
- * @param parentNodeTypes the parent node types for which to handle the node
819
- * @returns
820
- */
821
- standardHandler(node, route, parentNodeTypes, options) {
822
- var _a, _b;
823
- // Ignore items not at the nodeType level
824
- if (parentNodeTypes) {
825
- const nodeTypeArray = Array.isArray(parentNodeTypes) ? parentNodeTypes : [parentNodeTypes];
826
- const parent = this.getParentNode(route);
827
- if (!(parent === null || parent === void 0 ? void 0 : parent.key) || !nodeTypeArray.includes(parent === null || parent === void 0 ? void 0 : parent.key))
828
- return true;
829
- }
830
- // Add the property
831
- this.addProperty(this.bitJson, (_a = options.keyOverride) !== null && _a !== void 0 ? _a : node.key, (_b = options.valueOverride) !== null && _b !== void 0 ? _b : node.value, options);
832
- // Stop traversal of this branch
833
- return false;
834
- }
835
- addProperty(
836
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
837
- target, name, values, options) {
838
- if (values !== undefined) {
839
- let finalValue;
840
- if (!Array.isArray(values))
841
- values = [values];
842
- const valuesArr = values;
843
- // if (valuesArr.length > 0) {
844
- if (!options.array && valuesArr.length >= 1) {
845
- finalValue = valuesArr[valuesArr.length - 1];
846
- }
847
- else {
848
- finalValue = valuesArr;
849
- }
850
- // }
851
- if (options.allowNull || finalValue != null) {
852
- target[name] = finalValue;
853
- }
854
- }
855
- }
856
- toExample(node, options) {
857
- const { isExample, example, __isDefaultExample } = node;
858
- const { defaultExample, isBoolean } = options;
859
- if (!isExample) {
860
- return {
861
- isExample: false,
862
- example: null,
863
- };
864
- }
865
- let exampleValue;
866
- if (__isDefaultExample) {
867
- exampleValue = isBoolean
868
- ? BooleanUtils_1.BooleanUtils.toBoolean(defaultExample)
869
- : this.convertBreakscapedStringToJsonText(defaultExample, options.textFormat, TextLocation_1.TextLocation.tag);
870
- }
871
- else {
872
- exampleValue = isBoolean
873
- ? BooleanUtils_1.BooleanUtils.toBoolean(example)
874
- : this.convertBreakscapedStringToJsonText(example, options.textFormat, TextLocation_1.TextLocation.tag);
875
- }
876
- return {
877
- isExample: true,
878
- example: exampleValue,
879
- };
880
- }
881
- /**
882
- * Get the bit type from any node
883
- *
884
- * @param route the route to the current node
885
- * @returns the bit type
886
- */
887
- getBitType(route) {
888
- for (const node of route) {
889
- if (node.key === NodeType_1.NodeType.bitsValue) {
890
- const n = node.value;
891
- return n === null || n === void 0 ? void 0 : n.bitType;
892
- }
893
- }
894
- return undefined;
895
- }
896
- /**
897
- * Get the text format from any node
898
- *
899
- * @param route the route to the current node
900
- * @returns the text format
901
- */
902
- getTextFormat(route) {
903
- var _a;
904
- const bitType = this.getBitType(route);
905
- if (bitType) {
906
- const bitConfig = Config_1.Config.getBitConfig(bitType);
907
- for (const node of route) {
908
- if (node.key === NodeType_1.NodeType.bitsValue) {
909
- const n = node.value;
910
- return (_a = TextFormat_1.TextFormat.fromValue(n === null || n === void 0 ? void 0 : n.textFormat)) !== null && _a !== void 0 ? _a : bitConfig.textFormatDefault;
911
- }
912
- }
913
- }
914
- return TextFormat_1.TextFormat.bitmarkText;
915
- }
916
- /**
917
- * Get the bit resourceType atttachment from any node
918
- *
919
- * @param route the route to the current node
920
- * @returns the bit type
921
- */
922
- getResourceType(route) {
923
- for (const node of route) {
924
- if (node.key === NodeType_1.NodeType.bitsValue) {
925
- const n = node.value;
926
- return n === null || n === void 0 ? void 0 : n.resourceType;
927
- }
928
- }
929
- return undefined;
930
- }
931
- /**
932
- * Get the internal comments from any node
933
- *
934
- * @param route the route to the current node
935
- * @returns the text format
936
- */
937
- getInternalComments(route) {
938
- const bitType = this.getBitType(route);
939
- if (bitType) {
940
- for (const node of route) {
941
- if (node.key === NodeType_1.NodeType.bitsValue) {
942
- const n = node.value;
943
- return n.internalComment;
944
- }
945
- }
946
- }
947
- return undefined;
948
- }
949
- /**
950
- * Convert the text from the AST to the JSON format:
951
- * Input:
952
- * - breakscaped string
953
- * Output:
954
- * - text: plain text
955
- * - json: bitmark text JSON
956
- * - Bitmark v2: breakscaped string
957
- * - Bitmark v3: bitmark text JSON (TextAst)
958
- *
959
- * In the case of Bitmark v2 type texts, there is nothing to do but cast the type.
960
- *
961
- * @param text
962
- * @returns
963
- */
964
- convertBreakscapedStringToJsonText(text, format, textLocation) {
965
- if (!text)
966
- undefined;
967
- const isBitmarkText = format === TextFormat_1.TextFormat.bitmarkText;
968
- if (!isBitmarkText) {
969
- // Not bitmark text, so plain text, so unbreakscape only the start of bit tags
970
- return text || '';
971
- }
972
- const asPlainText = this.options.textAsPlainText;
973
- if (asPlainText) {
974
- return text || '';
975
- }
976
- // Use the text parser to parse the text
977
- const textAst = this.textParser.toAst(text, {
978
- format,
979
- location: textLocation,
980
- });
981
- return textAst;
982
- }
983
- /**
984
- * Concatenates a plain JSON text with a JsonText that may be plain (v2) or BitmarkText (v3)
985
- * Returns the combined text.
986
- *
987
- * @param text the text to concatenate
988
- * @param textPlain the plain text to concatenate
989
- */
990
- concatenatePlainTextWithJsonTexts(text, extraBreaks, textPlain) {
991
- var _a;
992
- if (Array.isArray(text)) {
993
- textPlain = textPlain.trim();
994
- if (textPlain) {
995
- const splitText = textPlain.split('\n');
996
- const content = [];
997
- for (let i = 0; i < extraBreaks; i++) {
998
- content.push({
999
- type: TextNodeType_1.TextNodeType.hardBreak,
1000
- });
1001
- }
1002
- for (let i = 0; i < splitText.length; i++) {
1003
- const t = splitText[i];
1004
- if (t) {
1005
- content.push({
1006
- text: t,
1007
- type: TextNodeType_1.TextNodeType.text,
1008
- });
1009
- }
1010
- // Add a hard break after each paragraph, except the last one
1011
- if (i < splitText.length - 1) {
1012
- content.push({
1013
- type: TextNodeType_1.TextNodeType.hardBreak,
1014
- });
1015
- }
1016
- }
1017
- // Add the content to the final paragraph, or create a new one if there none
1018
- const lastNode = text[text.length - 1];
1019
- if (lastNode && lastNode.type === TextNodeType_1.TextNodeType.paragraph) {
1020
- lastNode.content = [...((_a = lastNode.content) !== null && _a !== void 0 ? _a : []), ...content];
1021
- }
1022
- else {
1023
- text.push({
1024
- type: TextNodeType_1.TextNodeType.paragraph,
1025
- content,
1026
- attrs: {},
1027
- });
1028
- }
1029
- }
1030
- return text;
1031
- }
1032
- return `${text !== null && text !== void 0 ? text : ''}${'\n'.repeat(extraBreaks)}${textPlain !== null && textPlain !== void 0 ? textPlain : ''}`;
1033
- }
1034
- /**
1035
- * Check if an object is bitmark text
1036
- * The check looks for a special tag on the array (__tag: 'text')
1037
- *
1038
- * @param obj object that might be bitmark text
1039
- * @returns
1040
- */
1041
- isBitmarkText(obj) {
1042
- if (obj == null)
1043
- return false;
1044
- if (!Array.isArray(obj))
1045
- return false;
1046
- // Check for the hidden text tag
1047
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1048
- if (obj.__tag === 'text')
1049
- return true;
1050
- return false;
1051
- }
1052
- //
1053
- // WRITE FUNCTIONS
1054
- //
1055
- writeInlineDebug(key, state) {
1056
- let tag = key;
1057
- if (state.open) {
1058
- tag = `<${key}>`;
1059
- }
1060
- else if (state.close) {
1061
- tag = `</${key}>`;
1062
- }
1063
- else if (state.single) {
1064
- tag = `<${key} />`;
1065
- }
1066
- this.writeString(tag);
1067
- }
1068
- writeString(s) {
1069
- if (s != null)
1070
- this.write(`${s}`);
1071
- }
1072
- /**
1073
- * Create a new bit json object.
1074
- * - This function defines the order of the properties in the json.
1075
- *
1076
- * @param bit
1077
- * @returns
1078
- */
1079
- createBitJson(bit) {
1080
- const format = bit.textFormat;
1081
- const bitJson = {
1082
- type: bit.isCommented ? BitType_1.BitType._comment : bit.bitType,
1083
- originalType: bit.isCommented ? bit.bitType : undefined,
1084
- format,
1085
- bitLevel: bit.bitLevel,
1086
- };
1087
- return bitJson;
1088
- }
1089
- /**
1090
- * Remove wanted properties from bit json object.
1091
- * - This function defines the defaults for properties in the json.
1092
- *
1093
- * TODO: All these defaults should come from the config and be set in the Builder.
1094
- *
1095
- * @param bit
1096
- * @returns
1097
- */
1098
- cleanBitJson(bitJson) {
1099
- var _a, _b, _c, _d, _e, _f;
1100
- const bitType = Config_1.Config.getBitType(bitJson.type);
1101
- const bitConfig = Config_1.Config.getBitConfig(bitType);
1102
- // const textFormat = bitJson.format;
1103
- // const plainText = this.options.textAsPlainText;
1104
- // Clear 'originalType' if not set
1105
- if (bitJson.originalType == null)
1106
- bitJson.originalType = undefined;
1107
- // Clear 'item' which may be an empty string if 'lead' was set but item not
1108
- // Only necessary because '.article' does not include a default value for 'item'
1109
- // which is totally inconsistent, but maybe is wanted.
1110
- if (!bitJson.item)
1111
- bitJson.item = undefined;
1112
- // Add default properties to the bit.
1113
- // NOTE: Not all bits have the same default properties.
1114
- // The properties used are a bit random sometimes?
1115
- // It would be better if this functionality was generated from the bit config
1116
- if (Config_1.Config.isOfBitType(bitType, [BitType_1.BitType._error, BitType_1.BitType._comment])) {
1117
- // Special case for _error and _comment bits
1118
- delete bitJson.format;
1119
- delete bitJson.item;
1120
- delete bitJson.lead;
1121
- delete bitJson.pageNumber;
1122
- delete bitJson.marginNumber;
1123
- delete bitJson.hint;
1124
- delete bitJson.instruction;
1125
- //
1126
- }
1127
- else {
1128
- let isTopLevelExample = false;
1129
- let isTopLevelExampleValue = false;
1130
- // Most bits have these defaults, but there are special cases (not sure if that is by error or design)
1131
- if (Config_1.Config.isOfBitType(bitType, [BitType_1.BitType.page])) {
1132
- // Bits without item, lead, etc
1133
- if (bitJson.item == null || ((_a = bitJson.item) === null || _a === void 0 ? void 0 : _a.length) === 0)
1134
- delete bitJson.item;
1135
- if (bitJson.lead == null || ((_b = bitJson.lead) === null || _b === void 0 ? void 0 : _b.length) === 0)
1136
- delete bitJson.lead;
1137
- if (bitJson.pageNumber == null || ((_c = bitJson.pageNumber) === null || _c === void 0 ? void 0 : _c.length) === 0)
1138
- delete bitJson.pageNumber;
1139
- if (bitJson.marginNumber == null || ((_d = bitJson.marginNumber) === null || _d === void 0 ? void 0 : _d.length) === 0)
1140
- delete bitJson.marginNumber;
1141
- if (bitJson.hint == null || ((_e = bitJson.hint) === null || _e === void 0 ? void 0 : _e.length) === 0)
1142
- delete bitJson.hint;
1143
- if (bitJson.instruction == null || ((_f = bitJson.instruction) === null || _f === void 0 ? void 0 : _f.length) === 0)
1144
- delete bitJson.instruction;
1145
- }
1146
- else {
1147
- // Majority of bits
1148
- if (bitJson.item == null)
1149
- bitJson.item = this.textDefault;
1150
- if (bitJson.lead == null)
1151
- bitJson.lead = this.textDefault;
1152
- if (bitJson.hint == null)
1153
- bitJson.hint = this.textDefault;
1154
- if (bitJson.instruction == null)
1155
- bitJson.instruction = this.textDefault;
1156
- if (bitJson.pageNumber == null)
1157
- bitJson.pageNumber = this.textDefault;
1158
- if (bitJson.marginNumber == null)
1159
- bitJson.marginNumber = this.textDefault;
1160
- }
1161
- if (bitJson.body == null)
1162
- bitJson.body = this.bodyDefault;
1163
- if (Config_1.Config.isOfBitType(bitType, [BitType_1.BitType.article])) {
1164
- //
1165
- }
1166
- if (Config_1.Config.isOfBitType(bitType, [BitType_1.BitType.example])) {
1167
- // With 'example' value at the bit level.
1168
- isTopLevelExample = true;
1169
- isTopLevelExampleValue = true;
1170
- }
1171
- if (Config_1.Config.isOfBitType(bitType, [
1172
- BitType_1.BitType.multipleChoice1,
1173
- BitType_1.BitType.multipleResponse1,
1174
- BitType_1.BitType.multipleChoiceText,
1175
- BitType_1.BitType.highlightText,
1176
- BitType_1.BitType.gapText,
1177
- BitType_1.BitType.gapTextInstructionGrouped,
1178
- BitType_1.BitType.clozeAndMultipleChoiceText,
1179
- BitType_1.BitType.sequence,
1180
- BitType_1.BitType.mark,
1181
- BitType_1.BitType.flashcard,
1182
- BitType_1.BitType.definitionList,
1183
- ])) {
1184
- // With no 'example' value at the bit level.
1185
- isTopLevelExample = true;
1186
- if (bitJson.body == null)
1187
- bitJson.body = this.bodyDefault;
1188
- }
1189
- if (Config_1.Config.isOfBitType(bitType, [BitType_1.BitType.sequence])) {
1190
- // With 'example' value at the bit level.
1191
- isTopLevelExample = true;
1192
- isTopLevelExampleValue = true;
1193
- if (bitJson.body == null)
1194
- bitJson.body = this.bodyDefault;
1195
- }
1196
- if (Config_1.Config.isOfBitType(bitType, BitType_1.BitType.cloze)) {
1197
- // With no 'example' value at the bit level.
1198
- isTopLevelExample = true;
1199
- if (Config_1.Config.isOfBitType(bitType, BitType_1.BitType.clozeSolutionGrouped)) {
1200
- // Solution grouped
1201
- if (bitJson.quizCountItems == null)
1202
- bitJson.quizCountItems = true;
1203
- if (bitJson.quizStrikethroughSolutions == null)
1204
- bitJson.quizStrikethroughSolutions = true;
1205
- }
1206
- else if (Config_1.Config.isOfBitType(bitType, BitType_1.BitType.clozeInstructionGrouped)) {
1207
- // Instruction grouped
1208
- if (bitJson.quizCountItems == null)
1209
- bitJson.quizCountItems = true;
1210
- if (bitJson.quizStrikethroughSolutions == null)
1211
- bitJson.quizStrikethroughSolutions = false;
1212
- }
1213
- }
1214
- if (Config_1.Config.isOfBitType(bitType, [BitType_1.BitType.multipleChoice, BitType_1.BitType.multipleResponse])) {
1215
- // Default with a card (and hence a footer possibility)
1216
- isTopLevelExample = true;
1217
- if (bitJson.body == null)
1218
- bitJson.body = this.bodyDefault;
1219
- if (bitJson.footer == null)
1220
- bitJson.footer = this.textDefault;
1221
- }
1222
- if (Config_1.Config.isOfBitType(bitType, BitType_1.BitType.essay)) {
1223
- // With 'example' value at the bit level.
1224
- isTopLevelExample = true;
1225
- isTopLevelExampleValue = true;
1226
- if (bitJson.body == null)
1227
- bitJson.body = this.bodyDefault;
1228
- if (bitJson.partialAnswer == null)
1229
- bitJson.partialAnswer = '';
1230
- // if (bitJson.sampleSolution == null) bitJson.sampleSolution = '';
1231
- }
1232
- if (Config_1.Config.isOfBitType(bitType, BitType_1.BitType.trueFalse1)) {
1233
- // With 'example' value at the bit level.
1234
- isTopLevelExample = true;
1235
- isTopLevelExampleValue = true;
1236
- if (bitJson.isCorrect == null)
1237
- bitJson.isCorrect = false;
1238
- if (bitJson.body == null)
1239
- bitJson.body = this.bodyDefault;
1240
- }
1241
- if (Config_1.Config.isOfBitType(bitType, BitType_1.BitType.trueFalse)) {
1242
- // With no 'example' value at the bit level.
1243
- isTopLevelExample = true;
1244
- if (bitJson.labelFalse == null)
1245
- bitJson.labelFalse = '';
1246
- if (bitJson.labelTrue == null)
1247
- bitJson.labelTrue = '';
1248
- if (bitJson.body == null)
1249
- bitJson.body = this.bodyDefault;
1250
- }
1251
- if (Config_1.Config.isOfBitType(bitType, BitType_1.BitType.chapter)) {
1252
- //
1253
- if (bitJson.toc == null)
1254
- bitJson.toc = true; // Always set on chapter bits?
1255
- if (bitJson.progress == null)
1256
- bitJson.progress = true; // Always set on chapter bits
1257
- if (bitJson.level == null)
1258
- bitJson.level = 1; // Set level 1 if none set (makes no sense, but in ANTLR parser)
1259
- if (bitJson.body == null)
1260
- bitJson.body = this.bodyDefault;
1261
- //
1262
- }
1263
- if (Config_1.Config.isOfBitType(bitType, BitType_1.BitType.interview)) {
1264
- // With no 'example' value at the bit level.
1265
- isTopLevelExample = true;
1266
- if (bitJson.body == null)
1267
- bitJson.body = this.bodyDefault;
1268
- if (bitJson.footer == null)
1269
- bitJson.footer = this.textDefault;
1270
- if (bitJson.questions == null)
1271
- bitJson.questions = [];
1272
- }
1273
- if (bitType === BitType_1.BitType.matchMatrix) {
1274
- // With no 'example' value at the bit level.
1275
- isTopLevelExample = true;
1276
- }
1277
- if (Config_1.Config.isOfBitType(bitType, BitType_1.BitType.match)) {
1278
- // With no 'example' value at the bit level.
1279
- isTopLevelExample = true;
1280
- if (bitJson.heading == null)
1281
- bitJson.heading = {};
1282
- }
1283
- if (Config_1.Config.isOfBitType(bitType, BitType_1.BitType.learningPathBook)) {
1284
- //
1285
- if (bitJson.isTracked == null)
1286
- bitJson.isTracked = true;
1287
- if (bitJson.isInfoOnly == null)
1288
- bitJson.isInfoOnly = false;
1289
- //
1290
- }
1291
- if (Config_1.Config.isOfBitType(bitType, BitType_1.BitType.table)) {
1292
- //
1293
- // if (bitJson.content2Buy == null) bitJson.content2Buy = '';
1294
- if (bitJson.tableFixedHeader == null)
1295
- bitJson.tableFixedHeader = false;
1296
- if (bitJson.tableHeaderWhitespaceNoWrap == null)
1297
- bitJson.tableHeaderWhitespaceNoWrap = true;
1298
- if (bitJson.tableSearch == null)
1299
- bitJson.tableSearch = false;
1300
- if (bitJson.tableSort == null)
1301
- bitJson.tableSort = false;
1302
- if (bitJson.tablePagination == null)
1303
- bitJson.tablePagination = false;
1304
- if (bitJson.tablePaginationLimit == null)
1305
- bitJson.tablePaginationLimit = 0;
1306
- if (bitJson.tableHeight == null)
1307
- bitJson.tableHeight = 0;
1308
- if (bitJson.tableWhitespaceNoWrap == null)
1309
- bitJson.tableWhitespaceNoWrap = false;
1310
- if (bitJson.tableAutoWidth == null)
1311
- bitJson.tableAutoWidth = true;
1312
- if (bitJson.tableResizableColumns == null)
1313
- bitJson.tableResizableColumns = false;
1314
- if (bitJson.tableColumnMinWidth == null)
1315
- bitJson.tableColumnMinWidth = 0;
1316
- //
1317
- }
1318
- if (Config_1.Config.isOfBitType(bitType, BitType_1.BitType.bookReference)) {
1319
- //
1320
- if (bitJson.refAuthor == null)
1321
- bitJson.refAuthor = [];
1322
- if (bitJson.refBookTitle == null)
1323
- bitJson.refBookTitle = '';
1324
- if (bitJson.refPublisher == null)
1325
- bitJson.refPublisher = [];
1326
- if (bitJson.refPublicationYear == null)
1327
- bitJson.refPublicationYear = '';
1328
- //
1329
- }
1330
- // Page bits
1331
- if (Config_1.Config.isOfBitType(bitType, [
1332
- BitType_1.BitType.pageBanner,
1333
- BitType_1.BitType.pageBuyButton,
1334
- BitType_1.BitType.pageBuyButtonAlt,
1335
- BitType_1.BitType.pageBuyButtonPromotion,
1336
- BitType_1.BitType.pageFooter,
1337
- BitType_1.BitType.pageOpenBook,
1338
- BitType_1.BitType.pagePerson,
1339
- BitType_1.BitType.pageProduct,
1340
- BitType_1.BitType.pageProductList,
1341
- BitType_1.BitType.pageProductVideo,
1342
- BitType_1.BitType.pageProductVideoList,
1343
- BitType_1.BitType.pageSectionFolder,
1344
- BitType_1.BitType.pageSubscribe,
1345
- BitType_1.BitType.pageSubpage,
1346
- ])) {
1347
- //
1348
- if (bitJson.slug == null)
1349
- bitJson.slug = '';
1350
- if (bitJson.body == null)
1351
- bitJson.body = this.bodyDefault;
1352
- if (Config_1.Config.isOfBitType(bitType, BitType_1.BitType.pageBuyButton)) {
1353
- if (bitJson.content2Buy == null)
1354
- bitJson.content2Buy = '';
1355
- }
1356
- }
1357
- // Special case for 'toc-resource' bits
1358
- if (Config_1.Config.isOfBitType(bitType, BitType_1.BitType.tocResource)) {
1359
- if (bitJson.tocResource == null)
1360
- bitJson.tocResource = [];
1361
- }
1362
- // Special case for 'toc-content' bits
1363
- if (Config_1.Config.isOfBitType(bitType, BitType_1.BitType.tocContent)) {
1364
- if (bitJson.tocContent == null)
1365
- bitJson.tocContent = [];
1366
- }
1367
- // Special case for 'book' bits
1368
- if (Config_1.Config.isOfBitType(bitType, BitType_1.BitType.book)) {
1369
- if (bitJson.maxTocChapterLevel == null)
1370
- bitJson.maxTocChapterLevel = -1;
1371
- if (bitJson.hasMarkAsDone == null)
1372
- bitJson.hasMarkAsDone = false;
1373
- if (bitJson.processHandIn == null)
1374
- bitJson.processHandIn = false;
1375
- if (bitJson.isPublic == null)
1376
- bitJson.isPublic = false;
1377
- if (bitJson.chatWithBook == null)
1378
- bitJson.chatWithBook = false;
1379
- if (bitJson.chatWithBookBrainKey == null)
1380
- bitJson.chatWithBookBrainKey = '';
1381
- }
1382
- // Special case for 'ai' bits
1383
- if (bitType === BitType_1.BitType.articleAi || bitType === BitType_1.BitType.noteAi || bitType === BitType_1.BitType.summaryAi) {
1384
- if (bitJson.aiGenerated == null)
1385
- bitJson.aiGenerated = true;
1386
- }
1387
- // Special case for '-responsive...' bits
1388
- if (Config_1.Config.isOfBitType(bitType, [BitType_1.BitType.articleResponsive, BitType_1.BitType.pageArticleResponsive])) {
1389
- if (bitJson.imageFirst == null)
1390
- bitJson.imageFirst = true;
1391
- }
1392
- // Special case for 'review-...' bits
1393
- if (Config_1.Config.isOfBitType(bitType, BitType_1.BitType.reviewNote)) {
1394
- if (bitJson.resolved == null)
1395
- bitJson.resolved = false;
1396
- if (bitJson.resolvedDate == null)
1397
- bitJson.resolvedDate = '';
1398
- if (bitJson.resolvedBy == null)
1399
- bitJson.resolvedBy = '';
1400
- }
1401
- // Special case for 'images-logos-grave' / 'prototype-images' / etc bits
1402
- if (Config_1.Config.isOfBitType(bitType, [BitType_1.BitType.imagesLogoGrave, BitType_1.BitType.prototypeImages])) {
1403
- if (bitType === BitType_1.BitType.imagesLogoGrave) {
1404
- if (bitJson.logos == null) {
1405
- bitJson.logos = [];
1406
- }
1407
- }
1408
- else {
1409
- if (bitJson.images == null)
1410
- bitJson.images = [];
1411
- }
1412
- }
1413
- // Special case for 'stepImageScreenshotWithPointer' / surveyMatrix / etc bits
1414
- if (Config_1.Config.isOfBitType(bitType, [BitType_1.BitType.stepImageScreenshotWithPointer, BitType_1.BitType.surveyMatrix])) {
1415
- if (bitJson.pointerTop == null)
1416
- bitJson.pointerTop = '';
1417
- if (bitJson.pointerLeft == null)
1418
- bitJson.pointerLeft = '';
1419
- if (Config_1.Config.isOfBitType(bitType, [BitType_1.BitType.surveyMatrix])) {
1420
- if (bitJson.buttonCaption == null)
1421
- bitJson.buttonCaption = '';
1422
- }
1423
- }
1424
- if (Config_1.Config.isOfBitType(bitType, [BitType_1.BitType.listItem])) {
1425
- if (bitJson.listItemIndent == null)
1426
- bitJson.listItemIndent = 0;
1427
- }
1428
- // Special case for 'survey-rating-*' bits
1429
- if (Config_1.Config.isOfBitType(bitType, BitType_1.BitType.surveyRating)) {
1430
- //
1431
- if (bitJson.ratingLevelStart == null) {
1432
- bitJson.ratingLevelStart = {
1433
- level: 0,
1434
- };
1435
- }
1436
- if (bitJson.ratingLevelEnd == null) {
1437
- bitJson.ratingLevelEnd = {
1438
- level: 0,
1439
- };
1440
- }
1441
- }
1442
- // Special case for 'vendor-stripe-pricing-table' bits
1443
- if (Config_1.Config.isOfBitType(bitType, BitType_1.BitType.vendorStripePricingTable)) {
1444
- if (bitJson.stripePricingTableId == null)
1445
- bitJson.stripePricingTableId = '';
1446
- if (bitJson.stripePublishableKey == null)
1447
- bitJson.stripePublishableKey = '';
1448
- }
1449
- // Special case for 'call-to-action' bits
1450
- if (Config_1.Config.isOfBitType(bitType, BitType_1.BitType.callToAction)) {
1451
- if (bitJson.buttonCaption == null)
1452
- bitJson.buttonCaption = '';
1453
- if (bitJson.callToActionUrl == null)
1454
- bitJson.callToActionUrl = '';
1455
- }
1456
- // Special case for 'hand-in-file' bits
1457
- if (Config_1.Config.isOfBitType(bitType, BitType_1.BitType.handInFile)) {
1458
- if (bitJson.handInAcceptFileType == null)
1459
- bitJson.handInAcceptFileType = [];
1460
- }
1461
- // Special case for 'hand-in-submit' bits
1462
- if (Config_1.Config.isOfBitType(bitType, BitType_1.BitType.handInSubmit)) {
1463
- if (bitJson.handInRequirement == null)
1464
- bitJson.handInRequirement = [];
1465
- if (bitJson.handInInstruction == null)
1466
- bitJson.handInInstruction = '';
1467
- if (bitJson.buttonCaption == null)
1468
- bitJson.buttonCaption = '';
1469
- }
1470
- // Special case for 'module' bits
1471
- if (Config_1.Config.isOfBitType(bitType, BitType_1.BitType.module)) {
1472
- if (bitJson.hasBookNavigation == null)
1473
- bitJson.hasBookNavigation = true;
1474
- }
1475
- // Special case for 'container' bits
1476
- if (Config_1.Config.isOfBitType(bitType, BitType_1.BitType.container)) {
1477
- if (bitJson.allowedBit == null)
1478
- bitJson.allowedBit = [];
1479
- }
1480
- // Special case for 'quiz' bits
1481
- if (bitConfig.quizBit) {
1482
- if (bitJson.revealSolutions == null)
1483
- bitJson.revealSolutions = false;
1484
- }
1485
- // Special case for 'platform-path' bits
1486
- if (Config_1.Config.isOfBitType(bitType, BitType_1.BitType.platformPath)) {
1487
- if (bitJson.path == null)
1488
- bitJson.path = '';
1489
- }
1490
- // Remove top level example if it is not required
1491
- if (isTopLevelExample) {
1492
- if (bitJson.isExample == null)
1493
- bitJson.isExample = false;
1494
- }
1495
- else {
1496
- // Remove example
1497
- delete bitJson.isExample;
1498
- delete bitJson.example;
1499
- }
1500
- if (isTopLevelExampleValue) {
1501
- if (bitJson.example == null)
1502
- bitJson.example = null;
1503
- }
1504
- else {
1505
- // Remove example value
1506
- delete bitJson.example;
1507
- }
1508
- }
1509
- return bitJson;
1510
- }
1511
- /**
1512
- * Convert any bitmark texts to strings.
1513
- */
1514
- convertAllBitmarkTextsToStringsForPlainText(json) {
1515
- if (!this.options.textAsPlainText)
1516
- return;
1517
- const obj = json;
1518
- for (const key in obj) {
1519
- const val = obj[key];
1520
- if (this.isBitmarkText(val)) {
1521
- const s = this.textGenerator.generateSync(val, TextFormat_1.TextFormat.bitmarkText, TextLocation_1.TextLocation.tag, {
1522
- noBreakscaping: true,
1523
- });
1524
- obj[key] = (s !== null && s !== void 0 ? s : '').trim();
1525
- }
1526
- else if (typeof obj[key] === 'object') {
1527
- this.convertAllBitmarkTextsToStringsForPlainText(obj[key]);
1528
- }
1529
- }
1530
- }
1531
- /**
1532
- * Remove any property with a key starting with an double underscore.
1533
- *
1534
- * @param json
1535
- */
1536
- removeTemporaryProperties(json) {
1537
- const obj = json;
1538
- for (const key in obj) {
1539
- if (key.startsWith('__')) {
1540
- delete obj[key];
1541
- }
1542
- else if (typeof obj[key] === 'object') {
1543
- this.removeTemporaryProperties(obj[key]);
1544
- }
1545
- }
1546
- }
1547
- //
1548
- // Writer interface
1549
- //
1550
- /**
1551
- * Writes a string value to the output.
1552
- * @param value - The string value to be written.
1553
- */
1554
- write(value) {
1555
- this.writer.write(value);
1556
- return this;
1557
- }
1558
- /**
1559
- * Writes a new line to the output. The line is indented automatically. The line is ended with the endOfLineString.
1560
- * @param value - The line to write. When omitted, only the endOfLineString is written.
1561
- */
1562
- writeLine(value) {
1563
- this.writer.writeLine(value);
1564
- return this;
1565
- }
1566
- /**
1567
- * Writes a collection of lines to the output. Each line is indented automatically and ended with the endOfLineString.
1568
- * @param values - The lines to write.
1569
- * @param delimiter - An optional delimiter to be written at the end of each line, except for the last one.
1570
- */
1571
- writeLines(values, delimiter) {
1572
- this.writer.writeLines(values, delimiter);
1573
- return this;
1574
- }
1575
- /**
1576
- * Writes a single whitespace character to the output.
1577
- */
1578
- writeWhiteSpace() {
1579
- this.writer.writeWhiteSpace();
1580
- return this;
1581
- }
1582
- }
1583
- exports.JsonGenerator = JsonGenerator;
1584
- //# sourceMappingURL=JsonGenerator.js.map