@futpib/parser 1.0.2 → 1.0.4

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 (311) hide show
  1. package/.github/copilot-instructions.md +149 -0
  2. package/.github/workflows/copilot-setup-steps.yml +18 -0
  3. package/.github/workflows/main.yml +29 -8
  4. package/.yarn/releases/yarn-4.9.4.cjs +942 -0
  5. package/.yarnrc.yml +1 -1
  6. package/build/allSettledStream.js +1 -1
  7. package/build/allSettledStream.test.js +2 -2
  8. package/build/androidPackageParser.d.ts +1 -1
  9. package/build/androidPackageParser.js +5 -3
  10. package/build/androidPackageParser.test.js +7 -7
  11. package/build/androidPackageUnparser.d.ts +2 -2
  12. package/build/androidPackageUnparser.js +18 -14
  13. package/build/androidPackageUnparser.test.js +7 -7
  14. package/build/arbitrarilySlicedAsyncInterator.js +2 -1
  15. package/build/arbitraryDalvikBytecode.d.ts +4 -0
  16. package/build/arbitraryDalvikBytecode.js +640 -0
  17. package/build/arbitraryDalvikExecutable.d.ts +3 -0
  18. package/build/arbitraryDalvikExecutable.js +282 -0
  19. package/build/arbitraryDosDateTime.js +1 -0
  20. package/build/arbitraryZipStream.js +1 -1
  21. package/build/arrayParser.js +2 -2
  22. package/build/arrayUnparser.d.ts +1 -1
  23. package/build/backsmali.d.ts +3 -1
  24. package/build/backsmali.js +31 -3
  25. package/build/bash.d.ts +84 -0
  26. package/build/bash.js +1 -0
  27. package/build/bashParser.d.ts +6 -0
  28. package/build/bashParser.js +294 -0
  29. package/build/bashParser.test.d.ts +1 -0
  30. package/build/bashParser.test.js +181 -0
  31. package/build/customInvariant.d.ts +2 -1
  32. package/build/customInvariant.js +4 -6
  33. package/build/dalvikBytecodeParser/formatParsers.d.ts +76 -2
  34. package/build/dalvikBytecodeParser/formatParsers.js +146 -11
  35. package/build/dalvikBytecodeParser/formatSizes.d.ts +34 -0
  36. package/build/dalvikBytecodeParser/formatSizes.js +34 -0
  37. package/build/dalvikBytecodeParser/operationFormats.d.ts +225 -0
  38. package/build/dalvikBytecodeParser/operationFormats.js +225 -0
  39. package/build/dalvikBytecodeParser.d.ts +1105 -5
  40. package/build/dalvikBytecodeParser.js +658 -205
  41. package/build/dalvikBytecodeUnparser/formatUnparsers.d.ts +152 -0
  42. package/build/dalvikBytecodeUnparser/formatUnparsers.js +225 -0
  43. package/build/dalvikBytecodeUnparser.d.ts +3 -0
  44. package/build/dalvikBytecodeUnparser.js +642 -0
  45. package/build/dalvikBytecodeUnparser.test.d.ts +1 -0
  46. package/build/dalvikBytecodeUnparser.test.js +25 -0
  47. package/build/dalvikExecutable.d.ts +65 -8
  48. package/build/dalvikExecutable.js +36 -0
  49. package/build/dalvikExecutableParser/stringSyntaxParser.d.ts +1 -1
  50. package/build/dalvikExecutableParser/stringSyntaxParser.js +17 -17
  51. package/build/dalvikExecutableParser/typeParsers.d.ts +2 -1
  52. package/build/dalvikExecutableParser/typeParsers.js +16 -11
  53. package/build/dalvikExecutableParser/typedNumbers.d.ts +85 -69
  54. package/build/dalvikExecutableParser/typedNumbers.js +0 -1
  55. package/build/dalvikExecutableParser.d.ts +2 -2
  56. package/build/dalvikExecutableParser.js +655 -337
  57. package/build/dalvikExecutableParser.test.js +24 -22
  58. package/build/dalvikExecutableParserAgainstSmaliParser.test.js +223 -246
  59. package/build/dalvikExecutableUnparser/annotationUnparsers.d.ts +14 -0
  60. package/build/dalvikExecutableUnparser/annotationUnparsers.js +97 -0
  61. package/build/dalvikExecutableUnparser/poolBuilders.d.ts +49 -0
  62. package/build/dalvikExecutableUnparser/poolBuilders.js +140 -0
  63. package/build/dalvikExecutableUnparser/poolScanners.d.ts +4 -0
  64. package/build/dalvikExecutableUnparser/poolScanners.js +220 -0
  65. package/build/dalvikExecutableUnparser/sectionUnparsers.d.ts +25 -0
  66. package/build/dalvikExecutableUnparser/sectionUnparsers.js +581 -0
  67. package/build/dalvikExecutableUnparser/utils.d.ts +10 -0
  68. package/build/dalvikExecutableUnparser/utils.js +108 -0
  69. package/build/dalvikExecutableUnparser.d.ts +4 -0
  70. package/build/dalvikExecutableUnparser.js +406 -0
  71. package/build/dalvikExecutableUnparser.test.d.ts +1 -0
  72. package/build/dalvikExecutableUnparser.test.js +31 -0
  73. package/build/debugLogInputParser.js +1 -1
  74. package/build/disjunctionParser.d.ts +2 -2
  75. package/build/disjunctionParser.js +2 -2
  76. package/build/elementTerminatedArrayParser.d.ts +2 -2
  77. package/build/elementTerminatedArrayParser.js +1 -1
  78. package/build/elementTerminatedArrayParser.test.js +5 -5
  79. package/build/elementTerminatedSequenceArrayParser.d.ts +2 -2
  80. package/build/elementTerminatedSequenceArrayParser.js +1 -1
  81. package/build/elementTerminatedSequenceArrayParser.test.js +2 -2
  82. package/build/elementTerminatedSequenceParser.d.ts +2 -2
  83. package/build/elementTerminatedSequenceParser.js +1 -1
  84. package/build/elementTerminatedSequenceParser.test.js +2 -2
  85. package/build/endOfInputParser.d.ts +1 -1
  86. package/build/exactElementSwitchParser.d.ts +3 -0
  87. package/build/exactElementSwitchParser.js +22 -0
  88. package/build/fetchCid.js +2 -6
  89. package/build/fetchCid.test.d.ts +1 -0
  90. package/build/fetchCid.test.js +16 -0
  91. package/build/fixedLengthSequenceParser.test.js +2 -2
  92. package/build/hasExecutable.js +2 -2
  93. package/build/highResolutionTimer.js +1 -1
  94. package/build/index.d.ts +24 -2
  95. package/build/index.js +22 -1
  96. package/build/inputReader.d.ts +1 -1
  97. package/build/inputReader.test.js +33 -45
  98. package/build/javaKeyStoreParser.test.js +6 -6
  99. package/build/jsonParser.js +8 -8
  100. package/build/lazyMessageError.d.ts +48 -0
  101. package/build/lazyMessageError.js +53 -0
  102. package/build/lazyMessageError.test.d.ts +1 -0
  103. package/build/lazyMessageError.test.js +15 -0
  104. package/build/leb128Parser.d.ts +1 -1
  105. package/build/leb128Parser.js +10 -10
  106. package/build/leb128Parser.test.js +7 -7
  107. package/build/negativeLookaheadParser.js +2 -2
  108. package/build/negativeLookaheadParser.test.js +4 -4
  109. package/build/noStackCaptureOverheadError.d.ts +4 -0
  110. package/build/noStackCaptureOverheadError.js +9 -0
  111. package/build/noStackCaptureOverheadError.test.d.ts +1 -0
  112. package/build/noStackCaptureOverheadError.test.js +15 -0
  113. package/build/nonEmptyArrayParser.js +2 -2
  114. package/build/nonEmptyArrayParser.test.js +2 -1
  115. package/build/optionalParser.js +2 -2
  116. package/build/parser.d.ts +2 -1
  117. package/build/parser.js +23 -8
  118. package/build/parser.test.js +78 -29
  119. package/build/parserConsumedSequenceParser.d.ts +1 -1
  120. package/build/parserConsumedSequenceParser.js +2 -2
  121. package/build/parserContext.d.ts +8 -6
  122. package/build/parserContext.js +60 -33
  123. package/build/parserContext.test.js +7 -3
  124. package/build/parserError.d.ts +603 -44
  125. package/build/parserError.js +98 -53
  126. package/build/parserImplementationInvariant.d.ts +1 -1
  127. package/build/parserImplementationInvariant.js +2 -2
  128. package/build/parserInputCompanion.js +2 -2
  129. package/build/promiseCompose.js +1 -2
  130. package/build/regexpParser.d.ts +2 -0
  131. package/build/regexpParser.js +71 -0
  132. package/build/regexpParser.test.d.ts +1 -0
  133. package/build/regexpParser.test.js +83 -0
  134. package/build/regularExpression.d.ts +63 -0
  135. package/build/regularExpression.js +1 -0
  136. package/build/regularExpressionParser.d.ts +3 -0
  137. package/build/regularExpressionParser.js +580 -0
  138. package/build/regularExpressionParser.test.d.ts +1 -0
  139. package/build/regularExpressionParser.test.js +89 -0
  140. package/build/separatedArrayParser.js +2 -2
  141. package/build/separatedNonEmptyArrayParser.d.ts +2 -0
  142. package/build/separatedNonEmptyArrayParser.js +40 -0
  143. package/build/separatedNonEmptyArrayParser.test.d.ts +1 -0
  144. package/build/separatedNonEmptyArrayParser.test.js +66 -0
  145. package/build/sequenceBuffer.js +1 -1
  146. package/build/sequenceTerminatedSequenceParser.d.ts +2 -2
  147. package/build/sequenceTerminatedSequenceParser.js +3 -3
  148. package/build/sequenceTerminatedSequenceParser.test.js +1 -1
  149. package/build/sequenceUnparser.d.ts +1 -1
  150. package/build/skipToParser.d.ts +1 -1
  151. package/build/skipToParser.js +2 -2
  152. package/build/sliceBoundedParser.test.js +4 -9
  153. package/build/smali.d.ts +1 -1
  154. package/build/smali.js +6 -2
  155. package/build/smaliParser.d.ts +62 -6
  156. package/build/smaliParser.js +1721 -296
  157. package/build/smaliParser.test.js +338 -43
  158. package/build/stringFromAsyncIterable.d.ts +1 -0
  159. package/build/stringFromAsyncIterable.js +7 -0
  160. package/build/terminatedArrayParser.js +4 -4
  161. package/build/terminatedArrayParser.test.js +7 -7
  162. package/build/toAsyncIterator.js +4 -4
  163. package/build/unionParser.d.ts +1 -1
  164. package/build/unionParser.js +2 -2
  165. package/build/unionParser.test.js +3 -3
  166. package/build/unparser.d.ts +3 -3
  167. package/build/unparser.js +6 -4
  168. package/build/unparser.test.js +7 -19
  169. package/build/unparserContext.d.ts +2 -2
  170. package/build/unparserContext.js +2 -3
  171. package/build/unparserError.d.ts +2 -1
  172. package/build/unparserError.js +2 -1
  173. package/build/unparserImplementationInvariant.d.ts +1 -1
  174. package/build/unparserOutputCompanion.d.ts +1 -1
  175. package/build/unparserOutputCompanion.js +1 -1
  176. package/build/zipParser.js +1 -1
  177. package/build/zipUnparser.d.ts +3 -3
  178. package/build/zipUnparser.js +9 -19
  179. package/build/zipUnparser.test.js +1 -1
  180. package/package.json +20 -26
  181. package/src/allSettledStream.test.ts +2 -2
  182. package/src/allSettledStream.ts +3 -3
  183. package/src/androidPackageParser.test.ts +17 -19
  184. package/src/androidPackageParser.ts +129 -171
  185. package/src/androidPackageUnparser.test.ts +19 -21
  186. package/src/androidPackageUnparser.ts +23 -17
  187. package/src/arbitrarilySlicedAsyncInterable.ts +1 -1
  188. package/src/arbitrarilySlicedAsyncInterator.ts +4 -4
  189. package/src/arbitraryDalvikBytecode.ts +992 -0
  190. package/src/arbitraryDalvikExecutable.ts +434 -0
  191. package/src/arbitraryDosDateTime.ts +1 -0
  192. package/src/arbitraryZipStream.ts +1 -1
  193. package/src/arrayParser.ts +2 -2
  194. package/src/arrayUnparser.ts +2 -2
  195. package/src/backsmali.ts +48 -4
  196. package/src/bash.ts +120 -0
  197. package/src/bashParser.test.ts +332 -0
  198. package/src/bashParser.ts +461 -0
  199. package/src/bsonParser.test.ts +12 -14
  200. package/src/customInvariant.ts +8 -12
  201. package/src/dalvikBytecodeParser/formatParsers.ts +376 -17
  202. package/src/dalvikBytecodeParser/formatSizes.ts +35 -0
  203. package/src/dalvikBytecodeParser/operationFormats.ts +226 -0
  204. package/src/dalvikBytecodeParser.ts +1042 -243
  205. package/src/dalvikBytecodeUnparser/formatUnparsers.ts +442 -0
  206. package/src/dalvikBytecodeUnparser.test.ts +44 -0
  207. package/src/dalvikBytecodeUnparser.ts +758 -0
  208. package/src/dalvikExecutable.ts +110 -48
  209. package/src/dalvikExecutableParser/stringSyntaxParser.ts +33 -33
  210. package/src/dalvikExecutableParser/typeParsers.ts +23 -14
  211. package/src/dalvikExecutableParser/typedNumbers.ts +19 -19
  212. package/src/dalvikExecutableParser.test.ts +60 -60
  213. package/src/dalvikExecutableParser.test.ts.md +6 -6
  214. package/src/dalvikExecutableParser.test.ts.snap +0 -0
  215. package/src/dalvikExecutableParser.ts +911 -434
  216. package/src/dalvikExecutableParserAgainstSmaliParser.test.ts +256 -239
  217. package/src/dalvikExecutableUnparser/annotationUnparsers.ts +135 -0
  218. package/src/dalvikExecutableUnparser/poolBuilders.ts +189 -0
  219. package/src/dalvikExecutableUnparser/poolScanners.ts +297 -0
  220. package/src/dalvikExecutableUnparser/sectionUnparsers.ts +683 -0
  221. package/src/dalvikExecutableUnparser/utils.ts +149 -0
  222. package/src/dalvikExecutableUnparser.test.ts +57 -0
  223. package/src/dalvikExecutableUnparser.ts +581 -0
  224. package/src/debugLogInputParser.ts +1 -1
  225. package/src/disjunctionParser.ts +5 -5
  226. package/src/elementTerminatedArrayParser.test.ts +8 -8
  227. package/src/elementTerminatedArrayParser.ts +2 -2
  228. package/src/elementTerminatedSequenceArrayParser.test.ts +4 -6
  229. package/src/elementTerminatedSequenceArrayParser.ts +2 -2
  230. package/src/elementTerminatedSequenceParser.test.ts +4 -6
  231. package/src/elementTerminatedSequenceParser.ts +2 -2
  232. package/src/endOfInputParser.ts +1 -1
  233. package/src/exactElementSwitchParser.ts +41 -0
  234. package/src/fetchCid.test.ts +20 -0
  235. package/src/fetchCid.ts +3 -7
  236. package/src/fixedLengthSequenceParser.test.ts +10 -12
  237. package/src/hasExecutable.ts +2 -2
  238. package/src/highResolutionTimer.ts +1 -1
  239. package/src/index.ts +113 -2
  240. package/src/inputReader.test.ts +39 -52
  241. package/src/inputReader.ts +2 -4
  242. package/src/inputReaderState.ts +1 -1
  243. package/src/inspect.ts +1 -1
  244. package/src/javaKeyStoreParser.test.ts +12 -14
  245. package/src/javaKeyStoreParser.ts +2 -6
  246. package/src/jsonParser.test.ts +2 -4
  247. package/src/jsonParser.ts +34 -38
  248. package/src/lazyMessageError.test.ts +21 -0
  249. package/src/lazyMessageError.ts +88 -0
  250. package/src/leb128Parser.test.ts +25 -23
  251. package/src/leb128Parser.ts +19 -19
  252. package/src/negativeLookaheadParser.test.ts +7 -11
  253. package/src/negativeLookaheadParser.ts +2 -2
  254. package/src/noStackCaptureOverheadError.test.ts +17 -0
  255. package/src/noStackCaptureOverheadError.ts +12 -0
  256. package/src/nonEmptyArrayParser.test.ts +3 -2
  257. package/src/nonEmptyArrayParser.ts +2 -2
  258. package/src/optionalParser.ts +2 -2
  259. package/src/parser.test.ts +96 -43
  260. package/src/parser.test.ts.md +13 -6
  261. package/src/parser.test.ts.snap +0 -0
  262. package/src/parser.ts +35 -12
  263. package/src/parserAccessorParser.ts +1 -1
  264. package/src/parserConsumedSequenceParser.ts +3 -3
  265. package/src/parserContext.test.ts +7 -3
  266. package/src/parserContext.ts +82 -48
  267. package/src/parserError.ts +143 -63
  268. package/src/parserImplementationInvariant.ts +3 -3
  269. package/src/parserInputCompanion.ts +2 -2
  270. package/src/promiseCompose.ts +2 -2
  271. package/src/regexpParser.test.ts +186 -0
  272. package/src/regexpParser.ts +94 -0
  273. package/src/regularExpression.ts +24 -0
  274. package/src/regularExpressionParser.test.ts +102 -0
  275. package/src/regularExpressionParser.ts +921 -0
  276. package/src/separatedArrayParser.ts +3 -3
  277. package/src/separatedNonEmptyArrayParser.test.ts +117 -0
  278. package/src/separatedNonEmptyArrayParser.ts +61 -0
  279. package/src/sequenceBuffer.test.ts +9 -9
  280. package/src/sequenceBuffer.ts +4 -4
  281. package/src/sequenceTerminatedSequenceParser.test.ts +3 -5
  282. package/src/sequenceTerminatedSequenceParser.ts +4 -4
  283. package/src/sequenceUnparser.ts +2 -2
  284. package/src/skipToParser.ts +2 -2
  285. package/src/sliceBoundedParser.test.ts +4 -12
  286. package/src/sliceBoundedParser.ts +2 -2
  287. package/src/smali.ts +8 -3
  288. package/src/smaliParser.test.ts +377 -66
  289. package/src/smaliParser.test.ts.md +1635 -48
  290. package/src/smaliParser.test.ts.snap +0 -0
  291. package/src/smaliParser.ts +2751 -569
  292. package/src/stringFromAsyncIterable.ts +9 -0
  293. package/src/terminatedArrayParser.test.ts +11 -11
  294. package/src/terminatedArrayParser.ts +5 -7
  295. package/src/toAsyncIterator.ts +8 -8
  296. package/src/uint8Array.ts +2 -3
  297. package/src/unionParser.test.ts +22 -23
  298. package/src/unionParser.ts +6 -8
  299. package/src/unparser.test.ts +18 -34
  300. package/src/unparser.ts +13 -9
  301. package/src/unparserContext.ts +9 -13
  302. package/src/unparserError.ts +2 -1
  303. package/src/unparserImplementationInvariant.ts +1 -1
  304. package/src/unparserOutputCompanion.ts +1 -1
  305. package/src/zip.ts +2 -6
  306. package/src/zipParser.ts +10 -18
  307. package/src/zipUnparser.test.ts +1 -1
  308. package/src/zipUnparser.ts +52 -64
  309. package/tsconfig.json +7 -1
  310. package/xo.config.ts +15 -0
  311. package/.yarn/releases/yarn-4.5.3.cjs +0 -934
