@financial-times/ads-personalised-consent
Advanced tools
Comparing version 5.1.1 to 5.1.2-beta.1
import { fetchLegislation } from '@financial-times/privacy-legislation-client'; | ||
/** | ||
* @typedef {import("..").RegionalCompliance} RegionalCompliance | ||
* @typedef {import("..").ConsentInfo} ConsentInfo | ||
* @typedef {import("..").Legislation} Legislation | ||
* @typedef {import("..").Region} Region | ||
*/ | ||
function _defineProperty(obj, key, value) { | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
class PersonalisedConsent { | ||
gpcValue = false; | ||
/** @type {RegionalCompliance} */ | ||
// existing legislation policies | ||
constructor() { | ||
this.gpcValue = false; | ||
/** @type {RegionalCompliance} */ | ||
privacyLegislation = { | ||
legislation: undefined, | ||
region: undefined | ||
}; | ||
consentCookie = { | ||
behavioral: false, | ||
demographic: false, | ||
programmatic: false, | ||
all: false | ||
}; // existing legislation policies | ||
this.privacyLegislation = { | ||
legislation: undefined, | ||
region: undefined | ||
}; | ||
/** @type {ConsentInfo} */ | ||
static legislationPolicy = { | ||
CCPA: "ccpa", | ||
GDPR: "gdpr" | ||
}; | ||
this.consentCookie = { | ||
behavioral: false, | ||
demographic: false, | ||
programmatic: false, | ||
all: false | ||
}; | ||
} | ||
/** | ||
@@ -32,2 +41,3 @@ * init method initialises all the properties in the class by calling all the update functions | ||
async init() { | ||
@@ -214,2 +224,7 @@ await this.updatePrivacyLegislation(); | ||
_defineProperty(PersonalisedConsent, "legislationPolicy", { | ||
CCPA: "ccpa", | ||
GDPR: "gdpr" | ||
}); | ||
const getPersonalisedConsent = async () => { | ||
@@ -216,0 +231,0 @@ const pc = new PersonalisedConsent(); |
@@ -22,3 +22,3 @@ { | ||
}, | ||
"version": "5.1.1" | ||
"version": "5.1.2-beta.1" | ||
} |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
13821
230
2