Socket
Socket
Sign inDemoInstall

@iabtcf/cmpapi

Package Overview
Dependencies
1
Maintainers
1
Versions
88
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.0-2 to 1.1.0-3

2

lib/CallResponder.js

@@ -1,1 +0,1 @@

"use strict";var __read=this&&this.__read||function(o,e){var n="function"==typeof Symbol&&o[Symbol.iterator];if(!n)return o;var t,a,i=n.call(o),s=[];try{for(;(void 0===e||e-- >0)&&!(t=i.next()).done;)s.push(t.value)}catch(o){a={error:o}}finally{try{t&&!t.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return s},__spread=this&&this.__spread||function(){for(var o=[],e=0;e<arguments.length;e++)o=o.concat(__read(arguments[e]));return o};Object.defineProperty(exports,"__esModule",{value:!0});var command_1=require("./command"),CommandMap_1=require("./command/CommandMap"),CmpApiModel_1=require("./CmpApiModel"),Disabled_1=require("./response/Disabled"),SupportedVersions_1=require("./SupportedVersions");exports.API_KEY="__tcfapi";var CallResponder=function(){function o(o){this.customCommands=o;try{this.callQueue=window[exports.API_KEY]()||[]}catch(o){this.callQueue=[]}finally{window[exports.API_KEY]=this.apiCall.bind(this)}}return o.prototype.apiCall=function(o,e,n){for(var t,a=[],i=3;i<arguments.length;i++)a[i-3]=arguments[i];if("string"!=typeof o)n(null,!1);else if(SupportedVersions_1.SupportedVersions.has(e)){if("function"!=typeof n)throw new Error("invalid callback function");CmpApiModel_1.CmpApiModel.disabled?n(new Disabled_1.Disabled,!1):this.isCustomCommand(o)||this.isBuiltInCommand(o)?this.isCustomCommand(o)&&!this.isBuiltInCommand(o)?(t=this.customCommands)[o].apply(t,__spread([n],a)):o===command_1.TCFCommand.PING?this.isCustomCommand(o)?new CommandMap_1.CommandMap[o](this.customCommands[o],a[0],null,n):new CommandMap_1.CommandMap[o](n,a[0]):void 0===CmpApiModel_1.CmpApiModel.tcModel?this.callQueue.push(__spread([o,e,n],a)):this.isCustomCommand(o)&&this.isBuiltInCommand(o)?new CommandMap_1.CommandMap[o](this.customCommands[o],a[0],null,n):new CommandMap_1.CommandMap[o](n,a[0]):n(null,!1)}else n(null,!1)},o.prototype.purgeQueuedCalls=function(){var o=this.callQueue;this.callQueue=[],o.forEach((function(o){window[exports.API_KEY].apply(window,__spread(o))}))},o.prototype.isCustomCommand=function(o){return this.customCommands&&"function"==typeof this.customCommands[o]},o.prototype.isBuiltInCommand=function(o){return void 0!==CommandMap_1.CommandMap[o]},o}();exports.CallResponder=CallResponder;
"use strict";var __read=this&&this.__read||function(o,e){var n="function"==typeof Symbol&&o[Symbol.iterator];if(!n)return o;var t,a,i=n.call(o),s=[];try{for(;(void 0===e||e-- >0)&&!(t=i.next()).done;)s.push(t.value)}catch(o){a={error:o}}finally{try{t&&!t.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return s},__spread=this&&this.__spread||function(){for(var o=[],e=0;e<arguments.length;e++)o=o.concat(__read(arguments[e]));return o};Object.defineProperty(exports,"__esModule",{value:!0});var command_1=require("./command"),CommandMap_1=require("./command/CommandMap"),CmpApiModel_1=require("./CmpApiModel"),Disabled_1=require("./response/Disabled"),SupportedVersions_1=require("./SupportedVersions");exports.API_KEY="__tcfapi";var CallResponder=function(){function o(o){this.customCommands=o;try{this.callQueue=window[exports.API_KEY]()||[]}catch(o){this.callQueue=[]}finally{window[exports.API_KEY]=this.apiCall.bind(this),this.purgeQueuedCalls()}}return o.prototype.apiCall=function(o,e,n){for(var t,a=[],i=3;i<arguments.length;i++)a[i-3]=arguments[i];if("string"!=typeof o)n(null,!1);else if(SupportedVersions_1.SupportedVersions.has(e)){if("function"!=typeof n)throw new Error("invalid callback function");CmpApiModel_1.CmpApiModel.disabled?n(new Disabled_1.Disabled,!1):this.isCustomCommand(o)||this.isBuiltInCommand(o)?this.isCustomCommand(o)&&!this.isBuiltInCommand(o)?(t=this.customCommands)[o].apply(t,__spread([n],a)):o===command_1.TCFCommand.PING?this.isCustomCommand(o)?new CommandMap_1.CommandMap[o](this.customCommands[o],a[0],null,n):new CommandMap_1.CommandMap[o](n,a[0]):void 0===CmpApiModel_1.CmpApiModel.tcModel?this.callQueue.push(__spread([o,e,n],a)):this.isCustomCommand(o)&&this.isBuiltInCommand(o)?new CommandMap_1.CommandMap[o](this.customCommands[o],a[0],null,n):new CommandMap_1.CommandMap[o](n,a[0]):n(null,!1)}else n(null,!1)},o.prototype.purgeQueuedCalls=function(){var o=this.callQueue;this.callQueue=[],o.forEach((function(o){window[exports.API_KEY].apply(window,__spread(o))}))},o.prototype.isCustomCommand=function(o){return this.customCommands&&"function"==typeof this.customCommands[o]},o.prototype.isBuiltInCommand=function(o){return void 0!==CommandMap_1.CommandMap[o]},o}();exports.CallResponder=CallResponder;
{
"name": "@iabtcf/cmpapi",
"version": "1.1.0-2",
"version": "1.1.0-3",
"description": "Ensures other in-page digital marketing technologies have access to CMP transparency and consent information for the iab. Transparency and Consent Framework (TCF).",

@@ -28,4 +28,4 @@ "author": "Chris Paterson <tcf@chrispaterson.io>",

"devDependencies": {
"@iabtcf/stub": "1.1.0-2",
"@iabtcf/testing": "1.1.0-2",
"@iabtcf/stub": "1.1.0-3",
"@iabtcf/testing": "1.1.0-3",
"@istanbuljs/nyc-config-typescript": "^0.1.3",

@@ -32,0 +32,0 @@ "@types/mocha": "^5.2.7",

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc