rudder-sdk-js 2.4.1 → 2.4.2

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.
Files changed (2) hide show
  1. package/index.js +23 -14
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -4829,7 +4829,7 @@
4829
4829
 
4830
4830
  // Reserved Keywords for properties/traits
4831
4831
  var ReservedPropertyKeywords = ["anonymous_id", "id", "sent_at", "received_at", "timestamp", "original_timestamp", "event_text", "event"]; // ECommerce Parameter Names Enumeration
4832
- var CONFIG_URL = "https://api.rudderlabs.com/sourceConfig/?p=npm&v=2.4.1";
4832
+ var CONFIG_URL = "https://api.rudderlabs.com/sourceConfig/?p=npm&v=2.4.2";
4833
4833
  var CDN_INT_DIR = "js-integrations";
4834
4834
  var DEST_SDK_BASE_URL = "https://cdn.rudderlabs.com/v1.1/".concat(CDN_INT_DIR);
4835
4835
  var MAX_WAIT_FOR_INTEGRATION_LOAD = 10000;
@@ -11535,7 +11535,7 @@
11535
11535
  this.build = "1.0.0";
11536
11536
  this.name = "RudderLabs JavaScript SDK";
11537
11537
  this.namespace = "com.rudderlabs.javascript";
11538
- this.version = "2.4.1";
11538
+ this.version = "2.4.2";
11539
11539
  });
11540
11540
 
11541
11541
  /* eslint-disable max-classes-per-file */
@@ -11544,7 +11544,7 @@
11544
11544
  _classCallCheck(this, RudderLibraryInfo);
11545
11545
 
11546
11546
  this.name = "RudderLabs JavaScript SDK";
11547
- this.version = "2.4.1";
11547
+ this.version = "2.4.2";
11548
11548
  }); // Operating System information class
11549
11549
 
11550
11550
 
@@ -11960,8 +11960,8 @@
11960
11960
  */
11961
11961
  var byteToHex = [];
11962
11962
 
11963
- for (var i = 0; i < 256; ++i) {
11964
- byteToHex[i] = (i + 0x100).toString(16).substr(1);
11963
+ for (var i$1 = 0; i$1 < 256; ++i$1) {
11964
+ byteToHex[i$1] = (i$1 + 0x100).toString(16).substr(1);
11965
11965
  }
11966
11966
 
11967
11967
  function bytesToUuid$2(buf, offset) {
@@ -14869,21 +14869,30 @@
14869
14869
 
14870
14870
  instance.registerCallbacks(false);
14871
14871
  var defaultMethod = "load";
14872
- var argumentsArray = window.rudderanalytics || []; // Skip all the methods queued prior to the 'defaultMethod'
14872
+ var argumentsArray = window.rudderanalytics;
14873
+ var isValidArgsArray = Array.isArray(argumentsArray);
14873
14874
 
14874
- while (argumentsArray.length > 0) {
14875
- if (argumentsArray[0][0] === defaultMethod) {
14876
- instance.toBeProcessedArray.push(argumentsArray[0]);
14877
- argumentsArray.shift();
14878
- break;
14879
- }
14875
+ if (isValidArgsArray) {
14876
+ /**
14877
+ * Iterate the buffered API calls until we find load call and
14878
+ * queue it first for processing
14879
+ */
14880
+ var i = 0;
14880
14881
 
14881
- argumentsArray.shift();
14882
+ while (i < argumentsArray.length) {
14883
+ if (argumentsArray[i] && argumentsArray[i][0] === defaultMethod) {
14884
+ instance.toBeProcessedArray.push(argumentsArray[i]);
14885
+ argumentsArray.splice(i, 1);
14886
+ break;
14887
+ }
14888
+
14889
+ i += 1;
14890
+ }
14882
14891
  } // parse querystring of the page url to send events
14883
14892
 
14884
14893
 
14885
14894
  parseQueryString(window.location.search);
14886
- if (Array.isArray(argumentsArray)) argumentsArray.forEach(function (x) {
14895
+ if (isValidArgsArray) argumentsArray.forEach(function (x) {
14887
14896
  return instance.toBeProcessedArray.push(x);
14888
14897
  });
14889
14898
  processDataInAnalyticsArray(instance);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rudder-sdk-js",
3
- "version": "2.4.1",
3
+ "version": "2.4.2",
4
4
  "description": "RudderStack Javascript SDK",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",