Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

consent-string

Package Overview
Dependencies
Maintainers
2
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

consent-string - npm Package Compare versions

Comparing version 1.3.0 to 1.3.1

54

dist/utils/bits.js

@@ -150,4 +150,2 @@ 'use strict';

function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return _arrayFrom(arr); } }
/* eslint no-use-before-define: off */

@@ -329,9 +327,2 @@

var listEntryCount = 0;
if (typeof listCount === 'function') {
listEntryCount = listCount(output);
} else if (typeof listCount === 'number') {
listEntryCount = listCount;
}
switch (type) {

@@ -347,16 +338,3 @@ case 'int':

case 'list':
return new Array(listEntryCount).fill().reduce(function (acc) {
var _decodeFields = decodeFields({
input: input,
fields: field.fields,
startPosition: acc.newPosition
}),
decodedObject = _decodeFields.decodedObject,
newPosition = _decodeFields.newPosition;
return {
fieldValue: [].concat(_toConsumableArray(acc.fieldValue), [decodedObject]),
newPosition: newPosition
};
}, { fieldValue: [], newPosition: startPosition });
return decodeList(input, output, startPosition, field, listCount);
case 'language':

@@ -369,2 +347,28 @@ return { fieldValue: decodeBitsToLanguage(input, startPosition, bitCount) };

function decodeList(input, output, startPosition, field, listCount) {
var listEntryCount = 0;
if (typeof listCount === 'function') {
listEntryCount = listCount(output);
} else if (typeof listCount === 'number') {
listEntryCount = listCount;
}
var newPosition = startPosition;
var fieldValue = [];
for (var i = 0; i < listEntryCount; i += 1) {
var decodedFields = decodeFields({
input: input,
fields: field.fields,
startPosition: newPosition
});
newPosition = decodedFields.newPosition;
fieldValue.push(decodedFields.decodedObject);
}
return { fieldValue: fieldValue, newPosition: newPosition };
}
function decodeFields(_ref4) {

@@ -467,4 +471,4 @@ var input = _ref4.input,

var _decodeFields2 = decodeFields({ input: bitString, fields: fields }),
decodedObject = _decodeFields2.decodedObject;
var _decodeFields = decodeFields({ input: bitString, fields: fields }),
decodedObject = _decodeFields.decodedObject;

@@ -471,0 +475,0 @@ return decodedObject;

{
"name": "consent-string",
"version": "1.3.0",
"version": "1.3.1",
"description": "Encode and decode web-safe base64 consent information with the IAB EU's GDPR Transparency and Consent Framework",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/InteractiveAdvertisingBureau/Consent-String-SDK-JS",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc