@xylabs/ts-scripts-yarn3 6.4.5 → 6.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/xy/xy.mjs CHANGED
@@ -691,13 +691,14 @@ function getImportsFromFile(filePath, importPaths, typeImportPaths) {
691
691
  );
692
692
  const imports = [];
693
693
  const typeImports = [];
694
+ const isDeclarationFile = filePath.endsWith(".d.ts");
694
695
  function visit(node) {
695
696
  if (ts.isImportDeclaration(node) || ts.isExportDeclaration(node)) {
696
697
  const moduleSpecifier = node.moduleSpecifier?.getFullText();
697
698
  const isTypeImport = ts.isImportDeclaration(node) ? node.importClause?.isTypeOnly ?? false : false;
698
699
  if (moduleSpecifier) {
699
700
  const trimmed = moduleSpecifier.split("'").at(1) ?? moduleSpecifier;
700
- if (isTypeImport) {
701
+ if (isTypeImport && !isDeclarationFile) {
701
702
  typeImports.push(trimmed);
702
703
  } else {
703
704
  imports.push(trimmed);