Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function fetchLists() {
const data = await firestoreService
.backup('lists');
fs.writeFileSync(backupFile, JSON.stringify(data.lists));
}
export function getProduct(productUrl) {
if (productData) {
return findUrl(productData, productUrl);
} else {
fei.backup('products').then((data) => {
productData = data.products.data.items;
return findUrl(productData, productUrl);
});
}
}
export function getHomeData() {
if (homeData) {
return homeData;
} else {
fei.backup('home').then((data) => {
homeData = {
categories: data.home.categories.data,
products: data.home.products.data,
};
return homeData;
});
}
}
export function getProducts(category) {
if (productData) {
return filterCategory(productData, category);
} else {
fei.backup('products').then((data) => {
productData = data.products.data.items;
return filterCategory(productData, category);
});
}
}