@constructor-io/constructorio-client-javascript 2.58.0 → 2.58.1

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.
@@ -163,8 +163,7 @@ var ConstructorIO = /*#__PURE__*/function () {
163
163
  segments = options.segments,
164
164
  testCells = options.testCells,
165
165
  sessionId = options.sessionId,
166
- _options$userId = options.userId,
167
- userId = _options$userId === void 0 ? '' : _options$userId;
166
+ userId = options.userId;
168
167
  if (apiKey) {
169
168
  this.options.apiKey = apiKey;
170
169
  }
@@ -179,7 +178,11 @@ var ConstructorIO = /*#__PURE__*/function () {
179
178
  if (sessionId && !helpers.canUseDOM()) {
180
179
  this.options.sessionId = sessionId;
181
180
  }
182
- this.options.userId = userId;
181
+
182
+ // If User ID is passed
183
+ if ('userId' in options) {
184
+ this.options.userId = userId;
185
+ }
183
186
  }
184
187
  }
185
188
  }]);
@@ -9,7 +9,7 @@ function canUseStorage(type) {
9
9
  storage.removeItem(x);
10
10
  return true;
11
11
  } catch (e) {
12
- return e instanceof DOMException && (e.name === 'QuotaExceededError' || e.name === 'QUOTA_EXCEEDED_ERR' || e.name === 'NS_ERROR_DOM_QUOTA_REACHED' || e.toString().indexOf('QUOTA_EXCEEDED_ERR') !== -1 || e.toString().indexOf('QuotaExceededError') !== -1) && storage && storage.length !== 0;
12
+ return typeof DOMException !== 'undefined' && e instanceof DOMException && (e.name === 'QuotaExceededError' || e.name === 'QUOTA_EXCEEDED_ERR' || e.name === 'NS_ERROR_DOM_QUOTA_REACHED' || e.toString().indexOf('QUOTA_EXCEEDED_ERR') !== -1 || e.toString().indexOf('QuotaExceededError') !== -1) && storage && storage.length !== 0;
13
13
  }
14
14
  }
15
15
  var session = {
package/lib/version.js CHANGED
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = void 0;
7
- var _default = '2.58.0';
7
+ var _default = '2.58.1';
8
8
  exports["default"] = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@constructor-io/constructorio-client-javascript",
3
- "version": "2.58.0",
3
+ "version": "2.58.1",
4
4
  "description": "Constructor.io JavaScript client",
5
5
  "main": "lib/constructorio.js",
6
6
  "types": "lib/types/index.d.ts",