You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@papercups-io/chat-widget

Package Overview
Dependencies
Maintainers
2
Versions
113
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.18 to 1.0.19

74

dist/index.js

@@ -318,27 +318,60 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }

var get = function get(key) {
var result = localStorage.getItem("" + PREFIX + key);
if (!result) {
return null;
}
var getStorage = function getStorage(w) {
try {
return JSON.parse(result);
var storage = w && (w.localStorage || w.sessionStorage);
return storage;
} catch (e) {
return result;
return {
_db: {},
getItem: function getItem(key) {
return this._db[key] || null;
},
setItem: function setItem(key, value) {
this._db[key] = value;
},
removeItem: function removeItem(key) {
delete this._db[key];
}
};
}
};
var set = function set(key, value) {
localStorage.setItem("" + PREFIX + key, JSON.stringify(value));
};
function store(w) {
var storage = getStorage(w);
var getCustomerId = function getCustomerId() {
return get('__CUSTOMER_ID__');
};
var setCustomerId = function setCustomerId(id) {
return set('__CUSTOMER_ID__', id);
};
var get = function get(key) {
var result = storage.getItem("" + PREFIX + key);
if (!result) {
return null;
}
try {
return JSON.parse(result);
} catch (e) {
return result;
}
};
var set = function set(key, value) {
storage.setItem("" + PREFIX + key, JSON.stringify(value));
};
var remove = function remove(key) {
storage.removeItem(key);
};
return {
getCustomerId: function getCustomerId() {
return get('__CUSTOMER_ID__');
},
setCustomerId: function setCustomerId(id) {
return set('__CUSTOMER_ID__', id);
},
removeCustomerId: function removeCustomerId() {
return remove('__CUSTOMER_ID__');
}
};
}
var helpers = function helpers(win) {

@@ -1285,3 +1318,4 @@ var ArrayProto = Array.prototype;

var iframeRef = React.useRef(null);
var cachedCustomerId = getCustomerId();
var storage = store(window);
var cachedCustomerId = storage.getCustomerId();
var query = React.useRef(qs.stringify({

@@ -1335,3 +1369,3 @@ accountId: accountId,

var customerId = payload.customerId;
return setCustomerId(customerId);
return storage.setCustomerId(customerId);
};

@@ -1338,0 +1372,0 @@

@@ -316,27 +316,60 @@ import React from 'react';

var get = function get(key) {
var result = localStorage.getItem("" + PREFIX + key);
if (!result) {
return null;
}
var getStorage = function getStorage(w) {
try {
return JSON.parse(result);
var storage = w && (w.localStorage || w.sessionStorage);
return storage;
} catch (e) {
return result;
return {
_db: {},
getItem: function getItem(key) {
return this._db[key] || null;
},
setItem: function setItem(key, value) {
this._db[key] = value;
},
removeItem: function removeItem(key) {
delete this._db[key];
}
};
}
};
var set = function set(key, value) {
localStorage.setItem("" + PREFIX + key, JSON.stringify(value));
};
function store(w) {
var storage = getStorage(w);
var getCustomerId = function getCustomerId() {
return get('__CUSTOMER_ID__');
};
var setCustomerId = function setCustomerId(id) {
return set('__CUSTOMER_ID__', id);
};
var get = function get(key) {
var result = storage.getItem("" + PREFIX + key);
if (!result) {
return null;
}
try {
return JSON.parse(result);
} catch (e) {
return result;
}
};
var set = function set(key, value) {
storage.setItem("" + PREFIX + key, JSON.stringify(value));
};
var remove = function remove(key) {
storage.removeItem(key);
};
return {
getCustomerId: function getCustomerId() {
return get('__CUSTOMER_ID__');
},
setCustomerId: function setCustomerId(id) {
return set('__CUSTOMER_ID__', id);
},
removeCustomerId: function removeCustomerId() {
return remove('__CUSTOMER_ID__');
}
};
}
var helpers = function helpers(win) {

@@ -1283,3 +1316,4 @@ var ArrayProto = Array.prototype;

var iframeRef = React.useRef(null);
var cachedCustomerId = getCustomerId();
var storage = store(window);
var cachedCustomerId = storage.getCustomerId();
var query = React.useRef(qs.stringify({

@@ -1333,3 +1367,3 @@ accountId: accountId,

var customerId = payload.customerId;
return setCustomerId(customerId);
return storage.setCustomerId(customerId);
};

@@ -1336,0 +1370,0 @@

@@ -1,3 +0,5 @@

export declare const getCustomerId: () => any;
export declare const setCustomerId: (id: string) => void;
export declare const removeCustomerId: () => void;
export default function store(w: any): {
getCustomerId: () => any;
setCustomerId: (id: string) => void;
removeCustomerId: () => void;
};
{
"name": "@papercups-io/chat-widget",
"version": "1.0.18",
"version": "1.0.19",
"description": "Papercups chat widget",

@@ -5,0 +5,0 @@ "author": "reichert621",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc