Open catie opened 1 year ago
Sorry for not getting back to you sooner. IIRC primitiveN
is private simply because there were no use cases to generate the parser definition itself dynamically. Also we wanted to minimize the API surface.
Feel free to open a PR to make it public!
Makes sense! I'll try and find some time to clean up my fork and get it submitted. Thanks @keichi!
I'm new to Node, so please forgive me if I'm missing something obvious here. I'm building a utility to parse binary files based on a Json definition of the file specification, and while I originally implemented it in Java, that solution is clunky and already showing strain so I'm rebuilding in Node.
My Json elements have types that already match your primitives, but I notice the
Parser.primitiveN()
function is private. It seems a little silly to re-implement mappings that I can see are happening in reverse once I callparse()
, but I could do that if needed. I'm also happy to make the changes to exposePrimitiveTypes
andprimitiveN()
, but looking at the git history it seems like they might've been made private for a reason. If someone could shed some light on why and provide guidance on the best path forward it would be greatly appreciated. Thanks!