Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const latestGVL = GVLFactory.getLatest();
const numPurposes = Object.keys(latestGVL.purposes).length;
const numVendors = Object.keys(latestGVL.vendors).length;
const numSpecialFeatures = Object.keys(latestGVL.specialFeatures).length;
const tcModel = new TCModel();
tcModel.cmpId = makeRandomInt(2,100);
tcModel.cmpVersion = makeRandomInt(1,10);
tcModel.consentScreen = makeRandomInt(1,5);
tcModel.isServiceSpecific = !!makeRandomInt(0,1);
tcModel.vendorListVersion = makeRandomInt(1, latestGVL.vendorListVersion);
let counter = 0;
const rand = makeRandomInt(1, TCModel.consentLanguages.size);
TCModel.consentLanguages.forEach((lang: string): void => {
counter ++;
if(counter === rand) {
tcModel.consentLanguage = lang;
}
});
tcModel.publisherCountryCode = String.fromCharCode(makeRandomInt(65, 90)) + String.fromCharCode(makeRandomInt(65, 90));
const now = (new Date()).getTime();
const GDPRMageddon = 1576883249;
tcModel.created = new Date(makeRandomInt(GDPRMageddon, now));
tcModel.lastUpdated = new Date(makeRandomInt(tcModel.created.getTime(), now));
const numPurposes = Object.keys(latestGVL.purposes).length;
const numVendors = Object.keys(latestGVL.vendors).length;
const numSpecialFeatures = Object.keys(latestGVL.specialFeatures).length;
const tcModel = new TCModel();
tcModel.cmpId = makeRandomInt(2,100);
tcModel.cmpVersion = makeRandomInt(1,10);
tcModel.consentScreen = makeRandomInt(1,5);
tcModel.isServiceSpecific = !!makeRandomInt(0,1);
tcModel.vendorListVersion = makeRandomInt(1, latestGVL.vendorListVersion);
let counter = 0;
const rand = makeRandomInt(1, TCModel.consentLanguages.size);
TCModel.consentLanguages.forEach((lang: string): void => {
counter ++;
if(counter === rand) {
tcModel.consentLanguage = lang;
}
});
tcModel.publisherCountryCode = String.fromCharCode(makeRandomInt(65, 90)) + String.fromCharCode(makeRandomInt(65, 90));
const now = (new Date()).getTime();
const GDPRMageddon = 1576883249;
tcModel.created = new Date(makeRandomInt(GDPRMageddon, now));
tcModel.lastUpdated = new Date(makeRandomInt(tcModel.created.getTime(), now));