Skip to content

Commit aa31690

Browse files
committed
Remove imported module name suffix with compactor
1 parent 257c8a1 commit aa31690

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

src/Writers/ModuleWriter.php

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,17 @@ public function format(TypesCollection $collection): string {
7979
$currentRest = ltrim(substr($currentModuleTsNamespace, strlen($commonPrefix)), '\\');
8080
$backParts = array_fill(0, substr_count($currentRest, '\\'), '..');
8181
$sourceModulePath =
82-
(
83-
count($backParts) === 0
84-
? '.'
85-
: join('/', $backParts)
86-
)
87-
. '/'
88-
. join(
89-
'/',
90-
explode('\\', $importedRest)
82+
$this->compactor->removeSuffix(
83+
(
84+
count($backParts) === 0
85+
? '.'
86+
: join('/', $backParts)
87+
)
88+
. '/'
89+
. join(
90+
'/',
91+
explode('\\', $importedRest)
92+
)
9193
);
9294

9395
$import .= '} from "' . $sourceModulePath . "\";\n";

0 commit comments

Comments
 (0)