Astro+Directus(Visual-Editing)+Snipcart Test-Stack
This commit is contained in:
+15
@@ -0,0 +1,15 @@
|
||||
function getAssetsPrefix(fileExtension, assetsPrefix) {
|
||||
let prefix = "";
|
||||
if (!assetsPrefix) {
|
||||
prefix = "";
|
||||
} else if (typeof assetsPrefix === "string") {
|
||||
prefix = assetsPrefix;
|
||||
} else {
|
||||
const dotLessFileExtension = fileExtension.slice(1);
|
||||
prefix = assetsPrefix[dotLessFileExtension] || assetsPrefix.fallback;
|
||||
}
|
||||
return prefix;
|
||||
}
|
||||
export {
|
||||
getAssetsPrefix
|
||||
};
|
||||
Reference in New Issue
Block a user