typia
typia copied to clipboard
Improve the appearance of the generated code
- copy both the current indentation and the level indentation size from the source code
- use only multi-line comments so that they can be inserted anywhere
- add a comment that this code has been generated
- add a comment with the package version
- change the order of the comparison (
"string" === typeof input.name->typeof input.name === "string") - for each field and element, add a comment with a path to it
- for each tag and type, add a comment with the name and parameters of the tag
- add comments for unions, etc.
- add a comment with the name of the original function and type (
typia.is<IMember & { ... }>) - do not use single line if statement, etc.
- ...
The protobuf already has something: https://github.com/samchon/typia/blob/cbaa2e79b9bc6ca04b12888263052a4678103aec/src/programmers/protobuf/ProtobufEncodeProgrammer.ts#L487
This will help you study the generated code, understand how it works, look for bugs, etc.
"string" === typeof input.name is intended spec.
About other features, wait your contributions.
I'm sorry, I won't be able to help with this anytime soon.