({
moduleSpecifier,
defaultImport,
namedImports,
isTypeOnly,
}: ImportDeclarationStructure)
| 94 | } |
| 95 | |
| 96 | function formatImport({ |
| 97 | moduleSpecifier, |
| 98 | defaultImport, |
| 99 | namedImports, |
| 100 | isTypeOnly, |
| 101 | }: ImportDeclarationStructure): string { |
| 102 | const named = namedImports?.length ? `{ ${namedImports.join(', ')} }` : ''; |
| 103 | const bindings = [defaultImport, named].filter(Boolean).join(', '); |
| 104 | const from = bindings ? `${bindings} from ` : ''; |
| 105 | const type = isTypeOnly ? 'type ' : ''; |
| 106 | return `import ${type}${from}'${moduleSpecifier}';`; |
| 107 | } |
| 108 | |
| 109 | function sortImports( |
| 110 | imports: ImportDeclarationStructure[], |
no outgoing calls
no test coverage detected