typia icon indicating copy to clipboard operation
typia copied to clipboard

Improve the appearance of the generated code

Open AlexRMU opened this issue 1 year ago • 2 comments

  • 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.

AlexRMU avatar Aug 08 '24 06:08 AlexRMU

"string" === typeof input.name is intended spec.

About other features, wait your contributions.

samchon avatar Dec 02 '24 18:12 samchon

I'm sorry, I won't be able to help with this anytime soon.

AlexRMU avatar Dec 02 '24 19:12 AlexRMU