New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@blotoutio/edgetag-sdk-js

Package Overview
Dependencies
Maintainers
1
Versions
165
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blotoutio/edgetag-sdk-js - npm Package Compare versions

Comparing version 0.6.4 to 0.6.5

2

index.d.ts
// TODO this all located in '@blotoutio/shared/utility-sdk'
type PersistType = 'local' | 'session'
type PersistType = 'local' | 'session' | 'edge'

@@ -5,0 +5,0 @@ type EventOptions = {

@@ -103,20 +103,52 @@ import { v4 } from 'uuid';

const saveLocal = (value, key) => {
localStorage.setItem(key, JSON.stringify(value));
try {
if (!localStorage) {
return;
}
localStorage.setItem(key, JSON.stringify(value));
}
catch (_a) {
console.log('Local storage not supported');
}
};
const getLocal = (key) => {
const data = localStorage.getItem(key);
if (!data) {
try {
if (!localStorage) {
return {};
}
const data = localStorage.getItem(key);
if (!data) {
return {};
}
return JSON.parse(data) || {};
}
catch (_a) {
return {};
}
return JSON.parse(data) || {};
};
const saveSession = (value, key) => {
sessionStorage.setItem(key, JSON.stringify(value));
try {
if (!sessionStorage) {
return;
}
sessionStorage.setItem(key, JSON.stringify(value));
}
catch (_a) {
console.log('Session storage not supported');
}
};
const getSession = (key) => {
const data = sessionStorage.getItem(key);
if (!data) {
try {
if (!sessionStorage) {
return {};
}
const data = sessionStorage.getItem(key);
if (!data) {
return {};
}
return JSON.parse(data) || {};
}
catch (_a) {
return {};
}
return JSON.parse(data) || {};
};

@@ -385,17 +417,15 @@

Object.values(providerPackages).forEach((pkg) => {
if (!allowProvider(providers, pkg.name)) {
if (!pkg || !pkg.tag || !allowProvider(providers, pkg.name)) {
return;
}
if (pkg && pkg.tag) {
const result = pkg.tag({
userId,
eventName,
eventId,
data,
sendTag,
manifestVariables: getProviderVariables(pkg.name),
});
if (result) {
providerData[pkg.name] = result;
}
const result = pkg.tag({
userId,
eventName,
eventId,
data,
sendTag,
manifestVariables: getProviderVariables(pkg.name),
});
if (result) {
providerData[pkg.name] = result;
}

@@ -414,2 +444,26 @@ });

const handleData = (data, options) => {
if (!data || Object.keys(data).length === 0) {
console.error('Provide data for data API.');
return;
}
saveKV(data);
postRequest(getDataURL(), { data }, options).catch(info);
};
const saveDataToEdge = (key, value, provider) => {
if (!value) {
return;
}
if (typeof value !== 'string') {
try {
value = JSON.stringify(value);
}
catch (_a) {
console.log('Error stringify value');
return;
}
}
handleData({ [`${provider}::${key}`]: value });
};
const handleCaptureQuery = (provider, key, persistType) => {

@@ -423,3 +477,11 @@ if (!window) {

}
saveDataPerKey(persistType, provider, params.get(key), key);
const data = params.get(key);
if (!data) {
return;
}
if (persistType === 'edge') {
saveDataToEdge(key, data, provider);
return;
}
saveDataPerKey(persistType, provider, data, key);
};

@@ -434,8 +496,7 @@ const handleCaptureStorage = (provider, key, persistType, location) => {

case 'local': {
data = sessionStorage && sessionStorage.getItem(key);
data = getData$1('local', key);
break;
}
case 'session': {
data = localStorage && localStorage.getItem(key);
break;
data = getData$1('session', key);
}

@@ -446,2 +507,6 @@ }

}
if (persistType === 'edge') {
saveDataToEdge(key, data, provider);
return;
}
saveDataPerKey(persistType, provider, data, key);

@@ -529,11 +594,2 @@ };

const handleData = (data, options) => {
if (!data || Object.keys(data).length === 0) {
console.error('Provide data for data API.');
return;
}
saveKV(data);
postRequest(getDataURL(), { data }, options).catch(info);
};
const handleGetData = (keys, callback) => {

@@ -540,0 +596,0 @@ if (!keys || keys.length === 0) {

{
"name": "@blotoutio/edgetag-sdk-js",
"version": "0.6.4",
"version": "0.6.5",
"description": "JS SDK for EdgeTag",

@@ -11,5 +11,5 @@ "author": "Blotout",

},
"main": "./index.esm.js",
"peerDependencies": {
"uuid": "*"
"main": "./index.cjs",
"dependencies": {
"uuid": "^9.0.0"
},

@@ -16,0 +16,0 @@ "repository": {

Sorry, the diff of this file is not supported yet

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