UNPKG

@causalfoundry/js-sdk

Version:

Causal Foundry WEB SDK (JS/TS)

21 lines (19 loc) 631 B
import { LegacyPromoProperties } from "../legacyLoggerFunctions"; import { PromoProperties } from "../typings"; /** * Maps LegacyPromoProperties to PromoProperties * @param legacyProperties - The legacy promo properties * @returns The new promo properties format */ export const promoPropertiesMapper = ( legacyProperties: LegacyPromoProperties ): PromoProperties => { return { promo_id: legacyProperties.id, action: legacyProperties.action, items_list: legacyProperties.items.map((item) => item.id), title: legacyProperties.title, type: legacyProperties.type, meta: legacyProperties.meta, }; };