@@ -1,6 +1,6 @@
1
1
  import * as fc from 'fast-check';
2
2
  import { testProp } from '@fast-check/ava';
3
- import { Parser, runParser } from './parser.js';
3
+ import { type Parser, runParser } from './parser.js';
4
4
  import { stringParserInputCompanion } from './parserInputCompanion.js';
5
5
  import { createElementTerminatedSequenceArrayParser } from './elementTerminatedSequenceArrayParser.js';
6
6
 
@@ -13,14 +13,12 @@ testProp.serial(
13
13
  })
14
14
  .map(string => ({
15
15
  string,
16
- terminator: string.slice(-1)
16
+ terminator: string.slice(-1),
17
17
  }))
18
- .filter(({ string, terminator }) => string.split(terminator).length === 2)
18
+ .filter(({ string, terminator }) => string.split(terminator).length === 2),
19
19
  ],
20
20
  async (t, { string, terminator }) => {
21
- const elementTerminatedSequenceArrayParser = createElementTerminatedSequenceArrayParser<string>(
22
- terminator,
23
- );
21
+ const elementTerminatedSequenceArrayParser = createElementTerminatedSequenceArrayParser<string>(terminator);
24
22
 
25
23
  const createTestWrapperParser = (innerParser: typeof elementTerminatedSequenceArrayParser): Parser<{
26
24
  strings: string[];
@@ -1,5 +1,5 @@
1
- import { Parser, setParserName } from "./parser.js";
2
- import { DeriveSequenceElement } from "./sequence.js";
1
+ import { type Parser, setParserName } from './parser.js';
2
+ import { type DeriveSequenceElement } from './sequence.js';
3
3
 
4
4
  export const createElementTerminatedSequenceArrayParser = <Sequence, Element = DeriveSequenceElement<Sequence>>(
5
5
  terminatorElement: Element,
@@ -1,6 +1,6 @@
1
1
  import * as fc from 'fast-check';
2
2
  import { testProp } from '@fast-check/ava';
3
- import { Parser, runParser } from './parser.js';
3
+ import { type Parser, runParser } from './parser.js';
4
4
  import { stringParserInputCompanion } from './parserInputCompanion.js';
5
5
  import { createElementTerminatedSequenceParser } from './elementTerminatedSequenceParser.js';
6
6
 
@@ -13,14 +13,12 @@ testProp.serial(
13
13
  })
14
14
  .map(string => ({
15
15
  string,
16
- terminator: string.slice(-1)
16
+ terminator: string.slice(-1),
17
17
  }))
18
- .filter(({ string, terminator }) => string.split(terminator).length === 2)
18
+ .filter(({ string, terminator }) => string.split(terminator).length === 2),
19
19
  ],
20
20
  async (t, { string, terminator }) => {
21
- const elementTerminatedSequenceParser = createElementTerminatedSequenceParser<string>(
22
- terminator,
23
- );
21
+ const elementTerminatedSequenceParser = createElementTerminatedSequenceParser<string>(terminator);
24
22
 
25
23
  const createTestWrapperParser = (innerParser: typeof elementTerminatedSequenceParser): Parser<{
26
24
  string: string;
@@ -1,5 +1,5 @@
1
- import { Parser, setParserName } from "./parser.js";
2
- import { DeriveSequenceElement } from "./sequence.js";
1
+ import { type Parser, setParserName } from './parser.js';
2
+ import { type DeriveSequenceElement } from './sequence.js';
3
3
 
4
4
  export const createElementTerminatedSequenceParser = <Sequence, Element = DeriveSequenceElement<Sequence>>(
5
5
  terminatorElement: Element,
@@ -8,4 +8,4 @@ export const createEndOfInputParser = <Sequence, Element = DeriveSequenceElement
8
8
  );
9
9
  };
10
10
 
11
- export const endOfInputParser = createEndOfInputParser<any, any>();
11
+ export const endOfInputParser = createEndOfInputParser<unknown, unknown>();
@@ -0,0 +1,41 @@
1
+ import invariant from "invariant";
2
+ import { getParserName, Parser, setParserName } from "./parser.js";
3
+ import { parserImplementationInvariant } from "./parserImplementationInvariant.js";
4
+ import { DeriveSequenceElement } from "./sequence.js";
5
+
6
+ export const createElementSwitchParser = <
7
+ Output,
8
+ Sequence,
9
+ Element = DeriveSequenceElement<Sequence>,
10
+ >(
11
+ childParsers: Map<Element, Parser<unknown, Sequence, Element>>,
12
+ defaultParser?: Parser<unknown, Sequence, Element>,
13
+ ): Parser<Output, Sequence, Element> => {
14
+ parserImplementationInvariant(childParsers.size > 0, 'Element switch parser must have at least one child parser.');
15
+
16
+ const elementSwitchParser: Parser<Output, Sequence, Element> = async parserContext => {
17
+ const currentElement = await parserContext.peek(0);
18
+
19
+ parserContext.invariant(currentElement !== undefined, 'Unexpected end of input.');
20
+ invariant(currentElement !== undefined, 'Unexpected end of input.');
21
+
22
+ const childParser = childParsers.get(currentElement) ?? defaultParser;
23
+
24
+ parserContext.invariant(childParser, `No child parser found for element: ${String(currentElement)}`);
25
+
26
+ const childParserOutput = await childParser!(parserContext) as Output;
27
+
28
+ return childParserOutput;
29
+ };
30
+
31
+ const name = [
32
+ 'elementSwitch(',
33
+ ...Array.from(childParsers.entries()).map(
34
+ ([ element, childParser ]) => `${String(element)}=>${getParserName(childParser, 'anonymousElementSwitchChild')}`,
35
+ ),
36
+ defaultParser ? `|default=>${getParserName(defaultParser, 'anonymousElementSwitchDefaultChild')}` : '',
37
+ ')',
38
+ ].join('');
39
+
40
+ return setParserName(elementSwitchParser, name);
41
+ }
@@ -0,0 +1,20 @@
1
+ import test from 'ava';
2
+ import { fetchCid } from './fetchCid.js';
3
+
4
+ const cid = 'bafybeicb3qajmwy6li7hche2nkucvytaxcyxhwhphmi73tgydjzmyoqoda';
5
+
6
+ test('fetchCid', async t => {
7
+ await Promise.all([
8
+ fetchCid(cid),
9
+ fetchCid(cid),
10
+ fetchCid(cid),
11
+ ]);
12
+
13
+ await Promise.all([
14
+ fetchCid(cid),
15
+ fetchCid(cid),
16
+ fetchCid(cid),
17
+ ]);
18
+
19
+ t.pass();
20
+ });
package/src/fetchCid.ts CHANGED
@@ -47,15 +47,13 @@ class FsCache {
47
47
  try {
48
48
  const file = await fsPromises.open(this._getKeyPath(key), 'r');
49
49
 
50
- const stream = file.readableWebStream({
51
- type: 'bytes',
52
- }) as ReadableStream<Uint8Array>;
50
+ const stream = file.readableWebStream() as ReadableStream<Uint8Array>;
53
51
 
54
52
  const streamWithClose = readableWebStreamOnFinish(stream, () => {
55
53
  file.close();
56
54
  });
57
55
 
58
- return [ streamWithClose, undefined as any ];
56
+ return [ streamWithClose, undefined as unknown as ReadableStream<Uint8Array> ];
59
57
  } catch (error) {
60
58
  if ((error as NodeJS.ErrnoException).code === 'ENOENT') {
61
59
  return undefined;
@@ -108,9 +106,7 @@ export async function fetchCid(cidOrPath: string): Promise<AsyncIterable<Uint8Ar
108
106
  if (cidOrPath.includes('/')) {
109
107
  const file = await fsPromises.open(cidOrPath, 'r');
110
108
 
111
- const stream = file.readableWebStream({
112
- type: 'bytes',
113
- }) as ReadableStream<Uint8Array>;
109
+ const stream = file.readableWebStream() as ReadableStream<Uint8Array>;
114
110
 
115
111
  const streamWithClose = readableWebStreamOnFinish(stream, () => {
116
112
  file.close();
@@ -2,7 +2,7 @@ import test from 'ava';
2
2
  import * as fc from 'fast-check';
3
3
  import { testProp } from '@fast-check/ava';
4
4
  import { createFixedLengthSequenceParser, createFixedLengthSequenceParserNaive } from './fixedLengthSequenceParser.js';
5
- import { Parser, runParserWithRemainingInput } from './parser.js';
5
+ import { type Parser, runParserWithRemainingInput } from './parser.js';
6
6
  import { stringParserInputCompanion } from './parserInputCompanion.js';
7
7
  import { HighResolutionTotalTimer } from './highResolutionTimer.js';
8
8
  import { arbitrarilySlicedAsyncIterable } from './arbitrarilySlicedAsyncInterable.js';
@@ -19,12 +19,10 @@ testProp.serial(
19
19
  max: 2n ** 14n,
20
20
  })
21
21
  .chain(length => fc.tuple(
22
- arbitrarilySlicedAsyncIterable(
23
- fc.string({
24
- minLength: Number(length),
25
- maxLength: Number(length) * 2,
26
- }),
27
- ),
22
+ arbitrarilySlicedAsyncIterable(fc.string({
23
+ minLength: Number(length),
24
+ maxLength: Number(length) * 2,
25
+ })),
28
26
  fc.constant(length),
29
27
  )),
30
28
  ],
@@ -33,8 +31,8 @@ testProp.serial(
33
31
  const fixedLengthSequenceParser = createFixedLengthSequenceParser<string>(length);
34
32
 
35
33
  const createTestWrapperParser = (innerParser: typeof fixedLengthSequenceParser): Parser<{
36
- result: string,
37
- position: number,
34
+ result: string;
35
+ position: number;
38
36
  }, string> => async parserContext => {
39
37
  const result = await innerParser(parserContext);
40
38
 
@@ -45,7 +43,7 @@ testProp.serial(
45
43
  };
46
44
  };
47
45
 
48
- const { output: actualNaive } = await naiveTotalTimer.measureAsync(() => runParserWithRemainingInput(
46
+ const { output: actualNaive } = await naiveTotalTimer.measureAsync(async () => runParserWithRemainingInput(
49
47
  createTestWrapperParser(fixedLengthSequenceParserNaive),
50
48
  sequence,
51
49
  stringParserInputCompanion,
@@ -53,7 +51,7 @@ testProp.serial(
53
51
 
54
52
  t.true(actualNaive.result.length === Number(length));
55
53
 
56
- const { output: actual } = await totalTimer.measureAsync(() => runParserWithRemainingInput(
54
+ const { output: actual } = await totalTimer.measureAsync(async () => runParserWithRemainingInput(
57
55
  createTestWrapperParser(fixedLengthSequenceParser),
58
56
  sequence,
59
57
  stringParserInputCompanion,
@@ -71,7 +69,7 @@ test.serial(
71
69
  t => {
72
70
  t.true(
73
71
  totalTimer.time * 10n < naiveTotalTimer.time,
74
- `Naive: ${naiveTotalTimer.time / 1000000n}ms, Optimized: ${totalTimer.time / 1000000n}ms`,
72
+ `Naive: ${naiveTotalTimer.time / 1_000_000n}ms, Optimized: ${totalTimer.time / 1_000_000n}ms`,
75
73
  );
76
74
  },
77
75
  );
@@ -1,10 +1,10 @@
1
1
  import { execa } from 'execa';
2
2
 
3
3
  export async function hasExecutable(executable: string) {
4
- const hasExecutable = execa(executable).then(() => true, () => false);
4
+ const hasExecutable = execa(executable).catch(() => false).then(() => true);
5
5
 
6
6
  if (!hasExecutable) {
7
- console.warn(`Executable %o not found`, executable);
7
+ console.warn('Executable %o not found', executable);
8
8
  }
9
9
 
10
10
  return hasExecutable;
@@ -1,5 +1,5 @@
1
- import invariant from 'invariant';
2
1
  import process from 'node:process';
2
+ import invariant from 'invariant';
3
3
 
4
4
  class HighResolutionSubTimer {
5
5
  private _ended = false;
package/src/index.ts CHANGED
@@ -1,16 +1,59 @@
1
-
2
1
  export {
3
2
  type Parser,
4
3
  runParser,
5
-
4
+ runParserWithRemainingInput,
6
5
  setParserName,
7
6
  getParserName,
7
+ cloneParser,
8
+ type RunParserOptions,
9
+ type RunParserWithRemainingInputResult,
8
10
  } from './parser.js';
9
11
 
10
12
  export type {
11
13
  ParserContext,
12
14
  } from './parserContext.js';
13
15
 
16
+ export {
17
+ type ParserInputCompanion,
18
+ StringParserInputCompanion,
19
+ stringParserInputCompanion,
20
+ Uint8ArrayParserInputCompanion,
21
+ uint8ArrayParserInputCompanion,
22
+ } from './parserInputCompanion.js';
23
+
24
+ export {
25
+ type UnparserOutputCompanion,
26
+ StringUnparserOutputCompanion,
27
+ stringUnparserOutputCompanion,
28
+ Uint8ArrayUnparserOutputCompanion,
29
+ uint8ArrayUnparserOutputCompanion,
30
+ } from './unparserOutputCompanion.js';
31
+
32
+ export {
33
+ type ParserError,
34
+ type ParserParsingFailedError,
35
+ type ParserParsingJoinError,
36
+ type ParserErrorModule,
37
+ isParserError,
38
+ isParserParsingFailedError,
39
+ isParserParsingJoinError,
40
+ normalParserErrorModule,
41
+ noStackCaptureOverheadParserErrorModule,
42
+ } from './parserError.js';
43
+
44
+ export {
45
+ parserCreatorCompose,
46
+ parserCreatorComposeMem,
47
+ } from './parserCreatorCompose.js';
48
+
49
+ export {
50
+ promiseCompose,
51
+ } from './promiseCompose.js';
52
+
53
+ export type {
54
+ DeriveSequenceElement,
55
+ } from './sequence.js';
56
+
14
57
  export {
15
58
  createTupleParser,
16
59
  } from './tupleParser.js';
@@ -75,11 +118,75 @@ export {
75
118
  createDebugLogParser,
76
119
  } from './debugLogParser.js';
77
120
 
121
+ export {
122
+ createNonEmptyArrayParser,
123
+ } from './nonEmptyArrayParser.js';
124
+
125
+ export {
126
+ createSeparatedArrayParser,
127
+ } from './separatedArrayParser.js';
128
+
129
+ export {
130
+ createSeparatedNonEmptyArrayParser,
131
+ } from './separatedNonEmptyArrayParser.js';
132
+
133
+ export {
134
+ createLookaheadParser,
135
+ } from './lookaheadParser.js';
136
+
137
+ export {
138
+ createNegativeLookaheadParser,
139
+ } from './negativeLookaheadParser.js';
140
+
141
+ export {
142
+ createElementTerminatedSequenceParser,
143
+ } from './elementTerminatedSequenceParser.js';
144
+
145
+ export {
146
+ createElementTerminatedSequenceArrayParser,
147
+ } from './elementTerminatedSequenceArrayParser.js';
148
+
149
+ export {
150
+ createElementTerminatedArrayParserUnsafe,
151
+ } from './elementTerminatedArrayParser.js';
152
+
153
+ export {
154
+ createSequenceTerminatedSequenceParser,
155
+ } from './sequenceTerminatedSequenceParser.js';
156
+
157
+ export {
158
+ createQuantifierParser,
159
+ } from './quantifierParser.js';
160
+
161
+ export {
162
+ createSkipToParser,
163
+ } from './skipToParser.js';
164
+
165
+ export {
166
+ createDebugLogInputParser,
167
+ } from './debugLogInputParser.js';
168
+
169
+ export {
170
+ createElementSwitchParser,
171
+ } from './exactElementSwitchParser.js';
172
+
173
+ export {
174
+ createParserConsumedSequenceParser,
175
+ } from './parserConsumedSequenceParser.js';
176
+
78
177
  export {
79
178
  type Unparser,
179
+ type UnparserResult,
80
180
  runUnparser,
81
181
  } from './unparser.js';
82
182
 
183
+ export {
184
+ type UnparserContext,
185
+ WriteLater,
186
+ WriteEarlier,
187
+ UnparserContextImplementation,
188
+ } from './unparserContext.js';
189
+
83
190
  export {
84
191
  createArrayUnparser,
85
192
  } from './arrayUnparser.js';
@@ -87,3 +194,7 @@ export {
87
194
  export {
88
195
  createSequenceUnparser,
89
196
  } from './sequenceUnparser.js';
197
+
198
+ export {
199
+ createRegExpParser,
200
+ } from './regexpParser.js';
@@ -1,9 +1,8 @@
1
1
  import test from 'ava';
2
2
  import { InputReaderImplementation } from './inputReader.js';
3
3
  import { stringParserInputCompanion } from './parserInputCompanion.js';
4
- import { ParserImplementationError } from './parserError.js';
5
4
  import { toAsyncIterable } from './toAsyncIterable.js';
6
- import { InputReaderState } from './inputReaderState.js';
5
+ import { type InputReaderState } from './inputReaderState.js';
7
6
 
8
7
  test('inputReader', async t => {
9
8
  const inputReader = new InputReaderImplementation(stringParserInputCompanion, (async function * () {
@@ -122,7 +121,7 @@ test('inputReader.peekSequence concurrent', async t => {
122
121
  yield * 'abcdefgh';
123
122
  })());
124
123
 
125
- const peeks = await Promise.all([1, 2, 3].flatMap(length => [
124
+ const peeks = await Promise.all([ 1, 2, 3 ].flatMap(length => [
126
125
  inputReader.peekSequence(0, 0 + length),
127
126
  inputReader.peekSequence(0, 0 + length),
128
127
  inputReader.peekSequence(0, 0 + length),
@@ -247,10 +246,16 @@ test('inputReader.lookahead', async t => {
247
246
  inputReader.skip(1);
248
247
 
249
248
  await t.throwsAsync(async () => lookahead0a.peek(0), {
250
- instanceOf: ParserImplementationError,
249
+ any: true,
250
+ name: 'ParserImplementationInvariantError',
251
+ });
252
+
253
+ await t.throwsAsync(async () => lookahead0b.peek(0), {
254
+ any: true,
255
+ });
256
+ await t.throwsAsync(async () => lookahead0c.peek(0), {
257
+ any: true,
251
258
  });
252
- await t.throwsAsync(async () => lookahead0b.peek(0));
253
- await t.throwsAsync(async () => lookahead0c.peek(0));
254
259
 
255
260
  const lookahead1a = inputReader.lookahead();
256
261
  const lookahead1b = inputReader.lookahead();
@@ -292,11 +297,19 @@ test('inputReader.lookahead', async t => {
292
297
 
293
298
  t.is(inputReader.position, 2);
294
299
 
295
- await t.throwsAsync(async () => lookahead0a.peek(0));
296
- await t.throwsAsync(async () => lookahead0b.peek(0));
297
- await t.throwsAsync(async () => lookahead0c.peek(0));
300
+ await t.throwsAsync(async () => lookahead0a.peek(0), {
301
+ any: true,
302
+ });
303
+ await t.throwsAsync(async () => lookahead0b.peek(0), {
304
+ any: true,
305
+ });
306
+ await t.throwsAsync(async () => lookahead0c.peek(0), {
307
+ any: true,
308
+ });
298
309
  t.is(await lookahead1a.peek(0), 'c');
299
- await t.throwsAsync(async () => lookahead1b.peek(0));
310
+ await t.throwsAsync(async () => lookahead1b.peek(0), {
311
+ any: true,
312
+ });
300
313
  t.is(await lookahead2a.peek(0), 'd');
301
314
  t.is(await lookahead2b.peek(0), 'c');
302
315
 
@@ -376,9 +389,9 @@ async function inputReaderStateToArray<Sequence>({
376
389
  unconsumedBufferedSequences,
377
390
  consumedBufferedSequences,
378
391
  unbufferedSequences,
379
- }: InputReaderState<Sequence>): Promise<(Sequence | typeof END_OF_CONSUMED_SEQUENCES | typeof END_OF_BUFFERED_SEQUENCES)[]> {
380
- const unconsumedBufferedSequencesArray = unconsumedBufferedSequences.slice();
381
- const consumedBufferedSequencesArray = consumedBufferedSequences.slice();
392
+ }: InputReaderState<Sequence>): Promise<Array<Sequence | typeof END_OF_CONSUMED_SEQUENCES | typeof END_OF_BUFFERED_SEQUENCES>> {
393
+ const unconsumedBufferedSequencesArray = [ ...unconsumedBufferedSequences ];
394
+ const consumedBufferedSequencesArray = [ ...consumedBufferedSequences ];
382
395
 
383
396
  const unbufferedSequencesArray = [];
384
397
  if (unbufferedSequences) {
@@ -396,43 +409,10 @@ async function inputReaderStateToArray<Sequence>({
396
409
  ];
397
410
  }
398
411
 
399
- for (const [
400
- input,
401
- position,
402
- expected,
403
- ] of [
404
- [
405
- [ '', 'abc', 'def', '', 'gh' ],
406
- 0,
407
- [ END_OF_CONSUMED_SEQUENCES, 'abc', END_OF_BUFFERED_SEQUENCES, 'def', '', 'gh' ],
408
- ],
409
- [
410
- [ '', 'abc', 'def', '', 'gh' ],
411
- 1,
412
- [ 'a', END_OF_CONSUMED_SEQUENCES, 'bc', END_OF_BUFFERED_SEQUENCES, 'def', '', 'gh' ],
413
- ],
414
- [
415
- [ '', 'abc', 'def', '', 'gh' ],
416
- 2,
417
- [ 'ab', END_OF_CONSUMED_SEQUENCES, 'c', END_OF_BUFFERED_SEQUENCES, 'def', '', 'gh' ],
418
- ],
419
- [
420
- [ '', 'abc', 'def', '', 'gh' ],
421
- 3,
422
- [ END_OF_CONSUMED_SEQUENCES, 'def', END_OF_BUFFERED_SEQUENCES, '', 'gh' ],
423
- ],
424
- [
425
- [ '', 'abc', 'def', '', 'gh' ],
426
- 4,
427
- [ 'd', END_OF_CONSUMED_SEQUENCES, 'ef', END_OF_BUFFERED_SEQUENCES, '', 'gh' ],
428
- ],
429
- [
430
- [ '', 'abc', 'def', '', 'gh' ],
431
- 8,
432
- [ END_OF_CONSUMED_SEQUENCES, END_OF_BUFFERED_SEQUENCES ],
433
- ],
434
- ] as const) {
435
- test('inputReader.toInputReaderState ' + JSON.stringify({ input, position }), async t => {
412
+ const inputReaderStateMacro = test.macro({
413
+ title: (providedTitle, input: readonly string[], position: number) =>
414
+ providedTitle ?? `inputReader.toInputReaderState ${JSON.stringify({ input, position })}`,
415
+ async exec(t, input: readonly string[], position: number, expected: ReadonlyArray<string | symbol>) {
436
416
  const inputReader = new InputReaderImplementation(stringParserInputCompanion, (async function * () {
437
417
  yield * input;
438
418
  })());
@@ -443,5 +423,12 @@ for (const [
443
423
  const actual = await inputReaderStateToArray(inputReader.toInputReaderState());
444
424
 
445
425
  t.deepEqual(actual, expected);
446
- });
447
- }
426
+ },
427
+ });
428
+
429
+ test(inputReaderStateMacro, [ '', 'abc', 'def', '', 'gh' ], 0, [ END_OF_CONSUMED_SEQUENCES, 'abc', END_OF_BUFFERED_SEQUENCES, 'def', '', 'gh' ]);
430
+ test(inputReaderStateMacro, [ '', 'abc', 'def', '', 'gh' ], 1, [ 'a', END_OF_CONSUMED_SEQUENCES, 'bc', END_OF_BUFFERED_SEQUENCES, 'def', '', 'gh' ]);
431
+ test(inputReaderStateMacro, [ '', 'abc', 'def', '', 'gh' ], 2, [ 'ab', END_OF_CONSUMED_SEQUENCES, 'c', END_OF_BUFFERED_SEQUENCES, 'def', '', 'gh' ]);
432
+ test(inputReaderStateMacro, [ '', 'abc', 'def', '', 'gh' ], 3, [ END_OF_CONSUMED_SEQUENCES, 'def', END_OF_BUFFERED_SEQUENCES, '', 'gh' ]);
433
+ test(inputReaderStateMacro, [ '', 'abc', 'def', '', 'gh' ], 4, [ 'd', END_OF_CONSUMED_SEQUENCES, 'ef', END_OF_BUFFERED_SEQUENCES, '', 'gh' ]);
434
+ test(inputReaderStateMacro, [ '', 'abc', 'def', '', 'gh' ], 8, [ END_OF_CONSUMED_SEQUENCES, END_OF_BUFFERED_SEQUENCES ]);
@@ -3,7 +3,7 @@ import invariant from 'invariant';
3
3
  import { type SequenceBuffer, SequenceBufferImplementation } from './sequenceBuffer.js';
4
4
  import { type ParserInputCompanion } from './parserInputCompanion.js';
5
5
  import { parserImplementationInvariant } from './parserImplementationInvariant.js';
6
- import { InputReaderState } from './inputReaderState.js';
6
+ import { type InputReaderState } from './inputReaderState.js';
7
7
 
8
8
  export type InputReader<Sequence, Element> = {
9
9
  get position(): number;
@@ -169,9 +169,7 @@ class InputReaderLookaheadImplementation<Sequence, Element> implements InputRead
169
169
  private _initialInputReaderPosition = 0;
170
170
  private _offset = 0;
171
171
 
172
- constructor(
173
- private readonly _inputReader: InputReaderImplementation<Sequence, Element>,
174
- ) {
172
+ constructor(private readonly _inputReader: InputReaderImplementation<Sequence, Element>) {
175
173
  this._initialInputReaderPosition = this._inputReader.position;
176
174
  }
177
175
 
@@ -12,7 +12,7 @@ export const inputReaderStateCompanion = {
12
12
  }: InputReaderState<Sequence>): boolean {
13
13
  return (
14
14
  unconsumedBufferedSequences.length === 0
15
- && unbufferedSequences === undefined
15
+ && unbufferedSequences === undefined
16
16
  );
17
17
  },
18
18
 
package/src/inspect.ts CHANGED
@@ -6,4 +6,4 @@ export const inspect = (value: unknown) => {
6
6
  }
7
7
 
8
8
  return nodeInspect(value);
9
- }
9
+ };
@@ -4,19 +4,17 @@ import { runParser } from './parser.js';
4
4
  import { javaKeyStoreParser } from './javaKeyStoreParser.js';
5
5
  import { fetchCid } from './fetchCid.js';
6
6
 
7
- for (const javaKeyStoreCid of [
8
- 'bafkreig6k53b6p7bdvfjxc5mcb4qv3mffqls5ymqerxkqd6ih2xy5cs3n4',
9
- ]) {
10
- test(
11
- 'javaKeyStore ' + javaKeyStoreCid,
12
- async t => {
13
- const javaKeyStoreStream = await fetchCid(javaKeyStoreCid);
7
+ const javaKeyStoreMacro = test.macro({
8
+ title: (providedTitle, javaKeyStoreCid: string) => providedTitle ?? `javaKeyStore ${javaKeyStoreCid}`,
9
+ async exec(t, javaKeyStoreCid: string) {
10
+ const javaKeyStoreStream = await fetchCid(javaKeyStoreCid);
14
11
 
15
- const actual = await runParser(javaKeyStoreParser, javaKeyStoreStream, uint8ArrayParserInputCompanion, {
16
- errorJoinMode: 'all',
17
- });
12
+ const actual = await runParser(javaKeyStoreParser, javaKeyStoreStream, uint8ArrayParserInputCompanion, {
13
+ errorJoinMode: 'all',
14
+ });
18
15
 
19
- t.snapshot(actual);
20
- },
21
- );
22
- }
16
+ t.snapshot(actual);
17
+ },
18
+ });
19
+
20
+ test(javaKeyStoreMacro, 'bafkreig6k53b6p7bdvfjxc5mcb4qv3mffqls5ymqerxkqd6ih2xy5cs3n4');
@@ -66,9 +66,7 @@ const javaKeyStorePrivateKeyEntryCertificateParser = promiseCompose(
66
66
  ([ type, certificate ]) => ({ type, certificate }),
67
67
  );
68
68
 
69
- const javaKeyStorePrivateKeyEntryCertificateChainParser = createUint32BECountPrefixedParser(
70
- javaKeyStorePrivateKeyEntryCertificateParser,
71
- );
69
+ const javaKeyStorePrivateKeyEntryCertificateChainParser = createUint32BECountPrefixedParser(javaKeyStorePrivateKeyEntryCertificateParser);
72
70
 
73
71
  const javaKeyStorePrivateKeyEntryParser = promiseCompose(
74
72
  createTupleParser([
@@ -109,9 +107,7 @@ const javaKeyStoreEntryParser = createUnionParser([
109
107
  javaKeyStoreSecretKeyEntryParser,
110
108
  ]);
111
109
 
112
- const javaKeyStoreEntriesParser = createUint32BECountPrefixedParser(
113
- javaKeyStoreEntryParser,
114
- );
110
+ const javaKeyStoreEntriesParser = createUint32BECountPrefixedParser(javaKeyStoreEntryParser);
115
111
 
116
112
  const javaKeyStoreParser_ = createTupleParser([
117
113
  javaKeyStoreImplementationParser,
@@ -7,10 +7,8 @@ import { stringParserInputCompanion } from './parserInputCompanion.js';
7
7
  testProp(
8
8
  'json',
9
9
  [
10
- arbitrarilySlicedAsyncIterator(
11
- fc.tuple(fc.json(), fc.nat())
12
- .map(([ jsonString, indent ]) => JSON.stringify(JSON.parse(jsonString), null, indent)),
13
- ),
10
+ arbitrarilySlicedAsyncIterator(fc.tuple(fc.json(), fc.nat())
11
+ .map(([ jsonString, indent ]) => JSON.stringify(JSON.parse(jsonString), null, indent))),
14
12
  ],
15
13
  async (t, [ jsonString, jsonStringChunkIterator ]) => {
16
14
  const actual = await runParser(jsonValueParser, jsonStringChunkIterator, stringParserInputCompanion, {