mirror of
https://github.com/sern-handler/website
synced 2026-06-28 02:32:23 +00:00
15 lines
371 B
JavaScript
15 lines
371 B
JavaScript
function getAssetsPrefix(fileExtension, assetsPrefix) {
|
|
if (!assetsPrefix)
|
|
return "";
|
|
if (typeof assetsPrefix === "string")
|
|
return assetsPrefix;
|
|
const dotLessFileExtension = fileExtension.slice(1);
|
|
if (assetsPrefix[dotLessFileExtension]) {
|
|
return assetsPrefix[dotLessFileExtension];
|
|
}
|
|
return assetsPrefix.fallback;
|
|
}
|
|
export {
|
|
getAssetsPrefix
|
|
};
|