import { TS } from "../../../type/type" ; import { AfterVisitorOptions } from "../after-visitor-options" ; export function visitDefineArrayLiteralExpression ( options ) { const { node , sourceFile , context } = options ; const { typescript , factory } = context ; const trailingExtraExpressions = [ ] ; for ( const importedSymbol of context . sourceFileToRequiredImportedSymbolSet . get ( sourceFile . fileName ) ?? new Set ( ) ) { if ( node . elements . some ( ( element ) => typescript . isStringLiteralLike ( element ) && element . text === importedSymbol . moduleSpecifier ) ) { continue ; } trailingExtraExpressions . push ( factory . createStringLiteral ( importedSymbol . moduleSpecifier ) ) ; } if ( context . sourceFileToAddTslibDefinition . get ( sourceFile . fileName ) === true ) { trailingExtraExpressions . push ( factory . createStringLiteral ( "tslib" ) ) ; } if ( trailingExtraExpressions . length < 1 ) { return node ; } return factory . updateArrayLiteralExpression ( node , [ ... node . elements , ... trailingExtraExpressions , ] ) ; }