Keep original doc-line formats (#1787)

This commit is contained in:
Jaco Greeff
2020-02-01 11:59:47 +01:00
committed by GitHub
parent 8da895efd4
commit 00026a173f
4 changed files with 1223 additions and 174 deletions
+2 -6
View File
@@ -8,15 +8,11 @@ type Arg = [Text | string, Text | string];
export function createDocComments (docs: Text[], args: Arg[] = []): string[] {
const contents = [
...(docs.length ? [` * ${docs.map((d): string => d.toString().trim()).join(' ')}`] : []),
...docs.map((doc): string => doc.toString().trim()).filter((doc): boolean => !!doc).map((doc): string => ` * ${doc}`),
...args.map(([name, type]): string => ` * @param ${name} ${type}`)
];
return contents.length
? [
'/**',
...contents,
' **/\n'
]
? ['/**', ...contents, ' **/\n']
: [];
}