Skip to content

Commit f1bb4c2

Browse files
Fix replacing .ts extension by .js (#16)
1 parent 87521d4 commit f1bb4c2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/AssetMapper/TypeScriptPublicPathAssetPathResolver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ public function getPublicFilesystemPath(): string
2525
{
2626
$path = $this->decorator->getPublicFilesystemPath();
2727

28-
if (str_contains($path, '.ts')) {
29-
return str_replace('.ts', '.js', $path);
28+
if (str_ends_with($path, '.ts')) {
29+
return substr($path, 0, -3).'.js';
3030
}
3131

3232
return $path;

0 commit comments

Comments
 (0)