jsdoctypeparser is a JSDoc type expression parser module. This module can parse:
foo.bar
, String[]
, module:foo/bar
Array.<string>
, function(arg1, arg2): ret
[string, string]
, import("./package").Type
Array.<Array.<string>>
, { length: number }
This module is available on github or npm.
Syntax Error
Please file an issue or join us on our Discord chat for jsdoc.
const {parse} = require('jsdoctypeparser'); const result = parse(yourTypeExpression); console.log(result);
The console output is:
const {publish} = require('jsdoctypeparser'); console.log(publish(result));