How to use the @iabtcf/core.TCModel function in @iabtcf/core

To help you get started, we’ve selected a few @iabtcf/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github InteractiveAdvertisingBureau / iabtcf-es / modules / testing / src / TCModelFactory.ts View on Github external
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;
      }
github InteractiveAdvertisingBureau / iabtcf-es / modules / tools / src / components / pages / TCStringEncode.vue.ts View on Github external
public constructor() {

    super();

    this.tcmodel = new TCModel();
    this.tcmodel.setCMPManifest(new CMPManifest());
    this.cmpManifest = this.tcmodel.getCMPManifest();

  }

@iabtcf/core

Ensures consistent encoding and decoding of TC Signals for the iab. Transparency and Consent Framework (TCF).

Apache-2.0
Latest version published 2 years ago

Package Health Score

62 / 100
Full package analysis