Open alastormininister opened 1 year ago
Glad to hear it's getting used.
I've just pushed v0.12.0 which should support that scenario you describe.
I really should overhaul the logic to use jsdoc-type-pratt-parser
, but am really too preoccupied at the moment to do so. For now I can hopefully add any missing support for some simple cases as you describe.
But note that if you had something like:
/**
* @typedef {object} Context
* @property {string[]|number[]} list
*/
...this will not put the types into an anyOf
or such. I'm afraid I just don't have too much time to dedicate to this at the moment. But if a simple case comes up like this, I can see if it is something I can add support for quickly.
Let me know if the new version works for you.
I've also added support for:
/**
* @typedef {object} Context
* @property {string[]|number[]} list
*/
Awesome, man! And thanks for the quick turnaround. It looks great at first glance. I’ll let you know if I run into issues. And hey, if I can convince my company to go with the approach I’m experimenting with maybe we’ll have some time to contribute as well 🤞
First of all, great lib and great work. I'm finding the below error when parsing the below declaration, maybe someone can tell me how to declare arrays?