posthog-js-lite
Advanced tools
Comparing version 2.0.0-alpha2 to 2.0.0-alpha3
@@ -1318,3 +1318,3 @@ 'use strict'; | ||
secure = ''; | ||
var new_cookie_val = key + '=' + encodeURIComponent(JSON.stringify(value)) + expires + '; path=/' + cdomain + secure; | ||
var new_cookie_val = key + '=' + encodeURIComponent(value) + expires + '; path=/' + cdomain + secure; | ||
document.cookie = new_cookie_val; | ||
@@ -1359,3 +1359,3 @@ } catch (err) { | ||
setItem: function (key, value) { | ||
store.setItem(key, JSON.stringify(value)); | ||
store.setItem(key, value); | ||
}, | ||
@@ -1410,3 +1410,3 @@ removeItem: function (key) { | ||
var version = "2.0.0-alpha2"; | ||
var version = "2.0.0-alpha3"; | ||
@@ -1442,9 +1442,7 @@ var PostHog = | ||
delete this._storageCache[key]; | ||
this._storage.removeItem(this._storageKey); | ||
} else { | ||
this._storageCache[key] = value; | ||
} | ||
this._storage.setItem(this._storageKey, JSON.stringify(this._storageCache)); | ||
} | ||
this._storage.setItem(this._storageKey, JSON.stringify(this._storageCache)); | ||
}; | ||
@@ -1457,3 +1455,3 @@ | ||
PostHog.prototype.getLibraryId = function () { | ||
return 'posthog-web'; | ||
return 'posthog-js-lite'; | ||
}; | ||
@@ -1460,0 +1458,0 @@ |
@@ -1314,3 +1314,3 @@ /****************************************************************************** | ||
secure = ''; | ||
var new_cookie_val = key + '=' + encodeURIComponent(JSON.stringify(value)) + expires + '; path=/' + cdomain + secure; | ||
var new_cookie_val = key + '=' + encodeURIComponent(value) + expires + '; path=/' + cdomain + secure; | ||
document.cookie = new_cookie_val; | ||
@@ -1355,3 +1355,3 @@ } catch (err) { | ||
setItem: function (key, value) { | ||
store.setItem(key, JSON.stringify(value)); | ||
store.setItem(key, value); | ||
}, | ||
@@ -1406,3 +1406,3 @@ removeItem: function (key) { | ||
var version = "2.0.0-alpha2"; | ||
var version = "2.0.0-alpha3"; | ||
@@ -1438,9 +1438,7 @@ var PostHog = | ||
delete this._storageCache[key]; | ||
this._storage.removeItem(this._storageKey); | ||
} else { | ||
this._storageCache[key] = value; | ||
} | ||
this._storage.setItem(this._storageKey, JSON.stringify(this._storageCache)); | ||
} | ||
this._storage.setItem(this._storageKey, JSON.stringify(this._storageCache)); | ||
}; | ||
@@ -1453,3 +1451,3 @@ | ||
PostHog.prototype.getLibraryId = function () { | ||
return 'posthog-web'; | ||
return 'posthog-js-lite'; | ||
}; | ||
@@ -1456,0 +1454,0 @@ |
{ | ||
"name": "posthog-js-lite", | ||
"version": "2.0.0-alpha2", | ||
"version": "2.0.0-alpha3", | ||
"main": "lib/index.cjs.js", | ||
"module": "lib/index.esm.js", | ||
"types": "lib/index.d.ts" | ||
"types": "lib/index.d.ts", | ||
"scripts": { | ||
"test": "jest -c jest.config.js", | ||
"prepublish": "cd .. && yarn build" | ||
} | ||
} |
@@ -44,7 +44,7 @@ import { | ||
delete this._storageCache[key] | ||
this._storage.removeItem(this._storageKey) | ||
} else { | ||
this._storageCache[key] = value | ||
this._storage.setItem(this._storageKey, JSON.stringify(this._storageCache)) | ||
} | ||
this._storage.setItem(this._storageKey, JSON.stringify(this._storageCache)) | ||
} | ||
@@ -56,3 +56,3 @@ | ||
getLibraryId(): string { | ||
return 'posthog-web' | ||
return 'posthog-js-lite' | ||
} | ||
@@ -59,0 +59,0 @@ getLibraryVersion(): string { |
@@ -34,4 +34,3 @@ export type PostHogStorage = { | ||
const new_cookie_val = | ||
key + '=' + encodeURIComponent(JSON.stringify(value)) + expires + '; path=/' + cdomain + secure | ||
const new_cookie_val = key + '=' + encodeURIComponent(value) + expires + '; path=/' + cdomain + secure | ||
document.cookie = new_cookie_val | ||
@@ -76,3 +75,3 @@ } catch (err) { | ||
setItem(key, value) { | ||
store.setItem(key, JSON.stringify(value)) | ||
store.setItem(key, value) | ||
}, | ||
@@ -79,0 +78,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
373276
3583