1.1 KiB
1.1 KiB
- The
parseandparse_syncfunctions must support bothBufferandStringinputs for thesrcparameter, using theEithertype fromnapito avoid breaking existing string-based usage while adding buffer support. - A helper function
stringifymust handle conversion ofEither<Buffer, String>to a unifiedStringrepresentation 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 forparseandparse_syncto 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
filenameparameter must remain optional but useFileName::Realwhen provided and fall back toFileName::Anonif omitted, preserving existing file resolution logic. - No regressions in error handling, abort signal support, or serialization/deserialization of
ParseOptionsduring the refactor.