posthog-js-lite 2.0.0-alpha2 → 2.0.0-alpha3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.cjs.js CHANGED
@@ -1315,7 +1315,7 @@ var cookieStore = {
1315
1315
  var cdomain = '',
1316
1316
  expires = '',
1317
1317
  secure = '';
1318
- var new_cookie_val = key + '=' + encodeURIComponent(JSON.stringify(value)) + expires + '; path=/' + cdomain + secure;
1318
+ var new_cookie_val = key + '=' + encodeURIComponent(value) + expires + '; path=/' + cdomain + secure;
1319
1319
  document.cookie = new_cookie_val;
1320
1320
  } catch (err) {
1321
1321
  return;
@@ -1355,7 +1355,7 @@ var createStorageLike = function (store) {
1355
1355
  return store.getItem(key);
1356
1356
  },
1357
1357
  setItem: function (key, value) {
1358
- store.setItem(key, JSON.stringify(value));
1358
+ store.setItem(key, value);
1359
1359
  },
1360
1360
  removeItem: function (key) {
1361
1361
  store.removeItem(key);
@@ -1405,7 +1405,7 @@ var checkStoreIsSupported = function (storage, key) {
1405
1405
  var localStore = checkStoreIsSupported(_localStore) ? _localStore : undefined;
1406
1406
  var sessionStorage = checkStoreIsSupported(_sessionStore) ? _sessionStore : undefined;
1407
1407
 
1408
- var version = "2.0.0-alpha2";
1408
+ var version = "2.0.0-alpha3";
1409
1409
 
1410
1410
  var PostHog =
1411
1411
  /** @class */
@@ -1436,13 +1436,11 @@ function (_super) {
1436
1436
 
1437
1437
  if (value === null) {
1438
1438
  delete this._storageCache[key];
1439
-
1440
- this._storage.removeItem(this._storageKey);
1441
1439
  } else {
1442
1440
  this._storageCache[key] = value;
1443
-
1444
- this._storage.setItem(this._storageKey, JSON.stringify(this._storageCache));
1445
1441
  }
1442
+
1443
+ this._storage.setItem(this._storageKey, JSON.stringify(this._storageCache));
1446
1444
  };
1447
1445
 
1448
1446
  PostHog.prototype.fetch = function (url, options) {
@@ -1450,7 +1448,7 @@ function (_super) {
1450
1448
  };
1451
1449
 
1452
1450
  PostHog.prototype.getLibraryId = function () {
1453
- return 'posthog-web';
1451
+ return 'posthog-js-lite';
1454
1452
  };
1455
1453
 
1456
1454
  PostHog.prototype.getLibraryVersion = function () {