1.1 KiB
1.1 KiB
- The
parse
andparse_sync
functions must support bothBuffer
andString
inputs for thesrc
parameter, using theEither
type fromnapi
to avoid breaking existing string-based usage while adding buffer support. - A helper function
stringify
must handle conversion ofEither<Buffer, String>
to a unifiedString
representation internally, ensuring consistent UTF-8 decoding for buffers and direct string passthrough. - The TypeScript binding declarations (
binding.d.ts
) must reflect the updated parameter types forparse
andparse_sync
to acceptBuffer | string
, ensuring compatibility with JavaScript/TypeScript callers. - Unit tests must validate both buffer and string input paths for asynchronous (
parse
) and synchronous (parse_sync
) APIs, ensuring parity in functionality and output correctness. - The
filename
parameter must remain optional but useFileName::Real
when provided and fall back toFileName::Anon
if omitted, preserving existing file resolution logic. - No regressions in error handling, abort signal support, or serialization/deserialization of
ParseOptions
during the refactor.