@ledgerhq/live-common
Version:
Common ground for the Ledger Live apps
13 lines • 580 B
JavaScript
const NUMBER_OF_MONTHS = 3;
const MILLISECONDS_IN_A_MONTH = 30 * 24 * 60 * 60 * 1000;
export const getBrazeCampaignCutoff = (now) => now.getTime() - NUMBER_OF_MONTHS * MILLISECONDS_IN_A_MONTH;
export const generateAnonymousId = () => {
return "anonymous_id_" + (Math.floor(Math.random() * 20) + 1);
};
export const getOldCampaignIds = (campaigns) => {
const cutoff = getBrazeCampaignCutoff(new Date());
return Object.entries(campaigns)
.filter(([_, timestamp]) => timestamp < cutoff)
.map(([id, _]) => id);
};
//# sourceMappingURL=anonymousUsers.js.map