Conversation
mourner
left a comment
There was a problem hiding this comment.
Overall this is a really nice, elegant and surprisingly compact implementation, nice work!
Co-authored-by: Volodymyr Agafonkin <agafonkin@gmail.com>
| } | ||
|
|
||
| const type = getTsType(field); | ||
| const isRequired = field.required || field.repeated || field.map; |
There was a problem hiding this comment.
| const isRequired = field.required || field.repeated || field.map; | |
| const isRequired = field.required; |
repeated fields (and map) are inheritely optional as they can be provided with zero values.
Should we not reflect that in the JSDoc and makes all repeated and map fields optional ?
|
I am currently using pbf with Typescript and the implementation of JSDoc is a nice and elegant feature to get type hints understandable by Typescript compilers. Is there any blockers to merge this and integrate it in the next release ? |
|
Hey, @aberrier, thanks for trying this implementation! It is working for me as well. I've planned to add more tests for this, like the ones in the Another approach for TypeScript support might also be considered in #138. I'm not sure what the best option here, but implementing JSDoc support is less intrusive and easier to review, in my opinion. |
Different approach to #107. Adds
--jsdocoption to generate type annotations.