Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cacheString - global #49

Open
vincent-ogury opened this issue Mar 5, 2020 · 2 comments
Open

cacheString - global #49

vincent-ogury opened this issue Mar 5, 2020 · 2 comments

Comments

@vincent-ogury
Copy link

Having cacheString in global make unexpected behavior.

Example:

const {ConsentString} = require('consent-string');

const globalVendorList = {vendorListVersion: 1,
  purposes: [{id: 1}, {id: 2}, {id: 3}, {id: 4}, {id: 5}],
  vendors: [{id: 10, name: 'vendor1'}, {id: 20, name: 'vendor2'}]};

const test1 = new ConsentString();
test1.setGlobalVendorList(globalVendorList);
test1.setCmpId(7);

const test2 = new ConsentString();
test2.setGlobalVendorList(globalVendorList);
test2.setCmpId(45);

console.log('TEST1:', test1.getConsentString(false));
console.log('TEST2:', test2.getConsentString(false));
console.log(test1.getConsentString(false) === test2.getConsentString(false))
;

In that case the consentString of the first object is returned on the second object!

@vincent-ogury
Copy link
Author

no issue on 1.4.2

@vincent-ogury
Copy link
Author

I have created a PR:
#50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant