doc_website icon indicating copy to clipboard operation
doc_website copied to clipboard

Constant function expressions are categorized as variables

Open jsejcksn opened this issue 4 years ago • 1 comments

Example:

Source:

/**
 * Log your data
 */
export const log = (data: any): void => console.log(data);

Generated: doc

It also doesn't seem to recognize types on the anonymous function expression signature.

Is this the intended behavior?

jsejcksn avatar Jun 12 '20 00:06 jsejcksn

This is correct behavior at the moment, because any constant, no matter what you assign it, is a variable. I do get why it would make sense for that to render like a function though. This is actually an issue with denoland/deno upstream though, because that is where the code analysis and documentation generation takes place.

cc @bartlomieju

lucacasonato avatar Jun 20 '20 11:06 lucacasonato