(tag: any)
| 31 | } |
| 32 | |
| 33 | function formatType(tag: any): string { |
| 34 | // console.log(tag); |
| 35 | if (tag.type === 'RestType') { |
| 36 | return `...${formatType(tag.expression)}`; |
| 37 | } else if (tag.type === 'TypeApplication') { |
| 38 | return `Array<${tag.applications |
| 39 | .map((item: any) => formatType(item)) |
| 40 | .join(',')}>`; |
| 41 | } |
| 42 | |
| 43 | return tag.name; |
| 44 | } |
| 45 | |
| 46 | async function main(...params: Array<any>) { |
| 47 | const contents = fs.readFileSync(jsFile, 'utf8'); |