@iabtcf/core
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -1,1 +0,1 @@ | ||
"use strict";var __values=this&&this.__values||function(e){var r="function"==typeof Symbol&&Symbol.iterator,o=r&&e[r],t=0;if(o)return o.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&t>=e.length&&(e=void 0),{value:e&&e[t++],done:!e}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")},__read=this&&this.__read||function(e,r){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var t,n,i=o.call(e),s=[];try{for(;(void 0===r||r-- >0)&&!(t=i.next()).done;)s.push(t.value)}catch(e){n={error:e}}finally{try{t&&!t.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}return s};Object.defineProperty(exports,"__esModule",{value:!0});var errors_1=require("../errors"),model_1=require("../model"),SemanticPreEncoder=function(){function e(){}return e.process=function(e,r){var o,t,n=e.gvl;if(!n)throw new errors_1.EncodingError("Unable to encode TCModel without a GVL");if(!n.isReady)throw new errors_1.EncodingError("Unable to encode TCModel tcModel.gvl.readyPromise is not resolved");(e=e.clone()).consentLanguage=n.language.toUpperCase(),(null===(o=r)||void 0===o?void 0:o.version)>0&&(null===(t=r)||void 0===t?void 0:t.version)<=this.processor.length?e.version=r.version:e.version=this.processor.length;var i=e.version-1;if(!this.processor[i])throw new errors_1.EncodingError("Invalid version: "+e.version);return this.processor[i](e,n)},e.processor=[function(e){return e},function(e,r){var o,t,n,i;e.publisherRestrictions.gvl=r,e.purposeLegitimateInterests.unset(1);var s=new Map;s.set("legIntPurposes",e.vendorLegitimateInterests),s.set("purposes",e.vendorConsents);try{for(var l=__values(s),a=l.next();!a.done;a=l.next()){var u=__read(a.value,2),c=u[0],v=u[1];try{for(var d=(n=void 0,__values(v.values())),f=d.next();!f.done;f=d.next()){var p=f.value,h=r.vendors[p];if(!h||h.deletedDate)v.unset(p);else if(0===h[c].length)if(e.isServiceSpecific)if(0===h.flexiblePurposes.length)v.unset(p);else{for(var y=e.publisherRestrictions.getRestrictions(p),_=!1,g=0,m=y.length;g<m&&!_;g++)_=y[g].restrictionType===model_1.RestrictionType.REQUIRE_CONSENT&&"purposes"===c||y[g].restrictionType===model_1.RestrictionType.REQUIRE_LI&&"legIntPurposes"===c;_||v.unset(p)}else v.unset(p)}}catch(e){n={error:e}}finally{try{f&&!f.done&&(i=d.return)&&i.call(d)}finally{if(n)throw n.error}}}}catch(e){o={error:e}}finally{try{a&&!a.done&&(t=l.return)&&t.call(l)}finally{if(o)throw o.error}}return e.vendorsDisclosed.set(r.vendors),e}],e}();exports.SemanticPreEncoder=SemanticPreEncoder; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var errors_1=require("../errors"),model_1=require("../model"),SemanticPreEncoder=function(){function e(){}return e.process=function(e,r){var o,s,n=e.gvl;if(!n)throw new errors_1.EncodingError("Unable to encode TCModel without a GVL");if(!n.isReady)throw new errors_1.EncodingError("Unable to encode TCModel tcModel.gvl.readyPromise is not resolved");(e=e.clone()).consentLanguage=n.language.toUpperCase(),(null===(o=r)||void 0===o?void 0:o.version)>0&&(null===(s=r)||void 0===s?void 0:s.version)<=this.processor.length?e.version=r.version:e.version=this.processor.length;var t=e.version-1;if(!this.processor[t])throw new errors_1.EncodingError("Invalid version: "+e.version);return this.processor[t](e,n)},e.processor=[function(e){return e},function(e,r){e.publisherRestrictions.gvl=r,e.purposeLegitimateInterests.unset(1);var o=new Map;return o.set("legIntPurposes",e.vendorLegitimateInterests),o.set("purposes",e.vendorConsents),o.forEach((function(o,s){o.forEach((function(n,t){if(n){var i=r.vendors[t];if(!i||i.deletedDate)o.unset(t);else if(0===i[s].length)if(e.isServiceSpecific)if(0===i.flexiblePurposes.length)o.unset(t);else{for(var c=e.publisherRestrictions.getRestrictions(t),l=!1,u=0,d=c.length;u<d&&!l;u++)l=c[u].restrictionType===model_1.RestrictionType.REQUIRE_CONSENT&&"purposes"===s||c[u].restrictionType===model_1.RestrictionType.REQUIRE_LI&&"legIntPurposes"===s;l||o.unset(t)}else o.unset(t)}}))})),e.vendorsDisclosed.set(r.vendors),e}],e}();exports.SemanticPreEncoder=SemanticPreEncoder; |
@@ -8,3 +8,3 @@ import { Cloneable } from '../Cloneable'; | ||
*/ | ||
declare class Vector extends Cloneable<Vector> implements Iterable<IdBoolTuple> { | ||
export declare class Vector extends Cloneable<Vector> implements Iterable<IdBoolTuple> { | ||
/** | ||
@@ -73,2 +73,2 @@ * if this originatd from an encoded string we'll need a place to store the | ||
} | ||
export { Vector }; | ||
export {}; |
@@ -1,1 +0,1 @@ | ||
"use strict";var __extends=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),__generator=this&&this.__generator||function(t,e){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},__values=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(exports,"__esModule",{value:!0});var Cloneable_1=require("../Cloneable"),errors_1=require("../errors"),Vector=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.bitLength=0,e.maxId_=0,e.set_=new Set,e}return __extends(e,t),e.prototype[Symbol.iterator]=function(){var t;return __generator(this,(function(e){switch(e.label){case 0:t=1,e.label=1;case 1:return t<=this.maxId?[4,[t,this.has(t)]]:[3,4];case 2:e.sent(),e.label=3;case 3:return t++,[3,1];case 4:return[2]}}))},e.prototype.values=function(){return this.set_.values()},Object.defineProperty(e.prototype,"maxId",{get:function(){return this.maxId_},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this.set_.has(t)},e.prototype.unset=function(t){var e=this;Array.isArray(t)?t.forEach((function(t){return e.unset(t)})):"object"==typeof t?this.unset(Object.keys(t).map((function(t){return+t}))):(this.set_.delete(t),this.bitLength=0,t===this.maxId&&(this.maxId_=0,this.set_.forEach((function(t){e.maxId_=Math.max(e.maxId,t)}))))},e.prototype.isIntMap=function(t){var e=this,r="object"==typeof t;return r=r&&Object.keys(t).every((function(r){var n=Number.isInteger(parseInt(r,10));return n=(n=n&&e.isValidNumber(t[r].id))&&void 0!==t[r].name}))},e.prototype.isValidNumber=function(t){return parseInt(t,10)>0},e.prototype.isSet=function(t){var e=!1;return t instanceof Set&&(e=Array.from(t).every(this.isValidNumber)),e},e.prototype.set=function(t){var e=this;if(Array.isArray(t))t.forEach((function(t){return e.set(t)}));else if(this.isSet(t))this.set(Array.from(t));else if(this.isIntMap(t))this.set(Object.keys(t).map((function(t){return+t})));else{if(!this.isValidNumber(t))throw new errors_1.TCModelError("set()",t,"must be positive integer array, positive integer, Set<number>, or IntMap");this.set_.add(t),this.maxId_=Math.max(this.maxId,t),this.bitLength=0}},e.prototype.empty=function(){this.set_=new Set},e.prototype.forEach=function(t){var e,r;try{for(var n=__values(this),o=n.next();!o.done;o=n.next()){var i=o.value;t(i[1],i[0])}}catch(t){e={error:t}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}},Object.defineProperty(e.prototype,"size",{get:function(){return this.set_.size},enumerable:!0,configurable:!0}),e.prototype.setAll=function(t){this.set(t)},e}(Cloneable_1.Cloneable);exports.Vector=Vector; | ||
"use strict";var __extends=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),__generator=this&&this.__generator||function(t,e){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(exports,"__esModule",{value:!0});var Cloneable_1=require("../Cloneable"),errors_1=require("../errors"),Vector=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.bitLength=0,e.maxId_=0,e.set_=new Set,e}return __extends(e,t),e.prototype[Symbol.iterator]=function(){var t;return __generator(this,(function(e){switch(e.label){case 0:t=1,e.label=1;case 1:return t<=this.maxId?[4,[t,this.has(t)]]:[3,4];case 2:e.sent(),e.label=3;case 3:return t++,[3,1];case 4:return[2]}}))},e.prototype.values=function(){return this.set_.values()},Object.defineProperty(e.prototype,"maxId",{get:function(){return this.maxId_},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this.set_.has(t)},e.prototype.unset=function(t){var e=this;Array.isArray(t)?t.forEach((function(t){return e.unset(t)})):"object"==typeof t?this.unset(Object.keys(t).map((function(t){return+t}))):(this.set_.delete(t),this.bitLength=0,t===this.maxId&&(this.maxId_=0,this.set_.forEach((function(t){e.maxId_=Math.max(e.maxId,t)}))))},e.prototype.isIntMap=function(t){var e=this,r="object"==typeof t;return r=r&&Object.keys(t).every((function(r){var n=Number.isInteger(parseInt(r,10));return n=(n=n&&e.isValidNumber(t[r].id))&&void 0!==t[r].name}))},e.prototype.isValidNumber=function(t){return parseInt(t,10)>0},e.prototype.isSet=function(t){var e=!1;return t instanceof Set&&(e=Array.from(t).every(this.isValidNumber)),e},e.prototype.set=function(t){var e=this;if(Array.isArray(t))t.forEach((function(t){return e.set(t)}));else if(this.isSet(t))this.set(Array.from(t));else if(this.isIntMap(t))this.set(Object.keys(t).map((function(t){return+t})));else{if(!this.isValidNumber(t))throw new errors_1.TCModelError("set()",t,"must be positive integer array, positive integer, Set<number>, or IntMap");this.set_.add(t),this.maxId_=Math.max(this.maxId,t),this.bitLength=0}},e.prototype.empty=function(){this.set_=new Set},e.prototype.forEach=function(t){for(var e=1;e<=this.maxId;e++)t(this.has(e),e)},Object.defineProperty(e.prototype,"size",{get:function(){return this.set_.size},enumerable:!0,configurable:!0}),e.prototype.setAll=function(t){this.set(t)},e}(Cloneable_1.Cloneable);exports.Vector=Vector; |
{ | ||
"name": "@iabtcf/core", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Ensures consistent encoding and decoding of TC Signals for the iab. Transparency and Consent Framework (TCF).", | ||
@@ -24,3 +24,3 @@ "author": "Chris Paterson <tcf@chrispaterson.io>", | ||
"devDependencies": { | ||
"@iabtcf/testing": "1.1.1", | ||
"@iabtcf/testing": "1.1.2", | ||
"@istanbuljs/nyc-config-typescript": "^0.1.3", | ||
@@ -27,0 +27,0 @@ "@types/sinon": "^7.0.13", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
139967