@constructor-io/constructorio-client-javascript 2.29.3 → 2.29.4

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.
@@ -7,7 +7,7 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl
7
7
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
8
8
 
9
9
  /* eslint-disable no-unneeded-ternary */
10
- var helpers = require('../utils/helpers');
10
+ var helpers = require('./helpers');
11
11
 
12
12
  var EventDispatcher = /*#__PURE__*/function () {
13
13
  function EventDispatcher(options) {
@@ -140,12 +140,12 @@ var utils = {
140
140
  applyNetworkTimeout: function applyNetworkTimeout() {
141
141
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
142
142
  var networkParameters = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
143
- var controller = arguments.length > 2 ? arguments[2] : undefined;
143
+ var controller = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
144
144
  var optionsTimeout = options && options.networkParameters && options.networkParameters.timeout;
145
145
  var networkParametersTimeout = networkParameters && networkParameters.timeout;
146
146
  var timeout = optionsTimeout || networkParametersTimeout;
147
147
 
148
- if (typeof timeout === 'number') {
148
+ if (typeof timeout === 'number' && controller) {
149
149
  setTimeout(function () {
150
150
  return controller.abort();
151
151
  }, timeout);
@@ -7,7 +7,7 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl
7
7
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
8
8
 
9
9
  /* eslint-disable class-methods-use-this */
10
- var store = require('../utils/store');
10
+ var store = require('./store');
11
11
 
12
12
  var botList = require('./botlist');
13
13
 
@@ -11,11 +11,11 @@ var fetchPonyfill = require('fetch-ponyfill');
11
11
 
12
12
  var Promise = require('es6-promise');
13
13
 
14
- var store = require('../utils/store');
14
+ var store = require('./store');
15
15
 
16
- var HumanityCheck = require('../utils/humanity-check');
16
+ var HumanityCheck = require('./humanity-check');
17
17
 
18
- var helpers = require('../utils/helpers');
18
+ var helpers = require('./helpers');
19
19
 
20
20
  var storageKey = '_constructorio_requests';
21
21
  var requestTTL = 180000; // 3 minutes in milliseconds
@@ -47,7 +47,7 @@ var RequestQueue = /*#__PURE__*/function () {
47
47
  key: "queue",
48
48
  value: function queue(url) {
49
49
  var method = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'GET';
50
- var body = arguments.length > 2 ? arguments[2] : undefined;
50
+ var body = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
51
51
  var networkParameters = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
52
52
 
53
53
  if (this.sendTrackingEvents && !this.humanity.isBot()) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@constructor-io/constructorio-client-javascript",
3
- "version": "2.29.3",
3
+ "version": "2.29.4",
4
4
  "description": "Constructor.io JavaScript client",
5
5
  "main": "lib/constructorio.js",
6
6
  "scripts": {
@@ -44,8 +44,8 @@
44
44
  "chai-as-promised": "^7.1.1",
45
45
  "dotenv": "^8.6.0",
46
46
  "esbuild": "^0.12.28",
47
- "eslint": "^8.0.1",
48
- "eslint-config-airbnb-base": "^13.1.0",
47
+ "eslint": "^8.17.0",
48
+ "eslint-config-airbnb-base": "^15.0.0",
49
49
  "eslint-plugin-import": "^2.25.2",
50
50
  "husky": "^7.0.4",
51
51
  "jsdoc": "^3.6.7",