import { TS } from "../../src/type/type" ; import { getImportDefaultHelper , getImportStarHelper , } from "../../src/util/ts-util" ; export function includeEmitHelper ( typescript , helperName ) { const helper = helperName === "__importStar" ? getImportStarHelper ( typescript ) : getImportDefaultHelper ( typescript ) ; let str = "" ; for ( const dependency of helper . dependencies ?? [ ] ) { str += dependency . text ; } str += helper . text ; if ( str . startsWith ( "\n" ) ) { return str . slice ( 1 ) ; } else { return str ; } }