File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 6
6
const { stat, readFile, writeFile } = require ( 'fs/promises' ) ;
7
7
const { join : joinPath } = require ( 'path' ) ;
8
8
const { spawn } = require ( 'child_process' ) ;
9
- const typescript = require ( 'typescript' ) ;
10
9
11
10
class APIPrinterError extends Error { }
12
11
@@ -54,11 +53,11 @@ async function getDriverAPI() {
54
53
async function main ( ) {
55
54
const api = await getDriverAPI ( ) ;
56
55
57
- console . log ( api . name ) ;
58
56
const packageMembers = api . members [ 0 ] . members ;
59
57
60
58
for ( const classDescription of packageMembers . filter ( m => m . kind === 'Class' ) ) {
61
59
const className = classDescription . name ;
60
+ const methodsPrinted = new Set ( ) ;
62
61
for ( const methodDescription of classDescription . members . filter ( m => m . kind === 'Method' ) ) {
63
62
/** @type {string } */
64
63
const returnType = methodDescription . excerptTokens
@@ -68,7 +67,8 @@ async function main() {
68
67
)
69
68
. map ( token => token . text . replaceAll ( '\n' , '' ) . replace ( / \s \s + / g, ' ' ) )
70
69
. join ( '' ) ;
71
- if ( returnType . includes ( 'Promise' ) ) {
70
+ if ( returnType . includes ( 'Promise<' ) && ! methodsPrinted . has ( methodDescription . name ) ) {
71
+ methodsPrinted . add ( methodDescription . name ) ;
72
72
const apiString = `${ className } .${ methodDescription . name } (): ${ returnType } ` ;
73
73
console . log ( apiString ) ;
74
74
}
You can’t perform that action at this time.
0 commit comments