Skip to content

Commit 8dd49a3

Browse files
committed
Add util for getting the url from asset default import regardless of the bundler
1 parent 4c264aa commit 8dd49a3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/lib/tools/getAssetUrl.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export function getAssetUrl(componentOrUrl: { src: string } | string): string {
2+
return typeof componentOrUrl === "string" ? componentOrUrl : componentOrUrl.src;
3+
}

0 commit comments

Comments
 (0)