@jitsu/js 0.0.0-alpha.108 → 0.0.0-alpha.110

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.
@@ -1,4 +1,4 @@
1
- @jitsu/js:build: cache hit, replaying output e8bd50f74bd9d841
1
+ @jitsu/js:build: cache hit, replaying output e21a37b6ca6005f8
2
2
  @jitsu/js:build: 
3
3
  @jitsu/js:build: > @jitsu/js@0.0.0 build /Users/ildarnurislamov/Projects/onetag/libs/jitsu-js
4
4
  @jitsu/js:build: > tsc -p . && rollup -c && cp src/jitsu.d.ts dist
@@ -7,9 +7,9 @@
7
7
  @jitsu/js:build: ./compiled/src/browser.js → dist/web/p.js.txt...
8
8
  @jitsu/js:build: (!) Circular dependency
9
9
  @jitsu/js:build: compiled/src/index.js -> compiled/src/analytics-plugin.js -> compiled/src/index.js
10
- @jitsu/js:build: created dist/web/p.js.txt in 303ms
10
+ @jitsu/js:build: created dist/web/p.js.txt in 274ms
11
11
  @jitsu/js:build: 
12
12
  @jitsu/js:build: ./compiled/src/index.js → dist/jitsu.es.js, dist/jitsu.cjs.js...
13
13
  @jitsu/js:build: (!) Circular dependency
14
14
  @jitsu/js:build: compiled/src/index.js -> compiled/src/analytics-plugin.js -> compiled/src/index.js
15
- @jitsu/js:build: created dist/jitsu.es.js, dist/jitsu.cjs.js in 163ms
15
+ @jitsu/js:build: created dist/jitsu.es.js, dist/jitsu.cjs.js in 156ms
@@ -1,4 +1,4 @@
1
- @jitsu/js:clean: cache hit, replaying output 0526b9603ada097a
1
+ @jitsu/js:clean: cache hit, replaying output 946ccca6a061b682
2
2
  @jitsu/js:clean: 
3
3
  @jitsu/js:clean: > @jitsu/js@0.0.0 clean /Users/ildarnurislamov/Projects/onetag/libs/jitsu-js
4
4
  @jitsu/js:clean: > rm -rf ./dist
package/dist/jitsu.cjs.js CHANGED
@@ -1132,8 +1132,8 @@ const cookieStorage = (cookieDomain, key2cookie) => {
1132
1132
  const cookieName = key2cookie[key] || key;
1133
1133
  const result = getCookie(cookieName);
1134
1134
  if (typeof result === "undefined" && key === "__user_id") {
1135
- //backward compatibility with old jitsu code. get user id if from traits
1136
- const traits = parse(getCookie(key2cookie[key])) || {};
1135
+ //backward compatibility with old jitsu cookie. get user id if from traits
1136
+ const traits = parse(getCookie("__eventn_id_usr")) || {};
1137
1137
  return traits.internal_id || traits.user_id || traits.id || traits.userId;
1138
1138
  }
1139
1139
  return parse(result);
@@ -1379,7 +1379,7 @@ function parse(input) {
1379
1379
  value = decodeURIComponent(input);
1380
1380
  }
1381
1381
  try {
1382
- value = JSON.parse(input);
1382
+ value = JSON.parse(value);
1383
1383
  if (value === "true")
1384
1384
  return true;
1385
1385
  if (value === "false")
package/dist/jitsu.es.js CHANGED
@@ -1130,8 +1130,8 @@ const cookieStorage = (cookieDomain, key2cookie) => {
1130
1130
  const cookieName = key2cookie[key] || key;
1131
1131
  const result = getCookie(cookieName);
1132
1132
  if (typeof result === "undefined" && key === "__user_id") {
1133
- //backward compatibility with old jitsu code. get user id if from traits
1134
- const traits = parse(getCookie(key2cookie[key])) || {};
1133
+ //backward compatibility with old jitsu cookie. get user id if from traits
1134
+ const traits = parse(getCookie("__eventn_id_usr")) || {};
1135
1135
  return traits.internal_id || traits.user_id || traits.id || traits.userId;
1136
1136
  }
1137
1137
  return parse(result);
@@ -1377,7 +1377,7 @@ function parse(input) {
1377
1377
  value = decodeURIComponent(input);
1378
1378
  }
1379
1379
  try {
1380
- value = JSON.parse(input);
1380
+ value = JSON.parse(value);
1381
1381
  if (value === "true")
1382
1382
  return true;
1383
1383
  if (value === "false")
package/dist/web/p.js.txt CHANGED
@@ -1133,8 +1133,8 @@
1133
1133
  const cookieName = key2cookie[key] || key;
1134
1134
  const result = getCookie(cookieName);
1135
1135
  if (typeof result === "undefined" && key === "__user_id") {
1136
- //backward compatibility with old jitsu code. get user id if from traits
1137
- const traits = parse(getCookie(key2cookie[key])) || {};
1136
+ //backward compatibility with old jitsu cookie. get user id if from traits
1137
+ const traits = parse(getCookie("__eventn_id_usr")) || {};
1138
1138
  return traits.internal_id || traits.user_id || traits.id || traits.userId;
1139
1139
  }
1140
1140
  return parse(result);
@@ -1380,7 +1380,7 @@
1380
1380
  value = decodeURIComponent(input);
1381
1381
  }
1382
1382
  try {
1383
- value = JSON.parse(input);
1383
+ value = JSON.parse(value);
1384
1384
  if (value === "true")
1385
1385
  return true;
1386
1386
  if (value === "false")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jitsu/js",
3
- "version": "0.0.0-alpha.108",
3
+ "version": "0.0.0-alpha.110",
4
4
  "description": "",
5
5
  "author": "Jitsu Dev Team <dev@jitsu.com>",
6
6
  "main": "dist/jitsu.cjs.js",
@@ -34,7 +34,7 @@
34
34
  "raw-loader": "^4.0.2",
35
35
  "rollup": "^3.2.5",
36
36
  "ts-jest": "^29.0.3",
37
- "@jitsu/types": "0.0.0-alpha.108"
37
+ "@jitsu/types": "0.0.0-alpha.110"
38
38
  },
39
39
  "dependencies": {
40
40
  "analytics": "^0.8.1"
@@ -124,7 +124,7 @@ const cookieStorage: StorageFactory = (cookieDomain, key2cookie) => {
124
124
  const result = getCookie(cookieName);
125
125
  if (typeof result === "undefined" && key === "__user_id") {
126
126
  //backward compatibility with old jitsu cookie. get user id if from traits
127
- const traits = parse(getCookie(key2cookie[key])) || {};
127
+ const traits = parse(getCookie("__eventn_id_usr")) || {};
128
128
  return traits.internal_id || traits.user_id || traits.id || traits.userId;
129
129
  }
130
130
  return parse(result);
package/src/index.ts CHANGED
@@ -9,7 +9,7 @@ export default function parse(input) {
9
9
  value = decodeURIComponent(input);
10
10
  }
11
11
  try {
12
- value = JSON.parse(input);
12
+ value = JSON.parse(value);
13
13
  if (value === "true") return true;
14
14
  if (value === "false") return false;
15
15
  if (typeof value === "object") return value;