esdoc / esdoc-plugins

MIT License
139 stars 74 forks source link

Empty string as default is resolved as undefined #62

Closed fabulator closed 2 years ago

fabulator commented 6 years ago

I have following class: class LocalStorage { constructor(prefix: string = '') { } }

ESdocs will describe it as:

prefix | string | optional, default: undefined

But default is not undefined, it is empty string.

When I try class LocalStorage { constructor(prefix: string = 'x') { } }

Results is prefix | string | optional, default: x

Which is ok. Problem is only in empty string. My config is:

{
  "source": "./src",
  "destination": "./docs",
  "excludes": ["index.js"],
  "plugins": [
    {
      "name": "esdoc-standard-plugin"
    },
    {"name": "esdoc-flow-type-plugin", "option": {"enable": true}},
    {"name": "esdoc-ecmascript-proposal-plugin", "option": {"all": true}}
  ]
}