UNPKG

@lyxa.ai/types

Version:

Lyxa type definitions and validation schemas for both frontend and backend

31 lines 2.24 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isGroceryFamilyItemType = isGroceryFamilyItemType; exports.getProductDietariesByItemType = getProductDietariesByItemType; const enum_1 = require("../enum"); const GROCERY_FAMILY_ITEM_TYPES = [enum_1.ItemType.GROCERY, enum_1.ItemType.PET]; function isGroceryFamilyItemType(itemType) { return GROCERY_FAMILY_ITEM_TYPES.includes(itemType); } function getProductDietariesByItemType(itemType) { if (isGroceryFamilyItemType(itemType)) { return [ { icon: '', label: 'Gluten Free', productDietaryType: enum_1.ProductDietaryType.GLUTEN_FREE }, { icon: '', label: 'Lactose Free', productDietaryType: enum_1.ProductDietaryType.LACTOSE_FREE }, { icon: '', label: 'Low Cal', productDietaryType: enum_1.ProductDietaryType.LOW_CAL }, { icon: 'https://storage.googleapis.com/lyxa-global/product-dietary-icons/vegetarian.png', label: 'Vegetarian', productDietaryType: enum_1.ProductDietaryType.VEGETARIAN }, { icon: 'https://storage.googleapis.com/lyxa-global/product-dietary-icons/vegan.png', label: 'Vegan', productDietaryType: enum_1.ProductDietaryType.VEGAN }, { icon: '', label: 'Keto', productDietaryType: enum_1.ProductDietaryType.KETO }, { icon: '', label: 'High Protein', productDietaryType: enum_1.ProductDietaryType.HIGH_PROTEIN } ]; } else { return [ { icon: 'https://storage.googleapis.com/lyxa-global/product-dietary-icons/vegetarian.png', label: 'Vegeterian', productDietaryType: enum_1.ProductDietaryType.VEGETARIAN }, { icon: 'https://storage.googleapis.com/lyxa-global/product-dietary-icons/vegan.png', label: 'Vegan', productDietaryType: enum_1.ProductDietaryType.VEGAN }, { icon: 'https://storage.googleapis.com/lyxa-global/product-dietary-icons/glutenFree.png', label: 'Gluten Free', productDietaryType: enum_1.ProductDietaryType.GLUTEN_FREE }, { icon: 'https://storage.googleapis.com/lyxa-global/product-dietary-icons/allergyFriendly.png', label: 'Low Cal', productDietaryType: enum_1.ProductDietaryType.LOW_CAL } ]; } } //# sourceMappingURL=common-methods.js.map