@didomi/iabtcf-core
Advanced tools
Comparing version 1.5.3 to 1.5.4
@@ -17,2 +17,3 @@ import { Cloneable } from '../Cloneable.js'; | ||
[Symbol.iterator](): Iterator<IdBoolTuple>; | ||
toArray(): Array<IdBoolTuple>; | ||
/** | ||
@@ -19,0 +20,0 @@ * values() |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Vector=void 0;const Cloneable_js_1=require("../Cloneable.js"),index_js_1=require("../errors/index.js");class Vector extends Cloneable_js_1.Cloneable{constructor(){super(...arguments),this.bitLength=0,this.maxId_=0,this.set_=new Set}*[Symbol.iterator](){for(let e=1;e<=this.maxId;e++)yield[e,this.has(e)]}values(){return this.set_.values()}get maxId(){return this.maxId_}has(e){return this.set_.has(e)}unset(e){Array.isArray(e)?e.forEach(e=>this.unset(e)):"object"==typeof e?this.unset(Object.keys(e).map(e=>Number(e))):(this.set_.delete(Number(e)),this.bitLength=0,e===this.maxId&&(this.maxId_=0,this.set_.forEach(e=>{this.maxId_=Math.max(this.maxId,e)})))}isIntMap(e){let t="object"==typeof e;return t=t&&Object.keys(e).every(t=>{let s=Number.isInteger(parseInt(t,10));return s=s&&this.isValidNumber(e[t].id),s=s&&void 0!==e[t].name,s}),t}isValidNumber(e){return parseInt(e,10)>0}isSet(e){let t=!1;return e instanceof Set&&(t=Array.from(e).every(this.isValidNumber)),t}set(e){if(Array.isArray(e))e.forEach(e=>this.set(e));else if(this.isSet(e))this.set(Array.from(e));else if(this.isIntMap(e))this.set(Object.keys(e).map(e=>Number(e)));else{if(!this.isValidNumber(e))throw new index_js_1.TCModelError("set()",e,"must be positive integer array, positive integer, Set<number>, or IntMap");this.set_.add(e),this.maxId_=Math.max(this.maxId,e),this.bitLength=0}}empty(){this.set_=new Set}forEach(e){for(let t=1;t<=this.maxId;t++)e(this.has(t),t)}get size(){return this.set_.size}setAll(e){this.set(e)}}exports.Vector=Vector; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Vector=void 0;const Cloneable_js_1=require("../Cloneable.js"),index_js_1=require("../errors/index.js");class Vector extends Cloneable_js_1.Cloneable{constructor(){super(...arguments),this.bitLength=0,this.maxId_=0,this.set_=new Set}*[Symbol.iterator](){for(let e=1;e<=this.maxId;e++)yield[e,this.has(e)]}toArray(){const e=new Array(0);for(let t=1;t<=this.maxId;t++)e.push([t,this.has(t)]);return e}values(){return this.set_.values()}get maxId(){return this.maxId_}has(e){return this.set_.has(e)}unset(e){Array.isArray(e)?e.forEach(e=>this.unset(e)):"object"==typeof e?this.unset(Object.keys(e).map(e=>Number(e))):(this.set_.delete(Number(e)),this.bitLength=0,e===this.maxId&&(this.maxId_=0,this.set_.forEach(e=>{this.maxId_=Math.max(this.maxId,e)})))}isIntMap(e){let t="object"==typeof e;return t=t&&Object.keys(e).every(t=>{let s=Number.isInteger(parseInt(t,10));return s=s&&this.isValidNumber(e[t].id),s=s&&void 0!==e[t].name,s}),t}isValidNumber(e){return parseInt(e,10)>0}isSet(e){let t=!1;return e instanceof Set&&(t=Array.from(e).every(this.isValidNumber)),t}set(e){if(Array.isArray(e))e.forEach(e=>this.set(e));else if(this.isSet(e))this.set(Array.from(e));else if(this.isIntMap(e))this.set(Object.keys(e).map(e=>Number(e)));else{if(!this.isValidNumber(e))throw new index_js_1.TCModelError("set()",e,"must be positive integer array, positive integer, Set<number>, or IntMap");this.set_.add(e),this.maxId_=Math.max(this.maxId,e),this.bitLength=0}}empty(){this.set_=new Set}forEach(e){for(let t=1;t<=this.maxId;t++)e(this.has(t),t)}get size(){return this.set_.size}setAll(e){this.set(e)}}exports.Vector=Vector; |
@@ -17,2 +17,3 @@ import { Cloneable } from '../Cloneable.js'; | ||
[Symbol.iterator](): Iterator<IdBoolTuple>; | ||
toArray(): Array<IdBoolTuple>; | ||
/** | ||
@@ -19,0 +20,0 @@ * values() |
@@ -19,2 +19,9 @@ import { Cloneable } from '../Cloneable.js'; | ||
} | ||
toArray() { | ||
const result = new Array(0); | ||
for (let i = 1; i <= this.maxId; i++) { | ||
result.push([i, this.has(i)]); | ||
} | ||
return result; | ||
} | ||
/** | ||
@@ -21,0 +28,0 @@ * values() |
{ | ||
"name": "@didomi/iabtcf-core", | ||
"version": "1.5.3", | ||
"version": "1.5.4", | ||
"description": "Ensures consistent encoding and decoding of TC Signals for the iab. Transparency and Consent Framework (TCF).", | ||
@@ -31,3 +31,3 @@ "author": "Chris Paterson <tcf@chrispaterson.io>", | ||
"devDependencies": { | ||
"@didomi/iabtcf-testing": "1.5.3", | ||
"@didomi/iabtcf-testing": "1.5.4", | ||
"@istanbuljs/nyc-config-typescript": "^0.1.3", | ||
@@ -34,0 +34,0 @@ "@types/sinon": "^10.0.11", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
307566
5939
0