File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 66const { stat, readFile, writeFile } = require ( 'fs/promises' ) ;
77const { join : joinPath } = require ( 'path' ) ;
88const { spawn } = require ( 'child_process' ) ;
9- const typescript = require ( 'typescript' ) ;
109
1110class APIPrinterError extends Error { }
1211
@@ -54,11 +53,11 @@ async function getDriverAPI() {
5453async function main ( ) {
5554 const api = await getDriverAPI ( ) ;
5655
57- console . log ( api . name ) ;
5856 const packageMembers = api . members [ 0 ] . members ;
5957
6058 for ( const classDescription of packageMembers . filter ( m => m . kind === 'Class' ) ) {
6159 const className = classDescription . name ;
60+ const methodsPrinted = new Set ( ) ;
6261 for ( const methodDescription of classDescription . members . filter ( m => m . kind === 'Method' ) ) {
6362 /** @type {string } */
6463 const returnType = methodDescription . excerptTokens
@@ -68,7 +67,8 @@ async function main() {
6867 )
6968 . map ( token => token . text . replaceAll ( '\n' , '' ) . replace ( / \s \s + / g, ' ' ) )
7069 . join ( '' ) ;
71- if ( returnType . includes ( 'Promise' ) ) {
70+ if ( returnType . includes ( 'Promise<' ) && ! methodsPrinted . has ( methodDescription . name ) ) {
71+ methodsPrinted . add ( methodDescription . name ) ;
7272 const apiString = `${ className } .${ methodDescription . name } (): ${ returnType } ` ;
7373 console . log ( apiString ) ;
7474 }
You can’t perform that action at this time.
0 commit comments