@scayle/storefront-nuxt
Version:
Nuxt integration for the SCAYLE Commerce Engine and Storefront API
11 lines (10 loc) • 383 B
JavaScript
export const getAvailableMounts = (storage) => {
return storage.getMounts().map((existingMount) => existingMount.base.replace(/:$/, ""));
};
export const mountStorage = async (storage, mount) => {
const mounts = getAvailableMounts(storage);
if (!mounts.includes(mount)) {
const { driver: baseDriver } = storage.getMount(mount);
storage.mount(mount, baseDriver);
}
};