@futpib/parser 1.0.0 → 1.0.2
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.
- package/build/allSettledStream.js +32 -14
- package/build/allSettledStream.test.js +32 -0
- package/build/androidPackage.d.ts +39 -0
- package/build/androidPackageParser.d.ts +17 -0
- package/build/androidPackageParser.js +183 -0
- package/build/{apkParser.test.js → androidPackageParser.test.js} +7 -7
- package/build/androidPackageUnparser.d.ts +4 -0
- package/build/androidPackageUnparser.js +90 -0
- package/build/androidPackageUnparser.test.js +26 -0
- package/build/arbitrarilySlicedAsyncInterable.d.ts +3 -1
- package/build/arbitrarilySlicedAsyncInterable.js +3 -3
- package/build/arbitraryFileSystemEntry.js +1 -1
- package/build/arbitraryZip.d.ts +1 -1
- package/build/arbitraryZip.js +13 -19
- package/build/arbitraryZipPermissions.d.ts +1 -8
- package/build/arbitraryZipPermissions.js +1 -16
- package/build/arbitraryZipStream.d.ts +1 -1
- package/build/arbitraryZipStream.js +3 -3
- package/build/arrayParser.d.ts +1 -1
- package/build/arrayParser.js +2 -2
- package/build/arrayParser.test.js +4 -4
- package/build/arrayUnparser.d.ts +2 -0
- package/build/arrayUnparser.js +8 -0
- package/build/backsmali.d.ts +1 -0
- package/build/backsmali.js +22 -0
- package/build/bsonParser.js +6 -2
- package/build/bsonParser.test.js +2 -2
- package/build/{parserInvariant.d.ts → customInvariant.d.ts} +1 -1
- package/build/{parserInvariant.js → customInvariant.js} +1 -1
- package/build/dalvikBytecodeParser/formatParsers.d.ts +97 -0
- package/build/dalvikBytecodeParser/formatParsers.js +169 -0
- package/build/dalvikBytecodeParser.d.ts +107 -0
- package/build/dalvikBytecodeParser.js +836 -0
- package/build/dalvikExecutable.d.ts +158 -0
- package/build/dalvikExecutable.js +20 -0
- package/build/dalvikExecutableParser/stringSyntaxParser.d.ts +4 -0
- package/build/dalvikExecutableParser/stringSyntaxParser.js +76 -0
- package/build/dalvikExecutableParser/typeParsers.d.ts +10 -0
- package/build/dalvikExecutableParser/typeParsers.js +34 -0
- package/build/dalvikExecutableParser/typedNumbers.d.ts +90 -0
- package/build/dalvikExecutableParser/typedNumbers.js +19 -0
- package/build/dalvikExecutableParser.d.ts +5 -0
- package/build/dalvikExecutableParser.js +1439 -0
- package/build/dalvikExecutableParser.test.js +70 -0
- package/build/dalvikExecutableParserAgainstSmaliParser.test.js +298 -0
- package/build/debugLogInputParser.d.ts +4 -0
- package/build/debugLogInputParser.js +16 -0
- package/build/debugLogParser.d.ts +1 -1
- package/build/debugLogParser.js +15 -4
- package/build/disjunctionParser.d.ts +2 -1
- package/build/disjunctionParser.js +4 -2
- package/build/elementParser.d.ts +2 -2
- package/build/elementParser.js +1 -1
- package/build/elementTerminatedArrayParser.d.ts +3 -0
- package/build/elementTerminatedArrayParser.js +18 -0
- package/build/elementTerminatedArrayParser.test.js +52 -0
- package/build/elementTerminatedSequenceArrayParser.d.ts +3 -0
- package/build/elementTerminatedSequenceArrayParser.js +32 -0
- package/build/elementTerminatedSequenceArrayParser.test.js +34 -0
- package/build/elementTerminatedSequenceParser.d.ts +3 -0
- package/build/elementTerminatedSequenceParser.js +27 -0
- package/build/elementTerminatedSequenceParser.test.js +34 -0
- package/build/endOfInputParser.d.ts +2 -2
- package/build/exactElementParser.d.ts +1 -1
- package/build/exactElementParser.js +10 -5
- package/build/exactSequenceParser.d.ts +2 -1
- package/build/exactSequenceParser.js +12 -2
- package/build/fetchCid.d.ts +1 -0
- package/build/fetchCid.js +107 -0
- package/build/fixedLengthSequenceParser.d.ts +1 -0
- package/build/fixedLengthSequenceParser.js +18 -1
- package/build/fixedLengthSequenceParser.test.js +41 -0
- package/build/hasExecutable.d.ts +1 -0
- package/build/hasExecutable.js +8 -0
- package/build/highResolutionTimer.d.ts +16 -0
- package/build/highResolutionTimer.js +42 -0
- package/build/index.d.ts +5 -2
- package/build/index.js +3 -0
- package/build/inputReader.d.ts +14 -3
- package/build/inputReader.js +43 -6
- package/build/inputReader.test.js +172 -7
- package/build/inputReaderState.d.ts +10 -0
- package/build/inputReaderState.js +16 -0
- package/build/inspect.d.ts +1 -0
- package/build/inspect.js +7 -0
- package/build/javaKeyStoreParser.d.ts +2 -0
- package/build/javaKeyStoreParser.js +67 -0
- package/build/javaKeyStoreParser.test.d.ts +1 -0
- package/build/javaKeyStoreParser.test.js +16 -0
- package/build/jsonParser.d.ts +2 -0
- package/build/jsonParser.js +13 -15
- package/build/jsonParser.test.js +2 -2
- package/build/leb128Parser.d.ts +7 -0
- package/build/leb128Parser.js +82 -0
- package/build/leb128Parser.test.d.ts +1 -0
- package/build/leb128Parser.test.js +107 -0
- package/build/listParser.d.ts +1 -1
- package/build/listParser.js +5 -5
- package/build/lookaheadParser.d.ts +2 -0
- package/build/lookaheadParser.js +14 -0
- package/build/{negativeLookahead.d.ts → negativeLookaheadParser.d.ts} +1 -1
- package/build/negativeLookaheadParser.js +24 -0
- package/build/negativeLookaheadParser.test.d.ts +1 -0
- package/build/negativeLookaheadParser.test.js +30 -0
- package/build/nonEmptyArrayParser.d.ts +2 -0
- package/build/nonEmptyArrayParser.js +32 -0
- package/build/nonEmptyArrayParser.test.d.ts +1 -0
- package/build/nonEmptyArrayParser.test.js +16 -0
- package/build/optionalParser.d.ts +1 -1
- package/build/optionalParser.js +2 -2
- package/build/parser.d.ts +13 -4
- package/build/parser.js +67 -32
- package/build/parser.test.js +94 -27
- package/build/parserAccessorParser.d.ts +1 -1
- package/build/parserAccessorParser.js +9 -1
- package/build/parserConsumedSequenceParser.d.ts +2 -0
- package/build/parserConsumedSequenceParser.js +22 -0
- package/build/parserContext.d.ts +20 -6
- package/build/parserContext.js +70 -40
- package/build/parserContext.test.js +34 -7
- package/build/parserCreatorCompose.d.ts +4 -3
- package/build/parserCreatorCompose.js +9 -3
- package/build/parserError.d.ts +6 -0
- package/build/parserError.js +6 -6
- package/build/parserImplementationInvariant.d.ts +1 -1
- package/build/parserImplementationInvariant.js +2 -2
- package/build/parserInputCompanion.d.ts +35 -0
- package/build/parserInputCompanion.js +68 -0
- package/build/promiseCompose.d.ts +1 -1
- package/build/promiseCompose.js +12 -1
- package/build/promiseSettled.d.ts +1 -0
- package/build/promiseSettled.js +4 -0
- package/build/quantifierParser.d.ts +2 -0
- package/build/quantifierParser.js +17 -0
- package/build/separatedArrayParser.d.ts +2 -0
- package/build/separatedArrayParser.js +39 -0
- package/build/separatedArrayParser.test.d.ts +1 -0
- package/build/separatedArrayParser.test.js +21 -0
- package/build/sequenceBuffer.d.ts +13 -3
- package/build/sequenceBuffer.js +60 -8
- package/build/sequenceBuffer.test.js +59 -2
- package/build/sequenceTerminatedSequenceParser.d.ts +5 -0
- package/build/sequenceTerminatedSequenceParser.js +32 -0
- package/build/sequenceTerminatedSequenceParser.test.d.ts +1 -0
- package/build/sequenceTerminatedSequenceParser.test.js +37 -0
- package/build/sequenceUnparser.d.ts +2 -0
- package/build/sequenceUnparser.js +6 -0
- package/build/skipParser.d.ts +1 -1
- package/build/skipParser.js +4 -2
- package/build/skipToParser.d.ts +2 -0
- package/build/skipToParser.js +11 -0
- package/build/sliceBoundedParser.d.ts +2 -2
- package/build/sliceBoundedParser.js +8 -3
- package/build/sliceBoundedParser.test.js +37 -3
- package/build/smali.d.ts +1 -0
- package/build/smali.js +17 -0
- package/build/smaliParser.d.ts +12 -0
- package/build/smaliParser.js +656 -0
- package/build/smaliParser.test.d.ts +1 -0
- package/build/smaliParser.test.js +115 -0
- package/build/terminatedArrayParser.d.ts +4 -2
- package/build/terminatedArrayParser.js +82 -5
- package/build/terminatedArrayParser.test.d.ts +1 -0
- package/build/terminatedArrayParser.test.js +131 -0
- package/build/toAsyncIterable.d.ts +1 -0
- package/build/toAsyncIterable.js +7 -0
- package/build/toAsyncIterator.d.ts +1 -0
- package/build/toAsyncIterator.js +33 -0
- package/build/tupleParser.d.ts +4 -0
- package/build/tupleParser.js +1 -5
- package/build/uint8Array.d.ts +1 -0
- package/build/uint8Array.js +7 -0
- package/build/unionParser.d.ts +2 -1
- package/build/unionParser.js +27 -12
- package/build/unionParser.test.d.ts +1 -0
- package/build/unionParser.test.js +60 -0
- package/build/unparser.d.ts +8 -0
- package/build/unparser.js +104 -0
- package/build/unparser.test.d.ts +1 -0
- package/build/unparser.test.js +150 -0
- package/build/unparserContext.d.ts +31 -0
- package/build/unparserContext.js +74 -0
- package/build/unparserError.d.ts +9 -0
- package/build/unparserError.js +9 -0
- package/build/unparserImplementationInvariant.d.ts +2 -0
- package/build/unparserImplementationInvariant.js +5 -0
- package/build/unparserOutputCompanion.d.ts +15 -0
- package/build/unparserOutputCompanion.js +13 -0
- package/build/zip.d.ts +9 -17
- package/build/zipParser.d.ts +20 -12
- package/build/zipParser.js +83 -71
- package/build/zipParser.test.js +2 -7
- package/build/zipUnparser.d.ts +8 -0
- package/build/zipUnparser.js +200 -0
- package/build/zipUnparser.test.d.ts +1 -0
- package/build/zipUnparser.test.js +80 -0
- package/package.json +26 -8
- package/src/allSettledStream.test.ts +40 -0
- package/src/allSettledStream.ts +47 -15
- package/src/androidPackage.ts +48 -0
- package/src/{apkParser.test.ts → androidPackageParser.test.ts} +7 -8
- package/src/androidPackageParser.test.ts.md +271 -0
- package/src/androidPackageParser.test.ts.snap +0 -0
- package/src/androidPackageParser.ts +440 -0
- package/src/androidPackageUnparser.test.ts +36 -0
- package/src/androidPackageUnparser.ts +120 -0
- package/src/arbitrarilySlicedAsyncInterable.ts +7 -2
- package/src/arbitraryFileSystemEntry.ts +2 -4
- package/src/arbitraryZip.ts +20 -27
- package/src/arbitraryZipPermissions.ts +0 -25
- package/src/arbitraryZipStream.ts +4 -4
- package/src/arrayParser.test.ts +4 -4
- package/src/arrayParser.ts +3 -2
- package/src/arrayUnparser.ts +13 -0
- package/src/backsmali.ts +30 -0
- package/src/bsonParser.test.ts +2 -2
- package/src/bsonParser.ts +16 -5
- package/src/{parserInvariant.ts → customInvariant.ts} +2 -2
- package/src/dalvikBytecodeParser/formatParsers.ts +421 -0
- package/src/dalvikBytecodeParser.ts +2074 -0
- package/src/dalvikExecutable.ts +220 -0
- package/src/dalvikExecutableParser/stringSyntaxParser.ts +145 -0
- package/src/dalvikExecutableParser/typeParsers.ts +65 -0
- package/src/dalvikExecutableParser/typedNumbers.ts +57 -0
- package/src/dalvikExecutableParser.test.ts +89 -0
- package/src/dalvikExecutableParser.test.ts.md +634 -0
- package/src/dalvikExecutableParser.test.ts.snap +0 -0
- package/src/dalvikExecutableParser.ts +2768 -0
- package/src/dalvikExecutableParserAgainstSmaliParser.test.ts +346 -0
- package/src/debugLogInputParser.ts +28 -0
- package/src/debugLogParser.ts +20 -4
- package/src/disjunctionParser.ts +10 -5
- package/src/elementParser.ts +3 -3
- package/src/elementTerminatedArrayParser.test.ts +99 -0
- package/src/elementTerminatedArrayParser.ts +31 -0
- package/src/elementTerminatedSequenceArrayParser.test.ts +54 -0
- package/src/elementTerminatedSequenceArrayParser.ts +52 -0
- package/src/elementTerminatedSequenceParser.test.ts +54 -0
- package/src/elementTerminatedSequenceParser.ts +43 -0
- package/src/endOfInputParser.ts +4 -4
- package/src/exactElementParser.ts +18 -12
- package/src/exactSequenceParser.ts +24 -3
- package/src/fetchCid.ts +125 -0
- package/src/fixedLengthSequenceParser.test.ts +77 -0
- package/src/fixedLengthSequenceParser.ts +28 -1
- package/src/hasExecutable.ts +11 -0
- package/src/highResolutionTimer.ts +49 -0
- package/src/index.ts +15 -2
- package/src/inputReader.test.ts +216 -7
- package/src/inputReader.ts +80 -5
- package/src/inputReaderState.ts +33 -0
- package/src/inspect.ts +9 -0
- package/src/javaKeyStore.ts +0 -0
- package/src/javaKeyStoreParser.test.ts +22 -0
- package/src/javaKeyStoreParser.test.ts.md +103 -0
- package/src/javaKeyStoreParser.test.ts.snap +0 -0
- package/src/javaKeyStoreParser.ts +136 -0
- package/src/jsonParser.test.ts +2 -2
- package/src/jsonParser.ts +23 -34
- package/src/leb128Parser.test.ts +171 -0
- package/src/leb128Parser.ts +125 -0
- package/src/listParser.ts +6 -6
- package/src/lookaheadParser.ts +19 -0
- package/src/negativeLookaheadParser.test.ts +53 -0
- package/src/negativeLookaheadParser.ts +36 -0
- package/src/nonEmptyArrayParser.test.ts +20 -0
- package/src/nonEmptyArrayParser.ts +44 -0
- package/src/optionalParser.ts +4 -3
- package/src/parser.test.ts +148 -27
- package/src/parser.test.ts.md +21 -21
- package/src/parser.test.ts.snap +0 -0
- package/src/parser.ts +153 -49
- package/src/parserAccessorParser.ts +12 -2
- package/src/parserConsumedSequenceParser.ts +29 -0
- package/src/parserContext.test.ts +38 -7
- package/src/parserContext.ts +127 -51
- package/src/parserCreatorCompose.ts +25 -7
- package/src/parserError.ts +9 -6
- package/src/parserImplementationInvariant.ts +2 -2
- package/src/parserInputCompanion.ts +102 -0
- package/src/promiseCompose.ts +17 -3
- package/src/promiseSettled.ts +6 -0
- package/src/quantifierParser.ts +25 -0
- package/src/separatedArrayParser.test.ts +34 -0
- package/src/separatedArrayParser.ts +55 -0
- package/src/sequenceBuffer.test.ts +72 -2
- package/src/sequenceBuffer.ts +93 -7
- package/src/sequenceTerminatedSequenceParser.test.ts +60 -0
- package/src/sequenceTerminatedSequenceParser.ts +62 -0
- package/src/sequenceUnparser.ts +9 -0
- package/src/skipParser.ts +7 -5
- package/src/skipToParser.ts +16 -0
- package/src/sliceBoundedParser.test.ts +45 -3
- package/src/sliceBoundedParser.ts +21 -3
- package/src/smali.ts +24 -0
- package/src/smaliParser.test.ts +132 -0
- package/src/smaliParser.test.ts.md +2320 -0
- package/src/smaliParser.test.ts.snap +0 -0
- package/src/smaliParser.ts +1166 -0
- package/src/terminatedArrayParser.test.ts +258 -0
- package/src/terminatedArrayParser.ts +111 -6
- package/src/toAsyncIterable.ts +7 -0
- package/src/toAsyncIterator.ts +48 -0
- package/src/tupleParser.ts +8 -5
- package/src/uint8Array.ts +10 -0
- package/src/unionParser.test.ts +79 -0
- package/src/unionParser.ts +44 -16
- package/src/unparser.test.ts +221 -0
- package/src/unparser.ts +209 -0
- package/src/unparserContext.ts +127 -0
- package/src/unparserError.ts +12 -0
- package/src/unparserImplementationInvariant.ts +6 -0
- package/src/unparserOutputCompanion.ts +24 -0
- package/src/zip.ts +10 -22
- package/src/zipParser.test.ts +2 -8
- package/src/zipParser.ts +223 -146
- package/src/zipUnparser.test.ts +119 -0
- package/src/zipUnparser.ts +300 -0
- package/build/apk.d.ts +0 -13
- package/build/apkParser.d.ts +0 -3
- package/build/apkParser.js +0 -135
- package/build/arbitraryDosDate.d.ts +0 -2
- package/build/arbitraryDosDate.js +0 -8
- package/build/arbitraryZipEntry.d.ts +0 -3
- package/build/arbitraryZipEntry.js +0 -26
- package/build/createDisjunctionParser.d.ts +0 -2
- package/build/createDisjunctionParser.js +0 -47
- package/build/createExactParser.d.ts +0 -2
- package/build/createExactParser.js +0 -12
- package/build/createSequentialUnionParser.d.ts +0 -2
- package/build/createSequentialUnionParser.js +0 -69
- package/build/fixedLengthChunkParser.d.ts +0 -2
- package/build/fixedLengthChunkParser.js +0 -12
- package/build/fixedLengthParser.d.ts +0 -2
- package/build/fixedLengthParser.js +0 -12
- package/build/inputChunkBuffer.d.ts +0 -15
- package/build/inputChunkBuffer.js +0 -40
- package/build/inputChunkBuffer.test.js +0 -34
- package/build/inputCompanion.d.ts +0 -18
- package/build/inputCompanion.js +0 -28
- package/build/invariantDefined.d.ts +0 -1
- package/build/invariantDefined.js +0 -5
- package/build/invariantIdentity.d.ts +0 -3
- package/build/invariantIdentity.js +0 -5
- package/build/jsonParser2.d.ts +0 -3
- package/build/jsonParser2.js +0 -52
- package/build/jsonParser2.test.js +0 -22
- package/build/negativeLookahead.js +0 -20
- package/build/parserCompose.d.ts +0 -3
- package/build/parserCompose.js +0 -7
- package/build/parserImplementationInvariantInvariant.d.ts +0 -3
- package/build/parserImplementationInvariantInvariant.js +0 -15
- package/build/promiseFish.d.ts +0 -1
- package/build/promiseFish.js +0 -3
- package/build/sequenceParser.d.ts +0 -3
- package/build/sequenceParser.js +0 -10
- package/build/terminatedSequenceParser.d.ts +0 -2
- package/build/terminatedSequenceParser.js +0 -24
- package/build/zipEntry.d.ts +0 -28
- package/build/zipFile.d.ts +0 -32
- package/build/zipFileEntry.d.ts +0 -6
- package/src/apk.ts +0 -16
- package/src/apkParser.test.ts.md +0 -268
- package/src/apkParser.test.ts.snap +0 -0
- package/src/apkParser.ts +0 -327
- package/src/inputCompanion.ts +0 -43
- package/src/invariantDefined.ts +0 -6
- package/src/invariantIdentity.ts +0 -8
- package/src/negativeLookahead.ts +0 -26
- /package/build/{apk.js → androidPackage.js} +0 -0
- /package/build/{apkParser.test.d.ts → androidPackageParser.test.d.ts} +0 -0
- /package/build/{arbitraryDosPermissions.d.ts → androidPackageUnparser.test.d.ts} +0 -0
- /package/build/{arbitraryDosPermissions.js → dalvikExecutableParser.test.d.ts} +0 -0
- /package/build/{inputChunkBuffer.test.d.ts → dalvikExecutableParserAgainstSmaliParser.test.d.ts} +0 -0
- /package/build/{jsonParser2.test.d.ts → elementTerminatedArrayParser.test.d.ts} +0 -0
- /package/build/{parserParsingInvariant.d.ts → elementTerminatedSequenceArrayParser.test.d.ts} +0 -0
- /package/build/{parserParsingInvariant.js → elementTerminatedSequenceParser.test.d.ts} +0 -0
- /package/build/{zipEntry.js → fixedLengthSequenceParser.test.d.ts} +0 -0
- /package/build/{zipFile.js → javaKeyStore.d.ts} +0 -0
- /package/build/{zipFileEntry.js → javaKeyStore.js} +0 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Parser, setParserName } from "./parser.js";
|
|
2
|
+
import { DeriveSequenceElement } from "./sequence.js";
|
|
3
|
+
|
|
4
|
+
export const createElementTerminatedSequenceArrayParser = <Sequence, Element = DeriveSequenceElement<Sequence>>(
|
|
5
|
+
terminatorElement: Element,
|
|
6
|
+
): Parser<Sequence[], Sequence, Element> => {
|
|
7
|
+
const elementTerminatedSequenceArrayParser: Parser<Sequence[], Sequence, Element> = async parserContext => {
|
|
8
|
+
const sequences: Sequence[] = [];
|
|
9
|
+
|
|
10
|
+
let start = 0;
|
|
11
|
+
let window = 1;
|
|
12
|
+
|
|
13
|
+
while (true) {
|
|
14
|
+
const sequence = await parserContext.peekSequence(start, start + window);
|
|
15
|
+
|
|
16
|
+
if (sequence === undefined) {
|
|
17
|
+
window = Math.floor(window / 2);
|
|
18
|
+
|
|
19
|
+
if (start === 0 && window === 0) {
|
|
20
|
+
break;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
parserContext.invariant(window > 0, 'Unexpected end of input without terminator');
|
|
24
|
+
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const terminatorIndex = parserContext.indexOf(sequence, terminatorElement);
|
|
29
|
+
|
|
30
|
+
if (terminatorIndex === -1) {
|
|
31
|
+
start += window;
|
|
32
|
+
window *= 2;
|
|
33
|
+
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const sequence_ = await parserContext.readSequence(0, start + terminatorIndex);
|
|
38
|
+
|
|
39
|
+
parserContext.skip(1);
|
|
40
|
+
|
|
41
|
+
sequences.push(sequence_);
|
|
42
|
+
|
|
43
|
+
start = 0;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return sequences;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
setParserName(elementTerminatedSequenceArrayParser, `(.*?${JSON.stringify(terminatorElement)})*`);
|
|
50
|
+
|
|
51
|
+
return elementTerminatedSequenceArrayParser;
|
|
52
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as fc from 'fast-check';
|
|
2
|
+
import { testProp } from '@fast-check/ava';
|
|
3
|
+
import { Parser, runParser } from './parser.js';
|
|
4
|
+
import { stringParserInputCompanion } from './parserInputCompanion.js';
|
|
5
|
+
import { createElementTerminatedSequenceParser } from './elementTerminatedSequenceParser.js';
|
|
6
|
+
|
|
7
|
+
testProp.serial(
|
|
8
|
+
'elementTerminatedSequenceParser',
|
|
9
|
+
[
|
|
10
|
+
fc
|
|
11
|
+
.string({
|
|
12
|
+
minLength: 1,
|
|
13
|
+
})
|
|
14
|
+
.map(string => ({
|
|
15
|
+
string,
|
|
16
|
+
terminator: string.slice(-1)
|
|
17
|
+
}))
|
|
18
|
+
.filter(({ string, terminator }) => string.split(terminator).length === 2)
|
|
19
|
+
],
|
|
20
|
+
async (t, { string, terminator }) => {
|
|
21
|
+
const elementTerminatedSequenceParser = createElementTerminatedSequenceParser<string>(
|
|
22
|
+
terminator,
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
const createTestWrapperParser = (innerParser: typeof elementTerminatedSequenceParser): Parser<{
|
|
26
|
+
string: string;
|
|
27
|
+
nextPeek: string | undefined;
|
|
28
|
+
position: number;
|
|
29
|
+
}, string> => async parserContext => {
|
|
30
|
+
const string = await innerParser(parserContext);
|
|
31
|
+
|
|
32
|
+
return {
|
|
33
|
+
string,
|
|
34
|
+
nextPeek: await parserContext.peek(0),
|
|
35
|
+
position: parserContext.position,
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const actual = await runParser(
|
|
40
|
+
createTestWrapperParser(elementTerminatedSequenceParser),
|
|
41
|
+
string,
|
|
42
|
+
stringParserInputCompanion,
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
t.deepEqual(actual, {
|
|
46
|
+
string: string.split(terminator)[0],
|
|
47
|
+
nextPeek: undefined,
|
|
48
|
+
position: string.length,
|
|
49
|
+
});
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
verbose: true,
|
|
53
|
+
},
|
|
54
|
+
);
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Parser, setParserName } from "./parser.js";
|
|
2
|
+
import { DeriveSequenceElement } from "./sequence.js";
|
|
3
|
+
|
|
4
|
+
export const createElementTerminatedSequenceParser = <Sequence, Element = DeriveSequenceElement<Sequence>>(
|
|
5
|
+
terminatorElement: Element,
|
|
6
|
+
): Parser<Sequence, Sequence, Element> => {
|
|
7
|
+
const elementTerminatedSequenceParser: Parser<Sequence, Sequence, Element> = async parserContext => {
|
|
8
|
+
let start = 0;
|
|
9
|
+
let window = 1;
|
|
10
|
+
|
|
11
|
+
while (true) {
|
|
12
|
+
const sequence = await parserContext.peekSequence(start, start + window);
|
|
13
|
+
|
|
14
|
+
if (sequence === undefined) {
|
|
15
|
+
window = Math.floor(window / 2);
|
|
16
|
+
|
|
17
|
+
parserContext.invariant(!(start === 0 && window === 0), 'Unexpected end of input without terminated sequence');
|
|
18
|
+
parserContext.invariant(window > 0, 'Unexpected end of input without terminator');
|
|
19
|
+
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const terminatorIndex = parserContext.indexOf(sequence, terminatorElement);
|
|
24
|
+
|
|
25
|
+
if (terminatorIndex === -1) {
|
|
26
|
+
start += window;
|
|
27
|
+
window *= 2;
|
|
28
|
+
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const sequence_ = await parserContext.readSequence(0, start + terminatorIndex);
|
|
33
|
+
|
|
34
|
+
parserContext.skip(1);
|
|
35
|
+
|
|
36
|
+
return sequence_;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
setParserName(elementTerminatedSequenceParser, `.*?${JSON.stringify(terminatorElement)}`);
|
|
41
|
+
|
|
42
|
+
return elementTerminatedSequenceParser;
|
|
43
|
+
};
|
package/src/endOfInputParser.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Parser } from
|
|
2
|
-
import { DeriveSequenceElement } from
|
|
1
|
+
import { type Parser } from './parser.js';
|
|
2
|
+
import { type DeriveSequenceElement } from './sequence.js';
|
|
3
3
|
|
|
4
4
|
export const createEndOfInputParser = <Sequence, Element = DeriveSequenceElement<Sequence>>(): Parser<void, Sequence, Element> => async parserContext => {
|
|
5
5
|
parserContext.invariant(
|
|
6
6
|
await parserContext.peek(0) === undefined,
|
|
7
|
-
'Expected end of input.'
|
|
7
|
+
'Expected end of input.',
|
|
8
8
|
);
|
|
9
|
-
}
|
|
9
|
+
};
|
|
10
10
|
|
|
11
11
|
export const endOfInputParser = createEndOfInputParser<any, any>();
|
|
@@ -1,20 +1,26 @@
|
|
|
1
|
-
import { type Parser } from './parser.js';
|
|
2
|
-
import { DeriveSequenceElement } from './sequence.js';
|
|
1
|
+
import { setParserName, type Parser } from './parser.js';
|
|
2
|
+
import { type DeriveSequenceElement } from './sequence.js';
|
|
3
3
|
|
|
4
4
|
export const createExactElementParser = <
|
|
5
5
|
Sequence,
|
|
6
6
|
Element = DeriveSequenceElement<Sequence>,
|
|
7
|
-
>(element: Element): Parser<Element, Sequence, Element> =>
|
|
8
|
-
const
|
|
7
|
+
>(element: Element): Parser<Element, Sequence, Element> => {
|
|
8
|
+
const exactElementParser: Parser<Element, Sequence, Element> = async parserContext => {
|
|
9
|
+
const actualElement = await parserContext.peek(0);
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
parserContext.invariant(
|
|
12
|
+
actualElement === element,
|
|
13
|
+
'Expected %s, got %s',
|
|
14
|
+
element,
|
|
15
|
+
actualElement,
|
|
16
|
+
);
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
parserContext.skip(1);
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
return element;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
setParserName(exactElementParser, `createExactElementParser(${element})`);
|
|
24
|
+
|
|
25
|
+
return exactElementParser;
|
|
20
26
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { inspect } from 'util';
|
|
2
1
|
import { setParserName, type Parser } from './parser.js';
|
|
2
|
+
import { inspect } from './inspect.js';
|
|
3
3
|
|
|
4
|
-
export const
|
|
4
|
+
export const createExactSequenceNaiveParser = <Sequence>(sequence: Sequence) => {
|
|
5
5
|
const exactSequenceParser: Parser<Sequence, Sequence, unknown> = async parserContext => {
|
|
6
6
|
const length = parserContext.length(sequence);
|
|
7
7
|
|
|
@@ -24,4 +24,25 @@ export const createExactSequenceParser = <Sequence>(sequence: Sequence) => {
|
|
|
24
24
|
setParserName(exactSequenceParser, inspect(sequence));
|
|
25
25
|
|
|
26
26
|
return exactSequenceParser;
|
|
27
|
-
}
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const createExactSequenceParser = <Sequence>(expectedSequence: Sequence) => {
|
|
30
|
+
const exactSequenceParser: Parser<Sequence, Sequence, unknown> = async parserContext => {
|
|
31
|
+
const length = parserContext.length(expectedSequence);
|
|
32
|
+
|
|
33
|
+
const actualSequence = await parserContext.readSequence(0, length);
|
|
34
|
+
|
|
35
|
+
parserContext.invariant(
|
|
36
|
+
parserContext.equals(actualSequence, expectedSequence),
|
|
37
|
+
'Expected "%s", got "%s"',
|
|
38
|
+
() => inspect(expectedSequence),
|
|
39
|
+
() => inspect(actualSequence),
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
return expectedSequence;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
setParserName(exactSequenceParser, inspect(expectedSequence));
|
|
46
|
+
|
|
47
|
+
return exactSequenceParser;
|
|
48
|
+
};
|
package/src/fetchCid.ts
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import fsPromises from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import pMemoize from 'p-memoize';
|
|
4
|
+
import envPaths from 'env-paths';
|
|
5
|
+
|
|
6
|
+
const paths = envPaths('parser.futpib.github.io');
|
|
7
|
+
|
|
8
|
+
function readableWebStreamOnFinish<T>(readableWebStream: ReadableStream<T>, onFinish: () => void): ReadableStream<T> {
|
|
9
|
+
const reader = readableWebStream.getReader();
|
|
10
|
+
|
|
11
|
+
const stream = new ReadableStream<T>({
|
|
12
|
+
async start(controller) {
|
|
13
|
+
try {
|
|
14
|
+
while (true) {
|
|
15
|
+
const { done, value } = await reader.read();
|
|
16
|
+
if (done) {
|
|
17
|
+
break;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
controller.enqueue(value);
|
|
21
|
+
}
|
|
22
|
+
} finally {
|
|
23
|
+
controller.close();
|
|
24
|
+
reader.releaseLock();
|
|
25
|
+
onFinish();
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
async cancel(reason) {
|
|
29
|
+
await reader.cancel(reason);
|
|
30
|
+
onFinish();
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
return stream;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
class FsCache {
|
|
38
|
+
private get _basePath() {
|
|
39
|
+
return path.join(paths.cache, 'fetchCid');
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
private _getKeyPath(key: string) {
|
|
43
|
+
return path.join(this._basePath, key.replaceAll('/', '_'));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
async get(key: string): Promise<[ ReadableStream<Uint8Array>, ReadableStream<Uint8Array> ] | undefined> {
|
|
47
|
+
try {
|
|
48
|
+
const file = await fsPromises.open(this._getKeyPath(key), 'r');
|
|
49
|
+
|
|
50
|
+
const stream = file.readableWebStream({
|
|
51
|
+
type: 'bytes',
|
|
52
|
+
}) as ReadableStream<Uint8Array>;
|
|
53
|
+
|
|
54
|
+
const streamWithClose = readableWebStreamOnFinish(stream, () => {
|
|
55
|
+
file.close();
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
return [ streamWithClose, undefined as any ];
|
|
59
|
+
} catch (error) {
|
|
60
|
+
if ((error as NodeJS.ErrnoException).code === 'ENOENT') {
|
|
61
|
+
return undefined;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
throw error;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
async has(key: string) {
|
|
69
|
+
const streams = await this.get(key);
|
|
70
|
+
try {
|
|
71
|
+
return streams !== undefined;
|
|
72
|
+
} finally {
|
|
73
|
+
for (const stream of streams ?? []) {
|
|
74
|
+
await stream?.cancel();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
async set(key: string, [ _, value ]: [ ReadableStream<Uint8Array>, ReadableStream<Uint8Array> ]) {
|
|
80
|
+
await fsPromises.mkdir(this._basePath, {
|
|
81
|
+
recursive: true,
|
|
82
|
+
});
|
|
83
|
+
const file = await fsPromises.open(this._getKeyPath(key), 'w');
|
|
84
|
+
try {
|
|
85
|
+
for await (const chunk of value) {
|
|
86
|
+
await file.write(chunk);
|
|
87
|
+
}
|
|
88
|
+
} finally {
|
|
89
|
+
await file.close();
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
async delete(key: string) {
|
|
94
|
+
await fsPromises.unlink(this._getKeyPath(key));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
async function reallyFetchCid(cid: string): Promise<[ ReadableStream<Uint8Array>, ReadableStream<Uint8Array> ]> {
|
|
99
|
+
const response = await fetch('https://ipfs.io/ipfs/' + cid);
|
|
100
|
+
return response.body!.tee();
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const cachedReallyFetchCid = pMemoize(reallyFetchCid, {
|
|
104
|
+
cache: new FsCache(),
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
export async function fetchCid(cidOrPath: string): Promise<AsyncIterable<Uint8Array>> {
|
|
108
|
+
if (cidOrPath.includes('/')) {
|
|
109
|
+
const file = await fsPromises.open(cidOrPath, 'r');
|
|
110
|
+
|
|
111
|
+
const stream = file.readableWebStream({
|
|
112
|
+
type: 'bytes',
|
|
113
|
+
}) as ReadableStream<Uint8Array>;
|
|
114
|
+
|
|
115
|
+
const streamWithClose = readableWebStreamOnFinish(stream, () => {
|
|
116
|
+
file.close();
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
return streamWithClose;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const [ readable, unused ] = await cachedReallyFetchCid(cidOrPath);
|
|
123
|
+
await unused?.cancel();
|
|
124
|
+
return readable;
|
|
125
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import test from 'ava';
|
|
2
|
+
import * as fc from 'fast-check';
|
|
3
|
+
import { testProp } from '@fast-check/ava';
|
|
4
|
+
import { createFixedLengthSequenceParser, createFixedLengthSequenceParserNaive } from './fixedLengthSequenceParser.js';
|
|
5
|
+
import { Parser, runParserWithRemainingInput } from './parser.js';
|
|
6
|
+
import { stringParserInputCompanion } from './parserInputCompanion.js';
|
|
7
|
+
import { HighResolutionTotalTimer } from './highResolutionTimer.js';
|
|
8
|
+
import { arbitrarilySlicedAsyncIterable } from './arbitrarilySlicedAsyncInterable.js';
|
|
9
|
+
|
|
10
|
+
const naiveTotalTimer = new HighResolutionTotalTimer();
|
|
11
|
+
const totalTimer = new HighResolutionTotalTimer();
|
|
12
|
+
|
|
13
|
+
testProp.serial(
|
|
14
|
+
'fixedLengthSequenceParser',
|
|
15
|
+
[
|
|
16
|
+
fc
|
|
17
|
+
.bigInt({
|
|
18
|
+
min: 1n,
|
|
19
|
+
max: 2n ** 14n,
|
|
20
|
+
})
|
|
21
|
+
.chain(length => fc.tuple(
|
|
22
|
+
arbitrarilySlicedAsyncIterable(
|
|
23
|
+
fc.string({
|
|
24
|
+
minLength: Number(length),
|
|
25
|
+
maxLength: Number(length) * 2,
|
|
26
|
+
}),
|
|
27
|
+
),
|
|
28
|
+
fc.constant(length),
|
|
29
|
+
)),
|
|
30
|
+
],
|
|
31
|
+
async (t, [ [ _, sequence ], length ]) => {
|
|
32
|
+
const fixedLengthSequenceParserNaive = createFixedLengthSequenceParserNaive<string>(length);
|
|
33
|
+
const fixedLengthSequenceParser = createFixedLengthSequenceParser<string>(length);
|
|
34
|
+
|
|
35
|
+
const createTestWrapperParser = (innerParser: typeof fixedLengthSequenceParser): Parser<{
|
|
36
|
+
result: string,
|
|
37
|
+
position: number,
|
|
38
|
+
}, string> => async parserContext => {
|
|
39
|
+
const result = await innerParser(parserContext);
|
|
40
|
+
|
|
41
|
+
return {
|
|
42
|
+
result,
|
|
43
|
+
nextPeek: await parserContext.peek(0),
|
|
44
|
+
position: parserContext.position,
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const { output: actualNaive } = await naiveTotalTimer.measureAsync(() => runParserWithRemainingInput(
|
|
49
|
+
createTestWrapperParser(fixedLengthSequenceParserNaive),
|
|
50
|
+
sequence,
|
|
51
|
+
stringParserInputCompanion,
|
|
52
|
+
));
|
|
53
|
+
|
|
54
|
+
t.true(actualNaive.result.length === Number(length));
|
|
55
|
+
|
|
56
|
+
const { output: actual } = await totalTimer.measureAsync(() => runParserWithRemainingInput(
|
|
57
|
+
createTestWrapperParser(fixedLengthSequenceParser),
|
|
58
|
+
sequence,
|
|
59
|
+
stringParserInputCompanion,
|
|
60
|
+
));
|
|
61
|
+
|
|
62
|
+
t.deepEqual(actual, actualNaive);
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
verbose: true,
|
|
66
|
+
},
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
test.serial(
|
|
70
|
+
'fixedLengthSequenceParser performance',
|
|
71
|
+
t => {
|
|
72
|
+
t.true(
|
|
73
|
+
totalTimer.time * 10n < naiveTotalTimer.time,
|
|
74
|
+
`Naive: ${naiveTotalTimer.time / 1000000n}ms, Optimized: ${totalTimer.time / 1000000n}ms`,
|
|
75
|
+
);
|
|
76
|
+
},
|
|
77
|
+
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { setParserName, type Parser } from './parser.js';
|
|
2
2
|
import { parserImplementationInvariant } from './parserImplementationInvariant.js';
|
|
3
3
|
|
|
4
|
-
export const
|
|
4
|
+
export const createFixedLengthSequenceParserNaive = <Sequence>(lengthInput: bigint | number) => {
|
|
5
5
|
const length = BigInt(lengthInput);
|
|
6
6
|
|
|
7
7
|
parserImplementationInvariant(length >= 0n, 'Length must be non-negative got %s.', length);
|
|
@@ -22,3 +22,30 @@ export const createFixedLengthSequenceParser = <Sequence>(lengthInput: bigint |
|
|
|
22
22
|
|
|
23
23
|
return fixedLengthSequenceParser;
|
|
24
24
|
};
|
|
25
|
+
|
|
26
|
+
const MAX_SAFE_INTEGER = BigInt(Number.MAX_SAFE_INTEGER);
|
|
27
|
+
|
|
28
|
+
export const createFixedLengthSequenceParser = <Sequence>(lengthInput: bigint | number) => {
|
|
29
|
+
const length = BigInt(lengthInput);
|
|
30
|
+
|
|
31
|
+
parserImplementationInvariant(length >= 0n, 'Length must be non-negative got %s.', length);
|
|
32
|
+
|
|
33
|
+
const fixedLengthSequenceParser: Parser<Sequence, Sequence, unknown> = async parserContext => {
|
|
34
|
+
const safeIntegerSequences: Sequence[] = [];
|
|
35
|
+
let remainingLength = length;
|
|
36
|
+
|
|
37
|
+
while (remainingLength > 0n) {
|
|
38
|
+
const safeIntegerLength = length > MAX_SAFE_INTEGER ? Number.MAX_SAFE_INTEGER : Number(length);
|
|
39
|
+
|
|
40
|
+
safeIntegerSequences.push(await parserContext.readSequence(0, safeIntegerLength));
|
|
41
|
+
|
|
42
|
+
remainingLength -= BigInt(safeIntegerLength);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return parserContext.concat(safeIntegerSequences);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
setParserName(fixedLengthSequenceParser, `.{${length}}`);
|
|
49
|
+
|
|
50
|
+
return fixedLengthSequenceParser;
|
|
51
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { execa } from 'execa';
|
|
2
|
+
|
|
3
|
+
export async function hasExecutable(executable: string) {
|
|
4
|
+
const hasExecutable = execa(executable).then(() => true, () => false);
|
|
5
|
+
|
|
6
|
+
if (!hasExecutable) {
|
|
7
|
+
console.warn(`Executable %o not found`, executable);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
return hasExecutable;
|
|
11
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import invariant from 'invariant';
|
|
2
|
+
import process from 'node:process';
|
|
3
|
+
|
|
4
|
+
class HighResolutionSubTimer {
|
|
5
|
+
private _ended = false;
|
|
6
|
+
|
|
7
|
+
constructor(
|
|
8
|
+
private readonly _parent: HighResolutionTotalTimer,
|
|
9
|
+
private readonly _start: bigint,
|
|
10
|
+
) {}
|
|
11
|
+
|
|
12
|
+
end() {
|
|
13
|
+
invariant(!this._ended, 'Timer already ended.');
|
|
14
|
+
const end = process.hrtime.bigint();
|
|
15
|
+
const time = end - this._start;
|
|
16
|
+
this._parent.add(time);
|
|
17
|
+
this._ended = true;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export class HighResolutionTotalTimer {
|
|
22
|
+
private _total = 0n;
|
|
23
|
+
|
|
24
|
+
start(): HighResolutionSubTimer {
|
|
25
|
+
return new HighResolutionSubTimer(this, process.hrtime.bigint());
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
add(time: bigint) {
|
|
29
|
+
this._total += time;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
get time() {
|
|
33
|
+
return this._total;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
measure<T>(fn: () => T): T {
|
|
37
|
+
const timer = this.start();
|
|
38
|
+
const result = fn();
|
|
39
|
+
timer.end();
|
|
40
|
+
return result;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async measureAsync<T>(fn: () => Promise<T>): Promise<T> {
|
|
44
|
+
const timer = this.start();
|
|
45
|
+
const result = await fn();
|
|
46
|
+
timer.end();
|
|
47
|
+
return result;
|
|
48
|
+
}
|
|
49
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
|
|
2
2
|
export {
|
|
3
|
-
Parser,
|
|
3
|
+
type Parser,
|
|
4
4
|
runParser,
|
|
5
5
|
|
|
6
6
|
setParserName,
|
|
7
7
|
getParserName,
|
|
8
8
|
} from './parser.js';
|
|
9
9
|
|
|
10
|
-
export {
|
|
10
|
+
export type {
|
|
11
11
|
ParserContext,
|
|
12
12
|
} from './parserContext.js';
|
|
13
13
|
|
|
@@ -74,3 +74,16 @@ export {
|
|
|
74
74
|
export {
|
|
75
75
|
createDebugLogParser,
|
|
76
76
|
} from './debugLogParser.js';
|
|
77
|
+
|
|
78
|
+
export {
|
|
79
|
+
type Unparser,
|
|
80
|
+
runUnparser,
|
|
81
|
+
} from './unparser.js';
|
|
82
|
+
|
|
83
|
+
export {
|
|
84
|
+
createArrayUnparser,
|
|
85
|
+
} from './arrayUnparser.js';
|
|
86
|
+
|
|
87
|
+
export {
|
|
88
|
+
createSequenceUnparser,
|
|
89
|
+
} from './sequenceUnparser.js';
|