import omitBy from 'lodash.omitby'; import isNil from 'lodash.isnil'; export const shortenLookUpsHelper: any = { captureId: 'a', sessionId: 'b', tenantId: 'c', sessionCreated: 'd', ip: 'e', environment: 'f', dataResidency: 'g', spaceId: 'h', appId: 'i', appVersion: 'j', installationId: 'k', installationVersion: 'l', country: 'm', locationAccuracy: 'n', latitude: 'o', longitude: 'p', deviceId: 'q', clientId: 'r', eventType: 's', eventTime: 't', interaction: 'u', productId: 'v', categoryId: 'w', int1: 'x', int2: 'y', int3: 'z', int4: 'aa', int5: 'ab', str1: 'ac', str2: 'ad', str3: 'ae', str4: 'af', str5: 'ag', clientCreated: 'ah', clientIp: 'ai', clientUserAgent: 'aj', clientDeviceVendor: 'ak', clientDeviceModel: 'al', clientDeviceType: 'am', clientOsName: 'an', clientOsVersion: 'ao', clientBrowserName: 'ap', clientBrowserVersion: 'aq', clientBrowserMajor: 'ar', clientBrowserEngine: 'as', clientBrowserEngineVersion: 'at', clientCpuArchitecture: 'au', clientScreenWidth: 'av', clientScreenHeight: 'aw', clientScreenColorDepth: 'ax', clientScreenPixelDepth: 'ay', stateful: 'ba', public: 'bb', currency: 'bc', revenue: 'bd', products: 'be', transactionId: 'bf', affiliation: 'bg', shipping: 'bh', tax: 'bi', coupon: 'bj', }; export default function shortenKeys(obj: any) { const result: any = {}; for (const key of Object.keys(obj)) { result[shortenLookUpsHelper[key]] = obj[key]; } return omitBy(result, isNil); }