Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public static noGVL(): TCModel {
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;
}
public constructor() {
super();
this.tcmodel = new TCModel();
this.tcmodel.setCMPManifest(new CMPManifest());
this.cmpManifest = this.tcmodel.getCMPManifest();
}