Open ericelliott opened 5 years ago
Workaround:
jsdoc2md src/lib/to-slug/index.js | sed '/\*\*Kind\*\*/d'
Produces:
string
toSlug takes a string and converts it into a URL-safe string, replacing spaces with dashes, removing capitalized letters, and stripping unsafe characters out.
Returns: string
- A slugified string
Param | Type | Description |
---|---|---|
s | string | number |
A string to slugify |
True, that function is module scope, not global. In which case you should have a @module
tag defined but as you say, the module-scope function is then described as a "method" which it is not.
I think the "method" text is a legacy thing stemming from the old days when functions were exported by attaching them as a method to the Node.js global exports
object. Before ES Modules, functions were literally exported as a method in Node.js.
Either way, yes this needs correcting.
Given this input:
I get the following output:
toSlug(s) ⇒
string
toSlug Takes a string and converts it into a URL-safe string, replacing spaces with dashes, removing capitalized letters, and stripping unsafe characters out.
Kind: global function
Returns:
string
- A slugified stringstring
|number
Clearly, the
kind
should not beglobal function
because the function is not global. It's scoped within a module. If I add module to the top of the file, it gets worse: Now it assumes it's a method. It's not. It's just a function. Not a global, not a method, not a class. Just a function. If I annotate it with@kind function
it still says,Kind: global function
.