Skip to content

Commit 1697ac8

Browse files
KTibowokikio
authored andcommitted
a different kind of refactor
1 parent e4f8946 commit 1697ac8

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/ts/util/util-cdn.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,7 @@ export const getCDNOrigin = (importStr: string, cdn = DEFAULT_CDN_HOST) => {
7878
else if (/^(github)\:/.test(importStr))
7979
cdn = `https://raw.githubusercontent.com`;
8080

81-
if (!cdn.endsWith("/"))
82-
cdn += "/";
83-
84-
return cdn;
81+
return !/\/$/.test(cdn) ? `${cdn}/` : cdn;
8582
}
8683

8784
/**

0 commit comments

Comments
 (0)