import ts from 'typescript' ; export function getSyntaxKindName ( kind ) { return getKindCache ( ) [ kind ] ; } let mutableKindCache ; function getKindCache ( ) { if ( mutableKindCache !== undefined ) { return mutableKindCache ; } mutableKindCache = { } ; for ( const name of Object . keys ( ts . SyntaxKind ) . filter ( ( k ) => isNaN ( parseInt ( k , 10 ) ) ) ) { const value = ( ts . SyntaxKind as any ) [ name ] as number ; if ( ( mutableKindCache [ value ] as string | undefined ) === undefined ) { mutableKindCache [ value ] = name ; } } return mutableKindCache ; }