You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
1.4 KiB
Plaintext

Compatibility matrix:
- Input type
- Streaming output
- Streaming item reads
Input type Streaming output Streaming item reads supported?
=============== ================ ===============================
Stream Yes Yes, blocking
Stream No No
Seekable Yes Yes
Seekable No Yes
Value Yes Yes
Value No Yes
Parsing options:
- Force streaming items to be buffered instead
- Allow incomplete parses (for incremental seeking parsing)
Input types:
- Value (string/buffer)
- Seekable (how to set encoding here?)
- Stream (how to detect string vs. buffer here?)
Thoughts:
- Maybe there should be a parseString vs. parseBuffer method to declare the *intended* parsing mode?
- Need to support *some* form of mixed-mode parsing, eg. for HTTP-encapsulated binary data
- FIXME/MARKER: regex parsing cannot work in either stremaing *or* mixed-mode parsing, because with the language implementation of regex it is unknowable whether it failed due to a mismatch or due to running out of Input
- Provide a custom character range operation instead
- ensure that this correctly handles the astral plane, since those characters are two codepoints in JS (with UCS-2) rather than one (as in UTF-8)
- also need to make sure to get the *codepoint* of characters for determining the ranges, not the first/single byte value (which I think charcodeAt does?)