@constructor-io/constructorio-client-javascript 2.62.1 → 2.62.3

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.
@@ -14,7 +14,7 @@ var HumanityCheck = /*#__PURE__*/function () {
14
14
  var _this = this;
15
15
  (0, _classCallCheck2["default"])(this, HumanityCheck);
16
16
  // Check if a human event has been performed in the past
17
- this.hasPerformedHumanEvent = !!store.session.get(storageKey) || false;
17
+ this.hasPerformedHumanEvent = this.getIsHumanFromSessionStorage();
18
18
 
19
19
  // Humanity proved, remove handlers
20
20
  var remove = function remove() {
@@ -33,11 +33,18 @@ var HumanityCheck = /*#__PURE__*/function () {
33
33
  }
34
34
  }
35
35
 
36
- // Return boolean indicating if user is a bot
37
- // ...if it has a bot-like useragent
38
- // ...or uses webdriver
39
- // ...or has not performed a human event
36
+ // Helper function to grab the human variable from session storage
40
37
  (0, _createClass2["default"])(HumanityCheck, [{
38
+ key: "getIsHumanFromSessionStorage",
39
+ value: function getIsHumanFromSessionStorage() {
40
+ return !!store.session.get(storageKey) || false;
41
+ }
42
+
43
+ // Return boolean indicating if user is a bot
44
+ // ...if it has a bot-like useragent
45
+ // ...or uses webdriver
46
+ // ...or has not performed a human event
47
+ }, {
41
48
  key: "isBot",
42
49
  value: function isBot() {
43
50
  var _helpers$getNavigator = helpers.getNavigator(),
@@ -51,7 +58,7 @@ var HumanityCheck = /*#__PURE__*/function () {
51
58
  }
52
59
 
53
60
  // If the user hasn't performed a human event, it indicates it is a bot
54
- if (!this.hasPerformedHumanEvent) {
61
+ if (!this.getIsHumanFromSessionStorage()) {
55
62
  return true;
56
63
  }
57
64
 
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.62.1';
7
+ var _default = '2.62.3';
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.62.1",
3
+ "version": "2.62.3",
4
4
  "description": "Constructor.io JavaScript client",
5
5
  "main": "lib/constructorio.js",
6
6
  "types": "lib/types/index.d.ts",
@@ -56,7 +56,7 @@
56
56
  "chai-as-promised": "^7.1.1",
57
57
  "docdash": "^2.0.1",
58
58
  "dotenv": "^8.6.0",
59
- "esbuild": "^0.12.28",
59
+ "esbuild": "^0.25.0",
60
60
  "eslint": "^8.17.0",
61
61
  "eslint-config-airbnb-base": "^15.0.0",
62
62
  "eslint-plugin-import": "^2.25.2",
@@ -66,7 +66,7 @@
66
66
  "jsdom": "^16.7.0",
67
67
  "license-checker": "^25.0.1",
68
68
  "lodash.clonedeep": "^4.5.0",
69
- "mocha": "^9.1.3",
69
+ "mocha": "^11.1.0",
70
70
  "nyc": "^15.1.0",
71
71
  "qs": "^6.11.0",
72
72
  "sinon": "^7.5.0",